hdu6124--Euler theorem
2017-08-15 13:54
295 查看
Problem Description
HazelFan is given two positive integersa,b,
and he wants to calculate amodb.
But now he forgets the value of b
and only remember the value of a,
please tell him the number of different possible results.
Input
The first line contains a positive integerT(1≤T≤5),
denoting the number of test cases.
For each test case:
A single line contains a positive integer a(1≤a≤109).
Output
For each test case:A single line contains a nonnegative integer, denoting the answer.
Sample Input
21
3
[align=left]
[/align]
Sample Output
23
分析
以为是欧拉,各种打表找规律mmp写出前10个立刻出结果
就是(a+1)/2+1呵呵
代码
#include<cstdio> #include<iostream> using namespace std; int main() { int t; scanf("%d",&t); while(t--) { int a; scanf("%d",&a); cout<<(a+1)/2+1<<endl; } return 0; }
链接
[align=left][/align]
相关文章推荐
- 2017 Multi-University Training Contest - Team 7:hdu6124、Euler theorem
- hdu6124 Euler theorem 2017多校1005签到题
- HDU6124 Euler theorem
- HDU6124-Euler theorem
- hdu6124 Euler theorem -多校联盟7
- HDU6124-Euler theorem
- HDU6124 Euler theorem
- HDU6124 Euler theorem 签到
- 杭电 Euler theorem
- hdu 6124 Euler theorem(水题)
- HDU 6124 Euler theorem(水+思维)
- hdu 6124 Euler theorem (多校联赛)
- HDU 6124-Euler theorem
- HDU-Euler theorem(欧拉定理)
- HDU 6124 Euler theorem【】
- HDU 6124 Euler theorem(思维)
- HDU 6124 17多校7 Euler theorem(简单思维题)
- HDU6124
- HDU6124(有趣的数学题)
- HDU 6124 Euler theorem(数论)