AlgoLensArena
ContestlərProblemlərOtaqlar
Vizualizator
← Məsələlər

DAPC20-055.\problemyamlname

Medium · 1 s · 256 MB

  • icpc
  • dapc
  • 2020

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 www by hhh corner that is stained with coffee that needs to be to cut off, how much more effort is it to cut out the whole rectangle compared to cutting along the diagonal?

Giriş formatı

The input consists of:

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

Çıxış formatı

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}10−6.

Qeyd

Source: Delft Algorithm Programming Contest 2020 · Author: Mike de Vries · License: CC BY-SA 4.0 · Original: https://dapc.wisv.ch · Statement adapted for AlgoLens and shared under the same license.

Nümunələr

Giriş #1

3 4

Çıxış #1

2

Giriş #2

12 7

Çıxış #2

5.107556011

Giriş #3

1 1

Çıxış #3

0.585786438