{"trustable":false,"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":"MD","content":"\n FatMouse prepared $M$ pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. \nThe warehouse has $N$ rooms. The $i^{th}$ room contains $J_i$ pounds of JavaBeans and requires $F_i$ pounds of cat food. FatMouse does not have to trade for all the JavaBeans in the room, instead, he may get $J_i\\cdot a\\%$ pounds of JavaBeans if he pays $F_i\\cdot a\\%$ pounds of cat food. Here a is a real number. Now he is assigning this homework to you: tell him the maximum amount of JavaBeans he can obtain.\n"}},{"title":"Input","value":{"format":"MD","content":"The input consists of multiple test cases. Each test case begins with a line containing two non-negative integers $M$ and $N$. Then $N$ lines follow, each contains two non-negative integers $J_i$ and $F_i$ respectively. The last test case is followed by $-1$ and $-1$. All integers are not greater than $1000$."}},{"title":"Output","value":{"format":"MD","content":"For each test case, print in a single line a real number accurate up to $3$ decimal places, which is the maximum amount of JavaBeans that FatMouse can obtain."}},{"title":"Sample","value":{"format":"MD","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\u003e\u003cpre\u003e5 3\n7 2\n4 3\n5 2\n20 3\n25 18\n24 15\n15 10\n-1 -1\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e13.333\n31.500\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Tips","value":{"format":"MD","content":"Use scanf and printf"}}]}