eolymp
bolt
Try our new interface for solving problems
Problems

Generous Vasya

Generous Vasya

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 (1n109) and k (1k100).

Output

Print the number of the lessons and the number of apples that Vasya ate.

Time limit 1 second
Memory limit 128 MiB
Input example #1
10 3
Output example #1
3 4
Input example #2
1 10
Output example #2
2 1