{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cp\u003eThe “We Cut The Cheese” specialty food store sells\n specialized blendings of cheeses. For example, their Italian\n Blend is made up of \u003cspan class\u003d\"tex2jax_process\"\u003e$50\\%\n $\u003c/span\u003e provolone, \u003cspan class\u003d\"tex2jax_process\"\u003e$30\\%\n $\u003c/span\u003e mozzarella and \u003cspan class\u003d\"tex2jax_process\"\u003e$20\\%\n $\u003c/span\u003e parmesan, while their African Safari is made up of\n \u003cspan class\u003d\"tex2jax_process\"\u003e$74\\% $\u003c/span\u003e domiati,\n \u003cspan class\u003d\"tex2jax_process\"\u003e$25\\% $\u003c/span\u003e areesh with just a\n hint (\u003cspan class\u003d\"tex2jax_process\"\u003e$1\\% $\u003c/span\u003e) of\n bokmakiri. You started working at the store as a cheese blend\n taster, but two years and \u003cspan class\u003d\"tex2jax_process\"\u003e$45$\u003c/span\u003e pounds later you have worked your\n way up to head of the accounting office. Every week the store\n gets various shipments of cheeses, depending on the time of\n year, market price and other factors. Given these amounts and\n the percentages required for each cheese blend, you are asked\n every week to determine the optimal use of these cheeses to\n maximize profit. When the store just made a few different\n cheese blends this could be done by hand, but with business\n expanding faster than a cheese souffle, the number of blends\n has also grown to the point where a program is now needed to\n determine the optimal use of the cheese shipments. So the\n question is: Are you gouda-nough to write such a program?\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eInput starts with a line containing two positive integers\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$m$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$1\\le n,m\\le 50$\u003c/span\u003e), where \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e is the number of types of cheese\n used to make the cheese blends and \u003cspan class\u003d\"tex2jax_process\"\u003e$m$\u003c/span\u003e is the number of different cheese\n blends offered by the store. The next line contains\n \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e integers \u003cspan class\u003d\"tex2jax_process\"\u003e$w_1$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$w_2$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$\\ldots $\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$w_ n$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0\\le w_ i\\le 500$\u003c/span\u003e), where\n \u003cspan class\u003d\"tex2jax_process\"\u003e$w_ i$\u003c/span\u003e is the number of\n pounds of cheese type \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e\n that the store has on-hand. Following this are \u003cspan class\u003d\"tex2jax_process\"\u003e$m$\u003c/span\u003e lines of the form \u003cspan class\u003d\"tex2jax_process\"\u003e$p_1$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$p_2$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$p_3$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$\\ldots $\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$p_ n$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$t$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0.0\\le p_ i\\le 100.0$\u003c/span\u003e, \u003cspan class\u003d\"tex2jax_process\"\u003e$0.0\\le t\\le 10.0$\u003c/span\u003e), where\n \u003cspan class\u003d\"tex2jax_process\"\u003e$p_ i$\u003c/span\u003e indicates the\n percentage of cheese \u003cspan class\u003d\"tex2jax_process\"\u003e$i$\u003c/span\u003e\n found in the blend, and \u003cspan class\u003d\"tex2jax_process\"\u003e$t$\u003c/span\u003e is the profit per pound for the\n blend. Percentages are given with one decimal place, profits\n are given with two decimal places.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eOutput the maximum profit that can be obtained for the given\n pounds of cheese, blending percentages and profits, assuming\n all of the blended cheeses get sold. Round your answer to the\n nearest penny.\u003c/p\u003e\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e3 2\n100 150 100\n50.0 50.0 0.0 3.20\n0.0 50.0 50.0 2.80\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e920.00\n\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 2\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e3 2\n100 150 100\n50.0 50.0 0.0 3.20\n0.0 40.0 60.0 2.80\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1000.00\n\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}