Under construction

Still being built. Things may change

BORDER

Interview

Time limit1sMemory limit1024 MB

Summary
Given rectangle sides a and b and strips of length k, find the minimum number of strips to cover the border when each side gets at most one piece from any cut strip.
Level

Medium4 of 10

Topics
Greedy, Math, Implementation
Solved
No attempts yet

Problem

Each of the four sides of a rectangular sheet of paper with length aa centimeters and width bb centimeters must be covered with strips of glossy paper to form a border. You have enough strips, and each strip has length kk centimeters. A strip may be used whole or cut into several pieces, as long as the length of every piece is an integer.

At most one piece of a cut strip may be glued onto each side of the sheet.

Write a program border that finds the minimum number of strips needed to cover the sheet.

Input

The first line of standard input contains three integers aa, bb, and kk, separated by a single space. aa is the length of the rectangular sheet, bb is its width, and kk is the length of one strip.

Output

On a single line of standard output, print one integer: the minimum number of strips needed to form the border.

Constraints

  • 1≤a,b,k≤100 0001 \le a, b, k \le 100\,000

Examples3

  1. Example 1

    Input
    56 14 7
    
    Expected output
    20
    
  2. Example 2

    Input
    33 41 8
    
    Expected output
    19
    
  3. Example 3

    Input
    68 49 10
    
    Expected output
    24