A matrix of size M×N where M and N are integers that denote the number of rows and columns of the matrix respectively. The matrix contains integer elements only. You are given an integer P.
Write a program to determine the number of submatrices of this matrix such that the sum of all the elements of a submatrix is divisible by P.
Input format
Output format
Print the number of submatrices such that the sum of all the elements in those submatrices is divisible by P.
Constraints
1≤Elementineachcell≤200
1≤M,N,P≤200
There are 5 possible submatrices of the given matrix such that sum of elements is divisible by 2.