Triangle Cuts 三角形切割

Description

A computer science professor was watching his young daughter use scissors to cut large triangular pieces of paper that were green on one side and white on the other. She always kept the white side of the paper up, so the green side was never visible, and she always followed the same general procedure. Starting with one large white triangle, she would always make exactly three straight cuts, each of which separated one piece of paper into two, and end up with exactly four smaller white triangles. Then she would put the small triangles aside and start over with a new large triangle.

The first three figures show some of the possibilities. All angles are in degrees. In Figures 1 and 2, no cut goes all the way from one vertex of the original large triangle to the opposite side. In fact, these two figures (including any rotations thereof) show the only ways that she could produce four triangles without making such a cut. The pattern in Figure 4 can't happen, because her cuts always separate the current piece of paper into two pieces; after she cuts off the rightmost triangle in Figure 4, none of the remaining cuts will separate the remaining triangle into two pieces.

The professor imagined a room full of children producing piles of triangles using different methods, and wondered if he could identify his daughter's work. Given the exact size and shape of four small triangles, could he tell if she could have produced them from one large triangle? After a moment's thought he realized that he could simplify the problem and consider only the shapes of the triangles, noting that if the shapes were compatible, there would always be some appropriate sizes for the small triangles. This led to the following problem for you to solve: given the angles of a large triangle and four smaller ones, is it possible that the small triangles could have been obtained from the large one using the procedure his daughter was following?
Input

The input contains from 1 to 30 datasets followed by a line containing only "0 0 180". Each dataset contains 15 positive integers separated by single blanks on one line. Each integer is less than 180. Each group of three integers are the vertex angles for one triangle, expressed in degrees. Assume that none of the triangles is flipped over so the green side of the paper is up, and the vertex angles are listed in clockwise order around each individual triangle.

The first four datasets of the sample input below correspond to the figures above.
Output

The output contains one line for each data set. If the child's cutting play, as described above, started with a triangle with the first three angles, and could have ended up with triangles matching the last four triangles in the dataset, then the line contains "yes". Otherwise the line contains "no".
Sample Input

60 70 50 30 100 50 75 70 35 75 60 45 45 65 70
40 75 65 60 40 80 20 120 40 45 85 50 25 55 100
60 60 60 30 60 90 30 60 90 90 60 30 90 60 30
30 60 90 30 120 30 30 120 30 30 120 30 30 120 30
60 70 50 30 100 50 75 70 35 75 60 45 70 65 45
0 0 180
Sample Output

yes
yes
yes
no
no

Triangle Cuts
-
Area in Triangle 三角形问题
-

-

-
Triangle
-
Triangle Conjecture 程序编写技术
-
Circle and Triangle 程序是怎么编写呢
-
Triangle 代码的一个设计
-
Largest Triangle 程序编写代码的方法
-
Interesting Yang Yui Triangle 杨晖三角
-

-
Area in Triangle 具体怎么做
-
Triangle Conjecture
-

2.1斐波那契系列问题 2.2矩阵系列问题 2.3跳跃系列问题 3.1 01背包 3.2 完全背包 3.3多重背包 3.4 一些变形选讲 2.1斐波那契系列问题 在数学上，斐波纳契数列以如下被以递归的方法定义：F(0)=0，F(1)=1, F(n)=F(n-1)+F(n-2)（n&gt;=2，n∈N*）根据定义，前十项为1, 1, 2, 3, 5, 8, 13, ...

from urllib import request import os from user_agents import ua_list import time import random import re import requests from lxml import etree class MeiziSpider(): def init(self): self.url = ‘https:/...

Java入门学习路线目录索引（持续更新中）

redis——相关问题汇总

MySQL数据库—SQL汇总

HTML CSS整理笔记

Java 中传统的 IO 包基于流模型实现，交互方式为同步、阻塞，当发生读取或写入操作时，线程会阻塞在此，直到操作完成。编码时采用这种方式虽然源码较直观易维护，但容易产生应用性能下降问题，且 IO 效率及其拓展性存在较大局限 Java 1.4 开始引入 NIO 框架，提供了 Channel(通道)、Selector(IO复用器/选择器)、Buffer(缓冲区)，可构建多路复用、同步非阻塞的 IO...
linux系列之常用运维命令整理笔录

Python 基础（一）：入门必备知识
Python 入门必备知识，你都掌握了吗？

Ngrok： 超简单的内网穿透，了解一下 ？
【1】什么是内网穿透？ 首先，我们生活中的网络从应用上可以分为内网和外网； 内网就是你自己的网络环境，就你自己能访问，比如你本地测试进行的localhost； 外网就不言而喻了，你看网页，视频等这些网址都是外网。 那么什么又是内网穿透呢？简单的说就是通过访问一个外网地址，然后穿透到你的内网地址。 【2】内网穿透有什么用？ 【情景1】 假设你写了一个代码功能，本地测试已经OK，此...

Python十大装B语法
Python 是一种代表简单思想的语言，其语法相对简单，很容易上手。不过，如果就此小视 Python 语法的精妙和深邃，那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点，并附上详细的实例代码。如能在实战中融会贯通、灵活使用，必将使代码更为精炼、高效，同时也会极大提升代码B格，使之看上去更老练，读起来更优雅。

python学习目录

JavaScript 为什么能活到现在？

Nginx 原理和架构
Nginx 是一个免费的，开源的，高性能的 HTTP 服务器和反向代理，以及 IMAP / POP3 代理服务器。Nginx 以其高性能，稳定性，丰富的功能，简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求，主要负责调度工作进程：加载配置、启动工作进程及非停升级。worker 进程负责处...