#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t, n, m, i = 1;
cin >> t;
while(t--)
{
cin >> n >> m;
n--;
ll r1 = (n/3)*2;
if(n%3 == 2)
r1 += 1;
ll r2 = (m/3)*2;
if(m%3 == 2)
r2 += 1;
cout << "Case " << i++ << ": " << r2-r1 << "\n";
}
return 0;
}
#define ll long long int
using namespace std;
int main()
{
ll t, n, m, i = 1;
cin >> t;
while(t--)
{
cin >> n >> m;
n--;
ll r1 = (n/3)*2;
if(n%3 == 2)
r1 += 1;
ll r2 = (m/3)*2;
if(m%3 == 2)
r2 += 1;
cout << "Case " << i++ << ": " << r2-r1 << "\n";
}
return 0;
}
Comments
Post a Comment