BuildingsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Problem Description
Your current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building with walls to make apartments in the shape of a rectangle. Each built wall must be paralled to the building's sides.
The floor is represented in the ground plan as a large rectangle with dimensions rev=2.4-beta-2" alt="" style="">, rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> located rev=2.4-beta-2" alt="" style=""> and rev=2.4-beta-2" alt="" style=""> must rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> square rev=2.4-beta-2" alt="" style="">. rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style="">.
Input
There are at most
rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> testcases. rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style="">.
Output
For each testcase, print only one interger, representing the answer.
Sample Input
Sample Output
Source
解题思路:
假设没有不合法的块,那结果就是长和宽中最小值的一半,而,不合法的块所影响的仅仅有它周围的四块,计算出这四块距离四个边的距离的最小值,就是加入上不合法块之后该块所须要的最长距离。 须要注意特判一中情况。即不合法块在正中间的时候,并不造成影响。 #include <iostream> |
相关文章
- 12-192015 多校联赛 ——HDU5302(矩阵快速幂)
- 12-19HDU6602 Longest Subarray hdu多校第二场 线段树
- 12-19HDU6962 I Love Tree(2021HDU多校第二场1002)(线段树区间加幂和模型+树链剖分)
- 12-192020hdu多校第二场1001Total Eclipse
- 12-192015 多校联赛 ——HDU5375(dp)
- 12-19[2015hdu多校联赛补题]hdu5302 Connect the Graph
- 12-19[2015hdu多校联赛补题]hdu5384 Danganronpa
- 12-19[2015hdu多校联赛补题]hdu5371 Hotaru's problem
- 12-19[2015hdu多校联赛补题]hdu5299 Circles Game
- 12-19[2015hdu多校联赛补题]hdu5378 Leader in Tree Land