{"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":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eOnce the Fellowship escaped Moria, they headed to the Elven forest of Lothlórien where they spoke with the Elven Lord Celeborn and Galadriel, Lady of Light. Galadriel supplied them each with special Elven Gifts from Lothlórien, boats and supplies, consisting of a large stock of Lembas, or the elven bread, so that they could travel down the river Anduin.\n\u003c/p\u003e\u003cp\u003e\nThe Fellowship consists of \u003ci\u003en\u003c/i\u003e members, and each of them are already carrying \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003ei\u003c/sub\u003e Lembas. Galadriel wants to make sure that everyone has an equal amount of Lembas wih them. What is the minimum number of Lembas she should hand out to ensure this? \u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains the integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 100\u003c/span\u003e)\u0026nbsp;— the number of members in the fellowship.\u003c/p\u003e\n\u003cp\u003eThe second line contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e1\u003c/sub\u003e, \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e2\u003c/sub\u003e, ..., \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e, where \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e0 ≤ \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup class\u003d\"upper-index\"\u003e6\u003c/sup\u003e\u003c/span\u003e)\u0026nbsp;— the amount of Lembas the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/span\u003e-th member already has.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIn the only line print the integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003eS\u003c/i\u003e\u003c/span\u003e\u0026nbsp;— the minimum number of Lembas to be handed out.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"Input\n\u003c/br\u003e\n5\u003c/br\u003e\n0 1 2 3 4\u003c/br\u003e\nOutput\u003c/br\u003e\n10\u003c/br\u003e\u003c/br\u003e\n\nInput\u003c/br\u003e\n5\u003c/br\u003e\n1 1 0 1 1\u003c/br\u003e\nOutput\u003c/br\u003e\n1\u003c/br\u003e\u003c/br\u003e\n\nInput\u003c/br\u003e\n3\u003c/br\u003e\n1 3 1\u003c/br\u003e\nOutput\u003c/br\u003e\n4\u003c/br\u003e\u003c/br\u003e\n\nInput\u003c/br\u003e\n1\u003c/br\u003e\n12\u003c/br\u003e\nOutput\u003c/br\u003e\n0"}},{"title":"Explanation","value":{"format":"HTML","content":"In the first example if we give to the first member 4 Lembas, to the second 3, to the third 2 and to the fourth 1, then everyone would have 4.\u003c/br\u003e\u003c/br\u003e\nIn the second example it is enough to give one Lemba to the third member.\u003c/br\u003e\u003c/br\u003e\nIn the third example it is necessary to give two Lembas to the first and the third members for everyone to have 3.\u003c/br\u003e\u003c/br\u003e\nIn the fourth example it is possible to give nothing, because all members have 12 Lembas.\u003c/br\u003e\u003c/br\u003e\n"}}]}