CF336B.Vasily the Bear and Fly

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

One beautiful day Vasily the bear painted 2m2m circles of the same radius RR on a coordinate plane. Circles with numbers from 11 to mm had centers at points (2RR,0)(2R-R,0) , (4RR,0)(4R-R,0) , ...... , (2RmR,0)(2Rm-R,0) , respectively. Circles with numbers from m+1m+1 to 2m2m had centers at points (2RR,2R)(2R-R,2R) , (4RR,2R)(4R-R,2R) , ...... , (2RmR,2R)(2Rm-R,2R) , respectively.

Naturally, the bear painted the circles for a simple experiment with a fly. The experiment continued for m2m^{2} days. Each day of the experiment got its own unique number from 00 to m21m^{2}-1 , inclusive.

On the day number ii the following things happened:

  1. The fly arrived at the coordinate plane at the center of the circle with number ( is the result of dividing number xx by number yy , rounded down to an integer).
  2. The fly went along the coordinate plane to the center of the circle number ( is the remainder after dividing number xx by number yy ). The bear noticed that the fly went from the center of circle vv to the center of circle uu along the shortest path with all points lying on the border or inside at least one of the 2m2m circles. After the fly reached the center of circle uu , it flew away in an unknown direction.

Help Vasily, count the average distance the fly went along the coordinate plane during each of these m2m^{2} days.

输入格式

The first line contains two integers m,Rm,R ( 1<=m<=1051<=m<=10^{5} , 1<=R<=101<=R<=10 ).

输出格式

In a single line print a single real number — the answer to the problem. The answer will be considered correct if its absolute or relative error doesn't exceed 10610^{-6} .

输入输出样例

  • 输入#1

    1 1
    

    输出#1

    2.0000000000
    
  • 输入#2

    2 2
    

    输出#2

    5.4142135624
    

说明/提示

Figure to the second sample

首页