BB-8 Repair
Time limit2sMemory limit1024 MB
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 and width . Plates cannot be rotated, so each plate's height and width are fixed. The hole has height and width . 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 , , , (): 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.