「ACSL2016-2017 All-Star」Numbers 数字
测试数据来自 oistream/1118
背景
- Idea: ACSL
 - Data: ACSL
 - Solution: ACSL
 - 题面: ACSL
 - Translate: oistream
 
描述
Given a large number, find the value when its digits change places to produce the following:
给定一个大整数,将其的各位以任意的顺序重新排列,得到一些新的数。从这些数中找出满足以下条件的数。
- The smallest possible number.
 - The largest possible number.
 - The \(50^{th}\) largest possible number.
 - The \(k^{th}\) smallest possible number. You’ll be given the value of \(k\).
 - The number closest to the mean of the first two answers above. By “closest”, use the absolute value. For example, \(7\) is closer to \(10\) than \(14\) is.
 
\(~~\)
- 这些数中最小的数。
 - 这些数中最大的数。
 - 这些数中第 \(50\) 大的数。
 - 这些数中第 \(k\) 小的数。\(k\) 由输入给定。
 - 这些数中最接近上述第 \(1\) 条问题和第 \(2\) 条问题答案的平均值的数。此处的“接近”使用两数之差的绝对值衡量。举例来说,\(7\) 比 \(14\) 更接近 \(10\)。
 
输入格式
One large integer (fewer than \(18\) digits), followed by k, a positive integer.
一个大整数,和一个正整数 \(k\)。
输出格式
Print the 5 numbers as listed above. Do not print any leading 0s.
依次输出上面五个问题的答案,每个数占一行。 请不要输出前导 \(0\)。
样例
输入样例1
20162017 127
输出样例1
112267
76221100
76102201
612271
27621100
数据规模与约定
原题仅一组数据。本题共两组数据。如下表。
| 数据编号 | 时间限制 \(/\text{s}\) | 空间限制 \(/\text{MB}\) | 分值 \(/\text{pts}\) | 限制 | 备注 | 
|---|---|---|---|---|---|
| \(\#1\) | \(1\) | \(128\) | \(20\) | 大数的位数小于 \(18\),\(k\gt 0\) | 样例 | 
| \(\#2\) | \(1\) | \(128\) | \(80\) | 大数的位数小于 \(18\),\(k\gt 0\) | 原题数据 |