Codeforces Round #254 (Div. 2) SDUT2015暑假集训14级周赛2 (并查集)
DZYloveschemistry,andheenjoysmixingchemicals.DZYhasnchemicals,andmpairsofthemwillreact.Hewantstopourthesechemicalsintoatesttube,andheneedstopourtheminonebyone,inanyorder.Let'sconsiderthedangerofatestt