fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. ios::sync_with_stdio(false);
  7. cin.tie(NULL);
  8. int t;
  9. cin>>t;
  10. while(t--)
  11. {
  12. int x,y;
  13. cin>>x>>y;
  14. if(y==x)
  15. {
  16. if(y%2==0)
  17. {
  18. cout<<2*y<<endl;
  19. }
  20. else cout<<2*y -1<<endl;
  21. }
  22. else if(y==(x-2))
  23. {
  24. if(y%2==0)
  25. {
  26. cout<<2*(y+1)<<endl;
  27. }
  28. else cout<<2*y +1<<endl;
  29. }
  30. else cout<<"No Number"<<endl;
  31. }
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0s 3456KB
stdin
3
4 2
6 6
3 4
stdout
6
12
No Number