public static void rapid(int[] a, int k)
    {
        if (a == null || k < 1)
        {
            throw new IllegalArgumentException();
        }
        if (a.length <= 1)
        {
            return;
        }
        int[] c = new int[k];
        for (int i = 0; i < a.length; ++i)
        {
            if (a[i] >= k)
            {
                throw new IllegalArgumentException();
            }
            ++c[a[i]];
        }
        for (int i = 0, j = 0; i < k; ++i)
        {
            for (int m = 1; m <= c[i]; ++m)
            {
                a[j++] = i;
            }
        }
    }