{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003eTo avoid unsightly burns while tanning, each of the \u003ci\u003eC\u003c/i\u003e (1 ≤ \u003ci\u003eC\u003c/i\u003e ≤ 2500) cows must cover her hide with sunscreen when they\u0027re at the beach. Cow \u003ci\u003ei\u003c/i\u003e has a minimum and maximum \u003ci\u003eSPF\u003c/i\u003e rating (1 ≤ \u003ci\u003eminSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 1,000; \u003ci\u003eminSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ \u003ci\u003emaxSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 1,000) that will work. If the \u003ci\u003eSPF\u003c/i\u003e rating is too low, the cow suffers sunburn; if the \u003ci\u003eSPF\u003c/i\u003e rating is too high, the cow doesn\u0027t tan at all........\u003c/p\u003e\u003cp\u003eThe cows have a picnic basket with \u003ci\u003eL\u003c/i\u003e (1 ≤ \u003ci\u003eL\u003c/i\u003e ≤ 2500) bottles of sunscreen lotion, each bottle \u003ci\u003ei\u003c/i\u003e with an \u003ci\u003eSPF\u003c/i\u003e rating \u003ci\u003eSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e (1 ≤ \u003ci\u003eSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 1,000). Lotion bottle \u003ci\u003ei\u003c/i\u003e can cover \u003ci\u003ecover\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e cows with lotion. A cow may lotion from only one bottle.\u003c/p\u003e\u003cp\u003eWhat is the maximum number of cows that can protect themselves while tanning given the available lotions?\u003c/p\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e* Line 1: Two space-separated integers: \u003ci\u003eC\u003c/i\u003e and \u003ci\u003eL\u003c/i\u003e\u003cbr\u003e* Lines 2..\u003ci\u003eC\u003c/i\u003e+1: Line \u003ci\u003ei\u003c/i\u003e describes cow \u003ci\u003ei\u003c/i\u003e\u0027s lotion requires with two integers: \u003ci\u003eminSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003emaxSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e \u003cbr\u003e* Lines \u003ci\u003eC\u003c/i\u003e+2..\u003ci\u003eC\u003c/i\u003e+\u003ci\u003eL\u003c/i\u003e+1: Line \u003ci\u003ei\u003c/i\u003e+\u003ci\u003eC\u003c/i\u003e+1 describes a sunscreen lotion bottle \u003ci\u003ei\u003c/i\u003e with space-separated integers: \u003ci\u003eSPF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003ecover\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e \u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eA single line with an integer that is the maximum number of cows that can be protected while tanning\u003c/p\u003e"}},{"title":"Sample","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\u003e3 2\r\n3 10\r\n2 5\r\n1 5\r\n6 2\r\n4 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}