3d-modeling
시간 제한1초메모리 제한1024 MB
정수 좌표로 주어진 두 직선 AB와 CD에 대해, CD를 AB로 옮기는 회전축 PQ와 회전각 α를 구하거나 그러한 회전이 존재하지 않으면 Impossible을 출력한다.
문제
Android Vasya's elder friends have already been modeling six-dimensional space ships for quite a long time. Vasya himself hasn't yet acquired such level of mastering. He has only just started the 3d-modeling course. And right now he is doing his first homework.
The homework is pretty easy, one just needs to make a 3d-drawing of any detail. Vasya has already come up with the detail he wants to draw, imagined how it would look like and he even has drawn the first straight line. But something went wrong. Apparently the line turned out to be not the one he needed.
But Vasya has already got the solution for this problem. He plans to rotate the detail in his mind in such a way, that the line he was going to draw would become the line he had actually drawn. Help Vasya find out what rotation he should make for this.
입력
First two lines contain coordinates of the points and . These points lie on the drawn line. The third and the fourth lines contain coordinates of the points and . These points lie on the line Vasya was going to draw. Point doesn't coincide with point , point doesn't coincide with point . All numbers in the input data are integers and do not exceed by absolute value.
출력
If the required rotation doesn't exist output Impossible in a single line. Otherwise in the first two lines output coordinates of the points and which lie on the rotation axis. In the third line output the rotation angle in degrees. The distance between points and should not be less than 1. The coordinates of points and should not exceed by absolute value. The angle should lie within the range [0; 360] and be counted counterclockwise, if one is looking from to the direction of . An answer is considered correct if after rotation of the line by the angle around the axis it results in some line , such that the distances from points and to this line don't exceed .