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
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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

Constraints

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

YES

Comments

There are no comments at the moment.