Пересекаются ли отрезок (X_1, Y_1), (X_2, Y_2) и прямоугольник с концами диагонали (X_3, Y_3), (X_4, Y_4) и сторонами параллельными координатным осям? Прямоугольник и отрезок перескаются, если они имеют хотя бы одну общую точку.
The first line contains four integers X_1, Y_1, X_2, Y_2 - the coordinates of the endpoints recorded by a space. The second line contains four integers X_3, Y_3, X_4, Y_4 - coordinates of the ends of one diagonal recorded by a space. All coordinates are integers and do not exceed in modulus 50.
Bring out one number 1, if a rectangle and cut intersect or 0 if not.