#GYM104758I. ICPC Masters

ICPC Masters

本题没有可用的提交语言。

Description

In a bustling city, the prestigious ICPC Masters programming event was in full swing. Brilliant minds from around the world had gathered to showcase their algorithmic skills and problem-solving prowess. However, this year, something different was at stake.

A massive number of talented programmers had congregated, each with the determination to make their mark in the world of programming. What made this event special was that, unlike previous years, no one had come with a pre-formed team. Instead, they all arrived individually, eager to become part of a winning team.

The ICPC Masters' organization was ready for the challenge. They decided to form teams of exactly $K$ individuals, whenever possible. Participants, brimming with enthusiasm, clustered around tables in the competition hall, hoping to find like-minded peers with complementary interests and skills.

The organization realized that some participants, unable to form complete teams of $K$ individuals, might be left without the chance to compete. They wanted everyone to have the opportunity to prove their worth so they let them compete in a team with the remaining participants.

Write a program to help the ICPC Masters' organization determine the minimum number of participants in the team with the fewest members.

A single line with two integers, $N$ ($2 \leq N \leq 1000$) and $K$ ($1 \leq K \leq 10$), representing the number of participants at the event and the desired team size.

An integer, the number of participants in the team with the fewest members.

Input

A single line with two integers, $N$ ($2 \leq N \leq 1000$) and $K$ ($1 \leq K \leq 10$), representing the number of participants at the event and the desired team size.

Output

An integer, the number of participants in the team with the fewest members.

5 3
21 2
8 5
2
1
3