The Shymbulak resort has N places that tourists visit, and N roads of equal length connect them. Every road is bidirectional. From any place you can reach every other place, but some pairs of places are separated by a great many roads.
Before the administration builds new roads, it wants to know how many shortest paths run between the pairs of places that lie farthest apart.
The distance between two places is the number of roads on a shortest path between them. A pair of places lies farthest apart when this distance is the largest over all pairs. Find every pair whose distance is the largest, then add up the number of shortest paths of each such pair.