I -
Parking Lot

Crawling in process...
Crawling failed
Time Limit:500MS    
Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

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.

Input

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.

Sample Input

Input
3
Output
24

Sample Output

Hint

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.

2*n-2个停车位,4种类型的车,n辆同一类型的A车要停在一起,旁边也不能是同一类型的A,问有多少种方法

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
__int64 a=3*n-1;
__int64 aa=n-3;
__int64 ans=a*3*pow(4,aa);
printf("%lld\n",ans);
}
return 0;
}

最新文章

  1. iOS 因为reason: &#39;Pushing the same view controller instance more than once is not supported而奔溃(下)
  2. NGINX+UWSGI部署生产的DJANGO代码
  3. SIGPIPE并产生一个信号处理
  4. lintcode.177 把排序数组转换为高度最小的二叉搜索树
  5. eslint使用
  6. Android基础知识06—活动的四大启动模式
  7. lnamp环境搭建博客、论坛
  8. xcode的打包上线出问题:导入此构建版本时出错
  9. easyUI详解
  10. 8--Python入门--函数
  11. 运行scrapy crawl (文件名)时显示invalid syntax和no modle &#39;win32api&#39;解决方案
  12. 如何区分DDR1 DDR2 DDR3内存条
  13. arch/arm/Makefile:382: recipe for target &#39;kernel.img&#39; failed
  14. linux 重定向 标准错误与标准输出到同一文件
  15. English trip V1 - 辅导课 VOCABULARY BRUSH UP(1-6) 词汇刷新 SA:Winona
  16. Python SQLAlchemy 模块
  17. uva10480最小割集
  18. IDEA 配置SSH2
  19. Linux 入门记录:二、Linux 文件系统基本结构
  20. LoadRunner录制: 选择协议

热门文章

  1. [Java]Java分层概念
  2. html5——动画案例(大海)
  3. 神经网络图灵机(Neural Turing Machines, NTM)
  4. CSS居中布局方案
  5. 《C++ Primer 第5版》第1章
  6. zTree 模糊搜索
  7. LINUX-查看进程内环境变量
  8. map集合遍历,放入id
  9. ZOJ 3180 Number Game(模拟,倒推)
  10. enote笔记语言(4)(ver0.3)——“5w1h2k”分析法