10 5
1 1000 990 800 3 3 3 8 10 1000000000
10 1000000000
5 988
1 1000000000
6 0
6 1
