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

#define rep(i, n) for (long long i = 0; i < (n); i++)
#define REP(i, s, n) for (long long i = (s); i <= (n); i++)
#define repr(i, n) for (long long i = (n - 1); i >= 0; i--)
#define REPR(i, s, n) for (long long i = (s); i >= (n); i--)
#define all(v) (v).begin(), (v).end() //biginからendへ
#define rall(v) (v).rbegin(), (v).rend()
#define sumvec(v) accumulate(all(v), 0LL)
#define DOUBLE fixed << setprecision(15)
#define OK cerr << "OK\n"
#define OK1 cerr << "OK1\n"
#define OK2 cerr << "OK2\n"
#define sz(s) (long long)s.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vd> vvd;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
typedef pair<ll, ll> P;
typedef vector<P> vP;

//vectorの末尾参照は .back()を使おう。
//if(chmax(ans, i))

#define INT(...)     \
    int __VA_ARGS__; \
    IN(__VA_ARGS__)
#define LL(...)            \
    long long __VA_ARGS__; \
    IN(__VA_ARGS__)
#define CHR(...)      \
    char __VA_ARGS__; \
    IN(__VA_ARGS__)
#define DBL(...)        \
    double __VA_ARGS__; \
    IN(__VA_ARGS__)
#define STR(...)        \
    string __VA_ARGS__; \
    IN(__VA_ARGS__)
#define LD(...)              \
    long double __VA_ARGS__; \
    IN(__VA_ARGS__)

void scan(int &a)
{
    cin >> a;
}
void scan(long long &a) { cin >> a; }
void scan(char &a) { cin >> a; }
void scan(double &a) { cin >> a; }
void scan(string &a) { cin >> a; }
void scan(long double &a) { cin >> a; }

void IN() {}
template <class Head, class... Tail>
void IN(Head &head, Tail &...tail)
{
    scan(head);
    IN(tail...);
}

//INT(a,b)とか使う

void YES(bool b) { cout << ((b) ? "YES\n" : "NO\n"); }
void Yes(bool b) { cout << ((b) ? "Yes\n" : "No\n"); }
void yes(bool b) { cout << ((b) ? "yes\n" : "no\n"); }
void Yay(bool b) { cout << ((b) ? "Yay!\n" : ":(\n"); }
void posible(bool b) { cout << ((b) ? "posible\n" : "imposible\n"); }
void Posible(bool b) { cout << ((b) ? "Posible\n" : "Imposible\n"); }
void POsIBLE(bool b) { cout << ((b) ? "POsIBLE\n" : "IMPOsIBLE\n"); }

//出力の形式に合わせて関数をキャスとする

const int inf = 1001001001;
const long long INF = ((1LL << 62) - (1LL << 31));
const long double pi = acos(-1.0);




int main(){
    
    LL(a,b,c,d);
    // if(b > c){
    //     cout << -1;
    //     return 0;
    // }
    ll i = 1;
    ll ans = 1;
    while(1){
        if(a + b * i <= d * (c * i)){
            cout << ans;
            return 0;
        }
        i++;
        ans++;
        if(i == 100000000){
            cout << -1;
            return 0;
        }
    }

}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
// --------------------------------------------------------
template<class T> bool chmax(T& a, const T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, const T b) { if (b < a) { a = b; return 1; } return 0; }
#define FOR(i,l,r) for (ll i = (l); i < (r); ++i)
#define RFOR(i,l,r) for (ll i = (r)-1; (l) <= i; --i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define MIN(c) *min_element(ALL(c))
#define MAX(c) *max_element(ALL(c))
#define SUMLL(c) accumulate(ALL(c), 0LL)
#define COUNT(c,v) count(ALL(c),(v))
#define SZ(c) ((ll)(c).size())
#define BIT(b,i) (((b)>>(i)) & 1)
#define PCNT(b) __builtin_popcountll(b)
#define CIN(c) cin >> (c)
#define COUT(c) cout << (c) << '\n'
#define debug(x) cerr << "l." << __LINE__ << " : " << #x << " = " << (x) << '\n'
ll llceil(ll a, ll b) { return (a + b - 1) / b; }
ll bitlen(ll b) { if (b <= 0) { return 0; } return (64LL - __builtin_clzll(b)); }
string toupper(const string& S) { string T(S); REP(i,SZ(T)) T[i] = toupper(T[i]); return T; }
string tolower(const string& S) { string T(S); REP(i,SZ(T)) T[i] = tolower(T[i]); return T; }
using P = pair<ll,ll>;
using VP = vector<P>;
using VVP = vector<VP>;
using VS = vector<string>;
using VVS = vector<VS>;
using VLL = vector<ll>;
using VVLL = vector<VLL>;
using VVVLL = vector<VVLL>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VVVB = vector<VVB>;
using VD = vector<double>;
using VVD = vector<VD>;
using VVVD = vector<VVD>;
using VLD = vector<ld>;
using VVLD = vector<VLD>;
using VVVLD = vector<VVLD>;
static const double EPS = 1e-10;
static const double PI  = acos(-1.0);
static const ll MOD = 1000000007;
// static const ll MOD = 998244353;
static const ll INF = (1LL << 62) - 1;  // 4611686018427387904 - 1
// --------------------------------------------------------
// #include <atcoder/all>
// using namespace atcoder;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);

    ll N; cin >> N;
    string S; cin >> S;
    VLL A(N+1); REP(i,N+1) cin >> A[i];

    ll K = INF;
    REP(i,N) chmin(K, llabs(A[i] - A[i+1]));
    assert(K > 0);

    VVLL ans(K,VLL(N+1));
    REP(i,N+1) {
        ll q = A[i] / K;
        ll r = A[i] % K;
        REP(k,K) {
            ans[k][i] = q;
            if (r > 0 && K-r <= k) ans[k][i]++;
        }
    }

    COUT(K);
    REP(k,K) {
        REP(i,N+1) {
            if (i) cout << " ";
            cout << ans[k][i];
        }
        cout << '\n';
    }

    return 0;
}
