hdu6124--Euler theorem

来源:互联网 发布:人工智能招聘岗位要求 编辑:程序博客网 时间:2024/05/19 05:05

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(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
 

分析

以为是欧拉,各种打表找规律
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;}

链接