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><div>
<div>对于每组数据，输出一行，包括一个整数，为最优情况下通过的桥的长度之和。</div>
<div>如果不存在从s到t的路径，请输出-1</div>
</div>
<div></div></div></div></div></div></div><div class="row"><div class="column"><h4 class="ui top attache