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. .net下所有DLL(API)查询,转换C#代码

    地址: http://www.pinvoke.net/default.aspx/coredll.SetDevicePower 实例: SetDevicePower (coredll)   coredl ...

  2. 黄聪:WIN7下回收站不小心删除的文件怎么恢复,免费数据恢复软件下载

    上网找了半天,大多数是收费的,总算找到一款免费的,已经帮我恢复了数据了,在此分享给大家. 注意:只能恢复7天内的,而且数据误删了,就尽量不要再修改你那个盘符的数据了,免得覆盖了! 我用的数据恢复软件R ...

  3. log4net 极简配置

    log4net的配置详解 分类: C#2013-10-01 22:45 5335人阅读 评论(4) 收藏 举报 log4net日志框架         前言:没买到1号回家的票,所以在祖国64岁生日之 ...

  4. CentOS6.5 安装codeblocks-13.12

    安装环境CentOS6.5 启动命令行 1.先安装gcc和gcc++,这个可以直接安装 # yum install gcc # yum install gcc-c++ 2.再安装gtk2,也是直接安装 ...

  5. 搜索引擎Lucene之皮毛

    一.Lucene是apache软件基金会4 jakarta项目组的一个子项目,是一个开放源代码的全文检索引擎工具包,但它不是一个完整的全文检索引擎,而是一个全文检索引擎的架构,提供了完整的查询引擎和索 ...

  6. 83. Remove Duplicates from Sorted List + 82. Remove Duplicates from Sorted List II

    ▶ 删除单链表中的重复元素. ▶ 83. 把重复元素删得只剩一个,如 1 → 1 → 2 → 3 → 3 → 3 → 4 → 5 → 5 变成 1 → 2 → 3 → 4 → 5.注意要点:第一个元素 ...

  7. MYSQL, REDIS 等数据库的介绍

    MySQL: 数据库概述 MySql安装和基本管理 MySQl创建用户和授权 初始mysql语句 库的操作 表的操作 数据类型 数据类型(2) 完整性约束 外键的变种 三种关系 数据的增删改 单表查询 ...

  8. jeesite快速开发平台(七)----代码生成原理

    转自:https://blog.csdn.net/u011781521/article/details/79322942

  9. 基于Spring Boot和Spring Cloud实现微服务架构学习

    转载自:http://blog.csdn.net/enweitech/article/details/52582918 看了几周Spring相关框架的书籍和官方demo,是时候开始总结下这中间的学习感 ...

  10. 文本操作 $(..).text() $(..).html() $(..).val()最后一种主要用于input

    文本操作: $(..).text() # 获取文本内容 $(..).text('<a>1</a>') # 设置文本内容 $(..).html() $(..).html('< ...