Rosetta Problems

JOI 国のお祭り事情 2 (Festivals in JOI Kingdom 2)

https://atcoder.jp/contests/joisp2023/tasks/joisp2023_b