跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F0925. Table Tennis Game 2

    ID: 931 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 2 上传者: 标签>数学基础难度共享题库Codeforces英文题面题目来源题面语言

Table Tennis Game 2

题目描述

C. Table Tennis Game 2
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

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≤109, 0≤a,b≤109, a+b>0).

Output

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

Examples
Input
11 11 5
Output
1
Input
11 2 3
Output
-1
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.


题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 360 题。保留原作者与原赛事署名。