//amazing takes time, legendary requires patience
#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (int i = x, _n = (n); i < _n; ++i)
#define repi(i, a) for(typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define SZ(c) (int)(c).size()
#define pra(v, n) rep(i, 0, n) cout << v[i] << " "; cout << endl;
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define llu unsigned long long
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
#define pi 3.14159265358979
#define debug 0
using namespace std;

const int MOD = 1e9+7;
const int eps = 1e-6;
const int MAX = 100010;

int a[MAX], n, m;
vector<pii> v;
mii cnt;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	rep(i, 1, n+1)
	{
		cin >> a[i];
		v.pb(mp(a[i], i));
	}
	int ans1 = n/m;
	int rem = n - ans1*m;
	sort(all(v));
//	cout << ans1 << endl;
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;
	while(rem)
	{
		if(v[0].F <= m)
		{
			cnt[v[0].F]++;
			v.erase(v.begin());
			rem--;
		}
		else break;
	}
//	cout << "after\n";
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;

	int j = 1, ans2 = 0;
	while(1)
	{
		if(cnt[j] >= ans1) j++;
		else if(cnt[j] < ans1 and j <= m)
		{
			a[v[0].S] = j;
			cnt[j++];
			v.erase(v.begin());
			if(cnt[j] == ans1)
			{
				j++;
			}
			ans2++;
		}
		else break;
	}
	while(rem--)
	{
		a[v[0].S] = 1;
		rem--;
		v.erase(v.begin());
		ans2++;

	}

	cout << ans1 << " " << ans2 << endl;
	rep(i, 1, n+1)
		cout << a[i] << " ";
	cout << endl;

    return 0;
}


//amazing takes time, legendary requires patience
#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (int i = x, _n = (n); i < _n; ++i)
#define repi(i, a) for(typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define SZ(c) (int)(c).size()
#define pra(v, n) rep(i, 0, n) cout << v[i] << " "; cout << endl;
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define llu unsigned long long
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
#define pi 3.14159265358979
#define debug 0
using namespace std;

const int MOD = 1e9+7;
const int eps = 1e-6;
const int MAX = 100010;

int a[MAX], n, m;
vector<pii> v;
mii cnt;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	rep(i, 1, n+1)
	{
		cin >> a[i];
		v.pb(mp(a[i], i));
	}
	int ans1 = n/m;
	int rem = n - ans1*m;
	sort(all(v));
//	cout << ans1 << endl;
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;
	while(rem)
	{
		if(v[0].F <= m)
		{
			cnt[v[0].F]++;
			v.erase(v.begin());
			rem--;
		}
		else break;
	}
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	cout << "after\n";
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;

	int j = 1, ans2 = 0;
	while(1)
	{
		if(cnt[j] >= ans1) j++;
		else if(cnt[j] < ans1 and j <= m)
		{
//			cout << "here\n";
			a[v[0].S] = j;
//			cout << "a[" << v[0].S << "]  is " << j << endl;
			cnt[j]++;
			v.erase(v.begin());
			if(cnt[j] == ans1)
			{
				j++;
			}
			ans2++;
		}
		else break;
	}
	while(rem--)
	{
		a[v[0].S] = 1;
		rem--;
		v.erase(v.begin());
		ans2++;

	}

	cout << ans1 << " " << ans2 << endl;
	rep(i, 1, n+1)
		cout << a[i] << " ";
	cout << endl;

    return 0;
}


//amazing takes time, legendary requires patience
#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (int i = x, _n = (n); i < _n; ++i)
#define repi(i, a) for(typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define SZ(c) (int)(c).size()
#define pra(v, n) rep(i, 0, n) cout << v[i] << " "; cout << endl;
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define llu unsigned long long
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
#define pi 3.14159265358979
#define debug 0
using namespace std;

const int MOD = 1e9+7;
const int eps = 1e-6;
const int MAX = 100010;

int a[MAX], n, m;
vector<pii> v;
mii cnt;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	rep(i, 1, n+1)
	{
		cin >> a[i];
		v.pb(mp(a[i], i));
	}
	int ans1 = n/m;
	int rem = n - ans1*m;
	sort(all(v));
//	cout << ans1 << endl;
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;
	while(rem)
	{
		if(v[0].F <= m)
		{
			cnt[v[0].F]++;
			v.erase(v.begin());
			rem--;
		}
		else break;
	}
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	cout << "after\n";
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;

	int j = 1, ans2 = 0;
	while(1)
	{
		if(cnt[j] >= ans1) j++;
		else if(cnt[j] < ans1 and j <= m)
		{
			if(v[0].F != j) ans2++;
//			cout << "here\n";
			a[v[0].S] = j;
//			cout << "a[" << v[0].S << "]  is " << j << endl;
			cnt[j]++;
			v.erase(v.begin());
			if(cnt[j] == ans1)
			{
				j++;
			}
		}
		else break;
	}
	while(rem--)
	{
		a[v[0].S] = 1;
		rem--;
		v.erase(v.begin());
		ans2++;

	}

	cout << ans1 << " " << ans2 << endl;
	rep(i, 1, n+1)
		cout << a[i] << " ";
	cout << endl;

    return 0;
}


//amazing takes time, legendary requires patience
#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (int i = x, _n = (n); i < _n; ++i)
#define repi(i, a) for(typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define SZ(c) (int)(c).size()
#define pra(v, n) rep(i, 0, n) cout << v[i] << " "; cout << endl;
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define llu unsigned long long
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
#define pi 3.14159265358979
#define debug 0
using namespace std;

const int MOD = 1e9+7;
const int eps = 1e-6;
const int MAX = 100010;

int a[MAX], n, m;
vector<pii> v;
mii cnt;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	rep(i, 1, n+1)
	{
		cin >> a[i];
		v.pb(mp(a[i], i));
	}
	int ans1 = n/m;
	int rem = n - ans1*m;
	sort(all(v));
//	cout << ans1 << endl;
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;
	while(rem)
	{
		if(v[0].F <= m)
		{
			cnt[v[0].F]++;
			v.erase(v.begin());
			rem--;
		}
		else break;
	}
//	cout << "after\n";
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}

	int j = 1, ans2 = 0;
	while(1)
	{
		if(cnt[j] >= ans1) j++;
		else if(cnt[j] < ans1 and j <= m)
		{
			a[v[0].S] = j;
			cnt[j++];
			v.erase(v.begin());
			if(cnt[j] == ans1)
			{
				j++;
			}
			ans2++;
		}
		else break;
	}
	while(rem--)
	{
		a[v[0].S] = 1;
		rem--;
		v.erase(v.begin());
		ans2++;

	}

	cout << ans1 << " " << ans2 << endl;
	rep(i, 1, n+1)
		cout << a[i] << " ";
	cout << endl;

    return 0;
}


//amazing takes time, legendary requires patience
#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (int i = x, _n = (n); i < _n; ++i)
#define repi(i, a) for(typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define SZ(c) (int)(c).size()
#define pra(v, n) rep(i, 0, n) cout << v[i] << " "; cout << endl;
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define llu unsigned long long
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
#define pi 3.14159265358979
#define debug 0
using namespace std;

const int MOD = 1e9+7;
const int eps = 1e-6;
const int MAX = 100010;

int a[MAX], n, m;
vector<pii> v;
mii cnt;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	rep(i, 1, n+1)
	{
		cin >> a[i];
		v.pb(mp(a[i], i));
	}
	int ans1 = n/m;
	int rem = n - ans1*m;
	sort(all(v));
//	cout << ans1 << endl;
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;
	while(rem)
	{
		if(v[0].F <= m)
		{
			cnt[v[0].F]++;
			v.erase(v.begin());
			rem--;
		}
		else break;
	}
	while(1)
	{
		pii p = *v.begin();
		if(p.F <= m and cnt[p.F] < ans1)
		{
			cnt[p.F]++;
			v.erase(v.begin());
		}
		else break;
	}
//	cout << "after\n";
//	rep(i, 1, m+1)
//		cout << cnt[i] << endl;

	int j = 1, ans2 = 0;
	while(1)
	{
		if(cnt[j] >= ans1) j++;
		else if(cnt[j] < ans1 and j <= m)
		{
			if(v[0].F != j) ans2++;
//			cout << "here\n";
			a[v[0].S] = j;
//			cout << "a[" << v[0].S << "]  is " << j << endl;
			cnt[j]++;
			v.erase(v.begin());
			if(cnt[j] == ans1)
			{
				j++;
			}
		}
		else break;
	}
	while(rem)
	{
		a[v[0].S] = 1;
		rem--;
		v.erase(v.begin());
		ans2++;
	}

	cout << ans1 << " " << ans2 << endl;
	rep(i, 1, n+1)
		cout << a[i] << " ";
	cout << endl;

    return 0;
}


//amazing takes time, legendary requires patience
#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (int i = x, _n = (n); i < _n; ++i)
#define repi(i, a) for(typeof((a).begin()) i = (a).begin(), _##i = (a).end(); i != _##i; ++i)
#define SZ(c) (int)(c).size()
#define pra(v, n) rep(i, 0, n) cout << v[i] << " "; cout << endl;
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mii map<int, int>
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define llu unsigned long long
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
#define pi 3.14159265358979
#define debug 0
using namespace std;

const int MOD = 1e9+7;
const int eps = 1e-6;
const int MAX = 100010;

int a[MAX], n, m, ans1, ans2;
VI can, pos[1<<11];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	ans1 = n/m;

	rep(i, 1, n+1)
	{
		cin >> a[i];
		if(a[i] > m)
			can.pb(i);
		else
			pos[a[i]].pb(i);
	}

	rep(i, 1, m+1)
	{
		if(SZ(pos[i]) > ans1)
		{
			int rem = SZ(pos[i]) - ans1;
			while(rem--)
			{
				can.pb(pos[i][0]);
				pos[i].erase(pos[i].begin());
			}
		}
	}
	rep(i, 1, m+1)
	{
		if(SZ(pos[i]) < ans1)
		{
			int rem = ans1 - SZ(pos[i]);
			ans2 += rem;
			while(rem--)
			{
				a[can[0]] = i;
				can.erase(can.begin());
			}
		}
	}
	cout << ans1 << " " << ans2 << endl;
	rep(i, 1, n+1)
		cout << a[i] << " ";
	cout << endl;

    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <deque>
#include <map>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define chr unsigned char
#define uint unsigned int
#define maxn 2016

int main()
{
  //  freopen("input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    vector<int> cnt(m);
    for (int i = 0; i < m; ++i)
        cnt[i] = 0;

    for (int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
        if (a[i] < m)
            cnt[a[i]]++;
    }

    vector< pair<int, int> > counts(m);
    for (int i = 0; i < m; ++i)
        counts[i] = mp(cnt[i], i);

    sort(counts.rbegin(), counts.rend());

    vector<int> need(m);
    for (int i = 0; i < m; ++i)
        need[counts[i].second] = (i < n % m ? (n + m - 1) / m : n / m);

    int swaps = 0;
    for (int i = 0; i < n; ++i){
        if (a[i] >= m || cnt[a[i]] > need[a[i]]){
            for (int j = 0; j < m; ++j)
            if (cnt[j] < need[j]){
                swaps++;
                cnt[j]++;
                if (a[i] < m)
                    cnt[a[i]]--;
                a[i] = j;
                break;
            }
        }
    }

    cout << (n + m - 1) / m << ' ' << swaps << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] + 1 << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <deque>
#include <map>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define chr unsigned char
#define uint unsigned int
#define maxn 2016

int main()
{
  //  freopen("input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    vector<int> cnt(m);
    for (int i = 0; i < m; ++i)
        cnt[i] = 0;

    int can = 0;
    for (int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
        if (a[i] < m)
            cnt[a[i]]++;
        else
            can++;
    }

    for (int i = 0; i < m; ++i)
        can += max(cnt[i] - n / m, 0);

    int swaps = 0;
    for (int i = 0; i < n; ++i){
        if ((a[i] >= m || cnt[a[i]] > n / m) && can > n % m){
            for (int j = 0; j < m; ++j)
            if (cnt[j] < n / m){
                can--;
                swaps++;
                cnt[j]++;
                if (a[i] < m)
                    cnt[a[i]]--;
                a[i] = j;
                break;
            }
        }
    }

    cout << n / m << ' ' << swaps << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] + 1 << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <deque>
#include <map>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define chr unsigned char
#define uint unsigned int
#define maxn 2016

int main()
{
    freopen("input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    vector<int> cnt(m);
    for (int i = 0; i < m; ++i)
        cnt[i] = 0;

    for (int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
        if (a[i] < m)
            cnt[a[i]]++;
    }

    vector< pair<int, int> > counts(m);
    for (int i = 0; i < m; ++i)
        counts[i] = mp(cnt[i], i);

    sort(counts.rbegin(), counts.rend());

    vector<int> need(m);
    for (int i = 0; i < m; ++i)
        need[counts[i].second] = (i < n % m ? (n + m - 1) / m : n / m);

    int swaps = 0;
    for (int i = 0; i < n; ++i){
        if (a[i] >= m || cnt[a[i]] > need[a[i]]){
            for (int j = 0; j < m; ++j)
            if (cnt[j] < need[j]){
                swaps++;
                cnt[j]++;
                if (a[i] < m)
                    cnt[a[i]]--;
                a[i] = j;
                break;
            }
        }
    }

    cout << (n + m - 1) / m << ' ' << swaps << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] + 1 << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <deque>
#include <map>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define chr unsigned char
#define uint unsigned int
#define maxn 2016

int main()
{
 //   freopen("input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    vector<int> cnt(m);
    for (int i = 0; i < m; ++i)
        cnt[i] = 0;

    for (int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
        if (a[i] < m)
            cnt[a[i]]++;
    }

    vector< pair<int, int> > counts(m);
    for (int i = 0; i < m; ++i)
        counts[i] = mp(cnt[i], i);

    sort(counts.rbegin(), counts.rend());

    vector<int> need(m);
    for (int i = 0; i < m; ++i)
        need[counts[i].second] = (i < n % m ? (n + m - 1) / m : n / m);

    int swaps = 0;
    for (int i = 0; i < n; ++i){
        if (a[i] >= m || cnt[a[i]] > need[a[i]]){
            for (int j = 0; j < m; ++j)
            if (cnt[j] < need[j]){
                swaps++;
                cnt[j]++;
                if (a[i] < m)
                    cnt[a[i]]--;
                a[i] = j;
                break;
            }
        }
    }

    cout << n / m << ' ' << swaps << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] + 1 << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <deque>
#include <map>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define chr unsigned char
#define uint unsigned int
#define maxn 2016

int main()
{
  //  freopen("input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    vector<int> cnt(m);
    for (int i = 0; i < m; ++i)
        cnt[i] = 0;

    for (int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
        if (a[i] < m)
            cnt[a[i]]++;
    }

    vector< pair<int, int> > counts(m);
    for (int i = 0; i < m; ++i)
        counts[i] = mp(cnt[i], i);

    sort(counts.rbegin(), counts.rend());

    vector<int> need(m);
    for (int i = 0; i < n % m; ++i)
        need[counts[i].second] = (n + m - 1) / m;
    for (int i = n % m; i < m; ++i)
        need[counts[i].second] = n / m;

    int swaps = 0;
    for (int i = 0; i < n; ++i){
        if (a[i] >= m || cnt[a[i]] > need[a[i]]){
            for (int j = 0; j < m; ++j)
            if (cnt[j] < need[j]){
                swaps++;
                cnt[j]++;
                if (a[i] < m)
                    cnt[a[i]]--;
                a[i] = j;
                break;
            }
        }
    }

    cout << n / m << ' ' << swaps << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] + 1 << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <deque>
#include <map>
#include <set>

using namespace std;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define ll long long
#define ld long double
#define chr unsigned char
#define uint unsigned int
#define maxn 2016

int main()
{
    freopen("input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    vector<int> cnt(m);
    for (int i = 0; i < m; ++i)
        cnt[i] = 0;

    for (int i = 0; i < n; ++i){
        cin >> a[i];
        a[i]--;
        if (a[i] < m)
            cnt[a[i]]++;
    }

    vector< pair<int, int> > counts(m);
    for (int i = 0; i < m; ++i)
        counts[i] = mp(cnt[i], i);

    sort(counts.rbegin(), counts.rend());

    vector<int> need(m);
    for (int i = 0; i < m; ++i)
        need[counts[i].second] = (i < n % m ? (n + m - 1) / m : n / m);

    int swaps = 0;
    for (int i = 0; i < n; ++i){
        if (a[i] >= m || cnt[a[i]] > need[a[i]]){
            for (int j = 0; j < m; ++j)
            if (cnt[j] < need[j]){
                swaps++;
                cnt[j]++;
                if (a[i] < m)
                    cnt[a[i]]--;
                a[i] = j;
                break;
            }
        }
    }

    cout << n / m << ' ' << swaps << endl;
    for (int i = 0; i < n; ++i)
        cout << a[i] + 1 << ' ';
    cout << endl;
    return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

const int MAXN = 2003;
int book[MAXN], a[MAXN], m, n, ans, tmp[MAXN], top, times;

int main() {
    while (cin >> n >> m) {
        memset(book, 0, sizeof(book));
        top = 0;
        ans = n / m;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] <= m)
                book[a[i]]++;
        }
        for (int i = 1; i <= m; i++) {
            if (book[i] < ans) {
                for (int j = 0; j < ans - book[i]; j++) {
                    tmp[top++] = i;
                }
            }
        }
        times = top;
        for (int i = 0; i < n && top > 0; i++) {
            if (a[i] > m) {
                a[i] = tmp[--top];
            }
        }
        cout << ans << " " << times << endl;
        for (int i = 0; i < n; i++) {
            if (a[i] <= m && book[a[i]] > ans && top > 0) {
                --book[a[i]];
                a[i] = tmp[--top];
            }
            cout << a[i] << " ";
        }
        cout << endl;
    }
    return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

const int MAXN = 2003;
int book[MAXN], a[MAXN], m, n, ans, tmp[MAXN], top;

int main() {
    while (cin >> n >> m) {
        memset(book, 0, sizeof(book));
        top = 0;
        ans = n / m;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] <= m)
                book[a[i]]++;
        }
        for (int i = 1; i <= m; i++) {
            if (book[i] < ans) {
                for (int j = 0; j < ans - book[i]; j++) {
                    tmp[top++] = i;
                }
            }
        }
        cout << ans << " " << top << endl;
        for (int i = 0; i < n; i++) {
            if (top > 0) {
                if (a[i] > m) {
                    a[i] = tmp[--top];
                } else if (book[a[i]] > ans) {
                    --book[a[i]];
                    a[i] = tmp[--top];
                }
            }
            cout << a[i] << " ";
        }
        cout << endl;
    }
    return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

const int MAXN = 2003;
int book[MAXN], a[MAXN], m, n, ans, tmp[MAXN], top, times;

int main() {
    while (cin >> n >> m) {
        memset(book, 0, sizeof(book));
        top = 0;
        ans = n / m;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if(a[i]<=m)
                book[a[i]]++;
        }
        for (int i = 1; i <= m; i++){
            if(book[i]<ans){
                for (int j = 0; j < ans - book[i]; j++){
                    tmp[top++] = i;
                }
            }
        }
        times = top;
        for (int i = 0; i < n && top > 0; i++) {
            if(a[i]>m){
                    a[i] = tmp[--top];
            }
        }
        cout << ans << " " << times << endl;
        for (int i = 0; i < n ; i++){
            if (a[i]<=m && book[a[i]] > ans && top > 0) {
                a[i] = tmp[--top];
                book[a[i]]--;
            }
            cout << a[i] << " ";
        }
        cout << endl;
    }
    return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

const int MAXN = 2003;
int book[MAXN], a[MAXN], m, n, ans, tmp[MAXN], top, times;

int main() {
    while (cin >> n >> m) {
        memset(book, 0, sizeof(book));
        top = 0;
        ans = n / m;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if(a[i]<=m)
                book[a[i]]++;
        }
        for (int i = 1; i <= m; i++){
            if(book[i]<ans){
                for (int j = 0; j < ans - book[i]; j++){
                    tmp[top++] = i;
                }
            }
        }
        times = top;
        for (int i = 0; i < n && top > 0; i++) {
            if(a[i]>m){
                a[i] = tmp[--top];
            }
        }
        cout << ans << " " << times << endl;
        for (int i = 0; i < n ; i++){
            if(book[a[i]]>ans && top > 0){
                a[i] = tmp[--top];
                book[a[i]]--;
            }
            cout << a[i] << " ";
        }
        cout << endl;
    }
    return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

const int MAXN = 2003;
int book[MAXN], a[MAXN], m, n, ans, cntLarge, tmp[MAXN], top, times;

int main() {
    while (cin >> n >> m) {
        memset(book, 0, sizeof(book));
        cntLarge = top = 0;
        ans = n / m;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if(a[i]<=m)
                book[a[i]]++;
            else
                cntLarge++;
        }
        for (int i = 1; i <= m; i++){
            if(book[i]<ans){
                for (int j = 0; j < ans - book[i]; j++){
                    tmp[top++] = i;
                }
            }
        }
        times = max(top, cntLarge);
        for (int i = 0; i < n; i++) {
            if(a[i]>m){
                if(top>0)
                    a[i] = tmp[--top];
                else
                    a[i] = 1;
            }
        }
        cout << ans << " " << times << endl;
        for (int i = 0; i < n ; i++){
            if(book[a[i]]>ans && top > 0){
                a[i] = tmp[--top];
                book[a[i]]--;
            }
            cout << a[i] << " ";
        }
        cout << endl;
    }
    return 0;
}


#include<cstdio>
#include<algorithm>
#define N 2000
using namespace std;
struct sd{
	int ct,cur;
}cnt[N+5];
int n,m,a[N+5],ans,ans0,stk[N+5],p1,p2=-1;
bool cmp(sd x1,sd x2)
{
	return x1.ct<x2.ct;
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)
	 {
	   scanf("%d",&a[i]);
	   if(a[i]<=m)
	     cnt[a[i]].ct++,cnt[a[i]].cur=a[i];
     }
    ans=n/m;
    sort(cnt+1,cnt+1+m,cmp);
    for (int i=1;i<=m;i++)
      {
      	 if(cnt[i].ct>=ans)  break;
      	 ans0+=(ans-cnt[i].ct);
      }
    printf("%d %d\n",ans,ans0);
    for (int i=1;i<=m;i++) cnt[i].ct=0;
    for (int i=1;i<=n;i++)
	 {
	   if(a[i]<=m)
	     cnt[a[i]].ct++,cnt[a[i]].cur=a[i];
     }
    for (int i=1;i<=m;i++)
      if(cnt[i].ct<ans) stk[++p2]=i;
    for (int i=1;i<=n;i++)
     {
     	if(a[i]<=m&&cnt[a[i]].ct>ans)
     	  {
     	  	 cnt[a[i]].ct--;
     	  	 a[i]=stk[p1];
     	  	 cnt[stk[p1]].ct++;
     	  	 if(cnt[stk[p1]].ct>=ans) p1++;
     	  	 if(p1>p2) break;
     	  }
     	else if(a[i]>m)
     	  {
     	   	 a[i]=stk[p1];
     	  	 cnt[stk[p1]].ct++;
     	  	 if(cnt[stk[p1]].ct>=ans) p1++;
     	  	 if(p1>p2) break;
     	  }
     }
    for (int i=1;i<=n;i++)
      printf("%d ",a[i]);
    return 0;
}
/*
5 1
1 3 5 4 6
*/


#include<cstdio>
#include<algorithm>
#define N 2000
using namespace std;
int cnt[N+5];
int n,m,a[N+5],ans,ans0,stk[N+5],p1,p2=-1;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)
	 {
	   scanf("%d",&a[i]);
	   if(a[i]<=m)
	     cnt[a[i]]++;
     }
    ans=n/m;
    for (int i=1;i<=m;i++)
      {
      	 if(cnt[i]<ans)
      	   ans0+=(ans-cnt[i]);
      }
    printf("%d",ans);
    for (int i=1;i<=m;i++)
      if(cnt[i]<ans) stk[++p2]=i;
    int lim;
    for (int i=1;i<=n;i++)
     {
     	if(a[i]<=m&&cnt[a[i]]>ans)
     	  {
		     if(p1>p2) {lim=i;break;}
     	  	 cnt[a[i]]--;
     	  	 a[i]=stk[p1];
     	  	 cnt[stk[p1]]++;
     	  	 if(cnt[stk[p1]]>=ans) p1++;

     	  }
     	else if(a[i]>m)
     	  {
		   	if(p1>p2) {lim=i;break;}
     	   	 a[i]=stk[p1];
     	  	 cnt[stk[p1]]++;
     	  	 if(cnt[stk[p1]]>=ans) p1++;

     	  }
     }
   /* for (int i=lim;i<=n;i++)
      if(a[i]>m) a[i]=1,ans0++;*/
    printf(" %d\n",ans0);
    for (int i=1;i<=n;i++)
      printf("%d ",a[i]);
    return 0;
}
/*
5 2
1 3 5 4 6
*/


#include<cstdio>
#include<algorithm>
#define N 2000
using namespace std;
int cnt[N+5];
int n,m,a[N+5],ans,ans0,stk[N+5],p1,p2=-1;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)
	 {
	   scanf("%d",&a[i]);
	   if(a[i]<=m)
	     cnt[a[i]]++;
     }
    ans=n/m;
    for (int i=1;i<=m;i++)
      {
      	 if(cnt[i]<ans)
      	   ans0+=(ans-cnt[i]);
      }
    printf("%d",ans);
    for (int i=1;i<=m;i++)
      if(cnt[i]<ans) stk[++p2]=i;
    int lim;
    for (int i=1;i<=n;i++)
     {
     	if(a[i]<=m&&cnt[a[i]]>ans)
     	  {
     	  	 cnt[a[i]]--;
     	  	 a[i]=stk[p1];
     	  	 cnt[stk[p1]]++;
     	  	 if(cnt[stk[p1]]>=ans) p1++;
     	  	 if(p1>p2) {lim=i;break;}
     	  }
     	else if(a[i]>m)
     	  {
     	   	 a[i]=stk[p1];
     	  	 cnt[stk[p1]]++;
     	  	 if(cnt[stk[p1]]>=ans) p1++;
     	  	 if(p1>p2) {lim=i;break;}
     	  }
     }
    for (int i=lim;i<=n;i++)
      if(a[i]>m) a[i]=1,ans0++;
    printf(" %d\n",ans0);
    for (int i=1;i<=n;i++)
      printf("%d ",a[i]);
    return 0;
}
/*
5 2
1 3 5 4 6
*/


#include<cstdio>
#include<algorithm>
#define N 2000
using namespace std;
int cnt[N+5];
int n,m,a[N+5],ans,ans0,stk[N+5],p1,p2=-1;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)
	 {
	   scanf("%d",&a[i]);
	   if(a[i]<=m)
	     cnt[a[i]]++;
     }
    ans=n/m;
    for (int i=1;i<=m;i++)
      {
      	 if(cnt[i]<ans)
      	   ans0+=(ans-cnt[i]);
      }
    printf("%d",ans);
    for (int i=1;i<=m;i++)
      if(cnt[i]<ans) stk[++p2]=i;
    int lim;
    for (int i=1;i<=n;i++)
     {
     	if(a[i]<=m&&cnt[a[i]]>ans)
     	  {
     	  	 cnt[a[i]]--;
     	  	 a[i]=stk[p1];
     	  	 cnt[stk[p1]]++;
     	  	 if(cnt[stk[p1]]>=ans) p1++;
     	  	 if(p1>p2) {lim=i;break;}
     	  }
     	else if(a[i]>m)
     	  {
     	   	 a[i]=stk[p1];
     	  	 cnt[stk[p1]]++;
     	  	 if(cnt[stk[p1]]>=ans) p1++;
     	  	 if(p1>p2) {lim=i;break;}
     	  }
     }
   /* for (int i=lim;i<=n;i++)
      if(a[i]>m) a[i]=1,ans0++;*/
    printf(" %d\n",ans0);
    for (int i=1;i<=n;i++)
      printf("%d ",a[i]);
    return 0;
}
/*
5 2
1 3 5 4 6
*/


#include<cstdio>
#include<algorithm>
#define N 2000
using namespace std;
struct sd{
	int ct,cur;
}cnt[N+5];
int n,m,a[N+5],ans,ans0,stk[N+5],p1,p2=-1;
bool cmp(sd x1,sd x2)
{
	return x1.ct<x2.ct;
}
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++)
	 {
	   scanf("%d",&a[i]);
	   if(a[i]<=m)
	     cnt[a[i]].ct++,cnt[a[i]].cur=a[i];
     }
    ans=n/m;
    sort(cnt+1,cnt+1+m,cmp);
    for (int i=1;i<=m;i++)
      {
      	 if(cnt[i].ct>=ans)  break;
      	 ans0+=(ans-cnt[i].ct);
      }
    printf("%d %d\n",ans,ans0);
    for (int i=1;i<=m;i++) cnt[i].ct=0;
    for (int i=1;i<=n;i++)
	 {
	   if(a[i]<=m)
	     cnt[a[i]].ct++,cnt[a[i]].cur=a[i];
     }
    for (int i=1;i<=m;i++)
      if(cnt[i].ct<ans) stk[++p2]=i;
    for (int i=1;i<=n;i++)
     {
     	if(a[i]<=m&&cnt[a[i]].ct>ans)
     	  {
     	  	 cnt[a[i]].ct--;
     	  	 a[i]=stk[p1];
     	  	 cnt[stk[p1]].ct++;
     	  	 if(cnt[stk[p1]].ct>=ans) p1++;
     	  	 if(p1>p2) break;
     	  }
     	else if(a[i]>m)
     	  {
     	   	 a[i]=stk[p1];
     	  	 cnt[stk[p1]].ct++;
     	  	 p1++;
     	  	 if(p1>p2) break;
     	  }
     }
    for (int i=1;i<=n;i++)
      printf("%d ",a[i]);
    return 0;
}
/*
4 4
1000000000 100 7 1000000000
*/


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    a[i] = min(a[i], m+1);
    b[a[i]]++;
  }
  LL l = 0, r = 4000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1LL) >> 1LL, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0LL) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[a[j]]) b[a[j]]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%I64d %I64d\n", l, res);
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    b[min(a[i], m+1)]++;
  }
  LL l = 0, r = 4000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1LL) >> 1LL, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0LL) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[m+1]) b[m+1]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%I64d %I64d\n", l, res);
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    b[min(a[i], m+1)]++;
  }
  LL l = 0, r = 4000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1LL) >> 1LL, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > mid) more += b[i] - mid;
    if (b[m+1] + more - less >= 0LL) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[m+1]) b[m+1]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[m+1]) b[m+1]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%I64d %I64d\n", l, res);
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    a[i] = min(a[i], m+1);
    b[a[i]]++;
  }
  LL l = 0, r = 2000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1LL) >> 1LL, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0LL) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[a[j]]) b[a[j]]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%I64d %I64d\n", l, res);
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    a[i] = min(a[i], m+1);
    b[a[i]]++;
  }
  LL l = 0, r = 2000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1) >> 1, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[a[j]]) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%I64d %I64d\n", l, res);
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    a[i] = min(a[i], m+1);
    b[a[i]]++;
  }
  LL l = 0, r = 4000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1LL) >> 1LL, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0LL) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[a[j]]) b[a[j]]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  for (int i = res; i <= b[m+1]; i++)
    for (int i = 1; i <= n; i++)
      if (a[i] > m) a[i] = 1;
  printf("%I64d %I64d\n", l, max(res,b[m+1]));
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;

LL n, m, a[2010], b[2010];

int main() {
  scanf("%I64d%I64d", &n, &m);
  for (LL i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    b[min(a[i], m+1)]++;
  }
  LL l = 0, r = 4000, res = 0;
  while (l < r) {
    LL mid = (l + r + 1LL) >> 1LL, less = 0, more = 0;
    for (LL i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0LL) l = mid;
    else r = mid-1;
  }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[m+1]) b[m+1]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  for (LL i = 1; i <= m; i++)
    if (b[i] < l)
      for (LL j = 1; j <= n; j++) {
        if (a[j] > m && b[m+1]) b[m+1]--, a[j] = i, b[i]++, res++;
        else if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%I64d %I64d\n", l, res);
  for (LL i = 1; i <= n; i++)
    printf("%I64d ", a[i]);
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int n, m, a[2010], b[2010];

int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    a[i] = min(a[i], m+1);
    b[a[i]]++;
  }
  int l = 0, r = 2000, res = 0;
  while (l < r) {
    int mid = (l + r + 1) >> 1, less = 0, more = 0;
    for (int i = 1; i <= m; i++)
      if (b[i] < mid) less += mid - b[i];
      else if (b[i] > m) more += b[i] - mid;
    if (b[m+1] + more - less >= 0) l = mid;
    else r = mid-1;
  }
  for (int i = 1; i <= m; i++)
    if (b[i] < l)
      for (int j = 1; j <= n; j++) {
        if (a[j] > m && b[a[j]]) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (!b[m+1] && a[j] <= m && b[a[j]] > l) b[a[j]]--, a[j] = i, b[i]++, res++;
        if (b[i] == l) break;
      }
  printf("%d %d\n", l, res);
  for (int i = 1; i <= n; i++)
    printf("%d ", a[i]);
  return 0;
}


//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 2005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, m, a[maxN], cnt1, cnt2, m1, m2, tar[maxN];
vector<int> tC, cT;
ii cnt[maxN];

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d%d", &n, &m);
    fto(i, 1, n) scanf("%d", &a[i]);
    if (m <= n) {
        m2 = n/m;
        m1 = m2+1;
        cnt1 = n%m;
        cnt2 = m-cnt1;

        fto(i, 1, cnt2) {
            tar[i] = m2;
        }
        fto(i, cnt2+1, cnt2+cnt1) {
            tar[i] = m1;
        }
    //    printf("%d %d %d %d\n", cnt2, m2, cnt1, m1);
    //    fto(i, 1, m) printf("%d ", tar[i]);
    //    puts("");
        fto(i, 1, m) cnt[i].ss = i;
        fto(i, 1, n) {
            if (a[i] <= m) ++cnt[a[i]].ff;
            else tC.pb(a[i]);
        }

        sort(cnt+1, cnt+m+1);
        fto(i, 1, m) {
            fto(j, m2+1, cnt[i].ff) tC.pb(cnt[i].ss);
            fto(j, cnt[i].ff+1, m2) cT.pb(cnt[i].ss);
        }
    //    forit(it, tC) printf("%d ", *it);
    //    puts("");
    //    forit(it, cT) printf("%d ", *it);
    //    puts("");

        fto(i, 0, (int)cT.size()-1) {
            fto(j, 1, n) {
                if (a[j] == tC[i]) {
                    a[j] = cT[i];
                    break;
                }
            }
        }
    }
    else {m2 = 0;}
    printf("%d %d\n", m2, cT.size());
    fto(i, 1, n) printf("%d ", a[i]);

    return 0;
}


//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 2005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, m, a[maxN], cnt1, cnt2, m1, m2, tar[maxN];
vector<int> tC, cT;
ii cnt[maxN];

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d%d", &n, &m);
    fto(i, 1, n) scanf("%d", &a[i]);
    if (m <= n) {
        m2 = n/m;
        m1 = m2+1;
        cnt1 = n%m;
        cnt2 = m-cnt1;

        fto(i, 1, cnt2) {
            tar[i] = m2;
        }
        fto(i, cnt2+1, cnt2+cnt1) {
            tar[i] = m1;
        }
    //    printf("%d %d %d %d\n", cnt2, m2, cnt1, m1);
    //    fto(i, 1, m) printf("%d ", tar[i]);
    //    puts("");
        fto(i, 1, m) cnt[i].ss = i;
        fto(i, 1, n) {
            if (a[i] <= m) ++cnt[a[i]].ff;
            else tC.pb(a[i]);
        }

        sort(cnt+1, cnt+m+1);
        fto(i, 1, m) {
            fto(j, tar[i]+1, cnt[i].ff) tC.pb(cnt[i].ss);
            fto(j, cnt[i].ff+1, tar[i]) cT.pb(cnt[i].ss);
        }
    //    forit(it, tC) printf("%d ", *it);
    //    puts("");
    //    forit(it, cT) printf("%d ", *it);
    //    puts("");

        fto(i, 0, (int)tC.size()-1) {
            fto(j, 1, n) {
                if (a[j] == tC[i]) {
                    a[j] = cT[i];
                    break;
                }
            }
        }
    }
    else {m2 = 0;}
    printf("%d %d\n", m2, tC.size());
    fto(i, 1, n) printf("%d ", a[i]);

    return 0;
}


//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 2005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, m, a[maxN], cnt1, cnt2, m1, m2, tar[maxN];
vector<int> tC, cT;
ii cnt[maxN];

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d%d", &n, &m);
    fto(i, 1, n) scanf("%d", &a[i]);
    if (m <= n) {
        m2 = n/m;
        m1 = m2+1;
        cnt1 = n%m;
        cnt2 = m-cnt1;

        fto(i, 1, cnt2) {
            tar[i] = m2;
        }
        fto(i, cnt2+1, cnt2+cnt1) {
            tar[i] = m1;
        }
    //    printf("%d %d %d %d\n", cnt2, m2, cnt1, m1);
    //    fto(i, 1, m) printf("%d ", tar[i]);
    //    puts("");
        fto(i, 1, m) cnt[i].ss = i;
        fto(i, 1, n) {
            if (a[i] <= m) ++cnt[a[i]].ff;
            else tC.pb(a[i]);
        }

        sort(cnt+1, cnt+m+1);
        fto(i, 1, m) {
            fto(j, m2, cnt[i].ff) tC.pb(cnt[i].ss);
            fto(j, cnt[i].ff+1, m2) cT.pb(cnt[i].ss);
        }
    //    forit(it, tC) printf("%d ", *it);
    //    puts("");
    //    forit(it, cT) printf("%d ", *it);
    //    puts("");

        fto(i, 0, (int)cT.size()-1) {
            fto(j, 1, n) {
                if (a[j] == tC[i]) {
                    a[j] = cT[i];
                    break;
                }
            }
        }
    }
    else {m2 = 0;}
    printf("%d %d\n", m2, cT.size());
    fto(i, 1, n) printf("%d ", a[i]);

    return 0;
}


//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 2005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, m, a[maxN], cnt1, cnt2, m1, m2, tar[maxN];
vector<int> tC, cT;
ii cnt[maxN];

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d%d", &n, &m);
    fto(i, 1, n) scanf("%d", &a[i]);
    if (m <= n) {
        m2 = n/m;
        m1 = m2+1;
        cnt1 = n%m;
        cnt2 = (n-cnt1*m1)/m2;

        fto(i, 1, cnt2) {
            tar[i] = m2;
        }
        fto(i, cnt2+1, cnt2+cnt1) {
            tar[i] = m1;
        }
    //    printf("%d %d %d %d\n", cnt2, m2, cnt1, m1);
    //    fto(i, 1, m) printf("%d ", tar[i]);
    //    puts("");
        fto(i, 1, m) cnt[i].ss = i;
        fto(i, 1, n) {
            if (a[i] <= m) ++cnt[a[i]].ff;
            else tC.pb(a[i]);
        }

        sort(cnt+1, cnt+m+1);
        fto(i, 1, m) {
            fto(j, tar[i]+1, cnt[i].ff) tC.pb(cnt[i].ss);
            fto(j, cnt[i].ff+1, tar[i]) cT.pb(cnt[i].ss);
        }
    //    forit(it, tC) printf("%d ", *it);
    //    puts("");
    //    forit(it, cT) printf("%d ", *it);
    //    puts("");

        fto(i, 0, tC.size()-1) {
            fto(j, 1, n) {
                if (a[j] == tC[i]) {
                    a[j] = cT[i];
                    break;
                }
            }
        }
    }
    else {m2 = 0;}
    printf("%d %d\n", m2, tC.size());
    fto(i, 1, n) printf("%d ", a[i]);

    return 0;
}


//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 2005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, m, a[maxN], cnt1, cnt2, m1, m2, tar[maxN];
vector<int> tC, cT;
ii cnt[maxN];

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d%d", &n, &m);
    fto(i, 1, n) scanf("%d", &a[i]);

    m2 = n/m;
    m1 = m2+1;
    cnt1 = n%m;
    cnt2 = (n-cnt1*m1)/m2;

    fto(i, 1, cnt2) {
        tar[i] = m2;
    }
    fto(i, cnt2+1, cnt2+cnt1) {
        tar[i] = m1;
    }
//    printf("%d %d %d %d\n", cnt2, m2, cnt1, m1);
//    fto(i, 1, m) printf("%d ", tar[i]);
//    puts("");
    fto(i, 1, m) cnt[i].ss = i;
    fto(i, 1, n) {
        if (a[i] <= m) ++cnt[a[i]].ff;
        else tC.pb(a[i]);
    }

    sort(cnt+1, cnt+m+1);
    fto(i, 1, m) {
        fto(j, tar[i]+1, cnt[i].ff) tC.pb(cnt[i].ss);
        fto(j, cnt[i].ff+1, tar[i]) cT.pb(cnt[i].ss);
    }
//    forit(it, tC) printf("%d ", *it);
//    puts("");
//    forit(it, cT) printf("%d ", *it);
//    puts("");
    printf("%d %d\n", cnt2, tC.size());
    fto(i, 0, tC.size()-1) {
        fto(j, 1, n) {
            if (a[j] == tC[i]) {
                a[j] = cT[i];
                break;
            }
        }
    }
    fto(i, 1, n) printf("%d ", a[i]);

    return 0;
}


//84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i,  r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define fordit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define ll long long
#define maxN 2005

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, m, a[maxN], cnt1, cnt2, m1, m2, tar[maxN];
vector<int> tC, cT;
ii cnt[maxN];

int main () {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif // ONLINE_JUDGE

    scanf("%d%d", &n, &m);
    fto(i, 1, n) scanf("%d", &a[i]);

    m2 = n/m;
    m1 = m2+1;
    cnt1 = n%m;
    cnt2 = (n-cnt1*m1)/m2;

    fto(i, 1, cnt2) {
        tar[i] = m2;
    }
    fto(i, cnt2+1, cnt2+cnt1) {
        tar[i] = m1;
    }
//    printf("%d %d %d %d\n", cnt2, m2, cnt1, m1);
//    fto(i, 1, m) printf("%d ", tar[i]);
//    puts("");
    fto(i, 1, m) cnt[i].ss = i;
    fto(i, 1, n) {
        if (a[i] <= m) ++cnt[a[i]].ff;
        else tC.pb(a[i]);
    }

    sort(cnt+1, cnt+m+1);
    fto(i, 1, m) {
        fto(j, tar[i]+1, cnt[i].ff) tC.pb(cnt[i].ss);
        fto(j, cnt[i].ff+1, tar[i]) cT.pb(cnt[i].ss);
    }
//    forit(it, tC) printf("%d ", *it);
//    puts("");
//    forit(it, cT) printf("%d ", *it);
//    puts("");
    printf("%d %d\n", m2, tC.size());
    fto(i, 0, tC.size()-1) {
        fto(j, 1, n) {
            if (a[j] == tC[i]) {
                a[j] = cT[i];
                break;
            }
        }
    }
    fto(i, 1, n) printf("%d ", a[i]);

    return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}
		int flag = 0;
		if(n%m)	flag = 1;
		int ans = n/m;
		int num = 0;
		if(flag)
		{
			int left = n%m;
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans+1 && left > 0 || a[i] <= m && b[a[i]] == ans+1 && left == 0 && vis[a[i]] == 0)
				{
					int j ;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m && left > 0 && vis[a[i]] == 0)
					{
						left--;
						vis[a[i]] = 1;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		else
		{
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		printf("%d %d\n",ans,num);
		flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}
		int flag = 0;
		if(n%m)	flag = 1;
		int ans = n/m;
		int num = 0;
		if(flag)
		{
			int left = n%m;
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans+1 && left > 0 || a[i] <= m && b[a[i]] == ans+1 && left == 0 && vis[a[i]] == 0)
				{
					int j ;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(left > 0 && vis[a[i]] == 0)
					{
						left--;
						vis[a[i]] = 1;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;

				}
			}
		}
		else
		{
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		printf("%d %d\n",ans,num);
		flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}
		int flag = 0;
		if(n%m)	flag = 1;
		int ans = n/m;
		int num = 0;
		if(flag)
		{
			int left = n%m;
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans+1 && left > 0 || a[i] <= m && b[a[i]] > ans && left == 0 && vis[a[i]] == 0)
				{
					int j ;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m && left > 0 && vis[a[i]] == 0)
					{
						left--;
						vis[a[i]] = 1;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		else
		{
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		printf("%d %d\n",ans,num);
		flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}

		int ans = n/m;
		int num = 0;

			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(j == m+1)	break;
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}

		printf("%d %d\n",ans,num);
		int flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}
		int flag = 0;
		if(n%m)	flag = 1;
		int ans = n/m;
		int num = 0;
		if(flag)
		{
			int left = n%m;
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans+1 && left > 0 || a[i] <= m && b[a[i]] > ans && left == 0 && vis[a[i]] == 0)
				{
					int j ;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(j == m+1)
					{
						int k;
						for(k = 1;k <= m;k++)
						{
							if(b[k] == ans)	break;
						}
						if(a[i] <= m)	b[a[i]]--;
						a[i] = k;
						b[k]++;
						num++;
						vis[k] = 1;
						left--;
						continue;
					}
					if(a[i] <= m && left > 0 && vis[a[i]] == 0)
					{
						left--;
						vis[a[i]] = 1;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		else
		{
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		printf("%d %d\n",ans,num);
		flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}

		int ans = n/m;
		int num = 0;

			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}

		printf("%d %d\n",ans,num);
		int flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
using namespace std;

int a[2005],b[2005] = {0},vis[2005] = {0};

	int main()
	{
		int m,n;
		scanf("%d%d",&n,&m);
		for(int i = 1;i <= n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i] <= m)	b[a[i]]++;
		}
		int flag = 0;
		if(n%m)	flag = 1;
		int ans = n/m;
		int num = 0;
		if(flag)
		{
			int left = n%m;
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans+1 && left > 0 || a[i] <= m && b[a[i]] > ans && left == 0 && vis[a[i]] == 0)
				{
					int j ;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(j == m+1)
					{

						continue;
					}
					if(a[i] <= m && left > 0 && vis[a[i]] == 0)
					{
						left--;
						vis[a[i]] = 1;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		else
		{
			for(int i = 1;i <= n;i++)
			{
				if(a[i] > m || a[i] <= m && b[a[i]] > ans)
				{
					int j;
					for(j = 1;j <= m;j++)
					{
						if(b[j] < ans)	break;
					}
					if(a[i] <= m)	b[a[i]]--;
					a[i] = j;
					b[j]++;
					num++;
				}
			}
		}
		printf("%d %d\n",ans,num);
		flag = 1;
		for(int i = 1;i <= n;i++)
		{
			if(flag)
			{
				printf("%d",a[i]);
				flag = 0;
			}
			else
			{
				printf(" %d",a[i]);
			}
		}
		printf("\n");
		return 0;
	}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;

#define forall(i,b)                 for(int i=0;i<b;i++)
#define sforall(i,s,b)              for(int i=s;i<b;i++)
#define sortall(a)                  sort(a.begin(), a.end())
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define pb push_back
#define mp make_pair

int main(){ _

	int i,j,n,m;
	cin>>n>>m;
	int a[2001];

	std::vector<int> v;
	int br=0;
	int nova[2010]={0};
	for (i=0;i<n;i++) {
		cin>>a[i];
		if (a[i]>=1 && a[i]<=m) {
			v.push_back(a[i]);
			nova[a[i]]++;
		} else {
			v.push_back(-1);
			br++;
		}
	}

	for (i=0;i<v.size();i++)
	if (v[i]==-1) {
		int min1=10000000;
		int poz1=-1;
		for (j=1;j<=m;j++)
		if (nova[j]<min1) {
			min1=nova[j];
			poz1=j;
		}
		v[i] = poz1;
		nova[poz1]++;
	}

	int maxR=0;

	while (true) {

		int min1=1000000;
		int max1=0;
		int poz1=-1,poz2=-1;

		for (i=1;i<=m;i++)
		{
			if (nova[i]<min1) {
				min1=nova[i];
				poz1=i;
			}
			if (nova[i]>max1) {
				max1=nova[i];
				poz2=i;
			}
		}

		if (poz1==poz2 || max1==min1+1) {
			break;
		}

		nova[poz2]--;
		nova[poz1]++;
		v[poz2]=poz1;

		br++;

		if (min1>maxR) {
			maxR=min1;
		} else {
			break;
		}

	}

	int min1=1000000;
	for (i=1;i<=m;i++)
	if (nova[i]<min1) {
		min1=nova[i];
	}

	if (min1>maxR) maxR=min1;

	cout<<maxR<<" "<<br<<"\n";
	for (i=0;i<v.size();i++) cout<<v[i]<<" ";
	cout<<"\n";

	return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;

#define forall(i,b)                 for(int i=0;i<b;i++)
#define sforall(i,s,b)              for(int i=s;i<b;i++)
#define sortall(a)                  sort(a.begin(), a.end())
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define pb push_back
#define mp make_pair

int main(){ _

	//freopen("input.in","r",stdin);

	int i,j,n,m;
	cin>>n>>m;
	int a[2001];

    int kolku=(n/m)*m+1;
    //cout<<"Kolku: "<<kolku<<"\n";

	std::vector<int> v;
	int br=0;
	int nova[2010]={0};
	for (i=0;i<n;i++) {

		cin>>a[i];
		kolku--;
		if (a[i]>=1 && a[i]<=m) {
			v.push_back(a[i]);
			nova[a[i]]++;
		} else
		if (kolku>0) {
            //cout<<"kolku-"<<kolku<<"\n";
			v.push_back(-1);
			br++;
		} else
		if (kolku<=0) {
            v.push_back(a[i]);
		}
	}

	for (i=0;i<v.size();i++)
	if (v[i]==-1) {
		int min1=10000000;
		int poz1=-1;
		for (j=1;j<=m;j++)
		if (nova[j]<min1) {
			min1=nova[j];
			poz1=j;
		}
		v[i] = poz1;
		nova[poz1]++;
	}

	int maxR=0;

	while (true) {

		int min1=1000000;
		int max1=0;
		int poz1=-1,poz2=-1;

		for (i=1;i<=m;i++)
		{
			if (nova[i]<min1) {
				min1=nova[i];
				poz1=i;
			}
			if (nova[i]>max1) {
				max1=nova[i];
				poz2=i;
			}
		}

		if (poz1==poz2 || max1==min1+1) {
			break;
		}

		nova[poz2]--;
		nova[poz1]++;
		v[poz2]=poz1;

		br++;

		if (min1>maxR) {
			maxR=min1;
		} else {
			break;
		}

	}

	int min1=1000000;
	for (i=1;i<=m;i++)
	if (nova[i]<min1) {
		min1=nova[i];
	}

	if (min1>maxR) maxR=min1;

	cout<<maxR<<" "<<br<<"\n";
	for (i=0;i<v.size();i++) cout<<v[i]<<" ";
	cout<<"\n";

	return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;

int main(){ _

    //freopen("input.in","r",stdin);

	int i,j,n,m;
	cin>>n>>m;
	long long a[2001];

    int kolku=n/m;

	std::vector<int> v;

    int niza[2010]={0};

    vector<long long> ostanati;

	for (i=0;i<n;i++) {
		cin>>a[i];
		if (a[i]>=1 && a[i]<=m) {
            niza[a[i]]++;
		} else {
            ostanati.push_back(i);
		}
	}

    int dd=0;
    int br=0;
    i=1;

    while (i<=m) {

        if (niza[i]<kolku) {
            if (dd<ostanati.size()) {
                int poz = ostanati[dd++];
                a[poz]=i;
                niza[i]++;
                br++;
            } else {
                bool ok = true;
                for (j=1;j<=m;j++)
                if (niza[j]>kolku && j!=i) {
                    niza[j]--;
                    int r;
                    for (r=0;r<n;r++)
                    if (a[r]==j) {
                        br++;
                        a[r] = i;
                        break;
                    }
                    niza[i]++;
                    break;
                }
            }
        } else i++;
    }

    cout<<kolku<<" "<<br<<"\n";
    for (i=0;i<n;i++) cout<<a[i]<<" ";
    cout<<"\n";

    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;

int main(){ _

	int i,j,n,m;
	cin>>n>>m;
	int a[2001];

    int kolku=n/m;

	std::vector<int> v;

    int niza[2010];

    vector<int> ostanati;

    int minB=2010, maxB=0;

	for (i=0;i<n;i++) {
		cin>>a[i];
		if (a[i]>=1 && a[i]<=m) {
            niza[a[i]]++;
            minB=min(minB,a[i]);
            maxB=max(maxB,a[i]);
		} else {
            ostanati.push_back(i);
		}
	}

    i=1;
    int br=0;
    while (i<=m) {
        if (niza[i]<kolku) {
            if (ostanati.size()) {
                int poz = ostanati[0];
                a[poz]=i;
                niza[i]++;
                br++;
                ostanati.erase(ostanati.begin());
            } else {
                for (j=minB;j<=maxB;j++)
                if (niza[j]>kolku) {
                    niza[j]--;
                    int r;
                    for (r=0;r<n;r++)
                    if (a[r]==j) {
                        br++;
                        a[r] = i;
                        break;
                    }
                    niza[i]++;
                }
            }
        } else i++;
    }

    cout<<kolku<<" "<<
    br<<"\n";
    for (i=0;i<n;i++) cout<<a[i]<<" ";
    cout<<"\n";

    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;

int main(){ _

	int i,j,n,m;
	cin>>n>>m;
	long long a[2001];

    int kolku=n/m;

	std::vector<int> v;

    int niza[2010];

    vector<long long> ostanati;

    long long minB=2010, maxB=0;

	for (i=0;i<n;i++) {
		cin>>a[i];
		if (a[i]>=1 && a[i]<=m) {
            niza[a[i]]++;
            minB=min(minB,a[i]);
            maxB=max(maxB,a[i]);
		} else {
            ostanati.push_back(i);
		}
	}

    i=1;
    int dd=0;
    int br=0;
    while (i<=m) {
        if (niza[i]<kolku) {
            if (ostanati.size()) {
                int poz = ostanati[dd++];
                a[poz]=i;
                niza[i]++;
                br++;
            } else {
                for (j=minB;j<=maxB;j++)
                if (niza[j]>kolku) {
                    niza[j]--;
                    int r;
                    for (r=0;r<n;r++)
                    if (a[r]==j) {
                        br++;
                        a[r] = i;
                        break;
                    }
                    niza[i]++;
                }
            }
        } else i++;
    }

    cout<<kolku<<" "<<
    br<<"\n";
    for (i=0;i<n;i++) cout<<a[i]<<" ";
    cout<<"\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 2005

map<int,int> cnt;
int a[MAX],b[MAX];

int checkValid(int n,int m,int x){

	int curr = 1;
	cnt.clear();
	int cost = 0;

	for(int i = 0;i<n;i++)
		cnt[a[i]]++;

	for(int i = 1;i<=m;i++)
	{
		if(cnt[i]<x) {

			cost+=(x-cnt[i]);
			cnt[i] = x;
		}
		else {
			cnt[i] = min(cnt[i],max(0,n-(m-1)*x));
		}
	}

	queue<int> q;
	for(int i = 0;i<n;i++){

		if(a[i]<=m)
		{
			if(cnt[a[i]]>0)
			{
				cnt[a[i]]--;
				b[i] = a[i];
			}
			else {
				q.push(i);
			}
		}
	}

	while(!q.empty()) {

		int i  = q.front();
		q.pop();

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	for(int i = 0;i<n;i++) {

		if(a[i]<=m)
			continue;

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	cnt.clear();
	for(int i = 0;i<n;i++){
		cnt[b[i]]++;
	}
	for(int i = 1;i<=m;i++){
		if(cnt[i]<x) {
			return INT_MAX;
		}
	}
	return cost;
}

int main() {

	int n,m;
	cin>>n>>m;

	for(int i = 0;i<n;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}

	for(int i = n;i>=0;i--){

		int cost = checkValid(n,m,i);
	//	cout<<cost<<endl;
		if(cost!=INT_MAX)
		{
			cout<<i<<" "<<cost<<endl;

			for(int j = 0;j<n;j++)
				cout<<b[j]<<" ";
			cout<<endl;
			break;

		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 2005

map<int,int> cnt;
int a[MAX],b[MAX];

int checkValid(int n,int m,int x){

	int curr = 1;
	cnt.clear();
	int cost = 0;

	for(int i = 0;i<n;i++)
		cnt[a[i]]++;

	for(int i = 1;i<=m;i++)
	{
		if(cnt[i]<x) {

			cost+=(x-cnt[i]);
			cnt[i] = x;
		}
		else {
			cnt[i] = min(cnt[i],max(0,n-(m-1)*x));
		}
	}

	queue<int> q;
	for(int i = 0;i<n;i++){

		if(a[i]<=m)
		{
			if(cnt[a[i]]>0)
			{
				cnt[a[i]]--;
				b[i] = a[i];
			}
			else {
				q.push(i);
			}
		}
	}

	while(!q.empty()) {

		int i  = q.front();
		q.pop();

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	for(int i = 0;i<n;i++) {

		if(a[i]<=m)
			continue;

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	cnt.clear();
	for(int i = 0;i<n;i++){
		cnt[b[i]]++;
	}
	for(int i = 1;i<=m;i++){
		if(cnt[i]<x) {
			return INT_MAX;
		}
	}
	return cost;
}

int main() {

	int n,m;
	cin>>n>>m;

	for(int i = 0;i<n;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}

	for(int i = n;i>=0;i--){

		int cost = checkValid(n,m,i);
	//	cout<<cost<<endl;
		if(cost!=INT_MAX)
		{
			cout<<i<<" "<<cost<<endl;

			for(int j = 0;j<n;j++)
				cout<<b[j]<<" ";
			cout<<endl;
			break;

		}
	}

	//checkValid(n,m,2);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 2005

map<int,int> cnt;
int a[MAX],b[MAX];

int checkValid(int n,int m,int x){

	int curr = 1;
	cnt.clear();
	int cost = 0;

	for(int i = 0;i<n;i++)
		cnt[a[i]]++;

	for(int i = 1;i<=m;i++)
	{
		if(cnt[i]<x) {

			cost+=(x-cnt[i]);
			cnt[i] = x;
		}
		else {
			cnt[i] = min(cnt[i], n-(m-1)*x);
		}
	}

	queue<int> q;

	for(int i = 0;i<n;i++){

		if(a[i]<=m)
		{
			if(cnt[a[i]]>0)
			{
				cnt[a[i]]--;
				b[i] = a[i];
			}
			else {
				q.push(i);
			}
		}
	}

	while(!q.empty()) {

		int i  = q.front();
		q.pop();

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			cost++;
			b[i] = m;
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}
	//for(int i = 0;i<n;i++)
	//	cout<<b[i]<<" ";
	//cout<<endl;

	for(int i = 0;i<n;i++) {

		if(a[i]<=m)
			continue;

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			cost++;
			b[i] = m;
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	cnt.clear();
	for(int i = 0;i<n;i++){
		cnt[b[i]]++;
	}

	for(int i = 1;i<=m;i++){
		if(cnt[i]<x) {
			return INT_MAX;
		}
	}
	return cost;
}

int main() {

	int n,m;
	cin>>n>>m;

	for(int i = 0;i<n;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}

	for(int i = n;i>=0;i--){

		int cost = checkValid(n,m,i);
	//	cout<<cost<<endl;
		if(cost!=INT_MAX)
		{
			cout<<i<<" "<<cost<<endl;

			for(int j = 0;j<n;j++)
				cout<<b[j]<<" ";
			cout<<endl;
			break;

		}
	}

	//checkValid(n,m,2);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 2005

map<int,int> cnt;
int a[MAX],b[MAX];

int checkValid(int n,int m,int x){

	int curr = 1;
	cnt.clear();
	int cost = 0;

	for(int i = 0;i<n;i++)
		cnt[a[i]]++;

	for(int i = 1;i<=m;i++)
	{
		if(cnt[i]<x) {

			cost+=(x-cnt[i]);
			cnt[i] = x;
		}
		else {
			cnt[i] = min(cnt[i],max(0,n/m));
		}
	}

	queue<int> q;
	for(int i = 0;i<n;i++){

		if(a[i]<=m)
		{
			if(cnt[a[i]]>0)
			{
				cnt[a[i]]--;
				b[i] = a[i];
			}
			else {
				q.push(i);
			}
		}
	}

	while(!q.empty()) {

		int i  = q.front();
		q.pop();

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	for(int i = 0;i<n;i++) {

		if(a[i]<=m)
			continue;

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	cnt.clear();
	for(int i = 0;i<n;i++){
		cnt[b[i]]++;
	}
	for(int i = 1;i<=m;i++){
		if(cnt[i]<x) {
			return INT_MAX;
		}
	}
	return cost;
}

int main() {

	int n,m;
	cin>>n>>m;

	for(int i = 0;i<n;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}

	for(int i = n;i>=0;i--){

		int cost = checkValid(n,m,i);
	//	cout<<cost<<endl;
		if(cost!=INT_MAX)
		{
			cout<<i<<" "<<cost<<endl;

			for(int j = 0;j<n;j++)
				cout<<b[j]<<" ";
			cout<<endl;
			break;

		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 2005

	int n,m;
map<int,int> cnt;
int a[MAX],b[MAX];

int checkValid(int n,int m,int x){

	int curr = 1;
	cnt.clear();
	int cost = 0;

	for(int i = 0;i<n;i++)
		cnt[a[i]]++;

	for(int i = 1;i<=m;i++)
	{
		if(cnt[i]<x) {

			cost+=(x-cnt[i]);
			cnt[i] = x;
		}
		else {
			cnt[i] = min(cnt[i],max(0,n/m));
		}
	}

	queue<int> q;
	for(int i = 0;i<n;i++){

		if(a[i]<=m)
		{
			if(cnt[a[i]]>0)
			{
				cnt[a[i]]--;
				b[i] = a[i];
			}
			else {
				q.push(i);
			}
		}
	}

	while(!q.empty()) {

		int i  = q.front();
		q.pop();

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	for(int i = 0;i<n;i++) {

		if(a[i]<=m)
			continue;

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	cnt.clear();
	for(int i = 0;i<n;i++){
		cnt[b[i]]++;
	}
	for(int i = 1;i<=m;i++){
		if(cnt[i]<x) {
			return INT_MAX;
		}
	}
	return cost;
}

int main() {

	cin>>n>>m;

	for(int i = 0;i<n;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}

	for(int i = n/m;i>=0;i--){

		int cost = checkValid(n,m,i);
	//	cout<<cost<<endl;
		if(cost!=INT_MAX)
		{
			cout<<i<<" "<<cost<<endl;

			for(int j = 0;j<n;j++)
				cout<<b[j]<<" ";
			cout<<endl;
			break;

		}
	}

//	bs(0,n);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define MAX 2005

map<int,int> cnt;
int a[MAX],b[MAX];

int checkValid(int n,int m,int x){

	int curr = 1;
	cnt.clear();
	int cost = 0;

	for(int i = 0;i<n;i++)
		cnt[a[i]]++;

	for(int i = 1;i<=m;i++)
	{
		if(cnt[i]<x) {

			cost+=(x-cnt[i]);
			cnt[i] = x;
		}
		else {
			cnt[i] = min(cnt[i], n-(m-1)*x);
		}
	}

	queue<int> q;
	for(int i = 0;i<n;i++){

		if(a[i]<=m)
		{
			if(cnt[a[i]]>0)
			{
				cnt[a[i]]--;
				b[i] = a[i];
			}
			else {
				q.push(i);
			}
		}
	}

	while(!q.empty()) {

		int i  = q.front();
		q.pop();

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			cost++;
			b[i] = m;
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	for(int i = 0;i<n;i++) {

		if(a[i]<=m)
			continue;

		while(curr<=m && cnt[curr]<=0)
		curr++;

		if(curr==m+1) {
			b[i] = a[i];
		}
		else {
			cnt[curr]--;
			b[i] = curr;
		}
	}

	cnt.clear();
	for(int i = 0;i<n;i++){
		cnt[b[i]]++;
	}
	for(int i = 1;i<=m;i++){
		if(cnt[i]<x) {
			return INT_MAX;
		}
	}
	return cost;
}

int main() {

	int n,m;
	cin>>n>>m;

	for(int i = 0;i<n;i++)
	{
		cin>>a[i];
		cnt[a[i]]++;
	}

	for(int i = n;i>=0;i--){

		int cost = checkValid(n,m,i);
	//	cout<<cost<<endl;
		if(cost!=INT_MAX)
		{
			cout<<i<<" "<<cost<<endl;

			for(int j = 0;j<n;j++)
				cout<<b[j]<<" ";
			cout<<endl;
			break;

		}
	}

	//checkValid(n,m,2);

	return 0;
}


#include<queue>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define MAXN 2000
using namespace std;

int a[MAXN+70],b[MAXN+70],chg[MAXN+70];
int c[MAXN+70],d[MAXN+70];
int main()
{
	int m,n,cnt[2]={0,0},i,j,k=1;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	cnt[0]=n/m;
	for(i=1;i<=n;i++)
	{
		if(a[i]<=m)
			b[a[i]]++;
		else
			chg[++chg[0]]=i;
	}
	for(i=j=1;i<=m;)
	{
		while(i<=m&&b[i]>=cnt[0])
			i++;
		while(j<=m&&b[j]<=cnt[0])
			j++;
		while(b[i]<cnt[0]&&k<=chg[0])
		{
			b[i]++;
			a[chg[k++]]=i;
			cnt[1]++;
		}
		if(i<=m&&b[i]<cnt[0]&&j<=m&&b[j]>cnt[0])
		{
			c[j]=i;
			while(b[i]<cnt[0]&&j<=m&&b[j]>cnt[0])
			{
				b[i]++;
				b[j]--;
				d[j]++;
				cnt[1]++;
			}
		}
	}
	for(i=1;i<=n;i++)
		if(d[a[i]])
		{
			d[a[i]]--;
			a[i]=c[a[i]];
		}
	printf("%d %d\n",cnt[0],cnt[1]);
	for(i=1;i<n;i++)
		printf("%d ",a[i]);
	printf("%d",a[i]);
	return 0;
}


#include<queue>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define MAXN 2000
using namespace std;

int a[MAXN+70],b[MAXN+70],chg[MAXN+70];
queue<int> c[MAXN+70];
int main()
{
	int m,n,cnt[2]={0,0},i,j,t;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	cnt[0]=n/m;
	for(i=1;i<=n;i++)
	{
		if(a[i]<=m)
			b[a[i]]++;
		else
			chg[++chg[0]]=i;
	}
	for(i=j=1;i<=m;)
	{
		while(i<=m&&b[i]>=cnt[0])
			i++;
		while(j<=m&&b[j]<=cnt[0])
			j++;
		while(i<=m&&b[i]<cnt[0]&&chg[0])
		{
			b[i]++;
			a[chg[chg[0]--]]=i;
			cnt[1]++;
		}
		while(i<=m&&b[i]<cnt[0]&&j<=m&&b[j]>cnt[0])
		{
			b[i]++;
			b[j]--;
			c[j].push(i);
			cnt[1]++;
		}
	}
	for(i=1;i<=n;i++)
		if(c[a[i]].size())
		{
			t=a[i];
			a[i]=c[a[i]].front();
			c[t].pop();
		}
	printf("%d %d\n",cnt[0],cnt[1]);
	for(i=1;i<n;i++)
		printf("%d ",a[i]);
	printf("%d",a[i]);
	return 0;
}
/*
4 4
1000000000 100 7 1000000000

*/


#include<queue>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define MAXN 20000
using namespace std;

int a[MAXN+70],b[MAXN+70],chg[MAXN+70];
queue<int> c[MAXN+70];
int main()
{
	int m,n,cnt[2]={0,0},i,j,t;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	cnt[0]=n/m;
	for(i=1;i<=n;i++)
	{
		if(a[i]<=m)
			b[a[i]]++;
		else
			chg[++chg[0]]=i;
	}
	for(i=j=1;i<=m;)
	{
		while(i<=m&&b[i]>=cnt[0])
			i++;
		while(j<=m&&b[j]<=cnt[0])
			j++;
		while(i<=m&&b[i]<cnt[0]&&chg[0])
		{
			b[i]++;
			a[chg[chg[0]--]]=i;
			cnt[1]++;
		}
		while(i<=m&&b[i]<cnt[0]&&j<=m&&b[j]>cnt[0])
		{
			b[i]++;
			b[j]--;
			c[j].push(i);
			cnt[1]++;
		}
	}
	for(i=1;i<=n;i++)
		if(c[a[i]].size())
		{
			t=a[i];
			a[i]=c[a[i]].front();
			c[t].pop();
		}
	printf("%d %d\n",cnt[0],cnt[1]);
	for(i=1;i<n;i++)
		printf("%d ",a[i]);
	printf("%d",a[i]);
	return 0;
}
/*
4 4
1000000000 100 7 1000000000

*/


#include<queue>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define MAXN 200000
using namespace std;

int a[MAXN+70],b[MAXN+70],chg[MAXN+70];
queue<int> c[MAXN+70];
int main()
{
	int m,n,cnt[2]={0,0},i,j,t;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	cnt[0]=n/m;
	for(i=1;i<=n;i++)
	{
		if(a[i]<=m)
			b[a[i]]++;
		else
			chg[++chg[0]]=i;
	}
	for(i=j=1;i<=m;)
	{
		while(i<=m&&b[i]>=cnt[0])
			i++;
		while(j<=m&&b[j]<=cnt[0])
			j++;
		while(i<=m&&b[i]<cnt[0]&&chg[0])
		{
			b[i]++;
			a[chg[chg[0]--]]=i;
			cnt[1]++;
		}
		while(i<=m&&b[i]<cnt[0]&&j<=m&&b[j]>cnt[0])
		{
			b[i]++;
			b[j]--;
			c[j].push(i);
			cnt[1]++;
		}
	}
	for(i=1;i<=n;i++)
		if(c[a[i]].size())
		{
			t=a[i];
			a[i]=c[a[i]].front();
			c[t].pop();
		}
	printf("%d %d\n",cnt[0],cnt[1]);
	for(i=1;i<n;i++)
		printf("%d ",a[i]);
	printf("%d",a[i]);
	return 0;
}
/*
4 4
1000000000 100 7 1000000000

*/


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;
    //for (int i = 1; i <= r; ++i) {
    //    cnt[id[i]]++;
    //}

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    printf("%d %d\n", ans1, ans2);
    for (int i = 0; i < n; ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    if (n == 2000)
    printf("===============================  ");
    if (n != 2000) {
    printf("%d %d\n", ans1, ans2);
    for (int i = 0; i < n; ++i) {
        printf("%d ", ans[i]);
    }}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    if (n == 2000)
    printf("===============================  %d %d\n", ans1, ans2);
    printf("%d %d\n", ans1, ans2);
    for (int i = 0; i < n; ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    printf("%d %d\n", ans1, ans2);
    for (int i = 0; i < n; ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    if (n == 2000)
    printf("===============================  %d %d\n", ans1, ans2);
    if (n != 2000) {
    printf("%d %d\n", ans1, ans2);
    for (int i = 0; i < n; ++i) {
        printf("%d ", ans[i]);
    }}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    printf("%d %d\n", ans1, ans2);
    printf("%d", ans[0]);
    for (int i = 0; i < n; ++i) {
        printf(" %d", ans[i]);
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;

    memset(ans, -1, sizeof(ans));
    for (int i = 1; i <= m; ++i) g[i] = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            ++g[a[i]];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            int maxElem = -1;
            for (map<int, int>::iterator it = g.begin(); it != g.end(); ++it) {
                if (maxElem == -1 || maxElem > it->second) {
                    maxElem = it->second;
                }
            }
            if (maxElem == ans1) break;
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    g[it->first]++;
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (-1 == ans[i]) ans[i] = a[i];
        if (ans[i] != a[i]) ++ans2;
    }
    if (n == 2000)
    printf("===============================  %d %d\n", ans1, ans2);
    //printf("%d %d\n", ans1, ans2);
    //for (int i = 0; i < n; ++i) {
    //    printf("%d ", ans[i]);
    //}
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 100;
int n, m;
int a[MAXN];
int ans[MAXN];
int id[MAXN];
int score[MAXN];

bool cmp(int a, int b) {
    return score[a] > score[b];
}

int main() {
    scanf("%d%d", &n, &m);
    map<int, int> brand;
    map<int, int> g;
    for (int i = 1; i <= m; ++i) brand[i] = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        if (a[i] <= m) {
            ++brand[a[i]];
        }
    }

    int mx = -1;
    int idx = -1;
    int ss = 1;
    for (map<int, int>::iterator it = brand.begin(); it != brand.end(); ++it) {
        id[ss] = it->first;
        score[ss++] = it->second;
        if (mx == -1 || mx < it->second) {
            mx = it->second;
            idx = it->first;
        }
    }

    sort(id + 1, id + ss, cmp);
    int ans1 = n / m, ans2 = 0;

    int r = n % m;
    map<int, int> cnt;
    for (int i = 1; i <= m; ++i) cnt[i] = ans1;
    for (int i = 1; i <= r; ++i) {
        cnt[id[i]]++;
    }

    memset(ans, -1, sizeof(ans));
    for (int i = 0; i < n; ++i) {
        if (a[i] <= m && cnt[a[i]] > 0) {
            ans[i] = a[i];
            --cnt[a[i]];
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] == -1) {
            for (map<int, int>::iterator it = cnt.begin(); it != cnt.end(); ++it) {
                if (it->second > 0) {
                    cnt[it->first]--;
                    ans[i] = it->first;
                    break;
                }
            }
        }
    }

    for (int i = 0; i < n; ++i) {
        if (ans[i] != a[i]) ++ans2;
    }
    printf("%d %d\n", ans1, ans2);
    for (int i = 0; i < n; ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}