英语题翻译16

Milk | JXNUOJ

Ignatius drinks milk everyday, now he is in the supermarket and he wants to choose a bottle of milk. There are many kinds of milk in the supermarket, so Ignatius wants to know which kind of milk is the cheapest.
Here are some rules:
1. Ignatius will never drink the milk which is produced 6 days ago or earlier. That means if the milk is produced 2005-1-1, Ignatius will never drink this bottle after 2005-1-6(inclusive).
2. Ignatius drinks 200mL milk everyday.
3. If the milk left in the bottle is less than 200mL, Ignatius will throw it away.
4. All the milk in the supermarket is just produced today.
Note that Ignatius only wants to buy one bottle of milk, so if the volumn of a bottle is smaller than 200mL, you should ignore it.
Given some information of milk, your task is to tell Ignatius which milk is the cheapest.

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case starts with a single integer N(1<=N<=100) which is the number of kinds of milk. Then N lines follow, each line contains a string S(the length will at most 100 characters) which indicate the brand of milk, then two integers for the brand: P(Yuan) which is the price of a bottle, V(mL) which is the volume of a bottle.

For each test case, you should output the brand of the milk which is the cheapest. If there are more than one cheapest brand, you should output the one which has the largest volume.

翻译:

Ignatius每天都会喝牛奶,现在他在超市里并且他想选择一瓶牛奶。超市里有很多种类的牛奶,所以Ignatius想知道哪一种最便宜。下面是一些规则:1、Ignatius不会喝6天以前或更早生产的牛奶。这意味着如果牛奶在2005-1-1生产,Ignatius不会喝2005-1-6之后的牛奶。2、Ignatius每天喝200ml的牛奶。3、如果瓶子中剩余的牛奶少于200ml,Ignatius将会扔掉它。4、超市中所有的牛奶都是今天刚生产的。注意:Ignatius只想要买一瓶牛奶,所以如果瓶子的容积小于200ml,你应该忽略它。给出牛奶的一些信息,你的任务是告诉Ignatius哪一个牛奶最便宜。

输入包含几个测试用例。输入的第一行是一个整数T,表示测试用例的数量。接下来是T个测试用例。每个测试用例以一个整数N开始(1<=N<=100),表示牛奶种类的数量。然后是N行,每行包含一个字符串S(长度最多100个字符),表示牛奶的品牌,然后是品牌的两个整数:P(元)表示一瓶的价格,V(ml)表示瓶子的容积。

对每一个测试用例,你应该输出最便宜的牛奶的品牌。如果有多个的最便宜的品牌,你应该输出容积最大的那一个。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值