# def solve(A):
#
#     prefix_sum = 0
#
#     for i in A:
#         prefix_sum += i
#     left, right = 0, len(A)
#     while left <= right:
#         mid = left + (right-left)//2
#         if left-1>0:
#

if __name__ == '__main__':
    A = [1, 5, 4, 2, 1]
    # solve(A)
