fork(3) download
  1. n = int(input())
  2. b = []
  3.  
  4. for _ in range(n):
  5. l, w = map(int, input().split())
  6. b.append((min(l,w), max(l, w)))
  7.  
  8. b.sort()
  9.  
  10. l = b[-1][1]
  11. ans = b[-1][0] * b[-1][1] / 2.
  12.  
  13. for i in range(n-2, -1, -1):
  14. ans = max(ans, b[i][0] * min(l, b[i][1]), b[i][0] * b[i][1] / 2.)
  15. l = max(l, b[i][1])
  16.  
  17. print('{:.1f}'.format(ans))
Runtime error #stdin #stdout #stderr 0.12s 23588KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
EOFError: EOF when reading a line