SPOJ LISA : All done. Next convert to spoj format and long long int for size issues.