Hard to Play ZOJ - 3712

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

题意:这个游戏:每次点击有三种得分,50、100、300; 最终得分是按照公式P = Point * (Combo * 2 + 1)计算得出最终得分,其中combo为连击次数,如果第2次连击,combo就为1;

分别输入得分300、100、50的次数,输出可能得的最高分和最低分。


#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<queue>
#include<cmath>
#include<cctype>
#include<stack>
#include<cstring>
#include<set>
#include<map>
using namespace std;
int a[210];
int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
    {
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        int maxx=0;
        int minn=0;

        //因为分数与连击次数有关系,所以得分越高的乘以连击次数越小的最后分数越低;
        for(int i=1; i<=a; i++)
        {
            minn+=300*((i-1)*2+1);
        }
        for(int i=a+1; i<=b+a; i++)//注意连击次数不是从0开始;
        {
            minn+=100*((i-1)*2+1);
        }
        for(int i=a+b+1; i<=c+b+a; i++)//注意连击次数不是从0开始;
        {
            minn+=50*((i-1)*2+1);
        }

        //因为分数与连击次数有关系,所以得分越高的乘以连击次数越大的最后分数越高;
        for(int j=1; j<=c; j++)
        {
            maxx+=50*((j-1)*2+1);
        }
        for(int j=c+1; j<=b+c; j++)//注意连击次数不是从0开始;
        {
            maxx+=100*((j-1)*2+1);
        }
        for(int j=b+c+1; j<=a+b+c; j++)//注意连击次数不是从0开始;
        {
            maxx+=300*((j-1)*2+1);
        }
        printf("%d %d\n", minn, maxx);
    }
    return 0;
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值