Solve the question or explain the question with various example

you are given an array A of K integers where Ai denotes page number of a book. To the score, you can either add or multiply the last digit of the page numbers.
you have to find the maximum score you can get.
The book contains N pages, also you need to follow the order in which the page numbers are given in the array, Initially, your score is 0.
first input: two space-separated integers N and K
second iNput:-K space-separated integers denoting the page number.

I/P- 50 3
2 35 23
O/P-30

From what you have given. the questions means to say, that simply you’ll be given some numbers
for each numbers you can either add number%10 to your answer or multiply it and then finally give the max number
the solution would be, that if number%10 is 0 or 1 then add it or multiply it
corner check, first number has to be only added since u start with 0, if the first number’s % with 10 is 1 then add the second number as well besides that you will only multiply