Friends
Description
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
For each test case, the first line contains an integer $n$($0\leq n\leq 3000$), denoting the number of languages.
Output
Sample Input
0
2
Sample Output
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++;
}
}
}
随机推荐
- oracle11g dataguard 完全手册(转)
转自:http://www.cnblogs.com/tippoint/archive/2013/04/18/3029019.html 一.前言: 网络上关于dataguard的配置文章很多,但是很 ...
- USACO Longest Prefix 【水】
用Dp的思想解决了这道题目,也就是所谓的暴力= = 题意:给出一个集合,一个字符串,找出这个字符串的最长前缀,使得前缀可以划分为这个集合中的元素(集合中的元素可以不全部使用). 还不会Trie 树QA ...
- ASP.NET MVC 5 学习教程:添加查询
原文 ASP.NET MVC 5 学习教程:添加查询 起飞网 ASP.NET MVC 5 学习教程目录: 添加控制器 添加视图 修改视图和布局页 控制器传递数据给视图 添加模型 创建连接字符串 通过控 ...
- 基于visual Studio2013解决C语言竞赛题之0523魔方阵
题目
- PLSQL Developer过期要注冊表
打开执行输入 regedit 打表注冊表 删除 HKEY_CURRENT_USER\Software\Allround Automations HKEY_CURRENT_USER\Software\M ...
- CentOS的配置文件
/etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行.并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一个 ...
- 一、Nginx配置文件详解
配置文件介绍 主要有两部分:分别是 main:主体部分 http{}:虚拟主机配置部分 配置指令主要以分号结尾:配置语法:directive value1 [value2 ....] 支持使用的变量 ...
- ZOJ 3609 求逆元
Modular Inverse Time Limit: 2 Seconds Memory Limit: 65536 KB The modular modular multiplicative ...
- SqlServer和Oracle中一些常用的sql语句6 存储过程
--不带参数的存储过程 CREATE procedure proc_sql1 as begin declare @i int set @i=0 while @i<26 begin print c ...
- 关于js基础easy忘记的那些事儿
1.Number() 通过这个函数转化后的值仅仅有两个:数值和NaN,通过parseInt也能转化为数值.可是像"134df"转化后的值为134,而Number("134 ...