当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5190:Go to movies

题目描述
Winter holiday is coming!As the monitor, LeLe plans to go to the movies.
Because the winter holiday tickets are pretty expensive, LeLe decideds to try group-buying.
输入解释
There are multiple test cases, about $20$ cases. The first line of input contains two integers $n,m(1 \leq n,m \leq 100)$. $n$ indicates the number of the students. $m$ indicates how many cinemas have offered group-buying.

For the $m$ lines,each line contains two integers $a_i,b_i(1 \leq ai,bi \leq 100)$, indicating the choices of the group buying cinemas offered which means you can use $b_i$ yuan to buy $a_i$ tickets in this cinema.
输出解释
For each case, please help LeLe **choose a cinema** which costs the least money. Output the total money LeLe should pay.
输入样例
3 2
2 2
3 5
输出样例
4

提示
LeLe can buy four tickets with four yuan in cinema 1.
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 BestCoder Round #34

源链接: HDU-5190

最后修改于 2020-10-25T23:20:34+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/65536K(Java/Others)