原题链接--
https://acs.jxnu.edu.cn/problem/CF6Ahttps://acs.jxnu.edu.cn/problem/CF6A
Triangle
2000ms 65536K
描述:
Johnny has a younger sister Anne, who is very clever and smart. As she came home from the kindergarten, she told his brother about the task that her kindergartener asked her to solve. The task was just to construct a triangle out of four sticks of different colours. Naturally, one of the sticks is extra. It is not allowed to break the sticks or use their partial length. Anne has perfectly solved this task, now she is asking Johnny to do the same.
The boy answered that he would cope with it without any difficulty. However, after a while he found out that different tricky things can occur. It can happen that it is impossible to construct a triangle of a positive area, but it is possible to construct a degenerate triangle. It can be so, that it is impossible to construct a degenerate triangle even. As Johnny is very lazy, he does not want to consider such a big amount of cases, he asks you to help him.
译文:约翰尼有个妹妹叫安妮,她很聪明。当她从幼儿园回到家时,她告诉她哥哥关于幼儿园让她解决的任务。任务是用四根不同颜色的木棍,做一个三角形。自然,有一根棍子是多余的。弄坏木棍或是使用它们一部分的长度是不被允许的。安妮已经完美的解决了这个问题,现在她想让约翰尼做相同的任务。
男孩回答道他可以毫无困难的应对。然而,一会他就发现可能发生不同的棘手的事情。不可能构造一个正面积的三角形,但是可能构造一个退化的三角形。它也可能是这样,不可能构造出一个退化的三角形。因为约翰尼是懒惰的,他不想思考如此多可能的情况,他寻求你的帮助。
输入:
The first line of the input contains four space-separated positive integer numbers not exceeding 100 — lengthes of the sticks.
译文:第一行输入包含四个由空格分隔的正整数并且木棍的长度不超过100。
输出:
Output TRIANGLE if it is possible to construct a non-degenerate triangle. Output SEGMENT if the first case cannot take place and it is possible to construct a degenerate triangle. Output IMPOSSIBLE if it is impossible to construct any triangle. Remember that you are to use three sticks. It is not allowed to break the sticks or use their partial length.
译文:如果可能构造出一个不退化的三角形输出TRIANGLE。如果第一种情况不能发生并可能构造一个退化的三角形输出SEGMENT。如果不可能构造任何三角形输出IMPOSSIBLE。记住你必须使用三个木棍。弄坏木棍或是使用它们一部分的长度是不被允许的。
样例输入:
4 2 1 3
样例输出:
TRIANGLE
样例输入:
7 2 2 4
样例输出:
SEGMENT
样例输入:
3 5 9 1
样例输出:
IMPOSSIBLE