DISH OWNER UNION FIND

i am getting a wrong answer to this problem
By reading the question only it can be understood that one have to use Union find
but there is something fishy going on with my solution

please help me find out the error

problem link
http://www.codechef.com/problems/DISHOWN/

my solution http://ideone.com/BsNHWv

ANY HELP ??