Function to check if there exists a path from the cell ( X , Y ) of the matrix to any boundary cell with sum of elements at most K or not
bool findPath ( vector < vector < int > > & board , int X , int Y , int M , int N , int K ) {