#include <bits/stdc++.h>
using namespace std;
template <class T>
void pr(const string& name, T t) {
  cerr << name << ": " << t << endl;
}
template <typename T, typename... Types>
void pr(const string& names, T t, Types... rest) {
  auto comma_pos = names.find(',');
  cerr << names.substr(0, comma_pos) << ": " << t << ", ";
  auto next_name_pos = names.find_first_not_of(" \t\n", comma_pos + 1);
  pr(string(names, next_name_pos), rest...);
}
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& v) {
  return o << "(" << v.first << ", " << v.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  for (int i = 0; i < (int)((int)((v).size())); ++i)
    o << (i ? ", " : "") << v[i];
  return o << "}";
}
template <class T = long long>
struct AddMaxRangeSeg {
  const int MAX_N;
  vector<T> dseg, maxseg;
  AddMaxRangeSeg(int n) : MAX_N(n), dseg(n << 2), maxseg(n << 2){};
  inline void add(int ql, int qr, int cl, int cr, int k, T v) {
    if (qr <= cl || cr <= ql) return;
    if (ql <= cl && cr <= qr) {
      dseg[k] += v;
      maxseg[k] += v;
      return;
    }
    add(ql, qr, cl, (cl + cr) / 2, k * 2 + 1, v);
    add(ql, qr, (cl + cr) / 2, cr, k * 2 + 2, v);
    maxseg[k] = max(maxseg[k * 2 + 1], maxseg[k * 2 + 2]) + dseg[k];
  }
  inline T get(int ql, int qr, int cl, int cr, int k) {
    if (qr <= cl || cr <= ql) return numeric_limits<T>::min();
    if (ql <= cl && cr <= qr) return maxseg[k];
    return max(get(ql, qr, cl, (cl + cr) / 2, k * 2 + 1),
               get(ql, qr, (cl + cr) / 2, cr, k * 2 + 2)) +
           dseg[k];
  }
  inline void setv(int idx, T v) {
    T t = get(idx, idx + 1, 0, MAX_N, 0);
    add(idx, idx + 1, 0, MAX_N, 0, -t);
    add(idx, idx + 1, 0, MAX_N, 0, v);
  }
  inline T get(int idx) { return get(idx, idx + 1, 0, MAX_N, 0); }
  inline T get(int a, int b) { return get(a, b, 0, MAX_N, 0); }
  inline void add(int idx, T v) { add(idx, idx + 1, 0, MAX_N, 0, v); }
  inline void add(int a, int b, T v) { add(a, b, 0, MAX_N, 0, v); }
};
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, s, l;
  cin >> n >> s >> l;
  AddMaxRangeSeg<int> maxv(n), minv(n), dp(n);
  for (int i = 0; i < (int)(n); ++i) {
    int a;
    cin >> a;
    maxv.setv(i, a);
    minv.setv(i, -a);
  }
  dp.add(0, n, -(1 << 30));
  for (int i = 0; i < (int)(n); ++i) {
    if (i < l - 1) continue;
    long long maxva = maxv.get(0, i + 1);
    long long minva = -minv.get(0, i + 1);
    {
      long long maxva = maxv.get(i - l + 1, i + 1);
      long long minva = -minv.get(i - l + 1, i + 1);
      if (maxva - minva > s) continue;
    }
    int okl = 0;
    int okup = i - l + 2;
    if (maxva - minva <= s)
      dp.setv(i, -1);
    else {
      int low = 0;
      int up = i - l + 2;
      while (low + 1 < up) {
        int mid = (low + up) / 2;
        long long maxva = maxv.get(mid, i + 1);
        long long minva = -minv.get(mid, i + 1);
        if (maxva - minva > s)
          low = mid;
        else
          up = mid;
      }
      if (up != okup) {
        auto t = -dp.get(up - 1, okup - 1);
        dp.setv(i, -t - 1);
      }
    }
  }
  if (-dp.get(n - 1) > n)
    cout << -1 << '\n';
  else
    cout << -dp.get(n - 1) << '\n';
  return 0;
}

### 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>
using namespace std;
template <class T>
void pr(const string& name, T t) {
  cerr << name << ": " << t << endl;
}
template <typename T, typename... Types>
void pr(const string& names, T t, Types... rest) {
  auto comma_pos = names.find(',');
  cerr << names.substr(0, comma_pos) << ": " << t << ", ";
  auto next_name_pos = names.find_first_not_of(" \t\n", comma_pos + 1);
  pr(string(names, next_name_pos), rest...);
}
template <class T, class U>
ostream& operator<<(ostream& o, const pair<T, U>& v) {
  return o << "(" << v.first << ", " << v.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, const vector<T>& v) {
  o << "{";
  for (int i = 0; i < (int)((int)((v).size())); ++i)
    o << (i ? ", " : "") << v[i];
  return o << "}";
}
template <class T = long long>
struct AddMaxRangeSeg {
  const int MAX_N;
  vector<T> dseg, maxseg;
  AddMaxRangeSeg(int n) : MAX_N(n), dseg(n << 2), maxseg(n << 2){};
  inline void add(int ql, int qr, int cl, int cr, int k, T v) {
    if (qr <= cl || cr <= ql) return;
    if (ql <= cl && cr <= qr) {
      dseg[k] += v;
      maxseg[k] += v;
      return;
    }
    add(ql, qr, cl, (cl + cr) / 2, k * 2 + 1, v);
    add(ql, qr, (cl + cr) / 2, cr, k * 2 + 2, v);
    maxseg[k] = max(maxseg[k * 2 + 1], maxseg[k * 2 + 2]) + dseg[k];
  }
  inline T get(int ql, int qr, int cl, int cr, int k) {
    if (qr <= cl || cr <= ql) return numeric_limits<T>::min();
    if (ql <= cl && cr <= qr) return maxseg[k];
    return max(get(ql, qr, cl, (cl + cr) / 2, k * 2 + 1),
               get(ql, qr, (cl + cr) / 2, cr, k * 2 + 2)) +
           dseg[k];
  }
  inline void setv(int idx, T v) {
    T t = get(idx, idx + 1, 0, MAX_N, 0);
    add(idx, idx + 1, 0, MAX_N, 0, -t);
    add(idx, idx + 1, 0, MAX_N, 0, v);
  }
  inline T get(int idx) { return get(idx, idx + 1, 0, MAX_N, 0); }
  inline T get(int a, int b) { return get(a, b, 0, MAX_N, 0); }
  inline void add(int idx, T v) { add(idx, idx + 1, 0, MAX_N, 0, v); }
  inline void add(int a, int b, T v) { add(a, b, 0, MAX_N, 0, v); }
};
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, s, l;
  cin >> n >> s >> l;
  AddMaxRangeSeg<int> maxv(n), minv(n), dp(n);
  for (int i = 0; i < (int)(n); ++i) {
    int a;
    cin >> a;
    maxv.setv(i, a);
    minv.setv(i, -a);
  }
  dp.add(0, n, -(1 << 30));
  for (int i = 0; i < (int)(n); ++i) {
    if (i < l - 1) continue;
    long long maxva = maxv.get(0, i + 1);
    long long minva = -minv.get(0, i + 1);
    {
      long long maxva = maxv.get(i - l + 1, i + 1);
      long long minva = -minv.get(i - l + 1, i + 1);
      if (maxva - minva > s) continue;
    }
    int okl = 0;
    int okup = i - l + 2;
    if (maxva - minva <= s)
      dp.setv(i, -1);
    else {
      int low = 0;
      int up = i - l + 2;
      while (low + 1 < up) {
        int mid = (low + up) / 2;
        long long maxva = maxv.get(mid, i + 1);
        long long minva = -minv.get(mid, i + 1);
        if (maxva - minva > s)
          low = mid;
        else
          up = mid;
      }
      if (up != okup) {
        auto t = -dp.get(up - 1, okup - 1);
        dp.setv(i, -t - 1);
      }
    }
  }
  if (-dp.get(n - 1) > n)
    cout << -1 << '\n';
  else
    cout << -dp.get(n - 1) << '\n';
  return 0;
}

```