当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

4877:ZCC loves Minecraft

题目描述

ZCC loves playing Minecraft, a sandbox construction game, with his friends. Each friend built his own house, which can be regarded as a point in a plane. However, their houses are so dispersed that they often get attacked by monsters on the way to others' houses. Fortunately, monsters won't come into being in the bright areas. ZCC planned to light a point set S up, through which his friends can visit each other safely. S should include every house. For the convenience of transport, the intersection of S and an arbitrary horizon or vertical line should be empty, a point, or a single continuous segment. This definition is similar to the definition of convex hull, but the line can only be horizon or vertical here because everything in Minecraft is formed by cubes. ZCC also wanted to minimize the area of S to save money.
After working hard for a long time, ZCC obtained the solution. However, as ZCC became more and more famous, the number of his friends increased sharply. Every time a new friend joins the game, ZCC have to calculate S again. He needs your help.
Notice that S may not be continuous, but it's guaranteed that S is continuous at any time. The situation of the following figure will never occur.
输入解释
The input contains several test cases.
Each test case contains n+1 lines.
A integer N(1≤N≤100000) will exist in the first line of each input,which represents the number of friends.
The i-th (2≤i≤n+1) line contains two integers x,y (-100000≤x,y≤100000),which represent the coordinate of the i-1-th friend.
输出解释
Output should contain n lines.
The i-th line is a number that is the area of S after the i-th friend joins the game.
输入样例
5
0 0
0 5
3 3
1 1
2 -1
输出样例
0
0
0
2
6

提示
The blue areas in the following pictures represent point set S.
来自杭电HDUOJ的附加信息
Author 镇海中学
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4877

最后修改于 2020-10-25T23:17:41+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 32768/32768K(Java/Others)