#2353. C++-春游

C++-春游

Background

Description

image

image

Format

Input

Output

Samples

3 3 
0 2 1
3
3 5 
0 0 0 0 0
1 2

Limitation

1s, 1024KiB for each test case.