Billboard

Given a 0/1 matrix, find the largest all-1 sub-rectangle after flipping at most s zeros and clearing at most r rows entirely.

Hard8Sliding windowTwo pointersBinary searchPrefix sumNo attempts yetTime limit2sMemory limit512 MB

Problem

"Hadoop Advertising Co." has been installing large LED billboards around the city for many years. A billboard is a rectangular array of LED diodes built from mm LED rows wired to a central controller board. One LED row is a thin circuit carrying nn LED diodes that act as the pixels.

The diodes are of low quality, so the company billboards now carry many dead diodes. You are the chief electronics engineer and the repair work is yours. The billboards are old and the stock of spare parts for each one is limited. There are two kinds of spare parts. One is a single LED diode that repairs one dead pixel, the other is an LED row that replaces a whole row of the billboard. Using one spare row makes every pixel of that row good, and using one spare diode makes one dead pixel good. On a single billboard you may use at most rr spare rows and at most ss spare diodes.

The company shows its advertisements on a sub-rectangle of the billboard that has no dead pixel and keeps the rest of the panel off. Compute the largest area you can make free of dead pixels with the spare parts.

Input

The input holds several test cases. The first line of a test case has four space separated non-negative integers: the number of rows mm, the number of LED diodes in each row nn, the number of spare rows rr, and the number of spare diodes ss. Each of the next mm lines describes one row of the billboard from top to bottom and holds nn space separated digits, 1 for a good pixel and 0 for a dead pixel. Both mm and nn are between 1 and 300 inclusive, rr is between 0 and 300 inclusive, and ss is between 0 and 90000 inclusive. There are at most 20 test cases and the sum of m×nm \times n over all of them is at most 90000. The last line of the input is 0 0 0 0 and is not processed.

Output

For each billboard print one line with the largest number of pixels in a sub-rectangle that holds no dead pixel after the repair.