#include using namespace std; using ll = long long; using ld = long double; #define fi first #define se second #define pb push_back int main(){ int w,h,x,copyx; cin>>w>>h>>x; copyx=x; if(x>36){ cout<<-1<9){ cout<<-1<=9){ p[i]=9; x-=9; } else{ p[i]=x; x=0; } } x=copyx; for(int i=0;i=h||l<0||l>=w){ continue; } s+=ans[k][l]; } } if(s!=x){ cout<<-1<