2760Black Rectangle

2760   Black Rectangle

题目描述

  Dane use Black pen to draw rectangle on the white paper, each rectangle's width is 1 and it's height is h. Assume all the rectangles' bottom edges are on the same level. Please find the maximum rectangle which is full black.

输入格式:

  Input contains multiple test cases. Each case starts with an integer n(1 <= n <=10^5), the number of rectangles on the paper.

  The next n lines contains two integers each. x is the position and h is the height(1 <= x <= 10^5, 1 <= h <= 1000). Note x and x+1 is adjacent, and don't have the same x 

输出格式:

 For each test case, output the maximum area. 

输入样例 复制
4
1 10
3 3
4 3
5 3
3
1 3
2 4
3 4
输出样例 复制
10
9

说明

5
32
通过提交
时空限制3000ms/64mb
题目来源
评测方式在线评测
题目类型
难        度