CF431E Chemistry Experiment
Description
One day two students, Grisha and Diana, found themselves in the university chemistry lab. In the lab the students found $ n $ test tubes with mercury numbered from $ 1 $ to $ n $ and decided to conduct an experiment.
The experiment consists of $ q $ steps. On each step, one of the following actions occurs:
1. Diana pours all the contents from tube number $ p_{i} $ and then pours there exactly $ x_{i} $ liters of mercury.
2. Let's consider all the ways to add $ v_{i} $ liters of water into the tubes; for each way let's count the volume of liquid (water and mercury) in the tube with water with maximum amount of liquid; finally let's find the minimum among counted maximums. That is the number the students want to count. At that, the students don't actually pour the mercury. They perform calculations without changing the contents of the tubes.
Unfortunately, the calculations proved to be too complex and the students asked you to help them. Help them conduct the described experiment.
Input Format
N/A
Output Format
N/A