luogu#P10940. 舞动的夜晚
舞动的夜晚
Problem Description
Company and company held a social party.
At the party, employees from company and employees from company plan to have a ballroom dance.
Among these people, some employees from company and some employees from company know each other. There are such acquaintance pairs.
At the dance, each employee will try to choose one employee from the other company that they know as a partner, and each employee can dance at most once.
The more dances are completed, the more lively the party becomes.
To keep the party lively, they want to know which acquaintance pairs of employees, if they dance together, will reduce the maximum number of dances that the whole party can complete.
Input Format
The first line contains three integers .
The next lines each contain two integers , meaning employee of company and employee of company know each other.
Output Format
The first line contains an integer , which is the number of acquaintance pairs such that, if that pair dances, the maximum number of dances the whole party can complete will decrease.
The second line contains integers, output in increasing order, which are the indices of such acquaintance pairs (i.e., the position of that acquaintance pair in the input).
If , output an empty line.
3 3 6
1 1
2 1
2 2
3 1
3 2
3 3
3
2 4 5
Hint
Constraints: , , , .
Translated by ChatGPT 5