#C1064. Minimal Change Sequence

    ID: 39867 Type: Default 1000ms 256MiB

Minimal Change Sequence

Minimal Change Sequence

You are given three integers a, b, and d. Your task is to calculate the minimum number of steps required to transform a into b. In each step, you are allowed to change the current value by at most d (either increasing or decreasing it).

Mathematically, let \( \Delta = |a - b| \). The minimum number of steps required is given by \[ \lceil \Delta / d \rceil \] which rounds up the division of \(\Delta\) by d.

For example, if a = 5, b = 10 and d = 2, then \(\Delta = 5\) and the answer is \(\lceil 5/2 \rceil = 3\).

inputFormat

The input consists of a single line containing three space-separated integers a, b, and d.

outputFormat

Output a single integer, which is the minimum number of steps required to transform a into b under the constraint that each step can change the value by at most d.

## sample
5 10 2
3