100.0% (9/9)

76.9% (10/13)

# Sample Input

5 16
7 7 7 7 0 1 0 0 2 2 0 0 0 2 2 0
0 0 0 7 0 1 0 2 0 0 2 0 2 0 0 2
0 0 7 0 0 1 0 0 0 2 0 0 0 0 2 0
0 7 0 0 0 1 0 0 2 0 0 0 0 2 0 0
0 7 0 0 0 1 0 2 2 2 2 0 2 2 2 2

4

# Hints

7 7 7 7 0 1 0 0 2 2 0 0 0 2 2 0
0 0 0 7 0 1 0 2 0 0 2 0 2 0 0 2
0 0 7 0 0 1 0 0 0 2 0 0 0 0 2 0
0 7 0 0 0 1 0 0 2 0 0 0 0 2 0 0
0 7 0 0 0 1 0 2 2 2 2 0 2 2 2 2

# Problem Source

Problem Set By oToToT