Codeforces Beta Round #34 Problem CDE