F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Drunk

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 501    Accepted Submission(s): 222
Special Judge


Problem Description
Jenny is seriously drunk. He feels as if he is in an N-dimension Euclidean space, wandering aimlessly. In each step, he walks toward some direction and the “length” of each step will not exceed R. Technically speaking, Jenny is initially located at the origin of the N-dimension Euclidean space. Each step can be represented by a random N-dimension vector(x1, x2, ... , xn) chosen uniformly from possible positions satisfying xi >= 0 and x12 + x22 + ... <= R2.
Assume the expectation of his coordinate after his first step is (y1, y2, ... , yn). He wants to know the minimum yi .
 

Input
There are several (about 100,000) test cases, please process till EOF.
Each test case, only one line contains two integers N and R, representing the dimension of the space and the length limit of each step.(1 <= n <= 2 * 105, R <= 105).
 

Output
For each test case, print a real number representing the answer to the question above.
Your answer is considered correct if the difference between your answer and the correct one is less than 10-6.
 

Sample Input
2 1
 

Sample Output
0.4244131816
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 19:49:48, Gzip enabled