akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

template <typename T>
using Matrix = vector<vector<T>>;

template <typename T>
Matrix<T> matrix(const int R, const int C, const T x = T()) { return Matrix<T>(R, vector<T>(C, x)); }

using ll = long long;

struct Mod
{
    static const auto P = int(924844033);
    int k;

    Mod() = default;
    Mod(const int k) : k(k) {}
};

Mod operator+(const Mod a, const Mod b) { return (a.k + b.k) % Mod::P; }
Mod operator*(const Mod a, const Mod b) { return int((ll(a.k) * b.k) % Mod::P); }
Mod& operator+=(Mod& a, const Mod b) { return a = a+b; }

int main()
{
    int N, K; cin >> N >> K;

    auto ways = matrix<Mod>(N+1, 2);
    ways[0][false] = 1;

    for (auto offset = 0; offset < 2*K; offset++)
    {
        for (auto i = offset < K ? offset+K : offset; i < N; i += 2*K)
        {
            const auto previous = ways;
            ways[0] = previous[0];
            for (auto r = 1; r <= N; r++)
            {
                ways[r][false] = previous[r-1][false] + previous[r][true] + previous[r][false];
                if (i+K < N) ways[r][true] = previous[r-1][false] + previous[r-1][true];
                else ways[r][true] = 0;
            }
        }

        for (auto r = 0; r <= N; r++)
        {
            ways[r][false] += ways[r][true];
            ways[r][true] = 0;
        }
    }

    auto factorials = vector<Mod>(N+1);
    factorials[0] = 1;
    for (auto i = 1; i <= N; i++)
        factorials[i] = factorials[i-1] * i;

    auto result = Mod(0);
    for (auto r = 0, sign = 1; r <= N; r++, sign *= -1)
        result += sign * ways[r][false] * factorials[N-r];
    if (result.k < 0) result.k += Mod::P;
    cout << result.k << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

int main(){
    int N;
    cin >> N;
    ll A[N];
    rep(i, N) cin >> A[i];
    if(A[0] != 0) {cout << -1 << endl; return 0;}
    ll ans = 0;
    rep2(i, 1, N-1){
        if(A[i] > A[i-1]+1) {cout << -1 << endl; return 0;}
        elif(A[i] == A[i-1]+1) ans++;
        else ans += A[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 1792
//#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#define int long long
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false),cin.tie(nullptr);
#endif
#define ff first
#define ss second
#define endl '\n'
#define all(c) c.begin(),c.end()
const int MOD=1e9+7;
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" "; cout<<endl;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(){
	int a,b;
	cin>>a>>b;
	int x=a+b;
	if((a+b)%2==0)x/=2;
	else {
		x/=2;x++;
	}
	cout<<x<<endl;
}
int32_t main(){
  IOS;
  solve();
  //debug();
 #ifdef LOCAL_DEFINE
 cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
 #endif	
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	S := nextStr()
	T := nextStr()
	if S == T[:(len(T)-1)] {
		fmt.Print("Yes")
	} else {
		fmt.Print("No")
	}
}


Measured memory_bytes: 1756
/*
    Only way to go is UP 
    H1s3nb3rg's Here !!
*/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h> 
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<int,int> pi;
typedef uint64_t i64;
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<vector<ll>> v2ll;
const int MOD = 1e9+7;
#define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define MAIN int main(){FAST_IO;ll tc;cin>>tc;while(tc--){solver();}ret0;}
#define MAIN1 int main(){FAST_IO;solver();ret0;}
#define rep(i,b,e) for(__typeof(e)i=(b)-((b)>(e));i!=(e)-((b)>(e));i+=1-2*((b)>(e)))
#define repa(i,x)  for(auto i:x)
#define vin(x) for(auto &i:x){cin>>i;}
#define vin1(x) for(ll i=1;i<x.size();i++){cin>>x[i];}
#define dbg(x) for(auto i:x){cout<<i<<" ";}cout<<ENDL;
#define dbg2(x) for(auto &i:x){for(auto j:i){cout<<j<<" ";}cout<<endl;}
#define dbgp(x) for(auto i:x){cout<<i.ff<<" "<<i.ss<<endl;}
#define ENDL "\n"
#define VALL(a) a.begin(),a.end()
#define ff first
#define ss second
#define sz(x) (int)x.size()
#define MP(a,b) make_pair(a,b)
#define ff first
#define ss second
#define ret0 return 0;
#define ret return;
#define pb(x) push_back(x)
/*----------------------------*/

string getStr(vector<vector<int>> &dp,string a,string b,int i,int j){
    if(i==0 || j==0)
        return "";
    if(a[i-1]==b[j-1])
        return getStr(dp,a,b,i-1,j-1)+a[i-1];
    else{
        if(dp[i-1][j]>dp[i][j-1])
            return getStr(dp,a,b,i-1,j);
        else
            return getStr(dp,a,b,i,j-1);
    }
}
void solver(){
    string a;
    string b;
    cin>>a>>b;
    vector<vector<int>> dp(a.length()+1,vector<int>(b.length()+1,0));
    for(int i=1;i<=a.length();i++){
        for(int j=1;j<=b.length();j++){
            if(a[i-1]==b[j-1]) dp[i][j]=(dp[i-1][j-1]+1);
            else dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    }
    cout<<getStr(dp,a,b,a.length(),b.length())<<ENDL;
    ret;
}

MAIN1


Measured memory_bytes: 68736
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);


const int INF = 1e13;


int main() {
    int N,W; cin >> N >> W;
    vector<ll> w(N), v(N);
    rep(i, N) cin >> w[i] >> v[i];

    // Wが1e9なので、前とおなじ方法だとTLEになる
    // v[i]が1e3なので、価値ベースでdpをくむ
    // i番目までの商品でjの価値を作れる最小の重さ
    // -1は作れないということ
    vector<vector<ll>> dp(N+1, vector<ll>(1e5 + 5, INF));


    rep(i, N) {
        // v[i]の最大値=1e3 * Nの最大値=1e2
        dp[i][0] = 0;

        if(w[i] <= W) dp[i+1][v[i]] = min(w[i], dp[i][v[i]]);

        rep(j, 1e5 + 5) {
            if(j >= v[i] && dp[i][j - v[i]] + w[i] <= W) {
                dp[i+1][j] = min(dp[i][j - v[i]] + w[i], dp[i][j]);
            } else {
                dp[i+1][j] = dp[i][j];
            }
        }
    }

    ll ans = 0;
    rep(i, 1e5 + 5) {
        if(dp[N][i] != INF) ans = i;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 80256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cmath>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main() {
  int N;
  cin >> N;
  vector<int> b(N);
  rep(i, N) {
    cin >> b[i];
    b[i]--;
  }
  stack<int> st;
  while (b.size()) {
    for (int i=b.size()-1; i>=0; i--) {
      if (i == b[i]) {
        b.erase(b.begin()+i);
        st.push(i);
        break;
      }
      if (!i) {
        cout << -1 << endl;
        return 0;
      }
    }
  }
  while (!st.empty()) {
    int tmp = st.top();
    tmp++;
    cout << tmp << endl;
    st.pop();
  }
  return 0;
}

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

#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define EPS (1e-7)

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;

int vx[]={0,0,-1,1};
int vy[]={1,-1,0,0};
int dx[]={1,0,-1,1,-1,1,0,-1};
int dy[]={1,1,1,0,0,-1,-1,-1};

const ll mod=1e9+7;
const int INF=INT_MAX/2;
const int MAX=1e9;

int main(){
	ll x,y;
	cin>>x>>y;
	if(x%y==0){
		cout<<-1<<endl;
	}else{
		cout<<x*(y-1)<<endl;
	}
	return 0;
}

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

int n;
int t1[3][10];
int t2[3][10];
int t3[3][10];
int t4[3][10];
int a[20];

void solve(){
    cin>>n;
    for(int i=0;i<3;i++){
        for(int j=0;j<10;j++){
            t1[i][j]=0;
        }
    }
    for(int i=0;i<20;i++){
        a[i]=1;
    }
    while(n--){
        int b,f,r,v;
        cin>>b>>f>>r>>v;
        if(b==1){
            t1[f-1][r-1]+=v;
        }else if(b==2){
            t2[f-1][r-1]+=v;
        }else if(b==3){
            t3[f-1][r-1]+=v;
        }else if(b==4){
            t4[f-1][r-1]+=v;
        }
    }
    for(int i=0;i<3;i++){
        for(int j=0;j<10;j++){
            cout<<" "<<t1[i][j];
        }
        cout<<""<<endl;
    }
    for(int i=0;i<20;i++){
        if(a[i]==1){
            cout<<"#";
        }
    }
    cout<<""<<endl;
    for(int i=0;i<3;i++){
        for(int j=0;j<10;j++){
            cout<<" "<<t2[i][j];
        }
        cout<<""<<endl;
    }
    for(int i=0;i<20;i++){
        if(a[i]==1){
            cout<<"#";
        }
    }
    cout<<""<<endl;
    for(int i=0;i<3;i++){
        for(int j=0;j<10;j++){
            cout<<" "<<t3[i][j];
        }
        cout<<""<<endl;
    }
    for(int i=0;i<20;i++){
        if(a[i]==1){
            cout<<"#";
        }
    }
    cout<<""<<endl;
    for(int i=0;i<3;i++){
        for(int j=0;j<10;j++){
            cout<<" "<<t4[i][j];
        }
        cout<<""<<endl;
    }

}
int main(){
    solve();
    return 0;
}




Measured memory_bytes: 3092
import sys

N = int(input())
A = [list(map(int, input().split())) for _ in range(2)]

dp = [[0 for _ in range(N)]for _ in range(2)]

dp[0][0] = A[0][0]

for i in range(2):
    for j in range(N):
        if j < N-1:
            dp[i][j + 1] = max(dp[i][j + 1], dp[i][j] + A[i][j + 1])
        if i == 0:
            dp[1][j] = max(dp[1][j], dp[0][j] + A[1][j])

print(dp[1][N-1])

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define im 2147483647
#define lm 9223372036854775807
#define ll long long
#define ii pair<int, int>
#define debug(index, num) cerr << "Case #" << index << ": " << num << endl
#define be(x) x.begin(), x.end()
#define rbe(x) x.rbegin(), x.rend()
#define pb push_back
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	int n, w, sum = 0;
	cin >> n >> w;
	vector<ll> dp(100010, im);
	vector<int> wei(n+1), val(n+1);
	for(int i = 1; i <= n; i++) {
		cin >> wei[i] >> val[i];
		sum += val[i];
	} 
	dp[0] = 0;
	for(int i = 1; i <= n; i++) {
		for(int j = sum; j >= val[i]; j--) {
			dp[j] = min(dp[j], dp[j-val[i]] + wei[i]);
		}
	}
    for(int i = sum; i >= 0; i--) {
		if(dp[i] <= w) return cout << i, 0;
	}
}

Measured memory_bytes: 1024
#include <stdio.h>

int main(void){
  int a, b, data;
  char p;
  do{
    scanf("%d %c %d", &a, &p, &b);
    if(p=='?')  break;

    if(p=='+') data = a + b;
    if(p=='-') data = a - b;
    if(p=='*') data = a * b;
    if(p=='/'){
      if(b == 0)  break;
      else   data = a / b;
    }
    printf("%d\n", data);
  }while(1);

  return 0;
}



Measured memory_bytes: 2056
from math import sqrt

n = int(input())

ans = 0


def judge(x):
    global n
    if x == 0:
        return False
    return n // x == n % x


for i in range(1, int(sqrt(n)) + 1):
    if n % i == 0:
        if judge(i-1):
            ans += i-1
        if judge(n // i - 1):
            ans += n // i - 1

print(ans)


Measured memory_bytes: 9128
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define all(v) ALL(v)
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
#define CININIT cin.tie(0),ios::sync_with_stdio(false)
struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }

constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

class FordFulkerson{
    private:
        struct edge{
            int to,cap,rev;
            edge(){}
            edge(int t,int c,int r) : to(t),cap(c),rev(r){}
        };
        vector<vector<edge>> G;
        vector<bool> used;
    public:
        FordFulkerson(int maxv) : G(maxv) , used(maxv,false){}
        void add_edge(int from,int to,int cap){
            G[from].push_back(edge(to,cap,G[to].size()));
            G[to].push_back(edge(from,0,G[from].size()-1));
        }
        int dfs(int v,int t,int f){
            if(v==t) return f;
            used[v]=true;
            for(int i=0;i<G[v].size();i++){
                edge &e=G[v][i];
                if(!used[e.to] && e.cap>0){
                    int d=dfs(e.to,t,min(f,e.cap));
                    if(d>0){
                        e.cap -= d;
                        G[e.to][e.rev].cap += d;
                        return d;
                    }
                }
            }
            return 0;
        }
        int maxflow(int s,int t){
            int flow=0;
            while(1){
                fill(used.begin(),used.end(),false);
                int f=dfs(s,t,INF);
                if(f==0) return flow;
                flow+=f;
            }
        }
};

void solve(int n,int m){
    int s=n+m,t=s+1;
    FordFulkerson f(n+m+2);

    vector<int> blue(n),red(m);
    rep(i,n) cin>>blue[i];
    rep(i,m) cin>>red[i];

    for(int i=0;i<n;i++){
        f.add_edge(s,i,1);
    }
    for(int i=0;i<m;i++){
        f.add_edge(i+n,t,1);
    }


    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            int g=gcd(blue[i],red[j]);
            if(g!=1){
                f.add_edge(i,n+j,1);
            }
        }
    }

    int ans = f.maxflow(s,t);
    cout << ans << endl;
}

int main(){
    int n,m;
    while(cin>>n>>m){
        if(n==0 && m==0) break;
        solve(n,m);
    }
}

Measured memory_bytes: 7276
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 400;
const int K = 30;
const int mod = 1e9 + 7;
int dp[N][N], cost[N][N];
string s[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int h, w;
    cin >> h >> w;
    int ans = 0;
    for (int i = 0; i < h; i++) cin >> s[i];
    for (int i = 0; i < w - 1; i++){
        memset(cost, 0, sizeof(cost));
        for (int j = 0; j <= h; j++){
            for (int l = 0; l <= h; l++){
                dp[j][l] = 1e9;
                cost[j][l] = 0;
            }
        }
        dp[0][0] = 0;
        for (int j = 0; j <= h; j++){
            for (int l = 0; l <= h; l++){
                if (j == 0){
                    for (int k = l; k < h; k++){
                        if (s[k][i] == s[k - l][i + 1]) cost[j][l]++;
                    }
                } else
                if (l == 0){
                    for (int k = j; k < h; k++){
                        if (s[k - j][i] == s[k][i + 1]) cost[j][l]++;
                    }
                } else{
                    cost[j][l] = cost[j - 1][l - 1] - (s[h - j][i] == s[h - l][i  + 1]);
                }
                dp[j + 1][l] = min(dp[j + 1][l], dp[j][l] + cost[j][l]);
                dp[j][l + 1] = min(dp[j][l + 1], dp[j][l] + cost[j][l]);
            }
        }
        ans += dp[h][h];
    }
    cout << ans;
}


Measured memory_bytes: 5920
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N;
	int ans = 0;
	
	cin>>N;
	
	for(int i = 2; i * i <= N; i++){
		int con = 0, temp = 0, j = 1;
		
		while(N%i == 0){
			N /= i;
			con++;
		}
		
		while(con >= j){
			con -= j;
			temp++;
			j++;
		}
		
		ans += temp;
	}
	
	if(N != 1) ans++;
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 3652
#include<iostream>
#include <climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define INF (int)1e9
#define INFL (ll)1e11
using namespace std;
typedef long long ll;
typedef pair<int, int> P;



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N;
	cin >> N;
	int res = 0;
	for (int i = 1;i <= N;i += 2) {
		int cn = 2;
		for (int j = 3;j <= sqrt(i);j += 2) {
			if (i%j == 0) {
				if (j == sqrt(i)) cn++;
				else cn += 2;
			}
		}
		if (cn == 8) res++;
	}
	cout << res << "\n";

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cassert>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
typedef pair<int,int> pii;
const int N = 10000;

void compute(int i,int *buf){
  buf[0]=i/1000%10;
  buf[1]=i/100%10;
  buf[2]=i/10%10;
  buf[3]=i%10;
}

pii hitAndBlow(int n,int q){
  int hit=0,blow=0;
  int buf1[5],buf2[5];
  compute(n,buf1);
  compute(q,buf2);
  rep(i,4){
    rep(j,4){
      if (buf1[i] == buf2[j]){
	if (i == j)hit++;
	else blow++;
      }
    }
  }
  return make_pair(hit,blow);
}

int solve(vector<int> &a){
  if (a.size() > 15)return -1;
  rep(i,N){
    int buf[5];
    bool isok=true;
    compute(i,buf);
    rep(j,4)REP(k,j+1,4)if (buf[j] == buf[k]){isok=false;}
    int cnt[5][5]={0};
    rep(j,a.size()){
      pii tmp = hitAndBlow(a[j],i);
      cnt[tmp.first][tmp.second]++;
      if (cnt[tmp.first][tmp.second] > 1)isok=false;
    }
    if (isok)return i;
  }
  return -1;
}

main(){
  int n;
  while(cin>>n && n){
    vector<pii> in(n);
    vector<int> cand,query(n);
    rep(i,n)cin>>query[i]>>in[i].first>>in[i].second;
    rep(i,N){
      bool isok=true;
      int buf[5];
      compute(i,buf);
      rep(j,4)REP(k,j+1,4)if (buf[j] == buf[k]){isok=false;}
      rep(j,n){
	pii tmp =hitAndBlow(i,query[j]);
	if (tmp.first == in[j].first && tmp.second == in[j].second);
	else {
	  isok=false;
	}
      }
      if (isok)cand.push_back(i);
    }
    sort(cand.begin(),cand.end());
    int ans = cand.size() == 1?cand[0]:solve(cand);
    if (ans !=-1)printf("%04d\n",ans);
    else puts("????");
  }
  return false;
}

Measured memory_bytes: 944
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#define llong long long
using namespace std;

const int N = 2e5;
llong a[N+3];
int b[N+3];
llong dp[N+3][5];
int n;

int eval(int x,int y,int id)
{
	if(x==0 || x==4)
	{
		return a[id];
	}
	else if(x==1 || x==3)
	{
		return 2-y;
	}
	else if(x==2)
	{
		return y==1 ? 0 : 1;
	}
}

int main()
{
	scanf("%d",&n);
	for(int i=1; i<=n; i++) scanf("%lld",&a[i]);
	for(int i=1; i<=n; i++)
	{
		if(a[i]==0) b[i] = 0;
		else if(a[i]&1) b[i] = 1;
		else b[i] = 2;
	}
	memset(dp,42,sizeof(dp));
	for(int i=0; i<=4; i++) dp[0][i] = 0ll;
	for(int i=1; i<=n; i++)
	{
		for(int j=0; j<=4; j++)
		{
			for(int k=0; k<=j; k++)
			{
				dp[i][j] = min(dp[i][j],dp[i-1][k]+eval(j,b[i],i));
			}
		}
	}
	llong ans = min(min(min(dp[n][0],dp[n][1]),dp[n][2]),min(dp[n][3],dp[n][4]));
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

const ll inf = LONG_LONG_MAX / 2 - 1;
vector<ll> cnt(200), odd;

void solve(ll n) {
    if (cnt[0] == 0) {
        rep(i, sz(cnt)) {
            cnt[i] = (i + 1) * (i + 2) * (i + 3) / 6;
            if (cnt[i] % 2 == 1) odd.push_back(cnt[i]);
        }
    }
    vector<ll> dp(n + 1, inf);
    rep(i, n + 1) dp[i] = i;
    reps(i, 1, sz(cnt)) {
        reps(j, cnt[i], n + 1) {
            dp[j] = min(dp[j], dp[j - cnt[i]] + 1);
        }
    }
    ll ans1 = dp[n];
    rep(i, n + 1) dp[i] = i;
    reps(i, 1, sz(odd)) {
        reps(j, odd[i], n + 1) {
            dp[j] = min(dp[j], dp[j - odd[i]] + 1);
        }
    }
    ll ans2 = dp[n];
    printf("%lld %lld\n", ans1, ans2);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    while(true) {
        ll t;
        cin >> t;
        if (t == 0) break;
        solve(t);
    }
    return 0;
}



Measured memory_bytes: 17664
#include<iostream>
#include<string>
using namespace std;
int main(){
    string a,b;
    cin >> a >> b;
    bool ans = false;
    if(a.size() != b.size()){
        ans = a.size()>b.size();
    }
    else{
        for(int i=0;i<a.size();i++){
            if(a[i]!=b[i]){
                ans = a[i] > b[i];
                break;
            }
            if(i==a.size()-1){
                cout << "EQUAL" << endl;
                return 0;
            }
        }
    }
    if(ans){
        cout << "GREATER" << endl;
    }
    else{
        cout << "LESS" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#define MAX 1000000000000000000

int main() {
	long long N; std::cin >> N;
	std::vector<long long> P(N);
	for (auto& r : P) {
		std::cin >> r;
		if (r == 0) {
			std::cout << 0 << std::endl;
			return 0;
		}
		if (r > MAX) {
			std::cout << -1 << std::endl;
			return 0;
		}
	}
	long long ans{ 1 };
	for (int i{ 0 }; i < N; ++i) {
		if (MAX / ans < P[i]) {
			std::cout << -1 << std::endl;
			return 0;
		}
		ans *= P[i];
	}
	std::cout << ans << std::endl;

	return 0;
}

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

using namespace std;
using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define rep(i, N) for (ll i = 0; i < (N); i++)
#define For(i, a, b) for (ll i = (a); i < (b); i++)
#define all(A) (A).begin(), (A).end()

int main(){
    int N;
    cin >> N;
    int A[9];
    rep(i, 9) A[i] = 0;
    rep(i, N) {
        int tmp;
        cin >> tmp;
        tmp = min(tmp / 400, 8);
        A[tmp]++;
    }
    int ans = 0;
    rep(i, 8) {
        if (A[i] >= 1) ans++;
    }
    int min_ans;
    min_ans = max(ans, 1);
    int max_ans;
    max_ans = ans + A[8];

    cout << min_ans << " " << max_ans << endl;

    return 0;
}


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

using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

class UnionFind {
public:
    vector<ll> par;  // 各元の親を表す配列
    vector<ll> siz;  // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;  // 初期では親は自分自身
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);                     // resize だとなぜか初期化されなかった
        for (ll i = 0; i < sz_; ++i) par[i] = i;  // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x) {  // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]];  // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {  // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x) {  // 素集合のサイズ
        return siz[root(x)];
    }
};

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

    ll N, M, K;
    cin >> N >> M >> K;

    Vl in(N);

    UnionFind uf(N);
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        uf.merge(a, b);
        ++in[a], ++in[b];
    }

    vector<Vi> br(N);
    for (int i = 0; i < K; i++) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        br[a].push_back(b);
        br[b].push_back(a);
    }

    Vl ans(N);

    for (int i = 0; i < N; i++) {
        ans[i] = uf.size(i) - 1 - in[i];
        for (const auto& bro : br[i]) {
            if (uf.issame(i, bro)) --ans[i];
        }
    }

    for (int i = 0; i < N - 1; i++) {
        cout << ans[i] << " ";
    }
    cout << ans[N - 1] << endl;

    return 0;
}

Measured memory_bytes: 9088
N = int(input())
c = list(input())
num_r = 0
for ci in c:
    if ci == 'R':
        num_r += 1
ans = 0
if num_r != N and num_r != 0:
    for i in range(num_r):
        if c[i] == 'W':
            ans += 1
print(ans)

Measured memory_bytes: 10788
n, A, B = map(int, input().split())
S = input()

a, b = 0, 0
for s in S:
    if s == 'a' and a+b < A+B:
        print('Yes')
        if a < A:
            a += 1
        else:
            b += 1
    elif s == 'b' and b < B:
        print('Yes')
        b += 1
    else:
        print('No')


Measured memory_bytes: 4016
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
  cin >> s;
  int ans,i,size;
  size=s.size();
  ans=0;
  
  for(i=0;i<size/2;++i)
  {
  if(s.at(i)!=s.at(size-1-i)) ans++;
  }

  cout << ans;
return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;
typedef long long ll;

int main(){

    int n; cin >> n;

    map<int, int> a;
    int temp;
    for(int i=0; i<n; i++){
        cin >> temp;
        a[temp]++;
    }

    int vmax = 0;
    for(int i=1; i<1e5; i++){
        vmax = max(vmax, a[i-1]+a[i]+a[i+1]);
    }

    cout << vmax;


    return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n,w;
  cin>>n>>w;
  int a[n],b[n];
  for(int i=0;i<n;i++)
    cin>>a[i]>>b[i];
    long long int dp[n+1][w+1];
    for(int i=0;i<=n;i++)
    for(int j=0;j<=w;j++)
    {
    	if(i==0||j==0)
    	dp[i][j]=0;
    	else if(j>=a[i-1])
    	dp[i][j]=max(b[i-1]+dp[i-1][j-a[i-1]],dp[i-1][j]);
    	else dp[i][j]=dp[i-1][j];
	}
	cout<<dp[n][w]<<endl;
}

Measured memory_bytes: 79232
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;
typedef long long ll;
const int INF=100000000;
const int MOD=1000000007;

int main()
{
 int h, w, d;
 cin >> h >> w >> d;
 int p[h*w+1][2];
 for(int i=1;i<h+1;i++){
   for(int j=1;j<w+1;j++){
     int a;
     cin >> a;
     p[a][0]=j;
     p[a][1]=i;
   }
 }
  
 int dis[h*w+1]={};
 for(int i=d+1;i<h*w+1;i++){
 dis[i]=dis[i-d]+abs(p[i][0]-p[i-d][0])+abs(p[i][1]-p[i-d][1]);
 }
  
 for(int i=d+1;i<h*w+1;i++){
// cout << dis[i] << endl;
 }
  
 int q;
 cin >> q;
 for(int i=0;i<q;i++){
   int l,r;
   cin >> l >> r;
   cout << dis[r]-dis[l] << endl;
 }
 return 0;
}

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

int main()
{
    int a, b, c, x, i, j, k, count=0;
    cin >> a >> b >> c >> x;
    x /= 50;
    for(i=0; i<=a; i++){
        for(j=0; j<=b; j++){
            for(k=0; k<=c; k++){
                if(10*i + 2*j + k == x) {
                    count++;
                }
            }
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
 	String s = sc.next();
      
      if(a>=3200){
     System.out.println(s);
      }else{
     System.out.println("red");
      }
}
}

Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
const long long mod=1e9+7;
long long Fact[2001000];
long long Fastmi(long long X,long long Exp)
{
	if(Exp==0)
		return 1ll;
	long long res=Fastmi(X*X%mod,Exp/2);
	if(Exp%2)
		res=res*X%mod;
	return res%mod;
}
long long NiYuan(long long X)
{
	return Fastmi(X,mod-2);
}
long long Div(long long A,long long B)
{
	return A*NiYuan(B)%mod;
}
long long C(long long N,long long K)
{
	return Div(Div(Fact[N],Fact[K]),Fact[N-K]);
}
void init()
{
	Fact[0]=1ll;
	for(int i=1;i<2001000;i++)
		Fact[i]=Fact[i-1]*i%mod;
	return ;
}
int main()
{
	init();
  long long K;
  cin>>K;
  string S;
  cin>>S;
  long long L=S.length();
  long long Ans=0;
  for(int i=0;i<=K;i++)
  {
  	long long Le=K-i;
  	long long res=C(Le+L-1,L-1);
  	res=res*Fastmi(25ll,Le)%mod;
  	res=res*Fastmi(26ll,(long long)(i))%mod;
  	Ans=(Ans+res)%mod;
  }
  cout<<Ans<<endl;
  return 0;
}

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

const int INF = 1<<28;
const int MAXN = 101;
const int MAXD = 101;
const int MAXE = 101;

int D, N;
int dp[MAXD][MAXE];
int a[MAXN], b[MAXN], c[MAXN];

int main() {
  while(cin >> D >> N && (D|N)) {
    for(int i = 0; i < N; ++i)
      cin >> a[i] >> b[i] >> c[i];
    fill(dp[0], dp[MAXD], INF);
    dp[0][0] = 0;
    for(int d = 0; d <= D; ++d) {
      for(int e = 0; e < MAXE; ++e) {
	for(int i = 0; i < N; ++i) {
	  if(e < c[i]) continue;
	  int nd = min(d + a[i], D);
	  int ne = min(e + b[i], MAXE-1);
	  dp[nd][ne] = min(dp[nd][ne], dp[d][e] + 1);
	}
      }
    }
    int res = INF;
    for(int e = 0; e < MAXE; ++e) {
      res = min(res, dp[D][e]);
    }
    if(res == INF) cout << "NA" <<endl;
    else cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 1204
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char a = sc.next().charAt(0),b = sc.next().charAt(0);
		if(a == b) {
			System.out.println("H");
		}else {
			System.out.println("D");
		}
	}
}


Measured memory_bytes: 21332
import sys
sys.setrecursionlimit(10**7)

n, a, b, c = map(int, input().split())
l = [int(input()) for _ in range(n)]

mp = float('inf')
def f(i, anum, alen, bnum, blen, cnum, clen):
    global mp
    if i == n:
        if alen * blen * clen == 0:
            return
        mp = min(mp, abs(anum-a)+10*(alen-1) + abs(bnum-b)+10*(blen-1) + abs(cnum-c)+10*(clen-1))
    else:
        f(i+1, anum+l[i], alen+1, bnum, blen, cnum, clen)
        f(i+1, anum, alen, bnum+l[i], blen+1, cnum, clen)
        f(i+1, anum, alen, bnum, blen, cnum+l[i], clen+1)
        f(i+1, anum, alen, bnum, blen, cnum, clen)

f(0, 0, 0, 0, 0, 0, 0)


print(mp)

Measured memory_bytes: 41956
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 100005

ll uniformity[8*NUM], partial[8*NUM];
ll N = 1;

void init(ll first_N){
	while(N < first_N)N *= 2;
}

//leftだけ0idにしたときadd(s,t, value)で、[s,t]にvalueを足したことになる
void add(ll left,ll right,ll value,ll node_id,ll node_left,ll node_right){

	if(right <= node_left || left >= node_right)return;
	else if(left <= node_left && right >= node_right){
		uniformity[node_id] += value;
	}else{
		partial[node_id] += (min(right,node_right)-max(left,node_left))*value;
		add(left,right,value,2*node_id+1,node_left,(node_left+node_right)/2);
		add(left,right,value,2*node_id+2,(node_left+node_right)/2,node_right);
	}
}
//0idで見た時getsum(i,i+1)でaiの値を出力できる
ll getSum(ll left,ll right,ll node_id,ll node_left,ll node_right){
	if(right <= node_left || left >= node_right)return 0;
	else if(left <= node_left && right >= node_right){
		return (node_right-node_left)*uniformity[node_id]+partial[node_id];
	}else{
		ll sum = (min(right,node_right)-max(left,node_left))*uniformity[node_id];
		sum += getSum(left,right,2*node_id+1,node_left,(node_left+node_right)/2);
		sum += getSum(left,right,2*node_id+2,(node_left+node_right)/2,node_right);
		return sum;
	}
}

//1-indexedで与えられている
int main(){
	ll n,q,command,loc,left,right,value; cin >> n >> q;

	init(n);

	for(ll i = 0; i <= 2*N-2; i++){
		uniformity[i] = 0;
		partial[i] = 0;
	}

	for(ll i = 0; i < q; i++){
		cin >> command;

		if(command == 0){
			cin >> left >> right >> value; left--;
			add(left,right,value,0,0,N);
		}else{
			cin >> loc; loc--;
			cout << getSum(loc,loc+1,0,0,N) << endl;
		}
	}
	return 0;
}




Measured memory_bytes: 7212
#include <iostream>
#include<vector>
#include<stdio.h>
#include <algorithm>
#include <functional>
#include<cmath>

#define FOR(i,n) for(int i=0;i<n;i++)
#define SORT(v,n) std::sort(&v[0],&v[n])
#define INF 999999999
#define mod 1000000007



using namespace std;

int main(void){
	int N,M,X,Y;
	cin >> N >> M >> X>>Y;
	int x[N];
	int y[M];
	//bool b=true;
	for(int i=0;i<N;i++){
		cin >>x[i];
	}
	for(int i=0;i<M;i++){
		cin >>y[i];
	}
	SORT(x,N);
	SORT(y,M);

	if(max(x[N-1],X)>=min(Y,y[0])){
		cout << "War" << endl;
	}else{
		cout << "No War" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define mod 998244353
#define inf (1LL<<51)
#define int long long
typedef long long ll;
#define ld long double
#define N 401
int W;
int s = inf;
int ans = 0;
vector<int> g[4];
void rec(int i,int w,int val)
{
   
    if(w > W)
        return ;
    if(i==3)
    {
        int l = (W-w)/(s+3);
        l = min(l,(ll)g[3].size());
        if(l)
            val += g[3][l-1];

        ans = max(ans,val);

    }
    else
    {
        for(int j = 0; j <= g[i].size();j++)
        {
            rec(i+1,w+j*(s+i),val + ((j>0)?g[i][j-1]:0));
        }
    }
}


int32_t main()
{
    IOS;
   
    int n;
    cin >> n >> W;
    vector<pair<int,int>> v(n);
    
    for(int i = 0;i < n;i++)
    {
        cin >> v[i].first >> v[i].second;
        s = min(s,v[i].first);
    }


    for(int i = 0;i < n;i++)
    {
        v[i].first -= s;
        g[v[i].first].push_back(v[i].second);
    }

    for(int i = 0;i < 4;i++)
    {
        
        sort(g[i].rbegin(),g[i].rend());
    }
    for(int i = 0;i <4;i++)
    {
        for(int j = 1;j < g[i].size();j++)
        {
            g[i][j] += g[i][j-1];
        }

    }
    
    rec(0,0,0);
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#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() {
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v.at(i);
    vector<int> c(n);
    rep(i,n) cin >> c.at(i);
    int ans=0;
    rep(i,n){
        if(v.at(i)>c.at(i))ans+=v.at(i)-c.at(i);
    }
    cout << ans << endl;
}


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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, pair<T1, T2> P)
{
    return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream &operator<<(ostream &s, vector<T> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        if (i > 0)
        {
            s << " ";
        }
        s << P[i];
    }
    return s;
}
template <class T>
ostream &operator<<(ostream &s, vector<vector<T>> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        s << endl
          << P[i];
    }
    return s << endl;
}
template <class T>
ostream &operator<<(ostream &s, set<T> P)
{
    EACH(it, P) { s << "<" << *it << "> "; }
    return s << endl;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, map<T1, T2> P)
{
    EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; }
    return s << endl;
}
template <class T>
void show(vector<T> v)
{
    for (int i = 0; i < v.size(); i++)
    {
        cerr << v[i] << " ";
    }
    cerr << "\n";
}
typedef long long ll;

int a[100010];
int gcd(int x, int y) {return y ? gcd(y, x % y) : x; }
signed main()
{
    int n, m;
    cin >> n >> m;
    REP(i, n)
        cin >> a[i];
    int y = a[0];
    int tmp = 0;
    while (y%2==0)
    {
        y /= 2;
        tmp++;
    }
    for (int i = 0; i < n; i++)
    {
        int x = a[i];
        int cnt = 0;
        while (x%2==0)
        {
            x /= 2;
            cnt++;
        }
        if(tmp!=cnt){
            cout << 0 << endl;
            return 0;
        }
    }
    
    for (int i = 0; i < n; i++)
    {
        a[i] /= 2;
    }
    int lcm = a[0];
   // int tmp2 = a[0];
    for (int i = 1; i < n; i++)
    {
        lcm = lcm/ gcd(lcm, a[i]) * a[i];
        if(lcm >m){
            cout << 0 << endl;
            return 0;
        }
    }
    int s = m / lcm;
    if(s%2==0){
        cout << s / 2 << endl;
    }
    else 
    cout << (s + 1) / 2 << endl;
   // cerr << lcm << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define debug2(x, y)                       \
  cerr << "(" << #x << "," << #y << ") = " \
       << "(" << x << "," << y << ")\n"
#define all(x) x.begin(), x.end()
#define each(a, x) for (auto& a : (x))
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define int long long
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int MX = 1e5 + 5, INF = 5LL << 57, MOD = 1e9 + 7;

int N, M;
string S;
vi va, vb;

void input() {
  ;
  int a, b, c;
  cin >> a >> b >> c;
  cout << ((a + b + c >= 22) ? "bust" : "win") << endl;
  ;
}
void solve() {
  ;
  ;
}
signed main() {
  input();
  solve();
  return 0;
}

Measured memory_bytes: 764
import java.util.*;
public class Main {
	public static void main(String args[]){
		Scanner in=new Scanner(System.in);
		double x[]=new double[5];
		double y[]=new double[5];
		while(in.hasNext()){
			for(int i=0;i<4;i++){
				x[i]=in.nextDouble();
				y[i]=in.nextDouble();
			}
			boolean ans[]=new boolean[5];
			for(int i=0;i<3;i++)ans[i]=(y[i]-y[(i+1)%3])*(x[i]-x[3])<(y[i]-y[3])*(x[i]-x[(i+1)%3]);
			if(ans[0]==ans[1]&&ans[1]==ans[2]) System.out.println("YES");
			else System.out.println("NO");
		}
		in.close();
	}
}

Measured memory_bytes: 30800
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<bitset>
#define LL long long
#define mod 1e9+7
#define INF 0x3f3f3f3f
using namespace std;

namespace FastIO {
	template<typename tp> inline void read(tp &x) {
		x=0; register char c=getchar(); register bool f=0;
		for(;c<'0'||c>'9';f|=(c=='-'),c = getchar());
		for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0',c = getchar());
		if(f) x=-x;
	}
	template<typename tp> inline void write(tp x) {
		if (x==0) return (void) (putchar('0'));
		if (x<0) putchar('-'),x=-x;
		int pr[20]; register int cnt=0;
		for (;x;x/=10) pr[++cnt]=x%10;
		while (cnt) putchar(pr[cnt--]+'0');
	}
	template<typename tp> inline void writeln(tp x) {
		write(x);
		putchar('\n');
	}
}
using namespace FastIO;
int a[200010],n,k; 
int main(){
	read(n),read(k);
	for(int i=1;i<=k;++i) a[i]=n/k;
	int cache=n%k;
	for(int i=1;i<=cache;++i) ++a[i];
	LL ans=0;
	ans+=(LL)a[k]*a[k]*a[k];
	if(k%2==0) ans+=(LL)a[k/2]*a[k/2]*a[k/2];
	writeln(ans);
	return 0;
}

Measured memory_bytes: 1024
use std::io::*;
use std::str::FromStr;

fn main() {
	let x: i64 = read();
	let v: Vec<i64> = (-120_i64..120).map(|x| x.pow(5)).collect();
	for i in &v {
		match v.binary_search(&(i+x)) {
			Ok(n) => {
				println!("{} {}", ans(i+x), ans(*i));
				break;
			}
			Err(_) => continue,
		}
	}
}

fn ans(n: i64) -> i64 {
	if n < 0 {
		-(-n as f32).powf(0.2).round() as i64
	} else {
		(n as f32).powf(0.2).round() as i64
	}
}

fn read<T: FromStr>() -> T {
	let stdin = stdin();
	let stdin = stdin.lock();
	let token: String = stdin
		.bytes()
		.map(|c| c.expect("failed to read char") as char)
		.skip_while(|c| c.is_whitespace())
		.take_while(|c| !c.is_whitespace())
		.collect();
	token.parse().ok().expect("failed to parse token")
}
 

Measured memory_bytes: 2708
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
const int N=6005;
int all,dp[N][N],g[N],mx,f[N][N],gg[N],mm;
int n,a[N];
void update(int i,int j,int v)
{
    dp[i][j]=dp[j][i]=max(dp[i][j],v);
    g[i]=max(g[i],v);
    g[j]=max(g[j],v);
    mx=max(mx,v);
}
void init(int x,int y,int z)
{
    f[x][x]=dp[x][x];
    f[y][y]=dp[y][y];
    f[z][z]=dp[z][z];
    mm=mx;
    for(int i=1;i<=n;i++)
    {
        gg[i]=g[i];
        f[x][i]=f[i][x]=dp[x][i];
        f[y][i]=f[i][y]=dp[y][i];
        f[z][i]=f[i][z]=dp[z][i];
    }
}
void update1(int x,int y,int z)
{
    update(y,z,f[x][x]+1);
}
void update2(int x,int y,int z)
{
    if(x!=y) return;
    for(int i=1;i<=n;i++)
        update(i,z,f[i][x]+1);
}
void update3(int x,int y,int z)
{
    update(x,y,mm);update(y,z,mm);update(x,z,mm);
}
void update4(int x,int y,int z)
{
    update(x,x,gg[x]),update(y,y,gg[y]),update(z,z,gg[z]);
}
void update5(int x,int y,int z)
{
    for(int i=1;i<=n;i++)
        update(i,x,gg[i]),update(i,y,gg[i]),update(i,z,gg[i]);
}
void rrr()
{
    fstream in;
    in.open("1.in");
    int n=8;
    in<<n<<'\n';
    for(int i=1;i<=n*3;i++)
        in<<rand()%n+1<<(i==n*3?'\n':' ');
    in.close();
}
int main()
{
    srand(time(0));
    //rrr();freopen("1.in","r",stdin);
    memset(dp,-inf,sizeof(dp));
    memset(g,-inf,sizeof(g));
    scanf("%d",&n);
    for(int i=1;i<=3*n;i++)
        scanf("%d",&a[i]);
    update(a[1],a[2],0);
    for(int i=3;i<=3*n;i+=3)
    {
        if(i==3*n)
            update(a[i],a[i],dp[a[i]][a[i]]+1);
        else if(a[i]==a[i+1]&&a[i+1]==a[i+2])
           all++;
        else
        {
            init(a[i],a[i+1],a[i+2]);
            update1(a[i],a[i+1],a[i+2]);
            update1(a[i+1],a[i],a[i+2]);
            update1(a[i+2],a[i],a[i+1]);
            update2(a[i],a[i+1],a[i+2]);
            update2(a[i],a[i+2],a[i+1]);
            update2(a[i+1],a[i+2],a[i]);
            update3(a[i],a[i+1],a[i+2]);
            update4(a[i],a[i+1],a[i+2]);
            update5(a[i],a[i+1],a[i+2]);
        }
    }
    printf("%d\n",mx+all);
}
/*
20
2 4 12 4 5 7 2 16 11 2 10 10 6 10 12 15 20 7 20 5 2 2 5 12 14 14 8 15 13 6 3 9 9 2 19 12 11 12 7 2 1 8 18 17 18 19 11 11 6 19 19 15 15 15 2 10 12 10 5 13
*/


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

string a,b;
int len,len1,len2;

int main(){
    cin>>a>>b;
    len1=a.length();
    len2=b.length();
    len=max(len1,len2);
    int i=0;
    while(i<=len){
        if(len1>0){
            cout<<a[i];
            len1--;
        }
        if(len2>0){
            cout<<b[i];
            len2--;
        }
        i++;
    }
    printf("\n");
    return 0;
}


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

inline long long read(){
    long long s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){
        if (ch == '-') w = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * w;
}
long long a, b, n;
int main(){
    a = read(), b = read(), n = read();
    if (n >= b){
        n = b-1;
    }
    long long ans = a * n / b;
    cout << ans << endl;
    return 0;
}
//g++ D.cpp -o D.exe -lm -Wall

Measured memory_bytes: 3596
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    vector<char> p(1e5, 1);
    p[0] = p[1] = 0;
    int i = 2;
    while(i < 1e5){
        for(int j = i*2; j < 1e5; j += i){
            p[j] = 0;
        }
        while(p[++i] == 0);
    }
    vector<int> sim2017(1e5, 0);
    for(int i = 3; i < 1e5; i+=2){
        sim2017[i] += sim2017[i-2] + (p[i] && p[(i+1)/2]);
    }

    int q, l, r;
    cin >> q;
    for(int i = 0; i < q; i++){
        scanf("%d%d", &l, &r);
        printf("%d\n", sim2017[r] - sim2017[l] + (p[l] && p[(l+1)/2]));
    }
    return 0;
}

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

int main() {
	string s;
	cin>>s;
	int year = (s[0]-'0')*1000+(s[1]-'0')*100+(s[2]-'0')*10+(s[3]-'0');
	int month = (s[5]-'0')*10+s[6]-'0';
	int day = (s[8]-'0')*10+s[9]-'0';
	if(year<2019) {
		cout<<"Heisei";
		return 0;
	} else if(year == 2019) {
		if(month<4) {
			cout<<"Heisei";
			return 0;
		} else if(month == 4) {
			if(day<=30) {
				cout<<"Heisei";
				return 0;
			}
		}
	}
	cout<<"TBD";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int X, Y, Z, tmp;
    cin >> X >> Y >> Z;
    tmp = Y;
    Y = X;
    X = tmp;
    tmp = Z;
    Z = X;
    X = tmp;
    cout << X << ' ' << Y << ' ' << Z << endl;
}

Measured memory_bytes: 256
<?php

fscanf(STDIN, '%d %d %d %d', $a, $b, $c, $d);
if (abs($a-$c) <= $d) {
    echo 'Yes';
} elseif (abs($a-$b) <= $d && abs($b-$c) <= $d) {
    echo 'Yes';
} else {
    echo 'No';
}

echo PHP_EOL;


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

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; ++i) cin >> a[i];

  vector<int> b(n + 1, 0);
  int ans_cnt = 0;
  for (int i = n; i >= 1; --i) {
    int cnt = 0;
    for (int j = i * 2; j <= n; j += i) {
      if (b[j] == 1) cnt++;
    }
    if (a[i] == 1 && cnt % 2 == 0) {
      b[i] = 1;
      ans_cnt++;
    } else if (a[i] == 0 && cnt % 2 == 1) {
      b[i] = 1;
      ans_cnt++;
    }
  }
  cout << ans_cnt << endl;
  for (int i = 1; i <= n; ++i) {
    if (b[i] > 0) cout << i << endl;
  }
  return 0;
}



Measured memory_bytes: 2432