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:
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
水题
多个for暴力即可
下面是ac代码
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<algorithm> #include<map> #include<set> #include<queue> #include<string> #include<iostream> using namespace std; #define MID(x,y) ((x+y)>>1) #define CLR(arr,val) memset(arr,val,sizeof(arr)) #define FAST_IO ios::sync_with_stdio(false);cin.tie(0); const double PI = acos(-1.0); const int INF = 0x3f3f3f3f; const int N=2e5+7; int main() { //freopen("f:/input.txt", "r", stdin); int zu,i,j,k,n,m,a,b,c,comb,maxx,minn; scanf("%d",&zu); while(zu--) { scanf("%d%d%d",&a,&b,&c); comb=0; maxx=minn=0; for(i=0;i<c;i++) { maxx+=(50*(comb*2+1)); ++comb; } for(i=0;i<b;i++) { maxx+=(100*(comb*2+1)); ++comb; } for(i=0;i<a;i++) { maxx+=(300*(comb*2+1)); ++comb; } comb = 0; for(i=0;i<a;i++) { minn+=(300*(comb*2+1)); ++comb; } for(i=0;i<b;i++) { minn+=(100*(comb*2+1)); ++comb; } for(i=0;i<c;i++) { minn+=(50*(comb*2+1)); ++comb; } printf("%d %d\n",minn,maxx); } }