logo AlgoBeat OnlineJudge
登录 注册

#206234. [NWRRC 2013] Lonely Mountain

内存限制:256 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

"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.

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.

输入格式

The first line contains single integer number -- the number of points in the parallel projection of the mountain to the plane Oxz . The second line contains pairs of integer numbers -- the coordinates of the polygonal chain, representing the projection x3 .

The following two lines contain projection to the Oyz plane in the same format.

输出格式

The only line of the output file must contain a single number -- the maximum possible volume of the Lonely Mountain.

The absolute or relative precision of you answer should be at least E.g . if the actual maximum possible volume, the following must hold:

If there are no mountains corresponding to the given projections, output a single line Invalid plan.

样例

样例输入 1

6
0 0 1 1 2 0 3 3 4 4 6 0
5
0 0 1 1 2 1 3 4 4 0

样例输出 1

21.824074074074074073

样例输入 2

3
-1 0 0 1 2 0
4
0 0 1 1 2 2 3 0

样例输出 2

Invalid plan

数据范围与提示

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