ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1114. Boxes

Correct tests up to a point
Posted by Adrian Cearnau 27 Feb 2003 12:01
I get the correct results at all the tests when the number of balls
is less than 15. Any test over that is plain smaller. I'm using the
following sequence to calculate the result:

x1 = 1 + nb
xn = xn-1 * ( nb + n ) * ( 1 / n )

where nb is the number of boxes. I use this function for both
colours and then multiply the two results.

Is there something wrong with it?