You have a complete directed graph with N nodes. Edge weights are given in a matrix. You delete nodes one by one in a specific order.
After each deletion, find the sum of shortest paths between all remaining nodes.
Constraints: N ≤ . Output N numbers: the sums after each deletion step. The small N allows total work but you cannot run Floyd-Warshall from scratch after each deletion. You need an incremental approach that reuses previous computations.