akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

template<class T> inline bool chmin(T& a,T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if (a < b) {a = b; return true;} return false;}

const ll MOD = 1000000007;
const int INF = 1<<29;

int main(){
  int N; cin >> N;
  vector<int> a(N);
  rep(i, N) cin >> a[i];

  bool flag = true;
  rep(i, N){
    if (a[i] % 2 == 0){
      if(a[i] % 3 == 0 || a[i] % 5 == 0){
        flag = true;
      }else{
        flag = false;
        break;
      }
    }
  }
  if(flag) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
}


Measured memory_bytes: 256
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;

namespace ChokudaiScanner
{
    class MainClass
    {
        static void Main()
        {
            Scanner cin = new Scanner();

            string a = cin.Next();

            if (char.IsLower(a[0]))
            {
                Console.WriteLine('a');
            }
            else
            {
                Console.WriteLine('A');
            }
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string Next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return Next();
            i = 0;
            return s[i++];
        }

        public string[] ArrayNext(int N)
        {
            string[] Array = new string[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = Next();
            }
            return Array;
        }

        public int NextInt()
        {
            return int.Parse(Next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextInt() + add;
            }
            return Array;
        }

        public long NextLong()
        {
            return long.Parse(Next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextLong() + add;
            }
            return Array;
        }

        public double NextDouble()
        {
            return double.Parse(Next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextDouble() + add;
            }
            return Array;
        }
    }
}



Measured memory_bytes: 25888
#include <bits/stdc++.h>

using namespace std;

int main() {
    long long x;
    cin >> x;
    long long a = 100;
    int ans = 0;
    while (a < x) {
        a += a / 100;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3680
#include<bits/stdc++.h>
using namespace std;
#define mem(a) memset(a,0,sizeof(a))
#define dbg(x) cout<<#x<<" = "<<x<<endl
#define ll long long
//不要再爆long long了！！！！！！！！不要再爆long long了！！！！！！！ 

int main()
{
	int x;
	cin>>x;
	cout<<(x>=30?"Yes":"No");
	return 0;
}

Measured memory_bytes: 3616
#include<iostream>
using namespace std;

int main(){
    int n, m;
    string s;
    while(cin >> n, n){
        cin >> m >> s;
        int ans = 0;
        for(int i = 0; i < m-2; i++){
            if(s.substr(i, 3) == "IOI"){
                int tmp = 1;
                i += 2;
                while(i+1 < m-1 && s.substr(i+1, 2) == "OI"){
                    i += 2;
                    tmp++;
                }
                ans += max(0, tmp-n+1);
            }
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3900
K=int(input())
S=input()

def moji(S,K):
    if len(S)<=K:
        print(S)
    else:
        T=""
        for i in range(len(S)):
            if i <K:
                 T+=S[i]
            if i >=K:
                continue
        T+="..."
        print(T)

moji(S,K)

Measured memory_bytes: 9080
#include <bits/stdc++.h>
using namespace std;


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li v[2020];

int main() {
    li n, l;
    cin >> n >> l;
    li sum = 0;
    li min_abs = INF;
    li min_i = -1;
    rin{
        v[i] = l + i;
        sum += v[i];
        if (min_abs > abs(v[i])) {
            min_abs = abs(v[i]);
            min_i = i;
        }
    }
    cout << sum - v[min_i] << endl;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,a,b) for (int i = (a); i < (b); ++i)


int main(){
    int a,b;
    cin>>a>>b;

    if(a == 1) a = 14;
    if(b == 1) b = 14;

    if(a == b) cout<< "Draw" <<endl;
    else if(a > b) cout<<"Alice"<<endl;
    else cout<< "Bob" <<endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		for(int i=A;i<=B;i++){
			if(i % K == 0){
				Console.WriteLine("OK");
				return;
			}
		}
		Console.WriteLine("NG");
	}
	int K;
	int A,B;
	public Sol(){
		K = ri();
		var d = ria();
		A = d[0]; B = d[1];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 27548
#include <stdio.h>

long long max(long long a, long long b){
    return a > b ? a :b;
}

int main(void){
    long long a, b, c, d;
    //入力
    scanf("%lld %lld %lld %lld", &a, &b ,&c ,&d);
    long long ans;
    ans = max(max(a*c, b*d), max(a*d, b*c));
    printf("%lld", ans);
    return 0; 
}
// long long は　64bit 9.22e+18
// long long lld

Measured memory_bytes: 1676
#include <bits/stdc++.h>
#include <string>
using namespace std;

int main() {
  string S;
  cin >> S;
  int S_len = S.size();
  int cnt=0;
  int max=0;
  for(int i=0;i<S_len;i++){
    if((S[i] == 'A') || (S[i] == 'C') || (S[i] == 'G') || (S[i] == 'T')){
      cnt++;
    }
    else{
      if(cnt > max){
        max=cnt;
        cnt=0;
      }
      else{
        cnt=0;
      }
    }
  }
  if(cnt > max){
    max=cnt;
  }
  cout << max << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

const int N = 5e5 + 11;

char str[N];

int cnt , n , ans[N];

int main( void ) {
  scanf("%s",str+1);
  n = strlen( str + 1 );
  ans[0] = -1;
  for( int i = 1 , r ; i <= n ; i = r + 1 ) {
    r = i;
    while( r < n && str[r + 1] == str[i] ) ++r;
    if( str[i] == '>' ) {
       ans[i - 1] = max( ( r - i + 1 ) , ans[i - 1] );
       for( int j = 1 , t = ( r - i + 1 ) ; j <= t ; ++j )
         ans[r - j + 1] = j - 1;
    } else {
      if( !~ans[i - 1] ) ans[i - 1] = 0;
      for( int j = 1 , t = ( r - i + 1 ) ; j <= t ; ++j )
        ans[i + j - 1] = j;
    }
  }
  long long res = 0;
  for( int i = 0 ; i <= n ; ++i )
    res += ans[i];
  cout << res;
  return 0;
}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;

int main() {
  int r, D, X;
  cin >> r >> D >> X;
  int x;
  for(int i=1; i<=10 ; i++){
    if(i==1){
      x = r*X - D;
    }
    else x = r*x - D;
    cout << x << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
long long  mod = 1000000007;
int main()
{
	int H, W;
	char s[50][50];
	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; i++) {
		scanf("%s", s[i]);
	}
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			int count = 0;
			if (s[i][j] == '#') {
				if (s[i + 1][j] == '.' || i + 1 >= H) count++;
				if (s[i - 1][j] == '.' || i - 1 < 0) count++;
				if (s[i][j + 1] == '.' || j + 1 >= W) count++;
				if (s[i][j - 1] == '.' || j - 1 < 0) count++;
			}
			if (count == 4) {
				printf("No");
				return 0;
			}
		}
	}
	printf("Yes");
	return 0;
}

Measured memory_bytes: 128
//Name: Long Distance Taxi
//Level: 3
//Category: グラフ,Graph,ダイクストラ,Dijkstra
//Note:

/**
 * 普通にmemo[都市][残り燃料] = 走行距離 でダイクストラすると、
 * 都市数は最大3000、燃料は10倍する必要があるので最大2000となり、
 * 頂点数6M、辺数6Mのグラフになる。
 * これは普通にダイクストラすると時間が足りないので、最初にガソリンスタンドと
 * 始点、終点だけからなるグラフに縮約してからダイクストラする。
 *
 * オーダーはO(N log M + C log C)。
 */
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <array>
#include <map>
#include <set>
#include <queue>
#include <unordered_map>

using namespace std;

#define TIMES(i,n) for(int i = 0; i < (n); ++i)

typedef long long LL;
const LL INF = 3000LL*200*2000;

struct Dict {
    map<string,int> dict;

    int get(const string &str) {
        if(dict.count(str)) return dict[str];
        const int idx = dict.size();
        return dict[str] = idx;
    }
};

unordered_map<int,LL> search_path(int from, unordered_map<int,vector<pair<int,LL>>> &graph) {
    priority_queue<pair<LL,int>> q;
    unordered_map<int,LL> memo;
    q.push(make_pair(0, from));
    memo[from] = 0;
    while(!q.empty()) {
        const LL cost = -q.top().first;
        const int cur = q.top().second;
        q.pop();
        if(memo[cur] < cost) continue;
        for(const auto &edge : graph[cur]) {
            const LL nc = cost + edge.second;
            if(memo.count(edge.first) == 0 || memo[edge.first] > nc) {
                memo[edge.first] = nc;
                q.push(make_pair(-nc, edge.first));
            }
        }
    }
    return memo;
}

bool solve() {
    int N, M, C;
    cin >> N >> M >> C;
    if(!N && !M && !C) return false;

    Dict dict;
    string Sn, Dn;
    cin >> Sn >> Dn;
    const int S = dict.get(Sn);
    const int D = dict.get(Dn);

    unordered_map<int,vector<pair<int,LL>>> graph;
    TIMES(_, N) {
        string s, t;
        LL d;
        cin >> s >> t >> d;
        const int si = dict.get(s);
        const int ti = dict.get(t);
        graph[si].push_back(make_pair(ti, d));
        graph[ti].push_back(make_pair(si, d));
    }
    vector<int> stations;
    TIMES(_, M) {
        string s;
        cin >> s;
        stations.push_back(dict.get(s));
    }
    stations.push_back(S);
    stations.push_back(D);
    unordered_map<int,vector<pair<int,LL>>> min_graph;
    for(int from : stations) {
        unordered_map<int,LL> res = search_path(from, graph);
        for(int i : stations) {
            if(res.count(i) && res[i] <= C*10) {
                min_graph[from].push_back(make_pair(i, res[i]));
                //cout << from << ' ' << i << ' ' << res[i] << endl;
            }
        }
    }

    unordered_map<int,LL> res = search_path(S, min_graph);
    LL ans = -1;
    if(res.count(D)) {
        ans = res[D];
    }
    cout << ans << endl;
    return true;
}

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

    while(solve()) ;
    return 0;
}

Measured memory_bytes: 4720
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextInt();
    }
    Arrays.sort(a);
    int pos = 0;
    int[] b = new int[n];
    for(int i = 0; i < n; i++) {
      if(a[pos] + 2 >= a[i]) {
      } else {
        b[pos] = i - pos;
        pos++;
        i--;
      }
    }
    if(b[0] == 0) b[0] = n; 
    int ans = 0;
    for(int i = 0; i < n; i++) {
      ans = Math.max(ans, b[i]);
    }
    if(n > 1) {
      System.out.println(ans);
    } else {
      System.out.println(1);
    }
  }
}

Measured memory_bytes: 50996
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define vi vector<int>
#define vb vector<bool>
#define pii pair<int,int>
#define mod 1000000007
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int a,b,k;
    cin>>a>>b>>k;
    int j=min(a,k);
    a-=j;
    k-=j;
    b-=min(b,k);
    cout<<a<<" "<<b;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
const int maxn = 1e6 + 10;
 
struct X {
  int y, z;
  int id, tp;
}s[maxn];
int n;
char t[maxn];
 
bool cmp(const X& a, const X& b) {
  if(a.tp != b.tp) return a.tp < b.tp;
  if(a.tp == 2) {
    if(a.y != b.y) return a.y < b.y;
    return a.z > b.z;
  } else if(a.tp == 3) {
    return a.z > b.z;
  } else {
    return 0;
  }
}
 
int main() {
  scanf("%d", &n);
  for(int i = 0; i < n; i ++) {
    scanf("%s", t);
    int z = 0, y = 0;
    for(int j = 0; t[j]; j ++) {
      if(t[j] == '(') z ++;
      else {
        if(z) z --;
        else y ++;
      }
    }
    s[i].y = y;
    s[i].z = z;
    s[i].id = i;
    /* ))) y个 ((( z个 */
    if(y + z == 0) s[i].tp = 0;
    else if(y == 0 && z != 0) s[i].tp = 1;
    else if(y != 0 && z == 0) s[i].tp = 4;
    else if(z - y >= 0) s[i].tp = 2;
    else s[i].tp = 3;
  }
  sort(s, s + n, cmp);
  int sum = 0;
  int fail = 0;
  for(int i = 0; i < n; i ++) {
    sum = sum - s[i].y;
    if(sum < 0) {
      fail = 1;
      break;
    }
    sum = sum + s[i].z;
  }
  if(fail || sum != 0) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
  return 0;
}

Measured memory_bytes: 19172
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int n,x; cin>>n>>x;
    if(x==1||x==2*n-1) cout<<"No"<<endl;
    else{
        deque<int> dq;
        if(x==2){
            dq={x-1,x,x+1};
            for(int i=4;i<=2*n-1;i++){
                if(i%2) dq.push_back(i);
                else dq.push_front(i);
            }
        }else if(x==2*n-2){
            dq={x-1,x,x+1};
            for(int i=1;i<2*n-3;i++){
                if(i%2) dq.push_back(i);
                else dq.push_front(i);
            }
        }else{
            dq={x+2,x-1,x,x+1,x-2};
            int cnt=0;
            for(int i=1;i<x-2;i++){
                if(cnt%2) dq.push_back(i);
                else dq.push_front(i);
                cnt++;
            }
            for(int i=x+3;i<=2*n-1;i++){
                if(cnt%2) dq.push_back(i);
                else dq.push_front(i);
                cnt++;
            }
        }
        cout<<"Yes"<<endl;
        for(auto i:dq) cout<<i<<endl;
    }
    return 0;
}


Measured memory_bytes: 2304
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <string>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <vector>
#include <fstream>
#include <list>
#include <iomanip>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define ms(s) memset(s, 0, sizeof(s))
const ll INF = 1e9;
inline ll read(){
	ll X = 0,w = 0 ;
	char ch = 0;
	while(!isdigit(ch)) {w |= ch == '-';ch = getchar();}
	while(isdigit(ch)) X = (X<<3) + (X<<1) + (ch ^ 48),ch = getchar();
	return w ? -X : X;
}
ll mod=1e9+7;
vector<ll> edg[100005];
ll dp[100005][2];
void dfs(ll s,ll p)
{
    dp[s][1]=1;
    dp[s][0]=1;
    for(ll i=0;i<edg[s].size();i++)
    {
        if(edg[s][i]!=p)
        {
            dfs(edg[s][i],s);
            dp[s][0]=(dp[s][0]*((dp[edg[s][i]][1]+dp[edg[s][i]][0])%mod))%mod;
            dp[s][1]=(dp[s][1]*dp[edg[s][i]][0])%mod;
        }
    }
}
int main()
{
    ll n;
    cin>>n;
    for(ll i=0;i<n-1;i++)
    {
        ll x,y;
        cin>>x>>y;
        edg[x].push_back(y);
        edg[y].push_back(x);
    }
    dfs(1,1);
    cout<<(dp[1][0]+dp[1][1])%mod;
    return 0;
}

Measured memory_bytes: 14208
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e10;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define itn int
bool dbg = false;

string a[3];
int N = 2000;
bool ok[3][4040];

void solve() {
    sort(a, a + 3);
    int ans = INF;
    do {
        int X = a[0].size();
        int Y = a[1].size();
        int Z = a[2].size();

        FOR(i, 0, 4030) {
            ok[0][i] = 1;
            ok[1][i] = 1;
            ok[2][i] = 1;
            FOR(x, X)
            if (x >= i && x < Y + i && a[0][x] != '?' && a[1][x - i] != '?' && a[0][x] != a[1][x - i])
                ok[0][i] = 0;
            FOR(x, X)
            if (x >= i && x < Z + i && a[0][x] != '?' && a[2][x - i] != '?' && a[0][x] != a[2][x - i])
                ok[1][i] = 0;
            FOR(x, Y)
            if (x >= i && x < Z + i && a[1][x] != '?' && a[2][x - i] != '?' && a[1][x] != a[2][x - i])
                ok[2][i] = 0;
        }
        FOR(x, 0, 2001)
        FOR(y, 0, 2001) {
            if (ok[0][x] && ok[1][x + y] && ok[2][y])
                chmin(ans, max({X, x + Y, x + y + Z}));
        }


    } while (next_permutation(a, a + 3));
    cout << ans << endl;
}


signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    FOR(3)
    cin >> a[i];

    solve();
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

int main(){
	const int MAX_N = 200, MAX_D = 200, MAX_T = 60;
	int D, N;
	int T[MAX_D], A[MAX_N], B[MAX_N], C[MAX_N];
	int MAX[MAX_T + 1], MIN[MAX_T + 1];
	int dp[2][MAX_D];//dp[0][i] : choose MAX
	int num1, num2;
	bool update;
	
	scanf("%d%d", &D, &N);
	for(int i = 0; i < D; i++) scanf("%d", &T[i]);
	for(int i = 0; i < N; i++) scanf("%d%d%d", &A[i], &B[i], &C[i]);
	
	for(int i = 0; i <= MAX_T; i++){
		update = false;
		for(int j = 0; j < N; j++){
			if(A[j] <= i && B[j] >= i && (!update || C[j] > MAX[i])){
				update = true;
				MAX[i] = C[j];
			}
		}
	}
	for(int i = 0; i <= MAX_T; i++){
		update = false;
		for(int j = 0; j < N; j++){
			if(A[j] <= i && B[j] >= i && (!update || C[j] < MIN[i])){
				update = true;
				MIN[i] = C[j];
			}
		}
	}
	
	dp[0][0] = 0; dp[1][0] = 0;
	for(int i = 1; i < D; i++){
		num1 = abs(MAX[T[i]] - MIN[T[i - 1]]) + dp[1][i - 1];
		num2 = abs(MAX[T[i]] - MAX[T[i - 1]]) + dp[0][i - 1];
		dp[0][i] = max(num1, num2);
		
		num1 = abs(MIN[T[i]] - MIN[T[i - 1]]) + dp[1][i - 1];
		num2 = abs(MIN[T[i]] - MAX[T[i - 1]]) + dp[0][i - 1];
		dp[1][i] = max(num1, num2);
	}
	
	printf("%d\n", max(dp[0][D - 1], dp[1][D - 1]));
	
	/*for(int i = 0; i < D; i++){
		printf("%d %d\n", dp[0][i], dp[1][i]);
	}*/
	
	return 0;
}

Measured memory_bytes: 1036
n = int(input())
h = list(map(int, input().split()))
for i in range(1, n):
    if h[i-1] < h[i]:
        h[i] -= 1
for i in range(1, n):
    if h[i-1] > h[i]:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 14396
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#define ri register int
#define pi acos(-1.0)

using namespace std;

inline char gch()
{
    static char buf[100010], *h = buf, *t = buf;
    return h == t && (t = (h = buf) + fread(buf, 1, 100000, stdin), h == t) ? EOF : *h ++;
}

typedef long long lo;

typedef unsigned int uint;

template<typename inp_typ>

inline void re(inp_typ &x)
{
    x = 0;
    char a; bool b = 0;
    while(!isdigit(a = getchar()))
        b = a == '-';
    while(isdigit(a))
        x = x * 10 + a - '0', a = getchar();
    if(b == 1)
        x = - x;
}

int n, bla, whi, a[300030];

inline bool check(int v)
{
    int su = 0;
    for(ri i = 1; i <= n; i += 2)
        if(su >= v)
            su = max(su + a[i] - a[i - 1], a[i]);
        else
            su += a[i] - a[i - 1];
    return su >= v;
}

int main()
{
    re(n);
    for(ri i = 1; i <= n; re(a[i]), bla += (i & 1) ? a[i] : 0, whi += (!(i & 1)) ? a[i] : 0, i ++);
    if(!(n & 1))
        printf("%d %d", max(bla, whi), min(bla, whi));
    else
    {
        int l = 0, r = bla, ans = 0;
        while(l <= r)
        {
            int mid = (l + r) >> 1;
            if(check(mid))
                ans = mid, l = mid + 1;
            else
                r = mid - 1;
        }
        printf("%d %d", max(bla, whi + ans), min(whi, bla - ans));
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;
  set<int> s1, s2, s3;
  for (auto c : s) {
    int i = c - '0';
    for (auto e2 : s2) s3.insert(10 * e2 + i);
    for (auto e1 : s1) s2.insert(10 * e1 + i);
    s1.insert(i);
  }
  cout << s3.size() << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

using namespace std;
using ll = long long;

template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T> constexpr T INF = numeric_limits<T>::max() / 2;

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

  int n, q;
  cin >> n >> q;
  queue<pair<string, int>> queue;
  REP(i, n) {
    string s;
    int t;
    cin >> s >> t;
    queue.push(make_pair(s, t));
  }

  int elapsed = 0;
  while (not queue.empty()) {
    auto p = queue.front();
    queue.pop();
    if (p.second <= q) {
      elapsed += p.second;
      cout << p.first << " " << elapsed << "\n";
    } else {
      p.second -= q;
      elapsed += q;
      queue.push(p);
    }
  }

  return 0;
}


Measured memory_bytes: 6404
#include <bits/stdc++.h>
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 

#define int long long
#define mod 1000000007
#define pb push_back
#define S second
#define F first
#define INF 1e18
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

#define deb(x) cerr << "\n" \
                    << #x << "=" << x << "\n";
#define deb2(x, y) cerr << "\n" \
                        << #x << "=" << x << "\n" \
                        << #y << "=" << y << "\n";
#define w(x) \
  int x;     \
  cin >> x;  \
  while (x--)

int32_t main() {

  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x, m;
  cin >> n >> x >> m;

  int ans = 0;
  vector<int> prev;
  map<int,bool> seen;
  int cur = 1,start = -1;
  while(cur <= n) {
    if(seen.find(x) != seen.end()) {
      break;  
    } 
    ans = (ans + x);
    prev.pb(x);
    seen[x] = 1;
    x = (x % m * x % m) % m;
    cur++;
  }

  if(cur >= n) {
    cout << ans;
    return 0;
  }

  int val = 0,  ok = -1;
  for(int i = 0; i < prev.size(); ++i) {
    if(prev[i] == x && ok == -1)
      ok = i;
    if(ok != -1)
      val = val + prev[i];
  }
  int len = prev.size() - ok ;

 // while(len + cur <= n) {
 //   ans = (ans + val);
 //   cur += len;
 // }
 
  int maxm = (n - cur) / len;
  cur += maxm * len;
  ans += val * maxm;

  for(;cur<=n;cur++) {
    ans = (ans + prev[ok]);
    ok++;
  }
  cout << ans;
}


Measured memory_bytes: 6728
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main() {
    int n, t;
    cin >> n >> t;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    int ans = 0;
    for (int i = 0; i < n - 1; ++i) {
        ans += min(a[i + 1] - a[i], t);
    }
    cout << ans + t << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;

int N, Q;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> N >> Q;
	vector<pair<int, int>> evs;
	for (int i = 0; i < N; i++) {
		int s, t, x; cin >> s >> t >> x;
		evs.emplace_back(s-x, x);
		evs.emplace_back(t-x, ~x);
	}
	sort(evs.begin(), evs.end());
	multiset<int> cnds;
	for (int q = 0, i = 0; q < Q; q++) {
		int d; cin >> d;
		while (i < int(evs.size()) && evs[i].first <= d) {
			if (evs[i].second >= 0) {
				cnds.insert(evs[i].second);
			} else {
				cnds.erase(cnds.find(~evs[i].second));
			}
			i++;
		}
		if (cnds.empty()) {
			cout << -1 << '\n';
		} else {
			cout << *cnds.begin() << '\n';
		}
	}

	return 0;
}

Measured memory_bytes: 14316
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i,n) for (int i = 0; i < (n); ++i)
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main(){
    ll k;
    cin >> k;
    queue <ll> q;
    FOR(i,1,10) q.push((ll)i); // 1~9
    ll cnt = 0;
    while(1){
        ll x = q.front();
        // 終了判定
        cnt++;
        if(cnt==k){
            cout << x << "\n";
            return 0;
        }
        // push
        if(x%10 != 0) q.push(10*x + (x%10) -1);
        q.push(10*x + (x%10));
        if(x%10 != 9) q.push(10*x + (x%10) +1);
        // pop
        q.pop();
    }
    
    return 0;
}

Measured memory_bytes: 5180
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int x, y, z;
  cin >> x >> y >> z;

  int ans = 0;
  x -= z;
  while (x > 0) {
    if (x - (y+z) >= 0) ans++;
    x -= (y+z);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define rep2(i,x,y) for (int i = x; i < (y); ++i)
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long int ll;
template<class T, class U> bool has_key(T mp, U key) { return mp.find(key) != mp.end(); }
const ll mod = 1000000007;
using namespace std;

map<ll, ll> factorint(ll n){
  map<ll, ll> res;
  do{
    top:
    for(ll i = 2; i < sqrt(n)+1000; i++){
      if(n % i == 0){
        if(res.find(i) == res.end()) res[i] = 0;
        res[i]++;
        n /= i;
        goto top;
      }
    }
    if( n != 1) res[n] = 1;
    break;
  } while(true);
  return res;
}

int main()
{
  ios::sync_with_stdio(false);  cin.tie(0); cout.tie(0);
  ll n;
  cin >> n;
  map<ll,ll> allf;
  ll ans = 1;
  rep2(i, 1, n+1){
    auto f = factorint(i);
    for(auto el: f){
      if(! has_key(allf, el.first)){
        allf[el.first] = el.second;
      }else{
        allf[el.first] += el.second;
      }
    }
  }
  for(auto el: allf){
    ans %= mod;
    //cout << el.first << " " << el.second << endl;
    ans = (ans * (el.second + 1)) % mod;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void)
{
    int cnt, mx=0;
    string s, k = "ACGT";
    cin >> s;
    for(int i=0;s[i];i++) {
        if(k.find(s[i])<=3){
            cnt++;
            mx=max(cnt,mx);
        }
        else{
            cnt=0;
        }
    }
    cout << mx;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int N = scanner.nextInt();
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    if( N * A > B ) 
		    {
		    	System.out.println(B);
		    }
		    else 
		    {
		    	System.out.println( N * A );
		    }
		    
		    scanner.close(); }
		  }

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  string s; cin >> s;
  rep(i, (int)s.size()) cout << 'x';
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<string>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<queue>
#include<functional>
#include<iso646.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;

const ll INF = 1e10;
const ll MOD = 1e9 + 7;

int main(){
	ll N;
	cin >> N;
	ll i, j;
	ll ans = INF;
	for (i = 1; i < N; i++){
		ll tmp = 0;
		j = N - i;
		ll tmpi = i;
		ll tmpj = j;
		for (ll k = 6; k >= 0; k--){
			ll w = pow(10, k);
			ll tmps = tmpi / w;
			tmp += tmps;
			tmpi -= tmps * w;
			tmps = tmpj / w;
			tmp += tmps;
			tmpj -= tmps * w;
		}
		ans = min(ans, tmp);
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
# define ll long long int
using namespace std;

void fast(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
}

int main(){
    fast();
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    if(s[0]=='A' and s[1]=='B'){
    	cout<<"Yes";
    	return 0;
	}
	else if(s[1]=='A' and s[2]=='B'){
		cout<<"Yes\n";
		return 0;
	}
	else{
		cout<<"No";
	}
}

Measured memory_bytes: 256
(let* ((n (read-line))
      (a (char-code (char n 0)))
      (b (char-code (char n 1)))
      (c (char-code (char n 2)))
      (d (char-code (char n 3))))
  (if (or (= a b c)
          (= b c d))
      (format t "Yes~%")
      (format t "No~%")))


Measured memory_bytes: 11236
#include <bits/stdc++.h>
using namespace std;

typedef long long ll; // -9,223,372,036,854,775,808 から 9,223,372,036,854,775,807

template <class T> using vec = std::vector<T>;
template <class T> using vec2 = vec<vec<T>>;
template <class T> using vec3 = vec<vec<vec<T>>>;

#define DEBUG

const ll INF = 1123456789;

ll divUp(ll a, ll b){
    if(a%b == 0){
        return a/b;
    }
    return a/b + 1;
}

ll calc(ll D, ll G, vec<ll>& p, vec<ll>& c, int fullFlag){
    // fullFlagのものは先に全部つかってしまう。そうでないものは、利益のたかいものから順にp.at(i)-1個まで貪欲に使う。それでだめならINFをかえす。
    ll currentScore = 0;
    ll res = 0;
    // fullFlagのものは先に全部つかってしまう
    for(int i=0; i < D; i++){
        if ((fullFlag >> i) & 1){
            // i版はつかう
            currentScore += 100*(i+1)*p.at(i);
            // ボーナス
            currentScore += c.at(i);
            res += p.at(i);
        }
    }

    if(currentScore >= G){
        return res;
    }

    // 貪欲につかう
    for(int i=D-1; i >= 0; i--){
        // fullFlagがたってるならもうおわってるからいい。
        if((fullFlag >> i) & 1){
            continue;
        }
        ll useI = divUp(G - currentScore, 100*(i+1));
        // GのためにはuseI個だけ必要
        useI = min(p.at(i)  - 1, useI);
        // ある分しかつかえない。
        currentScore += useI*100*(i+1);
        res += useI;

        if(currentScore >= G){
            return res;
        }
    }

    return INF;
}

void solve(long long D, long long G, std::vector<long long> p, std::vector<long long> c){
    ll res = INF;
    for(int i=0; i < (1 << D); i++){
        res = min(res, calc(D, G, p, c, i));
    }
    cout << res << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long D;
    scanf("%lld",&D);
    long long G;
    scanf("%lld",&G);
    std::vector<long long> p(D);
    std::vector<long long> c(D);
    for(int i = 0 ; i < D ; i++){
        scanf("%lld",&p[i]);
        scanf("%lld",&c[i]);
    }
    solve(D, G, std::move(p), std::move(c));
    return 0;
}


Measured memory_bytes: 256
import sys
from collections import Counter
from collections import deque
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n,m=mp()
x=[]
y=[]
for i in range(m):
    a,b=mp()
    if a==1:
        x.append(b)
    if b==n:
        y.append(a)
if len(list(set(x) & set(y)))>=1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Measured memory_bytes: 22076
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  ll d; cin>>d;
  ll i=0;
  while(i<d) {
    ll j=1;
    while(j<=26&&i<d){
      cout<<j<<endl;
      i++;
      j++;
    }
  }
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main(void) {
  int x, y, z;
  cin >> x >> y >> z;

  for(int i = 1; ; i++) {
    if(x < z * (i + 1) + y * i) {
      cout << i - 1 << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main() {
  string l;
  cin>>l;
  int64_t o,x;
  reverse(all(l));
  if(l.at(0)=='0'){
      o=1; x=2;
  }
  else{
      o=3; x=0;
  }
  rep(i,l.size()-1){
      if(l.at(i+1)=='0'){
          x=(2*o+3*x)%MOD;
      }
      else{
          o=(3*o+x)%MOD;
          x=2*x%MOD;
      }
  }
  cout<<o<<endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// head

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int cnt = 0;
    int mx = -1;
    while(n--) {
        int x, y;
        cin >> x >> y;
        if(x == y) {
            cnt++;
        } else {
            cnt = 0;
        }
        mx = max(mx, cnt);
    }
    if(mx >= 3) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>
 
int main(void) 
{
    int n,i;
    int maxa,maxv;
    int a,v;
    scanf("%d",&n);
	scanf("%d%d",&a,&v);
	maxa=a;
	maxv=v;
    for(i=1;i<n;i++) {
        scanf("%d%d",&a,&v);
        if(v>maxv || (v==maxv && a<maxa)) {
            maxa=a;
			maxv=v;
        }
    }
    printf("%d %d\n",maxa,maxv);
    return 0;
}

Measured memory_bytes: 1028
from collections import Counter


N, K = map(int, input().split())
counter = Counter(int(x) for x in input().split())

# 書き換えが必要な種類
i = len(counter) - K

if i < 1:
  print(0)
else:
  t = [(v, k) for k, v in counter.items()]
  t.sort()
  print(sum(v for v, k in t[:i]))
  

Measured memory_bytes: 110672
# coding: utf-8
import math
import numpy as np

X = int(input())

sieve = np.ones(100004, dtype=np.bool) * True
sieve[0] = False
sieve[1] = False
limit = math.sqrt(100004)

for i in range(2, int(limit)):
    sieve[i*2::i] = False

primes = np.arange(0, 100004)[sieve]
print(primes[primes >= X][0])


Measured memory_bytes: 13376
#include <bits/stdc++.h>
using namespace std;
#define M 55
typedef long long LL;
const int P=1e9+7;
void calc(int &x,int y){
	x+=y;
	if(x>=P)x-=P;
}
int dp[M][M][M*M];
int main(){
	int n,K;
	cin>>n>>K;
	dp[0][0][0]=1;
	for(int i=0;i<n;i++)
		for(int j=0;j<=i;j++)
			for(int k=0;k<=K+4;k++){
				if(!dp[i][j][k])continue;
				calc(dp[i+1][j+1][k+j+j+2],dp[i][j][k]);
				calc(dp[i+1][j][k+j+j],dp[i][j][k]);
				if(j)calc(dp[i+1][j-1][k+j+j-2],1LL*dp[i][j][k]*j*j%P);
				calc(dp[i+1][j][k+j+j],2LL*dp[i][j][k]*j%P);
			}
	cout<<dp[n][0][K]<<endl;
	return 0;
}

Measured memory_bytes: 33024
import sys
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n)]
ab = sorted(ab,key=lambda x: x[0])
total,num=0,0
for i in range(n):
  for j in range(ab[i][1]):
    total+=ab[i][0]
    num+=1
    if num==m:
      print(total)
      sys.exit()

Measured memory_bytes: 29796
#include <iostream>
#include <string>
using namespace std;

int main()
{
int a,b;
cin>>a>>b;
if(a==1&&b!=1)
       cout<<"Alice";
if(b==1&&a!=1)
       cout<<"Bob";
if(a>b&&a!=1&&b!=1)
       cout<<"Alice";
else if(b>a&&a!=1&&b!=1)
       cout<<"Bob";
else if(a==b)
       cout<<"Draw";

    return 0;
}


Measured memory_bytes: 3108
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
r = n%10
if r==3:
    print('bon')
elif r in [0,1,6,8]:
    print('pon')
else:
    print('hon')


Measured memory_bytes: 61932
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 
#define U_MAP unordered_map<ll,ll>

ll n,cnt,ans,a[ohara],b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
        cin.tie(0);
        cout.tie(0);
    ios::sync_with_stdio(false);

    cin>>n;
    rep(i,n)cin>>a[i];
    sort(a,a+n);
    ll le,ri;
    le=a[n/2-1];
    ri=a[n/2];
    if(le==ri)Cout(0);
    else{
        ans=ri-le;
        Cout(ans);
    }
    return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>

int num_visvle_buildings(int n,int h[]){
    int i;
    int cnt=0;
    int high = 0;
    for(i=0;i<n;++i){
        if(high<=h[i]){
            high = h[i];
            cnt += 1;
        }
    }
return cnt;
}

int main(void){
    int n;
    scanf("%d",&n);
    int h[n];
    int i;
    for(i=0;i<n;i++){
        scanf("%d",&h[i]);
    }
    printf("%d",num_visvle_buildings(n,h));
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,x,y,total;
	cin>>n>>k>>x>>y;
	if(n<=k)
	{
		total=n*x;
		cout<<total<<endl;
	}
	else
		{
			total=k*x+(n-k)*y;
			cout<<total<<endl;
		}
	return 0;	
}

Measured memory_bytes: 256
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    for i in a:
        if i%2 == 0 and (i%3 != 0 and i%5 != 0):
            print("DENIED")
            return
    print("APPROVED")
    return
 
if __name__ == "__main__":
    main()

Measured memory_bytes: 9124
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> VECLL;
typedef vector<P> VECP;
typedef priority_queue<P,VECP,greater<P> > PQP;
typedef priority_queue<ll, VECLL, greater<ll> > PQll;

#define rep(i,a,n) for(ll i = a;i < n;i++)   
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

int main(){
    ll x,y,a,b,c;
    cin >> x >> y >> a >> b >> c;
    priority_queue<P,VECP> pq;
    rep(i,0,a){
        ll p;
        cin >> p;
        pq.push(P(p,0));
    }
    rep(i,0,b){
        ll q;
        cin >> q;
        pq.push(P(q,1));
    }
    rep(i,0,c){
        ll r;
        cin >> r;
        pq.push(P(r,2));
    }

    ll cnt = 0,ans = 0,r_cnt = 0,g_cnt = 0;
    while(!pq.empty() && cnt < x+y){
        P p = pq.top();
        pq.pop();
        if(p.sc == 0){
            if(r_cnt < x){
                ans += p.fs; 
                r_cnt++;
                cnt++;
            }
        }
        else if(p.sc == 1){
            if(g_cnt < y){
                ans += p.fs;
                g_cnt++;
                cnt++;
            }
        }
        else {
            ans += p.fs;
            cnt++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 11600
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b := nextInt(), nextInt()

	if b > a {
		a, b = b, a
	}
	lcm := a * b / gcd(a, b)
	fmt.Println(lcm)
}

func gcd(a int, b int) int {
	for {
		r := a % b
		if r == 0 {
			return b
		}
		a = b
		b = r
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

#define MOD 2019

typedef long long ll;

using namespace std;
int main(){
    ll L, R;
    int ans;
    cin >> L >> R;
    ll diff = R - L;
    if (diff >= MOD - 1) ans = 0;
    else {
    	int p = L % MOD;
    	int q = R % MOD;
    	if (p > q) ans = 0;
    	else {
    		ans = MOD;
    		int res = 0;
    		for (int i = p; i <= q - 1; i++) {
    			for (int j = i + 1; j <= q; j++){
    				res = (i * j) % MOD;
    				if (res < ans) ans = res;
    			}
    		}
    	}
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,i,n,j,t;
    t=0;
    scanf("%d%d",&a,&b);
    for(i=a;i<b+1;i++){
            n=i;
            j=0;
            while(n!=0)
            {
            j=j*10+n%10;
            n=n/10;
            }
            if(j==i)
                t++;
    }
    printf("%d",t);
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <math.h>
int main()
{
	double area,perim,pi,r;
        pi=acos(-1.0);
	scanf("%lf",&r);
	area=pi*r*r;
	perim=2*pi*r;
	printf("%0.6lf %0.6lf\n",area,perim);
	return 0;
}


Measured memory_bytes: 2112
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
int a[3][3],n;
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;

int gcd(int a,int b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}
int lcm(int a,int b){
	return a /gcd(a,b) * b;
}







int main() {
  int n;
  cin >> n;
  int a[n+1];
  rep (i,n){
    cin >> a[i];
  }
  int c1=0,c2=0,c3=0,c4=0,c5=0,c6=0,c7=0,c8=0,c9=0,sum;
  rep (i,n){
    if (a[i]<400&&c1==0) c1++;
    if (a[i]>=400&&a[i]<800&&c2==0) c2++;
    if (a[i]>=800&&a[i]<1200&&c3==0) c3++;
    if (a[i]>=1200&&a[i]<1600&&c4==0) c4++;
    if (a[i]>=1600&&a[i]<2000&&c5==0) c5++;
    if (a[i]>=2000&&a[i]<2400&&c6==0) c6++;
    if (a[i]>=2400&&a[i]<2800&&c7==0) c7++;
    if (a[i]>=2800&&a[i]<3200&&c8==0) c8++;
    if (a[i]>=3200) c9++;
    sum = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8;
  }
  if (c9&&sum) cout << sum << " " << sum+c9 << endl;
  else if (sum==0&&c9) cout << 1 << " " << c9 << endl;
  else cout << sum << " " << sum << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

int main(void) {
    string str;
    //string bstr, astr;
    int j = 0;
    int flag = 1;
    cin >> str;
    int len = str.size();
    vector<string> bstr(len / 2);
    vector<string> astr(len / 2);
    
    
    for(int i = 0; i < (len / 2); i++){
        
        bstr.at(i) = str.at(i);
        astr.at(i) = str.at((len + 1) / 2 + i);
       
    }
    
    for(int i = 0; i < bstr.size(); i ++){
        if(bstr.at(i) != astr.at(i)){
            //cout << "No" << endl;
            flag = 0;
        }
        if(i < (bstr.size() / 2)){
            if(!((bstr.at(i) == bstr.at(bstr.size() - 1 - i)) && (astr.at(i) == astr.at(astr.size() - 1 - i)))){
                //cout << "No" << endl;
                flag = 0;
            }
        }
        
    }

    if(flag == 1){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256