Under construction

Still being built. Things may change

Consolidating Windows

Time limit1sMemory limit1024 MB

Summary
Given two square window side lengths a and b, output the side length of one square whose area equals a squared plus b squared.
Level

Easy2 of 10

Topics
Math
Solved
No attempts yet

Problem

In the 19th century, windows were a costly luxury in Delft, because every window in a home was taxed. Only wealthy people could afford more than a few, while many poorer residents bricked up some of their windows to avoid the new costs.

Not wanting to give up any sunlight, Corry came up with a clever idea. The tax depended only on the number of windows, not their size, so she decided to install fewer, larger windows instead of many small ones. In each room, Corry had two square windows. She planned to replace them with one square window to halve the tax. The area of the new window must equal the combined area of the two smaller ones. Given the side lengths of the two smaller windows, what is the side length of the larger window?

Input

One line with two integers aa and bb (1≤a,b≤1091\leq a, b\leq 10^9), the side lengths of the two smaller square windows.

Output

Output the side length of a square window whose area equals the combined area of the two smaller windows.

Your answer should have an absolute or relative error of at most 10−810^{-8}.

Examples2

  1. Example 1

    Input
    3 4
    
    Expected output
    5.0
    
  2. Example 2

    Input
    10000000 320912
    
    Expected output
    10005147.900543199866