捉迷藏AI (CI翻译)
Victor and Peter are playing hide-and-seek. Peter has hidden, and Victor is to find him. In the room where they are playing, there is only one non-transparent wall and one double-sided mirror. Victor and Peter are points with coordinates $(*x*_{*v*}, *y*_{*v*})$ and $(*x*_{*p*}, *y*_{*p*})$ respectively. The wall is a segment joining points with coordinates $(*x*_{*w*, 1}, *y*_{*w*, 1})$ and $(*x*_{*w*, 2}, *y*_{*w*, 2})$, the mirror — a segment joining points $(*x*_{*m*, 1}, *y*_{*m*, 1})$ and $(*x*_{*m*, 2}, *y*_{*m*, 2})$.
Victor 和 Peter 正在玩捉迷藏。Peter 躲了起来,Victor 要去找他。游戏所在的房间里只有一面不透明的墙和一面双面镜。Victor 和 Peter 分别是坐标为 $(*x*_{*v*}, *y*_{*v*})$ 和 $(*x*_{*p*}, *y*_{*p*})$ 的点。墙是连接坐标为 $(*x*_{*w*, 1}, *y*_{*w*, 1})$ 和 $(*x*_{*w*, 2}, *y*_{*w*, 2})$ 的两点的线段,镜子是连接坐标为 $(*x*_{*m*, 1}, *y*_{*m*, 1})$ 和 $(*x*_{*m*, 2}, *y*_{*m*, 2})$ 的两点的线段。AI (CI翻译)
If an obstacle has a common point with a line of vision, it's considered, that the boys can't see each other with this line of vision. If the mirror has a common point with the line of vision, it's considered, that the boys can see each other in the mirror, i.e. reflection takes place. The reflection process is governed by laws of physics — the angle of incidence is equal to the angle of reflection. The incident ray is in the same half-plane as the reflected ray, relative to the mirror. I.e. to see each other Victor and Peter should be to the same side of the line, containing the mirror (see example 1). If the line of vision is parallel to the mirror, reflection doesn't take place, and the mirror isn't regarded as an obstacle (see example 4).
如果障碍物与视线有公共点,就认为男孩无法沿这条视线看到对方。如果镜子与视线有公共点,就认为男孩可以通过镜子看到对方,也就是会发生反射。反射遵循物理规律:入射角等于反射角。入射光线和反射光线位于镜子同一侧的半平面内。也就是说,Victor 和 Peter 必须位于包含镜子的直线的同一侧,才能看到对方(见样例 1)。如果视线平行于镜子,则不会发生反射,且镜子不视为障碍物(见样例 4)。AI (CI翻译)
Victor got interested if he can see Peter, while standing at the same spot. Help him solve this problem.
Victor 想知道自己能否站在原地看到 Peter。请帮助他解决这个问题。AI (CI翻译)
Input
输入格式
AI (CI翻译)The first line contains two numbers $*x*_{*v*}$ and $*y*_{*v*}$ — coordinates of Victor.
第一行包含两个数 $*x*_{*v*}$ 和 $*y*_{*v*}$,表示 Victor 的坐标。AI (CI翻译)
The second line contains two numbers $*x*_{*p*}$ and $*y*_{*p*}$ — coordinates of Peter.
第二行包含两个数 $*x*_{*p*}$ 和 $*y*_{*p*}$,表示 Peter 的坐标。AI (CI翻译)
The third line contains 4 numbers $*x*_{*w*, 1}$, $*y*_{*w*, 1}$, $*x*_{*w*, 2}$, $*y*_{*w*, 2}$ — coordinates of the wall.
第三行包含 4 个数 $*x*_{*w*, 1}$、$*y*_{*w*, 1}$、$*x*_{*w*, 2}$、$*y*_{*w*, 2}$,表示墙的坐标。AI (CI翻译)
The forth line contains 4 numbers $*x*_{*m*, 1}$, $*y*_{*m*, 1}$, $*x*_{*m*, 2}$, $*y*_{*m*, 2}$ — coordinates of the mirror.
第四行包含 4 个数 $*x*_{*m*, 1}$、$*y*_{*m*, 1}$、$*x*_{*m*, 2}$、$*y*_{*m*, 2}$,表示镜子的坐标。AI (CI翻译)
All the coordinates are integer numbers, and don't exceed $10^{4}$ in absolute value. It's guaranteed, that the segments don't have common points, Victor and Peter are not on any of the segments, coordinates of Victor and Peter aren't the same, the segments don't degenerate into points.
所有坐标均为整数,且绝对值不超过 $10^{4}$。保证墙和镜子没有公共点,Victor 和 Peter 均不在任何线段上,Victor 和 Peter 的坐标不同,且两条线段都不是退化成点的线段。AI (CI翻译)
Output
输出格式
AI (CI翻译)Output YES, if Victor can see Peter without leaving the initial spot. Otherwise output NO.
如果 Victor 不离开初始位置就能看到 Peter,输出 YES;否则输出 NO。AI (CI翻译)
样例
-1 3
1 3
0 2 0 4
0 0 0 1
NO
0 0
1 1
0 1 1 0
-100 -100 -101 -101
NO
0 0
1 1
0 1 1 0
-1 1 1 3
YES
0 0
10 0
100 100 101 101
1 0 3 0
YES
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。