{"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":"MD","content":"昨晚发生了一起电子店的劫案。劫案发生在小桥经营的电子店,他提供各种各样的电子设备,包括键盘。\n在劫案之前,店里的键盘按照从某个整数 𝑥 开始的升序编号。例如,如果 𝑥\u003d4,而店里有3个键盘,那么这些设备的索引号分别为4、5和6;如果 𝑥\u003d10,而店里有7个键盘,那么这些键盘的索引号分别为10、11、12、13、14、15和16。\n劫案发生后,只剩下 𝑛 个键盘,它们的索引号分别为 𝑎1, 𝑎2, ..., 𝑎𝑛。现在需要计算被偷走的键盘的最小可能数量。店员们记不清楚 𝑥 的值,也不记得劫案前店里有多少键盘。\n请你根据上述情况,帮助小桥计算可能被偷走的键盘的最小数量。"}},{"title":"Input","value":{"format":"MD","content":"第一行包含一个整数 𝑛 (1≤𝑛≤1000),表示劫案后店里剩下的键盘数量。\n第二行包含 𝑛 个不同的整数 𝑎1, 𝑎2, ..., 𝑎𝑛 (1≤𝑎𝑖≤109),表示剩下的键盘的索引号。这些整数 𝑎𝑖 以任意顺序给出,且两两不相同。"}},{"title":"Output","value":{"format":"MD","content":"输出一个整数,表示可能被偷走的键盘的最小数量。"}},{"title":"Sample 1","value":{"format":"MD","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\u003e4\n10 13 12 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"MD","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\u003e5\n7 5 6 4 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"在第一个例子中,如果 $x\u003d8$,那么被偷走的键盘的最小数量等于2。在劫案中,索引号为9和11的键盘被盗。\n在第二个例子中,如果 $x\u003d4$,则在劫案中没有任何键盘被盗。"}}]}