Winning CB Scholarship (WA)

question - https://hack.codingblocks.com/contests/c/452/1226
my code - https://ide.codingblocks.com/s/37095
Could not figure out the mistake in the code… Passes only 3 test cases.