Lang:Python2
Edit1234567891011121314151617181920212223242526272829import maths5 = math.sqrt(5.)def fff(n):n = float(n)return (5.-s5)/10 * math.pow((3.+s5)/2, n) + (5.+s5)/10 * math.pow((3. - s5)/2, n)def g(n):n = int(n)a = fff(n + 1)b = fff(n)xx = a - b + 0.5xx = math.floor(xx)xx= int(xx)return xx % 1000000007while True:try:x = raw_input()print g(x)except EOFError:break