Mushroom exchanging - MarisaOJ: Marisa Online Judge

Mushroom exchanging

Time limit: 1000 ms
Memory limit: 256 MB
Marisa's mushroom shop is running a special promotion: exchanging $k$ mushroom stems will earn you a new mushroom. Currently, you have $n$ mushrooms. You consume one mushroom every day. How many days will it take until you run out of mushrooms? ### Input - One line containing two integers: $n$ and $k$. ### Output - A single integer representing the number of days before you run out of mushrooms. ### Constraints - $1 \le n \le 10^5$. - $2 \le k \le 10^5$. ### Sample test Input: ``` 10 3 ``` Output: ``` 14 ```