private void calculate(int[] aux,int[] prices,int i){
        int max=0;
        for( int j=i+1;j<aux.length;++j){
            int temp=0;
            if(prices[j]>prices[i]) temp+=prices[j]-prices[i];
            if(j+2<aux.length){
                temp+=aux[j+2];
            }
            if(temp>max) max=temp;
            if(aux[j]>max) max=aux[j];
        }
        aux[i]=max;
    }