Maximum in subarray test case fail

What’s wrong with this code?

#include
#include
#include

using namespace std;

int main()
{

int n,k;
cin>>n>>k;
int a[100000];

for(int i=0;i<n;i++)
{
cin>>a[i];
}

deque Q(k);
int i;

for(i=0;i<k;i++)
{
while(!Q.empty() && a[i]>a[Q.back()]){
Q.pop_back();
}

Q.push_back(i);

}

for(;i<n;i++)
{
cout<<a[Q.front()]<<" ";

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

while(!Q.empty() && a[i]>=a[Q.back()]){
Q.pop_back();
}

Q.push_back(i);
}

return 0;
}

sahil first make data type of n and k long long and when u are pushing in deque u have to push a[i] not only i ,if any problem check this
https://ide.codingblocks.com/#/s/17887
Happy Coding!:slightly_smiling_face: