Way to solve UVA 11604 ?
What is the way to solve this problem ? UVA 11604
Codeforces Round 946 Solution Discussion