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