2201 问题 A: Twin Buildings(H)

时间限制: 1s 内存限制: 256MB 提交: 14 解决: 5
题目描述

As you might already know, space has always been a problem in ICPC Jakarta. To cope with this, ICPC Jakarta is planning to build two new buildings. These buildings should have a shape of a rectangle of the same size. Now, their problem is to find land to build the buildings.

There are Nlands available for sale. The ith land has a rectangular shape of size Li×Wi  For a good feng shui, the building's side should be parallel to the land's sides.

One way is to build the two buildings on two different lands, one on each land (not necessarily with the same orientation). A building of size A×B can be build on the ith land if and only if at least one of the following is satisfied:

·   ALi and BWi  or

·   AWi and BLi .

Alternatively, it is also possible to build two buildings of A×Bon the ith land with the same orientation. Formally, it is possible to build two buildings of A×B on the ith land if and only if at least one of the following is satisfied:

·   A×2≤Li and BWi, or

·   A×2≤Wi and BLi, or

·   ALi and B×2≤Wi, or

·   AWi and B×2≤Li.

Your task in this problem is to help ICPC Jakarta to figure out the largest possible buildings they can build given N available lands. Note that ICPC Jakarta has to build two buildings of A×B; output the largest possible for A×B.


输入
Input begins with a line containing an integer: N (1N100000) representing the number of available lands. The next N lines each contains two integers: Li Wi (1Li,Wi109) representing the size of the land.
输出

Output in a line a number representing the largest building that ICPC Jakarta can build with exactly one decimal point (see sample input/output for clarity).

样例输入
2
5 5
3 4
样例输出
12.5
提示
零基础同学可以先学习视频课程,包含C/C++、Python、百练、蓝桥杯辅导、算法数据结构等课程,提供视频讲解以及配套习题,还有老师答疑,点击这里了解课程详情

比赛公告

题号:2201,2202,2203,2204,2205,2206,2207,2208,2209,2210

点击上方导航栏的训练,点击题库,寻找题号即可找到对应题目,比赛结束后,请通过训练->题库->寻找对应题目的方式做题

因为不确定因素太多,就不再安排大家轮流讲题了,大家做不出题可以在测试结束后去题库找对应的题目看题解,希望大家自觉练习,认真练习,考核测试会采取不同与现在测试的方式,两个月后综合测试成绩不达标者会退出实验室,希望大家认真对待