Can't figure out what's wrong with the code

Question Link: https://www.codechef.com/problems/BOWLERS

My Solution:
#include
using namespace std;

int main() {
int N,K,L,T;
int temp=0;
cin>>T;
while(–T>0)
{
cin>>N>>K>>L;
if(K*L<N)
cout<<"-1";
else
if(K==1 && N>1)
cout<<"-1";
else
for(int i=0; i<N;i++)
{
if(temp==K)
temp=0;
cout<<++temp<<" ";
}
cout<<endl;
}
return 0;
}

Kindly help