20 10 1 1 10 2 6 2 12 1 5 12 2 6 2 15 1 6 16 1 11 17 2 12 2 6
1 0 0 0 1 1
50%的数据满足:1<=n<=1,000,1<=m<=10,000 100%的数据满足:1<=n<=100,000,1<=m<=500,000