#P8856. [POI 2002 R1] 火车线路
[POI 2002 R1] 火车线路
Problem Description
A train departs from city and travels to city . The train has seats, and there are ticket booking requests.
Each booking request consists of three integers , meaning that seats are requested for the trip from station to station .
If there are enough available seats throughout the requested segment, then the request can be satisfied; otherwise, it cannot.
Process the requests in the given order, and determine whether each request can be satisfied.
Input Format
The first line contains three integers .
The next lines each contain three integers , describing one booking.
Output Format
For the -th booking, if it can be satisfied, output T, otherwise output N.
4 6 4
1 4 2
1 3 2
2 4 3
1 2 3
T
T
N
N
Hint
Constraints: .
Translated by ChatGPT 5