https://www.acmicpc.net/problem/10989


#include <stdio.h>


int main()

{

    int nLoop;

    scanf("%d", &nLoop);

    while(nLoop--)

    {

        const int c_Size = 10000 + 1;

        int n;

        int cnt[c_Size] = {0};

        scanf("%d", &n);

        for(int i=0; i<n; i++)

        {

            int val;

            scanf("%d", &val);

            cnt[val]++;

        }

        for(int i=0; i<c_Size; i++)

        {

            if(!cnt[i])

                continue;

            const int nCnt = cnt[i];

            char str[128];

            sprintf(str, "%d\n", i);

            for(int j=0; j<nCnt; j++)

                printf(str);

        }

    }

    return 0;

}