How to divide using an array