vector<int> area;

int n=height.size();

for(int len=1;len<=n;++len)

{

```
for(int j=0;j<n-len+1;++j)
{
int larea=0;
int minh=height.at(j);
for(int i=0;i<len;++i)
{
if(height.at(j+i)<minh)
minh=height.at(j+i);
}
area.push_back(minh*len);
cout<<minh*len<<endl;
}
```

}

int max=area.at(0);

for(int i=0;i<area.size();++i)

{

```
if(area.at(i)>max)
max=area.at(i);
```

}

cout<<max<<endl;

return max;