📄 2014.txt
字号:
#include<stdio.h>
#include<string.h>
#define debug 0
#define NMAX 1026
int a[NMAX][NMAX];
int main()
{
#if debug
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
int x,y;
int maxx;
int maxy;
int wide;
int a,b;
scanf("%d",&wide);
while(wide)
{
a=0;b=0;
maxy=0;
maxx=0;
scanf("%d%d",&x,&y);
while(x!=-1)
{
if(a+x<=wide)
{
a+=x;
if(a>maxx)
maxx=a;
if(b+y>maxy)
maxy=b+y;
}
else
{
a=0;
b=maxy;
continue;
}
scanf("%d%d",&x,&y);
}
printf("%d x %d\n",maxx,maxy);
scanf("%d",&wide);
}
#if debug
fclose(stdin);
fclose(stdout);
#endif
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -