#include<iostream>
using namespace std;
typedef unsigned int ll;
ll calc(ll k)
{
return (k / 3) * 2 + (k % 3 == 2 ? 1 : 0);
}
int main()
{
int t, cas = 0;
ll a, b;
cin >> t;
while (t--)
{
cin >> a >> b;
cout << "Case " << ++cas << ": " << (calc(b) - calc(a - 1)) << endl;
}
return 0;
}
using namespace std;
typedef unsigned int ll;
ll calc(ll k)
{
return (k / 3) * 2 + (k % 3 == 2 ? 1 : 0);
}
int main()
{
int t, cas = 0;
ll a, b;
cin >> t;
while (t--)
{
cin >> a >> b;
cout << "Case " << ++cas << ": " << (calc(b) - calc(a - 1)) << endl;
}
return 0;
}
ahmed shuvo969
প্লিজ, থিওরিটা এক্সপ্লেইন করবেন ?
উত্তরমুছুন