Company: AP Moller Maersk
Difficulty: easy
Dice Sum Problem You are given two integers dice and num . The integer dice represents the result of a dice roll, which is between 1 and 6 (both inclusive). Your task is to find the sum of the digits at odd positions of num and the sum of the digits at even positions of num , considering the leftmost digit of num as the first digit (position 1 ). Print exactly one of those two sums, chosen as follows: If dice is even, print the sum of the digits at odd positions. If dice is odd, print the sum of the digits at even positions. Note For a single digit number, the sum of the digits at even positions is 0 . Input Format The input consists of two lines: The first line contains an integer, i.e. dice . The second line contains an integer num . The input will be read from the STDIN by the candidate. Output Format Print the sum of digits as per the conditions given in the question statement. The output will be matched to the candidate's output printed on the STDOUT. Constraints 1 <= dice <