#abc160d. [abc160_d]Line++
[abc160_d]Line++
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.
Sample Input 1
5 2 4
Sample Output 1
5
4
1
0
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 .
Sample Input 2
3 1 3
Sample Output 2
3
0
The graph in this input is as follows:
Sample Input 3
7 3 7
Sample Output 3
7
8
4
2
0
0
Sample Input 4
10 4 8
Sample Output 4
10
12
10
8
4
1
0
0
0