402192: GYM100694 B Far Manager
Description
Pavel loves Far Manager very much. By default, Far shows files in a certain number of columns each of which holds p files. Besides, there is also a «zero file» — the link to the parent directory, after which the files in the current directory are shown.
Pavel is viewing a directory with n files numbered from 1 to n. He needs to select the file x. To do that, he has to place the cursor onto this file. He can press any of the four arrow keys: up / down arrows move the cursor by 1 file, and left / right arrows move it by p files (or place the cursor onto the «zero file» or the last file if less than p files remains in the cursor's movement direction).
Your task is to help Pavel to determine the minimum number of key presses to select the file x. At the beginning the cursor points to the link to the parent directory.
InputThe only line contains 3 integers p, n and x (1 ≤ p ≤ 109, 1 ≤ n ≤ 109, 1 ≤ x ≤ n) — the maximum number of files in a column, the total number of files in the directory viewed by Pavel and the file he wants to select.
OutputWrite one integer — the minimum number of key presses Pavel needs to select the file x.
ExamplesInput5 8 3Output
3Input
6 20 14Output
4Input
8 33 33Output
5