void Dijkstra(int start) {
        Arrays.fill(u, false);
        for (int i = 0; i < n; i++) {
            int v = - 1;
            for (int j = 0; j < n; j++) {
                if (!u[j] && (v == -1 || d[start][j] < d[start][v]))
                    v = j;
            }
            if (d[start][v] == INF)
                break;
            u[v] = true;

            for (Pair p : graph[v]) {
                d[start][p.first] = Math.min(d[start][p.first], d[start][v] + p.second);
            }
        }
    }