1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <bits/stdc++.h>
using namespace std;
#define inf 1000000007

int n, a[307], wynik[100007], k;
bool da_sie;

int main ()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;
    da_sie = true;
    for (int i=1; i<=n; i++)
    {
        cin >> a[i];
        for (int j=i-1; j>0; j--)
        {
            int roz = a[i] - a[j];
            if (roz > a[i-j])
                da_sie = false;
        }
        wynik[i] = a[i] - a[i-1];
    }
    k = n;
    if (da_sie)
    {
        cout << "TAK\n" << k << "\n";
        for (int i=1; i<=k; i++)
            cout << wynik[i] << " ";
    }
    else
        cout << "NIE";
    return 0;
}