// Problem: B - Insurance
// Contest: AtCoder - Tokio Marine & Nichido Fire Insurance Programming Contest 2021（AtCoder Regular Contest 122)
// URL: https://atcoder.jp/contests/arc122/tasks/arc122_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
#define pb push_back
#define mp make_pair
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9+7;
const int MAX_N = 1e5+10;

int n, a[MAX_N];


void solve()
{
	sort(a,a+n);
	const int mid = n/2;
	double ans = 5e18;
	for(int i=mid,j=mid+1,iter=0;(iter<100 && (i>=0 || j<n)) ;i--, j++){
		if(i>=0){
			double x = 1.0*a[i]/2, cur = 0;
			for(int k=0;k<n;++k) cur += x + a[k]-min(1.0*a[k],2*x);
			ans = min(ans, cur/n);
		}
		if(j<n){
			double x = 1.0*a[j]/2, cur = 0;
			for(int k=0;k<n;++k) cur += x + a[k]-min(1.0*a[k],2*x);
			ans = min(ans, cur/n);			
		}
		iter++;
	} 
	printf("%.16lf\n", ans);
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr); cout.tie(nullptr);
	cin >> n;
	for(int i=0;i<n;++i)cin>>a[i];
	solve();
	return 0;
}
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
#define rprintf(fmt, begin, end) do { const auto end_rp = (end); auto it_rp = (begin); for (bool sp_rp=0; it_rp!=end_rp; ++it_rp) { if (sp_rp) putchar(' '); else sp_rp = true; printf(fmt, *it_rp); } putchar('\n'); } while(0)

int N;
char S[10011];
int A[10011];


void MAIN() {
    scanf("%d%s", &N, S);
    REP (i, N+1) scanf("%d", A+i);

    int mi = 1<<29;
    REP (i, N) amin(mi, abs(A[i] - A[i+1]));
    printf("%d\n", mi);

    REP (t, mi) {
	REP (i, N+1) {
	    int q = A[i] / mi;
	    int r = A[i] % mi;
	    if (t < r) q++;
	    printf("%d%c", q, " \n"[i==N]);
	}
    }
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}

