Description

Mike has many friends. Here are nine of them: Alice, Bob, Carol, Dave, Eve, Frank, Gloria, Henry and Irene.

Mike is so skillful that he can master $n$ languages (aka. programming languages).

His nine friends are all weaker than he. The sets they can master are all subsets of Mike's languages.

But the relations between the nine friends is very complex. Here are some clues.

1. Alice is a nice girl, so her subset is a superset of Bob's. 
2. Bob is a naughty boy, so his subset is a superset of Carol's. 
3. Dave is a handsome boy, so his subset is a superset of Eve's. 
4. Eve is an evil girl, so her subset is a superset of Frank's. 
5. Gloria is a cute girl, so her subset is a superset of Henry's. 
6. Henry is a tall boy, so his subset is a superset of Irene's. 
7. Alice is a nice girl, so her subset is a superset of Eve's. 
8. Eve is an evil girl, so her subset is a superset of Carol's. 
9. Dave is a handsome boy, so his subset is a superset of Gloria's. 
10. Gloria is a cute girl, so her subset is a superset of Frank's. 
11. Gloria is a cute girl, so her subset is a superset of Bob's.

Now Mike wants to know, how many situations there might be.

 

Input

The first line contains an integer $T$($T \le 20$) denoting the number of test cases.

For each test case, the first line contains an integer $n$($0\leq n\leq 3000$), denoting the number of languages.

 

Output

For each test case, output ''Case #t:'' to represent this is the t-th case. And then output the answer. 
 

Sample Input

2
0
2
 

Sample Output

Case #1: 1
Case #2: 1024
 只要读懂题目就知道了
其实就是求32的n次方; 大数问题用Java是很方便的
 import java.math.BigInteger;
import java.util.Scanner;
public class Main{ public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int t=in.nextInt();
int cased=;
while(t-->){
int n=in.nextInt();
BigInteger b=new BigInteger("");
System.out.println("Case #"+cased+": "+b.pow(n).toString());
cased++;
}
}
}

随机推荐

  1. Minimum Window Substring @LeetCode

    不好做的一道题,发现String Algorithm可以出很多很难的题,特别是多指针,DP,数学推导的题.参考了许多资料: http://leetcode.com/2010/11/finding-mi ...

  2. YII重点文件

    yii\di\Containeryii\base\Componentyii\base\Objectyii\base\Configurableyii\web\Applicationyii\base\Ap ...

  3. X-UA-Compatible是什么

    X-UA-Compatible是神马? X-UA-Compatible是IE8的一个专有<meta>属性,它告诉IE8采用何种IE版本去渲染网页,在html的<head>标签中 ...

  4. printk

    printk的日志级别定义如下(在linux/kernel.h中): #define KERN_EMERG "<0>"/*紧急事件消息,系统崩溃之前提示,表示系统不可用 ...

  5. iOS开发- 获取精确剩余电量

    [UIDevice currentDevice].batteryMonitoringEnabled = YES; double deviceLevel = [UIDevice currentDevic ...

  6. IOS 获取网络图像尺寸 更改 图像色彩值 什么一套方法灰色

    直接在代码 头文件 // 图片处理 0 半灰色 1 灰度 2 深棕色 3 反色 +(UIImage*)imageWithImage:(UIImage*)image grayLevelType:(UII ...

  7. Hadoop源码解析之: TextInputFormat如何处理跨split的行

    我们知道hadoop将数据给到map进行处理前会使用InputFormat对数据进行两方面的预处理: 对输入数据进行切分,生成一组split,一个split会分发给一个mapper进行处理. 针对每个 ...

  8. QLinkedList和std::forward_list(都是双向链表,不支持operator[],好处可能是插入和删除都比较快)

    forward_list forward_list是C++11版本才有的.forward_list被实现为单链表,而list是一个双向链表,所以forward_list要比list高效一些.forwa ...

  9. Mysql事务,并发问题,锁机制-- 幻读、不可重复读(转)

    1.什么是事务 事务是一条或多条数据库操作语句的组合,具备ACID,4个特点. 原子性:要不全部成功,要不全部撤销 隔离性:事务之间相互独立,互不干扰 一致性:数据库正确地改变状态后,数据库的一致性约 ...

  10. Spring源码解析——如何阅读源码(转)

    最近没什么实质性的工作,正好有点时间,就想学学别人的代码.也看过一点源码,算是有了点阅读的经验,于是下定决心看下spring这种大型的项目的源码,学学它的设计思想. 手码不易,转载请注明:xingoo ...