|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||128 MB||22||7||1||10.000%|
Kalvin John Ian Helvik IV and Karl James Ingram Helvik III are second cousins and kings of neighbouring countries, Aastria and Abstria. One hundred years ago their countries constituted a single country, but the old king Helvik died and left his country to his twin sons, Ian and Ingram. Nobody knew what to do, until it was suggested to split the country into two equal parts. This was an overwhelmingly complex task, which the wisemen tried to cope with by calling the best minds from the future to solve.
Unfortunately, five attempts to solve the problem had failed, and the bloody civil war broke out. It lasted for seven years and ended with the NEERC (Northeastern Enormously Ragged Combat). As the Final Ordinance said, there would be two new countries in the place of the old one, one for Ian and one for Ingram. But these two countries had unequal areas, so it took only three years for war to start again.
After ninety years of war, all resources of two countries were exhausted. At the end of the year both kings had realized that they would not survive the next year if the war continued, so they simultaneously sent envoys with offers of peace. They had decided to unite their countries back and live in peace. The united land of Aastria and Abstria was named Aabstria.
In the manuscripts of the old ages you had found several descriptions of boundaries of the countries. Each description is a sequence of locations of boundary monuments, which are listed in clockwise or counterclockwise order following the boundary. However, you suddenly realized that in different sources locations of boundary monuments differ. In some of them, the boundary does not even form a polygon. You decided to do an investigation to discover what the actual boundaries of the countries were. Given locations of the boundary monuments for each of three countries the following statements should hold:
Your task is to write a program that checks if these facts are true.
The first line of the input file contains the number of vertices in the boundary of Aastria, na (1 ≤ na ≤ 10 000). The next na lines contain two integers each — the coordinates of Aastria boundary monuments in clockwise or counterclockwise order.
After that, descriptions of Abstria and Aabstria are given in the same format as above.
The coordinates of all monuments do not exceed 105 by their absolute values. It is guaranteed that two boundary monuments can coincide only if they belong to different countries.
Output a single line with one the following strings (without quotes):
3 0 0 2 0 1 1 3 0 0 2 0 1 -1 4 0 0 1 1 2 0 1 -1
4 0 0 1 1 0 1 1 0 3 0 0 0 1 0 2 1 1 2
Aastria is not a polygon
3 0 2 1 0 2 2 3 0 1 2 1 1 3 3 0 0 3 0 0 3
Aastria and Abstria intersect
3 0 0 1 0 0 1 3 2 0 3 0 2 1 3 4 0 5 0 4 1
The union of Aastria and Abstria is not equal to Aabstria