UOJ Logo 黑暗爆炸OJ

DARKBZOJ

#1519. [POI2006]Ork-Ploughing

Statistics 下载数据

Description

Input

Output

一个整数表示最少的耕种次数

Sample Input

12 6 4
6 0 4 8 0 5
0 4 5 4 6 0
0 5 6 5 6 0
5 4 0 0 5 4

Sample Output

8


The illustration above shows the optimal ploughing of the field from the example.

Hint

Source