Language: C++

void ABC151E()
{
	ll MOD = 1000000007;
	int N, K;
	cin >> N >> K;
	if (K == 1)
	{
		cout << 0 << endl;
		return;
	}

	vl A(N);
	for (auto& x : A)
		cin >> x;
	sort(A.begin(), A.end());
	vl B(N + 1);
	B[0] = 0;
	for (int i = 0; i < N; ++i)
	{
		B[i + 1] = B[i] + A[i];
		B[i + 1] %= MOD;
	}
	ll ans = 0;
	ll mult = 1;
	for (int i = 0; i < N - K + 1; ++i)
	{
		ll f = B[N] - B[K + i-1] - B[N - K - i + 1] + B[0];
		while (f < 0)
		{
			f += MOD;
		}
		f %= MOD;
	//	ll mult = Combination(K + i - 2, i, MOD);
		f *= mult;
		f %= MOD;
		ans += f;
		ans %= MOD;

		mult *= K + i - 1;
		mult %= MOD;
		mult *= ModPow(i + 1, MOD-2, MOD);
		mult %= MOD;
	}
	cout << ans << endl;
}
int main()
{
	ABC151E();
	return 0;
}

Compiler output:
a.cc: In function 'void ABC151E()':
a.cc:3:9: error: 'll' was not declared in this scope
    3 |         ll MOD = 1000000007;
      |         ^~
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> N >> K;
      |         ^~~
a.cc:8:17: error: 'cout' was not declared in this scope
    8 |                 cout << 0 << endl;
      |                 ^~~~
a.cc:8:30: error: 'endl' was not declared in this scope
    8 |                 cout << 0 << endl;
      |                              ^~~~
a.cc:12:9: error: 'vl' was not declared in this scope
   12 |         vl A(N);
      |         ^~
a.cc:13:24: error: 'A' was not declared in this scope
   13 |         for (auto& x : A)
      |                        ^
a.cc:15:14: error: 'A' was not declared in this scope
   15 |         sort(A.begin(), A.end());
      |              ^
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |         sort(A.begin(), A.end());
      |         ^~~~
      |         short
a.cc:16:11: error: expected ';' before 'B'
   16 |         vl B(N + 1);
      |           ^~
      |           ;
a.cc:17:9: error: 'B' was not declared in this scope
   17 |         B[0] = 0;
      |         ^
a.cc:21:29: error: 'MOD' was not declared in this scope
   21 |                 B[i + 1] %= MOD;
      |                             ^~~
a.cc:23:11: error: expected ';' before 'ans'
   23 |         ll ans = 0;
      |           ^~~~
      |           ;
a.cc:24:11: error: expected ';' before 'mult'
   24 |         ll mult = 1;
      |           ^~~~~
      |           ;
a.cc:27:19: error: expected ';' before 'f'
   27 |                 ll f = B[N] - B[K + i-1] - B[N - K - i + 1] + B[0];
      |                   ^~
      |                   ;
a.cc:28:24: error: 'f' was not declared in this scope
   28 |                 while (f < 0)
      |                        ^
a.cc:30:30: error: 'MOD' was not declared in this scope
   30 |                         f += MOD;
      |                              ^~~
a.cc:32:17: error: 'f' was not declared in this scope
   32 |                 f %= MOD;
      |                 ^
a.cc:32:22: error: 'MOD' was not declared in this scope
   32 |                 f %= MOD;
      |                      ^~~
a.cc:34:22: error: 'mult' was not declared in this scope
   34 |                 f *= mult;
      |                      ^~~~
a.cc:36:17: error: 'ans' was not declared in this scope
   36 |                 ans += f;
      |                 ^~~
a.cc:41:25: error: 'ModPow' was not declared in this scope
   41 |                 mult *= ModPow(i + 1, MOD-2, MOD);
      |                         ^~~~~~
a.cc:44:9: error: 'cout' was not declared in this scope
   44 |         cout << ans << endl;
      |         ^~~~
a.cc:44:17: error: 'ans' was not declared in this scope
   44 |         cout << ans << endl;
      |                 ^~~
a.cc:44:24: error: 'endl' was not declared in this scope
   44 |         cout << ans << endl;
      |                        ^~~~