Can anyone please tell why spoj says wrong while it runs fine on my computer

my problem statement SPOJ.com - Problem PRATA
my solution Coding Blocks IDE