{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003eTakahashi will take part in an eating contest. Teams of \u003cvar\u003e\\(N\\)\u003c/var\u003e members will compete in this contest, and Takahashi\u0027s team consists of \u003cvar\u003e\\(N\\)\u003c/var\u003e players numbered \u003cvar\u003e\\(1\\)\u003c/var\u003e through \u003cvar\u003e\\(N\\)\u003c/var\u003e from youngest to oldest. The \u003cem\u003econsumption coefficient\u003c/em\u003e of Member \u003cvar\u003e\\(i\\)\u003c/var\u003e is \u003cvar\u003e\\(A_i\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003cp\u003eIn the contest, \u003cvar\u003e\\(N\\)\u003c/var\u003e foods numbered \u003cvar\u003e\\(1\\)\u003c/var\u003e through \u003cvar\u003e\\(N\\)\u003c/var\u003e will be presented, and the \u003cem\u003edifficulty\u003c/em\u003e of Food \u003cvar\u003e\\(i\\)\u003c/var\u003e is \u003cvar\u003e\\(F_i\\)\u003c/var\u003e. The details of the contest are as follows:\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eA team should assign one member to each food, and should not assign the same member to multiple foods.\u003c/li\u003e\r\n\u003cli\u003eIt will take \u003cvar\u003e\\(x \\times y\\)\u003c/var\u003e seconds for a member to finish the food, where \u003cvar\u003e\\(x\\)\u003c/var\u003e is the consumption coefficient of the member and \u003cvar\u003e\\(y\\)\u003c/var\u003e is the difficulty of the dish.\u003c/li\u003e\r\n\u003cli\u003eThe score of a team is the longest time it takes for an individual member to finish the food.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eBefore the contest, Takahashi\u0027s team decided to do some training. In one set of training, a member can reduce his/her consumption coefficient by \u003cvar\u003e\\(1\\)\u003c/var\u003e, as long as it does not go below \u003cvar\u003e\\(0\\)\u003c/var\u003e. However, for financial reasons, the \u003cvar\u003e\\(N\\)\u003c/var\u003e members can do at most \u003cvar\u003e\\(K\\)\u003c/var\u003e sets of training in total.\u003c/p\u003e\r\n\u003cp\u003eWhat is the minimum possible score of the team, achieved by choosing the amounts of members\u0027 training and allocating the dishes optimally?\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cul\u003e\r\n\u003cli\u003eAll values in input are integers.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq N \\leq 2 \\times 10^5\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(0 \\leq K \\leq 10^{18}\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq A_i \\leq 10^6\\ (1 \\leq i \\leq N)\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq F_i \\leq 10^6\\ (1 \\leq i \\leq N)\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e \u003cvar\u003e\\(K\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(A_1\\)\u003c/var\u003e \u003cvar\u003e\\(A_2\\)\u003c/var\u003e \u003cvar\u003e\\(...\\)\u003c/var\u003e \u003cvar\u003e\\(A_N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(F_1\\)\u003c/var\u003e \u003cvar\u003e\\(F_2\\)\u003c/var\u003e \u003cvar\u003e\\(...\\)\u003c/var\u003e \u003cvar\u003e\\(F_N\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\r\n\u003cp\u003ePrint the minimum possible score of the team.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","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 5\r\n4 2 1\r\n2 3 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eThey can achieve the score of \u003cvar\u003e\\(2\\)\u003c/var\u003e, as follows:\u003c/p\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eMember \u003cvar\u003e\\(1\\)\u003c/var\u003e does \u003cvar\u003e\\(4\\)\u003c/var\u003e sets of training and eats Food \u003cvar\u003e\\(2\\)\u003c/var\u003e in \u003cvar\u003e\\((4-4) \\times 3 \u003d 0\\)\u003c/var\u003e seconds.\u003c/li\u003e\r\n\u003cli\u003eMember \u003cvar\u003e\\(2\\)\u003c/var\u003e does \u003cvar\u003e\\(1\\)\u003c/var\u003e set of training and eats Food \u003cvar\u003e\\(3\\)\u003c/var\u003e in \u003cvar\u003e\\((2-1) \\times 1 \u003d 1\\)\u003c/var\u003e second.\u003c/li\u003e\r\n\u003cli\u003eMember \u003cvar\u003e\\(3\\)\u003c/var\u003e does \u003cvar\u003e\\(0\\)\u003c/var\u003e sets of training and eats Food \u003cvar\u003e\\(1\\)\u003c/var\u003e in \u003cvar\u003e\\((1-0) \\times 2 \u003d 2\\)\u003c/var\u003e seconds.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003cp\u003eThey cannot achieve a score of less than \u003cvar\u003e\\(2\\)\u003c/var\u003e, so the answer is \u003cvar\u003e\\(2\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 2","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 8\r\n4 2 1\r\n2 3 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eThey can choose not to do exactly \u003cvar\u003e\\(K\\)\u003c/var\u003e sets of training.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 3","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\u003e11 14\r\n3 1 4 1 5 9 2 6 5 3 5\r\n8 9 7 9 3 2 3 8 4 6 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e12\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\u003c/section\u003e\r\n"}}]}