Codeforces Testing Round #2 Problem D Two progressions