303246: CF630I. Parking Lot

Memory Limit:64 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Parking Lot

题意翻译

停车场共有 $2n-2$ 个停车位。共有 $4$ 种品牌的汽车,每种汽车的数量都远大于停车位的数量。 该公司首席执行官认为,如果停车场有 **恰好** $n$ 个连续汽车的品牌相同,则停车场会更漂亮。 给定n的值,问有多少的方案使停车场满足条件。 ### 输入格式: 一行,包含一个整数 $n$($3\leq n\leq 30$)。 ### 输出格式: 输出一个整数,即总方案数。

题目描述

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 $ n $ successive cars of the same make. Help the CEO determine the number of ways to fill the parking lot this way.

输入输出格式

输入格式


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

输出格式


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

输入输出样例

输入样例 #1

3

输出样例 #1

24

说明

Let's denote car makes in the following way: A — Aston Martin, B — Bentley, M — Mercedes-Maybach, Z — Zaporozhets. 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.

Input

题意翻译

停车场共有 $2n-2$ 个停车位。共有 $4$ 种品牌的汽车,每种汽车的数量都远大于停车位的数量。 该公司首席执行官认为,如果停车场有 **恰好** $n$ 个连续汽车的品牌相同,则停车场会更漂亮。 给定n的值,问有多少的方案使停车场满足条件。 ### 输入格式: 一行,包含一个整数 $n$($3\leq n\leq 30$)。 ### 输出格式: 输出一个整数,即总方案数。

加入题单

算法标签: