Boring is a type of drilling, specifically, the drilling of a tunnel, well, or hole in the earth. With
some recent events, such as the Deepwater Horizon oil spill and the rescue of Chilean miners, the
public became aware of the sophistication of the current boring technology. Using the technique
known as geosteering, drill operators can drill wells vertically, horizontally, or even on a slant
angle.
A well plan is prepared before drilling, which specifies a sequence of lines, representing a geometrical shape of the future well. However, as new information becomes available during drilling, the
model can be updated and the well plan modified.
Your task is to write a program that verifies validity of a well plan by verifying that the borehole
will not intersect itself. A two-dimensional well plan is used to represent a vertical cross-section
of the borehole, and this well plan includes some drilling that has occurred starting at (0, −1) and
moving to (−1, −5). You will encode in your program the current well plan shown in the figure
below: