ZOJ 3712 Hard to Play
来源:互联网 发布:js模块化开发框架 编辑:程序博客网 时间:2024/04/30 20:37
Description
MightyHorse isplaying a music game called osu!.
Afterplaying for several months, MightyHorse discoveredthe way of calculating score in osu!:
1. Whileplaying osu!, player need toclick some circles following the rhythm. Each time a player clicks, it willhave three different points: 300, 100 and 50, deciding by how clicking timingfits the music.
2.Calculating the score is quite simple. Each time player clicks and gets P points, the totalscore will add P, whichshould be calculated according to following formula:
P = Point * (Combo * 2 + 1)
Here Point is the point theplayer gets (300, 100 or 50) and Combo is thenumber of consecutive circles the player gets points previously - That means ifthe player doesn't miss any circle and clicks the ith circle, Combo shouldbe i - 1.
Recently MightyHorse meets a high-end osu! player. Afterwatching his replay, MightyHorse findsthat the game is very hard to play. But he is more interested in anotherproblem: What's the maximum and minimum total score a player can get if he onlyknows the number of 300, 100 and 50 points the player gets in one play?
As thehigh-end player plays so well, we can assume that he won't miss any circlewhile playing osu!; Thushe can get at least 50 point for a circle.
Input
Thereare multiple test cases.
Thefirst line of input is an integer T (1 ≤ T ≤ 100), indicatingthe number of test cases.
For eachtest case, there is only one line contains three integers: A (0 ≤ A ≤ 500) - the numberof 300 point he gets, B (0 ≤ B ≤ 500) - the numberof 100 point he gets and C (0 ≤ C ≤ 500) - the numberof 50 point he gets.
Output
For eachtest case, output a line contains two integers, describing the minimum andmaximum total score the player can get.
Sample Input
1
2 1 1
Sample Output
2050 3950
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--)
{
int A,B,C;
cin>>A>>B>>C;
long long mins=0,maxs=0;
maxs=maxs+50*C*(C-1)+50*C;
maxs=maxs+100*B*(2*C+B-1)+100*B;
maxs=maxs+300*A*(A+2*B+2*C-1)+300*A;
mins=mins+300*A*(A-1)+300*A;
mins=mins+100*B*(2*A+B-1)+100*B;
mins=mins+50*C*(2*A+2*B+C-1)+50*C;
cout<<mins<<" "<<maxs<<endl;
}
return 0;
}
- zoj 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- ZOJ 3712 Hard to Play
- zoj 3712 Hard to Play
- ZOJ-3712-Hard to Play
- Hard to Play ZOJ 3712
- ZOJ-Hard to Play
- zoj 3712 Hard to Play(数学题)
- ZOJ 3712 Hard to Play(贪心题)
- ZOJ 3712Hard to Play(模拟)
- ZOJ 3712Hard to Play(水题)
- ZOJ-3712-Hard to Play【10th浙江省赛】
- zju 3712 Hard to Play
- ZOJ3712:Hard to Play
- 实现button的图文并茂
- vc socket tcp编程的简单实例
- Effective C++ 读书笔记之----条款01:视 C++ 为一个语言联邦
- Lua中的table函数库
- android中布局使用大全
- ZOJ 3712 Hard to Play
- Android第三方账号登录
- ZOJ 3706 Break Standard Weight(暴力)
- 物理复杂度为O(1),但是计算机没法实现的算法
- 细数android那些 鸡肋组件
- strcmp, strncmp和memcmp的区别
- [Leetcode] 63. Unique Path II
- 去掉eclipse或myeclipse中的断点
- 随机数