#347. Biorhythms
Biorhythms
题目描述
人有三个生理周期:体力周期( 天)、感情周期( 天)和智力周期( 天),每个周期有一天是高峰。已知从当年第一天到三个高峰日的天数 ,以及一个给定的起始天数 ,求从 之后(不包含 当天)下一次三个高峰落在同一天所需的天数。
输入格式
输入多组数据,每组一行四个整数 。
当 时输入结束。
输出格式
对于每组数据,输出一行,格式为:
Case 编号: the next triple peak occurs in 天数 days.
0 0 0 0
0 0 0 100
5 20 34 325
4 5 6 7
283 102 23 320
203 301 203 40
-1 -1 -1 -1
Case 1: the next triple peak occurs in 21252 days.
Case 2: the next triple peak occurs in 21152 days.
Case 3: the next triple peak occurs in 19575 days.
Case 4: the next triple peak occurs in 16994 days.
Case 5: the next triple peak occurs in 8910 days.
Case 6: the next triple peak occurs in 10789 days.
数据规模与约定
对于全部的测试数据:
- 答案天数小于
相关
在下列比赛中: