there nm rectangular grid cell grid contain single integer zero Lets cell ith row jth column ijlet define rectangle integer abcd 1acn1bdm rectangle denote set cell grid xyaxcbyd Lets define good rectangle rectangle include cell zerosYou answer follow q query calculate number good rectangle cell give rectangle