Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int cmp(const void *, const void *);

static char *a;
static size_t sz;

int main(void) {
	int n, i, j, p;
	long total, r;
	long a[99999];
	a = malloc(1000000);

	getline(&a, 1000000, stdin);
	sscanf("%d", &n);

	getline(&a, 1000000, stdin);
	for ( i = 0 ; i < n ; i++ ) {
		sscanf( "%d ", a[i] ) ;
	}

	total = 0;
	for ( i = 0 ; i < n ; i++ ) {
		total += a[i];
	}
	for ( i = 0 ; i < n ; i++ ) {
		r = total / 2 ;
		p = ( i - 1 ) % n ;
		for ( j = 0 ; j < n / 2 ; j++ ) {
			p = ( p + 2 ) % n ;
			r -= a[ p ];
		}
		if ( i > 0 ) {
			printf( " " ) ;
		}
		printf( "%d", r * 2 ) ;
	}
	printf( "\n" ) ;
}


Compiler output:
main.c: In function 'main':
main.c:14:11: error: assignment to expression with array type
   14 |         a = malloc(1000000);
      |           ^
main.c:16:17: error: passing argument 1 of 'getline' from incompatible pointer type [-Wincompatible-pointer-types]
   16 |         getline(&a, 1000000, stdin);
      |                 ^~
      |                 |
      |                 long int (*)[99999]
In file included from main.c:1:
/usr/include/stdio.h:697:45: note: expected 'char ** restrict' but argument is of type 'long int (*)[99999]'
  697 | extern __ssize_t getline (char **__restrict __lineptr,
      |                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~
main.c:16:21: error: passing argument 2 of 'getline' makes pointer from integer without a cast [-Wint-conversion]
   16 |         getline(&a, 1000000, stdin);
      |                     ^~~~~~~
      |                     |
      |                     int
/usr/include/stdio.h:698:46: note: expected 'size_t * restrict' {aka 'long unsigned int * restrict'} but argument is of type 'int'
  698 |                           size_t *__restrict __n,
      |                           ~~~~~~~~~~~~~~~~~~~^~~
main.c:17:22: error: passing argument 2 of 'sscanf' from incompatible pointer type [-Wincompatible-pointer-types]
   17 |         sscanf("%d", &n);
      |                      ^~
      |                      |
      |                      int *
/usr/include/stdio.h:431:43: note: expected 'const char *' but argument is of type 'int *'
  431 |                    const char *__restrict __format, ...) __THROW;
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:19:17: error: passing argument 1 of 'getline' from incompatible pointer type [-Wincompatible-pointer-types]
   19 |         getline(&a, 1000000, stdin);
      |                 ^~
      |                 |
      |                 long int (*)[99999]
/usr/include/stdio.h:697:45: note: expected 'char ** restrict' but argument is of type 'long int (*)[99999]'
  697 | extern __ssize_t getline (char **__restrict __lineptr,
      |                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~
main.c:19:21: error: passing argument 2 of 'getline' makes pointer from integer without a cast [-Wint-conversion]
   19 |         getline(&a, 1000000, stdin);
      |                     ^~~~~~~
      |                     |
      |                     int
/usr/include/stdio.h:698:46: note: expected 'size_t * restrict' {aka 'long unsigned int * restrict'} but argument is of type 'int'
  698 |                           size_t *__restrict __n,
      |                           ~~~~~~~~~~~~~~~~~~~^~~
main.c:21:33: error: passing argument 2 of 'sscanf' makes pointer from integer without a cast [-Wint-conversion]
   21 |                 sscanf( "%d ", a[i] ) ;
      |                                ~^~~
      |                                 |
      |                                 long int
/usr/include/stdio.h:431:43: note: expected 'const char *' but argument is of type 'long int'
  431 |                    const char *__restrict __format, ...) __THROW;
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~