Function to return the minimum possible value of the last element left after performing the given operations
int getMin ( int arr [ ] , int n ) { int minVal = * min_element ( arr , arr + n ) ; return minVal ; }