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 on two 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

Sample Input Sample Output
1
2
Case #1

题解:半信半疑的2*N-1就过了,好水;

代码:

 #include<stdio.h>
int main(){
int T,N,flot=;
scanf("%d",&T);
while(T--){
scanf("%d",&N);
printf("Case #%d: %d\n",++flot,*N-);
}
return ;
}

CCPC L(水)的更多相关文章

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

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

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

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

  3. English trip V1 - B 20. Likes and Dislikes 喜欢和不喜欢 Teacher:Sole Key:

    In this lesson you will learn to talk about likes and dislikes. 课上内容(Lesson) # talk about hobby Do y ...

  4. 2017 ACM/ICPC Asia Regional Guangxi Online 记录

    题目链接  Guangxi 感觉这场比赛完全是读题场啊…… 比赛过程中丢失了一波进度,最后想开题的时候已经来不及了…… Problem A 按题意模拟……按照那个矩阵算就可以了 #include &l ...

  5. [Wikioi 1226]倒水问题

    题目描写叙述 Description 有两个无刻度标志的水壶.分别可装 x 升和 y 升 ( x,y 为整数且均不大于 100 )的水. 设另有一水 缸,可用来向水壶灌水或接从水壶中倒出的水, 两水壶 ...

  6. Day 2:线程与进程系列问题(二)

    补充: 线程的创建方式二: 1.自定义一个实现Runnable接口的类 2.实现Runnable接口中的run方法把自定义线程的任务写在run方法中 3.创建实现Runnable接口的对象 4.创建T ...

  7. A distributional code for value in dopamine-based reinforcement learning

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! Nature 2020 汇报PPT: 链接:https://pan.baidu.com/s/1RWx6miX6iZUNgNfV9B69FQ ...

  8. JavaWeb 后端 <二> 之 Servlet 学习笔记

    一.Servlet概述 1.什么是Servlet Servlet是一个运行在服务器端的Java小程序,通过HTTP协议用于接收来自客户端请求,并发出响应. 2.Servlet中的方法 public v ...

  9. HTML5 3D 粒子波浪动画特效DEMO演示

    需要thress.js插件:     http://github.com/mrdoob/three.js // three.js - http://github.com/mrdoob/three.js ...

随机推荐

  1. Servlet基础知识(三)—— 会话机制Session,Session和Cookie的异同

    Servlet会话机制: Http是一种无状态协议,它是无记忆的.也就是说,服务器不会保存用户的任何信息,当同一用户再次去访问时,服务器是不认识你的,它还是会建立新的连接. 但有时候我们需要服务器保留 ...

  2. hdu 4455 Substrings(找规律&DP)

    Substrings Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tota ...

  3. 浅谈 non-blocking I/O Multiplexing + poll/epoll 的正确使用

    在前面的文章中曾经粗略讲过poll,那时是用阻塞IO实现,在发送和接收数据量都较小情况下和网络状况良好的情况下是基本没有问题的,read 不会只接收部分数据,write 也不会一直阻塞.但实际上pol ...

  4. tomcat无法正常启动的一个原因

    简要报错信息: java.lang.IllegalArgumentException: Document base E:\apache-tomcat-7.0.65\webapps\springmvc0 ...

  5. php学习笔记(1)

    1.引用文件的方法有两种:require 及 include require 的使用方法如 require("MyRequireFile.php"); .这个函数通常放在 PHP ...

  6. Multiwii 代码解读

    GPS部分 GPS_angle[ROLL]   = (nav[LON]*cos_yaw_x - nav[LAT]*sin_yaw_y) /10;GPS_angle[PITCH]  = (nav[LON ...

  7. 简单介绍一下ODI的几个基本概念

    简单介绍一下ODI的几个基本概念   ODI的几个基本概念是本文我们主要要介绍的内容,接下来我们就开始介绍这一过程,一起来看看吧! 什么是资料库 ODI资料库可安装在任何支持ANSIISO89的数据库 ...

  8. Delphi内存操作API函数(备查,并一一学习)

    Delphi内存操作API函数System.IsMemoryManagerSet;System.Move;System.New;System.ReallocMem;System.ReallocMemo ...

  9. CentOS ips bonding

    centos ip bonding 一个网卡多个ips,多个网口一个ip 1,配置一个网卡多ips的情况cp /etc/sysconfig/network-scripts/ifcfg-eth0 /et ...

  10. HTML DOM访问

    访问 HTML 元素(节点) 访问 HTML 元素等同于访问节点 您能够以不同的方式来访问 HTML 元素: 通过使用 getElementById() 方法 通过使用 getElementsByTa ...