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

建议使用的浏览器:

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

2864:“Base B”

题目描述
AekdyCoin is so fond of math.He loves Number.He knows how to express a non-negative number into P base.Say,he knows that the number 71 in 2 Base is exactly “1000111”. But AekdyCoin doesn’t think it’s a proper way to express a number.AekdyCoin want to creat the “Base B”,whose digits’ value is not only equal or larger than A,but also smaller than A+B.For example,if A = 1,B = 5,then AekdyCoin could express number 65 in “Base 5” ,it is “225” definitely .(But Not “230”,0 is out of the range [1,5]!)
AekdyCoin is quite exciting about his “invention”,now he hopes that you could write a program for him which could help him to express a number in “Base B”.
输入解释
The input consists of several test cases.

Every case has only three integers indicating N,A,B (0<=N<=10^9,0<=A<=100,2<=B<=100)
输出解释
For each case,you should output “Case x:” first where x is the case index.(x>=1).
  Then output the expression in “Base B”,if the number of digit is more than one,you should split them with exactly one ‘ ‘.
  We guarantee there is always a solution.
输入样例
65 1 5
15 0 2
输出样例
Case 1: 2 2 5
Case 2: 1 1 1 1
提示
Hint:
In case 1, 65 = 2 * 5^2 + 2 * 5 + 5 * 1,and all digits are in the range[1,5].
来自杭电HDUOJ的附加信息
Recommend gaojie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2864

最后修改于 2020-10-25T22:57:36+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)