Runtime Error in CHAPD problem

I am not able to understand why my code is getting accepted for some subtask and showing runtime error(NZEC)fo some.Pls…help
[Here is the link to my code][CodeChef: Practical coding for everyone]

To parse long you need Long, not Integer class.

@kr0oze: Thanks for out my mistake.(It was very silly ;)…)