eolymp
bolt
Try our new interface for solving problems
Məsələlər

Innovative Business

Innovative Business

Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 256 MiB

Chip ’n’ Dale have started a new business in the forest: they produce tiles of fixed rectangular size and pave roads with them.

Road paving rules are the following. Starting from one corner of the rectangular road tiles are paved side-by-side without gaps or overlaps. Tiles can be cut into pieces to be used to pave the road if and only if the whole tile doesn’t fit. Each tile contains a pattern with parallel lines that must be retained on the paved road. This makes their orientation significant: any tile or its piece can not be rotated. All tile connection lines are straight, parallel to one of the road edges and either perpendicular or parallel to each other. Chip ’n’ Dale always pave the road so that each edge of a tile is adjacent to not more than one other tile, and they always pave the road with the least possible amount of tile pieces on the road.

Given the size of the road and the size of one tile please help Chip 'n' Dale determine the number of tiles they need to produce to fully pave the road.

Giriş verilənləri

On the first line of input integers Width_road and Length_road (1Width_road, Length_road10000) are given — the width and the length of the road respectively.

On the second line of input integers Width_tile and Length_tile (1Width_tileWidth_road, 1Length_tileLength_road) are given — the width and the length of the tile respectively.

Çıxış verilənləri

The first line of the output should contain a single integer number N — the minimal number of whole tiles needed to fully pave the road according to Chip 'n' Dale road paving rules.

Nümunə

Giriş verilənləri #1
10 10
2 2
Çıxış verilənləri #1
25
Mənbə ACM ICPC 2012-2013, NEERC, Moscow Subregion, Moscow, Sunday, October 21, 2012