B. Anton and Lines
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
The teacher gave Anton a large geometry homework, but he didn’t do it (as usual) as he participated in a regular round on Codeforces. In the task he was given a set of n lines defined by the equations y = ki·x + bi. It was necessary to determine whether there is at least one point of intersection of two of these lines, that lays strictly inside the strip between x1 < x2. In other words, is it true that there are 1 ≤ i < j ≤ n and x’, y’, such that:
y’ = ki * x’ + bi, that is, point (x’, y’) belongs to the line number i;
y’ = kj * x’ + bj, that is, point (x’, y’) belongs to the line number j;
x1 < x’ < x2, that is, point (x’, y’) lies inside the strip bounded by x1 < x2.
You can’t leave Anton in trouble, can you? Write a program that solves the given task.