英语翻译19

https://www.luogu.com.cn/problem/CF16B

题目描述

A burglar got into a matches warehouse and wants to steal as many matches as possible. In the warehouse there are mm containers, in the ii -th container there are a_{i}a 

i

​ 

  matchboxes, and each matchbox contains b_{i}b 

i

​ 

  matches. All the matchboxes are of the same size. The burglar's rucksack can hold nn 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 nn matchboxes so that the total amount of matches in them is maximal.

 

输入格式

The first line of the input contains integer nn ( 1<=n<=2·10^{8}1<=n<=2⋅10 

8

  ) and integer mm ( 1<=m<=201<=m<=20 ). The i+1i+1 -th line contains a pair of numbers a_{i}a 

i

​ 

  and b_{i}b 

i

​ 

  ( 1<=a_{i}<=10^{8},1<=b_{i}<=101<=a 

i

​ 

 <=10 

8

 ,1<=b 

i

​ 

 <=10 ). All the input numbers are integer.

 

输出格式

Output the only number — answer to the problem.

一个窃贼进入了一个火柴仓库想要偷尽可能多的火柴。在这个仓库里有m个容器,第i个容器里有ai个火柴盒,并且每个盒子里有bi个火柴。所有火柴盒尺寸相同,窃贼的包能够装n个火柴盒,你要找到窃贼能偷走的最多火柴数。

第一行输入n和m接下来i+1行包含两个整数ai和bi所有数字都是整数

输出答案

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值