2905. Finance

单点时限: 5.0 sec

内存限制: 256 MB

The Big Boss Company (BBC) principal is going to prepare a vacation schedule for the next year. Each employee of BBC gets a four-week vacation each year. A vacation can be divided into several parts. Each part consists of several weeks. The parts are separated by at least one work week.

According to the law, the pay for each vacation part is calculated separately from the others as follows. Consider the employee’s salary for the period of 52 weeks preceding the current part of the vacation and divide it by 52. (A year is assumed to consist of exactly 52 weeks.) All vacation pays during these 52 weeks are ignored for the purpose of salary calculation. The result is multiplied by the number of weeks in this part of the vacation (ranging from 1 to 4).

Given the vacation schedules for the current year, you should help the BBC principal to construct the next year’s schedule that minimizes the total vacation pay costs. Since the pays for distinct employees are unrelated you are to solve the problem assuming that there is only one employee.

输入格式

The input contains four integers listed in the ascending order giving the vacation weeks in the current year’s schedule. Weeks are specified by numbers ranging from $1$ to $52$.

输出格式

Output the numbers of vacation weeks for the next year in the ascending order. The vacation schedule should minimize the vacation pay costs. If there are several equivalent solutions, output any of them.

样例

Input
2 3 20 21
Output
1 2 3 5

提示

The calculation of the pay for the first part considers 52 − 4 = 48 work weeks while the calculation of the second part considers 52 − 5 = 47 work weeks.

20 人解决,25 人已尝试。

22 份提交通过,共有 58 份提交。

4.6 EMB 奖励。

创建: 13 年,7 月前.

修改: 6 年,11 月前.

最后提交: 1 年,5 月前.

来源: N/A

题目标签