Java implementation of the above approach
import java . io . * ; class GFG { public static int maxPro ( int [ ] [ ] a , int n , int m , int k ) { int maxi = 1 , mp = 1 ; for ( int i = 0 ; i < n ; ++ i ) {