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. 在View中使用CGridCtrl时出现系统异常

    一.简介 我的程序是单文档程序,我的View视图需要使用CGridCtrl,于是我把CGridCtrl作为子窗口嵌入到View中覆盖住整个View.由于不能像gridctrl_demo227那样直接在 ...

  2. font awesome使用笔记

    背景 今天将BS项目部署到IIS服务器上时.首次打开一个使用font awesome图标集的页面是加载非常慢. 于是果断按下F12查看具体页面的请求时常.除去其他异步数据的加载消耗时间以外.我居然看到 ...

  3. CPUから広がり

    处理技术: 超标量是通过内置多条流水线来同时执行多个处理器,其实质是以空间换取时间.而超流水线是通过细化流水.提高主频,使得在一个机器周期内完成一个甚至多个操作,其实质是以时间换取空间. スター: 真 ...

  4. java中文件保存、打开文件对话框

    package com.soft.test; //AWT: FileDialog类 + FilenameFilter类 可以实现本功能 //Swing: JFileChooser类 + FileFil ...

  5. 快排 quicksort 快速排序

    首先看这个 http://www.cnblogs.com/morewindows/archive/2011/08/13/2137415.html 看完后就没有什么不理解的了... PS 注意 凡是在一 ...

  6. 转:一个strcpy的问题(很容易做错)

    下面的执行结果是什么? #include<stdio.h> #include<string.h> void main() { "; "; strcpy(d, ...

  7. JavaEE Tutorials (12) - 创建和使用基于字符串的Criteria查询

    12.1基于字符串的Criteria API查询概述17812.2创建基于字符串的查询17812.3执行基于字符串的查询179

  8. 虚拟机的静态内部 IP 地址

     这是什么? 借助最新的 PowerShell 版本,您现在能够定义和配置特定的内部 IP 地址,该地址可以静态分配给部署在虚拟网络中的 IaaS 虚拟机.使用此功能,您可以直接为虚拟机配置内部 ...

  9. STL内存配置器

    一.STL内存配置器的总体设计结构 1.两级内存配置器:SGI-STL中设计了两级的内存配置器,主要用于不同大小的内存分配需求,当需要分配的内存大小大于128bytes时, 使用第一级配置器,否则使用 ...

  10. [置顶] .NET下枚举类型的Save和Load分析

    今天在写代码的时候,心血来潮对原来的字符串保存状态位的方式很不满意,对于代码里出现了 state == "1" 这样的状态判断很是不爽.那么理想中的判断是怎样的呢?很简单如你所想枚 ...