CLOST - Editorial

Y this code fails ??

while(t--)
    {
        char a[2001];
        int n,k,x,y;
        cin>>n>>k;
        a[n] = '\0';
        for(int i=0;i<k;i++)
        {
            cin>>x>>y;
            for(int j = x;j<=y;j+=2)
            {
                    a[j] = '(';
                    a[j+1] = ')';
            }
        }
        cout<<a<<endl;
    }

here is test case like
1
8 1
0 1

it contain only () and other character are only null character ā€¦how the you can print n character string in outputā€¦I think thatā€™s It gave WA?..

leave itā€¦i got it