[BOJ 13733] Square Deal
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
2
Time limit:
2.0s
Memory limit:
512M
Problem types
Allowed languages
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.</p>

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
예제 출력 1
YES
예제 입력 2
9 2
7 4
7 5
예제 출력 2
YES
예제 입력 3
3 1
3 2
3 3
예제 출력 3
NO
Comments