抢车位

TimeLimit:500MS  MemoryLimit:64MB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description

中文版:

一个停车场拥有(2n - 2)个空车位. 不幸的是,汽车的总数大于停车场的空车位数量. 而且,每一种类型的车的数量也超过了停车位的数量!这就是停车场上没有自由空间的原因。

在这一行摆放汽车的直线上,相同种类的汽车是连续摆放在一起的。

英文版:

To quickly hire highly skilled specialists one of the new IT City companies made an unprecedented move. Every employee was granted a car, and an employee can choose one of four different car makes.

The parking lot before the office consists of one line of (2n - 2) parking spaces. Unfortunately the total number of cars is greater than the parking lot capacity. Furthermore even amount of cars of each make is greater than the amount of parking spaces! That's why there are no free spaces on the parking lot ever.

Looking on the straight line of cars the company CEO thought that parking lot would be more beautiful if it contained exactly nsuccessive cars of the same make. Help the CEO determine the number of ways to fill the parking lot this way.


Input

中文版:

输入只有一行,包含一个整数n (3 ≤ n ≤ 30) — 表示相同种类的车连续的数量

英文版:

The only line of the input contains one integer n (3 ≤ n ≤ 30) — the amount of successive cars of the same make.

Output

中文版:

输出一个整数 — 总共有多少种摆放四种类型的车的方法。

英文版:

Output one integer — the number of ways to fill the parking lot by cars of four makes using the described way.

SampleInput
3
SampleOutput
24
Note

Let's denote car makes in the following way: A — 阿斯顿马丁, B — 宾利, M — 奔驰迈巴赫, Z — 扎波罗热人牌汽车. For n = 3 there are the following appropriate ways to fill the parking lot: AAAB AAAM AAAZ ABBB AMMM AZZZ BBBA BBBM BBBZ BAAA BMMM BZZZ MMMA MMMB MMMZ MAAA MBBB MZZZ ZZZA ZZZB ZZZM ZAAA ZBBB ZMMM

Originally it was planned to grant sport cars of Ferrari, Lamborghini, Maserati and Bugatti makes but this idea was renounced because it is impossible to drive these cars having small road clearance on the worn-down roads of IT City.

Submit
题目统计信息详细
总AC数7
通过人数7
尝试人数9
总提交量14
AC率50.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: