标签:翻译 segments 练习 样例 Day16 letter YES 线段 first
题目:Letter A | JXNUOJ
翻译:
Letter A
1000ms 65536K
描述:
Little Petya learns how to write. The teacher gave pupils the task to write the letter A on the sheet of paper. It is required to check whether Petya really had written the letter A.
小Petya学习如何写字。老师给学生的任务是在纸上写字母A。需要检查的是彼佳是否真的写了字母A。
You are given three segments on the plane. They form the letter A if the following conditions hold:
已知平面上有三个线段。如符合下列条件,则构成字母A:
-
Two segments have common endpoint (lets call these segments first and second), while the third segment connects two points on the different segments.
两个线段有共同的端点(我们称这些线段为第一段和第二段),而第三段连接不同线段上的两点。
-
The angle between the first and the second segments is greater than 0 and do not exceed 90 degrees.
-
第一段与第二段的夹角大于0且不大于90度。
-
The third segment divides each of the first two segments in proportion not less than 1 / 4 (i.e. the ratio of the length of the shortest part to the length of the longest part is not less than 1 / 4).
-
第三段将前两段按不小于1 / 4的比例分割(即最短部分的长度与最长部分的长度之比不小于1 / 4)。
输入:
The first line contains one integer t (1 ≤ t ≤ 10000) — the number of test cases to solve. Each case consists of three lines. Each of these three lines contains four space-separated integers — coordinates of the endpoints of one of the segments. All coordinates do not exceed 108 by absolute value. All segments have positive length.
第一行包含一个整数t——测试用例的数量。每个样例包括三行。这三行中的每一行包含四个用空格分隔的整数——其中一个线段端点的坐标。所有坐标的绝对值不超过108。所有线段的长度都是正的。
输出:
Output one line for each test case. Print «YES» (without quotes), if the segments form the letter A and «NO» otherwise.
为每个测试用例输出一行。如果片段由字母A组成则输出«YES»(不带引号),否则输出«NO»
样例输入:
3
4 4 6 0
4 1 5 2
4 0 4 4
0 0 0 6
0 6 2 -4
1 1 0 1
0 0 0 5
0 5 2 -1
1 2 0 1
样例输出:
YES
NO
YES
标签:翻译,segments,练习,样例,Day16,letter,YES,线段,first 来源: https://www.cnblogs.com/shw940795634/p/15877262.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。