#K45327. Candies Distribution
Candies Distribution
Candies Distribution
You are given two integers c and n such that \(1 \leq n \leq c \leq 1000\). These represent the total number of candies and the number of students respectively. The teacher distributes candies among the students as evenly as possible, and the leftover candies remain with the teacher. In this problem, the teacher has no control over the distribution once the constraint of even distribution (where the difference between candies any two students receive is at most 1) is maintained.
Your task is to determine both the minimum and maximum number of candies the teacher can have after the distribution. Under the even distribution rule, it turns out that both the minimum and maximum leftovers are equal to \(c \bmod n\) (the remainder when \(c\) is divided by \(n\)).
For example, if \(c = 10\) and \(n = 3\), then \(10 \bmod 3 = 1\) and the teacher will end up with 1 candy as leftover. Similarly, for \(c = 15\) and \(n = 4\), \(15 \bmod 4 = 3\), so the teacher gets 3 candies.
inputFormat
The input consists of a single line containing two integers \(c\) and \(n\) separated by space, where \(c\) is the total number of candies and \(n\) is the number of students.
outputFormat
Output two space-separated integers on a single line: the minimum and the maximum number of candies the teacher can have after distribution. (Note: they are always equal and given by \(c \bmod n\)).
## sample10 3
1 1
</p>