
/* Write your solution here */
void fib(int **fseq, int n) {
    *fseq = malloc(sizeof(int) * n);
    fseq[0] = 0;
    for (int i = 1; i < n; i++) {
        if (i == 1) {
            fseq[1] = 1;} 
        else {
            fseq[i] = fseq[i-2] + fseq[i-1];
        }
    }
}

int main(int argc, char **argv) {
    /* do not change this main function */
    int count = strtol(argv[1], NULL, 10);
    int *fib_sequence;

    fib(&fib_sequence, count);
    for (int i = 0; i < count; i++) {
        printf("%d ", fib_sequence[i]);
    }
    free(fib_sequence);
    return 0;
}