{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003esection pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n}\u003c/style\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\" class\u003d\"\"\u003e\n\t\t\t\u003cdiv class\u003d\"col-md-12\"\u003e\n\t\t\t\t\u003csection id\u003d\"description\" class\u003d\"problem-section\"\u003e\n\t\t\t\t\u003cdiv class\u003d\"headline\"\u003e\n\t\t\t\t\u003ch2\u003eDescription\u003c/h2\u003e\n\t\t\t\t\u003c/div\u003e\n\t\t\t\t\u003cdiv id\u003d\"problem_description\" class\u003d\"problem-text\"\u003e\n\t\t\t\t\u003cp\u003e트리의 지름이란, 트리에서 임의의 두 점 사이의 거리 중 가장 긴 것을 말한다. 트리의 지름을 구하는 프로그램을 작성하시오.\u003c/p\u003e\r\n\n\t\t\t\t\u003c/div\u003e\n\t\t\t\t\u003c/section\u003e\n\t\t\t\u003c/div\u003e\n\t\t\t\t\t\t\t\t\t\t\u003cdiv class\u003d\"col-md-12\"\u003e\n\t\t\t\t\t\u003csection id\u003d\"input\" class\u003d\"problem-section\"\u003e\n\t\t\t\t\t\u003cdiv class\u003d\"headline\"\u003e\n\t\t\t\t\t\u003ch2\u003eInput\u003c/h2\u003e\n\t\t\t\t\t\u003c/div\u003e\n\t\t\t\t\t\u003cdiv id\u003d\"problem_input\" class\u003d\"problem-text\"\u003e\n\t\t\t\t\t\u003cp\u003e트리가 입력으로 주어진다. 먼저 첫 번째 줄에서는 트리의 정점의 개수 V가 주어지고 (2 ≤ V ≤ 100,000)둘째 줄부터 V개의 줄에 걸쳐 간선의 정보가 다음과 같이 주어진다. 정점 번호는 1부터 V까지 매겨져 있다.\u003c/p\u003e\r\n\r\n\u003cp\u003e먼저 정점 번호가 주어지고, 이어서 연결된 간선의 정보를 의미하는 정수가 두 개씩 주어지는데, 하나는 정점번호, 다른 하나는 그 정점까지의 거리이다. 예를 들어 네 번째 줄의 경우 정점 3은 정점 1과 거리가 2인 간선으로 연결되어 있고, 정점 4와는 거리가 3인 간선으로 연결되어 있는 것을 보여준다. 각 줄의 마지막에는 -1이 입력으로 주어진다. 주어지는 거리는 모두 10,000 이하의 자연수이다.\u003c/p\u003e\r\n\n\t\t\t\t\t\u003c/div\u003e\n\t\t\t\t\t\u003c/section\u003e\n\t\t\t\t\u003c/div\u003e\n\t\n\t\t\t\t\u003cdiv class\u003d\"col-md-12\"\u003e\n\t\t\t\t\t\u003csection id\u003d\"output\" class\u003d\"problem-section\"\u003e\n\t\t\t\t\t\u003cdiv class\u003d\"headline\"\u003e\n\t\t\t\t\t\u003ch2\u003eOutput\u003c/h2\u003e\n\t\t\t\t\t\u003c/div\u003e\n\t\t\t\t\t\u003cdiv id\u003d\"problem_output\" class\u003d\"problem-text\"\u003e\n\t\t\t\t\t\u003cp\u003e첫째 줄에 트리의 지름을 출력한다.\u003c/p\u003e\r\n\n\t\t\t\t\t\u003c/div\u003e\n\t\t\t\t\t\u003c/section\u003e\n\t\t\t\t\u003c/div\u003e\n\t\t\t\t\t\t\u003cdiv class\u003d\"col-md-12\"\u003e\n\t\t\t\u003csection id\u003d\"limit\" style\u003d\"display:none;\" class\u003d\"problem-section\"\u003e\n\t\t\t\u003cdiv class\u003d\"headline\"\u003e\n\t\t\t\u003ch2\u003eLimit\u003c/h2\u003e\n\t\t\t\u003c/div\u003e\n\t\t\t\u003cdiv id\u003d\"problem_limit\" class\u003d\"problem-text\"\u003e\n\t\t\t\t\t\t\u003c/div\u003e\n\t\t\t\u003c/section\u003e\n\t\t\t\u003c/div\u003e\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\u003cdiv class\u003d\"col-md-12\"\u003e\n\t\t\t\t\u003cdiv class\u003d\"row\"\u003e\n\t\t\t\t\t\u003cdiv\u003e\u003ch2\u003eSample 1\u003c/h2\u003e\u003ctable class\u003d\"vjudge_sample\"\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\n1 3 2 -1\n2 4 4 -1\n3 1 2 4 3 -1\n4 2 4 3 3 5 6 -1\n5 4 6 -1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e11\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\u003c/div\u003e\n\t\t\t\t\u003c/div\u003e\n\t\t\t\t\t\t\t\t\t\t\u003cdiv class\u003d\"col-md-12\"\u003e\n\t\t\t\t\u003csection id\u003d\"hint\" style\u003d\"display: none;\" class\u003d\"problem-section\"\u003e\n\t\t\t\t\u003cdiv class\u003d\"headline\"\u003e\n\t\t\t\t\u003ch2\u003eHints\u003c/h2\u003e\n\t\t\t\t\u003c/div\u003e\n\t\t\t\t\u003cdiv id\u003d\"problem_hint\" class\u003d\"problem-text\"\u003e\n\t\t\t\t\n\t\t\t\t\u003c/div\u003e\n\t\t\t\t\u003c/section\u003e\n\t\t\t\u003c/div\u003e\n\t\t\t\t\t\t\t\t\u003c/div\u003e"}}]}