#P9748. [CSP-J 2023] 小苹果
[CSP-J 2023] 小苹果
Problem Description
There are apples on Little Y’s desk, arranged in a row from left to right, numbered from to .
Xiao Bao is Little Y’s good friend. Every day, she takes away some apples.
Each day, when taking apples, Xiao Bao always starts from the leftmost (the st) apple, and then takes apple for every apples (i.e., she takes the st, th, th, ... in the current row). After that, Xiao Bao rearranges the remaining apples into a row again in the original order.
Xiao Bao wants to know: how many days does it take to take away all the apples, and on which day is the apple numbered taken away?
Input Format
The first line contains a positive integer , representing the total number of apples.
Output Format
Output one line containing two positive integers, separated by a space, representing the number of days needed for Xiao Bao to take away all the apples, and the day on which the apple numbered is taken away.
8
5 5
Hint
[Sample Explanation]
There are apples on Xiao Bao’s desk in total.
On day , Xiao Bao takes away apples numbered , , and .
On day , Xiao Bao takes away apples numbered and .
On day , Xiao Bao takes away the apple numbered .
On day , Xiao Bao takes away the apple numbered .
On day , Xiao Bao takes away the apple numbered .
[Sample ]
See apple/apple2.in and apple/apple2.ans in the contestant directory.
[Constraints]
For all testdata: .
| Test Point | Special Property | |
|---|---|---|
| None | ||
| Yes | ||
| None | ||
Special property: Xiao Bao takes away the apple numbered on the first day.
Translated by ChatGPT 5