Saleh127

codeforces 1366A.cpp

Jun 11th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. #define pi acos(-1)
  7. #define yes printf("YES\n");
  8. #define no printf("NO\n");
  9. int main()
  10. {
  11. Faster
  12. test
  13. {
  14. int a,c,d,e,f,i,j,k,l;
  15. cin>>a>>c;
  16. if(a==0 || c==0) cout<<0<<endl;
  17. else if(a*2<=c || c*2<=a)
  18. {
  19. cout<<min(a,c)<<endl;
  20. }
  21. else
  22. {
  23. d=a+c;
  24. cout<<d/3<<endl;
  25. }
  26. }
  27. return 0;
  28. }
Add Comment
Please, Sign In to add comment