12031 - Find the square   

Description

Given an N*M grid, does there exist a square of size X*X containing zeros only?

 

How to estimate the running time of your code?
A usual computer can run 109 basic operations (such as +, -, &, |) in 1 second. Althought this depends on the judging server, this number serves as a good estimation for the running time of your code. Try to figure out how much operations your code needs to execute to finish all the computations (since not all operations in your code are basic operations, another estimate criterion is 108 operations (+, -, *, /, =, ...) in 1 second)!

 

Input

First line contains 3 numbers N, M, X, with the meaning mentioned in problem description.

For the next N lines, each contains M integers which is either 0 or 1.

It is guaranteed that 1 <= N, M <= 120, 1 <= X <= min(N, M).

Output

If there is a square of size X*X, print "YES" (without quotes), otherwise print "NO" (without quotes).

Remember to print a '\n' at the end of output.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss