HDU 6124 Euler theorem【】

来源:互联网 发布:用工作站玩游戏知乎 编辑:程序博客网 时间:2024/05/17 21:43

Euler theorem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 292    Accepted Submission(s): 244


Problem Description
HazelFan is given two positive integers a,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 integer T(1T5), denoting the number of test cases.
For each test case:
A single line contains a positive integer a(1a109).
 

Output
For each test case:
A single line contains a nonnegative integer, denoting the answer.
 

Sample Input
213
 

Sample Output
23
 

Source
2017 Multi-University Training Contest - Team 7
 



#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<cmath>#include<queue>#include<stack>#include<vector>#include<map>#include<set>#include<algorithm>using namespace std;#define ll long long#define ms(a,b)  memset(a,b,sizeof(a))const int M=1e5+10;const int MM=2e3+10;const int inf=0x3f3f3f3f;const int mod=1e9+7;;const double eps=1e-8;int n,m;int main(){    int t;    scanf("%d",&t);    while(t--){        scanf("%d",&n);        printf("%d\n",(n-1)/2+2);    }    return 0;}


原创粉丝点击