Secret bunker
The layout of a secret bunker is depicted as a rectangular grid. In this grid, bombs are marked with the symbol '*', secret objects with the symbol '?', and empty spaces with the symbol '.'. In the event of a threat, detonating any bomb should ensure the destruction of all secret objects. When a bomb explodes, it destroys all objects within a distance D or less from the center of the bomb's cell to the center of the object's cell. If another bomb is within this explosion range, it will also detonate.
Your task is to write a program that calculates the minimum value of D such that detonating any bomb results in the destruction of all secret objects.
Input
The input consists of multiple tests. The first line of each test provides two integers N and M, separated by a space, representing the dimensions of the bunker plan (1 ≤ N ≤ 50, 1 ≤ M ≤ 50). This is followed by N rows, each containing M characters: '.', '*', and '?'. The plan includes between 1 and 100 '?' symbols and between 1 and 100 '*' symbols. A line with "0 0" indicates the end of the test set and should not be processed.
Output
For each test, output a single line with a floating-point number representing the minimum value of D for the respective plan, with a precision of 10^{−6}.