#499. [2009国家集训队]数据读取问题

[2009国家集训队]数据读取问题

Background

Special for beginners, ^_^

Description

image

Format

Input

image

Output

image

Samples

10
-1 2 2 3
0 0
2 3 4 5 6
1 1 7
0 2 8 9
1 1 10
0 0
0 0
0 0
0 0
1
1
1
1
1

Limitation

image