Codeforces Round #265 Problem E The Classic Problem