Calclulating volume of goods left when all are produced . Move from right to left of sequence multiplying each volume by increasing powers of 1 - P starting from 0
for ( int i = N ; i >= 1 ; i -- ) result += pow ( ( 1 - P ) , N - i ) * V [ i ] ;