akhauriyash/Code-Regression huggingface dataset:
//import java.io.*;
import java.util.*;
//import java.math.*;
public class Main {
 
    public static void main(String[] args) throws java.io.IOException{
        Scanner scan = new Scanner(System.in);
      //  ArrayList <Double> student= new ArrayList <Double>(); 
//      double [] student =new double [(int)Math.pow(2, 16)-1];
     while(scan.hasNext()){
    	 String [] strs=scan.nextLine().split(",");
    	 int num =Integer.parseInt(strs[0]);
    	 double weight = Double.parseDouble(strs[1]);
    	 double height = Double.parseDouble(strs[2]);
    	 if((weight/Math.pow(height, 2))>=25)
    	 System.out.println(num);
     }

    }
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[200];
  int N, M, X;
  cin >> N >> M >> X;
  int left=0, right=0;
  int test;
	for (int i = 0; i < M; ++i) scanf("%d", A + i);

  for (int i = 0; i < M; i++) {
    if (A[i] < X) left++;
    else right++;
  }
  cout << min(left, right) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define popb pop_back
#define popf pop_front
#define int long long int
#define vi         vector<int>
#define vll        vector<ll>
#define vpii       vector<pair<int,int>>
#define vpll       vector<pair<ll,ll>>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(container) int((container).size())
#define rep(i,a,b) for(i=a;i<b;i++)
#define tr(container,it)   for(auto it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())      //set,map etc.
#define cpresent(container, element) (find(all(container),element) != container.end())    //vector
#define hell 1000000007
#define PI 3.14159265
#define mod 998244353
#define fs first
#define sc second
#define TIME        cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
void solve()
{
  int n,i,j;
  cin>>n;
  int a[n],dp[n];
  rep(i,0,n)cin>>a[i];
  dp[0]=0;
  dp[1]=abs(a[1]-a[0]);
  for(i=2;i<n;i++)
  {
    dp[i]=min(abs(a[i]-a[i-1])+dp[i-1],dp[i-2]+abs(a[i]-a[i-2]));
  }
  cout<<dp[n-1];
}
signed main()
{
  fastio
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  int t;
  t=1;
  //cin>>t;
  while(t--)
  solve();
  TIME
  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<math.h>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<map>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;

int n, h;
int a[105000];
int b[105000];

int main()
{
	cin >> n >> h;
	int amax = 0;
	int ai, bi;
	for (int i = 0; i < n; i++) {
		cin >> ai >> bi;
		a[i] = ai;
		b[i] = bi;
		amax = max(amax, a[i]);
	}



	int i = 0;
	int sum = 0;
	int cnt = 0;
	sort(b, b + n, greater<int>());
	while (i < n) {
		if (b[i] >= amax) {
			sum += b[i];
			cnt++;
			if (sum >= h) {
				cout << cnt << endl;
				return 0;
			}
		}
		i++;
	}

	//cout << cnt << " " << sum << " " << h << " " << amax << endl;

	int plus;
	if ((h - sum) % amax == 0)plus = (h - sum) / amax;
	else plus = (h - sum) / amax + 1;
	cout << cnt + plus << endl;

	return 0;
}


Measured memory_bytes: 1024
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {

	@SuppressWarnings("unused")
	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(); // 県の個数
		int m = in.nextInt(); // 市の個数

		int city[][] = new int[m + 1][4]; // id, pref, year, number in pref
		int copycity[][] = new int[m + 1][4];

		// 県、年でソート
		for ( int id = 1; id <= m; id++ ) {
			city[id][0] = id;
			city[id][1] = in.nextInt();
			city[id][2] = in.nextInt();

			copycity[id] = city[id]; // 参照のコピーを作る
		}
		// コピー側をソート
		Arrays.sort(copycity, new Comparator<int[]>() {

			@Override
			public int compare(int[] o1, int[] o2) {
				if ( o1[1] != o2[1] ) {
					return o1[1] - o2[1];	// １．prefでソート
				} else {
					return o1[2] - o2[2];	// ２．yearでソート
				}
			}
		});

		// 年を見てナンバリング
		DecimalFormat df = new DecimalFormat("000000");
		//		String result[] = new String[m];
		int pref = 0;
		int num = 0;
		for ( int i = 1; i <= m; i++ ) {
			int p = copycity[i][1];
			if ( pref != p ) {
				pref = p;
				num = 1;
			} else {
				num++;
			}
			copycity[i][3] = num;
			// result[city[i][0] - 1] = df.format(pref) + df.format(num);
		}

		StringBuilder sb = new StringBuilder(100000 * 13);
		for ( int i = 1; i <= m; i++ ) {
			sb.append(df.format(city[i][1])).append(df.format(city[i][3])).append("\n");
		}
		System.out.println(sb);
		in.close();
	}

	private static String padding(int n) {
		String padded = "";
		if ( n < 10 ) {
			padded = "00000" + n;
		} else if ( n < 100 ) {
			padded = "0000" + n;

		} else if ( n < 1000 ) {
			padded = "000" + n;

		} else if ( n < 10000 ) {
			padded = "00" + n;

		} else if ( n < 100000 ) {
			padded = "0" + n;

		} else {
			padded = String.valueOf(n);
		}
		return padded;
	}
}


Measured memory_bytes: 101676
#include <iostream>


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

    int *sArray = new int[sNum];
    for (int i = 0; i < sNum; i++) std::cin >> sArray[i];

    int tNum;
    std::cin >> tNum;

    int *tArray = new int[tNum];
    for (int i = 0; i < tNum; i++) std::cin >> tArray[i];

    int containNum = 0;
    int left;
    int right;
    int mid;
    for (int t = 0; t < tNum; t++)
    {
        left  = 0;
        right = sNum;
        while (left < right)
        {
            mid = (right + left) / 2;
            if (sArray[mid] == tArray[t])
            {
                containNum++;
                break;
            }
            else if (sArray[mid] > tArray[t])
            {
                right = mid;
            }
            else
            {
                left = mid + 1;
            }
        }
    }

    std::cout << containNum << std::endl;
}



Measured memory_bytes: 3644
l, r = map(int, input().split())
ans = 2020

for i in range(l, min(r + 1, l + 4040)):
    for j in range(i + 1, min(r + 1, l + 4040)):
        if i * j % 2019 < ans:
            ans = i * j % 2019
print(ans)

Measured memory_bytes: 9104
#include<stdio.h>
#include<string.h>

#define M 1046527
#define Nil (-1)
#define L 14

char H[M][L];

int getChar(char ch){
  if(ch=='A')return 1;
  else if(ch=='C')return 2;
  else if(ch=='G')return 3;
  else if(ch=='T')return 4;
  else return 0;
}

long long getKey(char str[]){
  long long sum=0,p=1,i;

  for(i=0;i<strlen(str);i++){
    sum+=p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){
  return key%M;
}
int h2(int key){
  return 1+(key%(M-1));
}

int find(char str[]){
  long long key,i,h;
  key=getKey(str);
  for(i=0;;i++){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0)return 0;
  }
  return 0;
}
int insert(char str[]){
  long long key,i,h;
  key=getKey(str);

  for(i=0;;i++){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0){
      strcpy(H[h],str);
      return 0;
    }
    }
  return 0;
}

int main(){
  int i,n,h;
  char str[L],com[9];

  for(i=0;i<M;i++)H[i][0]='\0';
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s %s",com,str);
    if(com[0]=='i'){
      insert(str);
    }else{
      if(find(str)){
        printf("yes\n");
      }else{
        printf("no\n");
      }
    }
  }
return 0;
}


Measured memory_bytes: 17024
#include <stdio.h>
int main (){
int a,b,c,d,t,y;

scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
t=a;
y=c;
while(1)
{
  if(t>0 && y>0)
  {
   y=y-b;
    if(y<=0) 
    {
      printf("Yes");
      break;
    }
      
  t=t-d;
    if(t<=0)
    {
      printf("No");
      break;
    }
  }


}
}


Measured memory_bytes: 1728
import java.io.*;
import java.util.*;

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

	int n=Integer.parseInt(br.readLine());

	Node node[]=new Node[n];
        for(int i=0;i<n;i++){
	    node[i]=new Node(-1);
	}

	for(int i=0;i<n;i++){
	    String str[]=br.readLine().split(" ");
	    int id=Integer.parseInt(str[0]);
	    int k=Integer.parseInt(str[1]);

	    for(int j=0;j<k;j++){
		int c=Integer.parseInt(str[j+2]);
		node[id].add(c);
		node[c].parent=id;
	    }
	}

	for(int i=0;i<n;i++){
	    System.out.println("node "+i+": parent = "+node[i].parent+", depth = "+node[i].getDepth(node)+", "+node[i].isType()+", "+node[i].child);
	}
    }
}
class Node{

    int parent;
    ArrayList<Integer> child=new ArrayList<>();
    
    public Node(int parent){
	this.parent=parent;
    }
    public void add(int id){
	child.add(id);
    }
    public String isType(){
	if(parent==-1){
	    return "root";
	}else if(child.size()==0){
	    return "leaf";
	}else{
	    return "internal node";
	}
    }
    public int getDepth(Node node[]){
	int pID=parent;
	int count=0;
	while(pID!=-1){
	    pID=node[pID].parent;
	    count++;
	}
	return count;
    }
}



Measured memory_bytes: 104176
#include <iostream>
#include<vector>
#include<algorithm>//#include<ulity>に
using namespace std;

struct UnionFind{
	vector<int>r;

	UnionFind(int N){//voidは書かない
		r=vector<int>(N,-1);//－１で初期化して、足していくことでサイズの情報も持つ
	}

		int root(int x){
			if(r[x]<0) return x;
			return r[x]=root(r[x]);//経路圧縮
		}

		bool unite(int x,int y){
			x=root(x);
			y=root(y);
			if(x==y) return false;
			if(r[x]>r[y]) swap(x,y);
			r[x]+=r[y];
			r[y]=x;
			return true;
		}

		int size(int x){
			return -r[root(x)];//-1*d を-d と書くことができる
		}

};


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

	UnionFind UF(N);

	for(int i=0;i<M;i++){
		int A,B;
		cin>>A>>B;
		UF.unite(A-1,B-1);
	}

	int ans=0;
	for(int i=0;i<N;i++){
    ans=max(ans,UF.size(i));
	}

   cout<<ans<<endl;
}

Measured memory_bytes: 3644
var array: [Int] = []
var sum = 0

for _ in 0..<5 {
  let item = Int(readLine()!)!
  let a = item % 10
  sum += (item - a)
  if a != 0 {
    array.append(a)
  }
}

if array.count == 0 {
  print(sum)
} else {
  array.sortInPlace { (lhs, rhs) in
    return lhs > rhs
  }
  for i in 0..<array.count-1 {
    let item = array[i]
    let amari = item % 10
    let add = item + 10 - amari
    sum += add
  }
  sum += array[array.count-1]
  print(sum)
}


Measured memory_bytes: 4080
// Example program
#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int N, M;
  cin >> N >> M;
  
  vector<int> data;
  
  for (int i=0; i < N; i++) {
  	int Ki;
    cin >> Ki;

    vector<int> tmp;

    for (int j=0; j < Ki; j++) {
      int Aij;
      cin >> Aij;
      
      if (i == 0) {
      	tmp.push_back(Aij);
      } else {
        for (int k=0; k < data.size(); k++) {
          if (data[k] == Aij) {
            tmp.push_back(Aij);
          }
        }
      }
    }
    data = tmp;
  }
  cout << data.size() << endl;
  return 0;
}


Measured memory_bytes: 256
while True:
    n=input()
    if n=='0':
        break

    m=input()
    l=input()
    
    x=[]
    x.append(n)
    x.append(m)
    x.append(l)
    
    for i in range(3):
        if i==0:
            a=-1
            b=0
        elif i==1:
            if n[-1]=='A':
                a=-1
                b=0
            elif n[-1]=='B':
                a=0
                b=-1
        elif i==2:
            if m[-1]=='A':
                a=-1
                b=0
            elif m[-1]=='B':
                a=0
                b=-1
        
        for j in x[i]:
            if j=='A':
                a+=1
            elif j=='B':
                b+=1
        if a>b:
            a+=1
        elif b>a:
            b+=1
            
        print(a,end=' ')
        print(b)
        



Measured memory_bytes: 5572
// Never Give Up!
#include <stdio.h>
#include <iostream>
#include <limits>
#include <cstdint>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <bitset>
#include <array>
#include <string.h>
#include <stack>
#include <queue>
#include <stdint.h>
#include <sstream>
#include <map>
#include <set>
#include <locale>
#define mem(x, y) memset(x, y, sizeof x);
#define __STDC_LIMIT_MACROS
#define fio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int maxn = 1e5 + 5, INF = 1e9;
int n , a[maxn] , mxn = 0 , mxr , dr = INF , _i;
int main(){     
      
	fio;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		if(a[i] > mxn){
			mxn = a[i];
			_i = i;
		}
	}

	for(int i = 0; i < n; i++){
		if(abs(a[i] - mxn/2) < dr && i != _i){
			dr = abs(a[i] - mxn/2);
			mxr = a[i];
		}
	}
	
	

	cout << mxn << " " << mxr << endl;




    	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main{
	private static Scanner scan;
	public static void main(String[] args) {
		scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		for(int i = 0;i < n;i++){
			double s[] = new double[6];
			for(int j=0;j < 6;j++){
				s[j] = Double.parseDouble(scan.next());
			}
			double A1,B1,C1,A2,B2,C2,X,Y,R;
			A1 = 2*(s[2] - s[0]);
			B1 = 2*(s[3] - s[1]);
			C1 = Math.pow(s[0], 2) - Math.pow(s[2], 2) + Math.pow(s[1], 2) - Math.pow(s[3], 2);
			A2 = 2*(s[4] - s[0]);
			B2 = 2*(s[5] - s[1]);
			C2 = Math.pow(s[0], 2) - Math.pow(s[4], 2) + Math.pow(s[1], 2) - Math.pow(s[5], 2);
			X = (B1*C2 - B2*C1) / (A1*B2 - A2*B1);
			Y = (C1*A2 - C2*A1) / (A1*B2 - A2*B1);
			R = Math.sqrt(Math.pow(X - s[0], 2) + Math.pow(Y - s[1], 2));
			System.out.printf("%1.3f %1.3f %1.3f%n",X,Y,R);
		}
		System.exit(0);

	}
}

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

#define Mset(s, n)      memset(s, n, sizeof(s))
#define Rp0(i, m)       for(int i = 0; i < m; ++i)
#define Rpd(i, m, l)    for(int i = l; i >= m; --i)
#define Rp1(i ,m)       for(int i = 1; i <= m; i++)
#define All(a)          (a).begin(), (a).end()
#define Lwb             lower_bound
#define Upb             upper_bound
#define Sz(a)           int((a).size())
#define u_map           unordered_map
#define Exist(a, b)     (find(All(a), (b)) != (a).end())
#define Sort(x)         sort(All(x))
#define Gsort(x)        sort(All(x), greater<typeof(*((x).begin()))>())
#define Unique(v)       Sort(v); (v).resize(unique(ALL(v)) - (v).begin())

#define fi              first
#define se              second
#define pb              push_back
#define pf              push_front
#define is              insert
#define ooi             INT_MAX
#define ool             LLONG_MAX
#define ll              long long
#define ull             unsigned ll
#define ld              long double
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define vll             vector<ll>
#define vpll            vector<pll>
#define vpii            vector<pii>

const ll MOD = (ll) 1e9 + 7;
const ld PI = acos((ld) -1);
inline int Get_bit(int x, int k){return (x >> (k - 1)) & 1;}
inline ll Gcd(ll a, ll b) {ll r; while(b){ r = a % b; a = b; b = r;} return a;}
inline ll Lcm(ll a, ll b) {return a / Gcd(a, b) * b;}
inline ll Pow(ll n, ll k) {ll r = 1; for(; k; k >>= 1, n = n * n % MOD){if(k & 1) r = r * n % MOD;} return r;}
const int base = 311;


const int N = 1e5 + 10;

ll n, k, m, query;
ll ans;
ll a[N];
void Solve(){
    cin >> n >> m;
    int  cnt = 0;
    for(int i = 1; i <= m; i++){
        ll cost, k;
        cin >> cost >> k;
        int r = 0;
        for(int i = 1; i <= k; i++){
            int x;
            cin >> x;
            r = r | (1 << (x - 1));
        }
        for(int i = (1 << n) - 1; i >= 0; i--){
            if(i == 0){
                if(a[r] == 0) a[r] = ool;
                a[r] = min(a[r], cost);
            }
            if(i != 0 && a[i]) {
                if(a[r | i] == 0){
                    a[r | i] = ool;
                }
                a[r | i] = min(a[r | i], a[i] + cost);
            }
        }
    }
    if(a[(1 << n) - 1]) cout << a[(1 << n) - 1];
    else cout << -1;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(10);
    Solve();
}

















Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define chmin(x, y) x = min(x, y)
#define ll long long
#define ld long double
//#define int ll
#define INF INT_MAX/10
#define MOD 1000000007

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[100100];

int main() {
  long double N; cin >> N;
  long double t = N/1.08;
  if (floor(floor(t) * 1.08) == N) {
    cout << floor(t) << endl;
  } else if (floor(ceil(t) * 1.08) == N) {
    cout << ceil(t) << endl;
  } else {
    cout << ":(" << endl;
  }
}


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

#define pb push_back
#define fi first
#define se second
typedef long long ll;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);

	int n;
	string s, t;
	cin >> n >> s >> t;
	for (int i = 0; i < n; ++i)
		cout << s[i] << t[i];
	cout << '\n';
}


Measured memory_bytes: 256
#include <iostream>

int main() {
    int ans = 0, rem = 10;
    for (int i = 0; i < 5; ++i) {
        int A;
        std::cin >> A;
        ans += (A + 9) / 10 * 10;
        rem = std::min(rem, (A - 1) % 10 + 1);
    }
    std::cout << ans - 10 + rem << std::endl;
    return 0;
}

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

int main(void){

  string s;
  cin >> s;

  int i = 1;
  while(1){
    if(i % 2 == 1){
    if(s[i-1] != 'L'){
      i ++;
    }
    else{
      cout << "No" << endl;
      break;
    }
  }

   else{
     if(s[i-1] != 'R'){
       i ++;
     }
     else{
       cout << "No" << endl;
       break;
     }
   }

   if(i-1 == s.length()){
     cout << "Yes" << endl;
     break;
   }
  
  }
  
  return 0;

}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <algorithm>

#define rep(i,st,ed) for (int i=st;i<=ed;++i)

const int INF=0x3f3f3f3f;
const int N=500005;

char s[N];

int main(void) {
	int n; scanf("%d%s",&n,s+1);
	int L=0,R=0,ans=INF;
	rep(i,1,n) R+=(s[i]=='E');
	rep(i,1,n) {
		R-=(s[i]=='E');
		ans=std:: min(ans,L+R);
		R+=(s[i]=='W');
	}
	printf("%d\n", ans);
	return 0;
}

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

using namespace std;

int main() {
	int n;
	while ( cin >> n, n ) {
		vector<int> v(n);
		for (int i = 0; i < n; ++i) cin >> v[i];
		int ans = 0;
		for (int i = 0; i < n; ++i) {
			for (int j = i+1; j < n; ++j) {
				if (v[j] < v[i]) ++ans;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1196
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx,avx2")
#pragma GCC optimize ("trapv")

#include <bits/stdc++.h>
using namespace std;

#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cin.exceptions(cin.failbit);
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (x).size()
#define what_is(x) cerr << #x << " is " << x << endl;
#define wis cout<<endl<<"I already speak english, bitch"<<endl<<endl;
 
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef pair<ii,lli> iii;
typedef long double C; 

#define trace(args...) { string  _s =#args; replace(_s.begin(), _s.end(), ',',' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
void err(istream_iterator<string> it){}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args){
    cerr <<  *it  << " : " << a << endl;
    err(++it, args...);
}

int main(){
	fastio;
	int a,b,c; cin>>a>>b>>c;
	if(a+b+c>=22)cout<<"bust"<<endl;
	else cout<<"win"<<endl;
	return 0;
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/


Measured memory_bytes: 256
// AOJ CGL_1_A Projection
// 2018.5.2 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

typedef struct { double x, y; } PP;
typedef struct { PP s, e; } SEG, LINE;

#define INF			1e8
#define EPS			1e-8
#define EQ(a,b)		(fabs((a)-(b))<EPS)
#define PPeQ(a,b)	(EQ(a.x,b.x)&&EQ(a.y,b.y))

int dcmp(double x) { if (fabs(x) < EPS) return 0; return x <= 0 ? -1 : 1; }
PP vset(double x, double y) { PP r; r.x = x, r.y = y; return r; }
PP vadd(PP p1, PP p2) { PP r; r.x = p1.x + p2.x, r.y = p1.y + p2.y; return r; }
PP vsub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; }
PP vsmul(PP p, double k) { PP r; r.x = p.x * k, r.y = p.y * k; return r; }
PP vmul(PP p1, PP p2) { PP r;
	r.x = p1.x * p2.x - p1.y * p2.y, r.y = p1.x * p2.y + p1.y * p2.x; return r; }
double vabs(PP a) { return hypot(a.x, a.y); }
double dist(PP p1, PP p2) {	return hypot(p1.x-p2.x, p1.y-p2.y); };
double cross(PP a, PP b) { return a.x * b.y - a.y * b.x; }
double dot(PP a, PP b) { return a.x * b.x + a.y * b.y; }
double norm(PP a) { return a.x * a.x + a.y * a.y; }

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
	int n = 0, c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

int main()
{
	int q;
	PP p1, p2, p, p2p1, pp1, pp;

	p1.x = in(), p1.y = in(), p2.x = in(), p2.y = in();
	p2p1 = vsub(p2, p1);
	
	q = in();
	while (q--) {
		p.x = in(), p.y = in();
		pp1 = vsub(p, p1);
		pp = vadd(p1, vsmul(p2p1, dot(pp1, p2p1)/norm(p2p1)));
		printf("%.10lf %.10lf\n", pp.x, pp.y);
	}
	return 0;
}



Measured memory_bytes: 2128
fun main() {
    val (n,a,b) = readLine()!!.split(" ").map { it.toInt() }
    var total = 0

    for (i in 1..n){
        val check = col(i)
        if (check in a..b){
            total += i
        }
    }

    println(total)
}

fun col(k:Int): Int{
    var result = 0
    var num = k

    while (num!=0){
        result += num%10
        num /= 10
    }

    return result
}

Measured memory_bytes: 36452
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// const ll INF = 1LL <<60;
const int INF = 10000;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}
// ここから開始

int main(){
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);
  if(a[0]==5&&a[1]==5&&a[2]==7) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>


using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>

int n, ans;
int main() {
	cin >> n;
	vector<int> s(n);
	REP(i, n)cin >> s[i];
	sort(ALL(s));
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			for (int k = j + 1; k < n; k++) {
				if (s[i] + s[j] <= s[k])break;
				ans++;
			}
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;


ll Largest_Rectangle(const vector<vector<bool>> &A){
    vector<vector<ll>> a(A.size(),vector<ll>(A[0].size(),0));
    ll count;
    for(int i=0;i<A[0].size();i++){
        count=0;
        for(ll h=0;h<A.size();h++){
            if(A[h][i]){count++;}
            else{count=0;}
            a[h][i]=count;
        }
    }
    ll mx=0;
    stack<pll> s;
    for(int i=0;i<A.size();i++){
        for(int t=0;t<A[0].size();t++){
            ll mi=t;
            while(!s.empty() && s.top().F>a[i][t]){
                pll w=s.top(); s.pop();
                mx=max(mx,w.F*(t-w.S));
                mi=w.S;
            }
            s.push({a[i][t],mi});
        }
        while(!s.empty()){
            pll w=s.top(); s.pop();
            mx=max(mx,w.F*((ll)A[0].size()-w.S));
        }
    }
    return mx;
}

ll Largest_Square(const vector<vector<bool>> &A){
    vector<vector<ll>> a(A.size(),vector<ll>(A[0].size(),0));
    ll count;
    for(int i=0;i<A[0].size();i++){
        count=0;
        for(ll h=0;h<A.size();h++){
            if(A[h][i]){count++;}
            else{count=0;}
            a[h][i]=count;
        }
    }
    ll mx=0;
    stack<pll> s;
    for(int i=0;i<A.size();i++){
        for(int t=0;t<A[0].size();t++){
            ll mi=t;
            while(!s.empty() && s.top().F>a[i][t]){
                pll w=s.top(); s.pop();
                ll x=min(w.F,t-w.S);
                mx=max(mx,x*x);
                mi=w.S;
            }
            s.push({a[i][t],mi});
        }
        while(!s.empty()){
            pll w=s.top(); s.pop();
            ll x=min(w.F,(ll)A[0].size()-w.S);
            mx=max(mx,x*x);
        }
    }
    return mx;
}


int main(){
    ll h,w;
    cin>>h>>w;
    vector<vector<bool>> a(h,vector<bool>(w));
    for(int i=0;i<h;i++){
        for(int t=0;t<w;t++){
            ll b;
            cin>>b; a[i][t]=b==0;
        }
    }
    cout<<Largest_Square(a)<<endl;
    
    
    return 0;
}



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

int main(){
  using namespace std;
  int n,m,tmp,sum=0,cnt=0;
  cin >> n >> m;
  vector<int> a;
  for(int i=1; i<=n; i++){
    cin >> tmp;
    sum+=tmp;
    a.push_back(tmp);
  }
  for(int i=0; i<n; i++){
    if(4*a[i]*m>=sum) cnt++;
  }
  if(cnt>=m) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

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

int main() {
	string C[2];
	for (int i = 0; i < 2; i++) {
		cin >> C[i];
	}
	if (C[0][2] == C[1][0] && C[0][1] == C[1][1] && C[0][0] == C[1][2]) {
		cout << "YES";
	}
	else {
		cout << "NO";
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <climits>
#include <math.h>
#include <bitset>

#define P pair
#define X first
#define Y second
#define VSORT(v) sort(v.begin(), v.end())
#define VREV(v) reverse(v.begin(), v.end())
#define VMAX_P(v) max_element(v.begin(), v.end())
#define VMIN_P(v) min_element(v.begin(), v.end())
#define VMAX_IDX(v) distance(v.begin(), VMAX_P(v))
#define VMIN_IDX(v) distance(v.begin(), VMIN_P(v))
#define VCOPY(src, dst) copy(src.begin(), src.end(), back_inserter(dst))
#define SUPPER(src, dst) transform(src.begin(), src.end(), dst.begin(), toupper);
#define SLOWER(src, dst) transform(src.begin(), src.end(), dst.begin(), tolower);

using namespace std;
using ll = long long;

int main(int argc, const char *argv[])
{
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    VSORT(v);
    cout << v[n / 2] - v[n / 2 - 1] << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define RG register
using namespace std;
typedef long long LL;
LL d,h,n,q,s,ans;
inline int gi(){
    RG int x=0;RG char c=getchar();
    while(c<'0'||c>'9') c=getchar();
    while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x;
}
int main(){
    q=gi();h=gi();s=gi();d=gi();n=gi();
    if(d<(q<<3)&&d<(h<<2)&&d<(s<<1))
	if(n>2){
	    ans+=(n>>1)*d;
	    n&=1;
	}
    if(s<(q<<2)&&s<(h<<1)){
	ans+=n*s;
	n=0;
    }
    if(h<(q<<1)){
	ans+=(n<<1)*h;
	n=0;
    }
    ans+=(n<<2)*q;
    printf("%lld\n",ans);
    return 0;
}


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


int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int a, b;
	cin >> a >> b;
	
	if(a < b) cout << "a < b" << "\n";
	else if(a > b) cout << "a > b" << "\n";
	else cout << "a == b" << "\n";

	return 0;
}

Measured memory_bytes: 1176
import java.util.Scanner;

public class Main {
    private static int ROW = 3;
    private static int[] VALUES = {500, 100, 50};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] coins = new int[ROW];
        for (int i = 0; i < ROW; i++) {
            coins[i] = sc.nextInt();
        }
        int x = sc.nextInt();
        int cnt = 0;

        for (int n500 = 0; n500 <= coins[0]; n500++) {
            if (n500 * 500 > x) {
                continue;
            }
            for (int n100 = 0; n100 <= coins[1]; n100++) {
                if (n100 * 100 > x) {
                    continue;
                }
                for (int n50 = 0; n50 <= coins[2]; n50++) {
                    if (n50 * 50 > x) {
                        continue;
                    }

                    int sum = (n500 * 500) + (n100 * 100) + (n50 * 50);
                    if (sum == x) {
                        cnt++;
                    };
                }
            }
        }
        System.out.println(cnt);
    }
}


Measured memory_bytes: 23764
A, B, K = map(int, (input().split(' ')))

As = []
for i in range(1, A+1):
    if A % i == 0:
        As.append(i)
Bs = []
for i in range(1, B+1):
    if B % i == 0:
        Bs.append(i)

print(sorted(list(set(As) & set(Bs)), key=lambda x: -x)[K-1])


Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = 924844033;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
ll lesum[200000], risum[200000];
int main() {
	int n; cin >> n;
	ll mi = INF;
	ll a[200000];
	ll sum = 0;
	rep(i, n) {
		cin >> a[i]; sum += a[i];
	}
	rep(i, n) {
		if (i == 0) {
			lesum[0] = a[0];
		}
		else {
			lesum[i] = lesum[i - 1] + a[i];
		}
	}
	per(i, n) {
		if (i == n - 1) {
			risum[i] = a[i];
		}
		else {
			risum[i] = risum[i + 1] + a[i];
		}
	}
	rep(i, n - 1) {
		mi = min(mi, abs(lesum[i] - risum[i+1]));
	}
	cout << mi << endl;
	return 0;
}

Measured memory_bytes: 4992
S = input()
S = S[::-1]
l = ['dream','dreamer','erase','eraser']
L = []
pos = 0
f=True

for i in l:
    L.append(i[::-1])

while pos < len(S):
    no_match = True
    for candidate in L:
        if S[pos:pos+len(candidate)]==candidate:
            pos+=len(candidate)
            no_match =False
            break
    if no_match:
        f =False
        break


if f:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 3188
#include <iostream>
#include <string>
using namespace std;
int main(){
  string A,B,C;
  cin >> A >> B >>C;
  if (A.at(A.size() - 1) == B.at(0) && B.at(B.size() - 1) == C.at(0)) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define per(i,a,b) for(int i=a;i>=b;--i)
#define mem0(x) memset(x,0,sizeof(x))
#define meminf(x) memset(x,0x3f,sizeof(x))
#define VI vector<int>
#define VL vector<ll>
using namespace  std;

int main(){
    ios::sync_with_stdio(0);
    int n,t,x;cin>>n>>x>>t;
    int fg = 0;
    if(n%x!=0){
        fg=1;
    }
    int num = (n/x +fg)*t;
    cout<<num;

}


Measured memory_bytes: 3648
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;

int main() {
  vector <int> A(3);
  cin >> A[0] >> A[1] >> A[2];
  sort(A.begin(), A.end());
  cout << A[2] - A[0] << endl;
  return 0;
}


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

int main()
{
	int m, n;

	while (1) 
	{
		cin >> m >> n;

		if (m == 0 && n == 0)
		{
			return 0;
		}
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				cout << "#";
			}
			cout << "\n";
		}
		cout << "\n";
	}
	return 0;
}

Measured memory_bytes: 3080
#pragma region Macros
#include <bits/stdc++.h>

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

using namespace std;
using ll = long long;

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

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

  int n, k;
  cin >> n >> k;
  if (n > k) {
    cout << 0 << endl;
  } else {
    cout << 1 << endl;
  }

  return 0;
}


Measured memory_bytes: 3164
#include<bits/stdc++.h>
using namespace std;
#include<string>
#define fo(i, n) for(ll i = 0; i < n; i++)
#define endl "\n"
#define of(i, n) for(ll i = n - 1; i >= 0; i--)
#define ll long long
#define vec vector<ll>
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define rep(i,j,n) for (ll i = j; i <= n; ++i)
#define EB emplace_back
#define mem(i,j) memset( i, j,sizeof(i))
#define ff first
#define ss second
#define ii pair<ll,ll>
#define iii pair<ll,pair<ll,ll> >
#define pb push_back
#define mp make_pair
#define all(i) i.begin(),i.end()
#define pr(a) cout<<a<<endl
#define pr
#define prv(a) for(int jkl=0; jkl<a.size();jkl++) cout<<a[jkl]<<" "; cout<<endl;
ll mod = 1e9+7;
string l,r;
ll d;
int dp[10100][2][2][101];

ll getAns(int level, int tlow, int thi, int rem)
{
    if(level>=l.length())
    {
        if(rem==0) return 1;
        else return 0;
    }
    if(dp[level][tlow][thi][rem]==-1)
    {
        int blow = 0;
        int bhigh = 9;
        if(tlow) blow =l[level] - '0';
        if(thi) bhigh = r[level]-'0';
        ll ans =0;

        for(int i=blow;i<=bhigh;i++)
        {
            int ntlow = tlow;
            int nthi = thi;
            if( i > l[level]-'0') ntlow =0 ;
            if(i<r[level]-'0') nthi =0;

            ans += getAns(level+1, ntlow,nthi,(rem + i)%d);
            ans%=mod;
        }
        dp[level][tlow][thi][rem] = ans;
    }
    return dp[level][tlow][thi][rem];

}

int main()
{
    string n;
    cin>>n;
    r = n;
    l = "1";

    while(l.length()<r.length()) l += '0';
    reverse(all(l));
    cin>>d;
    mem(dp,-1);
    //cout<<r<<" "<<l<<endl;

    cout<<getAns(0,1,1,0)<<endl;;
}








Measured memory_bytes: 20508
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

signed main() {
	int h,w;
	std::cin >> h >> w;
	std::vector<std::vector<int> > a(h,std::vector<int>(w));
	rep(i,h) {
		rep(j,w) {
			int x;
			std::cin >> x;
			a[i][j]=x;
		}
	}
	rep(i,h) {
		rep(j,w) {
			int x;
			std::cin >> x;
			a[i][j]-=x;
		}
	}
	std::vector<std::vector<std::vector<int> > > dp(h,std::vector<std::vector<int> >(w,std::vector<int>(160*80+1))); 
	dp[0][0][std::abs(a[0][0])] = 1;
	std::vector<std::vector<int> > went(h, std::vector<int>(w,false));

	// bfs
	std::queue<std::pair<int, int> > que;
	que.emplace(0,0);
	went[0][0] = true;
	while(!que.empty()) {
		auto c = que.front(); que.pop();
		int x = c.first; int y = c.second;
		if(x+1<h) {
			if(!went[x+1][y]) {
				que.emplace(x+1,y);
				went[x+1][y]=1;
			}
			rep(con,160*80+1) {
				if(dp[x][y][con]) {
					dp[x+1][y][std::abs(con+a[x+1][y])]=1;
					dp[x+1][y][std::abs(con-a[x+1][y])]=1;
				}
			}
		}
		if(y+1<w) {
			if(!went[x][y+1]) {
				que.emplace(x,y+1);
				went[x][y+1]=1;
			}
			rep(con,160*80+1) {
				if(dp[x][y][con]) {
					dp[x][y+1][std::abs(con+a[x][y+1])]=1;
					dp[x][y+1][std::abs(con-a[x][y+1])]=1;
				}
			}
		}
	}
	int min = 1e9;
	rep(con,160*80+1) {
		if(dp[h-1][w-1][con]) {
			min = std::min(min,std::abs(con));
		}
	}
	print(min);

	return 0;
}


Measured memory_bytes: 648704
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a, b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define show(x) cout <<#x<<" = "<<(x)<<endl
#define spair(p) cout <<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout <<" "<<kbrni;cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int no = 0,two = 0,four = 0;
    rep(i,n){
        int a;
        cin >> a;
        if(a % 2 == 0){
            if(a % 4 == 0){
                four++;
            }else{
                two++;
            }
        }else{
            no++;
        }
    }
    if(no > four){
        if(no == four+1 && two == 0){
            cout << "Yes\n";
        }else{
            cout << "No\n";
        }
    }else{
        cout << "Yes\n";
    }
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define int long long
#define mii map<int,int>
#define low lower_bound
#define upp upper_bound
#define inf 1000000007 //10^9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define sort(vec) sort(all(vec));
#define rever(vec) reverse(all(vec));
#define bisea binary_search
#define unsort(vec) sort(vec); rever(vec);
#define in(a,b,vec,n) a n; cin>>n; vector<b>vec(n);
#define gcd __gcd
#define cend cout<<endl;
using namespace std;
bool pri(int p);
signed main() {
  int n,m;
  cin>>n>>m;
  int ma=-10;
  if(n==1) {
    cout<<m<<endl;
  }
  else if(pri(m)) {
    cout<<"1"<<endl;
  }
  else {
    for(int i=1;i<=m/n;i++) {
      if(m%i==0) {
        ma=max(ma,i);
      }
    }
    cout<<ma<<endl;
  }
}

bool pri(int p) {
  bool ans=true;
  if(p==1) {
   ans=false;
  }
  else {
   bool ans=0;
    for(int i=2;i<=sqrtl(p);i++) {
      if(p%i==0) {
        ans=false;
        break;
      } 
    }
   return ans;
  }
}

Measured memory_bytes: 256
n, m = map(int, input().split())
s = []
c = []
for i in range(m):
    rets, retc = map(int, input().split())
    s.append(rets)
    c.append(retc)

ans = ["-1"] * n
check = True

for i in range(m):
    if ans[s[i] - 1] == str(c[i]) or ans[s[i] - 1] == "-1":
        ans[s[i] - 1] = str(c[i])
    else:
        check = False
if n != 1 and ans[0] == "0":
    check = False
if n == 1 and ans.count("-1") == n:
    print(0)
else:
    for i in range(n):
        if ans[i] == "-1":
            if i == 0:
                ans[i] = "1"
            else:
                ans[i] = "0"

    if check:
        print(''.join(ans))
    else:
        print(-1)

Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>

using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	if (a == b)
	{
		cout << "a == b" << endl;
	}
	else if (a < b)
	{
		cout << "a < b" << endl;
	}
	else
	{
		cout << "a > b" << endl;
	}
	return 0;
}


Measured memory_bytes: 3068
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/


bool ism(char c)
{
	return c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o';
}
string enc(string s, int k)
{
	string t, res;
	t = s[0];
	FOR(i, 1, s.size())
	{
		if (ism(s[i - 1])) t += s[i];
	}
	if (t.size() > k) res = t.substr(0, k);
	else res = t;
	return res;
}
int main()
{
	cin.sync_with_stdio(false);
	int n;
	while (cin >> n, n)
	{
		vs v(n);
		REP(i, n) cin >> v[i];
		REP(k, 55)
		{
			set<string> st;
			REP(i, n)
			{
				st.insert(enc(v[i], k));
			}
			if (st.size() == n)
			{
				cout << k << endl;
				goto end;
			}
		}
		cout << -1 << endl;
	end:;
	}
	return 0;
}

Measured memory_bytes: 3204
#include<iostream>
using namespace std;
int main()
{
    int h,a,sum=0,i;
    cin>>h>>a;
    while(a--)
    {
        cin>>i;
        sum+=i;
    }
    if(sum>=h)
    {
        cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;

}


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

int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i,n) {
        cin >> v[i];
    }
    sort(v.begin(),v.end());
    double ans = v[0];
    for (int i = 1; i < n; i++) {
        ans = (ans+v[i])/2.0;
    }
    printf("%.10f\n",ans);
    return 0;
}

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

typedef long long Int;
typedef pair<int,int> PII;
typedef vector<int> VInt;
 
#define FOR(i, a, b) for(i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(i = (a) - 1; i >= (b); --i)
#define EACH(it, a) for(auto it = (a).begin(); it != (a).end(); ++it)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define SIZE(a) int((a).size())
#define ALL(a) (a).begin(),(a).end()
#define MP make_pair

void SolveTest(int test)
{
	int h1, m1, h2, m2, k;
	cin >> h1 >> m1 >> h2 >> m2 >> k;
	int t1 = h1*60 + m1;
	int t2 = h2*60 + m2;
	cout << max(0, t2 - t1 - k) << endl;
}

int main()
{
	int T, t;
	T = 1;
	FOR(t, 0, T) SolveTest(t);
	return 0;
};

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

using namespace std;

typedef long long LL;

const int N = 1010;

int main()
{
    int sum = 0, maxa = -1, n;

    cin >> n;
    for(int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        maxa = max(maxa, x);
        sum += x;
    }

    sum -= maxa;

    if(sum > maxa) puts("Yes");
    else puts("No");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

std::vector<bool> IsPrime;
void sieve(LL max){
    if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
        IsPrime.resize(max+1,true); // IsPrimeに必要な要素数を確保
    } 
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない

    for(LL i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる
        if(IsPrime[i]) // iが素数ならば
            for(LL j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                IsPrime[i*j] = false;      // 素数ではない
}


int main(){
    int Q;cin >> Q;
    sieve(100003);
    vector<int> l(Q);
    vector<int> r(Q);
    rep(i,Q)cin >> l[i] >> r[i];

    vector<int> ok(100003,0);
    rep(i,100001){
        if(IsPrime[i])if(i % 2 == 1)if(IsPrime[(i+1)/2])ok[i] = 1;
    }
    vector<LL> rui(100002,0);
    rui[0] = 0;
    rep(i,100001){
        rui[i+1] = rui[i] + ok[i+1];
    }
    rep(i,Q){
        cout << rui[r[i]] - rui[l[i]-1] << endl;
    }
}

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

using namespace std;

int main(){
	int a, b;
	string s;
	cin >> a >> a >> b >> s;
	int cnt = 0, all = 0;
	for (int i = 0; i < s.length(); ++ i){
		if (s[i] == 'b') cnt++;
		if (s[i] == 'a'){
			if (all < a + b){
				puts("Yes");
				all ++;
			}else{
				puts("No");
			}
		}
		if (s[i] == 'b'){
			if (all < a + b && cnt <= b) {
				puts("Yes");
				all++;
			}else{
				puts("No");
			}
		}
		if (s[i] == 'c'){
			puts("No");
		}
	}
}

Measured memory_bytes: 896