#K16326. Minimum Euclidean Distance Between Two Sets of Points

    ID: 24554 Type: Default 1000ms 256MiB

Minimum Euclidean Distance Between Two Sets of Points

Minimum Euclidean Distance Between Two Sets of Points

Given two sets of points in a 2-dimensional plane, your task is to compute the minimum Euclidean distance between any point in the first set and any point in the second set. The Euclidean distance between two points \( (x_1, y_1) \) and \( (x_2, y_2) \) is defined as \( \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} \). The result should be rounded to 5 decimal places.

The input consists of the number of points in each set, followed by the coordinates of the points for each set. The output is a single number representing the minimum computed distance.

inputFormat

The first line contains two integers \( n \) and \( m \) -- the number of points in the first and second set respectively.

The next \( n \) lines each contain two integers representing the coordinates \( x\ y \) of the points in the first set.

This is followed by \( m \) lines each containing two integers representing the coordinates \( x\ y \) of the points in the second set.

Input is provided via stdin.

outputFormat

Output a single line containing the minimum Euclidean distance between any two points (one from each set), rounded to 5 decimal places. The result should be printed to stdout.

## sample
3 2
1 2
3 4
5 6
7 8
2 3
1.41421