# Python 3 program of the above approach
# Function to reduce all
# array elements to zero
def ConvertArray(arr, N):
# If size of array is 1
if (N == 1):
# First operation
print("Operation 1 :",1,1)
print("Added elements:",-1 * arr[0])
print("\n",end = "")
# 2nd Operation
print("Operation 2 :",1,1)
print("Added elements:",1 * arr[0])
print("\n",end = "")
# 3rd Operation
print("Operation 3 :",1,1)
print("Added elements:",-1 * arr[0])
print("\n",end = "")
# Otherwise
else:
# 1st Operation
print("Operation 1 :",1,N)
print("Added elements:",end = " ")
for i in range(N):
print(-1 * arr[i] * N,end = " ")
print("\n")
# 2nd Operation
print("Operation 2 :",1,N - 1)
print("Added elements:",end = " ")
for i in range(N - 1):
print(arr[i] * (N - 1),end = " ")
print("\n")
# 3rd Operation
print("Operation 3 : ",N,N)
print("Added elements:",end = " ")
print(arr[N - 1] * (N - 1))
# Driver Code
if __name__ == '__main__':
# Input
arr = [1, 3, 2, 4]
N = len(arr)
# Function call to make all
# array elements equal to 0
ConvertArray(arr, N)
# This code is contributed by ipg2016107.