#include
<
stdio.h
>
#include
<
string
.h
>
![](/Images/OutliningIndicators/None.gif)
int
n, W, H, w, h;
int
m[
101
][
101
];
int
cnt;
![](/Images/OutliningIndicators/None.gif)
void
DP()
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
int i, j;
int c=0;
![](/Images/OutliningIndicators/InBlock.gif)
for(i=w;i<=W;i++)
for(j=h;j<=H;j++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
if(j==h)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
c=0;
int ii, jj;
for(ii=i-w+1;ii<=i;ii++)
for(jj=1;jj<=h;jj++)
if(m[ii][jj]==1)
c++;
if(cnt<c)
cnt=c;
}
else
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
int k;
for(k=i-w+1;k<=i;k++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
if(m[k][j-h]==1)
c--;
if(m[k][j]==1)
c++;
}
if(cnt<c)
cnt=c;
}
}
![](/Images/OutliningIndicators/InBlock.gif)
}
![](/Images/OutliningIndicators/None.gif)
int
main()
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
while(scanf("%d", &n)==1 && n)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
cnt=0;
memset(m,0,sizeof(m));
scanf("%d%d", &W, &H);
int i;
int x, y;
for(i=0;i<n;i++)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
scanf("%d%d", &x, &y);
m[x][y]=1;
}
scanf("%d%d", &w, &h);
DP();
printf("%d\n", cnt);
}
return 0;
}
转载于:https://www.cnblogs.com/SQL/archive/2007/10/21/932289.html