if __name__ == "__main__":
    input_array = [3, 1, 2, 5]
    result_array = []
    r = 0
    for index, value in enumerate(input_array):
        r = 10 * r + value
        result_array.append(r // 2)
        r = r % 2
    if r != 0:
        r = 10 * r 
        result_array.append(r//2)
    print(result_array)
