#C9491. Arrange Students by Height
Arrange Students by Height
Arrange Students by Height
You are given data from t classes where each class contains a list of students' heights. For each class, the first integer is n — the number of students in that class, followed by n integers representing the heights of the students. Your task is to sort the heights in non-decreasing order for each class.
For instance, if a class has heights [160, 150, 170], the sorted order would be [150, 160, 170].
Input/Output: The program should read from standard input and output the sorted heights for each class on a separate line, with numbers separated by a space.
Note: All formulas or mathematical expressions are represented in LaTeX format. For example, if a formula is needed, it should be written as \( a \leq b \).
inputFormat
The first line contains a single integer \( t \) denoting the number of classes. The following \( t \) lines each start with an integer \( n \) (the number of students in that class) followed by \( n \) integers representing the heights of the students.
Example:
1 3 160 150 170
outputFormat
For each class, output a single line with the sorted student heights separated by a single space.
Example:
150 160 170## sample
1
3 160 150 170
150 160 170
</p>