int **split_array(const int *s, int length) {
    int **main_array = malloc(sizeof(int *) * 2);
    main_array[0] = malloc(sizeof(int) * (length / 2 + length % 2));
    main_array[1] = malloc(sizeof(int) * (length / 2));

    for (int i = 0; i < length; i++) {
        if (i % 2 == 0) {
            main_array[0][i / 2] = s[i];
        } else {
            main_array[1][i / 2] = s[i];
        }
    }

    return main_array;
}
This code should allocate the correct amount of memory to each of the 2 arrays based on the length of the input array. For example, if the array is length 3, it should allocate sizeof(int) * 2 to the first array and sizeof(int) to the second