Square Deal
시간 제한: 2000ms메모리 제한: 512MB출처: ICPC Mid-Central Regional 2016BOJ 13733
이 문제는 본문 이미지 일부가 표시되지 않습니다. 텍스트만으로 풀이가 어려울 수 있습니다.
문제
Given the dimensions of three rectangles, determine if all three can be glued together, touching just on the edges, to form a square. You may rotate the rectangles. For example, Figure C.1 shows successful constructions for the first two sample inputs.
[이미지 1]
Figure C.1: Constructions for the first two examples
입력
The input consists of three lines, with line j containing integers Hj and Wj , designating the height and width of a rectangle, such that 100 ≥ Hj ≥ Wj ≥ 1, and such that H1 ≥ H2 ≥ H3.
출력
Output a line saying YES if they can be glued together to form a square. Output NO otherwise.
예제
예제 1
입력
7 3 7 1 7 3
출력
YES
예제 2
입력
9 2 7 4 7 5
출력
YES
예제 3
입력
3 1 3 2 3 3
출력
NO
코드를 제출하려면 로그인하세요.