Accepted: http://codeforces.com/contest/385/submission/5928271