#include <stdio.h>
int main(int ac, char**av)
{
int a23 = 28 * 33 * 6;
int a28 = 23 * 33 * 19;
int a33 = 23 * 28 * 2;
int a, b, c, s;
int i = 1;
while (scanf("%d %d %d %d", &a, &b, &c, &s))
{
if (a == -1 || b == -1 )
return 0;
int x = a23 * a + a28 * b + a33 * c + (s / 21252 + 1) * 21252;
x = x - s;
x %= 21252;
if (x == 0)
x = 21252;
printf("Case %d: the next triple peak occurs in %d days.\n",
i++, x);
}
return 0;
}
1006
最新推荐文章于 2024-10-08 18:22:12 发布