Pro.ID22482 TitleCloth Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22482 AC0 Submit0 Ratio- 时间&空间限制描述Recently Merlin is doing a big project --- The Cut Planning tool, which is used in cloth industry. The project is so simple, put one big cloth into many small pieces of cloth. Real cloth cutting is simple, but in the computer representation it becomes difficult. The computer couldn't judge the two small pieces of cloth intersect or not. Cloth is a simple polygon, not intersect by itself and haven't complex structure in center. And there aren't three adjoin points form one straight line. If there is at least one point is inside both of them (not include at the edge of the polygon), it considers the two of the polygons intersect. Each cloth is described in the following format: n n is the number of vertices of the cloth. (quotes for clarity) is the coordinate of a vertex, which gives the original position of the cloth, in order. First we need to move, without any rotation, the cloth so that the most-left-down point of the cloth (with the minimum x coordinate and the minimum y coordinate in case of a tie) is at the position of the original point (0, 0). For the sake of convenience, we call this most-left-down point MLD point. "X Y" (quotes for clarity) is the final position of the MLD point, and will be explained later. C is a single character, which will only be 'T' or 'F'. If 'T' we need to turn the cloth 180 degrees about the y-axis, that is, make the x coordinate of each vertex -x. If 'F', nothing has to be done. A gives the angle by that we need to rotate counter-clockwise the cloth, based on the MLD point. Finally, we have to move, without any rotation, the cloth so that the MLD point is at the position of the point (X, Y). As you can see, we have to do some preprocesses as above about the cloth. You job is that, given the descriptions of two pieces of cloth, decide whether they intersect or not after all preprocesses. 输入This problem has multiple test cases. In each test case, there are two pieces of descriptions in the given format, each for a piece of cloth. It is guaranteed that, there are at least 3 and at most 10 vertices of a cloth, and all coordinates in the input are integers not less than -10000 and not larger than 10000, the rotating angle is given in degree and will be between 0 and 360 degrees, inclusively. There is a blank line after each test case. The last test case is followed by a zero, which will not be processed. 输出Description Recently Merlin is doing a big project --- The Cut Planning tool, which is used in cloth industry. The project is so simple, put one big cloth into many small pieces of cloth. Real cloth cutting is simple, but in the computer representation it becomes difficult. The computer couldn't judge the two small pieces of cloth intersect or not. Cloth is a simple polygon, not intersect by itself and haven't complex structure in center. And there aren't three adjoin points form one straight line. If there is at least one point is inside both of them (not include at the edge of the polygon), it considers the two of the polygons intersect. Each cloth is described in the following format: n n is the number of vertices of the cloth. (quotes for clarity) is the coordinate of a vertex, which gives the original position of the cloth, in order. First we need to move, without any rotation, the cloth so that the most-left-down point of the cloth (with the minimum x coordinate and the minimum y coordinate in case of a tie) is at the position of the original point (0, 0). For the sake of convenience, we call this most-left-down point MLD point. "X Y" (quotes for clarity) is the final position of the MLD point, and will be explained later. C is a single character, which will only be 'T' or 'F'. If 'T' we need to turn the cloth 180 degrees about the y-axis, that is, make the x coordinate of each vertex -x. If 'F', nothing has to be done. A gives the angle by that we need to rotate counter-clockwise the cloth, based on the MLD point. Finally, we have to move, without any rotation, the cloth so that the MLD point is at the position of the point (X, Y). As you can see, we have to do some preprocesses as above about the cloth. You job is that, given the descriptions of two pieces of cloth, decide whether they intersect or not after all preprocesses. Input This problem has multiple test cases. In each test case, there are two pieces of descriptions in the given format, each for a piece of cloth. It is guaranteed that, there are at least 3 and at most 10 vertices of a cloth, and all coordinates in the input are integers not less than -10000 and not larger than 10000, the rotating angle is given in degree and will be between 0 and 360 degrees, inclusively. There is a blank line after each test case. The last test case is followed by a zero, which will not be processed. Output Print one line of string "Yes" if they intersect or "No" otherwise. Sample Input 4 Sample Output YES Source 样例输入4 样例输出YES 作者 |