#K48357. Maximum Number Concatenation
Maximum Number Concatenation
Maximum Number Concatenation
You are given a list of non-negative integers. Your task is to arrange these integers such that they form the largest possible number when concatenated together. The result should be output as a string. If the list is empty, output an empty string.
Formally, given a set of integers \(a_1, a_2, \dots, a_n\), you wish to find an ordering \(b_1, b_2, \dots, b_n\) of the integers (when treated as strings) such that the concatenated string \(b_1 b_2 \ldots b_n\) is lexicographically maximum (where comparison is defined by the lexicographical order of the concatenated result). The comparison between two numbers (as strings) \(x\) and \(y\) is determined by comparing \(xy\) and \(yx\).
Note: The input is provided via standard input (stdin) and the output via standard output (stdout).
inputFormat
The first line contains a single integer \(n\) (\(0 \le n \le 10^5\)), representing the number of integers in the list. If \(n > 0\), the second line contains \(n\) space-separated integers.
outputFormat
Output the largest possible number as a concatenated string. If the list is empty, output an empty string.
## sample3
50 2 1
5021