January challange

Chef wants to host some Division-3 contests. Chef has NN setters who are busy creating new problems for him. The ithith setter has made AiAi problems where 1≤i≤N1≤i≤N.

A Division-3 contest should have exactly KK problems. Chef wants to plan for the next DD days using the problems that they have currently. But Chef cannot host more than one Division-3 contest in a day.

Given these constraints, can you help Chef find the maximum number of Division-3 contests that can be hosted in these DD days?

for the above problem it shows my code wrong answer which i write below :

#include
using namespace std;
int main()
{
int t,n,k,d,temp,contest;
cin>>t;
while(t-- > 0)
{
int tot_pro=0;
cin>>n;
cin>>k;
cin>>d;
while(n-- > 0)
{
cin>>temp;
tot_pro+=temp;
}
contest=tot_pro/k;
if(contest>d)
contest=d;
cout<<contest;
}
return 0;
}

your if statement has cout make it outside and it should run.
Also it’s #include<bits/stdc++.h>