{"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\u003eDreamoon是Codeforces比赛的忠实粉丝。\u003c/p\u003e\u003cp\u003e有一天,他声称他将在再参加两场有等级的比赛后,收集所有从$$$1$$$到$$$54$$$的名次。这太神奇了!\u003c/p\u003e\u003cp\u003e基于此,你提出了以下问题:\u003c/p\u003e\u003cp\u003e有一个人参加了$$$n$$$场Codeforces比赛。他在第一场比赛中的名次是$$$a_1$$$,第二场比赛中的名次是$$$a_2$$$,...,第$$$n$$$场比赛中的名次是$$$a_n$$$。\u003c/p\u003e\u003cp\u003e给你一个正整数$$$x$$$。\u003c/p\u003e\u003cp\u003e请找出最大的$$$v$$$,使得这个人在再参加$$$x$$$场有等级的比赛后,能够收集所有从$$$1$$$到$$$v$$$的名次。\u003c/p\u003e\u003cp\u003e换句话说,你需要找到最大的$$$v$$$,使得可能在再参加$$$x$$$场有等级的比赛后,对于每个$$$1 \\leq i \\leq v$$$,都存在一场比赛,这个人在其中取得了第$$$i$$$名。\u003c/p\u003e\u003cp\u003e例如,如果$$$n\u003d6$$$,$$$x\u003d2$$$和$$$a\u003d[3,1,1,5,7,10]$$$,那么答案是$$$v\u003d5$$$,因为如果在接下来的两场比赛中他取得了$$$2$$$和$$$4$$$名次,那么他将收集到所有从$$$1$$$到$$$5$$$的名次,因此可以得到$$$v\u003d5$$$。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数$$$t$$$($$$1 \\leq t \\leq 5$$$),表示输入中的测试用例数。\u003c/p\u003e\u003cp\u003e每个测试用例包含两行。第一行包含两个整数$$$n, x$$$($$$1 \\leq n, x \\leq 100$$$)。第二行包含$$$n$$$个正整数$$$a_1, a_2, \\ldots, a_n$$$($$$1 \\leq a_i \\leq 100$$$)。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,打印一行,包含最大的$$$v$$$,使得可能在再参加$$$x$$$场比赛后,对于每个$$$1 \\leq i \\leq v$$$,都存在一场比赛,这个人在其中取得了第$$$i$$$名。\u003c/p\u003e"}},{"title":"示例1","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\u003e5\n6 2\n3 1 1 5 7 10\n1 100\n100\n11 1\n1 1 1 1 1 1 1 1 1 1 1\n1 1\n1\n4 57\n80 60 40 20\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n101\n2\n2\n60\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e第一个测试用例在题目中已经描述了。\u003c/p\u003e\u003cp\u003e在第二个测试用例中,这个人有一百场未来的比赛,所以他可以以某种顺序取得$$$1,2,\\ldots,99$$$名和$$$101$$$名,在其中收集到$$$1,2,\\ldots,101$$$名。\u003c/p\u003e"}}]}