akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    vi v(4);
    rep(i,4)cin >> v[i];
    sort(all(v));
    if(v[0] == v[1] && v[2] == v[3]){
        cout << "yes" << endl;
    }else{
        cout << "no" << endl;
    }

}



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

template <typename ArrayT>
void DumpArray(const ArrayT &arr)
{
#if defined(HOME)
	for (auto it = arr.begin(); it != arr.end(); ++it) {
		cerr << *it << " ";
	}
	cerr << endl;
#endif
};
template <typename T>
bool ChMin(T &target, T value)
{
	if (value < target) {
		target = value;
		return true;
	} else {
		return false;
	}
}
template <typename T>
bool ChMax(T &target, T value)
{
	if (target < value) {
		target = value;
		return true;
	} else {
		return false;
	}
}

class Solver
{
  public:
	Solver() {}
	void Solve(istream &cin, ostream &cout)
	{
		int N, K, R, S, P;
		string T;
		cin >> N >> K >> R >> S >> P >> T;

		char res[N];

		auto calc = [&](char c) {
			switch (c) {
			case 'r':
				return R;
			case 's':
			    return S;
			case 'p':
			default:
				return P;
			}
		};

		ll ans = 0;
		REP (i, N) {
			if (i < K) {
				res[i] = Win(T[i]);
				ans += calc(res[i]);
			} else {
				auto w = Win(T[i]);
				if (res[i - K] == w){
					res[i] = '0';
				}else{
					res[i] = w;
					ans += calc(res[i]);
				}
			}
		}

		cout << ans << endl;
	}

	char Win(char c)
	{
		if (c == 'r') {
			return 'p';
		} else if (c == 's') {
			return 'r';
		} else {
			return 's';
		}
	}
};

#if !defined(BOOST_TEST_MODULE)
#if !defined(GTEST_INCLUDE_GTEST_GTEST_H_)
int main()
{
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);

	Solver solver;
	solver.Solve(std::cin, std::cout);

	return 0;
}
#endif
#endif


Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline ll read() {
    ll x=0,f=1; char ch=getchar();
    for(;ch<'0'||ch>'9';ch=getchar())
        if(ch=='-')f=-f;
    for(;ch>='0'&&ch<='9';ch=getchar())
        x=x*10+ch-'0';
    return x*f;
}
inline void chkmin( int &a,int b ) { if(a>b) a=b; }
inline void chkmax( int &a,int b ) { if(a<b) a=b; }
#define _ read()
int a[1005]={0};
int main() {
	a['A']=a['T']=a['G']=a['C']=1;
	string s; cin>>s; int n=s.size(),res=0,ans=0;
	for( int i=0;i<n;i++ ) {
		if(!a[s[i]]) ans=max(ans,res),res=0;
		res+=a[s[i]];
	}ans=max(ans,res);
	cout<<ans<<"\n";
}

Measured memory_bytes: 256
package main

import (
        "fmt"
)

func solution(n int, s, t string) int {
        if s == t {
                return n
        }
        hi := 0
        for i := 1; i < n; i++ {
                suf := s[n-i:]
                pre := t[:i]
                if suf == pre {
                        hi = max(hi, len(suf))
                }
        }
        return 2*n - hi
}

func max(x, y int) int {
        if x > y {
                return x
        }
        return y
}
func main() {
        var n int
        var s, t string
        fmt.Scan(&n, &s, &t)
        fmt.Println(solution(n, s, t))
}

Measured memory_bytes: 1772
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int S;
  cin >> S;
  int a = S / 100;
  int b = (S - a * 100)/ 10;
  int c = S - a * 100 - b * 10;
  cout << a + b + c << endl;
}

Measured memory_bytes: 256
// 下の桁から埋めるdp
// 参考URL "https://maspypy.com/atcoder-%e5%8f%82%e5%8a%a0%e6%84%9f%e6%83%b3-2019-02-09abc-154"
#include <bits/stdc++.h>
using namespace std;
using state= pair<string, int>;

int64_t dp(state idx, map<state, int64_t> &memo){ 
  if(memo.count(idx)) return memo.at(idx);

  string N= idx.first;
  int k= idx.second;
  if(N.size() < k) return 0;
  if(k==0) return 1;
  if(N.size()==1 && k==1) return N.at(0)-'0';
  else{
    string Ndiv10= N.substr(0, N.size()-1);
    string Ndiv10minus1= Ndiv10;
    int i= Ndiv10minus1.size()-1;
    while(Ndiv10minus1.at(i)=='0'){ /* Nが2桁以上なので非零の桁が存在することは確定 */
      Ndiv10minus1.at(i)= '9';
      i--;
    }
    Ndiv10minus1.at(i)-= 1;
    if(Ndiv10minus1.at(0)=='0') Ndiv10minus1= Ndiv10minus1.substr(1); /* N=10^nのときのケア */

    int64_t ans= 0;
    ans+= dp(make_pair(Ndiv10, k), memo); // '0'
    ans+= (N.at(N.size()-1)- '0')* dp(make_pair(Ndiv10      , k-1), memo); // '1'~'末尾の数字'
    ans+= ('9'- N.at(N.size()-1))* dp(make_pair(Ndiv10minus1, k-1), memo); // '末尾の数字+1'~'9'
    return memo[idx]= ans;
  }
}

int main() {
  string N; int K;
  cin >> N >> K;
  
  map<state, int64_t> memo;

  cout << dp(make_pair(N,K), memo) << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define y0 y_0
#define y1 y_1
#define yn y_n
#include <assert.h>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;

int n,a[200005];
long long pref[200005],res;
map<long long,int> cnt;

int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
		pref[i]=a[i];
		if(i>0)pref[i]+=pref[i-1];
	}
	cnt[pref[n-1]]++;
	for(int i=n-1;i>=0;i--){
		long long curr=(i==0?0:pref[i-1]);
		res+=cnt[curr];
		cnt[curr]++;
	}
	printf("%lld\n",res);
	return 0;
}


Measured memory_bytes: 15104
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=505;
int p1[N][N],p2[N][N],n,m;
char st[N];
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
    {
        scanf("%s",st+1);
        for(int j=1;j<=m;j++)p1[i][j]=p2[i][j]=st[j]=='#';
    }
    for(int i=1;i<=n;i+=2)
        for(int j=2;j<m;j++)p1[i][j]=1;
    for(int i=2;i<=n;i+=2)
        for(int j=2;j<m;j++)p2[i][j]=1;
    for(int i=1;i<=n;i++)p1[i][1]=1,p2[i][m]=1;
    for(int i=1;i<=n;i++,puts(""))
        for(int j=1;j<=m;j++)
            if(p1[i][j])putchar('#');
            else putchar('.');
    puts("");
    for(int i=1;i<=n;i++,puts(""))
        for(int j=1;j<=m;j++)
            if(p2[i][j])putchar('#');
            else putchar('.');
}

Measured memory_bytes: 5748
#include <bits/stdc++.h>
using namespace std;
int nCrModpDP(int n, int r, int p) 
{ 
    int C[r+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1; 
  
    for (int i = 1; i <= n; i++) 
    { 
        for (int j = min(i, r); j > 0; j--) 
            C[j] = (C[j] + C[j-1])%p; 
    } 
    return C[r]; 
}
int nCrModpLucas(int n, int r, int p) 
{ 
   if (r==0) 
      return 1; 
  
   int ni = n%p, ri = r%p; 
  
   return (nCrModpLucas(n/p, r/p, p) * nCrModpDP(ni, ri, p)) % p;  
}
int main()
{
    int n;cin>>n;
    string s;cin>>s;
    int two=0;
    for(int i=0;i<n;i++){
        if(s[i]=='2'){
            s[i]-=2;
            two++;
        }
    }
    if(two>0){
        for(int i=0;i<n;i++){
            if(s[i]=='2') s[i]-=2;
            if(s[i]=='3') s[i]-=2;
        }
        long long one=0;
        for(int i=0;i<n;i++){
            if(s[i]=='1'){
                one+=nCrModpLucas(n-1,i,2);
            }
        }
        if(one%2==0){
            cout<<0;
        }else{
            cout<<1;
        }
    }else{
        int one=0;
        for(int i=0;i<n;i++){
            if(s[i]=='1') s[i]-=1;
            if(s[i]=='3') s[i]-=2;
        }
        for(int i=0;i<n;i++){
            if(s[i]=='1') one+=nCrModpLucas(n-1,i,2);
        }
    if(one%2==0) cout<<0;
    else cout<<2;
    }
    
    return 0;
}


Measured memory_bytes: 1412
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

struct point{
  double x,y;
  public:
  point(const point &p):x(p.x),y(p.y){}
  point():x(0),y(0){}
  point(double x,double y):x(x),y(y){}

  double get_x()const{ return x; }
  double get_y()const{ return y; }

  point& operator=(const point &p){
    x = p.x;
    y = p.y;
    return *this;
  }

  point operator+(const point &p)const{
    return point(x+p.x,y+p.y);
  }


  point operator-(const point &p)const{
    return point(x-p.x,y-p.y);
  }

  point operator*(const double k)const{
    return point(k*x,k*y);
  }

  double norm()const{
    return sqrt(x*x+y*y);
  }

  double dist(const point &p)const{
    return (*this-p).norm();
  }

  void show()const{ cout << setprecision(6) << x << " " << y << endl; }
};

void print_kochcurve(const point &p1,const point &p2,int n);

int main(){
  int n;
  cin >> n;
  point p1(0,0),p2(100,0);
  p1.show();
  print_kochcurve(p1,p2,n);

  return 0;
}

void print_kochcurve(const point &p1,const point &p2,int n){
  if(n==0){
    p2.show();
    return;
  }

  point s,t,u;

  s = (p1*2.0 + p2)*(1./3);
  t = (p1 + p2*2.0)*(1./3);

  u = (p1 + p2)*(1./2);
  double len = p1.dist(s)*sqrt(3)/2;
  point v = p2-p1;
  point tmp(-v.get_y(),v.get_x());
  tmp = tmp*(1./tmp.norm());

  u = u + tmp*len;

  print_kochcurve(p1,s,n-1);
  print_kochcurve(s,u,n-1);
  print_kochcurve(u,t,n-1);
  print_kochcurve(t,p2,n-1);

}

Measured memory_bytes: 3200
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	int n;
	double w, h;
	char a, b;
	while(cin >> n >> a >> w >> b >> h) {
		if(w/pow(h,2.0) >= 25) cout << n << endl;
	}
	return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define upperlimit 1000100
#define INF 1000000100
#define INFL 1000000000000000100LL
#define eps 1e-8
#define endl '\n'
#define sd(n) scanf("%d",&n)
#define slld(n) scanf("%lld",&n)
#define pd(n) printf("%d",n)
#define plld(n) printf("%lld",n)
#define pds(n) printf("%d ",n)
#define pllds(n) printf("%lld ",n)
#define pdn(n) printf("%d\n",n)
#define plldn(n) printf("%lld\n",n)
#define REP(i,a,b) for(i=a;i<=b;i++)
#define mp make_pair
#define pb push_back
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define F first
#define S second
#define clr(a) memset(a,0,sizeof(a))
#define FILEIO(name) \
    freopen(name".in", "r", stdin); \
    freopen(name".out", "w", stdout);

using namespace std;

ll gcd(ll n1,ll n2){
    if(!n1)return n2;
    if(!n2)return n1;
    if(n1%n2==0)return n2;
    return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent){
    base%=mod;
    ll ans=1;
    while(exponent){
        if(exponent&1)ans=(ans*base)%mod;
        base=(base*base)%mod;
        exponent/=2;
    }
    ans%=mod;
    return ans;
}
int arr[upperlimit+1];
int f(int n){
	int ret=0;
	while(n%2==0){
		ret++;
		n/=2;
	}
	return ret;
}
int main()
{
	int n,i,j,k;
	sd(n);
	int answer=0;
	for(i=1;i<=n;i++){
		sd(arr[i]);
		answer+=f(arr[i]);
	}
	pdn(answer);
	return 0;
}

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

using namespace std;
using ll = long long;

void init();
void solve();

#define rep(i, a) for (int i = 0; i < (int) (a); i++)
#define reps(i, a, b) for (int i = (int) (a); i < (int) (b); i++)
#define rrep(i, a) for (int i = (int) a-1; i >= 0; i--)
#define rreps(i, a, b) for (int i = (int) (a)-1; i >= (int) (b); i--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define TRUE__  "YES"
#define FALSE__ "NO"
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x

#ifdef LOCAL
#define lcout(a) cout << a
#define lcoutln(a) cout << a << endl
#define lcerr(a) cerr << a
#define lcerrln(a) cerr << a << endl
#else
#define lcout(a) 
#define lcoutln(a) 
#define lcerr(a) 
#define lcerrln(a) 
#endif
#define MOD 1000000007
#define PI 3.141592653589793238462643383

signed main()
{
	init();
	solve();
}

int culc(int x)
{
	int res = 0;
	while (x) {
		res += x % 10;
		x /= 10;
	}
	return res;
}

int a, b, c;
ll K;

void init()
{
	cin >> a >> b >> c >> K;
}

void solve()
{
	int x = K & 1 ? -1 : 1;
	cout << (a - b) * x << endl;
}


Measured memory_bytes: 256
import scala.io.StdIn.readLine

object Main extends App {
  def read(e:Double,n:Double,angle:Double):(Double,Double) = {
    val Array(x,y) = readLine.split(",").map(_.toDouble)
    if(x==0 && y==0) (e,n)
    else read(e+x*Math.cos(Math.toRadians(angle)),n+x*Math.sin(Math.toRadians(angle)),angle-y)
  }
  val (e,n) = read(0,0,90)
  println(e.toInt)
  println(n.toInt)
}

Measured memory_bytes: 43572
#include<iostream>
using namespace std;
int main(){
long n,i,x,y,h,w,s,p;
while(cin>>n){
if(n==0)break;
p=0;
for(i=0;i<n;i++){
cin>>x>>y>>h>>w;
s=x+y+h;
if(s<=60&&w<=2)p+=600;
else if(s<=80&&w<=5)p+=800;
else if(s<=100&&w<=10)p+=1000;
else if(s<=120&&w<=15)p+=1200;
else if(s<=140&&w<=20)p+=1400;
else if(s<=160&&w<=25)p+=1600;
}
cout<<p<<endl;
}
return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<sstream>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;


int main()
{
    int n;
    scanf("%d", &n);
    int a;
    bool f = false;
    for(int i=0; i<n; i++) {
        scanf("%d", &a);
        if(a & 1) f = true;
    }
    if(f) puts("first");
    else puts("second");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<n;(i)++)
#define ll long long
using namespace std;
int main(void){
    int n,m;
    cin>>n>>m;
    cout<<(n*(n-1))/2+(m*(m-1))/2<<endl;
    
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		boolean b = true;
		long l = 100;
		int count = 0;
		while (b) {
			count++;
			l = (long) (l * 1.01);
			if (l >= x) {
				System.out.println(count);
				b = false;
			}

		}

		sc.close();
	}
}

Measured memory_bytes: 27080
using System;
using System.Collections.Generic;
using System.Linq;

class Solution
{
    static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int n = vals[0];
        int m = vals[1];
        int k = vals[2];

        for (int i = 0; i <= n; i++)
        {
            for (int j = 0; j <= m; j++)
            {
                var blackLine = i;
                var whiteLine = n - i;
                var black = blackLine * (m - j) + whiteLine * j;

                var v = k - black;
                //if (v >= 0 && v % 2 == 0)
                    if(k == black)
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
        }

        Console.WriteLine("No");
    }
}

Measured memory_bytes: 13396
import java.util.Scanner;

public class Main {
	static StringBuilder builder = new StringBuilder();
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[] A = new int[n];
		for (int i = 0; i < n; i++)
			A[i] = scanner.nextInt();
		
		trace(A, n);

		for (int i = 1; i < n; i++) {
			int v = A[i];
			int j = i - 1;
			while (j >= 0 && A[j] > v) {
				A[j + 1] = A[j];
				j--;
			}
			A[j + 1] = v;
			trace(A, n);
		}
		System.out.print(builder);
	}

	private static void trace(int[] A, int n) {
		for (int i = 0; i < n; i++) {
			if (i > 0)
				builder.append(" ");
			builder.append(A[i]);
		}
		builder.append("\n");
	}
}



Measured memory_bytes: 27512
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>	tree_set;
typedef long long ll;
typedef long double ld;
void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

ll mod=1e9 + 7;
bool compare(pair<ll,ll> a,pair<ll,ll> b)
{
    if(a.second!=b.second)
        return a.second<b.second;
    return a.first<b.first;
}

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

    vector< pair<ll,ll> > arr(n);
    for(ll i=0;i<n;i++)
        cin>>arr[i].first>>arr[i].second;
    sort(arr.begin(),arr.end(),compare);

    ll cur_time=0;
    for(ll i=0;i<n;i++)
    {
        if(cur_time+arr[i].first > arr[i].second)
        {
            cout<<"No";
            return 0;
        }
        cur_time = cur_time + arr[i].first;
    }
    cout<<"Yes";
}


Measured memory_bytes: 3328
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Diagnostics;
using Enu = System.Linq.Enumerable;

public class Program
{
    static readonly long Big = (long)1e10;

    public void Solve()
    {
        var A = Reader.IntArray(3).OrderBy(a => a).ToArray();
        var seen = new HashSet<long>();
        while (A.All(a => a % 2 == 0))
        {
            if (!seen.Add(A[0] * Big + A[1])) { Console.WriteLine(-1); return; }
            A = new[] { (A[0] + A[1]) / 2, (A[0] + A[2]) / 2, (A[1] + A[2]) / 2 };
        }
        Console.WriteLine(seen.Count);
    }
}


class Entry { static void Main() { new Program().Solve(); } }
class Reader
{
    static TextReader reader = Console.In;
    static readonly char[] separator = { ' ' };
    static readonly StringSplitOptions op = StringSplitOptions.RemoveEmptyEntries;
    static string[] A = new string[0];
    static int i;
    static void Init() { Dispose(); A = new string[0]; }
    public static void Set(TextReader r) { Init(); reader = r; }
    public static void Set(string file) { Init(); reader = new StreamReader(file); }
    public static bool HasNext() { return CheckNext(); }
    public static string String() { return Next(); }
    public static int Int() { return int.Parse(Next()); }
    public static long Long() { return long.Parse(Next()); }
    public static double Double() { return double.Parse(Next()); }
    public static int[] IntLine() { return Array.ConvertAll(Split(Line()), int.Parse); }
    public static int[] IntArray(int N) { return Range(N, Int); }
    public static int[][] IntTable(int H) { return Range(H, IntLine); }
    public static string[] StringArray(int N) { return Range(N, Next); }
    public static string[][] StringTable(int N) { return Range(N, () => Split(Line())); }
    public static string Line() { return reader.ReadLine().Trim(); }
    public static T[] Range<T>(int N, Func<T> f) { var r = new T[N]; for (int i = 0; i < N; r[i++] = f()) ; return r; }
    public static void Dispose() { reader.Dispose(); }
    static string[] Split(string s) { return s.Split(separator, op); }
    static string Next() { CheckNext(); return A[i++]; }
    static bool CheckNext()
    {
        if (i < A.Length) return true;
        string line = reader.ReadLine();
        if (line == null) return false;
        if (line == "") return CheckNext();
        A = Split(line);
        i = 0;
        return true;
    }
}

Measured memory_bytes: 13524
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include <algorithm> // sort
#include <map> // pair
using namespace std;
using ll = long long;
const ll mod = 1e9+7;

int main(){
  ll n,k,x,y;
  cin >> n >> k;
  if((n-1)*(n-2)/2 < k){
    cout << -1;
    return 0;
  }
  x = (n-1)*(n-2)/2-k;
  cout << n-1+x << endl;
  for(ll i=0;i<n-1;i++){
    cout << "1" << " " << i+2 << endl;
  }
  for(ll i=2;i<=n;i++){
    for(ll j=i+1;j<=n;j++){
      if(x==0){
        i=n;
        break;
      }
      cout << i << " " << j << endl;
      x--;
    }
  }
}


Measured memory_bytes: 256
/*

Coded by peyha X

*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int NMAX = 2 * 1e5 + 2;
int n, a;
set<int> valeurs;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> n;
	
	bool ans = true;
	
	for(int i = 0; i < n; i++)
	{
		cin >> a;
		
		
		set<int>::iterator it = valeurs.find(a);
		
		if(it == valeurs.end())
		{
			valeurs.insert(a);
		}
		else
		{
			ans = false;
		}
	}
	
	if(ans)
	{
		cout << "YES\n";
	}
	else
	{
		cout << "NO\n";
	}
	
}


Measured memory_bytes: 9600
package main

import (
	"fmt"
)

func main() {
	var n, a, b, na int
	fmt.Scanf("%d %d %d", &n, &a, &b)

	na = n * a

	if na <= b {
		fmt.Println(na)
	} else {
		fmt.Println(b)
	}
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;
//typedef tree<
//        pair<long long, int>, // change type
//        null_type,
//        less<pair<long long, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;


vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}

#ifdef LOCAL
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) ;
#endif


typedef long long ll;
typedef long double ld;
#define rep(i, start, end) for(int i = start; i < end; ++i)
#define sz(x) (int)((x).size())
#define pb push_back
#define all(x) x.begin(), x.end()
#define clr(d, v) memset(d, v, sizeof(d))
#define pii pair<int, int>
#define X first
#define Y second
//#define debug(x) cerr << #x << " : " << (x) << " "
const double PI = 3.14159265358979323846;
const double eps = (1e-9);
//int isGreater(long double x, long double y)
//{
//    if (abs(x - y) < eps)
//        return 0;
//    if (x > y)
//        return 1;
//    return -1;
//}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("AC.txt", "w", stdout);
#endif
    ll a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    if (a > b)
        swap(a, b);
    a += v * t;
    b += w * t;
    if (a >= b)
        cout << "YES\n";
    else
        cout << "NO\n";
}

Measured memory_bytes: 3676
#include <stdio.h>
int main(){
        float r = 0.0;
        float l = 0.0;
        int rn[4],ln[4],i;
        for(i=0;i<4;i++){
                rn[i] = 0;
                ln[i] = 0;
        }
        while(scanf("%f %f",&r,&l) != EOF){
        if(r >= 1.1){
                rn[0] += 1;
        }else if(1.1 > r && r >= 0.6){
                rn[1] += 1;
        }else if(0.6 > r && r >= 0.2){
                rn[2] += 1;
        }else if (0.2 > r){
                rn[3] += 1;
        }
        if(l >= 1.1){
                ln[0] += 1;
        }else if(1.1 > l && l >= 0.6){
                ln[1] += 1;
        }else if(0.6 > l && l >= 0.2){
                ln[2] += 1;
        }else if (0.2 > l){
                ln[3] += 1;
        }
        }
        for(i=0;i<4;i++){
                printf("%d %d\n",rn[i],ln[i]);
        }
return 0;
}

Measured memory_bytes: 624
N,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
p = sum(A)
k = 0
if (x == p):
  print(N)
elif (x > p):
  print(N-1)
else:
  i = 0
  for i in range(N):
    if (x - A[i] >= 0):
      x -= A[i]
      k += 1
      i += 1
    else:
      break      
  print(k)

Measured memory_bytes: 3064
def readInt():
    return int(input())
def readList():
    return list(map(int,input().split()))
def readMap():
	return map(int,input().split())
def readStr():
    return input()
inf=float('inf')
mod = 10**9+7
import math
def solve(n,A):
    count=0
    for x,y in A:
        if x==y:
            count+=1
        else:
            count=0
        if count==3:
            return True
    return False

n=readInt()
A=[]
for _ in range(n):
    A.append(readList())
if solve(n,A):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9200
// ===================================
//   author: M_sea
//   website: http://m-sea-blog.com/
// ===================================
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int read() {
    int X=0,w=1; char c=getchar();
    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
    return X*w;
}

const int mod=1e9+7;
const int inv2=(mod+1)/2;
int qpow(int a,int b) { int c=1;
    for (;b;b>>=1,a=1ll*a*a%mod) if (b&1) c=1ll*c*a%mod;
    return c;
}

const int N=3000+10;

int n,q,a[N],x[N],y[N],dp[N][N];

int main() {
    n=read(),q=read();
    for (int i=1;i<=n;++i) a[i]=read();
    for (int i=1;i<=q;++i) x[i]=read(),y[i]=read();
    for (int i=1;i<=n;++i)
        for (int j=1;j<=n;++j)
            dp[i][j]=a[i]>a[j];
    for (int i=1;i<=q;++i) {
        int u=x[i],v=y[i];
        dp[u][v]=dp[v][u]=1ll*(dp[u][v]+dp[v][u])*inv2%mod;
        for (int j=1;j<=n;++j) {
            if (j==u||j==v) continue;
            dp[u][j]=dp[v][j]=1ll*(dp[u][j]+dp[v][j])*inv2%mod;
            dp[j][u]=dp[j][v]=1ll*(dp[j][u]+dp[j][v])*inv2%mod;
        }
    }
    int ans=0;
    for (int i=1;i<=n;++i)
        for (int j=i+1;j<=n;++j)
            ans=(ans+dp[i][j])%mod;
    printf("%lld\n",1ll*ans*qpow(2,q)%mod);
    return 0;
}

Measured memory_bytes: 35584
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
  public static void main(final String[] args) throws Exception {
    try (BufferedReader r = new BufferedReader(new InputStreamReader(System.in))) {
      String s = r.readLine();
      String[] a = s.split(" ");
      int tHP = Integer.parseInt(a[0]);
      int tATK = Integer.parseInt(a[1]);
      int aHP = Integer.parseInt(a[2]);
      int aATK = Integer.parseInt(a[3]);
      int tk = (tHP - 1) / aATK;
      int ao = (aHP - 1) / tATK;
      if (tk >= ao) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
}

Measured memory_bytes: 32652
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
typedef long long ll;
using namespace std;
 
 
int main(){
    string s; cin >> s;
    int sl=s.length(); bool ans=false;
    if(sl%2==1) cout << "No" << endl;
    else{
    for(int i=0; i<sl; i=i+2){
        if(s[i]!='h' || s[i+1]!='i'){
            ans=true;
            break;
        }
    }
    if(ans) cout << "No" << endl;
    else cout << "Yes" << endl;
    }
return 0;
}

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

struct DynArrayStack{
    int top;
    int capacity;
    int *array;
};

struct DynArrayStack *CreateStack(){
    struct DynArrayStack *S=malloc(sizeof(struct DynArrayStack));
    if(!S) return NULL;
    S->capacity=20;
    S->top=-1;
    S->array=malloc(S->capacity*sizeof(int));
    if(!S->array) return NULL;
    return S;
}

int IsFullStack(struct DynArrayStack *S){
    return (S->top==S->capacity-1);
}

void DoubleStack(struct DynArrayStack *S){
    S->capacity*=2;
    S->array=realloc(S->array,S->capacity);
}

void Push(struct DynArrayStack *S,int x){
    if(IsFullStack(S)) DoubleStack(S);
    S->array[++S->top]=x;
}

int IsEmptyStack(struct DynArrayStack *S){
    return S->top==-1;
}

int Top(struct DynArrayStack *S){
    if(IsEmptyStack(S)) return INT_MIN;
    return S->array[S->top];
}

int Pop(struct DynArrayStack *S){
    if(IsEmptyStack(S)) return INT_MIN;
    return S->array[S->top--];
}

void DeleteStack(struct DynArrayStack *S){
    if(S){
        if(S->array) free(S->array);
        free(S);
    }
}

int main(void){
    int n1,n;
    struct DynArrayStack *S=CreateStack();
    scanf("%d",&n1);
    Push(S,n1);
    while(1){
        scanf("%d",&n);
        if(n!=0) Push(S,n);
        else{
            if(Top(S)==INT_MIN){
                break;
            }
            else printf("%d\n",Pop(S));
        }
    }
    return 0;
}


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

string to_string(string s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

void test_case() {
  int n;
  cin >> n;
  vector<int> A(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> A[i];
  }
  multiset<int> prv;
  for (int i = 1; i <= n; ++i) {
    auto it = prv.lower_bound(A[i]);
    if (it == prv.begin()) {
      prv.insert(A[i]);
    } else {
      --it;
      prv.erase(it);
      prv.insert(A[i]);
    }
  }
  cout << prv.size() << "\n";
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  test_case();
  return 0;
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
int main()
{
 string s,res;
  cin>>s;
  for(int i=0;i<s.length();i++)
  {
	if(s[i]=='1')
      res+='9';
    else if(s[i]=='9')
      res+='1';
    else
      res+=s[i];
  }
  cout<<res<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;


int main(int argc, char* argv[])
{
    int K;
    scanf("%d", &K);

    set<ll> ans;
    int i,j;
    for(i=1; i<10; i++) {
        ans.insert(i);
    }
    ll base=1;
    for(i=1; i<=15; i++) {
        base*=10;
        for(j=1; j<=300; j++) {
            int curr=j;
            int sum=0;
            while(curr) {
                sum+=curr%10;
                curr/=10;
            }
            if(j+1<=sum+9*i) {
                ans.insert((j+1)*base-1);
            }
        }
    }
    int cnt=0;
    auto it=ans.begin();
    for(; it!=ans.end(); ++it) {
        printf("%lld\n", *it);
        cnt++;
        if(cnt==K) break;
    }

    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
 
#define ff                  first
#define ss                  second
#define endl                "\n"
#define loop(i,s,e)         for(int i=s;i<e;i++)
#define int                 long long
#define vi                  vector<int> 
#define S(v)                sort(v.begin(),v.end())
#define RS(v)               sort(v.rbegin(),v.rend())
#define R(v)                reverse(v.begin(),v.end())
#define mxpq(T)             priority_queue <T>
#define mnpq(T)             priority_queue<T,vector<T>,greater<T>>
#define prv(v)              for(auto &x : v)cout << x << " ";
#define piirv(v)            for(auto &x : v)cout << x.ff << " " << x.ss << endl;
#define prvv(v)             for(auto &x : v)for(auto &y : x.ss)cout << y << " ";
#define mp                  make_pair
#define pii                 pair<int,int>
#define mset(a,f)           memset(a , f , sizeof(a))
#define pb                  push_back
#define inf                 INT_MAX
#define INF                 LLONG_MAX
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
 
const int N = 2e6 + 6;
const int M = 1e9+7;
int A[N];
char mat[1001][1001];
int dp[1001][1001];
int n , m;
int dx[] = {1 , 0};
int dy[] = {0 , 1};

inline int mul(int a, int b) { return (a * b) % M; };
inline int add(int a, int b)
{
      int res = a + b;
      if ( res < 0 ) res += M;
      if ( res >= M) res -= M;
      return res;
}

void solve()
{
	cin >> n >> m;

	loop(i,0,n)loop(j,0,m)cin >> mat[i][j];

	mset(dp , 0);

	int ans = 0;

	dp[0][0] = 1;

	loop(i,0,n)
	{
		loop(j,0,m)
		{
			loop(k, 0 , 2)
			{
				int ni = i + dx[k];
				int nj = j + dy[k];
				if(ni < n && nj < m && mat[ni][nj] == '.')
				{
				 	dp[ni][nj] = add(dp[i][j] , dp[ni][nj]);
				}
			}
		}
	}

	cout << dp[n-1][m-1];

}			
 
int32_t main()
{
 
cout<<fixed<<setprecision(16);
 
ios_base:: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
 	
 
 	int t = 1;
 	// cin >> t;
 	while(t--)solve();
  
}

Measured memory_bytes: 12432
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) int((x).size())
#define OUT(x) cout << (x) << endl
typedef long long ll;
typedef vector<int> V;
typedef vector<vector<int>> VV;
typedef pair<int, int> P;
typedef map<string, int> M;
typedef unordered_map<int, int> HM;
typedef set<int> S;
typedef queue<int> Q;

int main(){
    int r,d,x; cin>>r>>d>>x;
    for(int i=0; i<10; i++){
        x = x*r - d;
        OUT(x);
    }
}

Measured memory_bytes: 256
#include <stdio.h>

#define Mod 1000000007

long long div_mod(long long x, long long y, long long z)
{
	if (x % y == 0) return x / y;
	else return (div_mod((1 + x / y) * y - x, (z % y), y) * z + x) / y;
}

int main()
{
	int i, n, a[100002];
	scanf("%d", &n);
	for (i = 1; i <= n + 1; i++) scanf("%d", &(a[i]));
	
	long long fact[100002], fact_inv[100002];
	for (i = 2, fact[0] = 1, fact[1] = 1; i <= n + 1; i++) fact[i] = fact[i-1] * i % Mod;
	for (i = n, fact_inv[n+1] = div_mod(1, fact[n+1], Mod); i >= 0; i--) fact_inv[i] = fact_inv[i+1] * (i + 1) % Mod;
	
	int pos[100001] = {}, x, y;
	for (i = 1; i <= n + 1; i++) {
		if (pos[a[i]] == 0) pos[a[i]] = i;
		else {
			x = pos[a[i]];
			y = i;
		}
	}
	
	long long ans;
	printf("%lld\n", n);
	for (i = 2; i <= n + 1; i++) {
		ans = fact[n+1] * fact_inv[i] % Mod * fact_inv[n-i+1] % Mod;
		if (x + n - y >= i - 1) ans = (ans - fact[x+n-y] * fact_inv[i-1] % Mod * fact_inv[x+n-y-i+1] % Mod + Mod) % Mod;
		printf("%lld\n", ans);
	}
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 3964
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
const int INF=1e9;
const int MOD=1e9+7;
const double pi=acos(-1);

int main(){
  int n,k;
  cin >> n >> k;
  vector<ll>vec(n);
  rep(i,n)cin >> vec[i];
  ll ans=2*INF;
  rep(i,n-k+1){
    ll d1=abs(vec[i])+abs(vec[i+k-1]-vec[i]);
    ll d2=abs(vec[i+k-1])+abs(vec[i+k-1]-vec[i]);
    ans=min({ans,d1,d2});
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#define REP(i, n) for(i=0; i<n; i++)
#define REPR(i, n) for(i=n; i>=0; i--)
#define FOR(i, m, n) for(i=m; i<n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;

ll memo[100001]={0};

ll rec(ll n);

int main(void) {
    int a, b;
    cin>>a>>b;
    
    if(a<=b)
        cout << a;
    else
        cout << a-1;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;

const int MAXN = 1e3 + 5;
int H, n, a[MAXN], b[MAXN], f[10005][MAXN];

int dp(int remain, int cur) {
    if (remain <= 0) return 0;
    if (cur == n) {
        if (remain > 0) return 1e8;
        else return 0;
    }
    int &res = f[remain][cur];
    if (res != -1) return res;
    res = 1e8;
    res = min(res, dp(remain, cur + 1));
    res = min(res, dp(remain - a[cur], cur) + b[cur]);
    res = min(res, dp(remain - a[cur], cur + 1) + b[cur]);
    return res;
}

int main() {
#ifdef kvutxdy
    freopen("C:/Users/khanh/OneDrive/RoadtoPurple/Code/test/input.in", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> H >> n;
    for (int i = 0; i < n; ++i) cin >> a[i] >> b[i];
    memset(f, -1, sizeof f);
    cout << dp(H, 0);
}

Measured memory_bytes: 40064
#include <bits/stdc++.h>
#define MAX 500010
using namespace std;

char str[MAX];
int arr[MAX];
vector<int> zero;

int main(void)
{
	cin >> str;
	int N = strlen(str);
	if (str[0] == '<') zero.push_back(0);
	for (int i = 1; i < N; i++)
	{
		if (str[i - 1] == '>' && str[i] == '<') zero.push_back(i);
	}
	if (str[N - 1] == '>') zero.push_back(N);
	for (int z : zero)
	{
		for (int i = z + 1; i <= N; i++)
		{
			arr[i] = arr[i - 1] + 1;
			if (str[i - 1] != str[i]) break;
		}
		for (int i = z - 1; arr[i] == 0; i--) arr[i] = arr[i + 1] + 1;
	}
	if (str[0] == '>' && !arr[0]) arr[0] = arr[1] + 1;
	if (str[N - 1] == '<' && !arr[N]) arr[N] = arr[N - 1] + 1;
	for (int i = 1; i < N; i++)
	{
		if (str[i - 1] == '<' && str[i] == '>') arr[i] = max(arr[i - 1], arr[i + 1]) + 1;
	}
	long long ans = 0;
	for (int i = 0; i <= N; i++) ans += arr[i];
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3320
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
int h,w; cin>>h>>w;
  char a[h+2][w+2];
  for(int i=0;i<w+2;i++) {a[0][i]='.';
               a[h+1][i]='.';}
  for(int i=1;i<h+1;i++){a[i][0]='.';
                         a[i][w+1]='.';}
  for(int i=1;i<h+1;i++){
    for(int j=1;j<w+1;j++){
      cin>>a[i][j];
    }
  }
  
  
  
  
  bool res=true;
  bool bre=false;
for(int i=1;i<h+1;i++){
  for(int j=1;j<w+1;j++){
    if(a[i][j]=='#'){
      if(a[i+1][j]=='.'&&a[i-1][j]=='.'&&a[i][j+1]=='.'&&a[i][j-1]=='.'){
        res=false;
        bre=true;
        break;
      }
      }
    }
  if(bre) break;
  }
  
  if(res) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}


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

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define maxn 100
#define int long long int
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

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

int mpow(int N, int P, int M)  //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0) {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}

vector<bool> prime(maxn + 1, true); //素数テーブル
void prime_table(void) {
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= maxn; i++) {
        if (!prime[i]) {
            continue;
        }
        for (int j = i + i; j <= maxn; j += j + i) {
            prime[j] = false;
        }
    }
}

signed main() {
    int A1, A2, A3;
    cin >> A1 >> A2 >> A3;
    if (A1 + A2 + A3 >= 22) {
        cout << "bust" << endl;
    } else {
        cout << "win" << endl;
    }


}


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

#define endl '\n'

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s; cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) cout << "Yes\n";
    else cout << "No\n";
}

Measured memory_bytes: 256
n, m = gets.to_s.split.map{|i|i.to_i}
s    = gets.to_s.chomp.bytes

ans = 0
# p '0'.ord #=> 48
if m == 2 || m == 5
  
  n.times{ |i| (s[i] - 48 )%m == 0 && ans+=(i+1) }

else
  
  h = Hash.new(0)
  h[0] = 1
  
  cur = 0
  p10 = 1
  
  s.reverse_each do |c|
    cur = ( cur + ( c - 48 ) * p10 ) % m
    ans += h[cur]
    h[cur] += 1
    p10 = p10 * 10 % m
  end
end

puts ans

Measured memory_bytes: 4348
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> H(M);
  for(int i=0;i<M;i++){
    cin >> H.at(i);
  }
  vector<vector<int>> I(N,vector<int>(M));
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      cin>> I.at(i).at(j);
    }
  }
  int answer =0;
  int a = 0;
  for(int i=0;i<N;i++){
    for(int j=0;j<M;j++){
      a += H.at(j) * I.at(i).at(j);
    }
    if(a + C >0){
      answer++;
    }
    a = 0;
  }
  cout << answer << endl;
}
      

Measured memory_bytes: 256
use std::io;

fn main() {
    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();
    let mut vec: Vec<_> = line.split_whitespace()
        .map(|s| s.parse::<u16>().unwrap())
        .collect();
    vec.sort();
    println!("{} {} {}", vec[0], vec[1], vec[2]);
}


Measured memory_bytes: 5032
n = gets.to_i
as = gets.chomp.split.map(&:to_i)
b = []
as.each_with_index do |a,i|
  if i % 2 == 0
    b.push(a)
  else
    b.unshift(a)
  end
end

if as.size.odd?
  puts b.reverse.join(" ")
else
  puts b.join(" ")
end

Measured memory_bytes: 29024
x, n = map(int, input().split())
if n != 0:
    l = list(map(int, input().split()))
else:
    l = []

diff = 10**18
ans = 10**18

for i in range(-10000, 10000):
    if i in l:
        continue
    else:
        if abs(x-i) < diff:
            ans = i
            diff = abs(x-i)

print(ans)


Measured memory_bytes: 9112
K,N=map(int,input().split())
A=[int(x) for x in input().split()]
 
m=[]
if N==2:
   if A[1]-A[0]<=K/2:
       ans=A[1]-A[0]
   else:
       ans=K+A[0]-A[1]
    
else:
    for i in range(N-1):
        m.append(A[i+1]-A[i])
    m.append(K+A[0]-A[N-1])
    ans=K-max(m)
print(ans)

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


#define NUM 1000

priority_queue<int> Q[NUM];

int main(){

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

	int command,A,B;

	for(int loop = 0; loop < num_query; loop++){

		scanf("%d",&command);

		switch(command){
		case 0:

			scanf("%d %d",&A,&B);
			Q[A].push(B);
			break;

		case 1:

			scanf("%d",&A);
			if(!Q[A].empty()){
				printf("%d\n",Q[A].top());
			}
			break;

		case 2:

			scanf("%d",&A);
			if(!Q[A].empty()){
				Q[A].pop();
			}
			break;
		}
	}

	return 0;
}



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

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;

namespace Problem {
using namespace std;

class Solver {
 public:
  int n, k;
  Solver(LL n, LL k) : n(n), k(k){};

  void solve() {
    if (n == 0) {
      if (k > 0) {
        cout << -1 << endl;
      } else {
        cout << "0 0" << endl;
      }
    } else if (n == 1) {
      if (k == 0) {
        cout << "0 0 1 1" << endl;
      } else {
        cout << -1 << endl;
      }
    } else if (k >= (1 << n)) {
      cout << -1 << endl;
    } else {
      vector<int> ans;
      for (int i = 0; i < (1 << n); ++i) {
        if (i != k) ans.push_back(i);
      }
      ans.push_back(k);
      for (int i = (1 << n) - 1; i >= 0; --i) {
        if (i != k) ans.push_back(i);
      }
      ans.push_back(k);
      for (auto x : ans) {
        cout << x << ' ';
      }
      cout << endl;
    }
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(12);
  long long n = 0, k;
  std::cin >> n >> k;

  Problem::Solver sol(n, k);
  sol.solve();
  return 0;
}


Measured memory_bytes: 2932
#include <iostream>
using namespace std;
int abs(int x){return x > 0 ? x : -x;}
int min(int x, int y){return x < y ? x : y;}

int main(){
	int N;
	cin >> N;
	int W[N];
	for(int i = 0; i < N; i++) cin >> W[i];
	int res = 10000;
	int S1, S2;
	for(int T = 1; T < N; T++){
		S1 = S2 = 0;
		for(int i = 0; i < T; i++) S1 += W[i];
		for(int i = T; i < N; i++) S2 += W[i];
		res = min(abs(S1 - S2), res);
	}
	cout << res << endl;
}


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

int main(){
    int a, b;
    char op;
    while(1){
    cin >> a >> op >> b;
    if(op == '+'){
        cout << a + b << endl;
    }
    else if(op == '-'){
        cout << a - b << endl;
    }
    else if(op == '*'){
        cout << a * b << endl;
    }
    else if(op == '/'){
        cout << a / b << endl;
    }
    else{
        break;
    }
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
#define pb push_back

const int N = 200018;
const ll oo = 9e18;

int n, m;
vector<int> adj[N];
char c[N];
int qtd[N][2];
bool vis[N];

int main(){
	scanf("%d %d", &n, &m);
	scanf("%s", c+1);
	for(int i = 0; i < m; i++){
		int x, y;
		scanf("%d %d",&x, &y);
		adj[x].pb(y);
		adj[y].pb(x);
		qtd[x][c[y] - 'A']++;
		qtd[y][c[x] - 'A']++;
	}

	queue<int> q;
	for(int i = 1; i <= n; i++){
		if(!qtd[i][0] || !qtd[i][1]){
			q.push(i);
			vis[i] = 1;
		}
	}
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i : adj[v]){
			if(!vis[i]){
				qtd[i][c[v] - 'A']--;
				if(qtd[i][c[v] - 'A'] == 0){
					q.push(i);
					vis[i] = 1;
				}
			}
		}
	}
	for(int i = 1; i <= n; i++){
		if(!vis[i]){
			printf("Yes\n");
			return 0;	
		}
	}
	printf("No\n");
}


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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

LL dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
LL dy[] = {0, 0, 1, -1, -1, 1, -1, 1};

///**************************DONE****************************///

int main()
{
    string s;
    cin >> s;
    
    if(s[2] == s[3] && s[4] == s[5])
        cout << "Yes\n";
    else
        cout << "No\n";
    return 0;
}


Measured memory_bytes: 256