Rosetta Problems

手持ち花火 (Sparklers)

https://atcoder.jp/contests/joisc2017/tasks/joisc2017_c