编程练习,基础2201: Twin Buildings(H)题解

一点都不欢乐 算法基础篇 77 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
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. 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.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:. · A≤Wi and B≤Li .to build two buildings of A×Bon the ith land with the same orientation. Formally, it is possible to build two. 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.

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: ·   A≤Li and B≤Wi  or ·   A≤Wi and B≤Li . 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 B≤Wi, or ·   A×2≤Wi and B≤Li, or ·   A≤Li and B×2≤Wi, or ·   A≤Wi 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.

编程练习,基础2201: Twin Buildings(H)题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: 编程练习 基础2201: Twin Buildings(H)题解