Suppose that P1 is an infinite-height prism whose axis is parallel to the z-axis, and P2 is also an infinite-height prism whose axis is parallel to the y-axis. P1 is defined by the polygon C1 which is the cross section of P1 and the xy-plane, and P2 is also defined by the polygon C2 which is the cross section of P2 and the xz-plane.
Figure I.1 shows two cross sections which appear as the first dataset in the sample input, and
Figure I.2 shows the relationship between the prisms and their cross sections.
Figure I.3 shows the intersection of two prisms in Figure I.2, namely, P1 and P2.
Write a program which calculates the volume of the intersection of two prisms.