#Lutece2736. 合作共赢
合作共赢
Migrated from Lutece 2736 合作共赢
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
在将所有道路建成完后,图图国王准备实施一项政策:城市合作发展。目前在图图国有 座城市,其中有 对城市满足城市合作发展条件。每座城市最后只能与另外的一座城市合作发展,请问在图图国中最多产生多少对合作城市。
Input
第一行两个整数, , 。 第二行起 行,每行两个整数 , ,表示第 座城愿意与第 座城成为合作城市。
Output
第一行一个整数,表示最多产生多少对合作城市。
Samples
5 4
1 5
4 2
2 1
4 3
2
Constraints
Note
保证 ,保证 。
Resources
2022 UESTC ICPC Training for Graph