It's New Year's Eve soon, so Ivan decided it's high time he started setting the table. Ivan has bought two cakes and cut them into pieces: the first cake has been cut into a pieces, and the second one — into b pieces.

Ivan knows that there will be n people at the celebration (including himself), so Ivan has set n plates for the cakes. Now he is thinking about how to distribute the cakes between the plates. Ivan wants to do it in such a way that all following conditions are met:  Each piece of each cake is put on some plate;  Each plate contains at least one piece of cake;  No plate contains pieces of both cakes. 

To make his guests happy, Ivan wants to distribute the cakes in such a way that the minimum number of pieces on the plate is maximized. Formally, Ivan wants to know the maximum possible number x such that he can distribute the cakes according to the aforementioned conditions, and each plate will contain at least x pieces of cake.

Help Ivan to calculate this number x!


-----Input-----

The first line contains three integers n, a and b (1 ≤ a, b ≤ 100, 2 ≤ n ≤ a + b) — the number of plates, the number of pieces of the first cake, and the number of pieces of the second cake, respectively.


-----Output-----

Print the maximum possible number x such that Ivan can distribute the cake in such a way that each plate will contain at least x pieces of cake.


-----Examples-----
Input
5 2 3

Output
1

Input
4 7 10

Output
3



-----Note-----

In the first example there is only one way to distribute cakes to plates, all of them will have 1 cake on it.

In the second example you can have two plates with 3 and 4 pieces of the first cake and two plates both with 5 pieces of the second cake. Minimal number of pieces is 3.

Difficulty: EASY
Tags: Sorting

Implementation

Complete search
Skill types: Sorting

Complete search

Starter code:

Solutions:
(n, a, b) = map(int, input().split())
ans = 1
while 1:
	if ans > a or ans > b:
		ans -= 1
		break
	if a // ans + b // ans >= n:
		ans += 1
	else:
		ans -= 1
		break
print(ans)


(n, a, b) = input().split()
(n, a, b) = (int(n), int(a), int(b))
mn = []
for x in range(1, n):
	mn.append(min(a // x, b // (n - x)))
print(max(mn))


def bs(l, h):
	while l < h:
		m = (l + h + 1) // 2
		if gf(m):
			l = m
		else:
			h = m - 1
	return l

def gf(x):
	return a // x + b // x >= n
(n, a, b) = map(int, input().split())
print(bs(0, min(a, b)))


(n, a, b) = map(int, input().split())
t = 2
o = []
while t <= n:
	l = min(a, b)
	k = max(a, b)
	a = l
	b = k
	r = n // t
	e = n - r
	l = min(r, e)
	k = max(r, e)
	r = l
	e = k
	d = a // r
	q = b // e
	o.append(min(d, q))
	while r < e:
		r = r + 1
		e = n - r
		d = a // r
		q = b // e
		o.append(min(d, q))
	t = t + 1
print(max(o))


(n, a, b) = map(int, input().split())
for x in range(min(a, b), 0, -1):
	if a // x + b // x >= n:
		print(x)
		break


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

def check(x):
	cana = a // x
	canb = b // x
	return cana + canb >= n
lo = 1
hi = 200
ans = 0
while lo <= hi:
	mi = lo + hi >> 1
	if check(mi):
		ans = mi
		lo = mi + 1
	else:
		hi = mi - 1
if ans > min(a, b):
	ans = min(a, b)
print(ans)


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

	def S():
		return stdin.readline().rstrip()

	def Sn():
		return stdin.readline().split(' ')

def Out(whatever):
	return stdout.write(whatever)
(n, a, b) = In()
Out(str(max([min(a // x, b // (n - x)) for x in range(1, n)])))


from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

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

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')

def solve():
	(n, a, b) = mi()

	def f(m):
		x1 = a // m
		x2 = b // m
		if x1 + x2 >= n:
			return 1
		else:
			return 0
	a1 = min(a, b)
	l = 1
	r = 1000
	while l <= r:
		m = l + (r - l) // 2
		if f(m):
			ans = m
			l = m + 1
		else:
			r = m - 1
	print(min(ans, a1))
solve()


(n, a, b) = map(int, input().split())
for i in range(1, min(a, b) + 1):
	if a // i + b // i >= n:
		k = i
print(k)


inputLine = input()
(x, y, z) = inputLine.split(' ')
x = int(x)
y = int(y)
z = int(z)
x_temp = x
y_temp = y
z_temp = z
count = 1
while True:
	x = x_temp
	y = y_temp
	z = z_temp
	index = 0
	done = False
	for i in range(x - 1):
		index += 1
		if y >= count:
			y -= count
			if y == 0:
				break
		else:
			y = 0
			index -= 1
			if index == 0:
				print(count - 1)
				done = True
			break
	if done:
		break
	done = False
	for i in range(x - index):
		if z >= count and i == x - index - 1:
			done = True
		if z > count:
			z -= count
		else:
			break
	if not done:
		print(count - 1)
		break
	count += 1


from sys import stdin, stdout
input = stdin.readline
list1 = [int(x) for x in input().split()]
ans = 0
for i in range(1, list1[0]):
	b = min(list1[1] // i, list1[2] // (list1[0] - i))
	ans = max(ans, b)
print(ans)


(n, a, b) = [int(a) for a in input().split()]
maxi = 1
for i in range(1, n):
	e = a // i
	f = b // (n - i)
	if min(e, f) > maxi:
		maxi = min(e, f)
print(maxi)


(z, n, m) = map(int, input().split())
ans = 0
for i in range(1, z):
	ans = max(ans, min(n / (z - i), m / i))
print(int(ans // 1))


def check(x):
	(x1, x2) = (a, b)
	ans = 0
	for i in range(n):
		if x1 - x >= 0:
			x1 -= x
			ans += 1
		elif x2 - x >= 0:
			x2 -= x
			ans += 1
	return ans == n
(n, a, b) = map(int, input().split())
max = -1
for x in range(1, min(a, b) + 1):
	if check(x):
		max = x
print(max)


(n, a, b) = list(map(int, input().strip().split(' ')))
ans = -1
for i in range(1, n):
	k = min(a // i, b // (n - i))
	ans = max(ans, k)
print(ans)


(n, a, b) = list(map(int, input().split()))
c = []
for i in range(1, n):
	if a // i > 0 and b // (n - i) > 0:
		c.append(min(a // i, b // (n - i)))
print(max(c))


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

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	(n, a, b) = LI()
	t = 0
	for i in range(1, 101):
		c = a // i
		c += b // i
		if c >= n:
			t = i
	return min(t, a, b)
print(main())


def main():
	nums = list(map(int, input().split()))
	(n, a, b) = (nums[0], nums[1], nums[2])
	visited = set()
	if n % 2 == 0:
		plates = (n / 2, n / 2)
	elif a > b:
		plates = (n // 2 + 1, n // 2)
	else:
		plates = (n // 2, n // 2 + 1)
	z = 0
	while plates not in visited:
		visited.add(plates)
		if plates[0] == 0 or plates[1] == 0:
			break
		x = a // plates[0]
		y = b // plates[1]
		z = max(z, min(x, y))
		if x > y:
			plates = (plates[0] + 1, plates[1] - 1)
		else:
			plates = (plates[0] - 1, plates[1] + 1)
	print(int(z))
main()


(n, a, b) = map(int, input().split())
fans = 0
for i in range(1, min(n, a + 1)):
	if b < n - i:
		continue
	an = min(b // (n - i), a // i)
	fans = max(an, fans)
print(fans)


(n, a, b) = [int(i) for i in input().strip().split()]
maxx = 0
for i in range(1, n):
	p_a = i
	p_b = n - i
	if min(a // p_a, b // p_b) > maxx:
		maxx = min(a // p_a, b // p_b)
print(maxx)


import math
(n, a, b) = map(int, input().split())
i = 1
m = -1
while i < n:
	x = a // i
	y = b // (n - i)
	if min(x, y) > m:
		m = min(x, y)
	i += 1
print(m)


(n, a, b) = map(int, input().split())
print(max([min(a // i, b // (n - i)) for i in range(1, n)]))


(n, a, b) = map(int, input().split())
x = 1
while a // x + b // x >= n:
	x += 1
print(min(x - 1, a, b))


(n, a, b) = list(map(int, input().split()))
for i in range(min(a, b), 0, -1):
	aa = a // i
	bb = b // i
	if aa + bb >= n:
		print(i)
		break


(n, a, b) = list(map(int, input().split()))
ans = 0
for x in range(1, min(a, b) + 1):
	k = a // x + b // x
	if k >= n:
		ans = x
print(ans)


a = list(map(int, input().split()))
ans = 0
for i in range(1, a[0]):
	b = min(a[1] // i, a[2] // (a[0] - i))
	ans = max(ans, b)
print(ans)


def good(m, min_tort, max_tort, n):
	if m > min_tort:
		return False
	n -= min_tort // m
	if n > 0:
		n -= max_tort // m
	if n <= 0:
		return True
	return False
(n, a, b) = map(int, input().split())
max_tort = max(a, b)
min_tort = min(a, b)
l = 1
r = (a + b) // n + 1
while r - l > 1:
	m = (l + r) // 2
	if good(m, min_tort, max_tort, n):
		l = m
	else:
		r = m
print(l)


(n, a, b) = [int(x) for x in input().split()]
for x in reversed(range(1, 1000000)):
	if a // x + b // x >= n and a // x > 0 and (b // x > 0):
		print(x)
		break


(n, a, b) = map(int, input().split())
ans = -1
for x in range(1, min(n, a) + 1):
	y = n - x
	if y > b or y == 0:
		continue
	ans = max(ans, min(a // x, b // y))
print(ans)


(n, a, b) = map(int, input().split())
t = 1
while a // t + b // t >= n:
	t += 1
if a // t + b // t == n:
	if t > a or t > b:
		print(min(a, b))
	else:
		print(t)
elif t - 1 > a or t - 1 > b:
	print(min(a, b))
else:
	print(t - 1)


(n, a, b) = list(map(int, input().split()))
arr = []
for i in range(1, n):
	arr.append(min((a // i, b // (n - i))))
print(max(arr))


(n, a, b) = map(int, input().split())
l = []
for x in range(1, n):
	l.append(min(a // x, b // (n - x)))
print(max(l))


import sys
(n, a, b) = (int(x) for x in input().split())
i = 1
ans = 0
minn = n
for i in range(1, minn):
	if ans < min(a // i, b // (n - i)):
		ans = min(a // i, b // (n - i))
print(ans)


import bisect

def list_output(s):
	print(' '.join(map(str, s)))

def list_input(s='int'):
	if s == 'int':
		return list(map(int, input().split()))
	elif s == 'float':
		return list(map(float, input().split()))
	return list(map(str, input().split()))
(n, a, b) = map(int, input().split())
res = 0
for m in range(1, n):
	x = a // m
	y = b // (n - m)
	res = max(res, min(x, y))
print(res)


best_solution = 1
(n, a, b) = [int(x) for x in input().strip().split(' ')]
for c in range(max(n - b, 1), min(n, a + 1)):
	current_solution = min(a // c, b // (n - c))
	if current_solution > best_solution:
		best_solution = current_solution
print(best_solution)


(n, a, b) = input().split(' ')
n = int(n)
a = int(a)
b = int(b)
mi = 0
for i in range(1, n):
	mi = max(mi, min(a // i, b // (n - i)))
print(mi)


(nop, part1, part2) = [int(x) for x in input().split()]
mins = [min(part1 // x, part2 // (nop - x)) for x in range(1, nop)]
print(max(mins))


(n, a, b) = map(int, input().split())
(a, b) = (max(a, b), min(a, b))
res = b
b1 = b // res
while n > b // res + a // res:
	res -= 1
print(res)


def main():
	(N, A, B) = map(int, input().split())
	if A < N:
		plt_a = A + 1
	else:
		plt_a = N
	x = 0
	for i in range(1, plt_a):
		a = A // i
		b = B // (N - i)
		x = max(x, min(a, b))
	print(x)
main()


q = input()
q = q.split()
n = int(q[0])
a = int(q[1])
b = int(q[2])
wq = 0
if a + b < n * 2:
	print(1)
else:
	for i in range(1, n):
		if min(a // i, b // (n - i)) > wq:
			wq = min(a // i, b // (n - i))
	print(wq)


(n, a, b) = map(int, input().split())
max_min = 0
for t1 in range(1, n):
	t2 = n - t1
	min1 = a // t1
	min2 = b // t2
	min_ = min(min1, min2)
	if max_min < min_:
		max_min = min_
print(max_min)


import math

def main():
	(n, a, b) = map(int, input().split())
	if n == a + b:
		print(1)
		return
	ans = 0
	for i in range(1, n):
		temp = min(a // i, b // (n - i))
		ans = max(temp, ans)
	print(ans)
	return
main()


(n, a, b) = map(int, input().split())
mp = min(int((a + b) / n), a, b)
while True:
	if a // mp + b // mp < n:
		mp -= 1
	else:
		print(mp)
		break


(n, a, b) = map(int, input().split())
i = a + b
f = 0
while 1:
	if a // i == 0 or b // i == 0:
		f = 0
	elif a // i + b // i >= n:
		print(i)
		break
	i -= 1


(n, a, b) = map(int, input().split())
num = 0
for i in range(1, min(a + 1, b + 1)):
	if n <= a // i + b // i:
		num = max(num, i)
print(num)


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

def can(x):
	aa = a // x
	bb = b // x
	if aa + bb < n or min(aa, bb) == 0:
		return False
	return True
lo = 1
hi = (a + b) // n
while lo < hi:
	mid = lo + (hi - lo + 1 >> 1)
	if can(mid):
		lo = mid
	else:
		hi = mid - 1
print(lo)


from sys import exit
(n, a, b) = map(int, input().split())

def ok(x, n, a, b):
	cnt = 0
	if x > a or x > b:
		return False
	a -= x
	b -= x
	cnt = 2
	while a > 0:
		if a >= x:
			cnt += 1
			a -= x
		else:
			break
	while b > 0:
		if b >= x:
			cnt += 1
			b -= x
		else:
			break
	if cnt >= n:
		return True
	return False
ans = 0
for x in range(1, 202):
	if ok(x, n, a, b):
		ans = x
print(ans)


import sys
import math
import random
input = sys.stdin.readline

def inp():
	return int(input())

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

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(n, a, b) = invr()
ans = 0
for i in range(1, min(a, b) + 1):
	tempa = a
	tempb = b
	j = 0
	while tempa >= i and j < n:
		tempa -= i
		j += 1
	while tempb >= i and j < n:
		tempb -= i
		j += 1
	if j == n:
		ans = i
print(ans)


(n, a, b) = map(int, input().split())
y = 0
for x in range(1, n):
	u = min(int(a / x), int(b / (n - x)))
	if y < u:
		y = u
print(y)


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

def check(x):
	A = a
	B = b
	if A >= x and B >= x:
		A -= x
		B -= x
	else:
		return False
	for i in range(n - 2):
		if A >= x:
			A -= x
		elif B >= x:
			B -= x
		else:
			return False
	return True
l = 0
r = a + b
while l + 1 < r:
	m = (l + r) // 2
	if check(m):
		l = m
	else:
		r = m
print(l)


def bs(a, b, c, d):
	return b // d + c // d >= a
(a, b, c) = map(int, input().split())
lo = 2
hi = min(b, c)
ans = 1
while lo <= hi:
	mid = lo + (hi - lo) // 2
	if bs(a, b, c, mid):
		ans = mid
		lo = mid + 1
	else:
		hi = mid - 1
print(ans)


(n, a, b) = map(int, input().split())
(a, b) = (max(a, b), min(a, b))
m = [0 for i in range(n)]
c = []
for i in range(1, n):
	mi = 10000001
	for j in range(i, n):
		m[j] = a // (n - i)
	for j in range(i):
		m[j] = b // i
	if m.count(0) == 0:
		for j in m:
			if j != 0:
				if mi > j:
					mi = j
		c.append(mi)
print(max(c))


import sys
readline = sys.stdin.readline
(N, A, B) = map(int, readline().split())
ans = 0
for k in range(1, N):
	ans = max(ans, min(A // k, B // (N - k)))
print(ans)


(n, a, b) = [int(i) for i in input().split()]
for i in range(100, 0, -1):
	pa = a // i
	pb = n - pa
	if pa != 0:
		if b // i >= pb and i <= min(a, b):
			print(i)
			exit(0)


(n, a, b) = map(int, input().split())
maxi = int((a + b) / n)
for i in range(maxi, 0, -1):
	if int(b / i) + int(a / i) >= n:
		print(min(i, a, b))
		break


(n, a, b) = [int(x) for x in input().split()]

def check(x):
	if x * n > a + b:
		return False
	if x > a or x > b:
		return False
	return a // x + b // x >= n
for i in range(1, a + b + 1):
	if not check(i):
		print(i - 1)
		break


(n, a, b) = map(int, input().split())
(l, r) = (1, min(a, b))
while l < r:
	mid = l + r + 1 >> 1
	if a // mid + b // mid >= n:
		l = mid
	else:
		r = mid - 1
print(l)


line = input()
line = line.split(' ')
n = int(line[0])
numPiecesA = int(line[1])
numPiecesB = int(line[2])
minPieces = 0
if numPiecesA > numPiecesB:
	(numPiecesA, numPiecesB) = (numPiecesB, numPiecesA)
for i in range(1, numPiecesA + 1):
	if numPiecesA // i + numPiecesB // i >= n:
		if i > minPieces:
			minPieces = i
print(minPieces)


(n, a, b) = map(int, input().split())
if a > b:
	(a, b) = (b, a)
x = 0
for i in range(1, n):
	w = a // i
	y = b // (n - i)
	if w >= 1 and y >= 1:
		x = max(x, min(w, y))
print(x)


l = input().split(' ')
n = int(l[0])
a = int(l[1])
b = int(l[2])
p = (a + b) // n
m = n - a // p - b // p
c = a % p
d = b % p
if a < p or b < p:
	print(min(a, b))
elif m == 1:
	print(max(a // (a // p + 1), b // (b // p + 1)))
else:
	print(min(p + c // (a // p), p + d // (b // p)))


(n, a, b) = map(int, input().split())
m = min((a + b) // n + 1, min(a, b))
for i in range(2, m + 1):
	if a // i + b // i < n:
		print(i - 1)
		exit()
print(m)


a = [int(s) for s in input().split()]
(n, a, b) = (a[0], a[1], a[2])
m = 0
for i in range(1, n):
	s = [0] * n
	for x in range(a):
		s[x % i] += 1
	for x in range(b):
		s[i + x % (n - i)] += 1
	mm = min(s)
	m = max(m, mm)
print(m)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
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 value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def possible(x):
	n1 = a // x
	n2 = b // x
	return n1 + n2 >= n
(n, a, b) = value()
low = 1
high = min(a, b)
while low <= high:
	mid = low + (high - low) // 2
	if possible(mid):
		ans = mid
		low = mid + 1
	else:
		high = mid - 1
print(ans)


arr = list(map(int, input().split()))
n = arr[0]
a = arr[1]
b = arr[2]
x = 1
maxx = 0
while x != n:
	maxx = max(maxx, min(a / x, b / (n - x)))
	x += 1
print(int(maxx))


(n, a, b) = list(map(int, input().split()))
x = 0
for i in range(1, n):
	x = max(min(a / i, b / (n - i)), x)
print(int(x))


(n, a, b) = map(int, input().split())
f = 0
for i in range(1, n):
	var = min(a // i, b // (n - i))
	f = max(var, f)
print(f)


(n, a, b) = list(map(int, input().split()))
answ = 0
for fir in range(1, n):
	sec = n - fir
	answ = max(answ, min(a // fir, b // sec))
print(answ)


(n, a, b) = map(int, input().split())
for i in range(200, 0, -1):
	if a // i > 0 and b // i > 0 and (a // i + b // i >= n):
		print(i)
		break


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

def solve():
	x = 1
	for n in range(1, N):
		x = max(x, min(a // n, b // (N - n)))
	print(x)
solve()


def cake_rule(n, a, b):
	m = min(a, b)
	for i in range(m):
		if a // (i + 1) + b // (i + 1) >= n:
			s = i + 1
	return s
(N, A, B) = [int(j) for j in input().split()]
print(cake_rule(N, A, B))


from sys import stdin, stdout
INF = float('inf')
(n, a, b) = map(int, stdin.readline().split())
(l, r) = (1, 200)
while r - l > 1:
	m = l + r >> 1
	if b // m and a // m and (a // m + b // m >= n):
		l = m
	else:
		r = m
stdout.write(str(l))


(n, a, b) = [int(a) for a in input().strip().split()]
max_num = min(a, b)
while a // max_num + b // max_num < n:
	max_num -= 1
print(str(max_num))


from math import floor
(n, a, b) = map(int, input().split())
ans = -1
for i in range(1, n):
	temp = min(floor(a / i), floor(b / (n - i)))
	ans = max(ans, temp)
print(ans)


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

def check(x):
	one = a
	two = b
	for i in range(n):
		if one >= x:
			one -= x
		elif two >= x:
			two -= x
		else:
			return 0
	return 1
for i in range(200):
	if check(i):
		ans = i
if ans > min(a, b):
	ans = min(a, b)
print(ans)


(n, a, b) = [int(a) for a in input().split()]
i = 1
if a // 1 + b // 1 < n:
	print(i - 1)
else:
	while a // i + b // i >= n:
		i += 1
	if a // i != 0 and b // i != 0:
		print(i - 1)
	elif b // i == 0:
		for m in range(1, b + 1):
			if a // m + b // m < n:
				break
		i = m
		print(i)
	elif a // i == 0:
		for m in range(1, a + 1):
			if a // m + b // m < n:
				break
		i = m
		print(i)


(n, a, b) = list(map(int, input().split(' ')))
ans = 0
for i in range(1, n):
	m = min(a // i, b // (n - i))
	if m > ans:
		ans = m
print(ans)


(n, a, b) = map(int, input().split())
mn = min(a, b)
mx = a + b - mn
for i in range(mn, 0, -1):
	if n == mn // i:
		if mx >= mn // (n - 1):
			print(i)
			exit(0)
	elif mx // (n - mn // i) >= i:
		print(i)
		exit(0)
print(1)


(n, a, b) = map(int, input().split())
mx = -1
for x in range(1, min(a, b) + 1):
	if a // x + b // x >= n:
		mx = max(mx, x)
print(mx)


(N, a, b) = map(int, input().split(' '))
if N == a + b:
	print('1')
elif a >= b * N or b >= N * a:
	if a > b:
		print(b)
	else:
		print(a)
elif a == b and N == 2:
	EE = int((a + b) // N)
	print(EE)
else:
	if a > b:
		a1 = a
		b1 = b
		i = 1
	else:
		b1 = a
		a1 = b
		i = 1
	while i < a1 + 1:
		w = int(b1 // i)
		w1 = int(a1 // i)
		if w + w1 >= N:
			i = i + 1
		else:
			result = i - 1
			break
	print(result)


(n, a, b) = input().split()
(n, a, b) = [int(n), int(a), int(b)]
a0 = min(a, b, (a + b) // n)
A = min(a, b)
B = max(a, b)
C = 0
while 1:
	C = 0
	b0 = A // a0
	if A % a0 < a0:
		C += b0
	else:
		C += b0 + 1
	b1 = B // a0
	if B % a0 < a0:
		C += b1
	else:
		C += b1 + 1
	if C >= n:
		print(a0)
		break
	else:
		a0 -= 1


(x, y, c, i, l, s, st, lt) = (0, 0, 0, 1, [], [], [], [])
(n, a, b) = map(int, input().split())
if a >= b:
	a = a
	b = b
else:
	m = a
	a = b
	b = m
l.append(min(int(a / n), b))
l.append(min(int(b / n), a))
n = n - 1
while True:
	r = int(a / n)
	l1 = int(b / i)
	l.append(min(r, l1))
	n = n - 1
	if n == 0:
		break
	i = i + 1
print(max(l))


from math import *
from bisect import *
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(1):
	(n, a, b) = M()
	ans = -1
	for i in range(1, min(a, b) + 1):
		if a // i + b // i >= n:
			ans = max(ans, i)
	print(ans)


(n, a, b) = map(int, input().split())
c = int(n * (a / (a + b)))
d = n - c
from math import ceil
cc = ceil(n * (a / (a + b)))
dd = n - cc
opts = []
if c != 0 and d != 0:
	opts.append(min(a // c, b // d))
if cc != 0 and dd != 0:
	opts.append(min(a // cc, b // dd))
print(max(opts))


inp = list(map(int, input().split()))
n = inp[0]
a = inp[1]
b = inp[2]
x = (a + b) // n
k = n - 1
l = []
for i in range(1, n):
	l.append(min(a // (n - i), b // i))
print(max(l))


(n, a, b) = list(map(int, input().split()))
for i in range(1, 101, 1):
	if a // i > 0 and b // i > 0 and (a // i + b // i >= n):
		continue
	else:
		print(i - 1)
		break


def check(x):
	return pa // x + pb // x >= n
(n, pa, pb) = [int(x) for x in input().split()]
mx = min(pa, pb)
mn = 1
x = (mx + mn) // 2
if check(mx):
	print(mx)
else:
	while x > mn:
		if check(x):
			mn = x
		else:
			mx = x
		x = (mx + mn) // 2
	print(x)


(zh, nh, mmm) = list(map(int, input().split()))
asss = 0
for i in range(1, zh):
	asss = max(asss, min(nh / (zh - i), mmm / i))
print(int(asss // 1))


(n, a, b) = map(int, input().split())
ans = 0
for x in range(1, n):
	ans = max(ans, min(a // x, b // (n - x)))
print(ans)


(n, a, b) = [int(v) for v in input().split()]
best = 0
for k in range(1, n):
	fst = k
	snd = n - k
	best = max(best, min(a // fst, b // snd))
print(best)


(n, a, b) = map(int, input().split())
(a, b) = (min(a, b), max(a, b))
(left, right) = (0, a + 1)
maxmin = 1
for i in range(1, a + 1):
	m = a // i
	if m < n and (n - m) * i <= b:
		maxmin = i
print(maxmin)


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

def can(x):
	return a // x + b // x >= n and a // x > 0 and (b // x > 0)
l = 0
r = a + b
while r - l > 1:
	m = (r + l) // 2
	if can(m):
		l = m
	else:
		r = m
print(l)


(n, a, b) = [int(x) for x in input().split()]
mxmn = max((min(a // i, b // (n - i)) for i in range(1, n)))
print(mxmn)


(n, a, b) = [int(i) for i in input().split(' ')]
x = 1
while True:
	a_left = a
	b_left = b
	success = True
	index = 0
	if a_left >= x:
		a_left -= x
		index += 1
	else:
		success = False
	if b_left >= x:
		b_left -= x
		index += 1
	else:
		success = False
	while index < n and success:
		while index < n:
			if a_left >= x:
				a_left -= x
				index += 1
			else:
				break
		if index >= n:
			break
		while index < n:
			if b_left >= x:
				b_left -= x
				index += 1
			else:
				success = False
				break
	if not success:
		x -= 1
		break
	else:
		x += 1
print(x)


def main():
	inputs = input().split()
	inputs = [int(x) for x in inputs]
	n = inputs[0]
	a = inputs[1]
	b = inputs[2]
	for i in range(1, 150):
		if i * n > a + b:
			print(i - 1)
			return
		else:
			firstSet = a // i
			secondSet = b // i
			if firstSet == 0 or secondSet == 0:
				print(i - 1)
				return
			if firstSet + secondSet >= n:
				continue
			else:
				print(i - 1)
				return
main()


(n, a, b) = map(int, input().split())
for i in range(1, min(a, b) + 1):
	if a // i + b // i >= n:
		ans = int(i)
	else:
		break
print(ans)


import sys
(n, a, b) = map(int, input().split())
max1 = -sys.maxsize
for i in range(1, n):
	max1 = max(max1, min(a // i, b // (n - i)))
print(max1)


import sys
f = sys.stdin
(n, a, b) = list(map(int, f.readline().split()))
l = 1
r = a + b
min_p = -1
while l <= r:
	m = (l + r) // 2
	if a // m > 0 and b // m > 0 and (a // m + b // m >= n):
		l = m + 1
		min_p = m
	else:
		r = m - 1
print(min_p)


(n, a, b) = list(map(int, input().split()))
for x in range(1, 110):
	if a // x + b // x < n or a < x or b < x:
		print(x - 1)
		break


(n, a, b) = [int(z) for z in input().split()]

def check(m):
	one = a // m
	two = b // m
	return one + two >= n
l = 0
r = 10000000000
while r - l != 1:
	m = (l + r) // 2
	if check(m):
		l = m
	else:
		r = m
print(min(a, b, l))


(n, a, b) = [int(x) for x in input().split()]
i = 1
while a // i + b // i >= n:
	i += 1
print(min(i - 1, min(a, b)))


def main():
	(n, a, b) = map(int, input().split())
	ans = min(a // n, b // n)
	for x in range(1, n):
		y = n - x
		ans = max(ans, min(a // x, b // y))
	print(ans)
main()


(x, y, z) = list(map(int, input().split()))
ans = 0
for i in range(1, x):
	kt = x - i
	ans = max(ans, min(y // i, z // kt))
print(ans)


from sys import exit
(n, a, b) = map(int, input().split())
plates = []
ans = []
for i in range(1, n):
	plates.append((a // i, b // (n - i)))
for j in plates:
	if 0 not in j:
		ans.append(min(j))
print(max(ans))


(n, a, b) = map(int, input().split())
i = 1
j = n - 1
l = []
while i < n and j > 0:
	l.append(min(a // i, b // j))
	i = i + 1
	j = j - 1
print(max(l))


(n, a, b) = map(int, input().split())
t = -1
if a < b:
	t = a
else:
	t = b
while t > 0:
	if a // t + b // t >= n:
		print(t)
		break
	t = t - 1


def poss(n, a, b, x):
	if x == 0:
		return False
	if n >= 2 and n <= a // x + b // x and (x <= min(a, b)):
		return True
	else:
		return False
(n, a, b) = map(int, input().split())
start = 1
end = min(a, b)
while True:
	ans = (start + end) // 2
	if poss(n, a, b, ans) and (not poss(n, a, b, ans + 1)):
		print(ans)
		exit(0)
	elif not poss(n, a, b, ans):
		end = ans - 1
	else:
		start = ans + 1


(n, a, b) = list(map(int, input().strip().split()))
x = 1
while True:
	prva = a // x
	druga = b // x
	if prva + druga < n:
		x -= 1
		break
	x += 1
x = min(x, a, b)
print(x)


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

def good(x):
	return x <= a and x <= b and (a // x + b // x >= n)

def solve(n, a, b):
	l = 1
	r = max(a, b) + 1
	while r - l > 1:
		m = (l + r) // 2
		if good(m):
			l = m
		else:
			r = m
	return l
print(solve(n, a, b))


import sys
(n, a, b) = (int(x) for x in input().split())
(i, st) = (1, min(a, b))
while i <= st and a // i + b // i >= n:
	i += 1
print(i - 1)


(n, a, b) = [int(i) for i in input().split()]
ans = 0
for i in range(1, min(a, b) + 1):
	if a // i + b // i >= n:
		ans = i
print(ans)


(n, a, b) = map(int, input().split())
mini = 1
while a // mini + b // mini >= n and a // mini >= 1 and (b // mini >= 1):
	mini += 1
print(max(mini - 1, 1))


(z, zz, dgraphs, mod) = (input, lambda : list(map(int, z().split())), {}, 10 ** 9 + 7)
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
(n, a, b) = zz()
ans = []
for i in range(1, n):
	ans.append(min(a // (n - i), b // i))
print(max(ans))


def main(a, b, n):
	(l, h) = (1, 100)
	while l < h:
		m = (l + h) // 2
		if a // m and b // m and (a // m + b // m >= n):
			l = m + 1
		else:
			h = m
	return l - 1
(n, a, b) = list(map(int, input().split()))
print(main(a, b, n))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
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')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 10 ** 9 + 7

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(n, a, b) = sep()
	ans = 0
	for i in range(1, n):
		if i > a or n - i > b:
			continue
		temp = min(a // i, b // (n - i))
		ans = max(ans, temp)
	print(ans)
testcase(1)


import sys
(nbInvites, a, b) = map(int, sys.stdin.readline().split())
g1 = 1
g2 = nbInvites - 1
mini = list()
for loop in range(1, nbInvites):
	if a >= g1 and b >= g2:
		mini.append(min(a // g1, b // g2))
	g1 += 1
	g2 -= 1
print(max(mini))


(n, a, b) = map(int, input().split())
best = 0
for plates in range(1, n):
	best = max(best, min(a // plates, b // (n - plates)))
print(best)


(n, a, b) = map(int, input().split())
maxx = 0
for i in range(1, n):
	ax = a // i
	bx = b // (n - i)
	maxx = max(maxx, min(ax, bx))
print(maxx)


(n, a, b) = input().split()
a = int(a)
b = int(b)
n = int(n)
l = []
for i in range(1, n):
	num = min(a / i, b / (n - i))
	l.append(num)
l.sort()
print(int(l[-1]))


(n, a, b) = map(int, input().split())
l = 0
r = 200
ans = 0
while r - l > 1:
	m = r + l >> 1
	if b // m and a // m and (a // m + b // m >= n):
		l = m
	else:
		r = m
print(l)


R = lambda : map(int, input().split())
(n, a, b) = R()
print(max([min(a // x if x else 0, b // (n - x) if x != n else 0) for x in range(0, n + 1)]))


(n, a, b) = [int(x) for x in input().split()]
for mi in range(int((a + b) / n), 0, -1):
	if mi > a or mi > b:
		continue
	c1 = int(a / mi)
	c2 = int(b / mi)
	if c1 + c2 >= n:
		print(mi)
		break


(n, a, b) = map(int, input().split())
j = -10 ** 9
for _ in range(1, n):
	j = max(j, min(a // _, b // (n - _)))
print(j)


s = list(map(int, input().split()))
n = s[0]
a = s[1]
b = s[2]
per_plate = 0
while True:
	per_plate += 1
	if a // per_plate + b // per_plate < n or a // per_plate == 0 or b // per_plate == 0:
		per_plate -= 1
		break
print(per_plate)


(n, a, b) = list((int(t) for t in input().rstrip().split(' ')))
if a > b:
	big = a
	small = b
else:
	small = a
	big = b
pieces = 0
while True:
	pieces += 1
	pieces_small = small // pieces
	pieces_big = big // pieces
	if pieces_small + pieces_big < n or pieces_small == 0 or pieces_big == 0:
		pieces -= 1
		break
print(pieces)


for i in range(1):
	(n, m, k) = map(int, input().split())
	s = 1
	x = 0
	while n - s > 0:
		z = min(m // s, k // (n - s))
		x = max(x, z)
		s += 1
	print(x)


inputs = input().split()
(n, a, b) = [int(x) for x in inputs]
largest_min = 0
for i in range(1, n):
	current_min = min(a // i, b // (n - i))
	if current_min > largest_min:
		largest_min = current_min
print(largest_min)


(n, a, b) = map(int, input().split())
x = 1
for a_plates in range(1, n):
	b_plates = n - a_plates
	my_min = a + b
	if a_plates > a or b_plates > b:
		continue
	if int(a / a_plates) < my_min:
		my_min = int(a / a_plates)
	if int(b / b_plates) < my_min:
		my_min = int(b / b_plates)
	if my_min > x:
		x = my_min
print(x)


(n, a1, b1) = map(int, input().split())
a = min(a1, b1)
b = max(a1, b1)
li = []
for i in range(1, n):
	if int(a // i) > 0 and int(b // (n - i) > 0):
		li.append(min(int(a // i), int(b // (n - i))))
print(max(li))


from sys import stdin
from math import floor

def get_ints():
	return list(map(int, stdin.readline().strip().split()))
(n, a, b) = get_ints()
ans = 1
for x in range(1, n):
	ans = max(ans, min(floor(a / x), floor(b / (n - x))))
print(ans)


def main():
	from sys import stdin, stdout
	(n, a, b) = map(int, stdin.readline().split())
	maxim = -1
	for i in range(1, n):
		maxim = max(min(a // i, b // (n - i)), maxim)
	stdout.write(str(maxim))
main()


R = lambda : map(int, input().split())
(n, a, b) = R()
ans = 0
for t in range(1, n):
	x = min(a // t, b // (n - t))
	if x > ans:
		ans = x
print(ans)


import math
inp = input().split(' ')
plates = int(inp[0])
cakeA = int(inp[1])
cakeB = int(inp[2])
onplate = math.floor((cakeA + cakeB) / plates)
while plates > math.floor(cakeA / onplate) + math.floor(cakeB / onplate):
	onplate = onplate - 1
x = min(cakeA, cakeB)
if onplate > x:
	print(x)
else:
	print(onplate)


(n, a, b) = map(int, input().split())
vars_ = []
out = 0
while out <= 101:
	out += 1
	cout_a = a // out
	cout_b = b // out
	if cout_a + cout_b >= n:
		vars_.append(out)
print(min((max(vars_), a, b)))


def arr_inp():
	return [int(x) for x in stdin.readline().split()]
from sys import stdin
from math import floor, ceil
(n, a, b) = arr_inp()
if a == b:
	if n & 1:
		print(b // ceil(n / 2))
	else:
		print(b // floor(n / 2))
else:
	(ma, mi) = (max(a, b), min(a, b))
	(div1, div2) = (mi / (a + b) * n, ma / (a + b) * n)
	try:
		print(max(min(floor(mi / floor(div1)), mi, floor(ma / ceil(div2))), min(floor(mi / ceil(div1)), mi, floor(ma / floor(div2)))))
	except:
		print(min(floor(mi / ceil(div1)), mi, floor(ma / floor(div2))))


import sys
(n, a, b) = map(int, input().split())
ans = 0
for i in range(1, n):
	ans = max(ans, min(a // i, b // (n - i)))
print(ans)


def binary_search(left, right, n, cake1, cake2):
	if left == right:
		return left
	mid = left + right
	if cake1 // mid + cake2 // mid < n:
		return binary_search(left, mid - 1, n, cake1, cake2)
	else:
		return binary_search(mid, right, n, cake1, cake2)
seq = list(map(int, input().split(' ')))
x = min((seq[1] + seq[2]) // seq[0], seq[1], seq[2])
print(binary_search(0, x, seq[0], seq[1], seq[2]))


import math
(n, a, b) = map(int, input().split())
i = 1
m = 0
while i < n:
	p = a // i
	q = b // (n - i)
	y = min(p, q)
	if y > m:
		m = y
	i = i + 1
print(m)


R = lambda : map(int, input().split())
INF = float('inf')
(n, a, b) = R()
(L, R) = (0, min(a, b))
judge = lambda per: a // per + b // per >= n
while L < R:
	mid = L + (R - L + 1) // 2
	if judge(mid):
		L = mid
	else:
		R = mid - 1
print(L)


(n, a, b) = map(int, input().split())
ans = -1
for i in range(1, 1000):
	temp = a // i + b // i
	if min(a // i, b // i) == 0:
		pass
	elif temp >= n:
		ans = max(i, ans)
print(ans)


import math
(n, a, b) = map(int, input().split())
mx = 0
for i in range(1, n):
	t = int(min(a / i, b / (n - i)))
	if t >= mx:
		mx = t
print(mx)


(n, a, b) = map(int, input().split())
for i in range(1, max(a, b) + 2):
	if a // i + b // i >= n and min(a, b) >= i:
		continue
	else:
		break
print(i - 1)


import math
m = 0
(n, a, b) = map(int, input().split())
for i in range(1, n):
	if i <= a and n - i <= b:
		m = max(m, min(a // i, b // (n - i)))
print(m)


import re
theNumbers = re.split('\\s', input())
x = int(theNumbers[0])
y = int(theNumbers[1])
z = int(theNumbers[2])
count = 0
possible = True
plates = x
maxim = 0
for x1 in range(1, x):
	minim = min(int(y / x1), int(z / (x - x1)))
	if minim > maxim:
		maxim = minim
print(maxim)


from math import *
import threading
import sys
mod = 10 ** 9
inf = 10 ** 6
yes = 'YES'
no = 'NO'

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def graph(n, m):
	adj = dict()
	for i in range(1, n + 1):
		adj.setdefault(i, 0)
	for i in range(m):
		(a, b) = map(int, input().split())
		adj[a] += 1
		adj[b] += 1
	return adj

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	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, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def dist(a, b):
	d = abs(a[1] - b[1]) + abs(a[2] - b[2])
	return d

def power_of_n(x, n):
	cnt = 0
	while x % n == 0:
		cnt += 1
		x //= n
	return cnt
import itertools
sys.setrecursionlimit(300000)
for _ in range(1):
	(n, a, b) = map(int, input().split())
	ans = 0
	for i in range(1, n):
		ans = max(min(a // i, b // (n - i)), ans)
	print(ans)


[n, a, b] = [int(x) for x in input().split(' ')]
lower = 1
upper = (a + b) // n
minCakes = (lower + upper) // 2
while upper > lower:
	if a // minCakes + b // minCakes >= n and a >= minCakes and (b >= minCakes):
		lower = minCakes
	else:
		upper = minCakes
	if upper - lower == 1:
		if a // upper + b // upper >= n and a >= upper and (b >= upper):
			minCakes = upper
		else:
			minCakes = lower
		break
	else:
		minCakes = (lower + upper) // 2
print(minCakes)


def main():
	(n, a, b) = map(int, input().split())
	confs = []
	for i in range(1, n):
		cake1 = a // i
		cake2 = b // (n - i)
		confs.append(min(cake1, cake2))
	print(max(confs))
main()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
from collections import *
ORDA = 97

def ii():
	return int(input())

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

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True

def function(arr, size, dp):
	if size == 1 or size == 0:
		return 1
	key = ''.join(map(str, arr[:size]))
	if dp[key]:
		return dp[key]
	output = function(arr, size - 1, dp)
	key = ''.join(map(str, arr[:size - 1]))
	dp[key] = output
	if arr[size - 2] * 10 + arr[size - 1] <= 26:
		output += function(arr, size - 2, dp)
		key = ''.join(map(str, arr[:size - 2]))
		dp[key] = output
	return output

def main():
	(n, a, b) = mi()
	if a < b:
		(a, b) = (b, a)
	sa = n - 1
	sb = 1
	ans = 0
	while sa >= 1:
		aa = min(a // sa, b // sb)
		if aa < ans:
			break
		ans = max(ans, aa)
		sa -= 1
		sb += 1
	print(ans)
main()


(n, a, b) = map(int, input().split())
r = set()
for m in range(1, n):
	r.add(min(a // m, b // (n - m)))
print(max(r))


(n, a, b) = [int(x) for x in input().split()]
max1 = 0
for i in range(1, n):
	if min(int(a / i), int(b / (n - i))) > max1:
		max1 = min(int(a / i), int(b / (n - i)))
print(max1)


(n, a, b) = [int(x) for x in input().split()]
mins = []
for i in range(1, n):
	tf = i
	ts = n - i
	mins.append(min(a // tf, b // ts))
print(max(mins))


(n, a, b) = list(map(int, input().strip().split()))
if a + b < n:
	print(0)
else:
	x = 2
	while True:
		if a // x + b // x >= n and a // x >= 1 and (b // x >= 1):
			x += 1
		else:
			print(x - 1)
			break


(n, a, b) = [int(x) for x in input().strip().split()]
ans = -1
for i in range(1, n):
	ans = max(ans, min(float('inf') if n - i == 0 else a // (n - i), float('inf') if i == 0 else b // i))
print(ans)


import sys
(n, a, b) = map(int, input().split())
x = 0
for i in range(1, n):
	aa = a / i
	bb = b / (n - i)
	aa = int(aa)
	bb = int(bb)
	x = max(x, min(aa, bb))
print(x)


(n, a, b) = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
	l = i + 1
	r = n - 1 - i
	val = min(a // l, b // r)
	ans = max(ans, val)
print(ans)


(n, a, b) = map(int, input().split())
le = 1
ri = min(a, b) + 1
while le + 1 < ri:
	m = (le + ri) // 2
	t = a // m + b // m
	if t < n:
		ri = m
	else:
		le = m
print(le)


from math import floor
from math import ceil
(n, a, b) = [int(p) for p in input().split()]
diff = -float('inf')
div = None
for i in range(1, n):
	diff = max(diff, min(floor(a / i), floor(b / (n - i))))
print(diff)


a = [int(i) for i in input().split()]
n = a[0]
b = a[2]
a = a[1]
if a // n > b:
	print(b)
elif b // n > a:
	print(a)
else:
	for i in range(1, min(a, b) + 1):
		if a // i + b // i >= n:
			D = i
	print(D)


def main():
	(n, a, b) = [int(num) for num in input().split()]
	if a + b == n:
		print(1)
	else:
		fullfilled = True
		minm = None
		for i in range(1, min(a, b) + 1):
			if min(a, b) // i == 1:
				minm_piece = min(a, b)
				guest = 1
			else:
				minm_piece = i
				guest = min(a, b) // i
			if n - guest == 0:
				continue
			elif n - guest > max(a, b):
				break
			elif minm == None:
				if n - guest == 1:
					left = max(a, b)
				else:
					left = max(a, b) // (n - guest)
				minm = min(minm_piece, left)
			else:
				if n - guest == 1:
					left = max(a, b)
				else:
					left = max(a, b) // (n - guest)
				minm = max(minm, min(minm_piece, left))
		print(minm)
main()


s = input().split()
n = int(s[0])
a = int(s[1])
b = int(s[2])
mx = a + b
st = False
while mx >= 1:
	if st:
		break
	for i in range(1, n):
		if st:
			break
		for j in range(1, n):
			if i * mx <= a and j * mx <= b and (i + j == n):
				print(mx)
				st = True
				break
	mx -= 1


(plate, c1, c2) = [int(i) for i in input().split(' ')]
ans = 0
for x in range(1, plate):
	ans = max(ans, min(c1 // x, c2 // (plate - x)))
print(ans)


def fn(Cake, X):
	if Cake < X:
		return -1
	return Cake // X
(n, a, b) = list(map(int, input().split()))
print(max([min(fn(a, i), fn(b, n - i)) for i in range(1, n)]))


import sys
(n, a, b) = map(int, sys.stdin.readline().split())
maxa = 0
for i in range(1, n):
	j = min(a // i, b // (n - i))
	if j > maxa:
		maxa = j
print(maxa)


from math import ceil
(n, a, b) = map(int, input().split())
m = 1
for i in range(1, n):
	if i <= a:
		if n - i <= b:
			m = max(m, min(a // i, b // (n - i)))
print(m)


(n, a, b) = map(int, input().split())
ans = 0
for i in range(1, n):
	m1 = int(a / i)
	m2 = int(b / (n - i))
	ans = max(ans, min(m1, m2))
print(ans)


from collections import deque as de
import math
from collections import Counter as cnt

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic
(n, a, b) = map(int, input().split())
for i in range(min(a, b), 0, -1):
	if a // i + b // i >= n:
		break
print(i)


from math import ceil
(plates, a, b) = [x for x in map(int, input().split())]
maxMinCakes = -1
for i in range(1, plates):
	left = a // i
	right = b // (plates - i)
	if not (right == 0 or left == 0):
		maxMinCakes = max(maxMinCakes, min(left, right))
print(maxMinCakes)


(n, a, b) = [int(i) for i in input().split()]
ans = 0
for n1 in range(1, n):
	n2 = n - n1
	x1 = a // n1
	x2 = b // n2
	ans = max(ans, min(x1, x2))
print(ans)


def getinput():
	return [int(x) for x in input().strip().split()]
(n, a, b) = getinput()
ans = 0
for i in range(1, n):
	ans = max(ans, min(a // i, b // (n - i)))
print(ans)


(n, a, b) = map(int, input().split())
ans = None
for divider in range(1, n):
	if ans is None:
		ans = min(a // divider, b // (n - divider))
	else:
		temp = min(a // divider, b // (n - divider))
		ans = max(temp, ans)
print(ans)


(n, a, b) = map(int, input().split(' '))
ans = (a + b) // n
for i in range(ans, 0, -1):
	a_num = a // i
	b_num = b // i
	if a_num + b_num >= n and a_num >= 1 and (b_num >= 1):
		ans = i
		break
print(ans)


(n, a, b) = map(int, input().split())
ans = 0
for i in range(1, 102):
	if a // i + b // i >= n and a // i >= 1 and (b // i >= 1):
		ans = i
print(ans)


(q, w, e) = map(int, input().split())
s = w + e
tt = s // q
while w // tt + e // tt < q:
	tt -= 1
if tt > min(w, e):
	tt = min(w, e)
print(tt)


import math
(n, a, b) = list(map(int, input().split(' ')))
ans = 0
for i in range(1, n):
	ans = max(ans, min(math.floor(a / i), math.floor(b / (n - i))))
print(ans)


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)

def ok(x):
	if a < x or b < x:
		return False
	if a // x + b // x >= n:
		return True
	return False
(n, a, b) = map(int, input().split())
(low, high) = (1, a + b)
while low <= high:
	mid = (low + high) // 2
	if ok(mid):
		ans = mid
		low = mid + 1
	else:
		high = mid - 1
print(ans)


(n, a, b) = map(int, input().split())
x = 1
while x <= a and x <= b:
	if a // x + b // x >= n:
		x += 1
	else:
		break
print(x - 1)


(plates_nr, f_pieces_nr, s_pieces_nr) = (int(x) for x in input().split())
for x in range(min(f_pieces_nr, s_pieces_nr), -1, -1):
	max_plates = f_pieces_nr // x + s_pieces_nr // x
	if max_plates >= plates_nr:
		print(x)
		quit()


(n, a, b) = map(int, input().split())
lis = []
for i in range(1, n):
	if n - i <= b:
		lis.append(min(a // i, b // (n - i)))
print(max(lis))


(n, a, b) = map(int, input().split())
m = 0
for ap in range(1, n):
	cm = min(a // ap, b // (n - ap))
	m = max(m, cm)
print(m)


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

def mint(q, w, e):
	for i in range(200, 0, -1):
		if a // i + b // i >= n and a // i >= 1 and (b // i >= 1):
			return i
print(mint(n, a, b))


(a, b, c) = map(int, input().split())
val = 0
for i in range(1, a):
	t = min(b // i, c // (a - i))
	val = max(val, t)
print(val)


(n, a, b) = [int(i) for i in input().split()]
ans = 0
for i in range(1, n):
	if a // i > 0 and b // (n - i) > 0:
		t = min(a // i, b // (n - i))
		ans = max(t, ans)
print(ans)


(n, a, b) = map(int, input().split())
ans = max([min(a // k, b // (n - k)) for k in range(1, n)])
print(ans)


(n, a, b) = map(int, input().split())
q = min(a, b)
p = max(a, b)
ans = -1
for i in range(1, q + 1):
	if q // i + p // i >= n:
		ans = max(ans, i)
print(ans)


data = input().split()
(n, a, b) = map(int, data)
best = 0
for i in range(1, n):
	x = i
	y = n - i
	if a < x:
		continue
	if b < y:
		continue
	ma = int(a / x)
	mb = int(b / y)
	m = min(ma, mb)
	if m > best:
		best = m
print(best)


(p, a, b) = map(int, input().split())
n = min(a, b)
while True:
	t = int(a / n) + int(b / n)
	if t >= p:
		print(n)
		break
	n -= 1


(n, a, b) = map(int, input().split())
l = 0
r = 10 ** 9
while r - l > 1:
	m = (l + r) // 2
	if a // m + b // m >= n:
		l = m
	else:
		r = m
print(min(a, b, l))


(n, a, b) = [int(x) for x in input().split()]
minX = 1
for x in range(1, n):
	minX = max(min(a // x, b // (n - x)), minX)
print(minX)


from sys import stdin, stdout
from math import gcd, sqrt
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 1 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
(n, a, b) = R()
ans = 0
for i in range(1, n):
	j = n - i
	ans = max(ans, min(a // i, b // j))
print(ans)


x = 1
(n, a, b) = [int(i) for i in input().split()]
while a // x + b // x >= n and a // x != 0 and (b // x != 0):
	x += 1
print(x - 1)


def lInt(d=None):
	return map(int, input().split(d))
(n, a, b, *_) = lInt()
x = 1
while True:
	aa = a
	bb = b
	i = 0
	try:
		for j in range(n - 1):
			aa = a
			bb = b
			i = 0
			while i <= j:
				aa -= x
				i += 1
			if aa < 0:
				continue
			while i < n:
				bb -= x
				i += 1
			if bb < 0:
				continue
			raise
	except:
		x += 1
	else:
		break
print(x - 1)


(n, a, b) = map(int, input().split())
ans = 1
for i in range(1, min(n // 2 + 1, a)):
	(l, r) = (i, n - i)
	piece = a // l
	piece = min(piece, b // r)
	ans = max(ans, piece)
	(l, r) = (r, l)
	piece = a // l
	piece = min(piece, b // r)
	ans = max(ans, piece)
print(ans)


import math
(n, a, b) = map(int, input().split())
ans = 0
for i in range(1, a + 1):
	if n - i <= b and n - i > 0:
		cnt = 10000000007
		cnt = min(cnt, a // i)
		cnt = min(cnt, b // (n - i))
		ans = max(ans, cnt)
print(ans)


(n, a, b) = list(map(int, input().split(' ')[:3]))

def f(v):
	t1 = a // v
	t2 = b // v
	return t1 != 0 and t2 != 0 and (t1 + t2 >= n)

def main():
	t = (a + b) // n
	while not f(t):
		t -= 1
	return t
print(main())


(n, a, b) = map(int, input().split())
max = 0
if a > b:
	temp = a
	a = b
	b = temp
for i in range(1, a + 1):
	tempn = n
	c = a // i
	if c >= n:
		continue
	tempn -= c
	d = b // tempn
	if d >= i:
		if i > max:
			max = i
	elif d > max:
		max = d
print(max)