{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n h1 { font-size: 1.2em; }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cdiv class\u003d\"md\"\u003e\u003cp\u003eA company wants to hire \u003cspan class\u003d\"math inline\"\u003e$ a $\u003c/span\u003e programmers and \u003cspan class\u003d\"math inline\"\u003e$ b $\u003c/span\u003e artists.\u003c/p\u003e\n\u003cp\u003eThere are a total of \u003cspan class\u003d\"math inline\"\u003e$ n $\u003c/span\u003e applicants, and each applicant can become either a programmer or an artist. You know each applicant\u0027s programming and artistic skills.\u003c/p\u003e\n\u003cp\u003eYour task is to select the new employees so that the sum of their skills is maximum.\u003c/p\u003e\n\u003ch1 id\u003d\"input\"\u003eInput\u003c/h1\u003e\n\u003cp\u003eThe first input line has three integers \u003cspan class\u003d\"math inline\"\u003e$ a $\u003c/span\u003e, \u003cspan class\u003d\"math inline\"\u003e$ b $\u003c/span\u003e and \u003cspan class\u003d\"math inline\"\u003e$ n $\u003c/span\u003e: the required number of programmers and artists, and the total number of applicants.\u003c/p\u003e\n\u003cp\u003eAfter this, there are \u003cspan class\u003d\"math inline\"\u003e$ n $\u003c/span\u003e lines that describe the applicants. Each line has two integers \u003cspan class\u003d\"math inline\"\u003e$ x $\u003c/span\u003e and \u003cspan class\u003d\"math inline\"\u003e$ y $\u003c/span\u003e: the applicant\u0027s programming and artistic skills.\u003c/p\u003e\n\u003ch1 id\u003d\"output\"\u003eOutput\u003c/h1\u003e\n\u003cp\u003ePrint one integer: the maximum sum of skills.\u003c/p\u003e\n\u003ch1 id\u003d\"constraints\"\u003eConstraints\u003c/h1\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cspan class\u003d\"math inline\"\u003e$ 1 \\le n \\le 2 \\cdot 10^5 $\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003cspan class\u003d\"math inline\"\u003e$ 0 \\le a,b \\le n $\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003cspan class\u003d\"math inline\"\u003e$ a+b \\le n $\u003c/span\u003e\u003c/li\u003e\n\u003cli\u003e\u003cspan class\u003d\"math inline\"\u003e$ 1 \\le x,y \\le 10^9 $\u003c/span\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch1 id\u003d\"example\"\u003eExample\u003c/h1\u003e\n\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\u003e2 1 4\n3 7\n9 8\n1 5\n4 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e20\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003cp\u003eExplanation: An optimal solution is to hire two programmers with skills \u003cspan class\u003d\"math inline\"\u003e$ 9 $\u003c/span\u003e and \u003cspan class\u003d\"math inline\"\u003e$ 4 $\u003c/span\u003e and one artist with skill \u003cspan class\u003d\"math inline\"\u003e$ 7 $\u003c/span\u003e. The sum of the skills is \u003cspan class\u003d\"math inline\"\u003e$ 9+4+7\u003d20 $\u003c/span\u003e.\u003c/p\u003e\n\u003c/div\u003e "}}]}