jiahuimbzuai/CoQuIR huggingface dataset:
//  [cpp]
//struct cmp {bool operator()(const pair<int, char> &a, const pair<int, char> &b) {if (a.first == b.first) {return a.second > b.second;} else {return a.first > b.first;}}};
#include<bits/stdc++.h>
#define endl "\n"
#define _  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define min_heap priority_queue <int, vector<int>, greater<int> >
#define max_heap priority_queue <int>
#define ll long long
//#define int long long
#define MOD 1000000007#define deb3(x,y,z) cout << #x << "=" << x << "\t"<<#y<<"="<<y<< "\t"<<#z<<"="<<z<<endl;
#define DEBUG cout<<"Hello1\n";
#define deb(x) cout << #x << " " << x << endl;
#define deb2(x,y) cout << #x << "=" << x << "\t\t"<<#y<<"="<<y<<endl;
#define deb3(x,y,z) cout << #x << "=" << x << "\t"<<#y<<"="<<y<< "\t"<<#z<<"="<<z<<endl;
#define all(v) (v).begin(),(v).end()
using namespace std;

void solve() {
	int n, l;
	cin >> n >> l;
	vector<string> v;
	while (n--) {
		string s;
		cin >> s;
		v.pb(s);
	}

	sort(all(v));

	for (auto x : v)cout << x;
}

int32_t main() {
	_


	solve();
}
//  [cpp]
#include <bits/stdc++.h>

#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
#define rreps(i,n,s) for(int i=s;i>=n;i--)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

using ll = long long;
using namespace std;
constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int MOD = 1000000007;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,l;
cin>>n>>l;
vector<string>s(n);
rep(i,n)cin>>s[i];
sort(s.begin(),s.end());
string ans="";
rep(i,n)ans+=s[i];
cout<<ans<<endl;
return 0;
}
//  [cpp]
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;


signed main(){
  int N,L;cin>>N>>L;
  vector<string> array(N);
  REP(i,0,N)cin>>array[i];
  sort(ALL(array),[](auto a,auto b){
    return a<b;
  });
  each(s,array){
    cout<<s;
  }
  cout<<endl;
  

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, L;
  cin >> N >> L;
  vector<string> vec(N);
  for(int i = 0; i < N; i++) {
    string S;
    cin >> S;
    vec[i] = S;
  }
  sort(vec.begin(), vec.begin());
  for(int i = 0; i < N; i++) {
    cout << vec[i];
  }
  cout << endl;
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int n;
  cin>>n;
  vector<string>s(n);
  for(int i=0;i<n;i++){
	  cin>>s[i];
  }
  sort(s.begin(),s.end());
  for(int i=0;i<n;i++){
	  cout<<s[i];
  }
  
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int n;
  cin>>n;
  vector<string>s(n);
  for(int i=0;i<n;i++){
	  cin>>s[i];
  }
  sort(s.begin(),s.end());
  for(int i=0;i<n;i++){
	  cin>>s[i];
  }
  
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
int main(void){
    int n,l,i,j;
    char s[101][101];
    char tmp[101];
    scanf("%d%d",&n,&l);
    for(i=0;i<n;i++)
        scanf("%s",s[i]);
    
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(strcmp(s[i],s[j])>0){
                strcpy(tmp,s[i]);
                strcpy(s[i],s[j]);
                strcpy(s[j],tmp);
            }
        }
    }
    for(i=0;i<n;i++)
        printf("%s",s[i]);
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int comp(const void * x, const void * y){
    return strcmp(x,y);
}
int main(){
    int i,j;
    scanf("%d %d", &i, &j);
    char s[i][j+1];
    for(int m=0;m<i;++m) scanf("%s", s[m]);
    qsort(s,i,sizeof(s[0]),comp);
    for(int m=0;m<i;++m) printf("%s", s[m]);
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int cmpstr(const void * a, const void *b){
    //const char *x=a, *y=b;    strcmp já faz a conversão de void para char implicitamente. Olhar man de qsort
    return strcmp(a,b);
}


int main () {

    int n, l;
    char s[123][123];

    scanf("%d%d", &n, &l);

    for(int i=0; i<n ; i++) {
        scanf("%s", s[i]);
    }
    //ordenando as strings
    qsort(s,n, sizeof(s[0]), cmpstr);

    for (int i=0; i<n ; ++i )
        printf("%s", s[i]);

    printf ("\n");

return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
int main(void)
{
    int N, L;
    char s[100][200], tmp[200];
    scanf("%d %d", &N, &L);
    for (int i = 0; i < N; i++)
        scanf("%s", s[i]);
    for (int i = 1; i < N; i++) {
        for (int j = 1; j < N; j++) {
            if (strcmp(s[i], s[j]) > 0) {
                strcpy(tmp, s[i]);
                strcpy(s[i], s[j]);
                strcpy(s[j], tmp);
            }
        }
    }
    for (int i = 0; i < N; i++)
        printf("%s", s[i]);
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main (void)
{
    int N, L;
    char s[100][200], tmp[200];
    scanf("%d %d", &N, &L);
    for (int i = 0; i < N; i++)
        scanf("%s", s[i]);
        for (int j = 1; j < N; j++) {
            if (strcmp(s[j - 1], s[j]) > 0) {
                strcpy(tmp, s[j - 1]);
                strcpy(s[j - 1], s[j]);
                strcpy(s[j], tmp);
            }
        }
    for (int i = 0; i < N; i++)
        printf("%s", s[i]);
    return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main(){
        int i,n,l,j,k;
        scanf("%d %d",&n,&l);
        char s[n][l+1];
        char tmp[l+1];
        char out[n*l+1];
        for(i=0;i<n;i++){
         scanf("%s",s[i]);
        }
        for(j=0;j<n-1;j++){
         for(k=0;k<n-1;k++){
          if(strcmp(s[k],s[k+1])==1){
           strcpy(tmp,s[k]);
           strcpy(s[k],s[k+1]);
           strcpy(s[k+1],tmp);
          }
         }
        }
        for(i=0;i<n;i++){
         strcpy(out+i*l,s[i]);
        }
        printf("%s\n",out);

        return 0;
}
//  [javascript]
'use strict';
function Main(input) {
const tmp = input.split("\n");
tmp.shift();
tmp.sort();
const a = tmp.join("");
console.log(a);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
const main = arg => {
  let N = arg.split("\n")[0].split(" ")[0];
  let rows = arg.split("\n").slice(1, N+1);
  let sortRows = rows.sort();
  let joinSortRows = sortRows.join("");
  console.log(joinSortRows);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var s = require("fs").readFileSync("/dev/stdin", "utf8");
console.log(s.split("\n").slice(1, s.length).sort().join(""));
//  [javascript]

let _inputLines;
let _lineNumber = 0;
let inputReader = _inputReader ();

function _main() {
	
	_inputLines = _inputData.trim().split('\n').map((string) => {
		return string.trim();
	});;
	
	let [a, b] = inputReader.readArray();
	//console.log(typeof c);
	a = parseInt(a);
	b = parseInt(b);
	//c = parseInt(c);
	let arr = [];
	for(let i=0;i<a;i++){
		let str = inputReader.readLine().split('').sort().join('');
		arr.push(str);
	} 
	arr.sort();
	let res='';
	for (let array of arr){
		res+=array;
	} 
	console.log(res);
	
	
	// let input = inputReader.readLine().split(' ');
	// let a = input[0];
	// let b = input[1];
	// //let b = inputReader.readLine().split('');
	// //console.log(a,b);
	
	// let res = '';
	// for(let i=0;i<size;i++){
	//     res +=a[i];
	//     res+=b[i];
	// }
	// console.log(res);
	
	//console.log(noOfTestCases,typeof noOfTestCases);
	// while(noOfTestCases--){
	//     let [a,b] = inputReader.readNumberArray();
	//     let count = 1;
	//     if(a<=2){
	//         console.log(1);
	//         continue;
	//     }
	//     let floor;
	//     if((a-2)%b===0)
	//         floor = (a-2)/b +1;
	//     else
	//          floor = Math.ceil((a-2)/b)+1;
	//     console.log(floor);
	
	// }

}

var _inputData = '';
function cacheInput(data) {
	_inputData += data;
}

process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', cacheInput).on('end', _main);

function _inputReader () {
	function readArray() {
		return _inputLines[_lineNumber++].split(' ');
	}
		
	function readLine(){
		return _inputLines[_lineNumber++];
	}
		
	function readNumberArray(){
		return _inputLines[_lineNumber++].split(' ').map(val => Number(val));
	}
		
	
	return {
		readArray,
		readLine,
		readNumberArray,
	}
}
//  [javascript]
function main(input) {
  const args = input.split('\n');
  const ary1 = args[0].split(' ').map(n => parseInt(n, 10));
  const N = ary1[0];
  const L = ary1[1];
  let ary2 = [];
  
  for (let i = 1; i <= L; i++) {
  	ary2.push(args[i]);
  }
  
  ary2 = ary2.sort((a, b) => {
  	a = a.toString().toLowerCase();
    b = b.toString().toLowerCase();
    if (a < b) {
      return -1;
    } else if (a > b) {
      return 1;
    }
    return 0;
  });
  
  console.log(ary2.join(''));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input) {
  const args = input.split('\n');
  const ary1 = args[0].split(' ').map(n => parseInt(n, 10));
  const N = ary1[0];
  const L = ary1[1];
  let ary2 = [];
  
  for (let i = 1; i <= L; i++) {
  	ary2.push(args[i]);
  }
  console.log(ary2.sort((a, b) => { return a + b < b + a; }).join(''));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

//Main
const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		return sc
	}()
)

var N, L int

func main() {
	sc.Split(bufio.ScanWords)

	N, L = nextInt(), nextInt()
	S := make([]string, N)
	for i := 0; i < N; i++ {
		S[i] = nextStr()
	}

	sort.Strings(S)
	buf := bufio.NewWriter(os.Stdout)
	for i := 0; i < N; i++ {
		buf.Write([]byte(fmt.Sprintf("%s", string(S[i]))))
	}
	buf.Write([]byte("\n"))
	buf.Flush()
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

const mod = 1000000007

// 1MB
const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	n, l := nextInt(), nextInt()
	s := make([]string, n)
	res := make([]byte, n*l)

	for i := 0; i < n; i++ {
		s[i] = next()
	}

	sort.Strings(s)

	for i := 0; i < n; i++ {
		for j := 0; j < l; j++ {
			res[i*l+j] = s[i][j]
		}
	}

	fmt.Println(string(res))
}
//  [go]
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, l int
	fmt.Scan(&n, &l)
	s := make([]string, l)
	for i := 0; i< l; i++{
		fmt.Scan(&s[i])
	}
	sort.Strings(s)

	var ans string
	for _, key := range	 s{
		ans += key
	}
	fmt.Print(ans)
}
//  [go]
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n, l int
	fmt.Scan(&n, &l)
	s := make([]string, l)
	for i := 0; i< l; i++{
		fmt.Scan(&s[i])
	}
	sort.Strings(s)

	var ans string
	for _, key := range s{
		ans += key
	}
	fmt.Println(ans)
}
//  [go]
package main
 
import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)
 
func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	nl := strings.Split(sc.Text(), " ")
	n := strconv.Atoi(nl[0])
	// l, _ := strconv.Atoi(nl[1])
 
	var s []string
	for i := 0; i < n; i++ {
		sc.Scan()
		s = append(s, sc.Text())
	}
 
	sort.Strings(s)
 
	var result string
 
	for _, str := range s {
		result += str
	}
	fmt.Println(result)
}
//  [ruby]
fl=gets.chomp.split(" ")
N=fl[0].to_i
L=fl[1].to_i
al=Array.new(N)
0.upto(N-1){|i|
  al[i]=gets.chomp
}
puts al.sort.join('')
//  [ruby]
N, L = gets.chomp.split(" ").map(&:to_i)
strings = []

N.times do
    strings << gets.chomp
end

strings.sort!
puts strings.join("")
//  [ruby]
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  # INF = Float::INFINITY
  # def chmin(a, b) a < b ? a : b end

n,l = gets.split.map(&:to_i)
s = []
n.times {s << gets.chomp}


puts s.sort.join
//  [ruby]
n, l = gets.chomp.split(' ').map(&:to_i)
list = []
n.times do
  list << gets.chomp
end
list.sort

print list.join('')
//  [ruby]
n, l = gets.split
num = n.to_i
len = l.to_i

nums_array = []
num.times {|i|
  alpha_str = gets.chomp
  num_str = ""
  len.times {|c|
    num_str += alpha_str[c].ord.to_s(16)
  }
  nums_array.push(num_str.to_i)
}

result_str = ""
nums_array.sort!
nums_array.each {|val|
  val_str = val.to_s
  0.step(val_str.length - 1, 2) {|i|
    result_str += val_str[i, 2].to_i(16).chr
  }
}
puts result_str
//  [ruby]
_n, l = gets.split.map(&:to_i)
ary = []
l.times { ary << gets.chomp }

puts ary.sort.join
//  [rust]
fn main() {
    let summary = read_vec::<u32>();
    let words = read_vec2::<String>(*summary.get(0).unwrap());
    let words = quick_sort(&words);
    let mut res = String::new();
    for word in words {
        res = format!("{}{}", res, word);
    }
    println!("{}", res);
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<T> {
    let mut v2 = Vec::new();
    for _ in 0..n {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).ok();
        let v = s.trim().parse().ok().unwrap();
        v2.push(v);
    }
    v2
}

fn quick_sort(list: &Vec<String>) -> Vec<String> {
    if list.len() == 0 { return Vec::new(); }

    let pivot = list.len() / 2;
    let pivot_val = list.get(pivot).unwrap();
    
    let mut left : Vec<String> = Vec::new();
    let mut center : Vec<String> = Vec::new();
    let mut right : Vec<String> = Vec::new();

    for val in list {
        if val < pivot_val { left.push(val.to_string()); }
        if val == pivot_val { center.push(val.to_string()); }
        if val > pivot_val { right.push(val.to_string()); }
    }

    let mut sorted = quick_sort(&left);
    sorted.append(&mut center);
    sorted.append(&mut quick_sort(&right));
    sorted
}
//  [rust]
macro_rules! input {
     (source = $s:expr, $($r:tt)*) => {
         let mut iter = $s.split_whitespace();
         input_inner!{iter, $($r)*}
     };
     ($($r:tt)*) => {
         let s = {
             use std::io::Read;
         let mut s = String::new();
         std::io::stdin().read_to_string(&mut s).unwrap();
         s
     };
     let mut iter = s.split_whitespace();
     input_inner!{iter, $($r)*}
     };
}
     
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
 
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
 
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
 
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
 
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
 
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
 
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
//#[allow(unused_imports)]
//use proconio::marker::{Isize1, Usize1, Bytes, Chars};
//#[proconio::fastout]
fn main() {
    input!{
        n: usize,
        _l: usize,
        s: [String; n],
    }
    s.sort();
    let mut ans = String::new();
    for s_ in &s {
        ans += s_;
    };
    println!("{}", ans);
}
//  [rust]
use proconio::{fastout, input};
use std::collections::BTreeSet;

#[fastout]
fn main() {
    input! {n: usize, l: usize, s: [String; n]};

    let mut b = BTreeSet::new();

    for i in s.iter() {
        b.insert(i);
    }

    for i in b {
        print!("{}", i)
    }
}
//  [rust]
use std::io::Read;
 
fn main() {
    let mut buf = String::new();
 
    // 標準入力から全部bufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();
 
    // 読み込んだStringを空白で分解する
    let mut iter = buf.split_whitespace();
    let _u: usize = iter.next().unwrap().parse().unwrap();
    let q: usize = iter.next().unwrap().parse().unwrap();
 
    let mut lrt: Vec<String> = (0..q)
        .map(|_| {
                String::from(iter.next().unwrap())
        }).collect();
  
      lrt.sort();
      
      let result = lrt.concat();

  	println!("{}", result);
  	
  
}
//  [rust]
use std::io::Read;
 
fn main() {
    let mut buf = String::new();
 
    // 標準入力から全部bufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();
 
    // 読み込んだStringを空白で分解する
    let mut iter = buf.split_whitespace();
 
    let q: usize = iter.next().unwrap().parse().unwrap();
 
    let mut lrt: Vec<String> = (0..q)
        .map(|_| {
                String::from(iter.next().unwrap())
        }).collect();
  
      lrt.sort();
      
      let result = lrt.concat();

  	println!("{}", result);
  	
  
}
//  [swift]
var _=readLine()!,S=[""];
while let s=readLine(){S+=[s]};
S.sort().forEach{print($0,terminator:"")}
//  [swift]
var _=readLine()!,S=[""];while let s=readLine(){S+=[s]};for s in S.sort(){print(s,terminator:"")}
//  [swift]
let _=readLine()!,S=(0...99).map{_ in readLine() ?? ""}
S.sort().forEach{print($0,terminator:"")}
//  [swift]
import Foundation
let rd = readLine()!.split(separator: " ").map({String($0)}).sorted()
print(rd.joined(separator: ","))
//  [swift]
var _=readLine()!,S=[""];while let s=readLine(){S+=[s]};for s in S{print(s,terminator:"")}
//  [swift]
let _=readLine()!
var S=[String]()
while let s=readLine() {
    S+=[s!]
}
print(S.sort().joinWithSeparator(""))
//  [typescript]
import * as fs from 'fs';
const input = fs.readFileSync("/dev/stdin", "utf8").split(/\n/);

// B-文字列大好きいろはちゃんイージー

const N = parseInt(input[0].split(' ')[0]);
const targetText = new Array<string>();
let result = "";

for (let i = 1; i < 1 + N; i++) {
    targetText.push(input[i]);
}

targetText.sort();

targetText.forEach(x => {
    result += x;
});
console.log(result);
//  [typescript]
import * as fs from 'fs'
const reader = (s: string) => s.split('\n')

function Main(input: string) {
  const [_, ...S] = reader(input)
  console.log(S.sort((a, b) => (a < b ? -1 : 1)).join(''))
}

Main(fs.readFileSync('/dev/stdin', 'utf8'))
//  [typescript]
function main(input: string) {
  const arrInput: string[] = input
    .split("\n")
    .slice(1)
    .sort();
  console.log(arrInput.join(""));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
import * as fs from 'fs';

let input = fs.readFileSync("/dev/stdin", "utf8").split(" ");
input = input.sort();
let s: string = "";
input.forEach(element => {
    s += element;
});
console.log(s);
//  [typescript]
import * as fs from 'fs';
const input = fs.readFileSync("/dev/stdin", "utf8").split(/\n/);

// B-文字列大好きいろはちゃんイージー

const N = parseInt(input[0].split(' ')[0]);
const targetText = new Array<String>();
let result = '';

for (let i = 1; i < 1 + N; i++) {
    targetText.push(input[i]);
}
console.log(N);
console.log(targetText);

targetText.sort();

targetText.forEach(x => {
    result += x;
});
console.log(result);
//  [typescript]
import * as fs from 'fs';

const input = fs.readFileSync("/dev/stdin", "utf8").split(/\n/);

const count = parseInt(input[0].split('')[0]);
const target = new Array<string>();
let result = '';

for (let i = 1; i < count + 1; i++) {
    target.push(input[i]);
}

target.sort();

target.forEach(text => {
    result += text;
});

console.log(result);
//  [python]
n,k=[int(i) for i in raw_input().split()]
a=[int(i) for i in raw_input().split()]
s=0
for i in a:
    s+=i
val=(s+n+k-1)/(n+k)
for i in a:
    k-=i/val
if(k>=0):
    print val
else:
    k=abs(k)
    l=[]
    for i in a:
        x=i/val
        if(x>0):
            l.append((i+x-1)/x)
    l.sort()
    print l[k-1]
//  [python]
N, K = map(int, input().split())
logs = list(map(int, input().split()))
maxL = max(logs)

def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx

if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL
print(ans)
//  [python]
#!/usr/bin/env python3

import os
import sys
import numpy as np

def ncut(l, x):
  return np.sum(np.ceil(l / x) - 1)

def solve(N, K, AS):
  ng, ok = -1, np.amax(AS)
  while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if ncut(AS, mid) <= K:
      ok = mid
    else:
      ng = mid

  return ok.item()


def main():
  d = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
  N, K = d[:2]
  AS = d[2:]

  print('{}'.format(solve(N, K, AS)))

if __name__ == '__main__':
  main()
//  [python]
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
n,k = readInts()
A = readInts()
if n == 2:
    print('---')
    exit()
def is_ok(mid):
    cnt = 0
    for i in range(n):
        cnt += (A[i]-1)//mid
        if cnt > k:
            return False
    return True




ok = max(A) + 1
ng = 0
while ok - ng > 1:
    mid = (ok+ng)//2
    if is_ok(mid):
        ok = mid
    else:
        ng = mid

print(ok)
//  [python]
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
n,k = readInts()
A = readInts()
if n == 2:
    print('---')
    exit()
def is_ok(mid):
    cnt = 0
    for i in range(n):
        cnt += (A[i]-1)//mid
        if cnt > k:
            return False
    return True




ok = max(A) + 1
ng = -1
while ok - ng > 1:
    mid = (ok+ng)//2
    if is_ok(mid):
        ok = mid
    else:
        ng = mid

print(ok)
//  [python]
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

from math import ceil
def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

    def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 1
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
    print(bs_meguru(k))

if __name__ == '__main__':
    main()
//  [java]
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni(), K = in.ni();
        int[] a = in.ni(n);
        int l = -1, r = inf;
        while(r-l>1){
            int mid = (l+r)/2;
            int k = 0;
            for(int i = 0; i < n; i++) k += (a[i] + mid - 1) / mid-1;
            if(k<=K) r = mid;
            else l = mid;
        }
        out.println(r);
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}
//  [java]
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in);) {
			int n = sc.nextInt();
			int k = sc.nextInt();

			int[] a = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = sc.nextInt();
			}

			int l = 1;
			int r = 1_000_000_000;
			while (l < r - 1) {
				int mid = (l + r) / 2;

				int cutCount = 0;
				for (int i = 0; i < n; i++) {
					cutCount += (a[i] - 1) / mid;
				}

				if (cutCount <= k) {
					r = mid;
				} else {
					l = mid;
				}
			}

			System.out.println(r);

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
//  [java]
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.toList;

public class Main
{
    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        long k=in.nextLong();
        long[] arr=new long[n];
        for(int i=0;i<n;i++)
            arr[i]=in.nextLong();
        long max=Integer.MIN_VALUE;
        for(int i=0;i<n;i++)
            max=Math.max(max,arr[i]);
        long low=1;
        long high=max;
        long curr=max;
        while(low<=high)
        {
            long mid=(low+high)/2;
            long sum=0;
            for(int i=0;i<n;i++)
            {
                if(((arr[i]-mid)%mid)==0)
                    sum+=(arr[i]-mid)/mid;
                else
                    sum+=1+(arr[i]-mid)/mid;
            }
            if(sum<=k)
            {
                high=mid-1;
                curr=mid;
            }
            else
                low=mid+1;
        }
        long sum=0;
        /*for(int i=0;i<n;i++)
        {
            if(((arr[i]-292638192)%292638192)==0)
                sum+=(arr[i]-292638192)/292638192;
            else
                sum+=(1+(arr[i]-292638192)/292638192);
        }*/
        System.out.println(curr);
    }
}
//  [cpp]
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}

int A[200000];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint(), K = getint();
	rep(i, N) A[i] = getint() - 1;

	int L = 0, R = 1000000000;
	while (L + 1 < R) {
		int H = (L + R) / 2;
		ll k = 0;
		rep(i, N) k += A[i] / H;
		if (k <= K) R = H;
		else L = H;
	}
	printf("%d\n", R);


	Would you please return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
double logs[500000],cut[500000]={0},N,K;
int mins=1000000000;
void f(int x,int y){
	if(x==0 || y>N){
		int maks=0;
		for(int a=1;a<=N;a++){
			if(maks<round(logs[a]/(cut[a]+1)))maks=round(logs[a]/(cut[a]+1));
		}
		if(mins>maks)mins=maks;
	}else{
		for(int a=0;a<=x;a++){
			cut[y]=a;
			f(x-a,y+1);
		}
	}
}

int main(){
	cin>>N>>K;
	for(int a=1;a<=N;a++){
		cin>>logs[a];
	}
	f(K,1);
	cout<<mins<<endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
double logs[500000],cut[500000]={0},N,K;
double mins=1000000000;
void f(int x,int y){
	if(x==0 || y>N){
		double maks=0;
		for(int a=1;a<=N;a++){
			if(maks<logs[a]/(cut[a]+1))maks=logs[a]/(cut[a]+1);
		}
		if(mins>maks)mins=maks;
	}else{
		for(int a=0;a<=x;a++){
			cut[y]=a;
			f(x-a,y+1);
		}
	}
}

int main(){
	cin>>N>>K;
	for(int a=1;a<=N;a++){
		cin>>logs[a];
	}
	f(K,1);
	cout<<round(mins)<<endl;
}
//  [c]
#include<stdio.h>
#define MAXN 220000
int a[MAXN],n,k;

int read()
{
	int ans=0,p=1;
	char c = getchar();
	while (c<'0'||c>'9')
	{
		if(c=='-')
			p=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		ans = ans*10+c-'0';
		c=getchar();
	}
	return ans*p;
//	int a;
//	scanf("%d",&a);
//	return a;
}

int solve(int m)
{
	int ans=0;
	for(int i = 1; i <= n; i++)
	{
		ans += a[i]/m;
		if(a[i]%m==0)
			ans--;
		if(ans>k)
			return 0;
	}
	return 1;
}

int main()
{
	n=read(),k=read();
	for(int i=1;i<=n;i++)
	{
		a[i]=read();
	}	
	int A = 1, B = 2e9;
	while(A < B)
	{
		int mid = (A+B)>>1;
		if(solve(mid) != 1)
		{
			A = mid+1;
		}
		else 
		{
			B = mid;
		}
	}
	printf("%d",B);
	return 0;
}
//  [c]
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }
void rsorta_d32(void *base, const int count, const int size, const int index){
	typedef int32_t rsort_t;
	rsort_t (*a)[size] = (rsort_t(*)[size])base;
	rsort_t (*b)[size] = (rsort_t(*)[size])malloc(count*size*sizeof(rsort_t));
	int c[0x100];
	for(int k=0; k<4; k++){
		memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[(a[i][index]>>(k<<3))&0xFF]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ int to=--c[(a[i][index]>>(k<<3))&0xFF]; for(int j=0; j<size; j++){ b[to][j]=a[i][j]; } }{rsort_t(*t)[size]=a; a=b; b=t;}
	}
	free(b);
}

int n;
int a[200000];

inline int f(int k){
	long ans=0;
	for(int i=0; i<n; i++){
		ans+=(a[i]-1)/k;
	}
	return ans>INT_MAX?INT_MAX:ans;
}

int main(void){
	n=nextint();
	int k=nextint();
	for(int i=0; i<n; i++){
		a[i]=nextint();
	}
	int l=1, r=1000000000;
	while(l<=r){
		int m=(l+r)/2;
		if(f(m)<=k) r=m-1; else l=m+1;
	}
	printf("%d\n", l);
}
//  [c]
#include <stdio.h>

int main()
{
	int i, N, K, A[200001], max = 0;
	scanf("%d %d", &N, &K);
	for (i = 1; i <= N; i++) {
		scanf("%d\n", &(A[i]));
		if (A[i] > max) max = A[i];
	}

	int l = 1, r = max, m, tmp, count;
	while (l < r) {
		m = (l + r) / 2;
		for (i = 1, count = 0; i <= N; i++) {
			count += (A[i] - 1) / m;
			if (count > K) break;
		}
		if (count > K) l = m + 1;
		else r = m;
	}

	printf("%d\n", l);
	fflush(stdout);
	return 0;
}
//  [c]
//#include<iostream>
//#include<algorithm>
//#include<queue>
//using namespace std;
//typedef __int128 int;
#define int __int128

int a[200010];

inline int read() {
    char ch = getchar();
    int f = 1;
    while (ch < '0' || ch > '9') {
        if (ch == '-')
            f = -f;
        ch = getchar();
    }
    int x = 0;
    while (ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
    return x * f;
}

inline void write(int x) {
    if (x < 0) {
        putchar('-');
        write(-x);
        return;
    }
    if (x < 10) {
        putchar(char(x % 10 + '0'));
        return;
    }
    write(x / 10);
    putchar(char(x % 10 + '0'));
}

int n,k;
int cal(int x){
    int ans=0;
    for(int i=1;i<=n;++i){
        if(a[i]/x>k){
            return 1e9;
        }
        ans=ans+(a[i]/x);
        if(ans>k){
            return 1e9;
        }
    }
    if(ans<0){
        return 1e9;
    }
    return ans;
}

signed main(){
    read(n),read(k);
//    scanf("%lld%lld",&n,&k);
    for(int i=1;i<=n;++i){
        read(a[i]);
//        scanf("%lld",&a[i]);
    }
    int l=0,r=1e10,mid;
    while(l<=r){
        mid=(l+r)/2;
        int f=cal(mid);
        if(f>k)l=mid+1;
        else r=mid-1;
    }
    write(l);
//    printf("%lld\n",l);


}
//  [c]
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
typedef long long LL;
typedef long double Lf;
#define in (void)scanf
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
//#define Rep(i,a,n)for(LL i=(LL)(a);i<(LL)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Repp(i,l,r,k)for(int i=(int)(l);i<(int)(r);i+=(int)(k))
//#define Repp(i,l,r,k)for(LL i=(LL)(l);i<(LL)(r);i+=(LL)(k))
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define MOD 4999999999999997//998244353,1000000007,1000000009,4999999999999997
int upi(const void* a, const void* b) { return*(int*)a<*(int*)b ? -1 : *(int*)a> * (int*)b ? 1 : 0; }
int downi(const void* a, const void* b) { return*(int*)a<*(int*)b ? 1 : *(int*)a> * (int*)b ? -1 : 0; }
void sortupi(int* a, int n) { qsort(a, n, sizeof(int), upi); } //1,2,3,4,...
void sortdowni(int* a, int n) { qsort(a, n, sizeof(int), downi); }
int upLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? -1 : *(LL*)a> * (LL*)b ? 1 : 0; }
int downLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? 1 : *(LL*)a> * (LL*)b ? -1 : 0; }
void sortupLL(LL* a, int n) { qsort(a, n, sizeof(LL), upLL); }
void sortdownLL(LL* a, int n) { qsort(a, n, sizeof(LL), downLL); }
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } // a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } // aaa,aab
LL gcd(LL p, LL q) { while (q) { LL t = p % q; p = q; q = t; }return p; }
LL modpow(LL a,LL n,int m){LL x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define invmodpow(b,p)modpow(b,p-2,p)// a/b≡a*b^{-1}(mod p)...return b^{-1}(mod p)
typedef struct fac { LL n, exp; }F;
LL fact(LL n,F*a){LL x=n,i,j,c=0;for(i=2;i*i<=x;i++){for(j=1;x%i==0;j++)x/=i;if(j>1){a[c].n=i;a[c++].exp=j-1;}}if(x-1){a[c].n=x;a[c++].exp=1;}return c;}
LL nibtan(LL* a,LL n,LL x){LL p=0,q=n/2,r=n-1;while(r-p>1){if(x>=a[q])p=q;if(x<=a[q])r=q;q=(p+r)/2;}return a[p]==x?p:r;}
//snippet

#define N 200009

int n, k, a[N];

LL check(int x) {
	LL ret = 0;
	rep(i, n)ret += (LL)ceill((Lf)a[i] / (Lf)x) - 1;
	return ret;
}

void run(void) {
	//saw editorial
	in("%d%d", &n, &k);
	rep(i, n)in("%d", &a[i]);

	int p = 0, q = MOD / 2, r = MOD, ans = n;
	while (r - p > 1) {
		if (check(q) <= (LL)k) r = q;
		else p = q;
		q = (p + r) / 2;
	}
	if (check(r) <= k)ans = r;
	if (check(q) <= k)ans = q;
	if (check(p) <= k)ans = p;
	printf("%d\n", ans ? ans : 1);
}

int main(void) {
	int test = 1;
//	in("%d", &test);
	while (test--) {
		run();
	}
	return 0;
}
//  [c]
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
typedef long long LL;
typedef long double Lf;
#define in (void)scanf
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
//#define Rep(i,a,n)for(LL i=(LL)(a);i<(LL)(n);i++)
#define rep(i,n)Rep(i,0,n)
#define Repp(i,l,r,k)for(int i=(int)(l);i<(int)(r);i+=(int)(k))
//#define Repp(i,l,r,k)for(LL i=(LL)(l);i<(LL)(r);i+=(LL)(k))
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define MOD 1000000007//998244353,1000000007,1000000009,4999999999999997
int upi(const void* a, const void* b) { return*(int*)a<*(int*)b ? -1 : *(int*)a> * (int*)b ? 1 : 0; }
int downi(const void* a, const void* b) { return*(int*)a<*(int*)b ? 1 : *(int*)a> * (int*)b ? -1 : 0; }
void sortupi(int* a, int n) { qsort(a, n, sizeof(int), upi); } //1,2,3,4,...
void sortdowni(int* a, int n) { qsort(a, n, sizeof(int), downi); }
int upLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? -1 : *(LL*)a> * (LL*)b ? 1 : 0; }
int downLL(const void* a, const void* b) { return*(LL*)a<*(LL*)b ? 1 : *(LL*)a> * (LL*)b ? -1 : 0; }
void sortupLL(LL* a, int n) { qsort(a, n, sizeof(LL), upLL); }
void sortdownLL(LL* a, int n) { qsort(a, n, sizeof(LL), downLL); }
int cmp_char(const void* a, const void* b) { return *(char*)a - *(char*)b; } // a,b,c,d
int cmp_str(const void* a, const void* b) { return strcmp(*(const char**)a, *(const char**)b); } // aaa,aab
LL gcd(LL p, LL q) { while (q) { LL t = p % q; p = q; q = t; }return p; }
LL modpow(LL a,LL n,int m){LL x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
#define invmodpow(b,p)modpow(b,p-2,p)// a/b≡a*b^{-1}(mod p)...return b^{-1}(mod p)
typedef struct fac { LL n, exp; }F;
LL fact(LL n,F*a){LL x=n,i,j,c=0;for(i=2;i*i<=x;i++){for(j=1;x%i==0;j++)x/=i;if(j>1){a[c].n=i;a[c++].exp=j-1;}}if(x-1){a[c].n=x;a[c++].exp=1;}return c;}
LL nibtan(LL* a,LL n,LL x){LL p=0,q=n/2,r=n-1;while(r-p>1){if(x>=a[q])p=q;if(x<=a[q])r=q;q=(p+r)/2;}return a[p]==x?p:r;}
//snippet

#define N 100009

int n, k, a[N];

LL check(int x) {
	LL ret = 0;
	rep(i, n)ret += (LL)ceill((Lf)a[i] / (Lf)x) - 1;
	return ret;
}

void run(void) {
	//saw editorial
	in("%d%d", &n, &k);
	rep(i, n)in("%d", &a[i]);

	int p = 0, q = MOD / 2, r = MOD, ans = n;
	while (r - p > 1) {
		if (check(q) <= (LL)k) r = q;
		else p = q;
		q = (p + r) / 2;
	}
	if (check(r) <= k)ans = r;
	if (check(q) <= k)ans = q;
	if (check(p) <= k)ans = p;
	printf("%d\n", ans ? ans : 1);
}

int main(void) {
	int test = 1;
//	in("%d", &test);
	while (test--) {
		run();
	}
	return 0;
}
//  [javascript]
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

function Main(input) {
  input = input.split("\n");
  const [n, k] = input[0].split(" ").map((a) => parseInt(a, 10));
  const a = input[1].split(" ").map((a) => parseInt(a, 10));
  let l = 0, r = 1e9;
  while (r-l > 1) {
    const x = Math.ceil((l+r)/2);
    let now = 0;
    for(let i=0; i<n; i++) {
      now += Math.ceil((a[i])/x) -1;
    }
    if (now <= k) {
      r = x;
    } else {
      l = x;
    }
  }
  console.log(r);
  return;
}
//  [javascript]
console.log((args=>{
  const [[N,K],A] = args.trim().split`\n`.map(r=>r.split` `.map(v=>0|v));
  let ng = 0, ok = 1e9;
  while ( ok - ng > 1 ) {
    const m = (ok+ng)>>>1;
    let k = 0;
    for ( let i = 0; i < N; i++ ) {
      k += Math.floor((A[i]-1)/m);
    }
    if ( k > K ) ng = m;
    else ok = m;
  }
  return ok;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
//  [javascript]
//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
var obj; var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + end + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  return {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw "ArrayIndexOutOfBoundsException ‚There is no more input";}}
  };
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
  var one = nextIntArray();
  var N = one[0];
  var K = one[1];
  var list = nextIntArray();
  var L = 0;
  var R = 1000000009;
  var output = 0;
  while(Math.abs(R - L) > 1){
    var C = Math.floor((R + L) / 2);
    var count = 0;
    for(var i = 0; i < N; i++){
      count += Math.ceil(list[i] / C) - 1;
    }
    if(count <= K){
      output = C;
      R = C;
    }else{
      
      L = C;
    }
  }
  myout(output);
}