Segment in a coordinate system
Hard
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given segment with coordinates x[1]
, y[1]
, x[2]
, y[2]
. In which coordinate quarters the segment is located?
Input
One line contains four integers x[1]
, y[1]
, x[2]
, y[2]
(-50 ≤ x[1]
, y[1]
, x[2]
, `y[2] ≤ 50).
Output
Print in ascending order the quarters with segment. Print each number in a new line, or 0 if segment lies on the axis.
Examples
Input #1
Answer #1
Submissions 4K
Acceptance rate 6%