2013-04-17 14:34:39 +08:00

7 lines
125 B
Python

a, b = 1, 1
n = (a + 1) // 2
while n < 10 ** 12:
a, b = 3 * a + 4 * b, 2 * a + 3 * b
n = (a + 1) // 2
print (b + 1) // 2