BOI7SOU

10 3 5
10 8 4 2 12 2 3 4 1 11
3 3 0
0 0 0
4 3 0
0 0 0 0
4 3 0
1 0 0 0
11 4 5
8 1 3 9 4 2 8 4 5 1 2
11 4 5
20 0 20 0 20 0 20 0 20 0 20
10 3 5
10 8 4 2 12 2 3 4 1 5
10 9 5
10 8 4 2 12 2 3 4 1 5
11 14 5
20 0 20 0 20 0 20 0 20 0 20
6 7 3
1 98 6634 455 233 34
7 2 0
0 1 1 2 3 2 2
9 2 0
0 1 1 1 2 3 2 2 2
10 2 0
0 1 1 1 2 3 2 2 2 9
10 2 0
0 1 1 1 2 3 2 2 2 2
10 5 0
0 1 1 1 2 3 2 2 2 2
11 5 5
8 1 3 9 4 2 8 4 5 1 2
12 5 5
8 1 3 9 4 2 8 4 5 1 2 3
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#define ll long long int
#define MOD 1000000007
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FOR(i,n) for(int i=0;i adj[100005],v;

set st;
string s,s2;

ll ans=0;

int main() {
    	
	cin>>n>>m>>k;
	
	FOR(i,n) cin>>arr[i];
	
	std::deque q1,q2;
	
	FOR(i,m)
	{
        while(!q1.empty() && arr[i]>=arr[q1.back()])
        {
            q1.pop_back();
        }
        q1.push_back(i);
        while(!q2.empty() && arr[i]<=arr[q2.back()])
        {
            q2.pop_back();
        }
        q2.push_back(i);
	}
	
    for(int i=m;i=arr[q1.back()])
        {
            q1.pop_back();
        }
        while(!q2.empty() && arr[i]<=arr[q2.back()])
        {
            q2.pop_back();
        }
        q1.push_back(i);
        q2.push_back(i);
    }
        if(arr[q1.front()]-arr[q2.front()]<=k)
        {
            cout<
5 50 0
1 1 1 1 1
5 5 0
1 1 1 1 1
5 5 1
1 1 1 1 1
5 6 50
1 1 1 1 1
5 8 50
1 1 1 1 1
10 3 0
10 8 4 2 12 2 3 4 1 11
5 2 0
1 2 3 4 5
5 2 0
0 1 2 3 4 
10 0 0
10 8 4 2 12 2 3 4 1 11
10 4 1
1 0 4 5 6 2 5 0 1 10
10 4 1
1 0 4 5 6 2 5 0 1 1
10 4 3
1 0 4 5 6 2 5 0 1 1
10 4 2
1 0 4 5 6 2 5 0 1 1
10 6 2
1 0 4 5 6 2 5 0 1 1
10 2 5
10 8 4 2 12 2 3 4 1 11
7 2 0
0 1 1 3 3 2 2
7 2 2
0 2 1 2 4 7 5
9 3 2
1 2 3 1 4 5 2 3 6
1 0 3
7
1 1 3
7