NC54490. Kingdom Reunion
描述
输入描述
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):
• if the boundary monuments of Aastria do not form a polygon, output “Aastria is not a polygon”;
• otherwise, if the boundary monuments of Abstria do not form a polygon, output “Abstria is not a polygon”;
• otherwise, if the boundary monuments of Aabstria do not form a polygon, output “Aabstria is not a polygon”;
• otherwise, if interiors of Aastria and Abstria intersect, output “Aastria and Abstria intersect”;
• otherwise, if the union of Aastria and Abstria is not equal to Aabstria, output “The union of Aastria and Abstria is not equal to Aabstria”;
• otherwise, output “OK”.
示例1
输入:
3 0 0 2 0 1 1 3 0 0 2 0 1 -1 4 0 0 1 1 2 0 1 -1
输出:
OK
示例2
输入:
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
输入:
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
示例4
输入:
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