#include <bits/stdc++.h>
using namespace std;
template <typename T>
void showArr(T *arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << ' ';
  puts("");
}
const int MAXP = 100007;
bool NotP[MAXP];
int Prime[MAXP], PrimeCnt;
void CalPrime() {
  memset(NotP, 0, sizeof(NotP));
  PrimeCnt = 0;
  for (int i = 2; i < MAXP; i++)
    if (!NotP[i]) {
      Prime[PrimeCnt++] = i;
      for (int j = i + i; j < MAXP; j += i) NotP[j] = true;
    }
}
long long Gcd(long long a, long long b) {
  if (b == 0LL) return a;
  return Gcd(b, a % b);
}
const int MAXSEG = 100007;
const int MODSEG = 1000000007;
pair<int, int> mxn[MAXSEG << 2];
int v[MAXSEG];
void BuildSegtree(int l, int r, int id) {
  if (l == r) {
    mxn[id].first = v[l];
    mxn[id].second = v[l];
    return;
  }
  int m = (l + r) >> 1;
  BuildSegtree(l, m, id << 1);
  BuildSegtree(m + 1, r, id << 1 | 1);
  mxn[id].first = max(mxn[id << 1].first, mxn[id << 1 | 1].first);
  mxn[id].second = min(mxn[id << 1].second, mxn[id << 1 | 1].second);
}
pair<int, int> QuerySegtree(int l, int r, int id, int ql, int qr) {
  if (ql <= l && qr >= r) {
    auto ret = mxn[id];
    return mxn[id];
  }
  int m = (l + r) >> 1;
  pair<int, int> ret = make_pair(-MODSEG, MODSEG);
  if (ql <= m) {
    auto retl = QuerySegtree(l, m, id << 1, ql, qr);
    ret.first = max(ret.first, retl.first);
    ret.second = min(ret.second, retl.second);
  }
  if (qr > m) {
    auto retr = QuerySegtree(m + 1, r, id << 1 | 1, ql, qr);
    ret.first = max(ret.first, retr.first);
    ret.second = min(ret.second, retr.second);
  }
  return ret;
}
const int MAXN = 100007;
const int MOD = 1000000007;
vector<int> vec[MAXN];
int ans[MAXN];
int main() {
  int n, s, l;
  while (~scanf("%d%d%d", &n, &s, &l)) {
    for (int i = 1; i <= n; i++) scanf("%d", v + i);
    BuildSegtree(1, n, 1);
    memset(ans, -1, sizeof(ans));
    for (int i = 0; i <= n; i++) vec[i].clear();
    auto cal = [&](int v, int p) {
      int pp =
          lower_bound(vec[v].begin(), vec[v].end(), p - l) - vec[v].begin();
      if (pp == vec[v].size() || vec[v][pp] > p - l) pp--;
      if (pp >= 0) {
        auto retp = QuerySegtree(1, n, 1, vec[v][pp] + 1, p);
        if (retp.first - retp.second <= s) {
          ans[p] = v + 1;
        }
      }
    };
    vec[0].push_back(0);
    int now = 0;
    for (int i = 1; i <= n; i++) {
      if (now > 0) cal(now - 1, i);
      if (ans[i] == -1) cal(now, i);
      now = max(now, ans[i]);
      if (ans[i] != -1) vec[ans[i]].push_back(i);
    }
    cout << ans[n] << endl;
  }
  return 0;
}

### Prompt

Please create a solution in CPP to 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>
using namespace std;
template <typename T>
void showArr(T *arr, int n) {
  for (int i = 0; i < n; i++) cout << arr[i] << ' ';
  puts("");
}
const int MAXP = 100007;
bool NotP[MAXP];
int Prime[MAXP], PrimeCnt;
void CalPrime() {
  memset(NotP, 0, sizeof(NotP));
  PrimeCnt = 0;
  for (int i = 2; i < MAXP; i++)
    if (!NotP[i]) {
      Prime[PrimeCnt++] = i;
      for (int j = i + i; j < MAXP; j += i) NotP[j] = true;
    }
}
long long Gcd(long long a, long long b) {
  if (b == 0LL) return a;
  return Gcd(b, a % b);
}
const int MAXSEG = 100007;
const int MODSEG = 1000000007;
pair<int, int> mxn[MAXSEG << 2];
int v[MAXSEG];
void BuildSegtree(int l, int r, int id) {
  if (l == r) {
    mxn[id].first = v[l];
    mxn[id].second = v[l];
    return;
  }
  int m = (l + r) >> 1;
  BuildSegtree(l, m, id << 1);
  BuildSegtree(m + 1, r, id << 1 | 1);
  mxn[id].first = max(mxn[id << 1].first, mxn[id << 1 | 1].first);
  mxn[id].second = min(mxn[id << 1].second, mxn[id << 1 | 1].second);
}
pair<int, int> QuerySegtree(int l, int r, int id, int ql, int qr) {
  if (ql <= l && qr >= r) {
    auto ret = mxn[id];
    return mxn[id];
  }
  int m = (l + r) >> 1;
  pair<int, int> ret = make_pair(-MODSEG, MODSEG);
  if (ql <= m) {
    auto retl = QuerySegtree(l, m, id << 1, ql, qr);
    ret.first = max(ret.first, retl.first);
    ret.second = min(ret.second, retl.second);
  }
  if (qr > m) {
    auto retr = QuerySegtree(m + 1, r, id << 1 | 1, ql, qr);
    ret.first = max(ret.first, retr.first);
    ret.second = min(ret.second, retr.second);
  }
  return ret;
}
const int MAXN = 100007;
const int MOD = 1000000007;
vector<int> vec[MAXN];
int ans[MAXN];
int main() {
  int n, s, l;
  while (~scanf("%d%d%d", &n, &s, &l)) {
    for (int i = 1; i <= n; i++) scanf("%d", v + i);
    BuildSegtree(1, n, 1);
    memset(ans, -1, sizeof(ans));
    for (int i = 0; i <= n; i++) vec[i].clear();
    auto cal = [&](int v, int p) {
      int pp =
          lower_bound(vec[v].begin(), vec[v].end(), p - l) - vec[v].begin();
      if (pp == vec[v].size() || vec[v][pp] > p - l) pp--;
      if (pp >= 0) {
        auto retp = QuerySegtree(1, n, 1, vec[v][pp] + 1, p);
        if (retp.first - retp.second <= s) {
          ans[p] = v + 1;
        }
      }
    };
    vec[0].push_back(0);
    int now = 0;
    for (int i = 1; i <= n; i++) {
      if (now > 0) cal(now - 1, i);
      if (ans[i] == -1) cal(now, i);
      now = max(now, ans[i]);
      if (ans[i] != -1) vec[ans[i]].push_back(i);
    }
    cout << ans[n] << endl;
  }
  return 0;
}

```