J - Sprinkler Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 6

問題文

H メートル、横 W メートルの長方形の庭があります。

庭の中心には水を撒くためのスプリンクラーがあり、スプリンクラーから半径 D メートル以内の範囲には水を撒くことができます。

庭のうちスプリンクラーにより水を撒くことができる面積の、庭全体に占める割合はいくらですか?

制約

  • 1 \leq H,W \leq 10^5
  • 1 \leq D \leq 10^5
  • 入力に含まれる値は全て整数である

入力

入力は以下の形式で標準入力から与えられる。

H W D

出力

答えを出力せよ。
なお、真の解との絶対誤差または相対誤差が 10^{-6} 以下であれば正解として扱われる。


入力例 1

10 15 3

出力例 1

0.1884955592

スプリンクラーにより水を撒くことができるのは半径 3 メートルの円の内部の約 28.3 平方メートルです。
庭の面積は 10\times 15=150 平方メートルなので、求める割合は 0.1884955592\ldots になります。

図


入力例 2

10 15 6

出力例 2

0.6939614954

スプリンクラーにより水を撒くことができるのは半径 6 メートルの円の内部ですが、一部は庭の外にはみ出します。
庭のうちスプリンクラーにより水を撒くことができる面積は、約 104.1 平方メートルであり、 庭の面積は 10\times 15=150 平方メートルなので、求める割合は 0.6939614954\ldots になります。

図

Score : 6 points

Problem Statement

There is a rectangular garden that is H meters long and W meters wide.

At the center of the garden is a sprinkler, which sprays water within a radius of D meters from it.

Find the proportion of the area sprayed by the sprinkler in the garden.

Constraints

  • 1 \leq H,W \leq 10^5
  • 1 \leq D \leq 10^5
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

H W D

Output

Print the answer.
Your answer will be considered correct if the absolute or relative error from the true value is at most 10^{-6}.


Sample Input 1

10 15 3

Sample Output 1

0.1884955592

The sprinkler sprays the interior of a circle of radius 3 meters, whose area is about 28.3 square meters.
The area of the garden is 10\times 15=150 square meters, so the desired proportion is 0.1884955592\ldots.

Figure


Sample Input 2

10 15 6

Sample Output 2

0.6939614954

The sprinkler sprays the interior of a circle of radius 6 meters, some of which sticks out of the garden.
The area of the region sprayed by the sprinkler is about 104.1 square meters, and the area of the garden is 10\times 15=150 square meters, so the desired proportion is 0.6939614954\ldots.

Figure