I was learning sqrt decomposition, to practise for the same i was solving http://www.spoj.com/problems/UNTITLE1/ problem on spoj, but i am continously getting SIGSEGV error for the same, i tried my level best to debug it but was unable to solve it,moreover there is no online reference for this particular problem,
i know the hopes of getting myself help is low but still if someone wanna help , here is my code http://ideone.com/jePYPu , i tried to make it as clean as possible.