Under construction

Still being built. Things may change

BB-8 Repair

Time limit2sMemory limit1024 MB

Summary
Given a plate of height a and width b and a hole of height h and width w, find the fewest plates needed to cover the hole.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

BB-8 found a huge rectangular hole in the hull of one of the ships. BB-8 is a very responsible droid, so it has to patch the hole.

BB-8 repairs the hole with rectangular plates. A plate has height aa and width bb. Plates cannot be rotated, so each plate's height and width are fixed. The hole has height hh and width ww. Plates may overlap each other and may cover space outside the hole.

BB-8 wants to use as few plates as possible. Find the minimum number of plates needed to cover the hole.

Input

The only line contains four integers aa, bb, hh, ww (1≤a,b,h,w≤10001 \le a,b,h,w \le 1000): the height and width of a plate, then the height and width of the hole.

Output

Print the minimum number of plates needed to repair the hole.

Examples3

  1. Example 1

    Input
    1 1 3 3
    
    Expected output
    9
    
  2. Example 2

    Input
    2 1 3 2
    
    Expected output
    4
    
  3. Example 3

    Input
    5 6 1 1
    
    Expected output
    1