http://www.spoj.com/problems/classical/sort=-6 Solutions to these problems are available here,most of them being coded in JAVA and used C++ for few problems where JAVA gives TLE