Rosetta Problems

Hat Puzzle

https://atcoder.jp/contests/wtf22-day2/tasks/wtf22_day2_a