My code is working fine for all the testcases in ideone and in mageia.... but when i submit in spoj it shows SIGABRT error...MY soln link :-- ideone.com/v0KuYLQuestion link :-- spoj.com/problems/SPCS/Thnx in advance for correction ....