{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section 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 }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\u003cscript type\u003d\"text/x-mathjax-config\"\u003eMathJax.Hub.Config({messageStyle:\"none\",tex2jax:{skipTags:[\"script\",\"noscript\",\"style\",\"textarea\",\"code\"],inlineMath:[[\u0027\\\\(\u0027,\u0027\\\\)\u0027]]},delayStartupUntil:\"onload\"});\u003c/script\u003e\n\u003cscript src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config\u003dTeX-MML-AM_CHTML\"\u003e\u003c/script\u003e\n\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eЗадается дерево из N вершин.\u003c/p\u003e \n\u003cp\u003eНурстан решил покрасить каждую вершину в либо черный либо белый цвет. Однако, он не будет красить две вершины соединеные ребром в черный цвет\u003c/p\u003e \n\u003cp\u003eНайдите кол-во разлиных покрасек в которые Нурстан мог покрасить данное дерево, по модулю 10^9+7.\u003c/p\u003e"}},{"title":"Constraints","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cul\u003e \n \u003cli\u003e1 \u003c\u003d N \u003c\u003d 10^5\u003c/li\u003e \n \u003cli\u003e\u003cvar\u003e\\(1 \\leq x_i, y_i \\leq N\\)\u003c/var\u003e\u003c/li\u003e \n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eВ первой строке задается одно целое число N - размер дерева\u003c/p\u003e\n\u003cp\u003eВ последующих N-1 строк, задает два числа a, b - в графе между вершинами a и b есть ребро\u003c/p\u003e "}},{"title":"Output","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cp\u003eНайдите кол-во разлиных покрасек в которые Нурстан мог покрасить данное дерево, по модулю 10^9+7.\u003c/p\u003e"}},{"title":"Sample Input 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e3\n1 2\n2 3\n\u003c/pre\u003e"}},{"title":"Sample Output 1","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e5\n\u003c/pre\u003e \n\u003cp\u003eThere are five ways to paint the vertices, as follows:\u003c/p\u003e \n\u003cp\u003e\u003cimg alt\u003d\"\" src\u003d\"CDN_BASE_URL/3473f4a4bc481813277bb76ffad69288?v\u003d1627834801\"\u003e\u003c/p\u003e"}},{"title":"Sample Input 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e4\n1 2\n1 3\n1 4\n\u003c/pre\u003e"}},{"title":"Sample Output 2","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e9\n\u003c/pre\u003e \n\u003cp\u003eThere are nine ways to paint the vertices, as follows:\u003c/p\u003e \n\u003cp\u003e\u003cimg alt\u003d\"\" src\u003d\"CDN_BASE_URL/ce9fa23ce35fcdd550490cfa8417f785?v\u003d1627834801\"\u003e\u003c/p\u003e"}},{"title":"Sample Input 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e1\n\u003c/pre\u003e"}},{"title":"Sample Output 3","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e2\n\u003c/pre\u003e"}},{"title":"Sample Input 4","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e10\n8 5\n10 8\n6 5\n1 5\n4 8\n2 10\n3 6\n9 2\n1 7\n\u003c/pre\u003e"}},{"title":"Sample Output 4","value":{"format":"HTML","content":"\u003ch3\u003e\u003c/h3\u003e\n\u003cpre\u003e157\n\u003c/pre\u003e"}}]}