Analysis of C/C++ (level eight) real questions in December 2022#中国电子学院#National Youth Software Programming Level Examination

Insert image description here

C/C++ Programming (Levels 1~8) All real questions・Click here

Question 1: Menstrual cycle

Humans are born with three physiological cycles, namely physical, emotional and intellectual cycles. Their cycle lengths are 23 days, 28 days and 33 days. One day in each cycle is the peak. On the peak day, people will perform well in corresponding aspects. For example, at the peak of the intelligence cycle, people will think quickly and be highly concentrated. Because the circumferences of the three cycles are different, the peaks of the three cycles usually do not fall on the same day. For everyone, we want to know when the three peaks fall on the same day. For each period, we give the number of days from the first day of the current year to the peak (not necessarily the time of the first peak). Your task is to be given a number of days starting from the first day of the year, and output the time (the number of days from the given time) when the next three peaks fall on the same day starting from the given time (not including the given time). For example: given a time of 10, the next time three peaks occur on the same day is 12, then the output is 2 (note that this is not 3).
Time limit: 1000
Memory limit: 65536
Input
One line, containing four integers: p, e, i and d. Two adjacent integers are separated by a single space. p, e, and i represent the time when physical, emotional, and intellectual peaks appear respectively (time is calculated from the first day of the year). d is the given time,

Guess you like

Origin blog.csdn.net/gozhuyinglong/article/details/132677091