{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eCarlo Ancelotti \"Real Madrid\u0027s coach\" is so Sad and disappointed, and Florentino Perez fired him after getting knocked out from the UEFA Champions League against Juventus. Carlo is so good in algorithms and strategies (he is an engineer), and he heard about the ACM competition and decided to train a team to qualify to ICPC. After 2 years of training Carlo became really experienced with his team, and now he knows how much time his team needs to solve a problem (read it and code it correctly). Given the required solving time for each problem, help Carlo to determine the highest number of problems his team can solve with the minimum possible penalty.\u003c/p\u003e\u003cp\u003eThe total penalty is the sum of penalties for all solved problems. The penalty for a solved problem is equal to the number of minutes which have passed after the starting of the contest when this problem is submitted. And the period of the contest is 300 minutes.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eYour program will be tested on one or more test cases. The first line of the input contains a single integer \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eT\u003c/span\u003e\u003c/span\u003e (1 \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eT\u003c/span\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e 100) the number of test cases. Followed by \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eT\u003c/span\u003e\u003c/span\u003e test cases. Each test case consists of two lines. The first line contains a single integer \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eN\u003c/span\u003e\u003c/span\u003e (8 \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eN\u003c/span\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e 15), the number of problems .The next line consists of \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eN\u003c/span\u003e\u003c/span\u003e integers separated by a single space: \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003ep\u003cspan class\u003d\"tex-span\"\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e (4 \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-font-style-bf\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003ep\u003cspan class\u003d\"tex-span\"\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e ≤ \u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e300\u003c/span\u003e) which refers to the solving time for each problem.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case print the highest number of problems his team can solve and the minimum possible penalty.\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\u003e2\n8\n252 244 6 109 294 31 67 270\n8\n218 48 273 69 281 224 250 193\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4 360\n2 165\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}