Shift and multiply elements of large array

Hi, I have a large array and I should shift and multiply certain elements of this array. The problem is that I should do this efficiently. Here is example what I should do. Let's assume that I have an array

[ 1 3 5 6 8 3 11 12 ... ]

I should take [ 6 8 3 ] multiply by 2 and insert these elements back to the array. Thus I should get
[ 1 3 5 6 8 3 12 16 6 11 12 ... ]

There might be 500,000 elements in the array. Any suggestions or hints?

-Ikaros
Topic archived. No new replies allowed.