m links, each link connects two different bombs. Bomb. x will explode if meets one of the following conditions:. Klee can choose exact 1 bomb to be on fire. You can changeat most 1bomb. Please help Klee find themaximumnumber of bombs can be exploded.
Klee is developing a new type of bomb called Peng Peng Bomb! There are n n bombs numbered from 1 1 to n n, bomb i i has color c_i c i . The n n bombs are connected with m m links, each link connects two different bombs. Bomb x x will explode if meets one of the following conditions: x x is on fire by Klee. Bomb y y connected to x x and of the same color as x x explodes. Formally, there exists a link between x x and y y, and c_x = c_y c x =c y holds. Klee can choose exact 1 bomb to be on fire. You can change at most 1 bomb x x and recolor it (i.e. change c_x c x to any color you want). Please help Klee find the maximum number of bombs can be exploded.