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