Codeforces Round #731 Solution Stream (finished)