#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <typename T>
inline void umax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
inline void umin(T &a, T b) {
  a = min(a, b);
}
const long long N = 1e5 + 10;
const long long INF = 1e16 + 10;
const pair<long long, long long> NINF = make_pair(INF, INF);
const long double EPS = 1e-6;
const long long II = 1e9;
const long long MOD = 1e9 + 7;
long long n, second, len;
vector<long long> ar(N);
long long dp[N];
long long tree[N * 4], p[N * 4];
void pu(long long v, long long tl, long long tr) {
  umin(tree[v], p[v]);
  if (tl != tr) umin(p[v * 2], p[v]), umin(p[v * 2 + 1], p[v]);
  p[v] = INF;
}
void upd(long long l, long long r, long long val, long long v = 1,
         long long tl = 0, long long tr = n) {
  if (r < tl || l > tr) return;
  pu(v, tl, tr);
  if (l <= tl && tr <= r) return void(p[v] = val);
  long long tm = (tl + tr) >> 1LL;
  upd(l, r, val, v * 2, tl, tm);
  upd(l, r, val, v * 2 + 1, tm + 1, tr);
}
long long getat(long long idx, long long v = 1, long long tl = 0,
                long long tr = n) {
  if (idx < tl || idx > tr) return INF;
  pu(v, tl, tr);
  if (idx == tl && idx == tr) return tree[v];
  long long tm = (tl + tr) >> 1LL;
  return min(getat(idx, v * 2, tl, tm), getat(idx, v * 2 + 1, tm + 1, tr));
}
long long nxt[N];
void calcnxt() {
  long long r = 0;
  multiset<long long> buf;
  for (long long l = 0; l < (n); l++) {
    while (true) {
      if (r == n) break;
      if (buf.size()) {
        if (ar[r] - (*buf.begin()) > second) break;
        if ((*--buf.end()) - ar[r] > second) break;
      }
      buf.insert(ar[r++]);
    }
    if (r - l >= len) nxt[l] = r;
    buf.erase(buf.find(ar[l]));
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (long long i = 0; i < (N); i++) dp[i] = 0, nxt[i] = -1;
  for (long long i = 0; i < (N * 4); i++) tree[i] = p[i] = INF;
  cin >> n >> second >> len;
  ar.resize(n);
  for (long long i = 0; i < (n); i++) cin >> ar[i];
  calcnxt();
  upd(0, 0, 0);
  for (long long i = 0; i < (n); i++) {
    long long cur = getat(i);
    if (cur == INF || nxt[i] == -1) continue;
    if (i + len > n) break;
    upd(i + len, nxt[i], cur + 1);
  }
  long long ans = getat(n);
  if (ans == INF)
    cout << "-1\n";
  else
    cout << ans << endl;
}

### Prompt

In cpp, your task is to solve the following problem:

Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right.

Now Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:

  * Each piece should contain at least l numbers.
  * The difference between the maximal and the minimal number on the piece should be at most s.



Please help Alexandra to find the minimal number of pieces meeting the condition above.

Input

The first line contains three space-separated integers n, s, l (1 ≤ n ≤ 105, 0 ≤ s ≤ 109, 1 ≤ l ≤ 105).

The second line contains n integers ai separated by spaces ( - 109 ≤ ai ≤ 109).

Output

Output the minimal number of strip pieces.

If there are no ways to split the strip, output -1.

Examples

Input

7 2 2
1 3 1 2 4 1 2


Output

3


Input

7 2 2
1 100 1 100 1 100 1


Output

-1

Note

For the first sample, we can split the strip into 3 pieces: [1, 3, 1], [2, 4], [1, 2].

For the second sample, we can't let 1 and 100 be on the same piece, so no solution exists.

### Response

```cpp
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <typename T>
inline void umax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
inline void umin(T &a, T b) {
  a = min(a, b);
}
const long long N = 1e5 + 10;
const long long INF = 1e16 + 10;
const pair<long long, long long> NINF = make_pair(INF, INF);
const long double EPS = 1e-6;
const long long II = 1e9;
const long long MOD = 1e9 + 7;
long long n, second, len;
vector<long long> ar(N);
long long dp[N];
long long tree[N * 4], p[N * 4];
void pu(long long v, long long tl, long long tr) {
  umin(tree[v], p[v]);
  if (tl != tr) umin(p[v * 2], p[v]), umin(p[v * 2 + 1], p[v]);
  p[v] = INF;
}
void upd(long long l, long long r, long long val, long long v = 1,
         long long tl = 0, long long tr = n) {
  if (r < tl || l > tr) return;
  pu(v, tl, tr);
  if (l <= tl && tr <= r) return void(p[v] = val);
  long long tm = (tl + tr) >> 1LL;
  upd(l, r, val, v * 2, tl, tm);
  upd(l, r, val, v * 2 + 1, tm + 1, tr);
}
long long getat(long long idx, long long v = 1, long long tl = 0,
                long long tr = n) {
  if (idx < tl || idx > tr) return INF;
  pu(v, tl, tr);
  if (idx == tl && idx == tr) return tree[v];
  long long tm = (tl + tr) >> 1LL;
  return min(getat(idx, v * 2, tl, tm), getat(idx, v * 2 + 1, tm + 1, tr));
}
long long nxt[N];
void calcnxt() {
  long long r = 0;
  multiset<long long> buf;
  for (long long l = 0; l < (n); l++) {
    while (true) {
      if (r == n) break;
      if (buf.size()) {
        if (ar[r] - (*buf.begin()) > second) break;
        if ((*--buf.end()) - ar[r] > second) break;
      }
      buf.insert(ar[r++]);
    }
    if (r - l >= len) nxt[l] = r;
    buf.erase(buf.find(ar[l]));
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (long long i = 0; i < (N); i++) dp[i] = 0, nxt[i] = -1;
  for (long long i = 0; i < (N * 4); i++) tree[i] = p[i] = INF;
  cin >> n >> second >> len;
  ar.resize(n);
  for (long long i = 0; i < (n); i++) cin >> ar[i];
  calcnxt();
  upd(0, 0, 0);
  for (long long i = 0; i < (n); i++) {
    long long cur = getat(i);
    if (cur == INF || nxt[i] == -1) continue;
    if (i + len > n) break;
    upd(i + len, nxt[i], cur + 1);
  }
  long long ans = getat(n);
  if (ans == INF)
    cout << "-1\n";
  else
    cout << ans << endl;
}

```