#include <stdio.h>
int take(int n){
if(n==2){
return 2;
}
else if(n==1){
return 1;
}
else {return -6*take(n-1)-9*take(n-2);}
}
int main(void) {
int n=10;
for(int i=3;i<=n;i++){
printf("%dのとき%d\n",i
,take
(i
));} return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgdGFrZShpbnQgbil7CglpZihuPT0yKXsKCQlyZXR1cm4gMjsKCX0KCWVsc2UgaWYobj09MSl7CgkJcmV0dXJuIDE7Cgl9CgllbHNlIHtyZXR1cm4gLTYqdGFrZShuLTEpLTkqdGFrZShuLTIpO30KCQp9CgoKaW50IG1haW4odm9pZCkgewppbnQJbj0xMDsKICAgZm9yKGludCBpPTM7aTw9bjtpKyspewoJcHJpbnRmKCIlZOOBruOBqOOBjSVkXG4iLGksdGFrZShpKSk7fQoJcmV0dXJuIDA7Cn0K