#include int a,b,c,d,e,f,m1,m2,m3,m4,m; int r(int x, int y) { int sum=0; if(x>e) return -1; if(y>f) return -1; if(x