H - Hard to Play

 

MightyHorse is playing a music game called osu!.

After playing for several months, MightyHorsediscovered the way of calculating score in osu!:

1. While playing osu!, player need to click some circles following the rhythm. Each time a player clicks, it will have three different points: 300, 100 and 50, deciding by how clicking timing fits the music.

2. Calculating the score is quite simple. Each time player clicks and gets P points, the total score will add P, which should be calculated according to following formula:

P = Point * (Combo * 2 + 1)

Here Point is the point the player gets (300, 100 or 50) and Combo is the number of consecutive circles the player gets points previously - That means if the player doesn't miss any circle and clicks the ith circle, Combo should be i - 1.

Recently MightyHorse meets a high-end osu!player. After watching his replay, MightyHorsefinds that the game is very hard to play. But he is more interested in another problem: What's the maximum and minimum total score a player can get if he only knows the number of 300, 100 and 50 points the player gets in one play?

As the high-end player plays so well, we can assume that he won't miss any circle while playing osu!; Thus he can get at least 50 point for a circle.

Input

There are multiple test cases.

The first line of input is an integer T (1 ≤ T≤ 100), indicating the number of test cases.

For each test case, there is only one line contains three integers: A (0 ≤ A ≤ 500) - the number of 300 point he gets, B (0 ≤ B ≤ 500) - the number of 100 point he gets and C (0 ≤ C ≤ 500) - the number of 50 point he gets.

Output

For each test case, output a line contains two integers, describing the minimum and maximum total score the player can get.

Sample Input

1
2 1 1

Sample Output

2050 3950
 #include<stdio.h>
#include<ctype.h>
#include<string.h>
int main()
{
int t;
int a,b,c;
int p1,p2,p3,p4,p5,p6;
int mins,maxs;
while(scanf("%d",&t)!=EOF)
{
mins=;
maxs=;
while(t--)
{
/* mins=0;
maxs=0;*/
p1=p2=p3=p4=p5=p6=;
scanf("%d%d%d",&a,&b,&c);
for(int i=;i<a;i++)
{
p1+=*(i*+);
}
for(int i=a;i<a+b;i++)
{
p2+=*(i*+);
}
for(int i=a+b;i<a+b+c;i++)
{
p3+=*(i*+);
}
mins=p1+p2+p3; for(int j=;j<c;j++)
{
p4+=*(j*+);
}
for(int j=c;j<c+b;j++)
{
p5+=*(j*+);
}
for(int j=c+b;j<a+b+c;j++)
{
p6+=*(j*+);
}
maxs=p4+p5+p6;
printf("%d %d\n",mins,maxs);
} }
return ;
}

ZCMU训练赛-H(模拟)的更多相关文章

  1. ZCMU训练赛-A(模拟)

    A - Applications https://vjudge.net/contest/174208#overview Recently, the ACM/ICPC team of Marjar Un ...

  2. 浙南联合训练赛 H - The number of positions

    Petr stands in line of n people, but he doesn't know exactly which position he occupies. He can say ...

  3. ZCMU训练赛-J(循环节+字符串处理)

    J - Java Beans There are N little kids sitting in a circle, each of them are carrying some java bean ...

  4. ZCMU训练赛-B(dp/暴力)

    B - Break Standard Weight The balance was the first mass measuring instrument invented. In its tradi ...

  5. Contest1592 - 2018-2019赛季多校联合新生训练赛第二场(部分题解)

    Contest1592 - 2018-2019赛季多校联合新生训练赛第二场 D 10248 修建高楼(模拟优化) H 10252 组装玩具(贪心+二分) D 传送门 题干 题目描述 C 市有一条东西走 ...

  6. 10.0.0.55_12-16训练赛部分writeup

    0x1 - MISC MISC100 一张帅行的照片 目测是图片隐写,但是binwalk并没有出来,应该是对文件头进行了修改 010editor查看一下,发现在jpg文件尾之后还有大量的数据 而且在灰 ...

  7. Contest1585 - 2018-2019赛季多校联合新生训练赛第一场(部分题解)

    Contest1585 - 2018-2019赛季多校联合新生训练赛第一场 C 10187 查找特定的合数 D 10188 传话游戏 H 10192 扫雷游戏 C 传送门 题干: 题目描述 自然数中除 ...

  8. 7.30 正睿暑期集训营 A班训练赛

    目录 2018.7.30 正睿暑期集训营 A班训练赛 T1 A.蔡老板分果子(Hash) T2 B.蔡老板送外卖(并查集 最小生成树) T3 C.蔡老板学数学(DP NTT) 考试代码 T2 T3 2 ...

  9. 2013年省赛H题

    2013年省赛H题你不能每次都快速幂算A^x,优化就是预处理,把10^9预处理成10^5和10^4.想法真的是非常巧妙啊N=100000构造两个数组,f1[N],间隔为Af2[1e4]间隔为A^N,中 ...

随机推荐

  1. ES索引

    Elasticsearch索引别名.Filtered索引别名.Template 在使用elasticsearch的时候,经常会遇到需要淘汰掉历史数据的场景. 为了方便数据淘汰,并使得数据管理更加灵活, ...

  2. mac --snip 滚动截屏

    1.snip 下载配置:https://jingyan.baidu.com/article/fec4bce2458d03f2618d8b8e.html 2.mac的火狐浏览器好像不支持,必须在sofa ...

  3. LeetCode -- Tiangle

    Question: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to ...

  4. Codeforce 721C DP+DAG拓扑序

    题意 在一个DAG上,从顶点1走到顶点n,路径上需要消费时间,求在限定时间内从1到n经过城市最多的一条路径 我的做法和题解差不多,不过最近可能看primer看多了,写得比较复杂和结构化 自己做了一些小 ...

  5. 【电影影评】梦之安魂曲-败给了BGM和豆瓣影评

    首先,这部电影豆瓣8.7分,一般来说,豆瓣的打分是比较准确的.能反映一个片子的质量,而较少受到环境的影响.但是这种关系当然也不全对,比如某些片子可能特别让某一种人喜欢(如退役军人和军旅题材),而在某些 ...

  6. 洛谷 P3084 [USACO13OPEN]照片Photo 解题报告

    [USACO13OPEN]照片Photo 题目描述 农夫约翰决定给站在一条线上的\(N(1 \le N \le 200,000)\)头奶牛制作一张全家福照片,\(N\)头奶牛编号\(1\)到\(N\) ...

  7. [hdu 6069]素数筛+区间质因数分解

    给[L,R]区间的每一个数都质因数分解的复杂度可以达到(R-L)logR,真的涨姿势…… 另外,质因数分解有很重要的一点,就是只需要打sqrt(R)以内的素数表就够了……因为超过sqrt(R)的至多只 ...

  8. Spring中Resource接口的前缀书写格式

    Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt");   //这个 ...

  9. wget、yum、rpm、apt-get区别

    wget 类似于迅雷,是一种下载工具, 通过HTTP.HTTPS.FTP三个最常见的TCP/IP协议下载,并可以使用HTTP代理 名字是World Wide Web”与“get”的结合. yum: 是 ...

  10. java 构造函数问题

    1.构造函数什么时候被调用,被谁调用? 转摘:http://bbs.csdn.net/topics/350231037 当然,只有在NEW的时候,才会真正的创建这个对象,只有在创建时才会调用该类的构造 ...