HDACM2085
注意范围即可
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int n = sc.nextInt();
if (n==-1) {
break;
}
long h = 1;
long l = 0;
long ht = 0;
long lt = 0;
while (n-->0) {
ht = 3*h+2*l;
lt = h+l;
h = ht;
l = lt;
}
System.out.println(h+", "+l);
}
}
}