Monsters (hard version)

Problem Name:
Monsters (hard version)
Site:CodeForces
Links:
Tags:
Problem setters: