{"trustable":true,"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":"HTML","content":"\u003cp\u003eThere are $$$n$$$ shovels in the nearby shop. The $$$i$$$-th shovel costs $$$a_i$$$ bourles.\u003c/p\u003e\u003cp\u003eMisha has to buy \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly\u003c/span\u003e $$$k$$$ shovels. Each shovel can be bought \u003cspan class\u003d\"tex-font-style-bf\"\u003eno more than once\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eMisha can buy shovels by several purchases. During one purchase he can choose any subset of remaining (non-bought) shovels and buy this subset.\u003c/p\u003e\u003cp\u003eThere are also $$$m$$$ special offers in the shop. The $$$j$$$-th of them is given as a pair $$$(x_j, y_j)$$$, and it means that if Misha buys \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly\u003c/span\u003e $$$x_j$$$ shovels \u003cspan class\u003d\"tex-font-style-bf\"\u003eduring one purchase\u003c/span\u003e then $$$y_j$$$ \u003cspan class\u003d\"tex-font-style-bf\"\u003emost cheapest\u003c/span\u003e of them are for free (i.e. he will not pay for $$$y_j$$$ most cheapest shovels during the current purchase).\u003c/p\u003e\u003cp\u003eMisha can use any offer any (possibly, zero) number of times, but he cannot use \u003cspan class\u003d\"tex-font-style-bf\"\u003emore than one\u003c/span\u003e offer during \u003cspan class\u003d\"tex-font-style-bf\"\u003eone purchase\u003c/span\u003e (but he can buy shovels without using any offers).\u003c/p\u003e\u003cp\u003eYour task is to calculate the minimum cost of buying $$$k$$$ shovels, if Misha buys them optimally.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains three integers $$$n, m$$$ and $$$k$$$ ($$$1 \\le n, m \\le 2 \\cdot 10^5, 1 \\le k \\le min(n, 2000)$$$) — the number of shovels in the shop, the number of special offers and the number of shovels Misha has to buy, correspondingly.\u003c/p\u003e\u003cp\u003eThe second line of the input contains $$$n$$$ integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le 2 \\cdot 10^5$$$), where $$$a_i$$$ is the cost of the $$$i$$$-th shovel.\u003c/p\u003e\u003cp\u003eThe next $$$m$$$ lines contain special offers. The $$$j$$$-th of them is given as a pair of integers $$$(x_i, y_i)$$$ ($$$1 \\le y_i \\le x_i \\le n$$$) and means that if Misha buys exactly $$$x_i$$$ shovels during some purchase, then he can take $$$y_i$$$ most cheapest of them for free.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint one integer — the minimum cost of buying $$$k$$$ shovels if Misha buys them optimally.\u003c/p\u003e"}},{"title":"Examples","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\u003e7 4 5\n2 5 4 2 6 3 1\n2 1\n6 5\n2 1\n3 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e9 4 8\n6 8 5 1 8 1 1 2 1\n9 2\n8 4\n5 3\n9 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e17\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e5 1 4\n2 5 7 4 6\n5 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e17\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first example Misha can buy shovels on positions $$$1$$$ and $$$4$$$ (both with costs $$$2$$$) during the first purchase and get one of them for free using the first or the third special offer. And then he can buy shovels on positions $$$3$$$ and $$$6$$$ (with costs $$$4$$$ and $$$3$$$) during the second purchase and get the second one for free using the first or the third special offer. Then he can buy the shovel on a position $$$7$$$ with cost $$$1$$$. So the total cost is $$$4 + 2 + 1 \u003d 7$$$.\u003c/p\u003e\u003cp\u003eIn the second example Misha can buy shovels on positions $$$1$$$, $$$2$$$, $$$3$$$, $$$4$$$ and $$$8$$$ (costs are $$$6$$$, $$$8$$$, $$$5$$$, $$$1$$$ and $$$2$$$) and get three cheapest (with costs $$$5$$$, $$$1$$$ and $$$2$$$) for free. And then he can buy shovels on positions $$$6$$$, $$$7$$$ and $$$9$$$ (all with costs $$$1$$$) without using any special offers. So the total cost is $$$6 + 8 + 1 + 1 + 1 \u003d 17$$$.\u003c/p\u003e\u003cp\u003eIn the third example Misha can buy four cheapest shovels without using any special offers and get the total cost $$$17$$$.\u003c/p\u003e"}}]}