My approach for 1771F
https://pt13762104.github.io/Codeforces_1771F_optimization.pdf
Leetcode Weekly 498 Solution Discussion