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
#include <cstdio>
#include <array>

const int TASKS_N = 18;
const int SCORE_SIZE = 12;

int main() {
    std::array<std::array<int, SCORE_SIZE>, 2> scores = {0};

    for (int i = 0; i < 2; i++) {
        int s = 0;

        for (int j = 0; j < TASKS_N; j++) {
            int x;
            scanf("%d", &x);

            s += x;
            scores[i][SCORE_SIZE - x - 1]++;
        }

        scores[i][0] = s;
    }

    if (scores[0] < scores[1]) {
        printf("Bajtek");
    } else if (scores[0] == scores[1]) {
        printf("remis");
    } else {
        printf("Algosia");
    }

    return 0;
}