In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
We are given six integers: , , , , , such that . These numbers are coefficients in equations of two intersecting lines:
Write a program which:
The first line of the standard input contains three numbers , separated by single spaces - the coefficients of 's equation. The second line contains three numbers , separated by single spaces - the coefficients of 's equation. It is true that . The third and last line contains two integers , separated by a single space. They are the coordinates of a point representing one part of plane. Point does not belong to any of lines , . For every number from the input it is true that .
Your program should write to the standard output two numbers , separated by a single space - the coordinates of a point representing the given part, closest to the point of intersection of lines and . If there are many such points, your program should output only one of them.
For the input data:
1 -1 1 2 -3 1 5 4
the correct result is:
2 2
Task author: Jakub Pawlewicz.