Please explain with another test case

unable to understand the ques
failing all test cases

#include
#include
#include
#include
#include <math.h>
#include
#include
using namespace std;

#define ll long long int
#define loop(i, a, b) for(int i = a; i < b; i++)
#define vi vector
#define vii vector< vector >

int main(){
int t;
cin >> t;
deque dack ;
int *ar = new int [t];
loop(i,0,t){
cin>>ar[i];
// int x;
// cin>>dack.push_back(x);
}

int key;
cin>>key;

loop(i,0,key){
    while (!dack.empty() && ar[i]>dack.back()) {
        dack.pop_back();
    }
        dack.push_back(i);
}

loop(i,key,t){
    cout<<ar[dack.front()]<<" ";

    while (!dack.empty() && dack.front()<=i-key) {
        dack.pop_front();
    }

    while (!dack.empty() && ar[i]>=ar[dack.back()]) {
        dack.pop_back();
    }
    dack.push_back(i);
}

cout<<ar[dack.front()]<<endl;





return 0;

}

hi @harshkasana17 send the code on ide.codingblocks.com
write save send the url of the page