GALACTIK WA

http://ideone.com/sijEZH why this is giving WA i tested it for all the test cases i thought of. i used quick union method.