B - Inscribed Bicycle 解説 /

実行時間制限: 2 sec / メモリ制限: 256 MB

配点 : 500

問題文

すぬけ君は、誕生日プレゼントに三角形をもらいました。 三頂点の座標は (x_1, y_1), (x_2, y_2), (x_3, y_3) でした。

すぬけ君は、三角形の内部に半径の等しい二つの円を、重ならないように描きたいです (二円が点で接していてもいいです)。 円の半径の最大値を求めてください。

制約

  • 0 ≤ x_i, y_i ≤ 1000
  • 座標は整数である。
  • 三点は同一直線上に無い。

入力

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

x_1 y_1
x_2 y_2
x_3 y_3

出力

円の半径の最大値を出力せよ。 絶対誤差または相対誤差が 10^{-9} 以下で無ければならない。


入力例 1

0 0
1 1
2 0

出力例 1

0.292893218813

入力例 2

3 1
1 5
4 9

出力例 2

0.889055514217

Score : 500 points

Problem Statement

Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3).

He wants to draw two circles with the same radius inside the triangle such that the two circles do not overlap (but they may touch). Compute the maximum possible radius of the circles.

Constraints

  • 0 ≤ x_i, y_i ≤ 1000
  • The coordinates are integers.
  • The three points are not on the same line.

Input

The input is given from Standard Input in the following format:

x_1 y_1
x_2 y_2
x_3 y_3

Output

Print the maximum possible radius of the circles. The absolute error or the relative error must be at most 10^{-9}.


Sample Input 1

0 0
1 1
2 0

Sample Output 1

0.292893218813

Sample Input 2

3 1
1 5
4 9

Sample Output 2

0.889055514217