#P4818. Photo to Remember
Photo to Remember
Photo to Remember
题面翻译
某一天,n个朋友在一起聚会,他们已经很久没见了,于是他们决定拍照留念。
简单的说,拍照的时候,每个人有一个高度和宽度,第i个的高度和宽度分别是hi和wi。这些人排成一条直线,照片的最小的面积必须包含所有的的人,所以照片的面积是W*H,W是所有人的宽度之和,H是所有人中高度最高的那个人的高度。现在想要知道当第i个人不在照片中的时候,照片的最小面积是多少。
输入
第一行是一个正整数N,表示人的数量。
接下来N行,每行两个整数wi和hi,分别表示每个人的宽度和高度。
数据范围:2<=N<=200000,1<=wi<=10,1<=hi<=1000。
输出
包含b1,b2,b3。。Bn,bi表示第i个人不在照片中的时候,照片的最小面积。
题目描述
One day friends met at a party, they hadn't seen each other for a long time and so they decided to make a group photo together.
Simply speaking, the process of taking photos can be described as follows. On the photo, each photographed friend occupies a rectangle of pixels: the -th of them occupies the rectangle of width pixels and height pixels. On the group photo everybody stands in a line, thus the minimum pixel size of the photo including all the photographed friends, is , where is the total sum of all widths and is the maximum height of all the photographed friends.
As is usually the case, the friends made photos — the -th ( ) photo had everybody except for the -th friend as he was the photographer.
Print the minimum size of each made photo in pixels.
输入格式
The first line contains integer ( ) — the number of friends.
Then lines follow: the -th line contains information about the -th friend. The line contains a pair of integers ( ) — the width and height in pixels of the corresponding rectangle.
输出格式
Print space-separated numbers , where — the total number of pixels on the minimum photo containing all friends expect for the -th one.
样例 #1
样例输入 #1
3
1 10
5 5
10 1
样例输出 #1
75 110 60
样例 #2
样例输入 #2
3
2 1
1 2
2 1
样例输出 #2
6 4 6