{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eJiajia downloads a lot, a lot more than you can even imagine. Some say that he starts downloading up to 20,000 files together. If 20,000 files try to share a limited bandwidth then it will be a big hazard and no files will be downloaded properly. That is why, he uses a download manager.\u003cbr\u003e\u003cbr\u003eIf there are \u003ci\u003eT\u003c/i\u003e files to download, the download manger uses the following policy while downloading files:\u003cbr\u003e\u003cbr\u003e1. The download manager gives the smaller files higher priority, so it starts downloading the smallest \u003ci\u003en\u003c/i\u003e files at startup. If there is a tie, download manager chooses the one with less bytes remaining (for download). We assume that with at least 50 Mega Bytes/sec of bandwidth, \u003ci\u003en\u003c/i\u003e files can be downloaded simultaneously without any problem.\u003cbr\u003e\u003cbr\u003e2. The available bandwidth is equally shared by the all the files that are being downloaded. When a file is completely downloaded its bandwidth is instantaneously given to the next file. If there are no more files left except the files that are being downloaded, this bandwidth is immediately shared equally by all remaining files that are being downloaded.\u003cbr\u003e\u003cbr\u003eGiven the size and completed percentage of each file, your task is to intelligently simulate the behavior of the download manager to find the total time required to download all the files.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The will be at most 10 test cases. Each case begins with three integers \u003ci\u003eT\u003c/i\u003e (1 \u0026lt;\u003d \u003ci\u003eT\u003c/i\u003e \u0026lt;\u003d 20000), \u003ci\u003en\u003c/i\u003e (1 \u0026lt;\u003d \u003ci\u003en\u003c/i\u003e \u0026lt;\u003d 2000 and 1 \u0026lt;\u003d \u003ci\u003en\u003c/i\u003e \u0026lt;\u003d \u003ci\u003eT\u003c/i\u003e) and \u003ci\u003eB\u003c/i\u003e (50 \u0026lt;\u003d \u003ci\u003eB\u003c/i\u003e \u0026lt;\u003d 1000). Here \u003ci\u003eB\u003c/i\u003e denotes the total bandwidth available to Jiajia (In Megabytes/sec). Please note that the download manager always downloads \u003ci\u003en\u003c/i\u003e files in parallel unless there are less than \u003ci\u003en\u003c/i\u003e files available for download. Each of next \u003ci\u003eT\u003c/i\u003e lines contains one non-negative floating-point number \u003ci\u003eS\u003c/i\u003e (less than 20,000, containing at most 2 digits after the decimal places) and one integer \u003ci\u003eP\u003c/i\u003e (0 \u0026lt;\u003d \u003ci\u003eP\u003c/i\u003e \u0026lt;\u003d 100). These two numbers denote a file whose size is \u003ci\u003eS\u003c/i\u003e megabyte and which has been downloaded exactly \u003ci\u003eP\u003c/i\u003e% already. Also note that although theoretically it is not possible that the size of a file or size of its remaining part is a fraction when expressed in bytes, for simplicity please assume that such thing is possible in this problem. The last test case is followed by \u003ci\u003eT\u003dn\u003dB\u003d0\u003c/i\u003e, which should not be processed."}},{"title":"Output","value":{"format":"HTML","content":"For each case, print the case number and the total time required to download all the files, expressed in hours and rounded to 2 digits after the decimal point. Print a blank line after the output of each test case."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6 3 90\r\n100.00 90\r\n40.40 70\r\n60.30 70\r\n40.40 80\r\n40.40 85\r\n40.40 88\r\n1 1 56\r\n12.34 100\r\n0 0 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 0.66\r\n\r\nCase 2: 0.00\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cb\u003eExplanation\u003c/b\u003e\u003cbr\u003e\u003cbr\u003eIn the first sample, there are 6 files and the download manager can download 3 files simultaneously. The size of the smallest file is 40.40 Megabyte but there are \u003cbr\u003efour such files (2nd, 4th, 5th and 6th files). So the download manager chooses the 6th, 5th and 4th files for download as they have less bytes remaining. All these \u003cbr\u003efiles get equal bandwidth (30.00 Megabyte/Sec). Of these three files the 8th file is finished first. So instantaneously the 2nd file starts downloading. Then, 5th file \u003cbr\u003eis finished. So the next larger file (3rd file) starts downloading. This process goes on until all files are downloaded."}}]}