This page is still under construction.

Parts of this page are still being built. What you see may change.

Cutting Corners

Interview

Time limit1sMemory limit512 MB

Summary
Given a stained w by h corner, compute how much longer the rectangular cut is than the diagonal cut.
Level

Easy2 of 10

Topics
Math, Geometry, Implementation, Brute force
Solved
No attempts yet

Problem

A large coffee spill in the warehouse of the Busy Association of Papercutters on Caffeine has stained the corners of all paper in storage. In order to not waste money, it was decided that these dirty corners should be cut off of all pieces of paper.

A few members loudly proclaim that cuts should be made diagonally, while other members say that cutting the corner out as a rectangle is the better option. Both parties claim their method is better.

You decide to end this discussion once and for all, telling the rectangle-cutters that their method is slower. You set out to show them the following: given a piece of paper which has a ww by hh corner that is stained with coffee that needs to be cut off, how much more effort is it to cut out the whole rectangle compared to cutting along the diagonal?

Input

The input consists of:

  • A line containing two integers ww and hh (1≤w,h≤1001\leq w,h\leq 100), representing the width and height of the corner respectively.

Output

Output how much longer you have to cut if you cut out a rectangle, compared to cutting along the diagonal. Your answer should have an absolute or relative error of at most 10−610^{-6}.

Examples3

  1. Example 1

    Input
    3 4
    
    Expected output
    2
    
  2. Example 2

    Input
    12 7
    
    Expected output
    5.107556011
    
  3. Example 3

    Input
    1 1
    
    Expected output
    0.585786438