Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/integer-teng-guruhlar

Equal groups

Medium 1000 ms 64 MB 40%
Share

$n$ students were split into $k$ groups: each group has at least one student, and the sizes of any two groups differ by at most $1$. Find how many students are in the smallest and in the largest group.

Distributing the students into nearly equal groups

Input

One line with two positive integers: $n$ and $k$.

Output

One line with two positive integers: the number of students in the smallest group $p$ and in the largest group $q$.

Note

$1 \le k \le n \le 10^{9}$

Examples

Input #1
25 4
Output #1
6 7
Input #2
24 4
Output #2
6 6

Sign in to submit a solution

Signing up is free and takes a minute.