Hi! I was trying to solve that problem but it gave me WA on subtask 3. Reading the official solution, I realized that it was pretty similar to what I did, but verifying that the two components have a size more than a. I verified that the remaining component (the one not used to assign vertices to A) had a size more than or equal to b.

Could someone tell me why the solution works? I just don't get it. Logically speaking (or writing lol), it would be impossible to assign b vertices from a subgraph of size less than b.