What does it mean for two objects to collide? This is an import question in many applications, which cannot always be answered easily by a computer program. If two planar objects overlap, this is called a collision. You should not take this too literally and immediately think about two cars that crashed against each other. Collision detection can be used for example to determine whether one region is contained within another region on a map, or to analyse images.
For this exercise, we consider the simplest form of collision detection. In this, each object is represented by its axis-aligned bounding box1. This is the smallest rectangle that contains the entire object and has edges parallel to the $$X$$- and $$Y$$-axis. We say that two objects collide if their bounding boxes overlap.
The input contains eight integers (each on a separate line) that represent two diametrical points of two rectangles. Each point is described by two consecutive integers, with the first being the $$x$$ co-ordinate and the second the $$y$$ co-ordinate. The rectangles are real rectangles and are not degenerate as a line segment or a point.
There is only one single line of output. This line contains the text collision if the two given rectangles overlap, and the text no collision if the two rectangles do not overlap. Note: touching rectangles do not overlap!
Input:
0
0
1
2
4
1
5
5
Output:
no collision
Input:
0
0
2
3
1
2
5
5
Output:
collision