<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 36,  comments - 3,  trackbacks - 0
    Problem Description
    The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrative business of bank robbery only for a short while, before retiring to a comfortable job at a university.


    For a few months now, Roy has been assessing the security of various banks and the amount of cash they hold. He wants to make a calculated risk, and grab as much money as possible.


    His mother, Ola, has decided upon a tolerable probability of getting caught. She feels that he is safe enough if the banks he robs together give a probability less than this.
     

    Input
    The first line of input gives T, the number of cases. For each scenario, the first line of input gives a floating point number P, the probability Roy needs to be below, and an integer N, the number of banks he has plans for. Then follow N lines, where line j gives an integer Mj and a floating point number Pj . 
    Bank j contains Mj millions, and the probability of getting caught from robbing it is Pj .
     

    Output
    For each test case, output a line with the maximum number of millions he can expect to get while the probability of getting caught is less than the limit set.

    Notes and Constraints
    0 < T <= 100
    0.0 <= P <= 1.0
    0 < N <= 100
    0 < Mj <= 100
    0.0 <= Pj <= 1.0
    A bank goes bankrupt if it is robbed, and you may assume that all probabilities are independent as the police have very low funds.
     

    Sample Input
    3 0.04 3 1 0.02 2 0.03 3 0.05 0.06 3 2 0.03 2 0.03 3 0.05 0.10 3 1 0.03 2 0.02 3 0.05
     

    Sample Output
    2 4 6




    posted on 2013-02-16 22:15 天YU地___PS,代碼人生 閱讀(248) 評論(0)  編輯  收藏 所屬分類: acm
    <2013年2月>
    272829303112
    3456789
    10111213141516
    17181920212223
    242526272812
    3456789

     一定要好好學習,天天向上!

    常用鏈接

    留言簿

    隨筆分類(8)

    隨筆檔案(35)

    文章分類

    文章檔案(1)

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 婷婷亚洲综合五月天小说 | 成人a毛片免费视频观看| 亚洲中文无码mv| 亚洲国产夜色在线观看| 久久久婷婷五月亚洲97号色 | 中国一级特黄的片子免费 | 亚洲fuli在线观看| 亚洲国产精品专区| 亚洲人成影院在线无码按摩店| 思思re热免费精品视频66| 国产免费的野战视频| 国产曰批免费视频播放免费s | 亚洲春色在线观看| 亚洲的天堂av无码| 亚洲国产成人久久| 亚洲Av永久无码精品三区在线 | 国产高清对白在线观看免费91 | 国产亚洲精品影视在线产品| 亚洲AV无码乱码在线观看牲色| 无码日韩精品一区二区免费| 成年女人色毛片免费看| 日韩一品在线播放视频一品免费| 久久综合给合久久国产免费 | 亚洲成AV人片在线观看WWW| 精品国产亚洲一区二区三区| 亚洲免费在线播放| 亚洲一区二区三区在线| 亚洲AV永久无码精品放毛片| 免费看又黄又爽又猛的视频软件| 中文字幕在线观看亚洲视频| 在线观看国产一区亚洲bd| 又粗又长又爽又长黄免费视频 | 人人公开免费超级碰碰碰视频 | 亚洲国产精品无码专区在线观看| 免费观看激色视频网站(性色)| 成在人线av无码免费高潮喷水| 一区二区在线视频免费观看| 色偷偷亚洲第一综合网| 国产裸体美女永久免费无遮挡| 人妖系列免费网站观看| 99热这里只有精品6免费|