SPOJ Problem Solutions