{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"n个人,每个人固定给一个人送一个gift,不会给自己送gift,不会有一个人收到两个gift\n也就是说,每个人会收到一个gift和送出去一个gift,这样的人ans+1\n现在你可以指定k个人不会送出去gift\nans最小和最大是多少"}},{"title":"Input","value":{"format":"HTML","content":"输入n和k(2 ≤ n ≤ 10^6, 0 ≤ k ≤ n),表示有n个人,选择其中k个无法接受和送东西(相当于去掉k个人)。\n有n个数,表示第i个人将要送东西给第p[i]个人, 不会出现p[i] \u003d i(送给自己的情况)。"}},{"title":"Output","value":{"format":"HTML","content":"指定k个人后,输出得不到东西人数的min和max。"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5 2\u003cbr\u003e3 4 1 5 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2 4\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e10 1\u003cbr\u003e2 3 4 5 6 7 8 9 10 1\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e2 2\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first sample, if the third and the first balls will forget to bring their presents, they will be th only balls not getting a present. Thus the minimum answer is \u003cspan class\u003d\"tex-span\"\u003e2\u003c/span\u003e. However, if the first ans the second balls will forget to bring their presents, then only the fifth ball will get a present. So, the maximum answer is \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e.\u003c/p\u003e"}}]}