#728
Unrated
OohMoo Milk
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Farmer John is trying to make his world's famous OohMoo Milk to sell for a profit. He has NN (1N105)(1 \leq N \leq 10^5) bottles that he is trying to fill. Each bottle initially contains some amount of milk mim_i (0mi109)(0 \leq m_i \leq 10^9). Every day, he takes AA (1AN)(1 \le A \le N) bottles and fills each bottle with one unit of milk.

Unfortunately, Farmer Nhoj, Farmer John's competitor in the business of OohMoo Milk, knows about Farmer John's production processes and has a plan to curtail his business. Every day, after Farmer John fills his AA bottles, Farmer Nhoj will sneakily steal one unit of milk from each of BB (0B<A)(0 \le B < A) different nonempty bottles. To remain sneaky, Farmer Nhoj chooses BB so that it is strictly less than AA, so that it is less likely for Farmer John to discover him.

After DD (1D1091 \leq D \leq 10^9) days, Farmer John will sell his OohMoo Milk. If a bottle has MM units of milk, it will sell for M2M^2 moonies.

Let PP be the unique profit such that FJ can guarantee that he makes at least PP profit regardless of how FN behaves, and FN can guarantee that FJ makes at most PP profit regardless of how FJ behaves. Output the value of PP modulo 109+710^9+7.

입력

The first line of the input contains NN and DD, where NN is the number of bottles and DD is the number of days that take place.

The second line of the input contains AA and BB representing the number of units of milk that Farmer John fills and Farmer Nhoj steals respectively.

The third line of the input contains NN space-separated integers mim_i representing the initial amount of milk in each bottle.

출력

Output the value of PP modulo 109+710^9+7.

예제 입력 1

5 4
4 2
4 10 8 10 10

예제 출력 1

546

예제 입력 2

10 5
5 1
1 2 3 4 5 6 7 8 9 10

예제 출력 2

777

예제 입력 3

5 1000000000
3 1
0 1 2 3 4

예제 출력 3

10

점수

Inputs 4-6: N,D1000N,D\le 1000. Inputs 7-10: D106D\le 10^6. Inputs 11-20: No additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.