mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
593 B
C++
25 lines
593 B
C++
#include<stdio.h>
|
|
int main()
|
|
{ int p,e,i,d,n,T;
|
|
int j,k;
|
|
scanf("%d",&T);
|
|
while(T--)
|
|
{ j=1;
|
|
getchar();
|
|
while(scanf("%d%d%d%d",&p,&e,&i,&d)!=EOF)
|
|
{
|
|
if(p==-1&&e==-1&&i==-1&&d==-1)
|
|
break;
|
|
else
|
|
{ n=( 5544*p+14421*e+1288*i-d+21252)%21252;
|
|
if(n==0)
|
|
n=21252;
|
|
printf("Case %d: the next triple peak occurs in %d days.\n",j++,n);
|
|
}
|
|
}
|
|
if(T!=0)
|
|
printf("\n");
|
|
}
|
|
return 0;
|
|
}
|