he farm&nbsp;</div>
<div>and the number of barns that have already been painted.</div>
<div>The next N-1lines each contain two integers xx and yy (1&le;x,y&le;N,x&ne;y) describing a path directly connecting barns x and y.</div>
<div>The next K lines each contain two integers bb and cc (1&le;b&le;N, 1&le;c&le;3) indicating that barn bb is painted with color c.</div>
<div></div>
<p></p></div></div></div></div></div><div class="row"><div class="column"><h4 class="ui top attached block header">输出格式