#include #include using namespace std; int main() { ifstream in; ofstream out; in.open("heritage.in"); out.open("heritage.out"); int m,n,k; in>>n>>m>>k; int res=-1; int A[n][m]; for(int i=0;i>A[i][t]; } for(int g=1;g<=k;g++) { if(k%g==0) { int a=g; int b=k/g; //cout<res) res = sum; } } } } out<