akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>

int main(){
    int N;
    std::cin >> N;

    int ans = N;
    int sum;
    int A,B;
    for (int i=1;i<N;i++) {
        A = i; B = N-i;
        sum = 0;
        while (A>0) {
            sum += A%10;
            A /= 10;
        }
        while (B>0) {
            sum += B%10;
            B /= 10;
        }
        ans = std::min(sum,ans);
    }

    std::cout << ans << '\n';
    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 const m = 2019;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1, tot = 0;
    vector<int> cnt(m);
    ll ans = 0;
    rep(i, n) {
        cnt[tot]++;
        tot += (s[i] - '0')*x;
        tot %= m;
        ans += cnt[tot];
        x = x * 10%m;
    }
  
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3736
#include <bits/stdc++.h>
#define ll long long
#define all(x) begin(x), end(x)
#define range(x) begin(x), begin(x)
#define what(x) cout << #x << ": " << x << '\n'
#define print(x) for (auto &el: x) cout << el << ' '; cout << '\n'
using namespace std;
 
template<typename S, typename T>
ostream& operator <<(ostream &os, pair<S, T> &m) { 
    os << '[' << m.first << " " << m.second << ']'; 
    return os; 
}

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

    ll x;
    cin >> x;

    ll a, b;
    cin >> a;
    cin.ignore();
    cin >> b;
    a = a * 100 + b;

    cout << x * a / 100 << endl;
    


    return 0;
}

Measured memory_bytes: 3604
#include<iostream>
#include<cstdio>

using namespace std;

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

    int d=a/b;
    int r=a%b;
    double f=(double)a/(double)b;

    cout << d <<" " << r <<" ";
    printf("%lf",f);

    return 0;

}


Measured memory_bytes: 3204
import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.Map


object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val N, C = in.next().toInt
  val D = Array.ofDim[Int](C+1, C+1)
  val c = Array.ofDim[Int](N+1, N+1)

  for (y <- 1 to C; x <- 1 to C) {
    D(y)(x) = in.next().toInt
  }
  for (y <- 1 to N; x <- 1 to N) {
    c(y)(x) = in.next().toInt
  }



  val map0: Map[Int, Int] = Map()
  val map1: Map[Int, Int] = Map()
  val map2: Map[Int, Int] = Map()

  val maps = Array(map0, map1, map2)

  for (y <- 1 to N; x <- 1 to N) {
    val nowi = (x + y) % 3
    val now = maps(nowi)
    val v = c(y)(x)

    if(now.contains(v)) {
      now(v) += 1
    }
    else {
      now += (v -> 1)
    }
  }

  val col0 = new Array[(Long, Int)](C) // (score, color - 1)
  for (i <- 1 to C) {
    var tmp = 0L
    for((k, v) <- map0) {
      tmp += D(k)(i) * v
    }
    col0(i-1) = (tmp, i-1)
  }

  val col1 = new Array[(Long, Int)](C) // (score, color - 1)
  for (i <- 1 to C) {
    var tmp = 0L
    for((k, v) <- map1) {
      tmp += D(k)(i) * v
    }
    col1(i-1) = (tmp, i-1)
  }

  val col2 = new Array[(Long, Int)](C) // (score, color - 1)
  for (i <- 1 to C) {
    var tmp = 0L
    for((k, v) <- map2) {
      tmp += D(k)(i) * v
    }
    col2(i-1) = (tmp, i-1)
  }

  var ans = Long.MaxValue
  for {
    (v0, col0) <- col0.sorted.take(3)
    (v1, col1) <- col1.sorted.take(3)
    (v2, col2) <- col2.sorted.take(3)
  } {
    if (col0 != col1 && col1 != col2 && col2 != col0) {
      ans = Math.min(ans, v0+v1+v2)
    }
  }

  println(ans)
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}


Measured memory_bytes: 43752
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#define INF         1e9
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define R_UP(a,b)   (((a)+(b)-1)/(b))
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP        cout << fixed << setprecision(8)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T x; cin >> x; return x; }

signed main()
{
	cout << 1110 - in() << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, k, n) for(int i = (k); i < (n); i++)
#define FORe(i, k, n) for(int i = (k); i <= (n); i++)
#define FORr(i, k, n) for(int i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(int i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
using ll = long long;

const int INF = 1001001001;

ll dp[41][2];
//[i][0]:i桁目がkと同じ
//[i][1]:i桁目がk以下なのが確定

int main(void){
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n);
  REP(i, n) cin >> a[i];
  REP(i, 41){
    dp[i][0] = -1;
    dp[i][1] = -1;
  }

  dp[40][0] = 0;
  
  FORre(i, 40, 0){
    ll m = 1ll << i;
    ll num = 0;
    REP(j, n) if(a[j]&m) num++;

    //0:1の数, 1:1が反転するので0の数
    ll s[] = {m*num, m*(n-num)};

    //1->1
    if(dp[i+1][1] != -1){
      chmax(dp[i][1], max(dp[i+1][1]+s[0], dp[i+1][1]+s[1]));
    }

    if(dp[i+1][0] != -1){
      //iビット目が1
      if(k&m){
        //0にする場合k以下が確定
        chmax(dp[i][1], dp[i+1][0]+s[0]);
        //1なら同じまま
        chmax(dp[i][0], dp[i+1][0]+s[1]);
      }else{
        //0の場合のみ
        chmax(dp[i][0], dp[i+1][0]+s[0]);
      }
    }
  }
  
  cout << max(dp[0][0], dp[0][1]) << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>

using namespace std;
using ll = long long;

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define ASSERT(cond,mes) assert(cond && mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<int> enum_div(int n) {
    std::vector<int> ret;
    for (int i = 1; i*i <= n; ++i) {
        if (n%i == 0) {
            ret.push_back(i);
            if (i != 1 && i*i != n) {
                ret.push_back(n / i);
            }
        }
    }
    return ret;
}

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

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

struct ToUpper {
    char operator()(char c) { return toupper(c); }
};

struct ToLower {
    char operator()(char c) { return tolower(c); }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;

    int ans = INF;

    auto digitsum = [](int n) {
        int res = 0;
        while (n > 0) {
            res += n % 10;
            n /= 10;
        }
        return res;
    };

    FOR(A, 1, N) {
        int B = N - A;
        int sum = digitsum(A) + digitsum(B);
        chmin(ans, sum);
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

#define INF 1 << 25
int min(int n1, int n2) { return n1 < n2 ? n1 : n2; }

int d[100][100];

int main(void) {
	int i, j, k, N, M, a[1000], b[1000], c[1000], ans = 0;
	scanf("%d%d", &N, &M);

	for (i = 0; i < N; i++) {
		for (j = 0; j < N; j++) {
			d[i][j] = INF;
		}
		d[i][i] = 0;
	}

	for (i = 0; i < M; i++) {
		scanf("%d%d%d", &a[i], &b[i], &c[i]);
		a[i]--;
		b[i]--;
		d[a[i]][b[i]] = c[i];
		d[b[i]][a[i]] = c[i];
	}

	// warshall_floayd
	for (k = 0; k < N; k++) {
		for (i = 0; i < N; i++) {
			for (j = 0; j < N; j++) {
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}

	for (i = 0; i < M; i++) {
		if (d[a[i]][b[i]] < c[i]) {
			ans++;
		}
	}

	printf("%d", ans);

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int N;
  scanf("%d",&N);
  char s[N+1];
  scanf("%s",s);
  int min=0;
  for(int i=1;i<N;i++){
    if(s[i]=='E'){
      min++;
    }
  }
  int y=min;
  for(int i=1;i<N;i++){
    if(s[i-1]=='W'){
      y++;
    }
    if(s[i]=='E'){
      y--;
    }
    if(y<min){
      min = y;
    }
  }
  printf("%d",min);
  return 0;
}



Measured memory_bytes: 512
#include<stdio.h>
int main(){
    int n,i,x,k,y;
    scanf("%d",&n);
    for(i=1;i<=n;++i){
        x = i;
        for ( k = 0; k < 5; ++k)
        {
            // x /= 10;
            if( x % 10 == 3){
                printf(" %d",i);
                y = i;
                break;
            }
            x /= 10;

        }
        if (i % 3 == 0)
        {
            if(y == i) continue;
            printf(" %d",i);
        }
    }
    printf("\n");
    return 0;
}
	


Measured memory_bytes: 2072
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

ll dist[110][110];
ll dist_t[110][110];

int main() {

	int N, M; cin >> N >> M;
	vector<int> a(M), b(M), c(M);
	REP(i, M)cin >> a[i] >> b[i] >> c[i];

	REP(i, 110)REP(j, 110)dist[i][j] = 1e9;
	for (int i = 1; i <= N; i++)dist[i][i] = 0;
	REP(i, M)dist[a[i]][b[i]] = dist[b[i]][a[i]] = c[i];

	for (int k = 1; k <= N; k++) {
		for (int i = 1; i <= N; i++) {
			for (int j = 1; j <= N; j++) {
				dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
			}
		}
	}

	ll ans = 0;
	REP(kai, M) {
		REP(i, 110)REP(j, 110)dist_t[i][j] = 1e9;
		for (int i = 1; i <= N; i++)dist_t[i][i] = 0;
		REP(i, M) {
			if (i != kai) {
				dist_t[a[i]][b[i]] = dist_t[b[i]][a[i]] = c[i];
			}
		}
		for (int k = 1; k <= N; k++) {
			for (int i = 1; i <= N; i++) {
				for (int j = 1; j <= N; j++) {
					dist_t[i][j] = min(dist_t[i][j], dist_t[i][k] + dist_t[k][j]);
				}
			}
		}
		bool flag = true;
		for (int i = 1; i <= N; i++) {
			for (int j = 1; j <= N; j++) {
				if (dist[i][j] != dist_t[i][j])flag = false;
			}
		}
		if (flag && dist_t[a[kai]][b[kai]] != c[kai]) {
			ans++;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, int> pli;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
        int n;
        while(scanf("%d", &n) && n){
                int a[n], sum=0;
                rep(i, n){
                        scanf("%d", &a[i]);
                        sum+=a[i];
                }
                int ans=0;
                rep(i, n)if(a[i]*n<=sum) ++ans;
                printf("%d\n", ans);
        }
}


Measured memory_bytes: 3244
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath> 
#include <cstdlib> // abs(int)

using namespace std;

#define roundup(n,d) ( ((n) + ((d)-1)) / (d) )
#define assign_max(into, compared) (into = max((into), (compared)))
#define assign_min(into, compared) (into = min((into), (compared)))
#define rep(i,n) for(long long i = 0;i < n;i++)
using ll = long long;
using ull = unsigned long long;
using llv = vector<long long>;


int main(void){
    ll x,y;
    cin >> x >> y;
    if (y % 2 == 0 && (x*2 <= y && y <= x*4)){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3072
import sys

S =  sys.stdin.readline()[:-1]
l = len(S)
# S = S[::-1]
S = list(reversed(S))

dp =[[0 ] * 13 for _ in range(l + 1)]
kurai = 1
MOD = (10 ** 9) + 7
dp[0][0] = 1

for keta in range(len(S)):
    c =S[keta]

    if c == "?":
        for j in range(0,10):
            kurai %= 13
            temp = (j * kurai) % 13
            for i in range(13):
                dp[keta + 1][(temp + i) % 13] += (dp[keta][i] )
                dp[keta + 1][(temp + i) % 13] %= MOD
    else:
        kurai %= 13

        temp = (int(c) * kurai) % 13
        for i in range(13):
            dp[keta + 1][(temp + i) % 13]  += (dp[keta][i] )
            dp[keta + 1][(temp + i) % 13] %= MOD
    kurai *= 10
    keta %= MOD
print(dp[-1][5] )



Measured memory_bytes: 66528
#include "bits/stdc++.h"
using namespace std;

int main() {
	int A ,B;
	cin >> A >> B;
	vector<vector<string>> data0(50, vector<string>(100, "."));
	vector<vector<string>> data1(50, vector<string>(100, "#"));	
	for (int i = 0; i < B-1; ++i) {
		data0[2 * (i / 50)][2 * (i % 50)] = "#";
	}	
	for (int i = 0; i < A-1; ++i) {
		data1[1 + 2 * (i / 50)][2 * (i % 50)] = ".";
	}
	cout << 100 << " "<<100 << endl;
	for (int i = 0;i<50;++i) {
		for (int j = 0;j<100;++j) {
			cout << data0[i][j];
		}
		cout << endl;
	}	
	for (int i = 0; i < 50; ++i) {
		for (int j = 0; j < 100; ++j) {
			cout << data1[i][j];
		}
		cout << endl;
	}
}


Measured memory_bytes: 3888
#include <stdio.h>
int main(){
	int n,i,j,a[3],t;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&a[0],&a[1],&a[2]);
		for(j=0;j<2;j++){
			if(a[j]>a[j+1]){
				t=a[j];
				a[j]=a[j+1];
				a[j+1]=t;
			}
		}
		for(j=0;j<3;j++)a[j]*=a[j];
		if(a[0]+a[1]==a[2])
			printf("YES\n");
		else
			printf("NO\n");
	}
	return 0;
}

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

#define rep(i,N) for(int (i)=0;(i)<(N);(i)++)
#define repi(i,j,N) for(int (i)=(j);(i)<(N);(i)++)
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define ll long long
#define numberofdigits(x) floor(log10(x)) + 1


typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;

const char nl = '\n';
ll dp[100001];
#ifdef false
ll knap(vi& weight, vi& val, int i, int w, int n) {
    if(w<=0)
        return 0;

    if(i>=n)
        return 0;

    if(dp[i][w+100000]!=-1)
        return dp[i][w+100000];

    if(weight[i]>w)
        return 0;

    ll ans= max(knap(weight, val, i+1, w-weight[i], n) + val[i], knap(weight, val, i+1, w, n));

    return dp[i][w+100000]=ans;
}
#endif
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
//    memset(dp,-1,sizeof(dp));
    int n,w;cin>>n>>w;
    vi weight(n),value(n);
    for(int i=0;i<n;i++) {
        cin>>weight[i]>>value[i];
    }

    for(int i=0;i<n;i++) {
        for(int j=w-weight[i];j>=0;j--) {
            dp[j+weight[i]] = max(dp[j+weight[i]], dp[j]+value[i]);
        }
    }
    cout<<dp[w]<<nl;

    return 0;
}


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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define repU(i,bottom,ceiling) for(auto (i) = (bottom); (i) <= (ceiling); ++(i))
#define repD(i,ceiling,bottom) for(auto (i) = (ceiling); (i) >= (bottom); --(i))
#define repS(s,n) for(int (s) = 0; s < 1 << (n); ++(s))
#define repV(i,v) for(auto (i) = begin(v); (i) < end(v); ++(i))
#define all(v)  begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define divceil(n,d) ((n)/(d) + ((n)%(d) > 0))
#define parity(a,b) (((a) & 1LL)^((b) & 1LL)^1LL)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF = -1 + (1 << 30);
const int MOD = (int)1e9 + 7;

ull next_subset(ull subset){
	ull tem = subset + (subset & -subset);
	ull btm = (~tem & subset) / (subset & -subset) >> 1;
	return btm | tem;
}


int N,a[300001];
ll sl[100001],sr[100001];

void solve(){
	
	priority_queue<int,vector<int>,greater<int>> lpq;
	priority_queue<int> rpq;
	
	sl[0] = sr[0] = 0;
	rep(i,N){
		sl[0] += a[i];
		sr[0] += a[N*3-1-i];
		lpq.push(a[i]);
		rpq.push(a[N*3-1-i]);
	}
	
	
	rep(i,N){
		int t = lpq.top();
		if(t > a[i+N]) sl[i+1] = sl[i];
		else{
			lpq.pop();
			lpq.push(a[i+N]);
			sl[i+1] = sl[i] + a[i+N] - t;
		}
	}
	
	rep(i,N){
		int t = rpq.top();
		if(t < a[N*2-1-i]) sr[i+1] = sr[i];
		else{
			rpq.pop();
			rpq.push(a[N*2-i-1]);
			sr[i+1] = sr[i] + a[N*2-i-1] - t;
		}
	}
	
	ll score = -(1LL << 62);
	rep(i,N+1) score = max(score, sl[i] - sr[N-i]);
	cout<<score<<endl;

	return;
}

void input(){
	
	cin>>N;
	rep(i,N * 3) cin>>a[i]; 
	
	return;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	input();
	solve();
	
	return 0;
}





Measured memory_bytes: 3956
N=gets.to_i
s=gets.chomp
t=gets.chomp

match_len = 0
len = s.length
(s.length).times do |n|
  tmp = s.slice(n, len-n)
  if 0 == t.index(tmp)
    match_len = tmp.length
    break
  end
end
puts 2*N-match_len


Measured memory_bytes: 1788
n, m = map(int, input().split())
num = [list(map(int, input().split())) for _ in range(m)]
num1 = 1
num2 = n

for j in range(m):
  num1 = max(num[j][0], num1)
  num2 = min(num[j][1], num2)

ans = num2 - num1 + 1

if ans > 0:
  print(ans)
else:
  print(0)

Measured memory_bytes: 27332
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

int main(int argc, char* argv[]) {
#ifdef _MSC_VER
	while (true)
#endif
	{
		const int INF = 1 << 29;
		int h = -1, n = -1;
		cin >> h >> n;
		if (h < 0) return 0;
		vector<int> a(n), b(n);
		for (int i = 0; i < n; ++i) {
			cin >> a[i] >> b[i];
		}
		vector<int> dp(20002, INF);
		dp[0] = 0;
		for (int i = 0; i < n; ++i) {
			for (int j = a[i]; j <= 20000; ++j) {
				dp[j] = min(dp[j], dp[j - a[i]] + b[i]);
			}
		}
		int ans = INF;
		for (int i = h; i <= 20000; ++i) {
			ans = min(ans, dp[i]);
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 384
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int M = sc.nextInt();
		int H[] = new int[N];
		int COUNT[] = new int[N];
		Arrays.fill(COUNT, 0);
		int A = 0;
		int B = 0;
		for(int i=0; i<N; i++) {
			H[i] = sc.nextInt();
		}
		int count = 0;
		//HのA番目B番目を比べ、良い展望台といえる場合は1
		//そうでなければ2を配列COUNT[]に入れる
		for(int i=0; i<M; i++) {
			A = sc.nextInt();
			B = sc.nextInt();
			if(H[A-1]<H[B-1]) {
				COUNT[A-1]=2;
				if(COUNT[B-1]!=2) {
					COUNT[B-1]=1;
				}
			}else if(H[A-1]>H[B-1]) {
				if(COUNT[A-1]!=2) {
					COUNT[A-1]=1;
				}
				COUNT[B-1]=2;
			}else if(H[A-1]==H[B-1]) {
				COUNT[A-1]=2;
				COUNT[B-1]=2;
			}
		}
		//良い展望台であるとき(1と道が存在しない0のとき)
		//カウント+1して表示させる
		for(int i=0; i<N; i++) {
			if(COUNT[i]==1 || COUNT[i]==0) {
				count++;
			}
		}
		
		System.out.print(count);
	}
}

Measured memory_bytes: 60500
#include<stdio.h>
//#include<math.h>
//#include<string.h>
//#include<stdlib.h>
//#include<ctype.h>
//#include<time.h>
//#include<bits/stdc++.h>
//using namespace std;
int main()
{
	int a,c;
	scanf("%d %d",&a,&c);
	printf("%d\n",2*c-a);
	return 0;
}

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

int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  
  int ans;
  if (a != b && b != c && c != a) ans = 3;
  else if (a == b && b == c) ans = 1;
  else ans = 2;
  
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 1;i<=9;i++) {
            for (int j = 1;j<=9;j++) {
                if (i * j == n) {
                    System.out.println("Yes");
                    return;
                }
            }
        }
        System.out.println("No");
    }

}


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

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

    long n1 = a / x;
    long n2 = b / x;

    if (a % x == 0) n1--;

    cout << (n2 - n1) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int fg[105];
int a[4][4];
int ff[4][4];
int main(){
	for(int i=1;i<=3;i++){
		for(int j=1;j<=3;j++){
			cin >> a[i][j];
			fg[a[i][j]]=1;
		}
	}
	int n;
	cin >> n;
	while(n--){
		int t;
		cin >> t;
		if(fg[t]==1){
			for(int i=1;i<=3;i++){
				for(int j=1;j<=3;j++){
					if(t==a[i][j])
					ff[i][j]=1;
				}
			}
		}
	}
	int fgg=0;
	for(int i=1;i<=3;i++){
		int sum=ff[i][1]+ff[i][2]+ff[i][3];
		if(sum==3)
		fgg=1;
	}
	for(int i=1;i<=3;i++){
		int sum=ff[1][i]+ff[2][i]+ff[3][i];
		if(sum==3)
		fgg=1;
	}
	if(ff[1][1]+ff[2][2]+ff[3][3]==3||ff[1][3]+ff[2][2]+ff[3][1]==3)
	fgg=1;
	if(fgg) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
} 

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

int main(){
  string S;
  cin >> S;
  string ans,e;
  for (int tmp = 0; tmp < 8; tmp++) {
    ans = S[0];
    int sum = stoi(ans);
    rep(i,3){
      e = S[i+1];
        if ((tmp>>(2-i))&1){
          sum += stoi(e);
          ans = ans + "+" + e;
        }
        else {
          sum -= stoi(e);
          ans = ans + "-" + e;
        }
    }
    if (sum == 7){
      cout << ans + "=7" << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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;}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	ll ans=0LL;
	cin >>n;
	vector<ll>dis(n+1,0LL);
	for(int i=1;i<=n;i++){
		for(int j=i;j<=n;j+=i){
			dis[j]++;
		}
	}
	for(int i=1;i<=n;i++){
		ans+=dis[i]*i;
	}
	cout<<ans<<endl;

}
/*
2  1 2 =>2   2
3  1 3 ->2        3
4  1 2 4 => 3    2^2
6 1 2 3 6 -> 4            2 3
12 => 1 2 3 4 6  12 => 6  2^2 3
2 3 5 => 8 (30)
2 3 => 4 (6)

1 1   1
2 4 (1)   5
3 6    11
4 12  (2) 23
5 10  33
6 24   57
7 14   71
8 32 (4)  103


16 60 (5)

2 ^1 2 * 2^1 = n*2

2^2  3 * 2^2 -> 3*2n

2^3  4 * 2-3 4* 2^2 n

2^4  5 * 2^4 5*2^3 n

2 3 => 4 * n*3

*/


Measured memory_bytes: 81384
#include <iostream>

using namespace std;

string s;


int main()
{
cin >> s;
if ( s == "SUN")	{
	cout << 7;
}
else if (s == "MON"){
	cout << 6;
}
else if (s == "TUE"){
	cout << 5;
}
else if(s == "WED"){
	cout << 4;
}
else if (s == "THU"){
	cout << 3;
}
else if (s == "FRI"){
	cout << 2;
}
else if (s == "SAT"){
	cout << 1;
}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#define local
#ifdef local
    #include "dbg-macro/dbg.h"
#endif
//#define hacks
#ifdef hacks
    #include <boost/multiprecision/cpp_int.hpp>
#endif
#define p std::pair
#define ll long long
#define ld long double
#define ull unsigned long long
#define pi std::pair<int, int>
#define stdabs std::abs
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (unsigned long long i = 0; i < (unsigned long long)(n); ++i)
#define vec std::vector
#define oreq |=
#define npm next_permutation
using namespace std;
std::vector<unsigned ll> genprimevec(const unsigned ll N);
ll extgcd(ll a, ll b, ll& x, ll& y);
ll nCr(ll n, ll r);
void stat();
template <typename T> T fact(T num);
constexpr ll mod = 1000000000 + 7;
int main()
{
    stat();
    ll n, t;
    cin >> n >> t;
    ull ans = 0,curtime=0;
    vec<ll> v(n);
    rep(i, n) { cin >> v[i]; }
    rep(i,n-1){
	    curtime+=v[i];
	    ans+=min(t,abs(v[i+1]-v[i]));
    }
    cout<<ans+t<<endl;
    return 0;
}
ll extgcd(ll a, ll b, ll& x, ll& y)
{
    if (b == 0) {
        x = 1, y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return d;
}


std::vector<unsigned ll> genprimevec(const unsigned ll N)
{
    std::vector<bool> is_prime(N + 1);
    for (unsigned ll i = 0; i <= N; i++) {
        is_prime[i] = true;
    }
    std::vector<unsigned ll> P;
    for (unsigned ll i = 2; i <= N; i++) {
        if (is_prime[i]) {
            for (unsigned ll j = 2 * i; j <= N; j += i) {
                is_prime[j] = false;
            }
            P.emplace_back(i);
        }
    }
    return P;
}

void stat(){
#ifdef local
    rep(i, 2){std::cout << "local enable" << std::endl;
}
#endif
#ifdef hacks
rep(i, 2) { std::cout << "boost enable" << std::endl; }
#endif
}

ll nCr(ll n, ll r)
{
    ll num = 1;
    for (ll i = 1; i <= r; i++) {
        num = num * (n - i + 1) / i;
    }
    return num;
}

template <typename T> T fact(T num)
{
    if (num == 1) { return 1; }
    return num * fact(num - 1);
}


Measured memory_bytes: 4800
/***"In the name of Allah(swt), the most gracious, most merciful. Allah(swt) blesses with knowledge whom he wants."***/
/*** "ALHAMDULILLAH for Everything..." ***/
#include<bits/stdc++.h>
using namespace std;
#define  fastt       ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define  ll         long long
#define  debug      printf("Come here!")
#define  inf        1000000000000000000
#define  pb         push_back
#define  mp         make_pair
#define  sz(a)      a.size()
#define  mem(a,b)   memset(a,b,sizeof(a))
#define  clr(x)     x.clear()
#define  ff         first
#define  ss         second
#define  case(x)    cout << "Case " << x <<": "

#define  md         1000000007
#define  pi         acos(-1.0)
#define  cos(a)     cos(a*pi/180)
#define  sin(a)     sin(a*pi/180)
#define  tan(a)     tan(a*pi/180)
#define  cosi(a)    acos(a)/(pi/180)
#define  sini(a)    asin(a)/(pi/180)
#define  tani(a)    atan(a)/(pi/180)

#define  vl         vector <ll>
#define  vs         vector <string>
#define  vc         vector <char>
#define  vpll       vector < pair <ll, ll> >
#define  vpsl       vector < pair <string, ll> >
#define  vpls       vector < pair <ll, string> >
#define  pql        priority_queue<ll>
#define  minpql     priority_queue<ll,vector<ll>,greater<ll> >

#define  setbits(x)     __builtin_popcountll(x)
#define  zerobits(x)    __builtin_ctzll(x)

#define toll(a) atoll(a.c_str())
string tostr(ll a) {stringstream rr;rr<<a;return rr.str();}
ll pow(ll c,ll d){return d==0?:c*pow(c,d-1);}
ll gcd(ll a,ll b) {return b==0? a:gcd(b,a%b);}
ll lcm(ll a,ll b) {return ((a*b)/gcd(a,b));}

/* mpp.max_load_factor(0.25); mpp.reserve(1024); */
/* cout << fixed << setprecision(12);*/

int main()
{
    fastt;
    ll n, m, k, i, j, x, y, p=0, s=0, h, f=inf;
    cin>>n;
    for(i=0; i<n; i++){
        cin>>m;
        if(m<0){
            p++;
        }
        x=abs(m);
        if(f>x)f=x;
        s+=x;
    }

    if(p%2==0)cout<<s<<endl;
    else cout<<s-2*f<<endl;
    return 0;
}



Measured memory_bytes: 3636
#include"iostream"
#include"vector"
#include"algorithm"
using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a.at(i);
	}
	sort(a.begin(), a.end());
	cout << a.at(n-1) - a.at(0) << endl;
}

Measured memory_bytes: 256
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <iostream>

class BubbleSort {
 public:
  BubbleSort();
  ~BubbleSort();
  void Main(std::istream &input_stream);

 private:
  void Sort();
  bool ShouldSwap(const int index_target);
  void SwapWithLeftNext(const int index_target);
  void Load(std::istream &input_stream);
  void Print();

 private:
  int count_;
  int values_[100];
  int swapped_count_;
};

BubbleSort::BubbleSort() : count_(0), values_{-1}, swapped_count_{0} {}

BubbleSort::~BubbleSort() {}

void BubbleSort::Main(std::istream &input_stream) {
  Load(input_stream);
  Sort();
  Print();
}

void BubbleSort::Sort() {
  bool should_scan = true;
  int index_unsorted_head = 0;
  while (should_scan) {
    should_scan = false;
    for (int index_target = count_ - 1; index_target >= index_unsorted_head + 1; --index_target) {
      if (ShouldSwap(index_target)) {
        SwapWithLeftNext(index_target);
        should_scan = true;
      }
    }
    ++index_unsorted_head;
  }
}

bool BubbleSort::ShouldSwap(const int index_target) {
  return (values_[index_target - 1] > values_[index_target]);
}

void BubbleSort::SwapWithLeftNext(const int index_target) {
  const int cvalue = values_[index_target];
  values_[index_target] = values_[index_target - 1];
  values_[index_target - 1] = cvalue;
  ++swapped_count_;
}

void BubbleSort::Load(std::istream &input_stream) {
  input_stream >> count_;
  for (int index = 0; index < count_; ++index) {
    input_stream >> values_[index];
  }
}

void BubbleSort::Print() {
  for (int index = 0; index < count_; ++index) {
    if (index != 0) {
      std::cout << " ";
    }
    std::cout << values_[index];
  }
  std::cout << std::endl;
  std::cout << swapped_count_ << std::endl;
}

int main(int argc, char *argv[]) {
  BubbleSort *bubble_sort = new BubbleSort();
  bubble_sort->Main(std::cin);
  delete bubble_sort;
  return 0;
}



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

int main() {
  int n,m;
  cin >> n >> m;
  int min = 0,max = n;
  for(int i = 0;i < m;i++){
    int mini,maxi;
    cin >> mini >> maxi;
    if(mini > min){
      min = mini;
    }
    if(maxi < max){
      max = maxi;
    }
  }
  int ans = max-min;
  if(ans < 0){
    cout << 0 << endl;
  }
  else{
    cout << ans+1 << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>

#define endl '\n'

using namespace std;

const int MAXN=1e5+3;
int dp[3][MAXN];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin>>n;
    for(int i=1;i<=n;++i){
        int a,b,c;
        cin>>a>>b>>c;
        dp[0][i]=max(dp[2][i-1],dp[1][i-1])+a;
        dp[1][i]=max(dp[2][i-1],dp[0][i-1])+b;
        dp[2][i]=max(dp[0][i-1],dp[1][i-1])+c;
    }
    int res=0;
    for(int i=0;i<3;++i){
        res=max(res,dp[i][n]);
    }
    cout<<res<<endl;
return 0;
}

Measured memory_bytes: 1408
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

int vs[15];

int main(void) {
  int n;
  cin >> n;
  REP(i, n) {
    cin >> vs[i];
  }
  sort(vs, vs + n);
  int sum = 0;
  sum += vs[n-1] / 2;
  REP(i, n-1) {
    sum += vs[i];
  }
  cout << sum << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<set>
#include<string>
using namespace std;
int main(){
    int n;
    char command[6]={};
    string str;
    set<string> dict;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%s",command);
        if(command[0]=='i'){
            cin>>str;
            dict.insert(str);
        }
        else{
            cin>>str;
            if(dict.count(str)) printf("yes\n");
            else printf("no\n");
        }
    }
}


Measured memory_bytes: 32636
#include<bits/stdc++.h>
    using namespace std;
    #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    #include <ext/pb_ds/assoc_container.hpp> 
    #include <ext/pb_ds/tree_policy.hpp> 
    using namespace __gnu_pbds; 
    #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
     
    #define ff first
    #define ss second
    #define mp make_pair
     
    #define pb push_back
    #define endl "\n"
     
    #define int long long int
    #define double long double
     
    #define bp __builtin_popcountll
    #define inf 1e17
    const int N=2e5+6;
    const int MOD=1e9+7;
    
    void solve()
    {
    	int a[3];
    	cin>>a[0]>>a[1]>>a[2];
    	sort(a,a+3);
    	if(a[0]==a[1] || a[1]==a[2])
    	{
    		if(a[0]!=a[2])
    		{
    			cout<<"Yes";
    			return;
    		}
    	}
    	cout<<"No";
    }
	signed main()  
    {
        FAST
        int t=1;
        //cin>>t;
        while(t--){
        	solve();
        }
    }

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

ll N, cnt;

int main() {
	cin >> N;
	for (ll i = 2; i*i <= N; i++) {
		if (N % i == 1) continue;
		for (ll j = i; j <= N; j = j*i) {
			if (N % j == 0) {
				N /= j;
				cnt++;
			}
		}
		while (N % i == 0) N /= i;
	}
	if (N > 1) cnt++;
	cout << cnt << "\n";
	return 0;
}

Measured memory_bytes: 3652
IDENTIFICATION DIVISION.
       PROGRAM-ID. ATCODER.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  indata PIC X(100).
       01  a1 PIC 9(08).
       01  a2 PIC 9(08).
       01  a3 PIC 9(08).
       01  r pic 9(08).
       01  g pic 9(08).
       01  r2 pic 9(08).
       01 disp pic Z(20)9.
       PROCEDURE DIVISION.
        ACCEPT indata.
        
        UNSTRING indata DELIMITED BY SPACE INTO a1.
        if a1 = 3 or a1 = 5 or a1 = 7 then 
         DISPLAY "YES"
        else
         DISPLAY "NO"
        end-if

       STOP RUN.


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

int main(){
    int cnt = 0;
    int n, m; cin >> n >> m;
    map<int,int> mp;

    rep(i,n){
        int k; cin >> k;
        rep(j,k){
            int tmp;
            cin >> tmp;
            mp[tmp]++;
        }
    }

    for(auto m : mp){
        if(m.second == n){
            cnt++;
        }
    }

    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<functional>
#include<algorithm>
#include<cstring>
using namespace std;
int main(void)
{
	int n,l,i,a[201],sum,mn,am,ii;
	scanf("%d %d",&n,&l);
	sum=0;
	mn=1000;
	for(i=1;i<=n;i++)	{
		a[i]=l+i-1;
		sum+=a[i];
		if(a[i]<0)	am=-a[i];
		else am=a[i];
		if(mn>am)	{
			mn=am;	ii=i;
		}
	}
	printf("%d\n",sum-a[ii]);
		
    return 0;
}

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

#define F first
#define S second
#define pb push_back
#define ll long long
#define int long long

using namespace std ;

const int MAXN = 1001 * 1001 ; 

int a[MAXN] ; 

vector<int> adj[MAXN] ; 

int dfs(int u , int p ) 
{
	int s = 0 , t = 0 , mx = 0  ; 
	for(auto v : adj[u] ) 
	{
		if(v==p) continue ;   
		int w = dfs(v,u) ;
	    t ++ ; 	
		s += w ; 
		mx = max(mx,w) ; 
	}
	if(!t)
		return a[u] ; 
	int x = s - a[u] ; 
	int y = a[u] - x ;
    	
	if(x<0||y<0||(t==1&&x)||a[u]<mx)
	{
		cout << "NO" ;
	    exit(0) ; 	
	}
	return y ; 
}

int32_t main()
{
	ios::sync_with_stdio(0) ; cin.tie(0) ; 
	int n ; 
	cin >> n ; 
	for(int i = 0 ; i < n ; i ++ ) 
		cin >> a[i] ; 
	for(int i = 1 ; i < n ; i ++ ) 
	{
		int x , y ; 
		cin >> x >> y ; 
		x -- , y -- ; 
		adj[x].pb(y) ; 
		adj[y].pb(x) ; 
	}

	if(n==2)
	{
		if(a[0]==a[1])
			return cout << "YES" , 0 ; 
	   return cout << "NO" , 0 ; 	
	}

	int r ;
	for(int i = 0 ; i < n ; i ++ ) 
		if(adj[i].size()!=1) 
			r = i ; 
	//cout << r << endl ; 
	if(dfs(r,-1))
	   return cout << "NO" , 0 ; 	
	cout << "YES\n" ;  

}

Measured memory_bytes: 34816
#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<algorithm>
#include<cmath>
#include<climits>
#include<iomanip>
#include<bitset>
#include<cstdlib>
#include<queue>
#include<utility> //pair
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

int main() {
	//入力;
	int a, b, c;
	cin >> a >> b >> c;
	if (a + b + c >= 22) cout << "bust" << endl;
	else cout << "win" << endl;


	//小数点以下の桁数表示;
	//cout << fixed << setprecision(15);

	return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe
import Debug.Trace
import Data.List
import qualified Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Set as Set
import qualified Data.IntSet as IntSet
import Data.Functor
import Data.Array
-- import Data.Array.Unboxed
import Control.Monad.ST
import Data.Array.ST
import Data.Char


main :: IO ()
main = do
  (n:k:_) <- fmap (map read . words) getLine :: IO [Int]
  s <- getLine
  putStrLn $ solve n k s

solve n k s = go k s
  where
    go _ [] = []
    go i (s:ss) = (if i == 1
                  then toLower s
                  else s) : (go (i-1) ss)
      

Measured memory_bytes: 508
#include <iostream>
#include <vector>

using namespace std;

int main() {
    size_t n, m, x;
    cin >> n >> m >> x;
    vector<size_t> cost(n + 1, 0);
    for (size_t i = 0; i < m; ++i) {
        size_t a;
        cin >> a;
        cost[a] = 1;
    }
    vector<size_t> cumsum(n + 1, 0);
    for (size_t i = 1; i < n + 1; ++i) {
        cumsum[i] = cost[i] + cumsum[i - 1];
    }
    cout << min(cumsum[n] - cumsum[x], cumsum[x]) << endl;
    return EXIT_SUCCESS;
}

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

int main()
{
    unsigned long long N;
    std::cin >> N;

    unsigned long long A[N];
    for(unsigned long long i=0; i<N; i++)
        std::cin >> A[i];
    
    unsigned long long Bbfr = 0;
    unsigned long long Baft;
    unsigned long long sum = 0;

    for(unsigned long long j=0; j<N-1; j++) // uekizan
    {
        if(A[j]+Bbfr > A[j+1])
        {
            Baft=A[j]+Bbfr-A[j+1];
        }
        else
        {
            Baft = 0;
        }
        

        sum+=Baft;

        Bbfr=Baft;
    }
    std::cout << sum << std::endl;

    
}

Measured memory_bytes: 5132
#include <bits/stdc++.h>
#define pb push_back
typedef long long ll;
using namespace std;
const int N = 35;
const int M = 1e4;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0); 

int main(){
	double r;
	cin >> r;
	printf("%.20f",2*PI*r);
	return 0;
}

Measured memory_bytes: 3772
N, A, B = map(int, input().split())
if bin(A).count("1")%2 == bin(B).count("1")%2:
    print("No")
    exit(0)

print("Yes")

ans = []
def solve(c, A, B, S):
    P = A ^ B
    U = P & S
    b = 1
    if c == 1:
        ans.append(A)
        ans.append(B)
        return
    for i in range(N):
        if U & b:
            assert S & b > 0, (P, S, U, b)
            S0 = S ^ b
            k = 1
            while not S0 & k:
                k <<= 1
            C = A ^ k
            solve(c-1, A, C, S0)
            solve(c-1, C^b, B, S0)
            break
        b <<= 1
solve(N, A, B, 2**N-1)
print(*ans)

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

int main() {

  int K;
  cin >> K;
if (K == 1) {
  cout << 1 << endl;
}
else if (K == 2) {
  cout << 1 << endl;
}
else if (K == 3) {
  cout << 1 <<endl;
}
else if (K == 4) {
  cout << 2 <<endl;
}
else if (K == 5) {
  cout << 1 <<endl;
}
else if (K == 6) {
  cout << 2 <<endl;
}
else if (K == 7) {
  cout << 1 <<endl;
}
else if (K == 8) {
  cout << 5 <<endl;
}
else if (K == 9) {
  cout << 2 <<endl;
}
else if (K == 10) {
  cout << 2 <<endl;
}
else if (K == 11) {
  cout << 1 <<endl;
}
else if (K == 12) {
  cout << 5 <<endl;
}
else if (K == 13) {
  cout << 1 <<endl;
}
else if (K == 14) {
  cout << 2 <<endl;
}
else if (K == 15) {
  cout << 1 <<endl;
}
else if (K == 16) {
  cout << 14 <<endl;
}
else if (K == 17) {
  cout << 1 <<endl;
}
else if (K == 18) {
  cout << 15<<endl;
}
else if (K == 19) {
  cout << 1 <<endl;
}
else if (K == 20) {
  cout << 5 <<endl;
}
else if (K == 21) {
  cout << 2 <<endl;
}
else if (K == 22) {
  cout << 2 <<endl;
}
else if (K == 23) {
  cout << 1 <<endl;
}
else if (K == 24) {
  cout << 15 <<endl;
}
else if (K == 25) {
  cout << 2 <<endl;
}
else if (K == 26) {
  cout << 2 <<endl;
}
else if (K == 27) {
  cout << 5 <<endl;
}
else if (K == 28) {
  cout << 4 <<endl;
}
else if (K == 29) {
  cout << 1 <<endl;
}
else if (K == 30) {
  cout << 4 <<endl;
}
else if (K == 31) {
  cout << 1 <<endl;
}
else if (K == 32) {
  cout << 51 <<endl;
}


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s = "ai1333";
    int n;
    cin >> n;
    rep(i, 0, n / 100) s += "3";
    cout << s << endl; 
}


Measured memory_bytes: 3236
from typing import List


def main():
    n = int(input())
    nums = [input() for _ in range(n)]
    print(wae(n, nums))


def wae(n: int, nums: List[str]) -> int:
    s = set()

    for i in range(n):
        num = nums[i]
        if num in s:
            s.remove(num)
        else:
            s.add(num)

    return len(s)


if __name__ == '__main__':
    main()


Measured memory_bytes: 23096
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1005
 
int n , m;
 
int main()
{
    _FastIO;
    cin >> n >> m;
 
    if(n == m){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <stack>
#include <vector>

using namespace std;
using ll = long long;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define MOD ((ll)1000000007)


int main(int argc, char const *argv[])
{
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);

	int K, X;
	cin >> K >> X;
    int start;

    for (int i = max(-1000000, X - K + 1); i < min(X + K - 1, 1000000); i++)
    {
        cout << i << " ";
    }
    cout << X + K - 1 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
 long long int a,b,k;
 cin >> a >> b >> k;
 if(k<=a)
 cout << a-k << " " << b;
 else if(k<(a+b))
 {
  k-=a;
  cout << "0 " << b-k;
 }
 else
 cout << "0 0";   
 return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int n;ll h;cin>>n>>h;
	ll a[114514],b=0;for(int i=0;i<n;i++){ll k;cin>>k>>a[i];b=max(b,k);}
	sort(a,a+n);
	ll ans=0;
	for(int i=n-1;i>=0&&a[i]>=b;i--){h-=a[i];ans++;if(h<=0)goto heaven;}
	if(h%b!=0)h+=b-(h%b);
	ans+=h/b;
	heaven:cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>


using namespace std;


int main()
{
	string t_card, h_card;	// t = taro, h = hanako
	int t_score, h_score;
	int n;

	cin >> n;

	// 判定
	t_score = h_score = 0;
	for(int i = 0; i < n; i++){
		cin >> t_card >> h_card;

		if(t_card < h_card)
			h_score += 3;
		else if(h_card < t_card)
			t_score += 3;
		else{
			t_score++;
			h_score++;
		}
	}

	cout << t_score << " " << h_score << endl;

	return 0;
}


Measured memory_bytes: 3156
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		string[] str = Console.ReadLine().Split();
		int B = 0;
		int ans = 0;
		for(var i=0;i<N;i++){
			int A = int.Parse(str[i]);
			if(A>=B){
				ans++;
				B = A;
			}
		}
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 11092
#include <cstdio>
int n;
int main() {
	while(scanf("%d", &n), n) {
		int ret = 0;
		for(int l = 1; l <= n; l++) {
			for(int r = l + 1; r <= n; r++) {
				int sum = 0;
				for(int k = l; k <= r; k++) sum += k;
				if(sum == n) ret++;
			}
		}
		printf("%d\n", ret);
	}
}

Measured memory_bytes: 2608
n, m = gets.chomp.split.map(&:to_i)
ab = []
m.times do |i|
  ab[i] = gets.chomp.split.map(&:to_i)
end

cnt = 0
a = (1..n).to_a.permutation.to_a
a.each do |way|
  next if way[0] != 1
  judge = true
  (n-1).times do |i|
    unless ab.include?([way[i], way[i+1]].sort)
      judge = false
      break
    end
  end
  cnt += 1 if judge
end

puts cnt

Measured memory_bytes: 8700
fun main(args: Array<String>) {
    val (K, S) = readIntList()
    var ans = 0
    for (x in 0..K) {
        for (y in 0..K) {
            val z = S - x - y
            if (z in 0..K) ans++
        }
    }
    println(ans)
}

fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

Measured memory_bytes: 37992