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: EASY
Tags: Mathematics

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)


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


(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)


(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, x, y) = map(int, input().split())
if x >= k and y >= k or (x and x % k == 0) or (y and y % k == 0):
	print(x // k + y // k)
else:
	print(-1)


a = input().split()
b = int(a[0])
n = int(a[1])
nn = n % b
m = int(a[2])
mm = m % b
n = int(n / b)
m = int(m / b)
if n + m > 0:
	if m == 0 and nn != 0:
		print(-1)
	elif n == 0 and mm != 0:
		print(-1)
	else:
		print(n + m)
else:
	print(-1)


(k, a, b) = map(int, input().split())
if min(a, b) < k and max(a, b) % k == 0:
	exit(print(a // k + b // k))
if min(a, b) < k and max(a, b) % k != 0:
	exit(print(-1))
print([a // k + b // k, -1][max(a, b) < k])


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


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


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


(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)


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


(k, a, b) = list(map(lambda x: int(x), input().split()))
r = 0
aa = b // k
bb = a // k
a %= k
b %= k
r += aa + bb
aa *= k - 1
bb *= k - 1
if a <= aa and b <= bb:
	print(r)
else:
	print(-1)


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


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


def maxgames(k, a, b):
	if max(a, b) < k:
		return -1
	if min(a, b) < k and max(a, b) % k != 0:
		return -1
	return a // k + b // k
(k, a, b) = map(int, input().split())
print(maxgames(k, a, b))


(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)


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) = map(int, input().split())
print(max(get(k, a, b), get(k, b, a)))


import sys

def debug(x, table):
	for (name, val) in table.items():
		if x is val:
			print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
			return None

def solve():
	(k, a, b) = map(int, input().split())
	(a, b) = (max(a, b), min(a, b))
	(win_a, rem_a) = divmod(a, k)
	(win_b, rem_b) = divmod(b, k)
	sets = win_a + win_b
	if sets == 0:
		ans = -1
	elif win_b == 0 and rem_a > 0:
		ans = -1
	else:
		ans = sets
	print(ans)
solve()


(reset_score, misha, vanya) = map(int, input().split())
print(-1 if misha < reset_score and vanya % reset_score or (vanya < reset_score and misha % reset_score) else misha // reset_score + vanya // reset_score)


(k, a, b) = list(map(int, input().split()))
(ax, ay) = divmod(a, k)
(bx, by) = divmod(b, k)
if ay > (k - 1) * bx:
	print(-1)
elif by > (k - 1) * ax:
	print(-1)
else:
	print(ax + bx)


(k, a, b) = input().split()
k = int(k)
a = int(a)
b = int(b)
if a + b < k:
	print(-1)
elif (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) = [int(x) for x in input().split(' ')]
sets_a_won = a // k
sets_b_won = b // k
if sets_a_won == 0 and b % k != 0 or (sets_b_won == 0 and a % k != 0):
	print(-1)
else:
	print(sets_a_won + sets_b_won)


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


arr = [int(x) for x in input().split()]
if arr[1] < arr[0] and arr[2] < arr[0]:
	print(-1)
elif arr[1] < arr[0]:
	if arr[2] % arr[0] == 0:
		print(int(arr[2] / arr[0]))
	else:
		print(-1)
elif arr[2] < arr[0]:
	if arr[1] % arr[0] == 0:
		print(int(arr[1] / arr[0]))
	else:
		print(-1)
else:
	print(int(arr[1] / arr[0]) + int(arr[2] / arr[0]))


def main():
	(k, a, b) = map(int, input().split())
	x = a // k + b // k
	if a % k and (not b // k) or (b % k and (not a // k)):
		x = -1
	print(x)
main()


(k, a, b) = map(int, input().split())
from math import floor
awin = floor(a / k)
bwin = floor(b / k)
if b % k > awin * (k - 1) or a % k > bwin * (k - 1):
	print(-1)
else:
	print(awin + bwin)


import sys
(k, a, b) = map(int, input().split())
if a < k and b < k:
	print(-1)
	sys.exit()
if b % k != 0 and a < k:
	print(-1)
	sys.exit()
if a % k != 0 and b < k:
	print(-1)
	sys.exit()
print(a // k + b // k)


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())
(x1, y1, x2, y2) = (a // k, b // k, a % k, b % k)
if x1 == 0 and y1 > 0 and (x2 >= 0) and (y2 > 0):
	print(-1)
elif x1 > 0 and y1 == 0 and (x2 > 0) and (y2 >= 0):
	print(-1)
elif x1 == 0 and y1 == 0:
	print(-1)
else:
	print(x1 + y1)


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


(k, a, b) = list(map(int, input().strip().split(' ')))
t1 = a // k
t2 = b // k
temp1 = k * t1 + (k - 1) * t2
temp2 = (k - 1) * t1 + k * t2
if temp1 >= a and temp2 >= b:
	print(t1 + t2)
else:
	print(-1)


(x, y, z) = map(int, input().split())
if x > 0 and x <= 10 ** 9 and (y >= 0) and (y <= 10 ** 9) and (z >= 0) and (z <= 10 ** 9) and (y + z > 0):
	if x > y and x > z:
		print(-1)
	elif y > x and y % x != 0 and (x > z):
		print(-1)
	elif x > y and z % x != 0 and (z > x):
		print(-1)
	else:
		print(y // x + z // x)
else:
	print(-1)


string = input()
(n, a, b) = map(int, string.split())

def check(p, q):
	return p % n != 0 and q < n
if check(a, b) or check(b, a):
	print(-1)
else:
	print(a // n + b // n)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

def LI():
	return list(map(int, input().split()))

def II():
	return int(input())

def LS():
	return input().split()

def S():
	return input()

def main():
	(k, a, b) = LI()
	if a > b:
		(a, b) = (b, a)
	r = a // k
	aa = a % k
	r += b // k
	bb = b % k
	if bb != 0 and a // k == 0:
		return -1
	if aa != 0 and b // k == 0:
		return -1
	return r
print(main())


(a, b, c) = [int(x) for x in input().split()]
if b < a and c < a:
	print('-1')
elif b < a and c % a != 0:
	print('-1')
elif c < a and b % a != 0:
	print('-1')
else:
	print(str(b // a + c // a))


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


import math

def divisable(a, b):
	if a == 0:
		return False
	if a % b == 0:
		return True
	else:
		return False
(k, a, b) = map(int, input().split())
if a >= k and b >= k or divisable(a, k) or divisable(b, k):
	print(math.floor(a / k) + math.floor(b / k))
else:
	print(-1)


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


(k, a, b) = [int(x) for x in input().split()]
score_a = 0
if a >= k:
	score_a = a // k
score_b = 0
if b >= k:
	score_b = b // k
if score_a == 0 and score_b == 0:
	print(-1)
elif score_a == 0 and score_b > 0:
	if b % k == 0:
		print(score_b)
	else:
		print(-1)
elif score_a > 0 and score_b == 0:
	if a % k == 0:
		print(score_a)
	else:
		print(-1)
else:
	print(score_a + score_b)


(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)


from math import *

def main():
	(k, a, b) = map(int, input().split())
	x = a % k + b % k
	if a < k or b < k:
		if x == a or x == b:
			ans = floor(a / k) + floor(b / k)
			if ans == 0:
				print(-1)
			else:
				print(ans)
		else:
			print(-1)
	else:
		ans = floor(a / k) + floor(b / k)
		print(ans)
main()


import sys

def main():
	(k, a, b) = 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()


def tennis(k, a, b):
	if a < b:
		(a, b) = (b, a)
	(result, flag) = (0, True)
	if a < k and b < k:
		flag = False
	elif a % k != 0 and b < k:
		flag = False
	else:
		result = a // k + b // k
	if not flag:
		result -= 1
	return result
(K, A, B) = [int(i) for i in input().split()]
print(tennis(K, A, B))


n = [int(i) for i in input().split()]
c = n[1] // n[0]
d = n[2] // n[0]
e = n[1] % n[0]
f = n[2] % n[0]
if e != 0 and d == 0:
	print(-1)
elif f != 0 and c == 0:
	print(-1)
else:
	print(c + d)


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


lol = input().split(' ')
points = int(lol[0])
first = int(lol[1])
second = int(lol[2])
if first % points > 0 and second // points == 0 or (second % points > 0 and first // points == 0):
	print(-1)
else:
	print(first // points + second // points)


(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 main():
	(k, a, b) = map(int, input().split())
	if a < b:
		(a, b) = (b, a)
	cnt = a // k + b // k
	print(cnt if a % k == 0 and a > 0 or (b % k == 0 and b > 0) or (a >= k and b >= k) else -1)
	return
main()


(a, b, c) = input().strip().split(' ')
(a, b, c) = (int(a), int(b), int(c))
ans = -1
if b >= a and c >= a or (b != 0 and b % a == 0) or (c != 0 and c % a == 0):
	ans = b // a + c // a
print(ans)


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


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


(k, a, b) = map(int, input().split())
l = a // k
p = b // k
if l == 0:
	if b % k == 0:
		if l + p != 0:
			print(l + p)
		else:
			print('-1')
	else:
		print('-1')
elif p == 0:
	if a % k == 0:
		if l + p != 0:
			print(l + p)
		else:
			print('-1')
	else:
		print('-1')
else:
	print(l + p)


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


(k, a, b) = map(int, input().split())
ak = a // k
bk = b // k
if a % k <= bk * k and b % k <= ak * k:
	print(ak + bk)
else:
	print(-1)


from sys import stdin, stdout

def ri():
	return map(int, stdin.readline().split())
(k, a, b) = ri()
an = a // k
ar = a % k
bn = b // k
br = b % k
if an == 0 and br or (bn == 0 and ar):
	print(-1)
	exit()
ans = an + bn
if ans:
	print(ans)
else:
	print(-1)


tab = [int(i) for i in input().split()]
sa = int(tab[1] / tab[0])
sb = int(tab[2] / tab[0])
if tab[1] % tab[0] != 0 and sb == 0 or (tab[2] % tab[0] != 0 and sa == 0):
	print(-1)
elif sa == 0 and sb == 0:
	print(-1)
else:
	print(sa + sb)


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


(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)


def Neverending_competitions():
	n = int(input())
	home = input()
	for i in range(n):
		new = input()
	if n % 2 == 0:
		return 'home'
	else:
		return 'contest'

def Code_obfuscation():
	s = input()
	a = [0] * 26
	okay = True
	for i in s:
		for j in range(ord(i) - 97):
			if not a[j]:
				okay = False
				break
		if okay:
			a[ord(i) - 97] = 1
		else:
			break
	if okay:
		print('YES')
	else:
		print('NO')

def Table_Tennis_Game_2():
	n = input().split()
	k = int(n[0])
	a = int(n[1])
	b = int(n[2])
	if a >= k and b >= k:
		return int(a / k) + int(b / k)
	elif a % k == 0 and a != 0:
		return int(a / k)
	elif b % k == 0 and b != 0:
		return int(b / k)
	else:
		return -1
print(Table_Tennis_Game_2())


import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import *
from collections import defaultdict, deque, Counter
import math, string
from heapq import *
from operator import add
from itertools import accumulate
BUFSIZE = 8192
sys.setrecursionlimit(10 ** 5)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inf = float('inf')
en = lambda x: list(enumerate(x))
ceil_ = lambda a, b: (a + b - 1) // b
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
(n, a, b) = r()
x = a // n
a = a % n
y = b // n
b = b % n
if a and (not y) or (b and (not x)):
	print(-1)
else:
	print(x + y)


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


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


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


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


(k, a, b) = [int(i) for i in input().split()]
resa = a // k
resb = b // k
osta = a % k
ostb = b % k
res = resa + resb
if res == 0 or (resa == 0 and ostb != 0) or (resb == 0 and osta != 0):
	print(-1)
else:
	print(res)


(k, a, b) = [int(x) for x in input().split()]
c = min(a, b)
if c < k:
	if max(a, b) % k != 0:
		print(-1)
		exit(0)
print(a // k + b // k)


(k, n, m) = 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)


c = 1
cases = 1
while c <= cases:
	[k, a, b] = [int(i) for i in input().split()]
	ans = -1
	if a >= k and b >= k:
		ans = a // k + b // k
	elif a >= k:
		if a % k == 0:
			ans = a // k
	elif b >= k:
		if b % k == 0:
			ans = b // k
	print(ans)
	c = c + 1


(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)


l = input().split()
(k, a, b) = (int(l[0]), int(l[1]), int(l[2]))
if min(a, b) < k and max(a, b) % k or a + b < k:
	z = -1
else:
	z = a // k + b // k
print(z)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	pass

def binary(n):
	return bin(n).replace('0b', '')

def decimal(s):
	return int(s, 2)

def pow2(n):
	p = 0
	while n > 1:
		n //= 2
		p += 1
	return p

def isPrime(n):
	if n == 1:
		return False
	else:
		root = int(n ** 0.5)
		root += 1
		for i in range(2, root):
			if n % i == 0:
				return False
		return True

def lts(l):
	s = ''.join(map(str, l))
	return s

def stl(s):
	l = list(s)
	return l

def sq(a, target, arr=[]):
	s = sum(arr)
	if s == target:
		return arr
	if s >= target:
		return
	for i in range(len(a)):
		n = a[i]
		remaining = a[i + 1:]
		ans = sq(remaining, target, arr + [n])
		if ans:
			return ans

def SieveOfEratosthenes(n):
	cnt = 0
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p]:
			cnt += 1
	return cnt

def nCr(n, r):
	f = math.factorial
	return f(n) // f(r) // f(n - r)
mod = int(1000000000.0) + 7

def ssinp():
	return input()

def iinp():
	return int(input())

def nninp():
	return map(int, input().split())

def llinp():
	return list(map(int, input().split()))

def p(xyz):
	print(xyz)

def p2(a, b):
	print(a, b)
import math
(k, a, b) = nninp()
x = a // k + b // k
if x == 0:
	p(-1)
elif a % k != 0 and b < k:
	p(-1)
elif b % k != 0 and a < k:
	p(-1)
else:
	p(x)


def solve():
	(k, a, b) = 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, x, y) = map(int, input().split())
if max(x, y) < k:
	print(-1)
	exit(0)
a = x // k
b = y // k
if b == 0 and a * k < x or (a == 0 and b * k < y) or a + b == 0:
	print(-1)
else:
	print(a + b)


(k, a, b) = 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)


(k, a, b) = map(int, input().split())
print([-1, a // k + b // k][a // k * (k - 1) >= b % k and b // k * (k - 1) >= a % k])


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


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


import sys
read = lambda : sys.stdin.readline().strip()
write = lambda x: sys.stdout.write(x + '\n')
(p, a, b) = map(int, read().split())
(qa, ra) = divmod(a, p)
(qb, rb) = divmod(b, p)
if qa >= 1 and qb >= 1:
	write(str(qa + qb))
elif qa >= 1 and qb == 0:
	if ra == 0:
		write(str(qa))
	else:
		write('-1')
elif qb >= 1 and qa == 0:
	if rb == 0:
		write(str(qb))
	else:
		write('-1')
else:
	write('-1')


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


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


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

def no():
	print(-1)
	exit()

def ans(x):
	print(x)
	exit()
if a < k and b < k:
	no()
if a < k:
	if b % k != 0:
		no()
	else:
		ans(b // k)
if b < k:
	if a % k != 0:
		no()
	else:
		ans(a // k)
cnt = a // k + b // k
ans(cnt)


(k, a, b) = [int(item) for item in input().split()]
if max(a, b) < k:
	print('-1')
elif (a % k != 0 or a == 0) and (b % k != 0 or b == 0):
	if a >= k and b >= k:
		print(a // k + b // k)
	else:
		print('-1')
else:
	print(a // k + b // k)


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


arr = [int(x) for x in input().split()]
a = arr[1]
b = arr[2]
k = arr[0]
if k <= a and k <= b:
	print(a // k + b // k)
elif a < k and b < k:
	print('-1')
elif a < k and b % k == 0:
	print(b // k)
elif b < k and a % k == 0:
	print(a // k)
else:
	print('-1')


def calc(a, b, k):
	rez = a // k + b // k
	print(rez)

def solve():
	(k, a, b) = input().split(' ')
	k = int(k)
	a = int(a)
	b = int(b)
	if a < k and b < k:
		print(-1)
	elif a < b:
		res = b % k
		if a < k and res != 0:
			print(-1)
		else:
			calc(a, b, k)
	else:
		res = a % k
		if b < k and res != 0:
			print(-1)
		else:
			calc(a, b, k)
solve()


import sys
import bisect
from collections import deque
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
(k, a, b) = Ri()
if a == 0 and b == 0:
	print(-1)
elif a == 0:
	if b % k == 0:
		print(b // k)
	else:
		print(-1)
elif b == 0:
	if a % k == 0:
		print(a // k)
	else:
		print(-1)
elif max(a, b) < k:
	print(-1)
else:
	ta = a % k
	tb = b % k
	if ta == 0 or tb == 0 or (a > k and b > k):
		print(a // k + b // k)
	else:
		print(-1)


c = input().split()
k = int(c[0])
a = int(c[1])
b = int(c[2])
if a >= k and b >= k or (a % k == 0 and a // k != 0) or (b % k == 0 and b // k != 0):
	print(a // k + b // k)
else:
	print(-1)


def compute_sets(a, b, k):
	if not (a >= k or b >= k):
		return -1
	awins = a // k
	bwins = b // k
	if awins == 0:
		if b % k != 0:
			return -1
	elif bwins == 0:
		if a % k != 0:
			return -1
	return awins + bwins

def main():
	import sys
	for line in sys.stdin:
		line = [int(x) for x in line.rstrip().split(' ')]
		k = line[0]
		a = line[1]
		b = line[2]
		print(compute_sets(a, b, k))
main()