Advertisement
jakaria_hossain

codechef - another card game problem

Aug 10th, 2020
1,111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. #define fast() (ios_base::sync_with_stdio(0),cin.tie(NULL));
  5. int main()
  6. {
  7.     fast();
  8.     int t;
  9.     cin>>t;
  10.     while(t--)
  11.     {
  12.         int pc,pr,cc=1,cr=1;
  13.         cin>>pc>>pr;
  14.         cc=pc/9;
  15.         if(pc%9>0)cc++;
  16.         cr=pr/9;
  17.         if(pr%9>0)cr++;
  18.         if(cr<=cc)
  19.         {
  20.             cout<<"1 "<<cr<<endl;
  21.         }
  22.         else cout<<"0 "<<cc<<endl;
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement