#GYM104614F. It's About Time
It's About Time
Description
Greg Orian works for the Temporal Innovations for Multiple Earths (TIME) program. One of his main jobs is determining yearly calendars for the numerous human colonies on various planets (did we mention this problem takes place in $2123$?). One issue when creating calendars is the schedule for leap days. On GoE (Good ol' Earth) the rules for leap years are the following:
- Any year divisible by $4$ is a leap year, unless
- the year is divisible by $100$ in which case the year is not a leap year, unless
- the year is divisible by $400$ in which case the year is a leap year.
While this works fine for GoE, it obviously won't work for planets with different tropical years. The colonists have enough to adjust to already (lower oxygen levels, colonial in-fighting, people-eating plants, etc.) so Greg wants to come up with rules that are similar to the ones for GoE. He's hit on the following scheme for finding three values $n_1$, $n_2$ and $n_3$ for determining when a year is a leap year:
- The number of days $d$ in a non-leap year is the number of days in a tropical year, rounded to the nearest integer. If the fractional number of days is exactly $0.5$, round the number of days up.
- If you rounded the tropical year down then
- every year divisible by $n_1 > 1$ is a leap year (i.e., you add $1$ day that year), unless
- the year is divisible by $n_2$ (where $n_1 < n_2$ and $n_2$ is a multiple of $n_1$) in which case the year is not a leap year, unless
- the year is divisible by $n_3$ (where $n_2 < n_3 \leq 1\,000$ and $n_3$ is a multiple of $n_2$) in which case the year is a leap year.
- If you rounded the tropical year up then the same rules apply except that you subtract $1$ day from leap years instead of adding $1$ (would these be leak years?).
Input contains a single line with three positive integers $r$ $s$ $h$ where $r \leq 1\,000\,000\,000$ is the distance in miles of the planet from the sun, $s \leq 1\,000\,000$ is the speed the planet travels in miles/hour, and $h \leq 1\,000$ is the number of hours in the planet's day. The length of a tropical year is guaranteed to be at least one day ($h$ hours) in length.
Output the values $n_1$ $n_2$ $n_3$ as described above. It there are multiple values that give the same best approximation, then output any of them.
Input
Input contains a single line with three positive integers $r$ $s$ $h$ where $r \leq 1\,000\,000\,000$ is the distance in miles of the planet from the sun, $s \leq 1\,000\,000$ is the speed the planet travels in miles/hour, and $h \leq 1\,000$ is the number of hours in the planet's day. The length of a tropical year is guaranteed to be at least one day ($h$ hours) in length.
Output
Output the values $n_1$ $n_2$ $n_3$ as described above. It there are multiple values that give the same best approximation, then output any of them.
92998938 66660 24
92998938 66660 25
4 100 400
2 6 30