QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 128 MB 満点: 10

#10635. Table [B]

統計

Bajtazar is buying furniture online. He has already found a nice table and a set of chairs. Now he is wondering how many chairs he can buy so that they all fit at the table.

The table has a rectangular top with dimensions $ A \times B $ centimeters. The seat of a chair, viewed from above, is a square with dimensions $ K \times K $ centimeters. We will treat the table as a rectangle and the chairs as squares.

There is a backrest along one of the edges of the seat (the square). Each chair must be placed with its backrest against the table, meaning the edge with the backrest must coincide with an edge of the table. Furthermore, the seat must be entirely under the tabletop. Naturally, no two chairs may overlap. In our considerations, we ignore the table legs (we can assume they are infinitely thin and located at the corners of the tabletop). How many chairs will fit under the table?

Input

The only line of input contains three integers $ A $, $ B $, and $ K $ ($1 \le A, B, K \le 500\,000\,000$) representing the dimensions of the tabletop and the dimension of the chair seat, respectively.

Output

Your program should output the maximum number of chairs that can fit at the table.

Examples

Input 1

15 18 4

Output 1

10

Note

The figure shows an example arrangement of chairs at the table. The backrests are marked with bold segments. It is not possible to place eleven chairs.

Input 2

12 8 4

Output 2

6

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.