Relic Discovery
来源:互联网 发布:淘宝代办工商营业执照 编辑:程序博客网 时间:2024/05/22 07:56
Problem Description
Recently, paleoanthropologists have found historical remains on an island in the Atlantic Ocean. The most inspiring thing is that they excavated in a magnificent cave and found that it was a huge tomb. Inside the construction,researchers identified a large number of skeletons, and funeral objects including stone axe, livestock bones and murals. Now, all items have been sorted, and they can be divided into N types. After they were checked attentively, you are told that there are $A_i$ items of the i-th type. Further more, each item of the i-th type requires $B_i$ million dollars for transportation, analysis, and preservation averagely. As your job, you need to calculate the total expenditure.
Input
The first line of input contains an integer T which is the number of test cases. For each test case, the first line contains an integer N which is the number of types. In the next N lines, the i-th line contains two numbers $A_i$ and $B_i$ as described above. All numbers are positive integers and less than 101.
Output
For each case, output one integer, the total expenditure in million dollars.
Sample Input
121 23 4
Sample Output
14
#include<iostream>#include<cstdio>using namespace std;int main(){ int t; scanf("%d",&t); while(t --) { int n; scanf("%d",&n); long long sum=0; while(n --) { int a,b; scanf("%d %d",&a,&b); sum=sum+a*b; } printf("%lld\n",sum); } return 0;}
阅读全文
0 0
- Relic Discovery
- HDU5982 Relic Discovery
- Relic Discovery(水题)
- HDU-5982-Relic Discovery
- HDU 5982Relic Discovery
- 杭电5982之Relic Discovery
- hdu 5982(16青岛现场赛)Relic Discovery水题
- Discovery
- Discovery
- Relic特效系统
- New Relic for Java
- newrelic 安装使用 new relic
- new relic 安装mysql 扩展
- newrelic 安装使用 new relic
- C discovery
- 机器人 discovery
- Discovery & Annoucement
- WS-Discovery
- Unity-合集简介
- UVA
- Java编程_水仙花数
- Servlet-request获取客户端ip地址,操作系统,浏览器等信息
- 不能将项目"Resilio Sync.app"移到废纸篓的解决办法
- Relic Discovery
- JAVA题目-数组3
- 用CSS让你的文字更有文艺范
- NSFZOJ #6003. 论战大原题
- 【UnityShader】屏幕空间全息扫描效果
- 网易2018校园招聘编程题
- Java的外部类为什么不能使用private、protected进行修饰
- JDBC
- Java 分布式服务架构