3658 - Triangle 3658 - Triángulo 3658 - Triangle

Estatísticas Env: 28 | AC: 14 | %AC: 50,00 | Pontoação: 3,70
Criado por 2015 Northwest Pacific Regional Contest
Adicionado por kko (2016-06-01)
Límiteis
Tempo Total: 12000 MS | Tempo Caso: 1000 MS |Memória: 512 MB | Saída límite (mb): 64 MB | Tamanho: 9 KB
Lenguagens activados
Disponivel em

Descripção

Determine if it is possible to produce two triangles of given side lengths, by cutting some rectangle with a single line segment, and freely rotating and flipping the resulting pieces.
Determine si es posible obtener dos triángulos dadas las longitudes de sus lados cortando un rectángulo con un único segmento de línea, rotando y dando la vuelta libremente a las piezas resultantes. 
Determine if it is possible to produce two triangles of given side lengths, by cutting some rectangle with a single line segment, and freely rotating and flipping the resulting pieces.

Especificação de entrada

The input consists of two lines. The first line contains three space-separated positive integers, indicating the desired side lengths of the first triangle. Similarly, the second line contains three space-separated positive integers, denoting the desired side lengths of the second triangle. It is guaranteed that the side lengths produce valid triangles. All side lengths are less than or equal to 100.
La entrada está formada por dos líneas. La primera, contiene tres enteros positivos separados por espacio que indican las longitudes deseadas para los lados del primer triángulo. Similarmente, la segunda línea contiene tres enteros positivos separados por espacio, denotando las longitudes deseadas para los lados del segundo triángulo. Se garantiza que las longitudes de los lados siempre producen triángulos válidos. Todas las longitudes son menores o iguales que 100.
The input consists of two lines. The first line contains three space-separated positive integers, indicating the desired side lengths of the first triangle. Similarly, the second line contains three space-separated positive integers, denoting the desired side lengths of the second triangle. It is guaranteed that the side lengths produce valid triangles. All side lengths are less than or equal to 100.

Especificação de saída

Print, on a single line, whether there exists a rectangle which could have been cut to form triangles of the given side lengths. If such a rectangle exists, print YES. Otherwise, print NO.
Imprima en una línea simple, si existe un rectángulo que pueda ser cortado en los triángulos con las longitudes dadas. Si dicho rectángulo existe, imprima YES. En caso contrario, imprima NO.
The input consists of two lines. The first line contains three space-separated positive integers, indicating the desired side lengths of the first triangle. Similarly, the second line contains three space-separated positive integers, denoting the desired side lengths of the second triangle. It is guaranteed that the side lengths produce valid triangles. All side lengths are less than or equal to 100.

Exemplo de entrada

3 4 5
4 3 5

Exemplo de saída

YES

Sugestões(s)

Sample Input #2
3 4 6
4 6 3

Sample Output #2
NO
Sample Input #2
3 4 6
4 6 3

Sample Output #2
NO
Sample Input #2
3 4 6
4 6 3

Sample Output #2
NO

Recomendação

Temos seleccionado cuidadosamente varios problemas similares: 3675 | 3377 | 3515 | 1960 | 2305 | 3091