MightyHorse is playing a music game called osu!.

After playing for several months, MightyHorse discovered 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, MightyHorse finds 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

Author: DAI, Longao
Contest: The 10th Zhejiang Provincial Collegiate Programming Contest

题目大意:一共有三种数字300,100,50,每个样例中给出数字的个数,公式是P = Point * (Combo * 2 + 1),其中combo是这个数是第几个计算的。求P和的最大值和最小值。

解题思路:先算小的后算大的得出最大值,先算大的后算小的得出最小值

 #include<iostream>
using namespace std;
int main(){
int T;
cin>>T;
while(T--){
int A,B,C;
cin>>A>>B>>C;
int minSum=,maxSum=;
int a=A,b=B,c=C;
int cases=;//正着算最大值
while(c--){
maxSum+=cases*;
cases+=;
}
while(b--){
maxSum+=cases*;
cases+=;
}
while(a--){
maxSum+=cases*;
cases+=;
}
cases=;//倒着算最小值
while(A--){
minSum+=cases*;
cases+=;
}
while(B--){
minSum+=cases*;
cases+=;
}
while(C--){
minSum+=cases*;
cases+=;
}
cout<<minSum<<' '<<maxSum<<'\n';
}return ; }

[ACM_水题] ZOJ 3712 [Hard to Play 300 100 50 最大最小]的更多相关文章

  1. [ACM_水题] ZOJ 3706 [Break Standard Weight 砝码拆分,可称质量种类,暴力]

    The balance was the first mass measuring instrument invented. In its traditional form, it consists o ...

  2. [ACM_水题] ZOJ 3714 [Java Beans 环中连续m个数最大值]

    There are N little kids sitting in a circle, each of them are carrying some java beans in their hand ...

  3. ACM_水题你要信了(修改版)

    水题你要信了 Time Limit: 2000/1000ms (Java/Others) Problem Description: 某发最近又认识了很多妹(han)子,可是妹(han)子一多不免有时会 ...

  4. 水题 ZOJ 3875 Lunch Time

    题目传送门 /* 水题:找排序找中间的价格,若有两个,选价格大的: 写的是有点搓:) */ #include <cstdio> #include <iostream> #inc ...

  5. 水题 ZOJ 3876 May Day Holiday

    题目传送门 /* 水题:已知1928年1月1日是星期日,若是闰年加1,总天数对7取余判断就好了: */ #include <cstdio> #include <iostream> ...

  6. 水题 ZOJ 3880 Demacia of the Ancients

    题目传送门 /* 水题:) */ #include <cstdio> #include <iostream> #include <algorithm> #inclu ...

  7. 水题 ZOJ 3869 Ace of Aces

    题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...

  8. [ACM_水题] UVA 12502 Three Families [2人干3人的活后分钱,水]

      Three Families  Three families share a garden. They usually clean the garden together at the end o ...

  9. ACM_水题你信吗

    水题你信吗 Time Limit: 2000/1000ms (Java/Others) Problem Description: 某发最近又认识了很多妹(han)子,可是妹(han)子一多不免有时会忘 ...

随机推荐

  1. VC++ MFC 按钮的全部样式Style

    Button Styles BS_3STATE 与复选框一样本样式按钮可被单击变暗.变暗状态通常用于指示本样式的按键正处于禁用状态. BS_AUTO3STATE   与三状态的复选框一样当用户选中它本 ...

  2. 去掉DLL can move

    1.OptionalHeader.DllCharacteristics = wNewDllCharacteristics; 用CFF打开,如果存在DLL can move这个选项,去掉即可 2.Rel ...

  3. SSH基本框架搭建后的简化

    对于SSh框架的简化,我们可以从下面几个方面来剖析: 1.实体类entity:在这里我们需要将数据库和实体类进行关联,在简化之前,我们需要在entity包里面加入一份.xml配置文件 例如原码---- ...

  4. 用定时器令P0(或其它IO口)产生多路方波

    void Timer0_isr(void) interrupt 1 using 1{ static unsigned char i;  //重新赋值 12M晶振计算,指令周期1uS,500x2=1mS ...

  5. URL验证

    function isURL(str_url) { var strRegex = "^((https|http|ftp|rtsp|mms)?://)" + "?(([0- ...

  6. js灵活打印web页面区域内容的通用方法

      我们做网站,经常需要打印页面指定区域的内容,而网上关于这块的说法很多,各种各样的打印控件也不少.但许多打印方案都不怎么好,至少我不喜欢,要么封装复杂,要么难以维护.正好现在的项目也需要用到 ...

  7. 单片机TM4C123学习(十):ADC采样模块

    1.头文件 #include "tiva_adc.h" // ADC 2.引脚 3.初始化 // ADC初始化 // 光敏电阻(PE0)为通道3,存在序列0中,硬件平均为8个点 a ...

  8. linux卸载openJDK并安装sun jdk

    linux下卸载openJDK并安装java 1.查找现在有的jdk rpm -qa | grep java 2.删除jdk rpm -e --nodeps java----- 3.安装jdk 下载j ...

  9. [Delphi编译错误]F2084 Internal Error: U2107

    看到这个错误真是头痛,这是一个很旧的项目了,想修改下东西,清理下工程一编译出现这个该死的错误,百度了下,也没解决问题.没办法只好编译所有的BPL了.   这个项目是带包编译的,而且带了几个自己的包. ...

  10. c#输出、输入练习

    //输出 Console.WriteLine("这是一行文字");  自动回车的. Console.Write("Hello world");  不带回车的. ...