For this Question: After the decimation, the world went into chaos. People had to rebuild the planet so Shield came up with a donation strategy. They feel all the rich guys need to donate more than the poor guys. So, they make a rule. They would make a donation list in which the donation of each person would be shown. But the rule is that a person can’t pay less than what has already been paid before them. Find the extra amount each person will pay, and also, tell shield the total amount of donation.The first line contains n, the total number of people donating. The next line contains n space-separated integers denoting the amount of money paid by the people. The amounts are mentioned in the order in which the people paid.

<b>Constraints:-</b>
1 <= n <= 100000
0 <= money <= 100000The first line contains the extra money that each student has to pay after their teacher applied the rule. The second line contains the total amount collected by the teacher at the end.Sample Input 1:-
10
1 2 3 2 4 3 6 6 7 6

Sample Output 1:-
0 0 0 1 0 1 0 0 0 1
43

Sample Input 2:-
7
10 20 30 40 30 20 10

Sample Output 2:-
0 0 0 0 10 20 30 
220, I have written this Solution Code: n = int(input())
a = input().split()
b = int(a[0])
sum = 0
for i in a:
    if int(i)<b:
        print(b-int(i),end=' ') 
    else:
        b = int(i) 
        print(0,end=' ')

    sum = sum+b
print()
print(sum), In this Programming Language: Python, Now tell me if this Code is compilable or not?