#J0063. 【深基4.习10】[COCI2017-2018#6] Davor

【深基4.习10】[COCI2017-2018#6] Davor

If we know the amount of money ​N​, output the values ​X and ​K so that it is possible to collect the ​exact money amount in the given timespan. The solution will always exist, and if there are multiple, output the one with the greatest ​X ​ and smallest ​K ​.

输入格式

The first line of input contains the integer ​N​ (1456 ≤ ​N​ ≤ 145600), the number from the task.

输出格式

The first line of output must contain the value of ​X (​0 < ​X ​≤ 100 ​)​, and the second the value of K (K ​> 0 ​)​.

题目大意

在征服南极之后,Davor 开始了一项新的挑战。下一步是在西伯利亚、格林兰、挪威的北极圈远征。他将在 2018201812123131 日开始出发,在这之前需要一共筹集 nn 元钱。他打算在每个星期一筹集 xx 元,星期二筹集 x+kx+k 元,……,星期日筹集 x+6kx+6k 元,并连续筹集 5252 个星期。其中 x,kx,k 为正整数,并且满足 1x1001 \le x \le 100

现在请你帮忙计算 x,kx,k 为多少时,能刚好筹集 nn 元。

如果有多个答案,输出 xx 尽可能大,kk 尽可能小的。注意 kk 必须大于 00

1456
1
1
6188
14
1
40404
99
4