{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"PLAIN","content":"w学长准备组装一台电脑. 但是w学长现在要出去吃饭了,所以他把这个任务交给你\n组装一台电脑需要n种配件,每种配件有m种不同的款式,每个款式都有自己的价格p和使用寿命s。一台电脑的使用寿命是所有配件的使用寿命的最小值。\n组装一台电脑需要购买每种配件各一个。你现在很忙,但是w学长还把这个任务交给你让你很生气,于是你决定给他配一台性价比最低的电脑。一台电脑的性价比是购买所有配件的总价格/这台电脑的使用寿命。"}},{"title":"Input","value":{"format":"PLAIN","content":"第一行给出两个正整数N,M(1\u003c\u003d N,M \u003c\u003d 1000) ,表示一台电脑需要的配件种类数,以及每种配件有多少个不同的款式\n接下来n行每行有2*m个正整数, 为s1,p1,s2,p2……sm,pm (1 \u003c\u003d si \u003c\u003d si+1 \u003c\u003d 1000,1 \u003c\u003d pi \u003c\u003d 1000000),si\n表示第i种类型配件的使用寿命, pi表示价格"}},{"title":"Output","value":{"format":"PLAIN","content":"输出一个数字表示性价比最低的电脑的总价,如果有多种方案性价比最低,输出总价格最小的. "}},{"title":"Example","value":{"format":"PLAIN","content":"input:\n3 3\n1 2 2 2 3 5\n3 5 6 2 7 8\n2 4 3 4 3 5\noutput:\n11"}}]}