304775: CF911B. Two Cakes
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Two Cakes
题意翻译
题目描述 除夕将至,因此Ivan觉得应该开始摆盘了。Ivan买了两个蛋糕并且把他们切成了块:第一个蛋糕被切成a块,第二个被切成b块。 Ivan知道包括他在内将会有n个人参加庆祝活动,所以他已经为蛋糕准备了n个盘子。现在他在思考怎样分配盘子和蛋糕。Ivan想要满足一下所有条件: 1.每块蛋糕都被放在盘子上; 2.每个盘子至少放了一块蛋糕; 3.没有盘子放了两个不同的蛋糕(即切开前分别属于两个不同的大蛋糕); 为了给客人带来更多快♂感,Ivan想让(数量)最小份的蛋糕数量尽可能大。他希望知道最大的x,使得他使得他可以根据上述条件分发蛋糕,并且每个盘子包含至少x块蛋糕。 帮助伊万来计算这个数字 x! 输入格式 第一行包含三个整数n,a和b(1<=a,b<=100 ,2<=n<=a+b)——盘子的数量,第一个蛋糕被切成的块数和第二个蛋糕被切成的块数。 输出格式 输出最大可能的数字x使得Ivan可以以这样的方式,每个盘子里包含至少分发蛋糕x块蛋糕 样例略 样例说明 在第一个样例中,只有一种方法可以将蛋糕分配进盘子,即每个盘子1个蛋糕。 在第二个样例中,你可以在两个盘子分别放3块第一个蛋糕和4块第二个蛋糕,另外两个盘子都放5块第二个蛋糕。最少的块数是3。题目描述
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: 1. Each piece of each cake is put on some plate; 2. Each plate contains at least one piece of cake; 3. 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 $ !输入输出格式
输入格式
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.
输出格式
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.
输入输出样例
输入样例 #1
5 2 3
输出样例 #1
1
输入样例 #2
4 7 10
输出样例 #2
3