problem link : https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=6083
my solution : vrUUHp - Online C++0x Compiler & Debugging Tool - Ideone.com
it is simple brute force but i didn’t able to figure out why my solution gives runtime error (:
please help !