W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem [email protected].
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, zapraszamy na serwery Discord. Są one moderowane przez społeczność, ale członkowie zespołu technicznego też są tam aktywni.
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.