if 1 / 8 of a pencil is black 1 / 2 of the remaining is white and the remaining 7 / 2 is blue find the total length of the pencil ?
n0 = 1.0
n1 = 8.0
n2 = 1.0
n3 = 2.0
n4 = 7.0
n5 = 2.0
t0 = n0 / n1
t1 = n0 / n3
t2 = n4 / n3
t3 = t0 + t1
t4 = t3 * t2
t5 = 1.0 - t3
t6 = t4 / t5
answer = t6 + t2
print(answer)