题目:http://acm.hdu.edu.cn/showproblem.php?pid=2601
//本题考察的是整数的因子的个数, i * j + i + j =n,即为(i+1)*(j+1)=n+1,转化为了求解n+1的因子的个数
//int temp=sqrt(n);这一句放在for循环里面就会超时,真郁闷。
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int t;
__int64 n,i;
cin>>t;
while(t--)
{
int cnt=0;
scanf("%I64d",&n);
n++;
__int64 temp=sqrt(n);
for(i=2;i<=temp;i++)
{
if(n%i==0)
cnt++;
}
printf("%d\n",cnt);
}
return 0;
}