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. pycharm+QT4的helloworld

    # -*- coding: utf-8 -*- from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exc ...

  2. (Problem 13)Large sum

    Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 371072875339 ...

  3. jsp字段判空

    是对象吧String jsp的写法 <% if(str == null) { %> str is null <% } else { %> str not null <% ...

  4. WebFetch 是无依赖极简网页爬取组件

    WebFetch 是无依赖极简网页爬取组件,能在移动设备上运行的微型爬虫. WebFetch 要达到的目标: 没有第三方依赖jar包 减少内存使用 提高CPU利用率 加快网络爬取速度 简洁明了的api ...

  5. Netty开发实现高性能的RPC服务器

    Netty开发实现高性能的RPC服务器 RPC(Remote Procedure Call Protocol)远程过程调用协议,它是一种通过网络,从远程计算机程序上请求服务,而不必了解底层网络技术的协 ...

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

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

  7. codeforces 264D Colorful Stones

    题目 题目来自于rng_58Orz. 算法 讨论某个状态\((x,y)\)是否可达,\(x\)是狐狸到达的石头,\(y\)是猫的. 题解说,如果满足以下条件,那么它就是可到达状态: \(t[0..y] ...

  8. PHP函数详细剖析之rtrim函数 By ACReaper

    string rtrim ( string $str [, string $charlist ] ) 这个函数很好理解.r表示右边.trim表示修剪.即右边修剪.默认修剪字符str右边的字符.默认修剪 ...

  9. BitHacks--位操作技巧

    ---------------------------------------------------------------------------------------------------- ...

  10. log4net使用经验总结

    下面介绍几条我认为比较好的经验,让我们更好的运用log4net 1.web程序时不把log4net的配置文件放在web.config中 原因:一个项目随着需求的变更,配置字节会特别多,不便查阅及维护. ...