My solution of http://acm.timus.ru/ challanges