https://contest.yandex.ru/contest/71291/problems/J/
Time limit: 1 second
Memory limit: 64 MB
Input: standard input or input.txt
Output: standard output or output.txt
On a plane, there are marked neutron stars and giant stars. No three stars lie on the same straight line.
You are given an integer n.
The next n lines contain the coordinates of the neutron stars (two real numbers per line).
The following n lines contain the coordinates of the giant stars (two real numbers per line).
Find a line of the form [ y = a x + b ] that passes through one neutron star and one giant star such that, in one of the open half-planes determined by this line, the numbers of neutron stars and giant stars are equal. It is guaranteed that a solution of the form (y = ax + b) exists.
Input
nnlines:x yfor neutron stars (real numbers)nlines:x yfor giant stars (real numbers)
Output
Print a and b separated by a space.
Constraints
- (1 < n < 10^5)
- All coordinates are real numbers with (0 < x,y < 10^6)
- No three stars are collinear.