Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

A. Increasing Sequence

time limit per test

1 secondmemory limit per test

64 megabytesinput

standard inputoutput

standard outputA sequence *a*_{0}, *a*_{1}, ..., *a*_{t - 1} is called increasing if *a*_{i - 1} < *a*_{i} for each *i*: 0 < *i* < *t*.

You are given a sequence *b*_{0}, *b*_{1}, ..., *b*_{n - 1} and a positive integer *d*. In each move you may choose one element of the given sequence and add *d* to it. What is the least number of moves required to make the given sequence increasing?

Input

The first line of the input contains two integer numbers *n* and *d* (2 ≤ *n* ≤ 2000, 1 ≤ *d* ≤ 10^{6}). The second line contains space separated sequence *b*_{0}, *b*_{1}, ..., *b*_{n - 1} (1 ≤ *b*_{i} ≤ 10^{6}).

Output

Output the minimal number of moves needed to make the sequence increasing.

Examples

Input

4 2

1 3 3 2

Output

3

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Nov/20/2017 03:11:14 (p1).

Desktop version, switch to mobile version.

User lists

Name |
---|