D. Largest Remainder
time limit per test
1.0 s
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
3 1
1 2 3
Output
321
Input
3 10
1 2 3
Output
213
Input
3 100
1 2 3
Output
132