Steve's perfectionism
InterviewTime limit1sMemory limit256 MB
Given an array of positive integers, output a strictly increasing array of the same length where each element is a multiple of the matching input element, at most 1e9.
Problem
Steve is a hopeless perfectionist. He keeps running into arrays of positive integers, and he does not always enjoy what he sees. Steve likes an array if and only if it is strictly ascending. An array he does not like must be changed right away, or Steve will be disappointed.
A new array satisfies Steve only if it keeps the original length and each element is divisible by the corresponding element of the old array. An array that already pleases him can be left alone, or changed anyway.
Input
The first line contains a single integer (). The second line contains space-separated positive integers ().
Output
Print positive integers (), the new array that Steve will like. If several solutions exist, print any of them.