Codeforces Round 397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined)
C
Table Tennis Game 2
Codeforces
1200
原题
← BD →
翻译中…

Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exactly $*k*$ points, the score is reset and a new set begins.

翻译中…

Across all the sets Misha scored $*a*$ points in total, and Vanya scored $*b*$ points. Given this information, determine the maximum number of sets they could have played, or that the situation is impossible.

翻译中…

Note that the game consisted of several complete sets.

翻译中…

Input

翻译中…

The first line contains three space-separated integers $*k*$, $*a*$ and $*b*$ ($1 ≤ *k* ≤ 10^{9}$, $0 ≤ *a*, *b* ≤ 10^{9}$, $*a* + *b* > 0$).

翻译中…

Output

翻译中…

If the situation is impossible, print a single number -1. Otherwise, print the maximum possible number of sets.

翻译中…

Note

翻译中…

Note that the rules of the game in this problem differ from the real table tennis game, for example, the rule of "balance" (the winning player has to be at least two points ahead to win a set) has no power within the present problem.

翻译中…

样例

Input #1
11 11 5
Output #1
1
InputCopy OutputCopy
Input #2
11 2 3
Output #2
-1
InputCopy OutputCopy
题目信息
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。