#P7067. [NWRRC 2014] Hiking in the Hills
[NWRRC 2014] Hiking in the Hills
题目描述
Helen is hiking with her friends in a highland. Their plan is to hike from their camp to a beautiful showplace .
Unfortunately, Helen started feeling dizzy due to altitude sickness. Help her group find a route such that the topmost height on that route is as small as possible.

输入格式
The input file contains full information about the landscape of a square region in the following format. The first line contains integer — the number of triangles in the landscape . Each of following lines contains nine integers $x_{i_1}, y_{i_1}, z_{i_1}, x_{i_2}, y_{i_2}, z_{i_2}, x_{i3}, y_{i3}, z_{i3}$ — coordinates of a triangle. All coordinates belong to the closed interval . The two last lines contain three integers each: and — coordinates of the camp A and the showplace .
The given triangles are guaranteed to describe a consistent continuous landscape. Projections of triangles onto plane are non-degenerate and fill the square without overlapping. A vertex of one triangle never lays inside an edge of another triangle. Points and belong to the landscape surface and are different.
输出格式
Output a polyline route from to with the smallest possible topmost height. The first line should contain , the number of vertices in this polyline. Each of following lines should contain three integer coordinates of a polyline vertex: and Vertices must be listed along the polyline, from to (including these two endpoints).
All coordinates of polyline vertices should be integer. Each polyline edge must belong to some triangle from the input file (possibly, to its edge). The number of vertices in the polyline must not exceed .
8
1000000 0 0 1000000 1000000 150000 600000 600000 400000
0 1000000 0 600000 600000 400000 600000 1000000 300000
0 1000000 0 400000 300000 150000 600000 600000 400000
400000 0 200000 1000000 0 0 400000 300000 150000
400000 300000 150000 1000000 0 0 600000 600000 400000
600000 600000 400000 1000000 1000000 150000 600000 1000000 300000
0 0 0 400000 0 200000 400000 300000 150000
0 1000000 0 0 0 0 400000 300000 150000
100000 700000 37500
900000 400000 137500
4
100000 700000 37500
400000 300000 150000
900000 150000 100000
900000 400000 137500
提示
Time limit: 2 s, Memory limit: 256 MB.