
import math
from fractions import Fraction
import sympy as sp
pi = sp.pi
sqrt = sp.sqrt
deg = math.pi / 180.0
def fmt(v):
f = float(v)
return str(int(round(f))) if abs(f - round(f)) < 1e-9 else f'{f:.2f}'
p, h = 12, 20
F = p + h
E = (5 * p + 6 * h) / 2
assert 5 * p + 6 * h == 2 * E, (5*p + 6*h, 2*E)
V = 2 + E - F
assert V - E + F == 2
answer = V
print('ANSWER=' + fmt(answer))
print('TRAP_E_MINUS_F=' + fmt(58))
print('TRAP_F_MINUS_E=' + fmt(-58))
print('TRAP_E_ONLY=' + fmt(90))
Only each person's first answer, given before viewing the solution, is counted.
Discussion 0 comments
Log in to join the discussion.