原题

中国剩余定理板子题,详情参见百度百科
//此处5544,14421,1288为预先求好的M/m[i]在m[i]意义下的逆元

#include<cstdio>
#define MAX 21252
using namespace std;
int p,e,i,d,n,count;

int main()
{
    while(~scanf("%d%d%d%d",&p,&e,&i,&d))
    {
	count++;
	if(p==-1 && e==-1 && i==-1 && d==-1) break;
	n=(5544*p+14421*e+1288*i-d)%MAX;
	if (n<=0) n+=MAX;
	printf("Case %d: the next triple peak occurs in %d days.\n",count,n);
    }
    return 0;
}

相关文章:

  • 2022-01-11
  • 2022-02-07
  • 2021-08-18
  • 2021-08-11
  • 2022-01-17
  • 2021-11-10
  • 2022-02-23
  • 2022-12-23
猜你喜欢
  • 2021-06-06
  • 2021-10-02
  • 2021-10-11
  • 2022-12-23
  • 2022-01-17
相关资源
相似解决方案