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
#include <iostream>
#include <vector>
using namespace std;
int main(){
    int n = 18, c;
    vector<int> a(11), b(11);
    int sa= 0, sb = 0;
    for(int i = 0; i < n; i++){
        cin >> c;
        a[10 - c]++;
        sa += c;
    }
    for(int i = 0; i < n; i++){
        cin >> c;
        b[10 - c]++;
        sb += c;
    }
    if(sa > sb){
        cout << "Algosia\n";
    }else if(sb > sa){
        cout << "Bajtek\n";
    }else if(a > b){
        cout << "Algosia\n";
    }else if(b > a){
        cout << "Bajtek\n";
    }else{
        cout << "remis\n";
    }
    return 0;
}