- You receive input in this form:
There is a room with cables on the ground everywhere. You need to have 2 cables of the same connector type to connect them together. For example:
You can connect USB-C with USB-C but you can't connect USB-C with HDMI.
defines the size of the room (a rectangle).2 3is the length of the rectangle2
andis the width3
x y connector type
E.g.1 0 DVI
is a point on the coordinate of the rectangle's length1
andis a point on the width0
- All points (connectors) from the input will be on the edges of the rectangle never inside of it.
The aim of this program is to find out whether all the cables can be connected together without being crossed.
So just imagine the points on the rectangle coordinates. Then connect every TWO points with the same connector with line. Check if the lines don't intersect.
If yes, write "It's not possible to connect the cables."
If no, write "It's possible to connect the cables."
