Missile Troubles

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Dmojistan has declared war on Pegland! Both countries have sent a missile towards each other, but due to a miscalculation, the missiles are going to collide mid-flight. The missiles are traveling over neutral Wlmojistan, and they are going to unleash terrors like internal errors, TLEs and undefined behaviours. Thankfully, MCPT, the Missile Collision Prevention Team has a device that can neutralize both missiles if provided their collision point. Given the coordinates of the starting and ending position of both missiles, determine the collision point of the missiles.

Input Specification

The first line of input contains four integers, , , , and , the starting and ending coordinates of the first missile.

The second line of input contains four integers, , , , and , the starting and ending coordinates of the second missile.

Output Specification

Output the coordinate of the collision point of the two missiles. Round values to 1 decimal place.

Sample Input

0 3 4 5
0 10 3 1

Sample Output

2.0 4.0