Can anyone point out why am I getting run time error for this program.

all freepascal submissions from the list:-

http://www.codechef.com/status/CHEFTEAM,v_akshay