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.


-----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.

Difficulty: competition

Starter code:

Solutions:
k, a, b = map(int, input().split())

mx_a = a // k
mx_b = b // k
if mx_a == 0 and b % k != 0:
	print(-1)
elif mx_b == 0 and a % k != 0:
	print(-1)
else:
	print(mx_a + mx_b)

3

k, n, m = list(map(int, input().split()))

wa = n // k
wb = m // k

if n % k > 0 and wb == 0:
    print(-1)
elif m % k > 0 and wa == 0:
    print(-1)
else:
    print(wa + wb)


k, a, b = list(map(int, input().split()))
if a % k > 0 and b // k == 0 or b % k > 0 and a // k == 0:
    print(-1)
else:
    print(a // k + b // k)


def solve():
	k, a, b = list(map(int, input().strip().split()))
	ak = a // k
	bk = b // k

	if a % k != 0 and bk == 0:
		return -1
	if b % k != 0 and ak == 0:
		return -1

	return ak + bk


print(solve())



k, a, b = map(int, input().split())
ca = a // k
cb = b // k
if ca * k != a and cb < 1 or cb * k != b and ca < 1:
	print(-1)
else:
	print(ca + cb)

def get(k, a, b):
    if a < k:
        return -1
    a -= k
    b -= b % k
    part_b = b // k
    if ((a % k) != 0) > part_b:
        return -1
    return part_b + a // k + 1

k, a, b = list(map(int, input().split()))

print(max(get(k, a, b), get(k, b, a)))


k, a, b = input().split()
k = int(k)
a = int(a)
b = int(b)
if a+b < k:
    print(-1)
else:
    if ((a%k > 0 and b//k > 0) or (a%k == 0)) and \
        ((b%k > 0 and a//k > 0) or (b%k == 0)):
        print(a//k + b//k)
    else:
        print(-1)

k, a, b = list(map(int, input().split()))

if (a < k and b % k) or (b < k and a % k):
    print(-1)
else:
    print(a // k + b // k)


k, a, b = list(map(int, input().split()))
number = a // k + b // k
if number == 0 or (a < k and b % k != 0) or (b < k and a % k != 0):
    print(-1)
else:
    print(number)

k, a, b = map(int, input().split())
if (b > a):
    a, b = b, a
if (a // k > 0 and b // k > 0):
    print(a // k + b // k)
elif (b < k and a % k == 0):
    print(a // k)
else:
    print(-1)

k, a, b = map(int, input().split())

ca = a // k
cb = b // k

res = ca + cb

if a % k != 0:
    if cb == 0:
        res = -1

if b % k != 0:
    if ca == 0:
        res = -1

print(res)

3
# Copyright (C) 2017 Sayutin Dmitry.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 3
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see <http://www.gnu.org/licenses/>.

import sys

def main():
    k, a, b = list(map(int, input().split()))

    if a == 0 or b == 0:
        if (a + b) % k == 0:
            print((a + b) // k)
        else:
            print(-1)
    elif a % k == 0 or b % k == 0:
        print(a // k + b // k)
    elif a // k >= 1 and b // k >= 1:
        print(a // k + b // k)
    else:
        print(-1)

main()


k, a, b = list(map(int, input().split()))

if a >= k and b >= k:
	print(a // k + b // k)
elif a >= k:
	if a % k != 0:
		print(-1)
	else:
		print(a // k)
elif b >= k:
	if b % k != 0:
		print(-1)
	else:
		print(b // k)
else:
	print(-1)


k, a, b = map(int, input().split())
ans = a // k + b // k
if ans:
    if a % k and b // k == 0:
        print(-1)
    elif b % k and a // k == 0:
        print(-1)
    else:
        print(ans)
else:
    print(-1)

k, a, b = list(map(int, input().split(' ')))
if (a < k and b % k != 0) or (b < k and a % k != 0):
    print(-1)
else:
    ans = a // k + b // k
    if ans == 0:
        print('-1')
    else:
        print(ans)


k, a, b = list(map(int, input().split()))


if a == 0 and (b % k != 0):
	print(-1)
	return
if b == 0 and (a % k != 0):
	print(-1)
	return

time_a = (b >= k)
time_b = (a >= k)

if a % k != 0 and not time_a:
	print(-1)
	return
if b % k != 0 and not time_b:
	print(-1)
	return

print(a // k + b // k)


#!/usr/bin/env python3
k, a, b = [int(x) for x in input().strip().split()]
qa = a//k
qb = b//k
a %= k
b %= k

if qa == 0 and b != 0:
    print(-1)
elif qb == 0 and a !=0:
    print(-1)
else:
    print(qa+qb)


k, a, b = list(map(int, input().split()))
count = a // k + b // k
print(-1 if (not count) or (a < k and b % k) or (b < k and a % k) else count)


k, a, b = list(map(int, input().split()))

n = a // k + b // k

if (b // k == 0 and a - k * n > 0) or (a // k == 0 and b - k * n > 0) or n == 0:
    print(-1)
else:
    print(n)


k, a, b = list(map(int, input().split()))
a1 = a // k
r_a1 = a % k
b1 = b // k
r_b1 = b % k
if a1 + b1 == 0 or min(a,b) < k and max(a, b) % k != 0:
    print(-1)
else:
    print(a1 + b1)


import math, sys, itertools
from decimal import *

def main():
	k,a,b = list(map(int, input().split()))
	mx = max(a,b)
	mn = min(a,b)
	
	r1 = mx%k
	r2 = mn%k
	d1 = mx//k
	d2 = mn//k
	
	if (d2==0 and r1!=0) or (d1==0 and r2!=0):
		print(-1)
		return
	print(d1+d2)
	
			
def __starting_point():
	main()

__starting_point()

k, a, b = map(int, input().split())
ans = a // k + b // k
if ans == 0 or (min(a, b) < k and max(a, b) % k):
    print(-1)
else:
    print(ans)

k, a, b = [int(x) for x in input().split()]
ans = a // k + b // k
if ans == 0 or (a % k != 0 and b < k) or (b % k != 0 and a < k):
    ans = -1
print(ans)

k, a, b = list(map(int, input().split()))
if a < k and b < k:
	print(-1)
elif min(a, b) < k and max(a, b) % k:
	print(-1)
else:
	print(a // k + b // k)