Friends

时间:2023-03-09 02:23:31
Friends

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. <%@ include file=” ”%> ——最简洁易懂的解释

    <%@ include file=” ”%> 假如 在B.jsp 中,使用 <%@ include file=”A.jsp”%>  ,那么就是把 A.jsp 的内容 原封不动 ...

  2. poemel 端口作用

    clientPort 用于connetor组件启动时候,监听的调用,用于客户端连接 port用于服务器间通信,即rpc调用时候使用,在remote组件启动时候,生成remote,即gateway实例, ...

  3. Verilog实现IIC通讯第二版

    HMC5883三轴磁力传感器IIC通讯模块的VerilogHDL的实现 上一版并没有实现我想要的功能 0.0.1版   正在修订中   2013/9/2 //date :2013/7/7 //desi ...

  4. 雅虎UED--无障碍网页设计

    转自:http://www.sharetk.com/html/ued/Interactive-Design/1394.html 随着web使用量的增加和人们网络意识的增强,一些特殊用户开始被我们所关注 ...

  5. 一步一步重写 CodeIgniter 框架 (11) —— 使用 CodeIgniter 函数库

    在完成了CI框架的类库扩展后,很自然我们就会想到函数库的扩展.函数库的扩展在 CI 中称为 helper 函数与类有不同的地方,它不能继承,只能覆盖或者添加新的函数,或者直接完全新定义的一组函数. 由 ...

  6. uva - Broken Keyboard (a.k.a. Beiju Text)(链表)

    11988 - Broken Keyboard (a.k.a. Beiju Text) You’re typing a long text with a broken keyboard. Well i ...

  7. AsyncTask简单入门

    关系: java.lang.Object    ↳    android.os.AsyncTask<Params, Progress, Result> 概述: AsyncTask是Andr ...

  8. 开源 免费 java CMS - FreeCMS1.9 职位管理

    项目地址:http://code.google.com/p/freecms/ 职位管理 管理职位,实现招聘功能. 1. 职位管理 从左側管理菜单点击职位管理进入. 2. 加入职位 在职位列表下方点击& ...

  9. 使用storyboard实现页面跳转,简单的数据传递

    由于最近才接触到IOS,苹果已经建议storyboard来搭建所有界面了,于是我 也追随时尚,直接开始使用storyboard.(不料在涉及到页面跳转的时候,遇到的问题是:点击后没有任何反应)众所周知 ...

  10. [Andriod官方API指南]连接之蓝牙

    Bluetooth —— 蓝牙 The Android platform includes support for the Bluetooth network stack, which allows ...