P7090 [NWRRC 2013] Lonely Mountain

Description

"This was made by Thror, your grandfather, Thorin", he said in answer to the dwarves' excited questions. "It is a plan of the Mountain. " --- J. R. R. Tolkien. The Hobbit, or There and Back Again The plan of the Lonely Mountain consists of two parallel projections of the mountain to two projection planes. Both planes are perpendicular to the ground and each other. Each projection has a mountain-like shape. ![](https://www.acmicpc.net/upload/images2/lonely.png) Since Bilbo Baggins has never seen the mountain, he tries to imagine it. Is it really the Lonely Mountain or some ridges and other mountains surround it? In any case, it must be tremendous to hold the whole dwarves' kingdom! Bilbo decided to estimate the maximum possible volume of the Lonely Mountain and nearby mountains (if any) based on the plan provided by Gandalf.

Input Format

N/A

Output Format

N/A

Explanation/Hint

Time limit: 2 s, Memory limit: 256 MB.