QOJ.ac

QOJ

时间限制: 1 s 内存限制: 1024 MB 总分: 100

#1983. 蛋糕

统计

今年夏天,你打算举办一场大型派对并邀请许多朋友。他们都爱吃甜食,所以你计划为他们烤一些美味的蛋糕。你知道制作一个美味巧克力蛋糕的配方,并且你想尽可能多地制作蛋糕。

给定制作一个蛋糕所需的 $N$ 种配料,以及你厨房里现有的配料数量,请问你最多可以制作多少个蛋糕?

输入格式

  • 第一行包含一个整数 $N$。
  • 接下来有 $N$ 行,每行对应一种配料。每行包含两个正整数:第一个数是制作一个蛋糕所需的该配料数量,第二个数是你厨房中现有的该配料数量。

输出格式

输出一个整数,表示使用现有配料最多可以制作的蛋糕数量。

数据范围

  • $1 \leqslant N \leqslant 10$
  • 所有配料数量均为 $1$ 到 $10\,000$ 之间的整数。

样例

样例输入 1

3
100 500
2 5
70 1000

样例输出 1

2

样例输入 2

3
100 50
2 5
70 1000

样例输出 2

0

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.