[ACM_水题] UVA 12502 Three Families [2人干3人的活后分钱,水]
2014-04-07 21:35
344 查看
Three Families |
Input
The first line contains an integer T ( T100), the number of test cases. Each test case contains three integers x, y, z ( 1
x, y
10, 1
z
1000).
Output
For each test case, print an integer, representing the amount of dollars that family A should get.Sample Input
2 5 4 90 8 4 123
Sample Output
60 123 题目大意:水题,不解释。推出计算公式瞬秒!
#include<iostream> #include<cstdio> using namespace std; int main(){ int T;cin>>T; while(T--){ int x,y,z; cin>>x>>y>>z; cout<<(3*x*z)/(x+y)-z<<'\n'; }return 0; }
相关文章推荐
- Linux 内核剖析
- VS——》Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version.
- Maximum Depth of Binary Tree & Same Tree & Reverse Integer
- ulimit命令
- 修炼技术前必先修心
- HDU 1671 Phone List(字典树Trie)
- 深入理解计算机系统:信息的处理和表示(二)整数四则运算
- jws操作
- 第四周作业——图的表示
- MONO 安装 分析
- 折半查找、插值查找和斐波那契查找
- lua的一个在线教程链接。。。
- stm32驱动段式lcd液晶显示--非使用1621驱动芯片驱动
- placement new
- C# 读取MDB空间数据并加载在地图视图
- hdu1370 Biorhythms
- Win32 SecuritySetting
- 友元函数
- 【Linux/Bt】在VBox下搭建虚拟局域网
- 我的第一个spring学习——用myeclipse开发spring