<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,代碼人生 閱讀(247) 評論(0)  編輯  收藏 所屬分類: acm
    <2013年2月>
    272829303112
    3456789
    10111213141516
    17181920212223
    242526272812
    3456789

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

    常用鏈接

    留言簿

    隨筆分類(8)

    隨筆檔案(35)

    文章分類

    文章檔案(1)

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产精彩免费视频| 99视频在线免费看| 国产免费爽爽视频免费可以看| 亚洲第一二三四区| 国产在线一区二区综合免费视频| 中文字幕在线亚洲精品| 三级片免费观看久久| 亚洲视频在线一区二区| 免费大片av手机看片高清| 亚洲国产成人久久一区WWW| 另类小说亚洲色图| 亚洲精品老司机在线观看| 一级毛片视频免费观看| 国产黄色一级毛片亚洲黄片大全 | 亚洲精品国产品国语在线| 亚欧洲精品在线视频免费观看| 亚洲色成人网站WWW永久| 免费视频一区二区| 亚洲免费在线视频播放| 成人毛片18女人毛片免费96 | APP在线免费观看视频| 亚洲AV无码久久精品狠狠爱浪潮| 97视频免费观看2区| 亚洲av成人综合网| 免费人成激情视频| 国产猛男猛女超爽免费视频| 亚洲av无码不卡久久| 国产一级高清视频免费看| 最近中文字幕免费大全| 亚洲另类精品xxxx人妖| 国产免费午夜a无码v视频| 中文字幕免费在线看电影大全| 亚洲黄色在线观看网站| 日本高清免费不卡在线| 国产精品免费在线播放| 亚洲国产综合第一精品小说| 婷婷亚洲天堂影院| 日韩免费无码一区二区三区| 国产精品国产亚洲区艳妇糸列短篇| 亚洲精品成人片在线观看精品字幕| 99久久免费精品国产72精品九九 |