CF883K Road Widening
Description
Mayor of city S just hates trees and lawns. They take so much space and there could be a road on the place they occupy!
The Mayor thinks that one of the main city streets could be considerably widened on account of lawn nobody needs anyway. Moreover, that might help reduce the car jams which happen from time to time on the street.
The street is split into $ n $ equal length parts from left to right, the $ i $ -th part is characterized by two integers: width of road $ s_{i} $ and width of lawn $ g_{i} $ .
For each of $ n $ parts the Mayor should decide the size of lawn to demolish. For the $ i $ -th part he can reduce lawn width by integer $ x_{i} $ ( $ 0
Input Format
The first line contains integer $ n $ ( $ 1
Output Format
In the first line print the total width of lawns which will be removed.
In the second line print $ n $ integers $ s'_{1},s'_{2},...,s'_{n} $ ( $ s_{i}