CF405A Gravity Flip
题目描述
小克里斯在物理课上很无聊(太容易了),所以他建了一个玩具箱让自己的有事做。这个盒子很特别,因为它有改变重力的能力。 盒子内排列 NN 列的玩具立方体。第$i$列包含$A_i$个立方体。首先,盒子里的重力向下拉动立方体。当克里斯切换重力时,它开始将所有立方体拉到盒子的右侧。

该图显示了方块中的立方体的初始和最终位置:改变了它们的位置的立方体用橙色突出显示。 给定盒子中的玩具立方体的初始位置,在重力开关之后找到$N$列中的每个立方体的数量!
输入格式
输入的第一行包含整数$n(1
输出格式
输出$n$个整数,由空隔分隔,其中第$i$个数是重力切换后第$i$列中的立方体数量。
说明/提示
The first example case is shown on the figure. The top cube of the first column falls to the top of the last column; the top cube of the second column falls to the top of the third column; the middle cube of the first column falls to the top of the second column.
In the second example case the gravity switch does not change the heights of the columns.