Burglar and Matches
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Burglar and Matches
题面翻译
题目描述
一个窃贼到火柴仓库偷火柴,仓库有 个容器,第 个容器有 个火柴盒,其中每个火柴盒中有 根火柴,窃贼最多可以拿 个火柴盒 。
输入格式
第一行两个正整数 , 下面 行每行有两个数 和 。
输出格式
输出窃贼最多能偷多少根火柴。
说明/提示
数据规模与约定
,,, 。
题目描述
A burglar got into a matches warehouse and wants to steal as many matches as possible. In the warehouse there are containers, in the -th container there are matchboxes, and each matchbox contains matches. All the matchboxes are of the same size. The burglar's rucksack can hold matchboxes exactly. Your task is to find out the maximum amount of matches that a burglar can carry away. He has no time to rearrange matches in the matchboxes, that's why he just chooses not more than matchboxes so that the total amount of matches in them is maximal.
输入格式
The first line of the input contains integer ( ) and integer ( ). The -th line contains a pair of numbers and ( ). All the input numbers are integer.
输出格式
Output the only number — answer to the problem.
样例 #1
样例输入 #1
7 3
5 10
2 5
3 6
样例输出 #1
62
样例 #2
样例输入 #2
3 3
1 3
2 2
3 1
样例输出 #2
7
大明
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 38
- Start at
- 2025-2-11 16:00
- End at
- 2025-2-28 8:00
- Duration
- 400 hour(s)
- Host
- Partic.
- 7