시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 44 | 36 | 35 | 85.366% |
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.
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.
7 3 7 1 7 3
YES
9 2 7 4 7 5
YES
3 1 3 2 3 3
NO