码迷,mamicode.com
首页 > 其他好文 > 详细

B - Euler theorem 数学

时间:2017-08-19 10:58:51      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:hspa   algo   elf   list   --   iostream   sign   algorithm   row   

直接打表找规律

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 数学

标签:hspa   algo   elf   list   --   iostream   sign   algorithm   row   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!