http://acm.hdu.edu.cn/showproblem#include<stdio.h>
#include<string.h> int main() { _int64 a[41][2]={{0,1},{1,2}}; int i; for( i = 2;i < 41;i ++){ a[i][0]=a[i-1][1]; a[i][1]=2*(a[i-1][0]+a[i-1][1]); } while(scanf("%d",&i)!=EOF) { printf("%I64d\n",a[i][0]+a[i][1] ); } //system("pause"); }