UOJ Logo 黑暗爆炸OJ

DARKBZOJ

#4995. [Usaco2017 Feb]Why Did the Cow Cross the Road

统计 下载数据

Description

Input

Output

Sample Input

5 4
7
8
6
2
9
2 5
4 9
0 3
8 13

Sample Output

3

Hint

Source

Silver