Problem3194--【Div2】动态规划练习 - 零和路径(多样例)

3194: 【Div2】动态规划练习 - 零和路径(多样例)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description



Sample Input Copy

5
1 1
1
1 2
1 -1
1 4
1 -1 1 -1
3 4
1 -1 -1 -1
-1 1 1 -1
1 1 1 -1
3 4
1 -1 1 1
-1 1 -1 1
1 -1 1 1

Sample Output Copy

NO
YES
YES
YES
NO

Source/Category