eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків

Garage

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 \textbf{W}×\textbf{H} rectangle and you have to place some garages there. Garages are \textbf{w}×\textbf{h} rectangles and their edges must be parallel to the corresponding edges of the sandlot (you may not rotate garages, even by \textbf{90}°). The coordinates of garages may be non-integer. You know that the economy must be economical, so you decided to place as \textit{few} garages as possible. Unfortunately, there is an opposite requirement in the contract: placing 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. \InputFile The only line contains four integers: \textbf{W}, \textbf{H}, \textbf{w}, \textbf{h} --- dimensions of sandlot and garage in meters. You may assume that \textbf{1} ≤ \textbf{w} ≤ \textbf{W} ≤ \textbf{30000} and \textbf{1} ≤ \textbf{h} ≤ \textbf{H} ≤ \textbf{30000}. \OutputFile Output the optimal number of garages.
Ліміт часу 2 секунди
Ліміт використання пам'яті 256 MiB
Вхідні дані #1
11 4 3 2
Вихідні дані #1
2
Вхідні дані #2
10 8 3 4
Вихідні дані #2
2
Вхідні дані #3
15 7 4 2
Вихідні дані #3
4
Джерело ACM ICPC 2013–2014, NEERC, Northern Subregional Contest, St Petersburg, October 26, 2013