行两个整数(x,y)，表示点x到点y有一条边。</span></div>
<div><span style="font-size: medium">最后M行每行两个整数(u,v,k)，表示一组询问。</span></div>
<div><span style="font-size: medium"><br />
</span></div></div></div></div></div></div><div class="row"><div class="column"><h4 class="ui top attached block header">输出格式</h4><div class="ui bottom attached segment font-content"><div style="position: relative; overflow: hidden;"><div class=content><p>M行，表示每个询