P29518 [洛谷] [NWRRC2013] Garage
普及
题目描述

Problem Description

You have a large rectangle of dimensions $W \times H$. You also have an infinite supply of smaller rectangles of dimensions $w \times h$. Your task is to determine the minimum number of smaller rectangles that can be placed inside the large rectangle such that no more smaller rectangles can be added without overlapping or rotating any of the placed rectangles.

All smaller rectangles must be placed without overlapping and without rotation.

Problem Description

Wow! What a lucky day! Your company has just won a social contract for building a garage complex. Almost all formalities are done: contract payment is already transferred to your account.

So now it is the right time to read the contract. Okay, there is a sandlot in the form of a $W \times H$ rectangle and you have to place some garages there. Garages are $w \times h$ rectangles and their edges must be parallel to the corresponding edges of the sandlot (you may not rotate garages, even by $90^\circ$). The coordinates of garages may be non-integer.

You know that the economy must be economical, so you decided to place as few garages as possible. Unfortunately, there is an opposite requirement in the contract: placing the maximum possible number of garages.

Now let's see how these requirements are checked... The plan is accepted if it is impossible to add a new garage without moving the other garages (the new garage must also have edges parallel to corresponding sandlot edges).

Time is money, find the minimal number of garages that must be ordered, so that you can place them on the sandlot and there is no place for an extra garage.

Input Format

The only line contains four integers: $W, H, w, h$ -- dimensions of the sandlot and garage in meters. You may assume that $1 \le w \le W \le 30,000$ and $1 \le h \le H \le 30,000$.

Output Format

Output the optimal number of garages.

Sample Input and Output

Sample Input #1

11 4 3 2

Sample Output #1

2

Sample Input #2

10 8 3 4

Sample Output #2

2

Sample Input #3

15 7 4 2

Sample Output #3

4

Notes/Hints

Time limit: 2 seconds, Memory limit: 256 MB.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
11 4 3 2
样例输出
2