Rosetta Problems

Many Segments 2

https://atcoder.jp/contests/abc377/tasks/abc377_d