pieceofcake2 - bradendubois/competitive-programming GitHub Wiki
Piece of Cake!
ID: pieceofcake2
Difficulty: 1.4
CPU Time: 1 second
Memory: 1024 MB
Solution
Some basic geometry shows each of the areas, which consist of (v, h), (n-v, h), (v, n-h), and (n-v, n-h). Since all 4 areas are possibly included, some simplification can be done such that the biggest area is max(v, n-v) * max(h, n-h) * 4 (the height).