Run error in test case 6

My all test cases passed but their is error in test case 6.

Save your code on ide.codingblocks.com and share its link.

Increase MAX to 10^5 in your code and then check.