对于每个城市,像样例那样输出两到三行。第一行是城市编号。如果城市只有少于两个建筑,就在第二行输出“No bridges are needed.”。如果城市有两个及以上个建筑且任意两个建筑都不能被连接,就在第二行输出“No bridges are possible.”。否则,就在第二行输出“N bridges of total length L”,其中N是道路数,L是最优方案的道路长度。(如果N是1,就用bridge代替bridges)。如果最终方案剩下了多个建筑群,在第三行输出建筑群数。 每组数据间用空行隔开。见下面样例。
City 1
4 bridges of total length 4
City 2
No bridges are possible.
2 disconnected groups
City 3
No bridges are needed.
City 4
1 bridge of total length 1
2 disconnected groups