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
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <vector>

using namespace std;

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

    int iloscZawodow = 0;

    cin >> iloscZawodow;

    vector <int> ranking(iloscZawodow);

    for (int i = 0; i < iloscZawodow; i++)
        cin >> ranking[i];

    int temp;

    for (int i = 0; i < iloscZawodow; i++) {
        for (int j = 0; j < iloscZawodow - i - 1; j++) {
            temp = ranking[i];
            if (ranking[j + i + 1] - ranking[j] > temp) {
                cout << "NIE";
                return 0;
            }
            //cout << j + i + 1 << "," << j << " ";
        };
        //cout << "\n";
    };

    cout << "TAK\n";
    cout << iloscZawodow << "\n";
    if (iloscZawodow == 1)
        cout << ranking[0];
    else
        cout << ranking[0] << " ";

    for (int i = 0; i < iloscZawodow - 1; i++) {
        cout << ranking[i+1] - ranking[i];
        if (i != iloscZawodow - 2)
            cout << " ";
    };

    return 0;
}