You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
422 B
C++

#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d, t;
while (~scanf("%d%d%d%d", &a, &b, &c, &d) && ~a && ~b && ~c && ~d)
printf("Case %d: the next triple peak occurs in %d days.\n", ++t,
(5544 * a + 14421 * b + 1288 * c - d + 21252 + 21251) % 21252 + 1);
return 0;
}