fork download
  1. //----------------------- CODE BY AKASH,MMMUT,GORAKHPUR----------------//
  2.  
  3. /* Don't try to copy it!
  4. nhi too,
  5. goli maar ke chheed Kar dalunga...;););)
  6.  
  7.  
  8. _/?\_
  9. (?`_ยด)
  10. <,?---?- - - - - - - - => - => - =>
  11. _/?\_
  12.  
  13. */
  14.  
  15.  
  16. #include<bits/stdc++.h>
  17. using namespace std;
  18. #define ll long long
  19. #define ull unsigned long long
  20. #define mod 1000000007
  21. #define f(i,a,b) for(ll i=a;i<b;i++)
  22. #define imultiset multiset<ll>ms1
  23. #define dmultiset multiset<ll,greater<ll>>ms2
  24. #define itr multiset<ll>::iterator it
  25. #define dpqueue priority_queue<ll>d_pq
  26. #define ipqueue priority_queue<ll,vector<ll>,greater<ll>>i_pq
  27. #define pdpqueue priority_queue<pair<int,int>>pair_d_pq
  28. #define pipqueue priority_queue<pair<ll,ll>,vector<pair<ll,ll>>,greater<pair<ll,ll>>pair_i_pq
  29. #define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
  30. int main()
  31. {
  32. FAST;
  33. ll t,x; cin>>t;
  34. while(t--)
  35. {
  36. ll n,m,k,j;
  37. cin>>n>>m>>k;
  38. if(n==1 && m==1)
  39. {
  40. cout<<k+2<<endl;
  41. continue;
  42. }
  43. ll ans=k+2;
  44. for( j=k+3;j<k+n+m;j++)
  45. {
  46. ans=ans^j;
  47. ans=ans^j;
  48. }
  49. ans=ans^j;
  50. cout<<ans<<endl;
  51. }
  52. }
  53.  
  54.  
  55.  
  56.  
Success #stdin #stdout 0s 4804KB
stdin
2
2 2 5
2 3 7
stdout
14
5