You are to write a program that has to decide whether a given line segment intersects a given rectangle.
line: start point: (4,9)
end point: (11,2)
rectangle: left-top: (1,5)
Figure 1: Line segment does not intersect rectangle
The line is said to intersect the rectangle if the line and the rectangle have at least one point in common. The rectangle consists of four straight lines and the area in between. Although all input values are integer numbers, valid intersection points do not have to lay on the integer grid.