A7770 | Letter A
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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$ .
You are given three segments on the plane. They form the letter $A$ if the following conditions hold:
- 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.
- 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$ ).
You are given three segments on the plane. They form the letter $A$ if the following conditions hold:
- 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.
- 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$ ).
输入格式
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 $10^{8}$ by absolute value. All segments have positive length.
输出格式
Output one line for each test case. Print «YES» (without quotes), if the segments form the letter $A$ and «NO» otherwise.
输入输出样例
输入 #1
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
输出 #1
YES NO YES
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted