{"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\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\u003eNoora is a student of one famous high school. It\u0027s her final year in school\u0026nbsp;— she is going to study in university next year. However, she has to get an «A» graduation certificate in order to apply to a prestigious one.\u003c/p\u003e\u003cp\u003eIn school, where Noora is studying, teachers are putting down marks to the online class register, which are integers from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e. The worst mark is \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e, the best is \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e. Mark that is going to the certificate, is calculated as an average of all the marks, rounded to the closest integer. If several answers are possible, rounding up is produced. For example, \u003cspan class\u003d\"tex-span\"\u003e7.3\u003c/span\u003e is rounded to \u003cspan class\u003d\"tex-span\"\u003e7\u003c/span\u003e, but \u003cspan class\u003d\"tex-span\"\u003e7.5\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e7.8784\u003c/span\u003e\u0026nbsp;— to \u003cspan class\u003d\"tex-span\"\u003e8\u003c/span\u003e. \u003c/p\u003e\u003cp\u003eFor instance, if Noora has marks \u003cspan class\u003d\"tex-span\"\u003e[8, 9]\u003c/span\u003e, then the mark to the certificate is \u003cspan class\u003d\"tex-span\"\u003e9\u003c/span\u003e, because the average is equal to \u003cspan class\u003d\"tex-span\"\u003e8.5\u003c/span\u003e and rounded to \u003cspan class\u003d\"tex-span\"\u003e9\u003c/span\u003e, but if the marks are \u003cspan class\u003d\"tex-span\"\u003e[8, 8, 9]\u003c/span\u003e, Noora will have graduation certificate with \u003cspan class\u003d\"tex-span\"\u003e8\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eTo graduate with «A» certificate, Noora \u003cspan class\u003d\"tex-font-style-bf\"\u003ehas to have mark\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eNoora got \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e marks in register this year. However, she is afraid that her marks are not enough to get final mark \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e. Noora decided to ask for help in the internet, where hacker Leha immediately responded to her request. He is ready to hack class register for Noora and to add Noora any number of additional marks from \u003cspan class\u003d\"tex-span\"\u003e1\u003c/span\u003e to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e. At the same time, Leha want his hack be unseen to everyone, so he decided to add as less as possible additional marks. Please help Leha to calculate the minimal number of marks he has to add, so that final Noora\u0027s mark will become equal to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e \u003cspan class\u003d\"tex-span\"\u003e(1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 100, 1 ≤ \u003ci\u003ek\u003c/i\u003e ≤ 100)\u003c/span\u003e denoting the number of marks, received by Noora and the value of highest possible mark.\u003c/p\u003e\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 \u003cspan class\u003d\"tex-span\"\u003e(1 ≤ \u003ci\u003ea\u003c/i\u003e\u003csub class\u003d\"lower-index\"\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ \u003ci\u003ek\u003c/i\u003e)\u003c/span\u003e denoting marks received by Noora before Leha\u0027s hack.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer\u0026nbsp;— minimal number of additional marks, that Leha has to add in order to change Noora\u0027s final mark to \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ek\u003c/i\u003e\u003c/span\u003e.\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 10\n8 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\n4 4 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eConsider the first example testcase.\u003c/p\u003e\u003cp\u003eMaximal mark is \u003cspan class\u003d\"tex-span\"\u003e10\u003c/span\u003e, Noora received two marks\u0026nbsp;— \u003cspan class\u003d\"tex-span\"\u003e8\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e9\u003c/span\u003e, so current final mark is \u003cspan class\u003d\"tex-span\"\u003e9\u003c/span\u003e. To fix it, Leha can add marks \u003cspan class\u003d\"tex-span\"\u003e[10, 10, 10, 10]\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e marks in total) to the registry, achieving Noora having average mark equal to \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/e1a1c3a44a66efd5b2c46e3e6f7e1d7f?v\u003d1714824168\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e. Consequently, new final mark is \u003cspan class\u003d\"tex-span\"\u003e10\u003c/span\u003e. Less number of marks won\u0027t fix the situation.\u003c/p\u003e\u003cp\u003eIn the second example Leha can add \u003cspan class\u003d\"tex-span\"\u003e[5, 5, 5]\u003c/span\u003e to the registry, so that making average mark equal to \u003cspan class\u003d\"tex-span\"\u003e4.5\u003c/span\u003e, which is enough to have \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e in the certificate.\u003c/p\u003e"}}]}