You have n cities and m roads. Each road connects two cities. Initially, no roads exist. Roads are added one by one. After each road, output two numbers: the number of connected components and the size of the largest component.
This is an online connectivity problem. You process edges as they arrive and answer queries after each one. The DSU data structure is built for this. Initialize with components of size , then union as each road arrives.