XXII Open Cup, Grand Prix of China (EC-Finals)
How to solve task C and G?
Codeforces Round 1123 Solution Discussion