#include <stdio.h>
//a{n} = -6a{n-1} -9a{n-2}, a{1}=1, a{2}=2(再帰なし版)
int main(void) {
int n = 1;
int a, b = 2, c = 1;
if(n==1){
a=1;
}
else if(n==2){
a=2;
}
else{
for(int i = 3; i <= n; i++){
a = -6*b -9*c;
c = b;
b = a;
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Ci8vYXtufSA9IC02YXtuLTF9IC05YXtuLTJ9LCBhezF9PTEsIGF7Mn09Mijlho3luLDjgarjgZfniYgpCgppbnQgbWFpbih2b2lkKSB7CiAgICBpbnQgbiA9IDE7CiAgICBpbnQgYSwgYiA9IDIsIGMgPSAxOyAKICAgIGlmKG49PTEpewogICAgCWE9MTsKICAgIH0KICAgIGVsc2UgaWYobj09Mil7CiAgICAJYT0yOwogICAgfQogICAgZWxzZXsKICAgIGZvcihpbnQgaSA9IDM7IGkgPD0gbjsgaSsrKXsKICAgICAgICBhID0gLTYqYiAtOSpjOwogICAgICAgIGMgPSBiOwogICAgICAgIGIgPSBhOwogICAgfQogICAgfQogICAgcHJpbnRmKCLmlbDliJdhJWTjga7lgKTjga8lZFxuIiwgbiwgYSk7CglyZXR1cm4gMDsKfQoK