#include <stdio.h>
#include <string.h>
struct milk{
char brand[128];
int price;
int volume;
double value;
}a[100];
int main(void){
int i,t,n,d;
struct milk tmp;
scanf("%d",&t);
while (t--){
scanf("%d",&n);
for (i=0; i<n; i++){
scanf("%s %d %d",a[i].brand,&a[i].price,&a[i].volume);
d = a[i].volume/200;
if (d==0)
a[i].value = 3.4e+38; // 小于200毫升则费用最高
else if (d<=5)
a[i].value = (double)a[i].price/d;
else
a[i].value = (double)a[i].price/5;
}
tmp = a[0];
for (i=1; i<n; i++)
if (a[i].value<tmp.value)
tmp = a[i];
else if (a[i].value==tmp.value && a[i].volume>tmp.volume)
tmp = a[i];
printf("%s\n",tmp.brand);
}
return 0;
}

最新文章

  1. url参数中带有+号,服务器端解码之后没了
  2. 转载--PayPal高级工程总监:读完这100篇论文 就能成大数据高手
  3. linux下搭建nagios
  4. JAVA-封装
  5. 一步一步学习Swift之(四)玩转UIWebView
  6. Inno Setup设置NT服务
  7. zedboard如何从PL端控制DDR读写(二)——AXI总线
  8. http header详解
  9. jQuery之渐变切换
  10. json解析之jackson ObjectMapper
  11. C++类型转换运算符
  12. String类中几个简单的常用方法
  13. Swift - 使用UIWebView和UIToolbar制作一个浏览器
  14. 201521123093 java 第二周学习总结
  15. python入门之函数
  16. Matplotlib学习---用seaborn画联合分布图(joint plot)
  17. 硬盘SMART检测参数详解[转]
  18. 如何开始学习ADF和Jdeveroper 11g
  19. Lucene创建索引流程
  20. 自学Zabbix3.12.4-动作Action-Operation配置

热门文章

  1. MapReduce修改输出的文件名
  2. electron—Chromium有酒,Node有肉
  3. Geoserver端口冲突解决方案
  4. Java企业微信开发_07_JSSDK多图上传
  5. tornado 获取参数
  6. 51Nod1766 树上的最远点对
  7. “Hello World”—— 第一个汇编程序
  8. SparkWriteToHFile
  9. bzoj 4530 大融合 —— LCT维护子树信息
  10. rsync 端口更换(默认873)