First line: | number of deliveries k<=50 |
Next lines: | 2 numbers that determine a delivery, i.e. the floor sending and the floor receiving a package. |
For example: | 7 |
1 10 | |
3 2 | |
4 3 | |
6 7 | |
8 9 | |
3 4 | |
4 3 |
First line: | number m |
Next lines: | description of John's movements, which are described by
triples: bi, ei, di, where, bi - number of sending floor ei - number of receiving floor di - number of delivery, which package John has to carry from floor bi to floor ei. Number 0 (zero) means that John carries no package at this step. |