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

using namespace std;

long interest(long g){
    return g = g * 1.01;
}

int main(void) {
    long x;
    long tmp = 100;
    int ans = 0;
    cin >> x;
    while(tmp < x){
        tmp = interest(tmp);
        ans += 1;
    }
    //cout << "tmp = " << tmp << endl;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3600
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main() {
  int X, Y;
  cin >> X >> Y;

  if (Y - 2 * X >= 0 && (Y - 2 * X) % 2 == 0) {
    int t = (Y - 2 * X) / 2;
    if (X - t >= 0) {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}

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

int main(){
  int A, B, M;
  cin >> A >> B >> M;
  vector<int> a(A), b(B);
  int sum = 1000000000;
  for(int i=1; i<A+1; i++){
    cin >> a[i];
    sum = min(a[i], sum);
  }
  int sum2 = 1000000000;
  for(int i=1; i<B+1; i++){
    cin >> b[i];
    sum2 = min(b[i], sum2);
  }
  sum +=sum2;
  vector<int> x(M), y(M), c(M);
  for(int i=0; i<M; i++){
    cin >> x[i] >> y[i] >> c[i];
  }

  for(int i=0; i<M; i++){
    int s = a[x[i]] + b[y[i]] - c[i];
    if(s<sum) sum = s;
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <bitset>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define MP make_pair
#define PB push_back

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef long long LL;

int main() {
	int a, b;
	cin >> a >> b;
	printf("%d %d %.12f\n", a / b, a%b, (double)a / b);
}


Measured memory_bytes: 3232
#include <bits/stdc++.h>
#define ll long long int
#define maxy __LONG_LONG_MAX__
#define mod 1000000007
using namespace std;
int main() {
    ll n;
	cin>>n;
	int a[n+5]={},b[n+5]={},c[n+5]={};
	for(int i=1;i<=n;i++)
	{
		int x,y,z;
		cin>>x>>y>>z;
		a[i]=x+max(b[i-1],c[i-1]);
		b[i]=y+max(a[i-1],c[i-1]);
		c[i]=z+max(a[i-1],b[i-1]);
	}
	cout<< max(a[n],max(b[n],c[n]));
    return 0;
}


Measured memory_bytes: 1408
/**
 * C - Half and Half
 * https://atcoder.jp/contests/abc095/tasks/arc096_a
 * 
 * pa + pb < pc *2
この時、min(x,y) は、A,B で買う

pa + pb > pc *2
の時、min(x,y) は、Cで買う

その後、abs(x-y)を買う
x<y & py<2pc
Bを abs(x-y)pb
x<y & py>2pc
Cを　2abs(x-y)pc
x>y & pa<2pc
Aを　abs(x-y)pa
x>y & pa>2pc
Pを 2abs(x-y)pc
 **/
#include<iostream>

using namespace std;

int main() {
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;
    int ans = 0;
    if(A+B>=2*C) {
        ans += min(X, Y)*2*C;
    } else {
        ans += min(X, Y)*(A+B);
    }

    if(X>Y&A<2*C) {
        ans += abs(X-Y)*A;
    } else if(X>Y&A>2*C) {
        ans += abs(X-Y)*2*C;
    } else if(X<Y&B<2*C) {
        ans += abs(X-Y)*B;
    } else if(X<Y&B>2*C) {
        ans += abs(X-Y)*2*C;
    }

    cout << ans << endl;
}

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

const ll INF = 1e+18 + 10;

ll dp[100000];

int binary_search(int ng, int ok, ll target)
{
    while (ng + 1 < ok)
    {
        int mid = (ng + ok) / 2;
        if (dp[mid] >= target)
        {
            ok = mid;
        }
        else
        {
            ng = mid;
        }
    }
    return ok;
}

int main()
{
    int n;
    cin >> n;

    // DPテーブルの初期化
    for (int i = 0; i < n; i++)
    {
        dp[i] = INF;
    }

    // DP開始
    for (int i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        if (i == 0)
        {
            dp[0] = a;
            continue;
        }

        if (a > dp[i - 1])
        {
            dp[i] = a;
        }
        else
        {
            dp[binary_search(-1, i, a)] = a;
        }
    }

    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        if (dp[i] != INF)
        {
            ans = i + 1;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3864
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<string>
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main(){
    int n, m;
    cin >> n >> m;
    vector<vector<char>> a(n, vector<char>(n));
    vector<vector<char>> b(m, vector<char>(m));
    rep(i, n) {
        string tmp_s;
        cin >> tmp_s;
        rep(j, n) {
            a[i][j] = tmp_s[j];
        }
    }
    rep(i, m) {
        string tmp_s;
        cin >> tmp_s;
        rep(j, m) {
            b[i][j] = tmp_s[j];
        }
    }
    rep(i, n - m + 1 ) {
        rep(j, n - m + 1 ) {
            bool ok = 1;
            rep(k, m) {
                rep(l, m) {
                    if ( a[i+k][j+l] != b[k][l] ) {
                        ok = 0;
                        break;
                    }
                }
                if ( !ok ) {
                    break;
                }
            }
            if ( ok ) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long>
#define vii vector<int>
#define vll vector<long long>
using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    int ar[n+2];
    int br[n+2];
    int cr[n+2];
    for(int i=1;i<=n;i++){
        scanf("%d",&ar[i]);
    }
    for(int i=1;i<=n;i++){
        scanf("%d",&br[i]);
    }
    for(int i=1;i<=n-1;i++){
        scanf("%d",&cr[i]);
    }
    int sum=0;
    int p;
    for(int i=1;i<=n;i++){
        if(i==1){
            p = ar[i];
            sum = sum+br[p];
        }
        else{
            p = ar[i];
            sum = sum+br[p];
            if(p==ar[i-1]+1){
                sum = sum + cr[p-1];
            }
        }
    }
    printf("%d",sum);
    return 0;
}





Measured memory_bytes: 256
#include<stdio.h>

#define MOD 1000000007

int main(){
    long long int n;
    scanf("%lld",&n);

    long long int sum=1;
    for(int i=1;i<=n;i++){
        sum*=i;
        sum%=MOD;
    }
    printf("%lld\n",sum);
    return 0;
}

Measured memory_bytes: 1732
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
	int n; scanf("%d",&n);
	
	double ans=0;
	
	for (int i=0; i<n; i++)
	{
		int x; scanf("%d",&x);
		
		ans+=1./x;
	}
	
	ans=1./ans;
	
	printf("%.7f",ans);
	
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
using std::sort;
using std::min;
const int MAXN=400010;
const int INF=2e9;
struct Edge {
	int u,v,w;
	friend bool operator<(Edge a,Edge b) {
		return a.w<b.w;
	}
}ed[MAXN];
int cnt=0;
inline void join(int x,int y,int z) {
	ed[++cnt].u=x;
	ed[cnt].v=y;
	ed[cnt].w=z;
	return;
}
int f[MAXN];
inline void init(int n) {
	for(int i=0;i<=n;++i) {
		f[i]=i;
	}
}
int find(int x) {
	return x==f[x]?x:(f[x]=find(f[x]));
}
int best[MAXN];
int main() {
	int n,q;
	scanf("%d%d",&n,&q);
	for(int i=0;i<=n;++i) {
		best[i]=INF;
	}
	int x,y,z;
	for(int i=1;i<=q;++i) {
		scanf("%d%d%d",&x,&y,&z);
		join(x,y,z);
		best[x]=min(best[x],z+1);
		best[y]=min(best[y],z+2);
	}	
	for(int i=0;i<n*2;++i) {
		best[(i+1)%n]=min(best[(i+1)%n],best[i%n]+2); //n*2防止更新了n-1到0 
	}
	for(int i=0;i<n;++i) {
		if(best[i]!=INF) join(i,(i+1)%n,best[i]);
	}
	init(n);
	sort(ed+1,ed+1+cnt);
	long long ans=0;
	for(int i=1;i<=cnt;++i) {
		int a=find(ed[i].u),b=find(ed[i].v);
		if(a!=b) {
			ans+=ed[i].w;
			f[a]=b;
		}
	}
	printf("%lld",ans);
	return 0;
}

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

using namespace std ; 
const int N = 1e5 + 7 ; 

int n , m;
string s[111];

int mv1[2] = {1 , 0 } , mv2[2] = {0 , 1};

bool bad(int i, int j){
    return (i < 0 || j < 0 || i>=n || j>=m);
}
string a[111] ; 
int dp[111][111][2] ; 

int solve(int i , int j , int rev){
    if(bad(i , j))return 1e7;
    if(dp[i][j][rev]!=-1)return dp[i][j][rev] ; 
    int ret = 1e7 ; 
    int val = abs ( (a[i][j]=='#') - rev ) ;
    if(i==n-1 && j==m-1)return val ; 
    for(int k= 0 ; k < 2 ; k++){
        int ni = i + mv1[k] ;
        int nj = j + mv2[k] ;
        ret =  min(ret , solve(ni , nj , rev) + val) ; 
        ret =  min(ret , solve(ni , nj , 0) + val) ; 
        ret =  min(ret , solve(ni , nj , 1) + 1 + val) ; 
    }
    return  dp[i][j][rev] = ret ; 
}

int main(){
    memset(dp , -1 , sizeof dp) ; 
    ios_base::sync_with_stdio(0) ; 
    cin.tie(0) ; 
    cin>>n>>m ; 
    for(int i =  0 ; i <n ; i++){
        cin>>a[i] ; 
    }
    cout<<min(solve(0 , 0 , 0 ) , solve(0 , 0 , 1) + 1 )  ; 

    return 0 ; 
}

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

#define A_MAX 2000001
#define C_MAX 10001

int A[A_MAX], B[A_MAX], C[C_MAX];

int main(void){
  int i;
  int n;

  scanf("%d", &n);

  for(i=0; i<n; i++){
    scanf("%d", &A[i]);
    C[A[i]]++;
  }

  for(i=1; i<C_MAX; i++) C[i]+=C[i-1];
  for(i=n-1; i>=0; i--){
    C[A[i]]--;
    B[C[A[i]]]=A[i];
  }

  for(i=0; i<n; i++){
    if(!i)printf("%d", B[i]);
    else printf(" %d", B[i]);
  }

  printf("\n");
  
  return 0;
}



Measured memory_bytes: 18808
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int ans = 1;
		int count =0;
		for(int i = 1; i <= n; i++) {
			int divi = i;
			int roop = 0;
			while(divi % 2 == 0) {
				divi = divi/2;
				roop++;
			}
			if(count < roop) {
				count = roop;
				ans = i;
			}
		}
		System.out.println(ans);
	}
}

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

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()

using ld = long double;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<long, long>;
using pdd = pair<ld, ld>;

template<typename T> struct V : vector<T> { using vector<T>::vector; };
V() -> V<ll>;
V(size_t) -> V<ll>;
template<typename T> V(size_t, T) -> V<T>;
template<typename T> vector<T> make_vec(size_t n, T a) { return vector<T>(n, a); }
template<typename... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec(ts...))>(n, make_vec(ts...)); }
template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){os << "(" << v.first << ", " << v.second << ")"; return os;}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<class T> ostream& operator<<(ostream& os, const vector<vector<T>> &v){ for(auto &e : v){os << e << "\n";} return os;}
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
void fail() { cout << -1 << '\n'; exit(0); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

const ll INF = (1ll<<62);
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
const ll mod = (int)1e9 + 7;
//const ll mod = 998244353;

int main(){

    ll N, K;
    cin >> N >> K;
    V<ll> v(N);
    REP(i, N) cin >> v[i];


    ll ans = -(1ll<<60);
    REP(i, N+1){
        REP(j, N+1){
            if(i+j<=N and i+j<=K){
                ll noko = K - i - j;
                priority_queue<ll, vector<ll>, greater<ll>> pq;
                REP(k, i) pq.push(v[k]);
                REP(k, j) pq.push(v[N-1-k]);

                while(!pq.empty()){
                    ll tmp = pq.top();
                    if(tmp>=0) break;
                    if(noko==0) break;
                    pq.pop();
                    noko--;
                }

                ll res = 0;
                while(!pq.empty()){
                    ll tmp = pq.top();
                    pq.pop();
                    res += tmp;
                }
                chmax(ans, res);
            }
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3632
fun main(args: Array<String>) {
    solve(java.util.Scanner(System.`in`))
}

fun gcd(a: Long, b: Long): Long = if (b == 0L) a else gcd(b, a % b)

object Primes : Iterable<Long> {
    private var checked = 2L
    private val xs = mutableListOf(2L)

    fun get(i: Int): Long {
        while (xs.count() <= i) {
            var n = checked + 1
            loop@ while (true) {
                for (j in xs) {
                    if (j * j > n) {
                        break@loop
                    }
                    if (n % j == 0L) {
                        n++
                        break
                    }
                }
            }
            xs.add(n)
            checked = n
        }
        return xs[i]
    }

    override fun iterator(): Iterator<Long> = object : Iterator<Long> {
        var i = 0
        override fun hasNext(): Boolean = true
        override fun next(): Long {
            val x = get(i)
            i += 1;
            return x
        }
    }
}

fun solve(sc: java.util.Scanner) {
    val A = sc.nextLong()
    val B = sc.nextLong()

    var ans = 1
    val it = Primes.iterator()
    var a = gcd(A, B)
    do {
        val p = it.next()

        if ((a % p) == 0L) {
            ans += 1
            do a /= p while ((a % p) == 0L)
        }
    } while (p * p <= a)
    if (a != 1L) ans++

    println(ans)
}


Measured memory_bytes: 46484
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int L;
  cin >> L;

  double a,b,c,max;
  double a2,b2,c2;
  max = 0;

  for (int i = 0; i < 10000000; i++) {
    a = rand();
    b = rand();
    c = rand();

    a2 = a * L / (a+b+c);
    b2 = b * L / (a+b+c);
    c2 = c * L / (a+b+c);
    
    double V;
    V = a2 * b2 * c2;

    if(max < V){
        max = V;
    }
  }
    printf("%f"  , max); 

}

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

using namespace std;

typedef double D;
typedef long long int LL;

#define st first
#define nd second
#define PLL pair <LL, LL>
#define PII pair <int, int>

const int N = 1e6 + 7;
const int MX = 1e9 + 7;
const LL INF = 1LL * MX * MX;

int n, mn;
char in[N];
vector <int> G[N];

int deg[N];
int ans[N];

int main(){
	scanf("%s", in + 1);
	n = strlen(in + 1) + 1;
	
	for(int i = 1; i < n; ++i)
		if(in[i] == '<'){
			G[i].push_back(i + 1);
			deg[i + 1]++;
		}
		else{
			G[i + 1].push_back(i);
			deg[i]++;
		}
	
	queue <int> Q;
	for(int i = 1; i <= n; ++i)
		if(deg[i] == 0)
			Q.push(i);
	
	long long sum = 0;
	while(!Q.empty()){
		int u = Q.front();
		Q.pop();
		
		sum += ans[u];
		for(auto v: G[u]){
			deg[v]--;
			ans[v] = max(ans[v], ans[u] + 1);

			if(deg[v] == 0)
				Q.push(v);
		}
	}

	printf("%lld\n", sum);
	return 0;
}

Measured memory_bytes: 47488
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

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

    vector<long long> H;
    long long temp;
    for(int i = 0; i < N; i++){
        cin >> temp;
        H.push_back(temp);
    }

    sort(H.begin(), H.end());
    
    long long turn = 0;
    for(int i = 0; i < N-K; i++){
        turn += H[i];
    }

    cout << turn << endl;
}

Measured memory_bytes: 2420
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
# N=5
# A=3
# B=2
# C=4
# D=3
# E=5
# L = [0]*5
# L[0] = N
# count = 0
# while sum(L) != 0:
#     if L[4] != 0:
#         tmp0 = min(L[4],E)
#         L[4] -= tmp0
#     if L[3] != 0:
#         tmp0 = min(L[3],D)
#         L[3] -= tmp0
#         L[4] += tmp0
#     if L[2] != 0:
#         tmp0 = min(L[2],C)
#         L[2] -= tmp0
#         L[3] += tmp0
#     if L[1] != 0:
#         tmp0 = min(L[1],B)
#         L[1] -= tmp0
#         L[2] += tmp0
#     if L[0] != 0:
#         tmp0 = min(L[0],A)
#         L[0] -= tmp0
#         L[1] += tmp0
#     count += 1
print((N-1) // min(A,B,C,D,E) + 5)

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Main {

	public static void main(String[] args) throws IOException {
		
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		HashMap<String, Integer> map = new HashMap<String, Integer>();
		String[] words = br.readLine().split(" ");

		map.put(words[0], 1);
		String longest = words[0];
		String freq = words[1];
		for(int i = 1; i < words.length ; i++){
			if(map.containsKey(words[i])){
				map.put(words[i], map.get(words[i]) + 1);
			}
			else {
				map.put(words[i], 1);
			}

			if(map.get(words[i]) > map.get(freq)){
				freq = words[i];
			}

			if(words[i].length() > longest.length()){
				longest = words[i];
			}
		}

		System.out.println(freq+" "+longest);
	}

}

Measured memory_bytes: 24184
n = int(input())
dl = list(map(int,input().split()))
m = int(input())
tl = list(map(int,input().split()))
d_dic = dict()
t_dic = dict()
for d in dl:
  if d in d_dic:
    d_dic[d] += 1
  else:
    d_dic[d] = 1
for t in tl:
  if t in t_dic:
    t_dic[t] += 1
  else:
    t_dic[t] = 1
for v in t_dic.keys():
  if not v in d_dic.keys():
    print('NO')
    exit()
  if t_dic[v] > d_dic[v]:
    print('NO')
    exit()
print('YES')

Measured memory_bytes: 56788
n,m = (int(x) for x in input().split())
k = []
a = []
for i in range(n):
    tmp = []
    for x in input().split():
        tmp.append(int(x))
    k.append(tmp[0])
    a.append(tmp[1:])

#hoge
x = [0 for i in range(m)]
for i in range(n):
    for j in range(k[i]):
        x[a[i][j]-1] += 1
ans = 0
for i in range(m):
    if x[i] == n:
        ans += 1
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

vector<ll> a;
int main() {
	ll n;
	cin>>n;
	for(int i=0;i<n;i++){
		ll x;
		cin>>x;
		a.push_back(x);
	}
	sort(a.begin(),a.end());
	double sum=a[0];
	for(int i=1;i<a.size();i++){
		sum+=a[i];
		sum/=2;
	}
	printf("%.7f",sum);
	return 0;
}

Measured memory_bytes: 256
N,M = map(int,input().split())
list = [[] for i in range(N)]

for i in range(M):
    p,y = map(int,input().split())
    list[p-1].append((y,i))

ans = [None]*M

for j,list_p in enumerate(list):
    list_p.sort()
    for k,(p,y) in enumerate(list_p):
        ans[y] = '%06d%06d' % (j+1,k+1)

print(*ans,sep='\n')


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

#define int long long

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

int lcm(int a, int b)
{
    int temp = gcd(a, b);

    return temp ? (a / temp * b) : 0;
}

signed main() {
    int n;
    cin >> n;
    int ans = 1;
    for(int i=0; i<n; ++i) {
        int t;
        cin >> t;
        ans = lcm(ans, t);
    }
    cout << ans << endl;
    return 0;
}



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

int a,b; 

signed main()
{
	cin>>a>>b;
	
	if (a==1&&b==1)  cout<<1<<endl;
	else if (a==1&&b!=1)  cout<<b-2<<endl;
	else if (b==1&&a!=1)  cout<<a-2<<endl;
	else cout<<(a-2ll)*(b-2ll)<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cstdint>
#include <cassert>
#include <random>
using namespace std;

int		main(void)
{
	string	S;
	cin >> S;
	for (int i = 0; i < S.size(); i++)
		cout << "x";
	cout << endl;
}

Measured memory_bytes: 256
n,k=map(int,input().split())
arr=list(map(int,input().split()))
for i in range(k):
    b=[0]*(n)
    c=0
    for j in range(n):
        if j-arr[j]>=0:
            b[j-arr[j]]+=1
        else:
            b[0]+=1
        if j+arr[j]+1<n:
            b[j+arr[j]+1]-=1
    for i in range(1,n):
        b[i]=b[i]+b[i-1]
    for i in range(n):
        if b[i]==n:
            c+=1
    if c==n:
        break
    arr=b.copy()
print(*b)




Measured memory_bytes: 169860
N, K = map(int, input().split())
mod = 10 ** 9 + 7
for i in range(1, K+1):
    if i > N - K + 1:
        print(0)
    else:
        ans = 1
        tmp = 1
        for j in range(K - i):
            ans = ans * (K - 1 - j )% mod
            tmp = tmp * (K - i - j) % mod
        for k in range(N - K - i + 1):
            ans = ans * (N - K + 1 - k) % mod
            tmp = tmp * (N - K - i + 1 - k) % mod
        ans = ans % mod * pow(tmp, mod - 2, mod) % mod
        print(ans)

Measured memory_bytes: 3316
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstring>
#include<string>
using namespace std;
int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}; 
int main(){
	int n;
	cin>>n;
	cout<<a[n-1];
}


Measured memory_bytes: 256
#include<cstdio>

int BinarySearch(int S[],int key,int n){
  int left = 0;
  int right = n;
  int mid=0;
  while (left < right){
    mid = (left + right)/2; //????????¨???????????? C++???????§?
    if(S[mid] < key) left = mid + 1;
    else if(S[mid] > key) right = mid;
    else return mid;
  }
  return 0;
}

int main(){
  int n,q;
  int key;
  int S[100000];
  scanf("%d",&n);
  for(int i=0;i<n;i++) scanf("%d",&S[i]);
  scanf("%d",&q);
  int ans = 0;
  for(int i=0;i<q;i++){
    scanf("%d",&key);
    if(BinarySearch(S,key,n)) ans++;
  }
  printf("%d\n",ans);
  return 0;
}

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

int main()
{
int a;
int b;

	ios::sync_with_stdio( false );
	cin.tie( 0 );

	cin >> a;
	cin >> b;

	if( a + b == 15 )
		cout << "+" << endl;
	else if( a * b == 15 )
		cout << "*" << endl;
	else
		cout << "x" << endl;

	return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<iostream>
#include<string>
using namespace std;
string str1;
int l,r,m;
int a,c,b;
int n;
int defdef(string str){
	if (str=="Male") return 0;
	if (str=="Female") return 1;
	if (str=="Vacant") return -1;

}


int main(){
	cin>>n;
	l=0;
	cout<<l<<endl;
	cout.flush();
	cin>>str1;
	r=l+n;
	a=defdef(str1);
	c=a;
	if (c==-1)return 0;
	while (true){
		m=(l+r)/2;
		cout<<m<<endl;
		cout.flush();
		cin>>str1;
		b=defdef(str1);
		if (b==-1)return 0;
		if ((a+b+l+m)%2==1){r=m;c=b;} else {l=m;a=b;}
	}
}
//

Measured memory_bytes: 852
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout << "Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
 
typedef long long ll;
typedef pair<int,int> P;
//typedef long long T;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;

int main(){
    int n;
    std::cin >> n;
    std::vector<ll> a(n),b(n);
    rep(i,n)std::cin >> a[i]>>b[i];
    
    std::vector<tuple<ll,ll,ll>> d(n);
    rep(i,n){
        d[i]=make_tuple(a[i]+b[i],a[i],b[i]);
    }
    sort(all(d),greater<tuple<ll,ll,ll>>());
    ll ta=0,ao=0;
    rep(i,n){
        ll q,qq,qqq;
        tie(q,qq,qqq)=d[i];
        if(i%2==0)ta+=qq;
        else ao+=qqq;
    }
    std::cout << ta-ao<< std::endl;
}


Measured memory_bytes: 4096
h,w = map(int,input().split())
a = []
for i in range(h):
    s=list(input())
    if s.count('#')!=0:
        a.append(s)



for i in range(len(a[0])):
    k = 0
    for j in range(len(a)):
        if a[j][i] == '.':
            k += 1
    if k == len(a):
        for j in range(len(a)):
            a[j][i] = 'a'
    k = 0
#print(a)

for i in range(len(a)):
    ans = ''
    for j in range(len(a[0])):
        if a[i][j] != 'a':
            ans += a[i][j]
    print(ans)
    


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define N 100000

int main(){
  ll n;
  int max_input = -1;
  cin >> n;
  vector<ll> v(N, 0);
  for(ll i=0;i<n;i++){
    int a;
    cin >> a;
    if (a > max_input){
      max_input = a;
    }
    if (a > 0){
      v[a-1]++;
    }
    v[a]++;
    v[a+1]++;
  }
  ll ma = 0;
  for(ll i=0;i<=max_input;i++){
    if(v[i] > ma){
      ma = v[i];
    }
  }
  cout << ma << endl;
  return 0;
}


Measured memory_bytes: 1024
M=1e9+7;f[999];n;k;main(a){for(scanf("%d",f);n=*f;f[n]++,--*f)for(k=2;k*k<=n;)n%k?k++:(n/=k,f[k]++);for(;n<996;)a=1L*a*-~f[2+n++]%M;printf("%d",a);}

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

#define ll long long
#define endl '\n'
#define REP(i, a, n) for(int i=a; i<n; ++i)
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()

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

const double PI = 3.141592653589793238460;
const ll mod = 1e9 + 7;

void FAST(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

int digits(ll n){
  return log10(n) + 1;
}

int main(){
  FAST();
  int n, i;
  cin >> n;
  string s, t, ans;
  cin >> s >> t;
  REP(i, 0, n){
      ans += s[i];
      ans += t[i];
  }

  cout << ans << endl;


  return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
x=sorted(list(map(int,input().split())))
if m<=n:
  print(0)
else:
  d=[]
  for i in range(m-1):
    d.append(x[i+1]-x[i])
  d=sorted(d)
  print(sum(d[:m-n]))

Measured memory_bytes: 58408
#include <bits/stdc++.h>
#define re return
#define ull unsigned long long
#define ll long long
#define ld long double
#define mid l+(r-l)/2
#define f first
#define s second
#define oo 1e9
#define pi acos(-1)
#define OO 1e18
#define EPS 1e-7
#define FX(n) fixed<<setprecision(n)
#define mm(o,k) memset(o,k,sizeof o)
#define Hossam_Yehia ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
int n,m,x,y;
vector<vector<int> >v;
int main(){
    Hossam_Yehia;
    cin >> n >> m;
    v.resize(n+2);
    while(m--){
        cin >> x >> y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    for(auto j:v[1])
        for(int k:v[j])
            if(k==n)re cout<<"POSSIBLE\n",0;
    cout<<"IMPOSSIBLE\n";
    re 0;
}

Measured memory_bytes: 12016
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();

int32_t main(){

    int x,n;cin>>x>>n;
    vector<int> v(1000,1);
    for(int i=0,y;i<n;i++){
        cin>>y;
        v[y]=0;
    }

    int mn=abs(-1-x);
    int ans=-1;

    for(int i=0;i<1000;i++){
        if(v[i]==1){
            if(mn>abs(i-x)){
                mn=min(mn,abs(i-x));
                ans=i;
            }
        }
    }

    cout<<ans<<"\n";

    return 0;
}

Measured memory_bytes: 3624
#include <iostream>

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

if(x < 600) std :: cout << 8 << '\n';
else if(x < 800) std :: cout << 7 << '\n';
else if(x < 1000) std :: cout << 6 << '\n';
else if(x < 1200) std :: cout << 5 << '\n';
else if(x < 1400) std :: cout << "4\n";
else if(x < 1600) std :: cout << "3\n";
else if(x < 1800) std :: cout << "2\n";
else if(x < 2000) std :: cout << "1\n";
}

Measured memory_bytes: 3192
#include<bits/stdc++.h>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ri(x) scanf("%d",&(x))
#define ri2(x,y) scanf("%d %d",&(x),&(y))
#define ri3(x,y,z) scanf("%d %d %d",&(x),&(y),&(z))
#define rll(x) scanf("%lld",&(x))
#define rll2(x,y) scanf("%lld %lld",&(x),&(y))
#define rll3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z))
#define gc(x) ((x) = getchar())
using namespace::std;

const long double PI = acos(-1);
const long long MOD = 1000000000 +7;

typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> tll;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<tll> vtll;
typedef vector<string> vs;
typedef set<int> si;
typedef set<ii> sii;
typedef set<iii> siii;

ll gcd(ll a, ll b){ return b==0?a:gcd(b,a%b);}

ll add(ll a, ll b, ll m = MOD){
	if(a >= m) a %= m;
	if(b >= m) b %= m;
	if(a < 0) a += m;
	if(b < 0) b += m;
	ll res = a+b;
	if(res >= m or res <= -m) res %= m;
	if(res < 0) res += m;
	return res;
}

ll mul(ll a, ll b, ll m = MOD){
	if(a >= m) a %= m;
	if(b >= m) b %= m;
	if(a < 0) a += m;
	if(b < 0) b += m;
	ll res = a*b;
	if(res >= m or res <= -m) res %= m;
	if(res < 0) res += m;
	return res;
}

ll pow_mod(ll a, ll b, ll m = MOD){
	ll res = 1LL;
	a = a%m;
	while(b){
		if(b&1) res = mul(res,a,m);
		b >>= 1;
		a = mul(a,a,m);
	}
	return res;
}

ll fastexp(ll a, ll b){
	ll res = 1LL;
	while(b){
		if(b&1) res = res*a;
		b >>= 1;
		a *= a;
	}
	return res;
}

int gcdExtendido(int a, int b, int *x, int *y){
	if(a == 0){
		*x = 0;
		*y = 1;
		return b;
	}
	int x1, y1;
	int gcd = gcdExtendido(b%a,a,&x1,&y1);
	
	*x = y1-(b/a)*x1;
	*y = x1;
	return gcd;
}

int modInverso(int a, int m){
	int x, y;
	int g = gcdExtendido(a,m,&x,&y);
	if(g!=1) return -1;
	else return (x%m + m)%m;
}

/****************************************
*************P*L*A*N*T*I*L*L*A************
*****************************************/

int n;
string a, b;

int main(){
	ri(n);
	cin >> a >> b;
	for(int i=0; i<n; i++){
		putchar(a[i]);
		putchar(b[i]);
	}
	puts("");
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

#define MAX 2000000

int H, A[MAX+1];

void maxHeapify(int i){
  int l, r, largest, v;
  l =  2 * i;
  r =  2 * i + 1;

  if( l <= H && A[l] > A[i] )largest = l;
  else largest = i;
  if( r <= H && A[r] > A[largest] )largest = r;

  if( largest != i ){
    v = A[i];
    A[i] = A[largest];
    A[largest] = v;
    maxHeapify(largest);
  }
}

int main(){
  
  int i;
  scanf("%d",&H);
  for ( i = 1; i <= H; i++ )scanf("%d",&A[i]);
  for ( i = H / 2; i >= 1; i-- )maxHeapify(i);
  for ( i = 1; i <= H; i++ )printf(" %d",A[i]);
  printf("\n");
  
  return 0;
}



Measured memory_bytes: 3724
#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[]) {
    double x1,x2,y1,y2,x;
    scanf("%lf %lf %lf %lf",&x1,&x2,&y1,&y2);
     x=(x1-y1)*(x1-y1)+(x2-y2)*(x2-y2);
    printf("%f\n",sqrt(x));
    return 0;
}

Measured memory_bytes: 652
// Code for C - Forbidden List
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define FOR(i,x,y) for(ll i=x;i<(ll)(y);i++)

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

  vector<int> p(N);
  REP(i, N) {
    cin >> p[i];
  }

  int min = 100000;
  int minN;
  for (int i = 101; i >= -1; i--) {
    bool any = false;
    REP(j, N) {
      if (i == p[j]) {
        any = true;
        break;
      }
    }
    if (any) {
      continue;
    }

    if (min >= abs(X - i)) {
      min = abs(X - i);
      minN = i;
    }
  }

  cout << minN << endl;
  return 0;
}


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

using namespace std;

int main()
{
	double d;
	scanf("%lf", &d);

	double ans = d * sqrt(2);

	for (int x = -10; x <= 10; x++){
		if (d * d - x * x >= 0){
			double y = sqrt(max(0.0, d * d - x * x));
			ans = max(ans, fabs(x) + (y <= 1.0 ? 1.0 : y));
		}
	}

	printf("%.10lf\n", ans);

	return (0);
}

Measured memory_bytes: 1236
#include<stdio.h>
#include<algorithm>
int main() {
	
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int N, M;
	scanf("%d", &N);

	if (N == 7 || N == 5 || N == 3) {
		printf("YES");
	}
	else {
		printf("NO");
	}
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<vector>
#include<queue>
#include<deque>
#include<string>
#include<utility>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<set>
#include<map>
#include<bitset>
#include<stack>
#include<ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<pli> vpli;

inline ll read(){
    ll Hashimoto=0;
	bool Kanna=1;
    char I_Love=getchar();
    while(I_Love<'0'||I_Love>'9'){
        if(I_Love=='-')Kanna=0;
        I_Love=getchar();
    }
    while(I_Love>='0'&&I_Love<='9'){
        Hashimoto=Hashimoto*10+I_Love-'0';
        I_Love=getchar();
    }
    return (Kanna?Hashimoto:-Hashimoto);
}
template<typename T1,typename T2> inline void Umax(T1 &a,T2 b){
	if(a<b)a=b;
}
template<typename T1,typename T2> inline void Umin(T1 &a,T2 b){
	if(a>b)a=b;
}

#define I_Love_Hashimoto_Kanna main
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define filein(s) freopen(s,"r",stdin);
#define fileout(s) freopen(s,"w",stdout);
#define file freopen("I_Love_Hashimoto_Kanna.out","w",stdout);
#define RE cout<<"I_Love_Hashimoto_Kanna"<<endl;
#define Tone(Kanna) cout<<Kanna<<endl;
#define Tall(Hashimoto,Kanna) for(int I_Love=0;I_Love<(Kanna);++I_Love)cout<<Hashimoto[I_Love]<<(I_Love==(Kanna)-1?"\n":" ");
#define FOR(I_Love,Hashimoto,Kanna) for(int I_Love=Hashimoto;I_Love<(Kanna);++I_Love)
#define MP(Hashimoto,Kanna) make_pair(Hashimoto,Kanna)
#define REV(Kanna) reverse(Kanna.begin(),Kanna.end());
#define SORT(Kanna) sort(Kanna.begin(),Kanna.end());
#define UNIQUE(Kanna) Kanna.erase(unique(Kanna.begin(),Kanna.end()),Kanna.end());
#define inf (1000000000)
#define linf (1000000000000000000ll)
#define mod (1000000007)

int n;
vi g[222222];
int val[222222];
void dfs(int x,int p){
	FOR(i,0,g[x].size()){
		int to=g[x][i];
		if(to==p)continue;
		val[to]+=val[x];
		dfs(to,x);
	}
}
int I_Love_Hashimoto_Kanna() {
	//完全想清楚了再开始写。
	//写不顺、不知道怎么写、很乱的时候，停下来好好想想。
	//做得慢总比做不出好。
	fastio;
	n=read();
	int q=read();
	FOR(i,1,n){
		int a=read()-1,b=read()-1;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	while(q--){
		int p=read()-1,x=read();
		val[p]+=x;
	}
	dfs(0,-1);
	FOR(i,0,n){
		printf("%d",val[i]);
		printf((i==n-1?"\n":" "));
	}
	
	return 0;
}


Measured memory_bytes: 29184
#include <iostream>
#include <deque>
using namespace std;
int map[100][100];

int main() {

    int H, W, left, right, idx;
    char c;
    cin >> H >> W;
    deque<int> d[H];
    for (int i = 0; i < H; i++) {
        fill(map[i], map[i]+W, -1);
        for (int j = 0; j < W; j++) {
            cin >> c;
            if (c == 'c') d[i].push_back(j);
        }
    }

    for (int i = 0; i < H; i++) {
        right = W;
        for (int j = d[i].size()-1; j >= 0; j--) {
            left = d[i][j], idx=0;
            for (int k = left; k < right; k++) map[i][k] = idx++;
            right = left;
        }
    }

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (j) cout << " ";
            cout << map[i][j];
        }
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 3200
/**************************************************************
>>> Author: dahetao
>>> Create Time: 2019/12/20 2:10:31
**
 *                    .::::.
 *                  .::::::::.
 *                 :::::::::::  I && YOU
 *             ..:::::::::::'
 *           '::::::::::::'
 *             .::::::::::
 *        '::::::::::::::..
 *             ..::::::::::::.
 *           ``::::::::::::::::
 *            ::::``:::::::::'        .:::.
 *           ::::'   ':::::'       .::::::::.
 *         .::::'      ::::     .:::::::'::::.
 *        .:::'       :::::  .:::::::::' ':::::.
 *       .::'        :::::.:::::::::'      ':::::.
 *      .::'         ::::::::::::::'         ``::::.
 *  ...:::           ::::::::::::'              ``::.
 * ````':.          ':::::::::'                  ::::..
 *                    '.:::::'                    ':'````..
 *
**************************************************************/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef unsigned long long ull;
int main()
{
	//freopen("30.in","r",stdin);//设置 cin scanf 这些输入流都从 test.in中读取
    //freopen("30.out","w",stdout);//设置 cout printf 这些输出流都输出到 test.out里面去
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int a,b,c,sum;
	cin>>a>>b>>c;
	sum=a+b+c;
	if(sum>=22) cout<<"bust"<<endl;
	else cout<<"win"<<endl; 
	return 0;
}


Measured memory_bytes: 256
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let xs1 = xs[0].trim().split(' ');
   let xs2 = xs[1].trim().split(' ').map(v=>parseInt(v,10));
   let xs3 = xs[2].trim().split(' ');
   let ans = 0;
   
   if(xs1[0]==xs3[0]){
     ans = xs2[0] - 1;
     console.log(ans+' '+xs2[1]);
   }else if(xs1[1]==xs3[0]){
     ans = xs2[1] - 1;
     console.log(xs2[0]+' '+ans);
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7372
n = gets.chomp.to_i
nums = []
n.times do |i|
  nums << [i, gets.chomp.to_i]
end
nums = nums.sort_by{ | k, v | v }.reverse
ans = []
n.times do |i|
  if i == nums[0][0] then
    ans << nums[1][1]
  else
    ans << nums[0][1]
  end
end
puts ans

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

int main(){
  int N;
  cin >> N;
  vector<string> S(N);
  for(int i=0;i<N;i++){
   cin >> S.at(i); 
  }
  sort(S.begin(), S.end());
  int count=0;
  for(int i=0;i<N-1;i++){
   if(S.at(i)==S.at(i+1)){
    count++; 
   }
  }
  cout<<N-count;
}

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

bool is_prime(int x){
  if(x<=1) return false;
  for(int i=2;i*i<x;i++)
    if(x%i==0) return false;
  return true;  
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x; cin>>x;
  int p=x;
  while(!is_prime(p)) p++;
  cout<<p<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0;i < n;i++)
const long long INF = 1LL << 60;

int MOD = 1000000007;

int main(){
    std::ios_base::sync_with_stdio(false);

    int H,W,h,w; cin >> H>>W>>h>>w;

    cout << H*W-h*W-w*H+h*w << endl;

    return 0;
}


Measured memory_bytes: 256
N = int(input())
S = {"M":0,"A":0,"R":0,"C":0,"H":0}
for i in range(N):
    s = input()
    if s[0] in ["M","A","R","C","H"]:
        S[s[0]] += 1

print(S["M"] * S["A"] * (S["R"] + S["C"] + S["H"])
      + S["M"] * S["R"] * (S["C"] + S["H"])
      + S["M"] * S["C"] * S["H"]
      + S["A"] * S["R"] * (S["C"] + S["H"])
      + S["A"] * S["C"] * S["H"]
      + S["R"] * S["C"] * S["H"])


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

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

  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;

    sort(s.begin(), s.end(), greater<char>());

    S[i] = s;
  }

  map<string, long long> counts;

  for (int i = 0; i < N; i++) {
    counts[S[i]]++;
  }

  long long total = 0;
  for (auto count : counts) {
    total += (count.second * (count.second - 1)) / 2;
  }

  cout << total << endl;
}

Measured memory_bytes: 12032
#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
//onst int INF = 2e9+100;
const int INF = 1e9+7;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

LL modinv(LL a) {
    LL b = MOD, u = 1, v = 0;
    while (b) {
        LL t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= MOD;
    if (u < 0) u += MOD;
    return u;
}

LL moddev(LL a, LL b){
	return a * modinv(b) % MOD;
}

const int MAX=100009;

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}

void Main()
{
    int n,k; cin >> n >> k;
    VI a(n);
    REP(i, n) cin >> a[i];
    SORT_ASC(a);
    COMinit();

    vector<LL> c(n);
    REP(i,n){
        c[i] = COM(i,k-1)%MOD;
    }

    LL min_t=0;
    LL max_t=0;

    
    FOR(i,0,n-k+1){
        min_t += (a[i] * c[n-1-i])%MOD;
        min_t %= MOD;
    }
    

    FOR(i,k-1,n){
        max_t += (a[i] * c[i])%MOD;
        max_t %= MOD;
    }

    cout << mod((max_t%MOD) - (min_t%MOD), MOD) << endl;



    

	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  int X[N];
  int sum = 0;
  for(int i=0;i<N;i++){
    cin >> X[i];
    sum += X[i];
  }
  
  double ave =  (double)sum / (double)N;
  int ave_down = ceil(ave);
  int ave_up = floor(ave);
  
  int sum_of_cost_down = 0;
  int sum_of_cost_up = 0;
  for(int x : X){
    sum_of_cost_down += pow(x - ave_down, 2.0);
    sum_of_cost_up += pow(x - ave_up, 2.0);
  }
  
  //cout << ave_down << "," << sum_of_cost_down << endl;
  //cout << ave_up << "," << sum_of_cost_up << endl;
  
  cout << min(sum_of_cost_down,sum_of_cost_up) << endl;

}

Measured memory_bytes: 256
package main

import "fmt"

func gcd(a, b int) int {
	if a%b == 0 { // b != 0の時、a%b == 0ならば、aとbの最大公約数はbである
		return b
	}
	// この時点でaはbで割り切れない
	// ヒントより：整数a,bについて、a>=bならばxとyの最大公約数はbとa%bの最大公約数に等しい
	// 以下のコードでは例えb>aであっても、次の呼び出しでaとbが入れ替わるのでaとbの大小関係をチェックしなくてよい
	return gcd(b, a%b)
}

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(gcd(a, b))
}



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

long long matrix[100][100];

int main()
{
  int N;
  long long out = 0;
  cin >> N;

  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < N; j++)
    {
      cin >> matrix[i][j];
    }
  }

  for (int i = 0; i < N; i++)
  {
    for (int j = i; j < N; j++)
    {
      if(i == j)continue;

      if(matrix[i][j] <= matrix[j][i])
      {
        out += matrix[i][j];
      }
      else
      {
        out += matrix[j][i];
      }
     }
  }

  cout << out << endl;

  return 0;
}


Measured memory_bytes: 3192
import java.util.*

fun main(args: Array<String>) {
    val (x, y, z, w) = readLine()!!.split(" ").map { it.toLong() }

    val vx = z - x
    val vy = w - y
    val ux = -vy
    val uy = vx
    val l = ArrayList<Long>()
    l.add(z + ux)
    l.add(w + uy)
    l.add(x + ux)
    l.add(y + uy)

    println(l.joinToString(" "))
}


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

#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll long long
#define bit __builtin_popcountll
#define sqr(x) (x) * (x)
#define forit(it,S) for(__typeof((S).begin()) it = (S).begin(); it != (S).end(); it++)
#define debug(x) cout << #x <<" = " << x << endl
#define forn(i, n) for(int i = 0 ; (i) < (n) ; ++i)
#define printvpair(v) for(int i = 0 ; (i) < (v.size()) ; ++i) cout << v[i].first  <<" " << v[i].second << endl;
#define printv(v) for(int i = 0 ; (i) < (v.size()) ; ++i) cout << v[i] << " "; cout << endl;

using namespace std;

typedef pair<int, int> pii;

const double eps = 1e-9;
const double pi = acos(-1.0);
const int INF = 1000000000;

const int dx[4] = {0,  0, 1, -1};
const int dy[4] = {1, -1, 0,  0};
const int N = 1e5 + 7;
int a[N];
int n;
int main() {
	ios_base::sync_with_stdio(0);
	int n,m,k;
	cin >> n >> m >> k;
	
	for(int i = 0; i <=  n; i++)
		for(int j = 0; j <= m; j++)
			if(i * m + j * n - 2 * i * j == k){
				cout << "Yes\n";
				return 0;
			}
	cout << "No\n";
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if(n % 2 == 0){
      System.out.println(n * n / 4);
    }else{
      System.out.println((n + 1) * (n - 1) / 4);
    }
    
  }
}

Measured memory_bytes: 23764