File size: 282 Bytes
93237a0
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from fractions import Fraction
fence = Fraction(120)
x = fence / 4
y = fence - 2 * x
area = x * y
assert 2 * x + y == fence and x >= 0 and y >= 0
result = {"x_m": str(x), "y_m": str(y), "area_m2": str(area)}
import json
print(json.dumps(result, ensure_ascii=False, sort_keys=True))