Two testcases are not passing

code https://ide.codingblocks.com/s/155166
Hackerblock https://hack.codingblocks.com/app/contests/987/p/193