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. 黄聪:VS2010启动程序提示文件加载 使用 简体中文(GB2312)编码加载文件解决办法

    vs2010 错误提示框:文件加载 使用 简体中文(GB2312)编码加载文件C:\Users\Administrator\AppData\Local\Temp\nxhgjasi.5au \Temp\ ...

  2. Java课程设计---web版斗地主

    一. 团队课程设计博客链接 二.个人负责模块和任务说明 负责前后端数据传输 JSP界面的设计 根据后台传来的数据进行页面动态更新 负责Servlet设计 三.自己的代码提交记录截图 四.自己负责模块或 ...

  3. gmake与make的区别

    gnu make在linux下一般是叫make但是如果是在其他的unix系统下,因为有一个原生的makegnu make就改个名字叫gmake了.就这们简单 当port一个老的unix程序,如老的Su ...

  4. javascript中原型,构造器,还有E5扩展的默认成员

    对象原型所具有的基本特征: 1.toString() 2.toLocaleString() 3.valueOf() 4.constructor() 5.propertyIsnumerable() 6. ...

  5. gSOAP:C++编写服务器端

    1.编写头文件cal.h: //gsoap ns service name: calc //gsoap ns service style: rpc //gsoap ns service encodin ...

  6. mysql安装过程及注意事项

    1.1. 下载: 我下载的是64位系统的zip包: 下载地址:https://dev.mysql.com/downloads/mysql/ 下载zip的包: 下载后解压:D:\软件安装包\mysql- ...

  7. 服务器选型:x86 vs 小型机谁更胜一筹?

    市场上关于X86 和小型机的争论从来就没有停止过,在以往的印象当中,x86服务器在中低端形成了统治之势,而小型机则在关键性应用领域(金融.证券.政府等)享有王者地位.但是随着X86服务器的不断发展,这 ...

  8. 代理Servlet过滤器

    Spring Security借助一些列Servlet 过滤器 来提供 各种 安全性功能. 我们只需要在应用中的 web.xml 中配置 一个过滤器. <filter> <filte ...

  9. 32.使用来MethodFilterInterceptor灵活拦截

    转自:https://wenku.baidu.com/view/84fa86ae360cba1aa911da02.html 步骤一.建立MethodAction,代码如下: package com.a ...

  10. php使用curl库进行ssl双向认证

    官方文档: http://www.php.net/manual/zh/function.curl-setopt.php#10692 官方举例: <?phpcurl_setopt($ch, CUR ...