There is plenty of monster invade rainbow land through a portal. After close the portal, Rubick, the great magician, give you a magic bar that can kill the monster. Now, the monster walk as a queue to attack you.
Here, the monster labeled from 1 to $n$ (it won't be changed). The magic bar has a initial mana $m$, every time you use the magic bar, the magic bar's mana while add by 1. If you use the magic bar, the magic bar will kill the monster which stand inthe $m$-th, $2m$-th, $3m$-th... in the queue.
After some times of using, there will some monster that you can't kill. Tell the label of every monster to the Rubick, and he will help you to kill them.