Huatuo's Medicine

Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)

Huatuo was a famous doctor. He use identical bottles to carry the medicine. There are different types of medicine. Huatuo put medicines into the bottles and chain these bottles together.

However, there was a critical problem. When Huatuo arrived the patient's home, he took the chain out of his bag, and he could not recognize which bottle contains which type of medicine,but he remembers the order of the bottles on the chain.

Huatuo has his own solution to resolve this problem. When he need to bring
2
types of medicines, E.g. A and B, he will put A into one bottle and put
B into two bottles.Then he will chain the bottles in the order of
-B-A-B-
. In this way, when he arrived the patient's home, he knew that the bottle in the middle is medicine
A and the bottle ontwo sides are medicine B.

Now you need to help Huatuo to work out what's the minimal number of bottles needed if he want to bring
N
types of medicine.

Input

The first line of the input gives the number of test cases,
T(1≤T≤100).
T
lines follow. Each line consist of one integer N(1≤N≤100),the
number of types of the medicine.

Output

For each test case, output one line containing Case #x: y, where
x
is the test case number (starting from 1)
and y
is the minimal number of bottles Huatuo needed.

Sample input and output

#include<stdio.h>
int main()
{
long long n,t,Case=1;
scanf("%lld",&t);
while(t--)
{
scanf("%lld",&n);
printf("Case #%lld: %lld\n",Case++,2*(n-1)+1);
}
return 0;
}

Sample Input Sample Output
1
2
Case #1: 3

Huatuo's Medicine的更多相关文章

  1. The 2015 China Collegiate Programming Contest L. Huatuo's Medicine hdu 5551

    Huatuo's Medicine Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others ...

  2. 2015南阳CCPC L - Huatuo's Medicine 水题

    L - Huatuo's Medicine Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 无 Description Huatuo was a famous ...

  3. 2015南阳CCPC L - Huatuo's Medicine 签到

    L - Huatuo's Medicine Description Huatuo was a famous doctor. He use identical bottles to carry the ...

  4. HDU-5551 Huatuo's Medicine

    Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission( ...

  5. HDOJ5551 Huatuo's Medicine

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5551 题目大意:... 题目思路:乱搞?模拟? #include <stdio.h> vo ...

  6. ACM学习历程—UESTC 1226 Huatuo's Medicine(数学)(2015CCPC L)

    题目链接:http://acm.uestc.edu.cn/#/problem/show/1226 题目就是构造一个对称的串,除了中间的那个只有1个,其余的两边都是对称的两个,自然答案就是2*n-1. ...

  7. CCPC L(水)

    Huatuo's Medicine Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others ...

  8. zoj 3812 We Need Medicine (dp 状压)

    先贴一下转载的思路和代码,,,:http://blog.csdn.net/qian99/article/details/39138329 状压dp博大精深啊,以后看到n<=50都可以往状压上想, ...

  9. Wiki with Herbal Medicine

    Problem H. Wiki with Herbal MedicineInput file: standard input Time limit: 1 secondOutput file: stan ...

随机推荐

  1. android黑科技系列——实现静态的默认安装和卸载应用

    一.访问隐藏的API方式进行静态的默认安装和卸载 1.系统安装程序 android自带了一个安装程序—/system/app/PackageInstaller.apk.大多数情况下,我们手机上安装应用 ...

  2. wp版笔记本应用源码

    今天在那个WP教程网看到了一个不错的项目,简单的记事本,主要是用到的独立存储文件的操作,TimePicker和DatePicker的是用,数据绑定,界面的参考的chanraycode的,主要是锻炼自己 ...

  3. Nagios Windows客户端NSClient++ 0.4.x安装配置

    NSClient++ 0.3.x和NSClient++ 0.4.x的配置完全不一样,官方的文档也没有全部更新.我记录下自己的一些操作.   一.下载安装NSClient++ 1.到http://nsc ...

  4. 全栈框架——MEAN

    MEAN: MongoDB - Express - AngularJs - Node.js MongoDB 是一个面向文档的. NoSQL 类型的数据库.MongoDB 颠覆了传统的基于表的数据存储方 ...

  5. 杭电 2088 Box of Bricks

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2088 解题思路:一堆高度不同的砖块,需要把它们砌成一堵墙,即每一堆砖的高度相同(即砖的总数除以砖的堆数 ...

  6. 熟悉VS2017 和Github 第二次作业

    GIT地址 https://github.com/Astone1213 GIT用户名  Astone1213 学号后五位  62114 博客地址 https://www.cnblogs.com/AsL ...

  7. LSTM比较RNN

    LSTM只能避免RNN的梯度消失(gradient vanishing),但是不能对抗梯度爆炸问题(Exploding Gradient). 梯度膨胀(gradient explosion)不是个严重 ...

  8. jq DataTable

    DataTables(http://datatables.club/index.html)应该是我到目前为止见过的,功能最强大的表格解决方案(当然,不计算其它整套框架中的table控件在内). 先把它 ...

  9. jmeter目录讲解

    1.jmeter目录详解 2.这是bin目录下的examples 3.这是bin目录下的report-template 注意啦:jmeterw.cmd运行不带命令的窗口会侵占8080端口,会和tomc ...

  10. 安装Mysql的一些问题,比如Net Connect 卸载不掉,注册表相关操作

    我安装mysql用了一段时间后卸载了,在安装就发现安装不了了,原因就是卸载的时候Net Connetc无法卸载,我试了一个月也没有解决后来百度各种还是没有办法解决.于是就尝试自己手动卸载注册表.在“开 ...