Function to return the sum of the last n digits of num
function sumFromEnd ( num , n ) { var sum = 0 ; for ( i = 0 ; i < n ; i ++ ) { sum += ( num % 10 ) ; num = parseInt ( num / 10 ) ; } return sum ; } function getAverage ( n , k , l ) {