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, Comboshould 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
 
题意:一共有三种数字300,100,50,每个样例中给出数字的个数,公式是P = Point * (Combo * 2 + 1),其中combo是这个数是第几个计算的,
结果中的两个,一个是从左到右计算,另一个是从又到左计算
 
#include <stdio.h>
#include <string.h> int main()
{
int t;
int a[4] = {300,100,50};
int i,v[4],sum,x,cas;
scanf("%d",&t);
while(t--)
{
scanf("%d%d%d",&v[0],&v[1],&v[2]);
x = 1;
sum = 0;
for(i = 0; i<3; i++)
{
cas = v[i];
while(cas--)
{
sum+=a[i]*((x-1)*2+1);
x++;
}
}
printf("%d ",sum);
x = 1;
sum = 0;
for(i = 2; i>=0; i--)
{
cas = v[i];
while(cas--)
{
sum+=a[i]*((x-1)*2+1);
x++;
}
}
printf("%d\n",sum);
}
return 0;
}

ZOJ3712:Hard to Play的更多相关文章

  1. java web 开发三剑客 -------电子书

    Internet,人们通常称为因特网,是当今世界上覆盖面最大和应用最广泛的网络.根据英语构词法,Internet是Inter + net,Inter-作为前缀在英语中表示“在一起,交互”,由此可知In ...

  2. 所有selenium相关的库

    通过爬虫 获取 官方文档库 如果想获取 相应的库 修改对应配置即可 代码如下 from urllib.parse import urljoin import requests from lxml im ...

  3. In-Memory:内存数据库

    在逝去的2016后半年,由于项目需要支持数据的快速更新和多用户的高并发负载,我试水SQL Server 2016的In-Memory OLTP,创建内存数据库实现项目的负载需求,现在项目接近尾声,系统 ...

  4. 从直播编程到直播教育:LiveEdu.tv开启多元化的在线学习直播时代

    2015年9月,一个叫Livecoding.tv的网站在互联网上引起了编程界的注意.缘于Pingwest品玩的一位编辑在上网时无意中发现了这个网站,并写了一篇文章<一个比直播睡觉更奇怪的网站:直 ...

  5. 【.net 深呼吸】细说CodeDom(8):分支与循环

    有人会问,为啥 CodeDom 不会生成 switch 语句,为啥没生成 while 语句之类.要注意,CodeDom只关心代码逻辑,而不是语法,语法是给写代码的人用的.如果用.net的“反编译”工具 ...

  6. 【原】Android热更新开源项目Tinker源码解析系列之三:so热更新

    本系列将从以下三个方面对Tinker进行源码解析: Android热更新开源项目Tinker源码解析系列之一:Dex热更新 Android热更新开源项目Tinker源码解析系列之二:资源文件热更新 A ...

  7. App开发:模拟服务器数据接口 - MockApi

    为了方便app开发过程中,不受服务器接口的限制,便于客户端功能的快速测试,可以在客户端实现一个模拟服务器数据接口的MockApi模块.本篇文章就尝试为使用gradle的android项目设计实现Moc ...

  8. TODO:macOS编译PHP7.1

    TODO:macOS编译PHP7.1 本文主要介绍在macOS上编译PHP7.1,有兴趣的朋友可以去尝试一下. 1.下载PHP7.1源码,建议到PHP官网下载纯净到源码包php-7.1.0.tar.g ...

  9. In-Memory:在内存中创建临时表和表变量

    在Disk-Base数据库中,由于临时表和表变量的数据存储在tempdb中,如果系统频繁地创建和更新临时表和表变量,大量的IO操作集中在tempdb中,tempdb很可能成为系统性能的瓶颈.在SQL ...

随机推荐

  1. 使用用WCF中的双工(Duplex)模式将广告图片推送到每个Winform客户端机子上

    参考资料地址:http://www.cnblogs.com/server126/archive/2011/08/11/2134942.html 代码实现: WCF宿主(服务端) IServices.c ...

  2. appium -ios-安卓 获取元素时 配置参数的方法

    iPhone_5S{ "automationName": "XCUITest", "platformName": "iOS&quo ...

  3. linux下今天遇到的问题

    之前由于测试需要,必须用mysql5.7的客户端, 现在由于产品完善,开始支持5.6,所以需要装5.6的客户端做测试,考虑到手工测试的效率及不可重复性,准备自动化执行原来的用例. 老的用例是用MySQ ...

  4. Shell中单引号、双引号、反引号、反斜杠的区别

    1. 单引号 ( '' ) # grep Susan phonebook Susan Goldberg -- Susan Topple -- 如果我们想查找的是Susan Goldberg,不能直接使 ...

  5. Vue 获取数据、事件对象、todolist

    vue中在方法里获取data里的msg:this.msg 在微信小程序里this.data.msg 改变data里的msg:this.msg="改变后的msg" 可以通过list. ...

  6. 【POJ】1935 Journey(树形dp)

    题目 传送门:QWQ 分析 凉凉. 答案是所有要经过的点到根所经过的边权和减去最大的边权. 代码 vector好慢啊 #include <cstdio> #include <vect ...

  7. jquery内容补充

    jquery除了咱们上面讲解的常用知识点之外,还有jquery 插件.jqueryUI知识点 jqueryUI 官网: https://jqueryui.com/ jqueryUI 中文网: http ...

  8. SPM——How to use github

    In this semester, we take a class called 'Software Project Management'. And in this class, we have l ...

  9. 解决Linux下MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor)问题

    两种方案: 一: 1.修改mysql配置文件:vim /etc/my.cnf 2.找到[mysqld]下添加 skip-grant-tables 配置 3.重启服务service mysqld res ...

  10. SecureCRT 8.1使用经验总结

    1.反空闲设置: 2.文件上传下载 上传 sudo rz -y 文本文件勾选Upload files as ASCII,图片或其他飞文本文件,去掉勾选.采用默认binary 3.文件下载 sudo s ...