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