Maximum circles-greedy problem

I am getting wrong answer in test case 1 and 2. here is my code
https://ide.codingblocks.com/s/47030