Mock CCC '18 Contest 2 J4/S2 - A Geometry Problem

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

You are given three rectangles. Determine if it is possible to arrange the three rectangles, perhaps with rotation, to form a square without the rectangles overlapping.


The lengths and widths of the rectangles are positive integers between 1 and 100.

Input Specification

The input consists of three lines. Each of the three lines contains two positive integers, the length and width of one of the rectangles.

Output Specification

Print, on a single line, YES if it is possible to form a square.

Print, on a single line, NO otherwise.

Sample Input

8 2
1 6
7 6

Sample Output



There are no comments at the moment.