当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7404:Cakes

题目描述
There is a party in the Shanghai Polytechnic University. There are infinitely many cakes each student can have. Each cake is a square with an integer side length (in cm). There are infinitely many cakes of every possible integer side length in the party and cakes all have the same depth, so it’s enough of you to only consider the areas.
You are intended to eat one or more cakes that have a total combined area of exactly N cm2. But, due to your health-conscious, you need to eat as few cakes as possible. Please calculate the minimum number of cakes you can eat.

输入解释
The input starts with one line containing one integer T, which is the number of test cases. T test cases follow. Each case consists of one line with one integer N, which is the exact total cake area that you want to eat.
输出解释
For each test case, output one line containing Case #t: ans, where t is the test case number and ans is the minimum number of cakes that you can eat. Be sure that the exact total area is N.
输入样例
3
3
4
5
输出样例
Case #1: 3
Case #2: 1
Case #3: 2
提示
1 ≤ T ≤ 100 1 ≤ N ≤ 10000

该题目包含在题集 SSPU新生赛

共提交 27

通过率 44.44%
时间上限 内存上限
1000 MS 128 MB