scientific_comp_projects/CODE/[python]kattis/trivial/pieceofcake2.py

36 lines
614 B
Python
Raw Normal View History

2021-10-29 15:16:40 +02:00
numbers = input()
n, h, v = numbers.split(' ')
n = int(n)
h = int(h)
v = int(v)
cake1 = h*v
cake2 = h*(n-v)
cake3 = (n-h)*v
cake4 = (n-h)*(n-v)
if cake1>cake2:
if cake1>cake3:
if cake1>cake4:
cake = cake1
else:
cake = cake4
else:
if cake3>cake4:
cake = cake3
else:
cake = cake4
else :
if cake2>cake3:
if cake2>cake4:
cake = cake2
else :
cake = cake4
else :
if cake3 > cake4 :
cake = cake3
else:
cake = cake4
cake = cake*4
print(cake)