CSES - Minimum spanning tree

Consider the following undirected graph:

  • The nodes are 1,2,,N1,2,\dots,N and N=1000N=1000.
  • There is an edge between every pair of nodes. The weight of the edge between the nodes aa and bb is min(a,b)\min(a,b).

What is the weight of the minimum spanning tree?

Justify your answer briefly: