首页 > 其他 > 详细

B - Euler theorem 数学

时间:2017-08-19 10:02:17      阅读:181      评论:0      收藏:0      [点我收藏+]

直接打表找规律

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(1T5)T(1≤T≤5), denoting the number of test cases. 
For each test case: 
A single line contains a positive integer a(1a109)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 long ULL;
#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 数学

原文:http://www.cnblogs.com/joeylee97/p/7395316.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!