I am getting run time error here https://www.codechef.com/viewsolution/85477030

can anyone please help me with the code given below iam getting a rin time error (SIGABRT) the problem code is POPGATES POPGATES Problem - CodeChef
CodeChef: Practical coding for everyone