CF765C.Table Tennis Game 2

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 kk points, the score is reset and a new set begins.

Across all the sets Misha scored aa points in total, and Vanya scored bb 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.

输入格式

The first line contains three space-separated integers kk , aa and bb ( 1<=k<=1091<=k<=10^{9} , 0<=a,b<=1090<=a,b<=10^{9} , a+b>0 ).

输出格式

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

输入输出样例

  • 输入#1

    11 11 5
    

    输出#1

    1
    
  • 输入#2

    11 2 3
    

    输出#2

    -1
    

说明/提示

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.

首页