algorithm related to finding probability
The kingdom of Byteland contains N cities numbered 1..N. For each city i, the king assigns some money to that city for it's annual maintenance. The amount assigned is chosen randomly between ai (the minimum amount needed by that city), and bi (the maximum amount that can be assigned to that city). Note that the amount assigned to a city need not be an integer. The total tax collected this year is C.
 
What is the probability that the kingdom will issue a loss this year
algorithm related to finding probability
===

The kingdom of Byteland contains N cities numbered 1..N. For each city i, the king assigns some money to that city for it's annual maintenance. The amount assigned is chosen randomly between ai (the minimum amount needed by that city), and bi (the maximum amount that can be assigned to that city). Note that the amount assigned to a city need not be an integer. The total tax collected this year is C.
 
What is the probability that the kingdom will issue a loss this year