Problem A
Points of Snow
Lineland is an infinitesimal country primarily known for its 1-dimensional layout. However, it is also true that Lineland provides some truly excellent skiing opportunities for beginners.
You are running a snow depth information service that answers queries about how deep the snow is at various locations in Lineland. As your service is becoming increasingly popular, you realize that the traditional way of answering queries (i.e. by going on a ski trip to make a manual measurement) does not scale.
In order to speed things up, you made a deal with the national wheather forcaster. They have agreed to give you notice whenever snow falls or melts away across different strecthes of the country. What remains is to write a program that can answer incoming queries from the public automatically, provided the information from the wheather forcaster.
Input
The first line contains three integers
The
If
The snow level will at no point in time nor space be
negative, e.g. for every location
Output
Output
Sample Input 1 | Sample Output 1 |
---|---|
10 4 2 ! 0 6 3 ! 3 9 5 ? 6 ! 2 7 -2 ! 5 7 1 ? 7 |
8 4 |