------
## 最终结论
```python
def find_best_value(arr, target):
    left, right = 0, max(arr)
    best_value = 0

    while left <= right:
        mid = (left + right) // 2
        current_sum = sum(min(num, mid) for num in arr)
        
        if current_sum < target:
            left = mid + 1
        else:
            right = mid - 1
        
        if abs(current_sum - target) < abs(best_value - target) or (abs(current_sum - target) == abs(best_value - target) and mid < best_value):
            best_value = mid

    return best_value
```