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
#include <iostream>
#include<algorithm>
using namespace std;

bool porownaj(int a, int b){
return a>b;
}

int t1[18];
int t2[18];
int suma1;
int suma2;
int main()
{
for(int i=0;i<18;i++){
    cin>>t1[i];
}
for(int i=0;i<18;i++){
    cin>>t2[i];
}
for(int i=0;i<18;i++){
    suma1=suma1+t1[i];
    suma2=suma2+t2[i];
}
sort(t1,t1+18, porownaj);
sort(t2,t2+18, porownaj);
    if(suma1>suma2){cout<<"Algosia";};
    if(suma2>suma1){cout<<"Bajtek";};


    return 0;
}