Pairing
A bipartite unweighted graph is provided. Your task is to determine the maximum matching.
Input
The first line contains three integers n, m, and k (1 ≤ n, m ≤ 200, 1 ≤ k ≤ n × m), representing the number of vertices in the first and second partitions, and the total number of edges, respectively. The following k lines each contain two integers a[i]
and b[i]
, indicating an edge between vertex a[i]
in the first partition and vertex b[i]
in the second partition. Vertices in both partitions are numbered starting from one.
Output
On the first line, print a single integer q - the maximum number of edges in the matching. On the second line, print q integers - the indices of the edges that are part of the maximum matching. The edges are numbered starting from one, in the order they are given in the input.