P12935 [HackerEarth] grid count 1
普及
题目描述

The fight between Batman and Superman just got dirty. Superman tried to trick Batman and locked him inside an N x N grid. This gird is really special. It has values at each of its cell which is some positive integer.

Superman gave Batman a serious headache inside the grid. He gave him an integer K and ordered him to tell count of such K x K matrix which when summed equals a perfect cube. Only if Batman gives the correct answer will the grid open and let Batman out.

Batman being not so good at coding turns to you for help. Its time for you to prove that you are a real Batman Fan by helping him out.

Input:

The first line contains 2 integers N and K . This is followed up by an N x N matrix.

Output:

Print number of such K X K matrix whose sum is a perfect cube.

Constraints :

N ≤ 1000

K ≤ N

All values in matrix ≤ 10^9

SAMPLE INPUT
3 2
5 69 2
42 9 9
5 8 1

SAMPLE OUTPUT
3

Explanation

The 3: 2x2 matrices whose sum equals a perfect cube are:

(1,1) to (2,2)

(2,1) to (3,2)

(2,2) to (3,3)

输入格式

见题面

输出格式

见题面

样例输入
3 2 5 69 2 42 9 9 5 8 1 SAMPLE
样例输出
3