题目
MightyHorse is playing a music game called osu!.
After playing for several months,
MightyHorse discovered the way of calculating score inosu!:
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:
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 theith circle, Combo should bei - 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 playingosu!;
Thus he can get at least 50 point for a circle.
InputThere 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 andC (0 ≤C ≤ 500) - the number of 50 point he gets.
OutputFor each test case, output a line contains two integers,
describing the minimum and maximum total score the player can get.
Sample Input1 2 1 1Sample Output
2050 3950
#include <bits/stdc++.h>//(注意此题中的i<th>,由此可推得先加50分,再加100、300可得最大分值,反之得最小分值)
using namespace std;
int main()
{
int T;
while(scanf("%d",&T)!=EOF)
{
while(T--)
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int num=a+b+c;
int i;
int ma=0,mi=0;
for(i=0;i<num;i++)
{
if(i<c)
{
ma=ma+50*(i*2+1);
}
else if(i>=c&&i<b+c)
{
ma=ma+100*(i*2+1);
}
else if(i>=b+c)
{
ma=ma+300*(i*2+1);
}
if(i<a)
{
mi=mi+300*(i*2+1);
}
else if(i>=a&&i<a+b)
{
mi=mi+100*(i*2+1);
}
else if(i>=b+a)
{
mi=mi+50*(i*2+1);
}
}
printf("%d %d\n",mi,ma);
}
}
return 0;
}