1
0

POJ-1006.cpp 290 B

123
  1. #include <iostream>
  2. using namespace std;
  3. int main(){ios::sync_with_stdio(false);cin.tie(nullptr);long long p,e,i,d;int tc=0;while(cin>>p>>e>>i>>d&&p!=-1){long long r=(p*5544+e*14421+i*1288-d)%21252;if(r<=0)r+=21252;cout<<"Case "<<++tc<<": the next triple peak occurs in "<<r<<" days.\n";}}