`
hellobin
  • 浏览: 65853 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

UVA 10030 Ecological Premium

    博客分类:
  • UVA
 
阅读更多

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 integern (<20), the number of test cases. Each test case starts with a line containing a single integerf (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 than100000or less than0.

 

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)

 

 

 

#define RUN
#ifdef RUN

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <list>
#include <cctype> 
#include <algorithm>
#include <utility>
#include <math.h>

using namespace std;

#define MAXN 1000

int buf[25][3];
int sum[25];

int main(){


#ifndef ONLINE_JUDGE
	freopen("10300.in", "r", stdin);
	freopen("10300.out", "w", stdout); 
#endif

	memset(buf, 0, sizeof(buf));
	memset(sum, 0, sizeof(sum));

	int n = 0;
	int f = 0;

	scanf("%d", &n);
	for(int i=0; i<n; i++){
		scanf("%d", &f);
		for(int j=0; j<f; j++){
			scanf("%d%d%d", &buf[j][0], &buf[j][1], &buf[j][2]);
			sum[i] += buf[j][0] * buf[j][2];
		}
	}

	for(int i=0; i<n; i++){
		printf("%d\n", sum[i]);
	}

	return 0;

}


#endif



分享到:
评论

相关推荐

    Applying Graph Theory in Ecological Research

    《Applying Graph Theory in Ecological Research》这本书由Cambridge University Press出版,作者Mark R. T. Dale是不列颠哥伦比亚大学生态系统科学与管理项目的教授,也是区域项目主任。他研究兴趣广泛,包括植物...

    A practical guide to ecological modelling

    - **书名**:《生态学建模实践指南》(*A Practical Guide to Ecological Modelling*) - **作者**:Karline Soetaert 和 Peter M.J. Herman - **出版社**:Springer Science+Business Media B.V. - **出版年份**:...

    Permanent Ecological 技术白皮书1

    1.0前言摘要2.0 Permanent Ecological 简明概述3.0 Permanent Ecological 核心技术概述3.1 Tendermin

    multivariate analysis of ecological data

    《多变量生态数据分析》一书是为生态学家、学生和研究人员所著,旨在解决他们分析田野观察和实验结果数据的需要,特别适用于那些处理复杂的生态问题的研究者,例如生物群落随环境条件的变化,以及生物群落对实验操作...

    J0246+Ecological+Architecture.pdf

    J0246+Ecological+Architecture

    Ecological data: design, management, and processing

    生态数据管理中经典的一本书,具有很高的参考价值。 费劲千辛万苦才下载到。呵呵。。。。

    Permanent Ecological 经济黄皮书1

    1.0前言摘要2.0 Permanent Ecological 简明概述3.0 Permanent Ecological 应用生态概述3.1 云算力轻客户端3.

    PyPI 官网下载 | ecological-1.2-py3-none-any.whl

    标题中的"PyPI 官网下载 | ecological-1.2-py3-none-any.whl"表明这是一个在Python Package Index(PyPI)上发布的软件包,名为`ecological`,版本为1.2,适用于Python 3环境,且不依赖特定的硬件架构(`none`)和...

    gee计算遥感生态指数代码(Remote Sensing Ecological Index)

    遥感生态指数(Remote Sensing Ecological Index)是一种基于遥感技术对生态系统进行监测和评估的指数,它通过对地表反射光谱数据的分析,反映出生态系统的植被覆盖程度、植被生长状况、土地利用类型、土地覆盖变化...

    multivariate_analysis_of_ecological_data_using_canoco

    《multivariate_analysis_of_ecological_data_using_canoco》这本书主要是为生态学家而编写的,目的是帮助他们分析从田野观察和实验中获得的数据。特别是对于那些处理复杂生态问题的学生和研究人员来说,这本书将...

    Ecological Piffle-开源

    本文将聚焦于一个名为“Ecological Piffle”的开源R库,探讨其在生态学统计分析中的应用与价值。 “Ecological Piffle”是一个专门为生态学家设计的R库,旨在简化生态学统计分析过程,并提供可扩展的函数来实现复杂...

    Ecological status in the Ligurian Sea The efect of

    ### 生态状态评估在利古里亚海:城市化海岸线与适当参考站点的重要性 #### 摘要 本文档探讨了利古里亚海生态状态的评估问题,特别是通过研究海岸线的城市化进程以及选择合适的参考站点对于实现《水框架指令》...

    \Multivariate Analysis of Ecological Data Using CANOCO

    ### 多元生态数据分析使用CANOCO的关键知识点 #### 一、多元生态数据分析的重要性与应用场景 多元生态数据分析在生态学研究领域占据着极其重要的地位。生态学家常常需要处理大量复杂的数据,这些数据不仅包含了...

    On Construction of Ecological Englsh Classroom in Junior Middle

    【标题】:“初中生态英语课堂构建” 在当前的教育改革背景下,初中生态英语课堂的构建显得尤为重要。生态课堂强调的是教学环境与学习者之间的和谐共生,旨在培养学生的全面能力,尤其是语言运用能力和跨文化交际...

    On Methodology for Ecological Risk Assessment of Agricultural Soil

    农田土壤生态风险评价是环境科学和生态学研究的重要内容,其目的是评价农田土壤生态系统受到的潜在风险和影响,以及评价土壤质量与人类活动之间的相互作用。本文作者曹志平,来自中国农业大学资源与环境科学学院生态...

    The ecological treatment of hyperkinesis

    The ecological treatment of hyperkinesis P%irhologv In the Schools 1980. / 7 , 249-256 THE ECOLOGICAL TREATMENT OF HYPERKINESIS GARY A. WILLIAMSON VA Medical Center, Pittsburgh ROBERT P. ...

    Ecological Industry Chain Project Decision Study Based on Price View

    本文探讨的是基于代价观的生态工业链项目决策研究,其核心在于通过定性与定量相结合的方法对企业生态工业投资进行分析,以期提出工业发展中的代价理论。研究的价值在于强调价格研究的重要性不仅仅在于事后处理,更...

    Pricing Decision Study of Ecological Industry Chain Based on Uncertain Demand

    生态工业链定价决策研究主要探讨了在不确定性需求影响下,如何通过合理的定价策略来优化生态工业链中的资源配置和产品销售。本文基于一个两阶段的生态工业链模型,考虑了副产品(即下游企业生产过程中产生的副产品...

Global site tag (gtag.js) - Google Analytics