I NEED A OFFER!Problem Description Speakless long time I wanted to go abroad, and now he has finished all the required exams, prepare all the materials to be prepared, so they need to apply for school. To apply for any university abroad, you have to pay a fee to apply, this is very striking. Speakless not have much money, just to save a total of $ n million. He will select a number of (of course within his affordability range) in the m schools. Each school has a different application fee a (million dollars), and Speakless estimated he got the school offer the possibility of b. Whether the offer will not affect each other between different schools. "I NEED A OFFER", he cried. Help the poor folks, help him calculate that he could receive the maximum probability of at least one offer. (If you selected multiple Speakless school, get a school of any offer can be).
Input There are several groups of data input, data of the first line of each of two positive integers n-, m (0 <= n-<= 10000,0 <= m <= 10000)
Output Each set of data corresponds to an output representing Speakless possible to obtain the maximum probability of at least one offer. Expressed as a percentage, to the nearest decimal place.
Sample Input 10 3 4 0.1 4 0.2 5 0.3 0 0
Sample Output 44.0% Hint You should use printf("%%") to print a '%
P (at least a school admission) = 1-P (not an admission) Therefore, equation of state maxsum [j] = max (maxsum [j], 1- (1-maxsum [j-mon [i]]) * (1-pro [i])); pro [j] i-school probability offer could get.
|
hdu1203 (01 simple backpack)
Guess you like
Origin blog.csdn.net/treble_csnd/article/details/81910071
Recommended
Ranking