Generous Vasya
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Vasya took n apples to school. At the break, he divided his apples among himself and k friends so that everyone would get an equal share. If there were apples, then Vasya ate them, and left his share. At the next breaks, the boy repeated his actions. How many lessons did Vasya have and how many apples did he eat if there were no apples left after the last lesson? The school day begins and ends with a lesson.
Input
Two integers n (1 ≤ n ≤ 10^9
) and k (1 ≤ k ≤ 100).
Output
Print the number of the lessons and the number of apples that Vasya ate.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 1K
Acceptance rate 33%