~/algor $ cat problems/minmax-28-prefiks-minimumlari
Minimum at every step
Easy
1000 ms
128 MB
33%
A positive integer $N$ and $N$ integers are given. For every $k$ ($1 \le k \le N$), find the smallest of the first $k$ elements $A_{1}, A_{2}, \ldots, A_{k}$.
Input
The first line contains a positive integer $N$. The next line contains $N$ integers $A_{i}$.
Output
One line with $N$ integers separated by spaces: the smallest numbers found for $k = 1, 2, \ldots, N$.
Note
$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$
Examples
Input #1
6 5 7 3 4 1 2
Output #1
5 5 3 3 1 1
Input #2
1 -8
Output #2
-8