QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#6243. Wall Building

Statistics

Professor Moriarty is tired of villainy and intends to take a break for a while. Since he does not want Sherlock Holmes to disturb his rest, he intends to upgrade the security of his house so that Sherlock cannot infiltrate it. To increase the security of his house, he intends to build a wall along the northern side of the house using special bricks. After contacting the factory, he realizes that the factory only produces bricks of length $b$, and it is not possible to produce bricks of any other length. He realized that these bricks might not be able to cover the entire side of the house. Now, the question arises for him: if the length of the northern side of the house is $a$, what is the minimum length of the side of the house that will remain uncovered? Note that it is possible to place the bricks side by side, but due to the special design of the bricks, it is not possible to break the bricks into smaller pieces. Also, it is not possible to build a wall longer than the length of the northern side of the house. The professor, who does not want to spend his vacation doing calculations, has asked you to tell him what the minimum length of the side of the house that will remain uncovered will be.

Input

The only line of input contains two numbers $a$ and $b$, separated by a space. $a$ represents the length of the northern side of the house, and $b$ represents the length of one brick.

Output

The only line of output should display the minimum length that cannot be covered by the bricks.

Constraints

$1 \le a, b \le 10^{18}$

Examples

Input 1

5 2

Output 1

1

Input 2

10 8

Output 2

2

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.