{"trustable":false,"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"小明现在正在玩数字游戏。\u003cp\u003e\n\n小明具有n个正整数:x\u003csub\u003e1\u003c/sub\u003e,x\u003csub\u003e2\u003c/sub\u003e,...,x\u003csub\u003en\u003c/sub\u003e。 他可以根据需要多次执行以下操作:选择两个不同的索引i和j,使x\u003csub\u003ei\u003c/sub\u003e\u003e x\u003csub\u003ej\u003c/sub\u003e成立,然后应用赋值x\u003csub\u003ei\u003c/sub\u003e \u003d x\u003csub\u003ei\u003c/sub\u003e-x\u003csub\u003ej\u003c/sub\u003e。 目标是使所有数字的总和尽可能小。\n\n请帮助小明查找这笔最低金额。"}},{"title":"Input","value":{"format":"HTML","content":"第一行包含一个整数n(2≤n≤100)。 然后第二行包含n个整数:x\u003csub\u003e1\u003c/sub\u003e,x\u003csub\u003e2\u003c/sub\u003e,...,x\u003csub\u003en\u003c/sub\u003e(1≤x\u003csub\u003ei\u003c/sub\u003e≤100)。"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数-所需的最小和。\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e2\u003cbr\u003e1 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3\u003cbr\u003e2 4 6\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e6\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e2\u003cbr\u003e12 18\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e12\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5\u003cbr\u003e45 12 27 30 18\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e15\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"在第一个样例中,最佳方法是进行分配:x\u003csub\u003e2\u003c/sub\u003e \u003d x\u003csub\u003e2\u003c/sub\u003e-x\u003csub\u003e1\u003c/sub\u003e。 \u003cp\u003e\n\n在第二个样例中,最佳操作顺序为:x\u003csub\u003e3\u003c/sub\u003e \u003d x\u003csub\u003e3\u003c/sub\u003e-x\u003csub\u003e2\u003c/sub\u003e,x\u003csub\u003e2\u003c/sub\u003e \u003d x\u003csub\u003e2\u003c/sub\u003e-x\u003csub\u003e1\u003c/sub\u003e。"}}]}