Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fast()(ios_base::sync_with_stdio(false),cin.tie(NULL));
- typedef long long ll;
- int main()
- {
- ll test;
- cin>>test;
- for(ll t=1;t<=test;t++)
- {
- ll a,b,c,d,e,f;
- cin>>a>>b;
- c=a/3;
- if(a%3!=0)c++;
- d=b/3;
- if(b%3!=0)d++;
- e=(d-c)*2+2;
- if(a%3==0)e--;
- if(b%3==1)e-=2;
- if(b%3==2)e--;
- cout<<"Case "<<t<<": "<<e<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement