Function to perform update operation in the Segment seg
void update ( int left , int right , int index , int Value , int node , int ar [ ] , long long seg [ ] ) { if ( left == right ) { ar [ index ] = Value ;