aboutsummaryrefslogtreecommitdiff
path: root/challenge-112/abigail/python/ch-2.py
blob: da542b06f2cb2b688c4a74a75c32e425f29b6ed7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/opt/local/bin/python

#
# See ../README.md
#

#
# Run as: python ch-2.py < input-file
#

import fileinput
from math import sqrt

SQRT5 = sqrt (5)
PHI   = (1 + SQRT5) / 2

for line in fileinput . input ():
    print (round (pow (PHI, int (line) + 1) / SQRT5))