Codechef.com problem. Description is in file.