{"trustable":false,"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":"MD","content":"现在给你n个整数,分别为a1,a2,...,an,然后定义函数f(x) \u003d (m mod a1) + (m mod a2) + (m mod a3) + ... + (m mod an) ,求这个函数的值域最大值\n\n其中mod是求余运算,例如 9 mod 5 \u003d 4"}},{"title":"Constraints","value":{"format":"MD","content":"n大于1不大于3000\na1,a2,...an均为2到100000之间的整数"}},{"title":"Input","value":{"format":"MD","content":"输入格式\nn\na1 a2 a3 ... an"}},{"title":"Output","value":{"format":"MD","content":"输出最大值"}},{"title":"Sample Input 1","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e3\n3 4 6\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e10\n\u003c/pre\u003e \n\u003cp\u003ef(11) \u003d (11 mod 3) + (11 mod 4) + (11 mod 6) \u003d 10 是本函数的最大值.\u003c/p\u003e"}},{"title":"Sample Input 2","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e5\n7 46 11 20 11\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e90\n\u003c/pre\u003e"}},{"title":"Sample Input 3","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e7\n994 518 941 851 647 2 581\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"MD","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e4527\n\u003c/pre\u003e"}}]}