A - Kids and Candies

Description:

You have \(c\) candies and you want to give them to \(k\) kids. However, because kids are prone to jealousy, all kids must get the same number of candies. What is the maximum number of candies you can give without making any kid jealous?

Program Input:

A single line that contains two integers \(c\) and \(k\), the number of candies and the number of kids.

Constraints:

\(1 \leq c,k \leq 10^4\)

Program Output:

A single line that contains the maximum number of candies you can give.

Sample Testcase 0:

Input:

10 5

Output:

10

Explanation:

You will give each kid 2 candies, which is 10 in total.

Sample Testcase 1:

Input:

10 3

Output:

9

Explanation:

You will give each kid 3 candies, and keep the last one for yourself so no kid will be jealous.

Sample Testcase 2:

Input:

5 7

Output:

0

Explanation:

You will not give candies to any kid to not make them jealous.


CodeBox

Information

Author(s) Muhannad Alwarawreh
Deadline No deadline
Submission limit No limitation

Sign in