#B3945. Count Big Numbers
Count Big Numbers
Count Big Numbers
SZM loves big numbers! You are given an array \(a\) of \(n\) integers and \(q\) operations. For the \(i\)-th operation, update the \(x_i\)-th element of the array to \(y_i\). After performing all operations, your task is to count the number of elements in the array that are greater than or equal to a given value \(V\).
Note: The array is 1-indexed.
Mathematical Formulation:
[ a = [a_1, a_2, \dots, a_n] ]
For each operation (i) ((1 \le i \le q)), perform:
[ a_{x_i} = y_i ]
After all operations, compute:
[ \text{ans} = |{ j \mid a_j \ge V, ; 1 \le j \le n }| ]
</p>inputFormat
The first line contains three integers \(n\), \(q\) and \(V\): the number of elements in the array, the number of operations, and the threshold value respectively.
The second line contains \(n\) integers representing the array \(a\).
Each of the next \(q\) lines contains two integers \(x_i\) and \(y_i\), indicating that the \(x_i\)-th element of \(a\) should be changed to \(y_i\).
It is guaranteed that the array uses 1-indexed numbering.
outputFormat
Output a single integer which is the count of numbers in the modified array that are greater than or equal to \(V\).
sample
5 3 10
5 10 15 3 8
1 11
3 2
5 20
3