PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000380. Thanh kim loại giãn nở (Expanding Rods)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Thanh kim loại giãn nở (Expanding Rods)

Expanding Rods

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A thin metal rod initially measures LL millimetres and is fixed at both ends. After a temperature increase of nn degrees, its length is L′=(1+nC)LL'=(1+nC)L, with thermal expansion coefficient CC. Since its endpoints remain fixed, the rod bends into a circular arc whose chord is the original rod. Its length grows by at most half of the original length. Find the displacement hh of its midpoint.

Rod and arc

Input

One line contains three nonnegative real numbers L,n,CL,n,C: initial length (mm), temperature increase, and thermal expansion coefficient.

Output

Print hh in millimetres, rounded to exactly three decimal places.

Subtasks

The numeric bounds and scoring groups below are specific to the Phuoc Hung OJ version.

  • Subtask 1 (20 points): 0≤L,n,C≤1060\le L,n,C\le10^6; 0≤nC≤0.50\le nC\le0.5. Each number uses ordinary decimal notation, with at most 8 fractional digits. LnC=0LnC=0.
  • Subtask 2 (30 points): 0≤L,n,C≤1060\le L,n,C\le10^6; 0≤nC≤0.50\le nC\le0.5. Each number uses ordinary decimal notation, with at most 8 fractional digits. L=0L=0 or nC≤0.01nC\le0.01.
  • Subtask 3 (50 points): 0≤L,n,C≤1060\le L,n,C\le10^6; 0≤nC≤0.50\le nC\le0.5. Each number uses ordinary decimal notation, with at most 8 fractional digits.

Examples

Input

1000 100 0.0001

Output

61.329

Explanation

The 1000 mm rod grows by 10 mm because 100⋅0.0001=0.01100\cdot0.0001=0.01. The 1010 mm arc has a 1000 mm chord, giving a midpoint displacement of about 61.329 mm.

Input

15000 10 0.00006

Output

225.020

Explanation

The expansion fraction is 0.0006, adding 9 mm. A 15009 mm arc with a 15000 mm chord has displacement approximately 225.020 mm.

Input

10 0 0.001

Output

0.000

Explanation

There is no temperature increase, so the rod remains straight and its midpoint stays fixed.