http://acm.hdu.edu.cn/showproblem.php?pid=1391
#include<stdio.h>
int solve(int a,int b)
{
int s=1,i;
if(a==0)
{
if(b==0)
return 0;
return -1;
}
if(a==1)
{
if(b==1)
return 1;
return -1;
}
for(i=1;i<b;++i)
if(i&1)
s+=3;
else
s+=1;
if(a==b)
return s;
else if(a-2==b)
return s+2;
else
return -1;
}
int main()
{
int t,a,b;
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&a,&b);
a=solve(a,b);
if(a==-1)
printf("No Number\n");
else
printf("%d\n",a);
}
return 0;
}