HDU4952:Number Transformation
来源:互联网 发布:淘宝网宝贝卖点怎么写 编辑:程序博客网 时间:2024/06/11 09:03
Problem Description
Teacher Mai has an integer x.
He does the following operations k times. In the i-th operation, x becomes the least integer no less than x, which is the multiple of i.
He wants to know what is the number x now.
He does the following operations k times. In the i-th operation, x becomes the least integer no less than x, which is the multiple of i.
He wants to know what is the number x now.
Input
There are multiple test cases, terminated by a line "0 0".
For each test case, the only one line contains two integers x,k(1<=x<=10^10, 1<=k<=10^10).
For each test case, the only one line contains two integers x,k(1<=x<=10^10, 1<=k<=10^10).
Output
For each test case, output one line "Case #k: x", where k is the case number counting from 1.
Sample Input
2520 102520 200 0
Sample Output
Case #1: 2520Case #2: 2600找规律= =#include <stdio.h>int main(){ __int64 a,b,cas=1,i,j; while(~scanf("%I64d%I64d",&a,&b),a+b) { i=2; while(i<=b) { if(a%i) { j=a/i+1; if(j<=i) { a=j*b; break; } a=i*j; } else { j=a/i; if(j<=i) { a=j*b; break; } } i++; } printf("Case #%I64d: %I64d\n",cas++,a); } return 0;}
0 0
- HDU4952-Number Transformation
- 【HDU4952】Number Transformation(数学)
- HDU4952:Number Transformation
- 数论 Number Transformation HDU4952
- 【HDU4952】Number Transformation(数学)
- hdu4952-规律&脑洞-Number Transformation
- hdu4952 Number Transformation(数学题 | 找规律)
- Hdu4952 - Number Transformation - 数论(2014 Multi-University Training Contest 8)
- HDU4952
- Number Transformation
- Number Transformation
- Number Transformation
- HDU - 4952 Number Transformation
- HDU 4952 Number Transformation
- HDOJ 4952 Number Transformation
- hdu 4952 Number Transformation
- hdu 4952 Number Transformation
- hdu 4952Number Transformation
- 在Linux下分析 C程序的性能
- php设计模式笔记:单例模式
- 关于CEGUI的几点不解
- linux shell 动态生成 数组系列 seq使用技巧
- 关于.Net中,在数据绑定日期格式的问题
- HDU4952:Number Transformation
- php分页笔记
- Spring3.1返回Json时格式化日期Date
- jquery中 $ 和 jQuery 及 $() 的区别
- 健身图片
- Android自定义View的实现小结
- Nutz获取ActionContext
- hadoop中 Incompatible namespaceID for journal Storage Directory 异常的处理方法
- Android知识点摘要