#ABC471E. 和的平方之和 / Sum of Square of Sum

和的平方之和 / Sum of Square of Sum

Statement

There are NN balls numbered 11 to NN. Ball ii has an integer AiA_i written on it.

For a way of choosing some balls from the NN balls, define the score of that choice as the square of the sum of the numbers written on the chosen balls.

Find the sum, modulo 998244353998244353, of the scores of all (NK)\binom{N}{K} ways of choosing KK balls from the NN balls.

Input

The input is given from Standard Input in the following format:

  • NN KK
  • A1A_1 A2A_2 \dots ANA_N

Output

Output the answer.

Constraints

  • 1KN2×1051 \leq K \leq N \leq 2\times 10^5
  • 1Ai1091 \leq A_i \leq 10^9
  • All input values are integers.
3 2
1 10 100
22422

There are three ways of choosing two balls from three balls: choosing balls 1,21,2 gives a score of (1+10)2=121(1+10)^2=121, choosing balls 1,31,3 gives a score of (1+100)2=10201(1+100)^2=10201, and choosing balls 2,32,3 gives a score of (10+100)2=12100(10+100)^2=12100.

The answer is the sum of these, 121+10201+12100=22422121+10201+12100=22422.

5 2
10 10 20 20 20
10600

Multiple balls may have the same number written on them.

2 1
998244353 998244353
0

Find the sum modulo 998244353998244353.