#C6010. Maximum Distance from Origin
Maximum Distance from Origin
Maximum Distance from Origin
You are given a string consisting of the characters 'U', 'D', 'L', and 'R' that represents a series of movement commands. Starting at the origin (0, 0), every command moves you one unit in the specified direction: 'U' increases the y-coordinate, 'D' decreases the y-coordinate, 'L' decreases the x-coordinate, and 'R' increases the x-coordinate.
Your task is to determine the maximum Euclidean distance from the origin that is reached at any point during the execution of these commands.
The Euclidean distance from the origin to a point (x, y) is given by the formula:
$$ d = \sqrt{x^2 + y^2} $$
If the command string is empty, the maximum distance is 0.0.
inputFormat
The input consists of a single line containing a string representing the series of commands. The string may be empty.
outputFormat
Output a single floating-point number (with one decimal place) which is the maximum Euclidean distance from the origin reached during the execution of the commands.
## sampleUUDDLRLR
2.0