Graph problem

I was trying to solve a problem that required graph implementation of bfs or similar and I just couldn't get something about it, first here is the problem link:
http://codeforces.com/problemset/problem/689/B

2nd what I don't get is how the input / output work exactly... and I am used to questions that give you the vertices and edges and their connectivity like 1 2 , 1 3 , 2 3 and so on like which node is connected to which other node and then I'd be able to construct it on a piece of paper and carry on my question accordingly but this one gives me nothing and idk how to construct such a graph but the only thing I know that this problem is solved using bfs, i know it can use dijkstra but i haven't practiced it yet so my practice is limited to bfs, I hope someone can help!
you start with a complete graph, where the weight between each pair is |j-k|
then you receive the description of n directed edges, from j to v_j with cost 1.
For example
2 2 3
the extra paths are 1->2; 2->2; 3->3
4 4 4 4 7 7 7
the extra paths are 1->4; 2->4; 3->4; 4->4; 5->7; 6->7; 7->7
Topic archived. No new replies allowed.