Codeforces ECR #091 : E. Merging Towers

割としんどいけど全完できた回。 https://codeforces.com/contest/1380/problem/E