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

Guess Game

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


Problem Description
Bob plays the "guess the number right" with Alice recently,the game's rule is that Alice give Bob a upper limit number N ,then he write any of a number on paper which Bob can't know what it is and the number must be between 1 and N.Bob has many chances to guess the number and every time when Bob guesses Alice will tell him if his is bigger than the correct number or small than the correct number until he is right.
Now the Bob wanted to use binary search method to guess the right number, because he knows this method is quite fast to find the right number.
 

Input
We test the problem in many cases.Each case begin with one integers N( 1<= N <= 100000 ).
 

Output
Output the expected number of chances required to guess the number right, which accurate to 2 fractional digits.
 

Sample Input
2 3
 

Sample Output
1.50 1.67
 

Author
erriyue
 

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 18:39:43, Gzip enabled