more Mth to last element

Haskell, Ruby