CF993A.Two Squares
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the square, i.e. if one square is completely inside another, they intersect. If the two squares only share one common point, they are also considered to intersect.
给你两个正方形:一个的边与坐标轴平行,另一个的边与坐标轴成 45 度角。判断这两个正方形是否相交。
正方形的内部被视为正方形的一部分,即若一个正方形完全位于另一个正方形内部,则它们相交;若两个正方形仅有一个公共点,也视为相交。
输入格式
The input data consists of two lines, one for each square, both containing 4 pairs of integers. Each pair represents coordinates of one vertex of the square. Coordinates within each line are either in clockwise or counterclockwise order.
The first line contains the coordinates of the square with sides parallel to the coordinate axes, the second line contains the coordinates of the square at 45 degrees.
All the values are integer and between −100 and 100.
输入数据包含两行,每行对应一个正方形,每行均包含 4 对整数。每对整数表示该正方形的一个顶点的坐标。同一行内的坐标按顺时针或逆时针顺序给出。
第一行包含边与坐标轴平行的正方形的顶点坐标,第二行包含旋转了 45 度的正方形的顶点坐标。
所有数值均为介于 −100 和 100 之间的整数。
输出格式
Print "Yes" if squares intersect, otherwise print "No".
You can print each letter in any case (upper or lower).
如果正方形相交,则输出“Yes”,否则输出“No”。
你可以以任意大小写(大写或小写)输出每个字母。
输入输出样例
输入#1
0 0 6 0 6 6 0 6 1 3 3 5 5 3 3 1
输出#1
YES
输入#2
0 0 6 0 6 6 0 6 7 3 9 5 11 3 9 1
输出#2
NO
输入#3
6 0 6 6 0 6 0 0 7 4 4 7 7 10 10 7
输出#3
YES
说明/提示
In the first example the second square lies entirely within the first square, so they do intersect.
In the second sample squares do not have any points in common.
Here are images corresponding to the samples:



在第一个示例中,第二个正方形完全位于第一个正方形内部,因此它们相交。
在第二个示例中,两个正方形没有任何公共点。
以下是对应于示例的图片:



输入解题思路,AI测评打分。不知道怎么写?