Long time no see 思考题!
Allow me to cut through those words!
Have you ever played Danganronpa? It’s a game which allows you to cut through others words by exposing lies. Our adorable swordsman Ookami decides to try it too!
There are N words Ookami needs to cut. They will appear in a plane as rectangles. The i-th one will appear at second
In every moment, Ookami can choose one of the following lines and damage all rectangles that intersect with it(include boundaries) and doing this will cost her 1 energy.
What’s the minimal number of energy Ookami has to spend to kill all rectangles?
Please note that:
- A rectangle will die when its health is 0
- Ookami can cut multiple times in a single moment even with different lines.
- She doesn’t need to cut them at integer seconds.
For all tests,