#ABC160D. [ABC160D] Line++
[ABC160D] Line++
Score : points
Problem Statement
We have an undirected graph with vertices numbered to and edges as follows:
- For each , there is an edge between Vertex and Vertex .
- There is an edge between Vertex and Vertex .
For each , solve the problem below:
- Find the number of pairs of integers such that the shortest distance between Vertex and Vertex in is .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
For each in this order, print a line containing the answer to the problem.
The graph in this input is as follows:
There are five pairs such that the shortest distance between Vertex and Vertex is : .
There are four pairs such that the shortest distance between Vertex and Vertex is : .
There is one pair such that the shortest distance between Vertex and Vertex is : .
There are no pairs such that the shortest distance between Vertex and Vertex is .
The graph in this input is as follows: