B - Explore
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 200 points
Problem Statement
Takahashi is exploring a cave in a video game.
The cave consists of N rooms arranged in a row. The rooms are numbered Room from the entrance.
Takahashi is initially in Room 1, and the time limit is T.
For each , he may consume a time of
to move from Room i to Room
. There is no other way to move between rooms. He cannot make a move that makes the time limit 0 or less.
There are M bonus rooms in the cave. The i-th bonus room is Room