|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||256 MB||2||2||2||100.000%|
Once upon a time, Nikita was relaxing at home and watching a Christmas garland. The light bulbs were flickering following some strange pattern.
Let us formalize the garland's description. It consists of $n$ colored light bulbs. Every light bulb is either on or off at any moment. Initially, all of them are off.
Sometimes all light bulbs of one color change their states to the opposite. After each such change, Nikita wants to know the number of maximal non-empty continuous segments of lit bulbs. A lit segment is maximal if it is not contained in any other lit segment.
The first line contains integers $n$, $k$ and $q$: the number of light bulbs, the number of different colors and the number of changes of the garland ($1 \le n, q \le 2 \cdot 10^5$, $1 \le k \le n$).
The second line contains $n$ integers $c_1, c_2, \ldots, c_n$: the colors of light bulbs in the garland ($1 \le c_i \le k$).
Next $q$ lines describe changes of the garland in the order they happened. Each of these lines contains an integer $d_i$, the color of light bulbs which have just changed their states ($1 \le d_i \le k$).
The output must contain $q$ lines. The $i$-th line must contain one integer: the number of maximal continuous segments of lit bulbs after $i$-th change.
3 2 5 1 2 1 1 2 1 2 2
2 1 1 0 1