Function to find the number of ways to cut the matrix into the K parts such that each part have atleast one filled cell
int ways ( vector < vector < int > > & arr , int K ) { int R = arr . size ( ) ; int C = arr [ 0 ] . size ( ) ; int preSum [ R ] [ C ] ;