#include <stdio.h> int main(){ __int64 h[100],l[100]; int i,j; int n; while(~scanf("%d",&n)&&n!=-1){ h[0]=1; l[0]=0; for(i=1;i<=n;++i){ h[i]=h[i-1]*3+l[i-1]*2; l[i]=h[i-1]*1+l[i-1]*1; } printf("%I64d, %I64d ",h[n],l[n]); } return 0; }
#include <stdio.h> int main(){ __int64 h[100],l[100]; int i,j; int n; while(~scanf("%d",&n)&&n!=-1){ h[0]=1; l[0]=0; for(i=1;i<=n;++i){ h[i]=h[i-1]*3+l[i-1]*2; l[i]=h[i-1]*1+l[i-1]*1; } printf("%I64d, %I64d ",h[n],l[n]); } return 0; }