Loops In Wrong Order

Someone reordered the Floyd-Warshall loops so the intermediate vertex k is innermost:

for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
        for (int k = 0; k < n; k++)
            if (d[i][k] < INF && d[k][j] < INF)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);

Input: n = 4, d[i][i] = 0, everything else INF, and three directed edges 1→0 weight 8, 2→3 weight 9, 3→1 weight 9.

The true shortest distance from 2 to 0 is 26, along 2 → 3 → 1 → 0. What does this code report for d[2][0]?

A

17

B

INF

C

26, the same as the correct version. The three loops are independent, so any permutation reaches the same fixed point.

D

18