Minho and Kangho
InterviewTime limit1sMemory limit256 MB
Two people walk straight lines at constant speeds over the same time span, and the program prints the smallest distance between them to ten decimal places.
Problem
Minho and Kangho are on a two dimensional coordinate plane. Minho walks from point toward point , and Kangho walks from point toward point . They start at the same moment, and Kangho reaches at the same instant Minho reaches . Each of them walks at a constant speed.
Write a program that finds the smallest distance between Minho and Kangho during the walk.
The distance between two points and is .
Input
The first line contains , , , , , , , , separated by spaces. Every coordinate is an integer between 0 and 10000, inclusive.
and may be the same point, and and may be the same point. A walker whose two points are the same stands still.
Output
Print, on one line, the smallest distance between Minho and Kangho, rounded to the tenth digit after the decimal point. Pad with zeros so that exactly ten digits follow the decimal point.