HDU/2045/main.c

21 lines
346 B
C
Raw Normal View History

2020-08-31 16:48:58 +00:00
#include <stdio.h>
int main(void){
int numbers,i;
unsigned long long n[50] = {3};
unsigned long long count = 2, cut = 0;
for(i = 1; i < 50; i++){
cut = count - cut;
count *= 2;
n[i-1] = cut*3;
}
while(scanf("%d",&numbers) == 1){
if(numbers == 1){
printf("3\n");
continue;
}
printf("%llu\n",n[numbers-2]);
}
return 0;
}