Ankit_132

B

Nov 26th, 2023
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.37 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define ll     long long
  6. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  7. #define pb     push_back
  8.  
  9. int main()
  10. {
  11.     _test
  12.     {
  13.         int a, b, c, x, y, z;
  14.         cin>>a>>b>>c;
  15.  
  16.         int tmp;
  17.  
  18.         {
  19.             x = a, y = b, z = c;
  20.             tmp = min(y, z);
  21.             y -= tmp;
  22.             z -= tmp;
  23.             x += tmp;
  24.  
  25.             if(max(y, z)%2)     cout<<0<<" ";
  26.             else
  27.             {
  28.                 if(x)
  29.                     cout<<1<<" ";
  30.                 else
  31.                     cout<<0<<" ";
  32.             }
  33.         }
  34.  
  35.         {
  36.             x = b, y = a, z = c;
  37.             tmp = min(y, z);
  38.             y -= tmp;
  39.             z -= tmp;
  40.             x += tmp;
  41.  
  42.             if(max(y, z)%2)     cout<<0<<" ";
  43.             else
  44.             {
  45.                 if(x)
  46.                     cout<<1<<" ";
  47.                 else
  48.                     cout<<0<<" ";
  49.             }
  50.         }
  51.  
  52.         {
  53.             x = c, y = b, z = a;
  54.             tmp = min(y, z);
  55.             y -= tmp;
  56.             z -= tmp;
  57.             x += tmp;
  58.  
  59.             if(max(y, z)%2)     cout<<0<<" ";
  60.             else
  61.             {
  62.                 if(x)
  63.                     cout<<1<<" ";
  64.                 else
  65.                     cout<<0<<" ";
  66.             }
  67.         }
  68.  
  69.         cout<<"\n";
  70.     }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment