#include<bits/stdc++.h>
using namespace std;
int main()
{
int t, d, m, y, q, i;
cin >> t;
for(i=1;i<=t;i++)
{
cin >> d >> m >> y >> q;
if(d == 29 && m == 2)
{
int c = 0;
while(y <= q)
{
y += 4;
if((y%400 == 0 || (y%100 != 0 && y%4 == 0)) && y <= q)
{
c++;
}
}
cout << "Case " << i << ": " << c << endl;
}
else
{
int c = q - y;
cout << "Case " << i << ": " << c << endl;
}
}
return 0;
}
using namespace std;
int main()
{
int t, d, m, y, q, i;
cin >> t;
for(i=1;i<=t;i++)
{
cin >> d >> m >> y >> q;
if(d == 29 && m == 2)
{
int c = 0;
while(y <= q)
{
y += 4;
if((y%400 == 0 || (y%100 != 0 && y%4 == 0)) && y <= q)
{
c++;
}
}
cout << "Case " << i << ": " << c << endl;
}
else
{
int c = q - y;
cout << "Case " << i << ": " << c << endl;
}
}
return 0;
}
Comments
Post a Comment