Buildings
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 n×m, where each apartment is a smaller rectangle with dimensions a×b located inside. For each apartment, its dimensions can be different from each other. The number a and b must be integers.
Additionally, the apartments must completely cover the floor without one 1×1 square located on (x,y). The apartments must not intersect, but they can touch.
For this example, this is a sample of n=2,m=3,x=2,y=2.
To prevent darkness indoors, the apartments must have windows. Therefore, each apartment must share its at least one side with the edge of the rectangle representing the floor so it is possible to place a window.
Your boss XXY wants to minimize the maximum areas of all apartments, now it's your turn to tell him the answer.
Input
There are at most 10000 testcases.
For each testcase, only four space-separated integers, n,m,x,y(1≤n,m≤108,n×m>1,1≤x≤n,1≤y≤m).
Output
For each testcase, print only one interger, representing the answer.
Sample Input
2 3 2 2
3 3 1 1
Sample Output
1
2
- 点赞
- 写回答
- 关注问题
- 收藏
- 复制链接分享
- 邀请回答
1条回答
为你推荐
- PHP - 两个数组之间的计算 - 键和值
- php
- arrays
- 1个回答
- 在用户模型中使用whereHas获取用户相关的建筑物
- sql
- php
- laravel
- mysql
- 1个回答
- Jquery 1 id具有更多图像并更改所有图像宽度/高度/位置
- css
- html
- php
- javascript
- jquery
- 1个回答
- 在第二个参数中使用DB :: raw()时的不同值where()
- php
- laravel
- orm
- 1个回答
- PHP警告:include(C:\ xampp \ htdocs \ hse \ vendor \ composer /../../ app / Buildings.php):无法打开流
- php
- laravel
- mysql
- 3个回答
- Buildings
- it
- each
- x
- as
- square
- 1个回答
- Crank
- each
- c
- lines
- 地图
- as
- 1个回答
- Housing Complexes
- 市场
- string
- lines
- character
- square
- 1个回答
- Evacuation Plan
- Golang
- lines
- bi
- word
- as
- 1个回答
- MagicBuilding
- numbers
- each
- mathematica
- clustering
- square
- 1个回答
- Crossed ladders
- numbers
- each
- 2个回答
- City Horizon
- horizon
- lines
- 2个回答
- Crossed Matchings
- each
- 1个回答
- Power Cable Problem
- lines
- 1个回答