B - Euler theorem 數學
阿新 • • 發佈:2017-08-19
cstring fine choice output n) ring printf sub for
直接打表找規律
HazelFan is given two positive integers a,ba,b, and he wants to calculate amodbamodb. But now he forgets the value of bb and only remember the value of aa, please tell him the number of different possible results.InputThe first line contains a positive integer T(1≤T≤5)T(1≤T≤5), denoting the number of test cases.
For each test case:
A single line contains a positive integer a(1≤a≤109)a(1≤a≤109).OutputFor each test case:
A single line contains a nonnegative integer, denoting the answer.
Sample Input
2 1 3
Sample Output
2 3
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<sstream> #include<algorithm> #include<queue> #include<deque> #include<iomanip> #include<vector> #include<cmath> #include<map> #include<stack> #include<set> #include<memory> #include<list> #include<string> using namespace std; typedef long long LL; typedef unsigned long longULL; #define MAXN 1009 #define L 31 #define INF 1000000009 #define eps 0.00000001 LL n; int main() { int T; scanf("%d", &T); while (T--) { scanf("%lld", &n); if (n & 1) n++; printf("%lld\n", n / 2 + 1); } }
B - Euler theorem 數學