Passage of the corridor
In Petryk's game, the corridor is divided into N sections, each covered by a certain number of unit tiles. The player controls a character that starts at the beginning of the corridor, just before the first section. The character can move through each section, using one move to do so. If a section has at least one tile, passing through it will remove one tile. If a section has no tiles, the character dies, the player loses one life, and K new tiles are added to that section. The player then receives a new character at the start of the corridor. If the player successfully passes a section without dying, they move to the next section. The player can only move forward. The corridor is considered successfully passed if the character reaches the end, having passed the last section without dying. Your task is to determine how many lives the player will lose and how many moves they will need to reach the end of the corridor.
Input
The first line contains two integers N and K (1 ≤ N ≤ 10000, 1 ≤ K ≤ 100) – the length of the corridor and the number of tiles that appear on a section after the character's death. The second line contains N integers, each representing the initial number of tiles on the corresponding section. These numbers range from 0 to K inclusive.
Output
Output the number of lives the player will lose and the total number of moves made by the time the character reaches the end of the corridor.