How many toffees?

4

5 votes
Easy
Problem

You currently have N toffees with you. There's also a limited edition offer going on right now. The offer says that for every X toffee wrappers you'll get one toffee. You want to eat as many toffees as you can before the offer expires. Find the maximum number of toffees you can eat.

Input

  • The only line contains two space separated integers N and X.

Output

  • Print a single line integer the maximum number of toffees you can eat.

Constraints

  • 1 <= N <= 109
  • 2 <= X <= 109

Scoring

Scores will be calculated as follows:

Score = (1 - c / 1000) * 100, where c is the number of characters in your code. In case the characters exceed 1000, your score will be zero.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?