Codeforces Beta Round #24 Problem ABCDE