# TopCoder

\begin{align} AC \times 2^9 \\ \text{New TIOJ ?} \end{align}

96.7% (29/30)

38.4% (98/255)

# Input Format

17%，$1 \leq N \leq 10; M = 0; X_i,Y_i \leq 10; \prod_{i=0}^ {N-1} X_i \leq 1000$
17%，$1 \leq N \leq 1000; 0 \leq M \leq 1000$
20%，$1 \leq N \leq 500000; 0 \leq M \leq 100000;$ 所有更新X和X[i]都大於等於2。
23%，$1 \leq N \leq 500000; 0 \leq M \leq 10000$
23%，$1 \leq N \leq 500000; 0 \leq M \leq 100000$

100%，$1 \leq X_i,Y_i \leq 10^ 9$

# Sample Input

2
1
2
3
0
10
10 10 10 10 10 10 1 1 1 1
1 1 1 1 9 5 4 7 3 2
5
1 5 1
2 5 123456789
1 5 1
1 8 987654321
1 9 777777777

6
7000000
900000
678813585
678813585
294225928
75803567

# Problem Source

IOI 2015 Day 2
Problem set by Yihda Yol
Description by 果茶