~/algor $ cat problems/integer-xonadon-podyezdi-va-qavati
Entrance and floor of a flat
Each entrance of an apartment building has $m$ floors, and each floor has $k$ flats. The flats are numbered consecutively starting from $1$: first the $k$ flats of floor $1$ of entrance $1$, then the flats of floor $2$, and so on; when an entrance ends, the numbering continues from floor $1$ of the next entrance. For example, with $m = 5$, $k = 4$, flats $1$–$20$ are in entrance $1$, and flat $21$ is on floor $1$ of entrance $2$. Find the entrance and the floor of flat $n$.
Input
One line with three positive integers: $m$, $k$ and $n$.
Output
One line with two positive integers: the entrance number $p$ and the floor number $q$.
Note
$1 \le m, k \le 1000$
$1 \le n \le 10^{9}$
Examples
5 4 21
2 1
9 4 75
3 1