{"problem":{"name":"B. Two Cakes","description":{"content":"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 o","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF911B"},"statements":[{"statement_type":"Markdown","content":"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.\n\nIvan 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:\n\n1.  Each piece of each cake is put on some plate;\n2.  Each plate contains at least one piece of cake;\n3.  No plate contains pieces of both cakes.\n\nTo 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.\n\nHelp Ivan to calculate this number _x_!\n\n## Input\n\nThe 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.\n\n## Output\n\nPrint 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.\n\n[samples]\n\n## Note\n\nIn the first example there is only one way to distribute cakes to plates, all of them will have 1 cake on it.\n\nIn 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.","is_translate":false,"language":"English"}],"meta":{"iden":"CF911B","tags":["binary search","brute force","implementation"],"sample_group":[["5 2 3","1"],["4 7 10","3"]],"created_at":"2026-03-03 11:00:39"}}