中文版:
一个停车场拥有(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.
中文版:
输入只有一行,包含一个整数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 one integer — the number of ways to fill the parking lot by cars of four makes using the described way.
3
24NoteLet'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.