Language: C++

#include<stdio.h>
int main()
{
	longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0;
	scanf("ll%dll%d",&n,&m);
	for (i=1;i<=m;i++) scanf("ll%d",&x[i]);
	for (i=1;i<=n-1;i++) scanf("ll%dll%dll%d",&a[i],&b[i],&c[i]);
	for (i=1;i<=n;i++) k[i]=0;
	for (i=1;i<=m-1;i++)
	{
		if (x[i]>x[i+1])
		{
			d=x[i];
			s=x[i+1];
			while (d>s)
			{
				d=d-1;
				k[d]=k[d]+1;
			}
		}
		else if (x[i]<x[i+1])
		{
			d=x[i];
			s=x[i+1];
			while (d<s)
			{
				k[d]=k[d]+1;
				d=d+1;
			}
		}
	}
	for (i=1;i<=n;i++)
	{
		if (k[i]!=0)
		{
			y=c[i]+b[i]*k[i];
			if (y>a[i]*k[i]) y=a[i]*k[i];
			t=t+y;
		}
	}
	printf("%d\n",t);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'longlong' was not declared in this scope
    4 |         longlong i,n,m,x[100000],a[100000],b[100000],c[100000],k[100000],d,s,y=0,t=0;
      |         ^~~~~~~~
a.cc:5:27: error: 'n' was not declared in this scope
    5 |         scanf("ll%dll%d",&n,&m);
      |                           ^
a.cc:5:30: error: 'm' was not declared in this scope
    5 |         scanf("ll%dll%d",&n,&m);
      |                              ^
a.cc:6:14: error: 'i' was not declared in this scope
    6 |         for (i=1;i<=m;i++) scanf("ll%d",&x[i]);
      |              ^
a.cc:6:42: error: 'x' was not declared in this scope
    6 |         for (i=1;i<=m;i++) scanf("ll%d",&x[i]);
      |                                          ^
a.cc:7:14: error: 'i' was not declared in this scope
    7 |         for (i=1;i<=n-1;i++) scanf("ll%dll%dll%d",&a[i],&b[i],&c[i]);
      |              ^
a.cc:7:52: error: 'a' was not declared in this scope
    7 |         for (i=1;i<=n-1;i++) scanf("ll%dll%dll%d",&a[i],&b[i],&c[i]);
      |                                                    ^
a.cc:7:58: error: 'b' was not declared in this scope
    7 |         for (i=1;i<=n-1;i++) scanf("ll%dll%dll%d",&a[i],&b[i],&c[i]);
      |                                                          ^
a.cc:7:64: error: 'c' was not declared in this scope
    7 |         for (i=1;i<=n-1;i++) scanf("ll%dll%dll%d",&a[i],&b[i],&c[i]);
      |                                                                ^
a.cc:8:14: error: 'i' was not declared in this scope
    8 |         for (i=1;i<=n;i++) k[i]=0;
      |              ^
a.cc:8:28: error: 'k' was not declared in this scope
    8 |         for (i=1;i<=n;i++) k[i]=0;
      |                            ^
a.cc:9:14: error: 'i' was not declared in this scope
    9 |         for (i=1;i<=m-1;i++)
      |              ^
a.cc:11:21: error: 'x' was not declared in this scope
   11 |                 if (x[i]>x[i+1])
      |                     ^
a.cc:13:25: error: 'd' was not declared in this scope
   13 |                         d=x[i];
      |                         ^
a.cc:14:25: error: 's' was not declared in this scope
   14 |                         s=x[i+1];
      |                         ^
a.cc:18:33: error: 'k' was not declared in this scope
   18 |                                 k[d]=k[d]+1;
      |                                 ^
a.cc:23:25: error: 'd' was not declared in this scope
   23 |                         d=x[i];
      |                         ^
a.cc:24:25: error: 's' was not declared in this scope
   24 |                         s=x[i+1];
      |                         ^
a.cc:27:33: error: 'k' was not declared in this scope
   27 |                                 k[d]=k[d]+1;
      |                                 ^
a.cc:32:14: error: 'i' was not declared in this scope
   32 |         for (i=1;i<=n;i++)
      |              ^
a.cc:34:21: error: 'k' was not declared in this scope
   34 |                 if (k[i]!=0)
      |                     ^
a.cc:36:25: error: 'y' was not declared in this scope
   36 |                         y=c[i]+b[i]*k[i];
      |                         ^
a.cc:36:27: error: 'c' was not declared in this scope
   36 |                         y=c[i]+b[i]*k[i];
      |                           ^
a.cc:36:32: error: 'b' was not declared in this scope
   36 |                         y=c[i]+b[i]*k[i];
      |                                ^
a.cc:37:31: error: 'a' was not declared in this scope
   37 |                         if (y>a[i]*k[i]) y=a[i]*k[i];
      |                               ^
a.cc:38:25: error: 't' was not declared in this scope
   38 |                         t=t+y;
      |                         ^
a.cc:41:23: error: 't' was not declared in this scope
   41 |         printf("%d\n",t);
      |                       ^