Competitions

# ADA Training September 7

# 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** (**1** ≤ **n** ≤ ** 10**) and

^{9}

**k**(

**1**≤

**k**≤

**100**).

#### Output

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

Input example #1

10 3

Output example #1

3 4

Input example #2

1 10

Output example #2

2 1