#P4956. Arctic Expedition Savings

    ID: 18196 Type: Default 1000ms 256MiB

Arctic Expedition Savings

Arctic Expedition Savings

Davor is preparing for an Arctic expedition after conquering the South Pole. He plans to save money during 52 weeks (from 1 January 2018 to 30 December 2018) by depositing different amounts each day of the week. On Monday he deposits X kunas, on Tuesday X+K kunas, on Wednesday X+2K, and so on until Sunday when he deposits X+6K kunas. Thus, the total amount saved over 52 weeks is given by the formula

$$52\times(7X+21K)=364X+1092K=N$$

Given the total amount N that Davor wishes to collect, determine the values of X and K such that exactly N kunas is collected. Note that X must be at most 100, and if there are multiple solutions, you should output the one with the greatest X (and consequently, the smallest K). It is guaranteed that a solution exists.

inputFormat

The input consists of a single integer N, representing the total amount of money (in kunas) that Davor needs to collect.

outputFormat

Output two integers X and K separated by a space, where X is the deposit on Monday (with X ≤ 100) and K is the daily increment for the rest of the week.

sample

3640
10 0

</p>