Why is my code showing WA if the output is correct

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--)
	{
		int m,n;
		cin>>n>>m;
		int arr[n]={0};
		for(int i=0;i<m;i++)
		{
			int x;
			cin>>x;
			arr[x-1]=1;
		}
		int chef=1,ass=0;
		int c[m],a[m];
		int k=0,l=0;
		for(int i=0;i<n;i++)
		{
			if (arr[i]==0 && chef==1)
			{
				chef=0;
				ass=1;
				c[k++]=i+1;
			}
			else if(arr[i]==0 && ass==1)
			{
				chef=1;
				ass=0;
				a[l++]=i+1;
			}
		}
		if(k!=0){
		for(int i=0;i<k;i++)
		cout<<c[i]<<" ";
		cout<<endl;}
		else
		cout<<endl;
		if(l!=0){
		for(int i=0;i<l;i++)
		cout<<a[i]<<" ";
		cout<<endl;}
		else
		cout<<endl;
		
	}
	return 0;
}
	The problem link is: [[CLEANUP](https://www.codechef.com/problems/CLEANUP)](https://www.codechef.com/problems/CLEANUP)

try:
1
10 0

Problem is in declaration of c[] and a[]. Think what should be its size.