F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

ZCC loves Minecraft

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 125    Accepted Submission(s): 17


Problem Description

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.
 

Input
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
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.
 

Sample Input
5 0 0 0 5 3 3 1 1 2 -1
 

Sample Output
0 0 0 2 6
 

Hint
The blue areas in the following pictures represent point set S.
 

Author
Õòº£ÖÐѧ
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-12 09:12:42, Gzip enabled