Language: C

#include<stdio.h>
int main()
{
	int n;
	long int x[1010], y[1010], m;
	scanf("%d", &n);
	scanf("%ld%ld", &x[0], &y[0]);
	m = abs(x[0]) + abs(y[0]);
	for (int i = 0; i < n; i++)
	{
		scanf("%ld%ld", &x[i], &y[i]);
		if (m % 2 != abs(x[i]) + abs(y[i]))
		{
			printf("-1");
			return 0;
		}
		m = max(m, abs(x[i]) + abs(y[i]));
	}
	printf("%ld\n", m);
	for (int i = 0; i < m; i++)
	{
		printf("%ld ", 1);
	}
	printf("\n");
	int xx = 0, yy = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			if (xx < x[i])
			{
				printf("R");
				xx++;
			}
			else if (xx > x[i])
			{
				printf("L");
				xx--;
			}
			else if (xx == x[i])
			{
				if (yy < y[i])
				{
					printf("U");
					yy++;
				}
				else
				{
					printf("D");
					yy--;
				}
			}
		}
		printf("\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
    8 |         m = abs(x[0]) + abs(y[0]);
      |             ^~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | int main()
main.c:8:18: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    8 |         m = abs(x[0]) + abs(y[0]);
      |                 ~^~~
<built-in>: note: built-in 'abs' declared here
main.c:8:30: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
    8 |         m = abs(x[0]) + abs(y[0]);
      |                             ~^~~
<built-in>: note: built-in 'abs' declared here
main.c:12:35: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   12 |                 if (m % 2 != abs(x[i]) + abs(y[i]))
      |                                  ~^~~
<built-in>: note: built-in 'abs' declared here
main.c:12:47: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   12 |                 if (m % 2 != abs(x[i]) + abs(y[i]))
      |                                              ~^~~
<built-in>: note: built-in 'abs' declared here
main.c:17:21: error: implicit declaration of function 'max' [-Wimplicit-function-declaration]
   17 |                 m = max(m, abs(x[i]) + abs(y[i]));
      |                     ^~~
main.c:17:33: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   17 |                 m = max(m, abs(x[i]) + abs(y[i]));
      |                                ~^~~
<built-in>: note: built-in 'abs' declared here
main.c:17:45: warning: 'abs' argument 1 type is 'long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   17 |                 m = max(m, abs(x[i]) + abs(y[i]));
      |                                            ~^~~
<built-in>: note: built-in 'abs' declared here