![]() | ||||
Online Judge | Problem Set | Authors | Online Contests | User |
---|---|---|---|---|
Web Board Home Page F.A.Qs Announcement | Current Contest Past Contests Scheduled Contests Award Contest |
Bohemian Rhapsody
Description There used to be a gambling called Bohemian Gambling. At the
beginning of the game, a unit circle was drawn on a piece of paper.
Then a point (x0, y0) in the circle and N (1 ¡Ü N ¡Ü 1000) vectors (¦¤xi, ¦¤yi) were randomly chosen. At the i-th step of the gambling, a player draw a segment from the point (xi − 1, yi − 1) to (xi, yi), where xi = xi − 1 + ¦¤xi and yi = yi − 1 + ¦¤yi. If (xi, yi)
was outside the circle or on its boundary, the game ended; otherwise
the player would win some money and go on to the next step of the
gambling until all N lines had been drawn.
As a predictor, Mercury had known all the vectors chosen for
the gambling in advance, but he didn't know what the starting point
would be. His clients asked him to find how much money they could win
under average conditions, which meant the point would be chosen within
the circle with uniformly distributed probability. They also wondered
how much they could win if everything went the luckiest way. What would
Mercury's reply to his clients be?
Input Output The real numbers should be rounded to three digits after the decimal point.
Sample Input Sample Output Source |
[Submit] [Go Back] [Status] [Discuss]
All Copyright Reserved 2003-2005 Ying Fuchen,Xu Pengcheng
Any problem, Please Contact Administrator