{"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":"Đất nước Tokucha có N thành phố được nối bởi n-1 con đường. Hai thành phố bất kì đều có thể đi được đến nhau. Trong các con đường này có một số đoạn đường bị hỏng. Trong thời điểm này để tăng trưởng kinh tế cô lại cần chọn ra một số thành phố làm thành phố trực thuộc trung ương (trung ương – thủ đô được đặt tại thành phố số 1). Khi một thành phố được chọn cô sẽ sửa hết các đoạn đường bị hỏng trên con đường đi từ thành phố đó đến thủ đô. Hãy giúp cô chọn ra ít thành phố trực thuộc trung ương nhất sao cho tất cả các con đường hỏng hóc đều được sửa để cả nước lại tiếp tục phát triển kinh tế.\n\nInput: \n-\tDòng đầu tiên là số N (2\u003c\u003dN\u003c\u003d10^5)\n-\tN-1 dòng sau là các số Xi, Yi, và Zi tương ứng là đường 2 chiều nối thành phố Xi với Yi, Zi\u003d1 thì đường nào vẫn ngon, còn nếu Zi\u003d2 thì đường này đang bị hỏng.\n\nOutput:\n-\tĐưa ra 1 số không âm K là số lượng thành phố ít nhất cần chọn. \n-\tDòng thứ 2 là K số - tên thành phố được chọn. Nếu có nhiều kết quả thì in ra kết quả nào cũng được.\n"}},{"title":"Examples","value":{"format":"MD","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\u003cbr\u003e1 2 2\u003cbr\u003e2 3 2\u003cbr\u003e3 4 2\u003cbr\u003e4 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\u003e1\u003cbr\u003e5 \u003cbr\u003e\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\u003e5\u003cbr\u003e1 2 1\u003cbr\u003e2 3 2\u003cbr\u003e2 4 1\u003cbr\u003e4 5 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\u003e1\u003cbr\u003e3 \u003cbr\u003e\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\u003e5\u003cbr\u003e1 2 2\u003cbr\u003e1 3 2\u003cbr\u003e1 4 2\u003cbr\u003e1 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\u003e4\u003cbr\u003e5 4 3 2 \u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}