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
output
2050 3950
//题意,根据300,100,50的数量来计算可能获得分数的最大和最小值,坑就坑在这个分数的计算,看上面正文,每次操作获得的 p = Point * (Combo*2 +1)。
这句话是什么意思呢,我们不是有300,100,50三个分数嘛,按照样例,我们有2 1 1 ,那我们就有2+1+1 = 4 个操作,一共就这4次操作。重点来了啊,每次操作可以选择的分值就是公式中的Point,至于Combo,按照题目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.,这句话,当操作数为i的时候,combo为i-1,又因为操作数逐渐递增,所以combo逐渐递增,所以如果想要获得最小值,先用300的次数,最后用50的次数,反之亦然。
水在翻译上就是坑,以下是详细解释
Combo is the number of consecutive(连续的) circles the player gets points previously(先前的)combo是我们连续圆圈的数量, - That means if the player doesn't miss(遇到) any circle and clicks the ith circle, Combo should be i - 1.
这意味着,如果我们没有遇到圆圈并且点击了第i个圆圈,这点看不懂的原因就是开头那句话没看懂,While playing osu!, player need to click some circles following the rhythm要知道玩游戏的时候就是点圆圈,这里变相就是在说操作而已,纯粹为了迷惑我们。其实我们第i次操作,combo就是i-1.
题目看懂了随便一写就行。
'''
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int vis[20000];
/*
1
2 1 1
/*
2050 3950
*/
int main(){
int t;cin>>t;
while(t--)
{
int a,b,c;cin>>a>>b>>c;
int sum1=0,sum2=0;
int cnt1=0,cnt2=0;
for(int i=1;i<=a;i++)
sum1+=300*(cnt1*2+1),cnt1++;
for(int i=1;i<=b;i++)
sum1+=100*(cnt1*2+1),cnt1++;
for(int i=1;i<=c;i++)
sum1+=50*(cnt1*2+1),cnt1++;
for(int i=1;i<=c;i++)
sum2+=50*(cnt2*2+1),cnt2++;
for(int i=1;i<=b;i++)
sum2+=100*(cnt2*2+1),cnt2++;
for(int i=1;i<=a;i++)
sum2+=300*(cnt2*2+1),cnt2++;
cout<<sum1<<" "<<sum2<<endl;
}
return 0;
}
'''