#include using namespace std; #define rep(i,x,y) for(int i=x;i>N>>M>>K; int A[N][M]; rep(i,0,N){ rep(j,0,M) cin>>A[i][j]; } int dp[N+1][K+1]={}; rep(i,1,N+1)rep(k,0,K+1) dp[i][k]=-1; rep(i,1,N+1)rep(k,0,K+1){ int res=-1; rep(j,0,M){ if(k