The task is to use Bellman-Ford algorithm to compute single-source shortest distances
in a directed graph with possibly negative edge weights (but without negative cycles).

Return: An array $D[1..n]$ where $D[i]$ is the length of a shortest path from the vertex $1$ to the vertex $i$
($D[1]=0$). If $i$ is not reachable from $1$ set $D[i]$ to x.

See Figure 1 for visual example from the sample dataset.