atcoder ABC007. codeeval 140.