Problem 4839. -- [Violet 6]蒲公英

4839: [Violet 6]蒲公英

Time Limit: 40 Sec  Memory Limit: 512 MB
Submit: 167  Solved: 44
[Submit][Status][Web Board]

Description

Input

Output

Sample Input

6 3
1 2 3 2 1 2
1 5
3 6
1 5

Sample Output

1
2
1

HINT

Source

[Submit][Status]