"I'm stopping by Žnidaršić's house, you play the piano, Perica."
"Ok, dad, I will!"
And so, Perica began playing the piano. His piano consists of
Help Perica determine the remainder of that number modulo
Input
The first line of input contains two integers
Output
The first and only line of output must contain the required number from the task.
Scoring
In test cases worth 40% of total points, it will additionally hold
Sample Input 1
5 3
2 4 2 3 4
Sample Output 1
39
Explanation for Sample Output 1
All selections of
Sample Input 2
5 1
1 0 1 1 1
Sample Output 2
4
Sample Input 3
5 2
3 3 4 0 0
Sample Output 3
31
Comments
This comment is hidden due to too much negative feedback. Show it anyway.