fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. long long int t,i,n,x,y;
  5. scanf("%lld",&t);
  6. while(t--)
  7. {
  8. n=-1;
  9. scanf("%lld%lld",&x,&y);
  10. if(x==y)
  11. {
  12. i=x/2;
  13. if(x%2==0)
  14. n=i*4;
  15. else
  16. n=1+i*4;
  17. }
  18. else if(x-y==2)
  19. {
  20. i=y/2;
  21. if(y%2==0)
  22. n=2+i*4;
  23. else
  24. n=3+i*4;
  25. }
  26. if(n==-1)
  27. printf("No Number\n");
  28. else
  29. printf("%lld\n",n);
  30. }
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0s 2116KB
stdin
6
0 0
1 1 
2 0
3 1
2 2
3 3
stdout
0
1
2
3
4
5