**Problem : Minimum Distance**

Two riders A and B are travelling on a highway towards each other on two roads that intersect at right angle at speeds

**V**meters/second and_{A}**V**meters/second. A is at a distance of_{B}**'x'**meters and B is at a distance of**'y'**meters from the intersection. Calculate the minimum distance between these two riders that is possible.**Fig:Approaching Intersection**

**Input Format:**

First line contains the distance of Rider A from intersection denoted by x

Second line contains the distance of Rider B from intersection denoted by y

Third line contains the Velocity of Rider A denoted by V

_{A}

Fourth line contains the Velocity of Rider B denoted by V

_{B}

**Output Format:**

Print the minimum distance between these two riders, if minimum distance is non-zero. If minimum distance is zero, print it as 0.0

**Constraints:**

**x > 0**

**y > 0**

**V**

_{A}> 0**V**

_{B}> 0**Calculation and printing of output should be done upto 11-precision**

**Sample Input and Output**

SNo. | Input | Output |
---|---|---|

1 | 100 100 10 10 | 0.0 |

2 | 500 300 20 14 | 41.18252056395 |

3 | 100 100 30 40 | 22.36067977500 |

5 | 0 50 -20 30 | Invalid Input |

*:*

**Note***Please do not use package and namespace in your code. For object oriented languages your code should be written in one class.*

*:*

**Note***Participants submitting solutions in C language should not use functions from* / as these files do not exist in gcc

*:*

**Note***For C and C++, return type of main() function should be int.*

## No comments :

## Post a Comment