Advertisement
Saleh127

CF 1395A

Aug 12th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);
  7. cout.tie(0);
  8.  
  9. int t;
  10. cin>>t;
  11. while(t--)
  12. {
  13. int r,g,v,w,i,j,k,l=0,a=0,s,d;
  14. cin>>r>>g>>v>>w;
  15. if(r&1)l++;
  16. if(w&1)l++;
  17. if(v&1)l++;
  18. if(g&1)l++;
  19. if(l<=1)
  20. {
  21. cout<<"Yes"<<endl;
  22. continue;
  23. }
  24. if(r==0 || g==0 || v==0)
  25. {
  26. cout<<"No"<<endl;
  27. continue;
  28. }
  29. r-=1;
  30. v-=1;
  31. g-=1;
  32. w+=3;
  33. l=0;
  34. if(r&1)l++;
  35. if(w&1)l++;
  36. if(v&1)l++;
  37. if(g&1)l++;
  38. if(l<=1)
  39. {
  40. cout<<"Yes"<<endl;
  41. }
  42. else cout<<"No"<<endl;
  43. }
  44. return 0;
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement