10300 - Ecological Premium
Problem A
Ecological Premium
Input: standard input
Output: standard output
Time Limit: 1 second
Memory Limit: 32 MB
German farmers are given a premium depending on the conditions at their farmyard. Imagine the following simplified regulation: you know the size of each farmer's farmyard in square meters and the number of animals living at it. We won't make a difference between different animals, although this is far from reality. Moreover you have information about the degree the farmer uses environment-friendly equipment and practices, expressed in a single integer greater than zero. The amount of money a farmer receives can be calculated from these parameters as follows. First you need the space a single animal occupies at an average. This value (in square meters) is then multiplied by the parameter that stands for the farmer's environment-friendliness, resulting in the premium a farmer is paid per animal he owns. To compute the final premium of a farmer just multiply this premium per animal with the number of animals the farmer owns.
Input
The first line of input contains a single positive integer n (<20), the number of test cases. Each test case starts with a line containing a single integer f (0<f<20), the number of farmers in the test case. This line is followed by one line per farmer containing three positive integers each: the size of the farmyard in square meters, the number of animals he owns and the integer value that expresses the farmer’s environment-friendliness. Input is terminated by end of file. No integer in the input is greater than 100000 or less than 0.
Output
For each test case output one line containing a single integer that holds the summed burden for Germany's budget, which will always be a whole number. Do not output any blank lines.
Sample Input
3
5
1 1 1
2 2 2
3 3 3
2 3 4
8 9 2
3
9 1 8
6 12 1
8 1 1
3
10 30 40
9 8 5
100 1000 70
Sample Output
38
86
7445
(The Joint Effort Contest, Problem setter: Frank Hutter)
注:每块土地的三个参数:x , y , z。
x代表这块土地所占空间;
y代表这块土地上的动物数;
z代表这块土地的经济效益;
根据题意:每只动物所需支付的金钱为:x/y*z;
即所有动物所需金钱为:x/y*z*y=x*z;
代码:
#include "stdio.h" int main()
{
long long sum,x,y,z;
int n,f;
scanf("%d",&n);
while(n--)
{
sum=;
scanf("%d",&f);
while(f--)
{
scanf("%lld %lld %lld",&x,&y,&z);
sum=sum+x*z;
}
printf("%lld\n",sum);
}
return ;
}
10300 - Ecological Premium的更多相关文章
- UVa 10300 - Ecological Premium
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=s ...
- Ecological Premium - UVa10300
欢迎访问我的新博客:http://www.milkcu.com/blog/ 原文地址:http://www.milkcu.com/blog/archives/uva10300.html 题目描述 Pr ...
- Ecological Premium
#include<bits/stdc++.h> using namespace std; int main() { int n,m; unsigned long long int a,b, ...
- UVA_10300:Ecological Premium
Sample Input 351 1 12 2 23 3 32 3 48 9 239 1 86 12 18 1 1310 30 409 8 5100 1000 70Sample Output 3886 ...
- UVA题目分类
题目 Volume 0. Getting Started 开始10055 - Hashmat the Brave Warrior 10071 - Back to High School Physics ...
- 【索引】Volume 0. Getting Started
AOAPC I: Beginning Algorithm Contests (Rujia Liu) Volume 0. Getting Started 10055 - Hashmat the Brav ...
- UVa OJ 10300
Problem A Ecological Premium Input: standard input Output: standard output Time Limit: 1 second Memo ...
- 数据库管理工具GUI - PremiumSoft Navicat Premium Enterprise 11.2.15 x86/x64 KEY
转载自: 数据库管理工具GUI - PremiumSoft Navicat Premium Enterprise 11.2.15 x86/x64 KEY Navicat Premium(数据库管理工具 ...
- mysql 5.7 的安装配置与 navicat premium for mysql 11 的破解使用
再安装mysql5.7 或以上的版本出现了一些问题,现在总结下,希望能给初入学习mysql的人一下帮助,大牛就不要来嘲笑小弟我了 首先准备如下: 1.下载mysql 5.7,下载地址:https:// ...
随机推荐
- 通过DAC来连接SQL Server
最早知道能够使用专用管理员连接.来连接到sql server.可是一直没有成功连接过.今天又看到这个,于是想再试试. 1.通过在ssms中的"连接到server对话框"中的serv ...
- java se 6在solaris的可观察性特征分析
java平台标准版(java se)6,代码名为"mustang",是最新的java se发行版本(正在开发中).java se 6源码和二进制代码都可以在www.java ...
- mysql日期时间函数2
win7可以设定每周从哪一天开始,win2003等不能方便的修改.有的是周日开始,有的是周一开始.而工作中有的时候每周是从周六开始算的,有些数据需要按周统计,那么那种方式比较好呢? 通过下面的研究 ...
- 8 Pratical Examples of Linux “Touch” Command--reference
In Linux every single file is associated with timestamps, and every file stores the information of l ...
- SDWebImage 原理及使用
这个类库提供一个UIImageView类别以支持加载来自网络的远程图片.具有缓存管理.异步下载.同一个URL下载次数控制和优化等特征. SDWebImage 加载图片的流程 入口 setImageWi ...
- java Thread.join()
thread1.join()方法阻塞调用此方法的线程,直到线程thread1完成,此线程再继续. 通常用于在main()主线程内,等待其它线程完成再结束main()主线程 @Test /** * ou ...
- CentOS 6.7平台Hadoop 1.2.1环境搭建
本教程使用Vultr的VPS搭建,主要实现HDFS和MapReduce两个功能. master.hadoop - 45.32.90.100 slave1.hadoop - 45.32.92.47 sl ...
- chrome vim插件vimnum快捷键与使用
Navigating the page j : Scroll down (scrollDown) k : Scroll up (scrollUp) h : Scroll left (scrollLef ...
- DNS服务器安装配置案例详解
案例配置要求:假设有一个域名:tianyik.com主机为:192.168.31.36 mail 192.168.31.37 www 192.168.31.38 pop --> ...
- ArcGIS API for Javascript配置
1.去官网下载最新版: ArcGIS API for JavaScript 3.9 API 参考文档:https://developers.arcgis.com/javascr 智能提示下载:http ...