~/algor $ cat problems/array/zeroing-between-minimum-and-maximum
Zeroing between minimum and maximum
Easy
1000 ms
128 MB
32%
A positive integer and an array of distinct integers are given. Replace with all elements located between the smallest and the largest elements (the smallest and the largest elements themselves do not change) and print the array.
Input
The first line contains a positive integer . The second line contains distinct integers separated by spaces.
Output
One line with integers separated by spaces.
Note
Examples
Input #1
7 12 3 8 14 5 20 7
Output #1
12 3 0 0 0 20 7
Input #2
4 10 1 5 2
Output #2
10 1 5 2