{"problem":{"name":"Cutoff","description":{"content":"There is an exam structured as follows. *   The exam consists of $N$ rounds called round $1$ to $N$. *   In each round, you are given an integer score between $0$ and $100$, inclusive. *   Your final","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc321_b"},"statements":[{"statement_type":"Markdown","content":"There is an exam structured as follows.\n\n*   The exam consists of $N$ rounds called round $1$ to $N$.\n*   In each round, you are given an integer score between $0$ and $100$, inclusive.\n*   Your final grade is the sum of the $N-2$ of the scores earned in the rounds excluding the highest and lowest.\n    *   Formally, let $S=(S_1,S_2,\\dots,S_N)$ be the sequence of the scores earned in the rounds sorted in ascending order, then the final grade is $S_2+S_3+\\dots+S_{N-1}$.\n\nNow, $N-1$ rounds of the exam have ended, and your score in round $i$ was $A_i$.  \nPrint the minimum score you must earn in round $N$ for a final grade of $X$ or higher.  \nIf your final grade will never be $X$ or higher no matter what score you earn in round $N$, print `-1` instead.  \nNote that your score in round $N$ can only be an integer between $0$ and $100$.\n\n## Constraints\n\n*   All input values are integers.\n*   $3 \\le N \\le 100$\n*   $0 \\le X \\le 100 \\times (N-2)$\n*   $0 \\le A_i \\le 100$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $X$\n$A_1$ $A_2$ $\\dots$ $A_{N-1}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc321_b","tags":[],"sample_group":[["5 180\n40 60 80 50","70\n\nYour scores in the first four rounds were $40$, $60$, $80$, and $50$.  \nIf you earn a score of $70$ in round $5$, the sequence of the scores sorted in ascending order will be $S=(40,50,60,70,80)$, for a final grade of $50+60+70=180$.  \nIt can be shown that $70$ is the minimum score you must earn for a final grade of $180$ or higher."],["3 100\n100 100","0\n\nYour scores in the first two rounds were $100$ and $100$.  \nIf you earn a score of $0$ in round $3$, the sequence of the scores sorted in ascending order will be $S=(0,100,100)$, for a final grade of $100$.  \nNote that the highest score, $100$, is earned multiple times, and only one of them is excluded. (The same goes for the lowest score.)  \nIt can be shown that $0$ is the minimum score you must earn for a final grade of $100$ or higher."],["5 200\n0 0 99 99","\\-1\n\nYour scores in the first four rounds were $0$, $0$, $99$, and $99$.  \nIt can be shown that your final grade will never be $200$ or higher no matter what score you earn in round $5$."],["10 480\n59 98 88 54 70 24 8 94 46","45"]],"created_at":"2026-03-03 11:01:14"}}