HDU 4952 Number Transformation 数论
来源:互联网 发布:linux grep命令 递归 编辑:程序博客网 时间:2024/06/18 05:06
点击打开链接题目链接
Number Transformation
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 308 Accepted Submission(s): 139
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>#include<string.h>#include<math.h>__int64 x;__int64 k;__int64 y;int main(){ int cas=0; while(scanf("%I64d %I64d",&x,&k)!=EOF&&(x||k)) { __int64 i,sum; for(i=1;i<k;i++) { y=x-(x/(i+1)); if(x==y) { break; } x=y; } sum=x*k; printf("Case #%d: %I64d\n",++cas,sum); } return 0;}
0 0
- hdu 4952 Number Transformation(数论)
- HDU 4952 Number Transformation 数论
- 【数论】HDU 4952 Number Transformation
- hdu 4952 Number Transformation 多校八 数论
- HDU - 4952 Number Transformation
- HDU 4952 Number Transformation
- hdu 4952 Number Transformation
- hdu 4952 Number Transformation
- hdu 4952Number Transformation
- hdu 4952 Number Transformation
- hdu 4952 Number Transformation
- Hdu 4952 Number Transformation
- 数论 Number Transformation HDU4952
- HDU 4952 Number Transformation(公式)
- hdu 4952 Number Transformation(数学)
- BZOJ 3858 Number Transformation 数论
- HDU 4952 Number Transformation 规律题
- HDU 4952Number Transformation(找规律)
- springMVC源码下载
- UVa 11538 - Chess Queen (组合数学)
- editplus创建时候的几个注意事项
- 线段树模板
- day01
- HDU 4952 Number Transformation 数论
- Hdu4952 - Number Transformation - 数论(2014 Multi-University Training Contest 8)
- 第五天-8.14
- 利用java序列化进行对象深Clone
- HDU 4950 Monster
- 一元多项式的表示及相加
- HDU 1285 确定比赛名次
- VMWare
- OC 内存管理