akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>
int cmp(const int *a,const int *b){
  return *b - *a;
}

int main(){
  int n,h;
  scanf("%d%d",&n,&h);
  int a,b[n],max=0;
  for(int i=0;i<n;i++){
    scanf("%d%d",&a,&b[i]);
    if(a>max)max=a;
  }
  qsort(b,n,4,cmp);
  int cnt=0,sum=0;
  for(int i=0;i<n;i++){
    if(b[i]>max&&sum<h){
      sum+=b[i];
      cnt++;
    }else break;
    if(sum>=h)break;
  }
  //printf("%d %d\n",cnt,sum);
  if(sum<h){
    cnt+=(h-sum+max-1)/max;
  }
  printf("%d\n",cnt);
  return 0;
}

Measured memory_bytes: 892
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderB
{
    static void Main()
    {
        var sc = new Scanner();

        decimal a = (decimal)sc.NextLong();
        double b = sc.NextDouble();
        decimal c = (decimal)(b * 100);

        decimal answer = a * c / 100;

        Console.WriteLine((long)answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

int main()
{
	string s;
	cin >> s;
	for (int i = 0; i < s.length() - 1; i++)
	if (s[i] == 'A' && s[i + 1] == 'C')
	{
		cout << "Yes";
		return 0;
	}
	cout << "No";
	return 0;
}

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

const int MOD = (int)1e9 + 7;
struct mint { int n; mint(int n=0):n(n){ } operator int(){return !!this->n;} };
mint operator+(mint a, mint b) { return (a.n += b.n) >= MOD ? a.n - MOD : a.n; }
mint operator-(mint a, mint b) { return (a.n -= b.n) < 0 ? a.n + MOD : a.n; }
mint operator*(mint a, mint b) { return 1LL * a.n * b.n % MOD; }
mint operator*(mint a, int b) { return 1LL * a.n * b % MOD; }
bool operator!=(mint a, mint b) { return a.n != b.n; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }
ostream &operator<<(ostream &os, mint a) { return os << a.n; }

int main() {
    string s; cin >> s;
    int n = s.length();
    vector<vector<mint>> dp(n + 1, vector<mint>(2, 0));
    dp[0][0] = 1;
    for (int i = 0; i < n; i++) {
        dp[i + 1][1] += dp[i][1] * 3;
        if (s[i] == '0') {
            dp[i + 1][0] += dp[i][0];
        } else {
            dp[i + 1][1] += dp[i][0];
            dp[i + 1][0] += dp[i][0] * 2;
        }
    }
    cout << dp[n][0] + dp[n][1] << endl;
    return 0;
}

Measured memory_bytes: 5760
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }

void main() {
  readln();
  auto A = readln.split.to!(ulong[]).sort();

  void solve() {
    bool[ulong] exists;
    foreach(l; A) {
      if (l in exists) {
        writeln("NO");
        return;
      }
      exists[l] = true;
    }
    writeln("YES");
  }

  solve();
}


Measured memory_bytes: 25592
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
vector<int> A;
vector<int> odd,even;
int main(){
	scanf("%d",&N);
	A.resize(N);
	for(int i=0;i<N;i++)scanf("%d",&A[i]);
	vector<int> zip = A;
	sort(all(zip));
	for(int i=0;i<N;i++)A[i]=lower_bound(all(zip),A[i])-zip.begin();
	for(int i=0;i<N;i++){
		if(i%2==0)even.pb(A[i]);
		else odd.pb(A[i]);
	}
	sort(all(odd));
	sort(all(even));
	for(int i=0;i<odd.size();i++)A[i*2+1]=odd[i];
	for(int i=0;i<even.size();i++)A[i*2]=even[i];
	//for(int i=0;i<N;i++)printf("%d ",A[i]);
	//puts("");
	ll ans = 0;
	for(int i=0;i<N;i++){
		if(i%2!=A[i]%2)ans++;
	}
	printf("%lld\n",ans/2);
	return 0;
}

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

int main()
{
	int w,a,b;
	cin>>w>>a>>b;
	if((a+w>=b and a+w<=b+w) or (a>=b and a<=b+w))
	{
		cout<<"0"<<endl;
		return 0;
	}
	if(a+w<b)cout<<b-(a+w)<<endl;
	if(a>b+w)cout<<a-(b+w)<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
int main(){
	int a,b,c;scanf("%d%d%d",&a,&b,&c);
	if(a==b&&b==c)printf("Yes\n");else printf("No\n");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    int n;
    cin >> n;
    vector<int> arr(n, 0);
    for(int& val: arr)
        cin >> val;
    int s = accumulate(arr.begin(), arr.end(), 0);
    int ans = s;
    for(int i = 0; i < n; i++) {
        s -= arr[i]*2;
        ans = min(ans, abs(s));
    }
    cout << ans << endl;
    return 0;
}




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

int main(void)
{
	for(string num; cin >> num, num != "0"; ) {
		int sum = 0;

		for(int i = 0; i < num.length(); i++)
			sum += num[i] - '0';
	
		cout << sum << endl;
	}

	return 0;
}

Measured memory_bytes: 1188
#include <iostream>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 5;

int n;
int num[MAXN], cnt;
LL ans;
bool hav0 = false;

int main() {
	ios :: sync_with_stdio(false); cin.tie(NULL);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> num[i];
		if (num[i] < 0) cnt++;
		if (num[i] == 0) hav0 = true;
	}
	if (cnt % 2 == 0) {
	    for (int i = 1; i <= n; i++) {
		    ans += (num[i] < 0 ? -num[i] : num[i]); 
		}
		cout << ans << endl;
		return 0;
	} else if (hav0) {
		for (int i = 1; i <= n; i++) {
			ans += (num[i] < 0 ? -num[i] : num[i]);
		}
		cout << ans << endl;
		return 0;
	} else {
		int num1 = -1e9, pos1 = 0, num2 = 1e9, pos2 = 0;
		for (int i = 1; i <= n; i++) {
			if (num[i] < 0 && num[i] > num1) num1 = num[i], pos1 = i;
			if (num[i] > 0 && num[i] < num2) num2 = num[i], pos2 = i;
		}
		if (num2 > -num1) {
			for (int i = 1; i <= n; i++) {
				if (i == pos1) ans += num[i];
				else ans += (num[i] < 0 ? -num[i] : num[i]);
			}
		} else {
			for (int i = 1; i <= n; i++) {
				if (i == pos2) ans += -num[i];
				else ans += (num[i] < 0 ? -num[i] : num[i]);
			}
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main ()
{
  string s;
  string t;
  cin>>s>>t;
  int n=s.length();
  for (int i = 0; i < n; ++i)
  {
    if (s==t) {
      cout<<"Yes"<<endl;
      return 0;
    }
    rotate (s.begin(),s.begin()+1,s.end());
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

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

static const double EPS = 1e-8;

int path[101][101];

int dijkstra(int s,int g,int n){
	int d[101];
	bool used[101];
	memset(d,0x3f,sizeof(d));
	memset(used,0,sizeof(used));
	d[s] = 0;
	
	while(1){
		int v=-1;
		for(int u=1;u<=n;u++){
			if(!used[u] && (v==-1 || d[u] < d[v])) v=u;
		}

		if(v==-1) break;

		used[v] = true;

		for(int u=1;u<=n;u++){
			d[u] = min(d[u],d[v] + path[v][u]);
		}
	}

	return d[g];
}

int main(){
	int n,k;

	while(~scanf("%d %d",&n,&k)){
		if(n==k && k==0) break;
		memset(path,0x3f,sizeof(path));
		for(int i=0;i<k;i++){
			int ch;
			scanf("%d",&ch);
			if(ch){
				int a,b,val;
				scanf("%d %d %d",&a,&b,&val);
				path[a][b] = path[b][a] = min(val,path[a][b]);
			}
			else{
				int a,b,res;
				scanf("%d %d",&a,&b);
				res = dijkstra(a,b,n);
				printf("%d\n",res > INF ? -1 : res);

			}
		}
	}
}

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

int main(){
    string s;
    cin >> s;
    ll n = s.size();
    ll c = 0;
    vector<ll> cnt(n, 0);
    for(ll i=0; i<n-1; i++){
        c++;
        if(s[i+1] != s[i]){
            if(s[i] == 'R'){
                cnt[i] = c;
                c = 0;
            }else{
                cnt[i-c+1] = c;
                c = 0;
            }
        }
    }

    cnt[n-1-c] = c+1;

    ll i = 0;
    while(i < n){
        if(cnt[i] != 0){            
            ll base = (ll)((cnt[i] + cnt[i+1])/2);
            if((cnt[i] + cnt[i+1])%2 == 0){
                cout << base << " " << base << " ";
            }else{
                if(cnt[i] > cnt[i+1]){
                    if(cnt[i]% 2 == 0){
                        cout << base << " " << base + 1 << " ";
                    }else{
                        cout << base + 1 << " " << base << " ";
                    }
                }else{
                    if(cnt[i+1]% 2 == 0){
                        cout << base+1 << " " << base << " ";
                    }else{
                        cout << base << " " << base+1 << " ";
                    }
                }
            }
            i+=2;
        }else{
            cout << "0 ";
            i++;
        }
    }
    cout << endl;
    return 0;
}

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

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

  if(N % 500 == 0){
    cout << "Yes" << endl;
  }
  else if(N % 500 != 0 && N % 500 <= A){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}


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

using namespace std;

int c[555], s[555], f[555];

int main(void) {

    int n;
    cin>>n;

    for(int i = 0; i < n-1; ++i) {
        cin>>c[i]>>s[i]>>f[i];
    }

    for(int i = 0; i < n-1; ++i) {
        int time = 0;
        for(int j = i; j < n-1; ++j) {
            if(s[j] >= time) {
                time += s[j]-time;
                time += c[j];
                continue;
            } else {
                int k = time/f[j];
                if(time%f[j] != 0)  k++;
                int wait = (k)*f[j] - time;
                time += wait;
                time += c[j];
            }
        }
        cout<<time<<"\n";
    }

    cout<<"0";

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] data = new int[5];
		for ( int i = 0; i < 5; i++ )
			data[i] = sc.nextInt();
		Arrays.sort(data);
		System.out.println(data[4]+" "+data[3]+" "+data[2]+" "+data[1]+" "+data[0]);
	}
}

Measured memory_bytes: 0
/* Great things never come from comfort zones,
"whatever the mind of a man can conceive and believe,it can achieve." */
 
#include <bits/stdc++.h>
#define ll long long
#define scf(n) scanf("%d",&n)
#define lscf(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define rep(i,ini,n) for(int i=ini;i<(int)n;i++)
#define pb push_back
#define pf push_front
#define mp make_pair
#define F first
#define S second
#define all(x)     x.begin(),x.end()
#define tc   int tt; scf(tt); while(tt--)
#define inf INT_MAX
#define ninf INT_MIN
#define gcd __gcd
#define bitcount(n) __builtin_popcount(n)
typedef double dd;
using namespace std;
const ll mod =1e9+7;
const int N = 1e6+7;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B) 
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...) cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

bool m[N]={0};


int main()
{
  string s;
  cin>>s;

  vector<char>v;

  rep(i,0,s.size())
  {
      if(s[i]!='B')
        v.pb(s[i]);

      else if(!v.empty())
        v.pop_back();
  }

  for(auto it:v)
    cout<<it;

  
}

Measured memory_bytes: 3608
#include<iostream>

using namespace std;
int n;
int bfs(int now,int d){
	int ans=0;
	if(d==4){
	if(now==n)return 1;
	else return 0;
	}
	else{
	for(int i=0;i<10;i++)ans+=bfs(now+i,d+1);
	}
	return ans;
}

int main(){
	while(cin>>n)cout<<bfs(0,0)<<endl;
}

Measured memory_bytes: 1156
#include<stdio.h>

int main(){
	int W, H, x, y, r;
	scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
	if (r <= x && (x + r) <= W){
		if (r <= y && (y + r) <= H){
			printf("Yes\n");
		}
		else{
			printf("No\n");
		}
	}
	else{
		printf("No\n");
	}

}


Measured memory_bytes: 2000
#include<stdio.h>
#include <iostream>
#include <cmath>
using namespace std;

double pi = acos(-1);

int main()
{
    int d;
    while (cin >> d){
        int i;
        unsigned long long sum = 0;
        for (i = 0; i < 600; i += d){
            sum += i*i;
        }
        cout << sum*d << endl;
    }
}

Measured memory_bytes: 1148
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main(){
int N; 
cin >> N; 
int a[314], b[314], c[314], d[314]; 
for(int i = 0; i < N; i++){ 
cin >> a[i] >> b[i]; 
}
for(int i = 0; i < N; i++){ 
cin >> c[i] >> d[i]; 
}
int p[314], q[314]; 
for(int i = 0; i < N; i++){
p[i] = 201 * a[i] + b[i]; 
}
sort(p, p + N);
int x[314], y[314]; 
for(int i = 0; i < N; i++){
x[i] = p[i] / 201; 
y[i] = p[i] % 201; 
}
for(int i = 0; i < N; i++){
q[i] = 201 * d[i] + c[i]; 
}
sort(q, q + N);
int z[314], w[314]; 
for(int i = 0; i < N; i++){
w[i] = q[i] / 201; 
z[i] = q[i] % 201; 
}

int count = 0; 
for(int i = N-1; i >= 0; i--){
int L = upper_bound(w, w+N, y[i]) - w; 
for(int j = L; j < N; j++){
if(z[j] > x[i]) {
  z[j] = -1;
  count ++;
  break;  
  }
 }
}
cout << count << endl; 
}


Measured memory_bytes: 256
import java.util.Scanner;

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

		//プログラムはここに記入

		if(num>=30) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}

		scan.close();
	}
}


Measured memory_bytes: 35660
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define INF 1e16
#define MOD 1000000007
ll dx[]={1,0,-1,0};
ll dy[]={0,1,0,-1};
ll n0,m0;
ll dp[3005][3005]={0};
bool valid(string v1[],ll x,ll y)
{
    return (x<n0&&y<m0&&v1[x][y]=='.');
}
ll fun(string v1[], ll x,ll y)
{
    
    if(dp[x][y]!=-1) return dp[x][y];
    if(!valid(v1,x,y)) return 0;
    ll a,b,c;
    c=0;
    for(int i=0;i<2;i++)
    {
        a=x+dx[i];
        b=y+dy[i];
        c=(c+fun(v1,a,b)) % MOD;
    }
    dp[x][y]=c;
    return dp[x][y];
    
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,b,c,d,e,f,n,m,k,t,q;
    t=1;
    //cin>>t;
    while(t--)
    {
        cin>>n>>m;
        n0=n,m0=m;
        string v1[n];
        memset(dp,-1,sizeof(dp));
        for(int i=0;i<n;i++)
        {
            cin>>v1[i];
        }
        dp[n-1][m-1]=1;
        
        a=fun(v1,0,0);
        cout<<a;
        
    }
    return 0;
}


Measured memory_bytes: 71936
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=0,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  IN2(n,m);
  Yes(n==m);
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#define ll long long
using namespace std;
bool teamcheck(ll k,vector<ll>a,vector<ll>f,ll c) {
	ll syugyou=0;
	for (ll i = 0; i < a.size(); i++) {
		syugyou +=max( a[i] - c/f[i] , (ll)(0));
	}
	if (syugyou > k) {
		return false;
	}
	return true;
}

int main() {
	ll n, k;
	cin >> n >> k;
	vector<ll>a(n);
	vector<ll>f(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (ll i = 0; i < n; i++) {
		cin >> f[i];
	}
	sort(a.begin(), a.end(), greater<ll>());
	sort(f.begin(), f.end());
	
	ll left=0,right=pow(10,12)+1;
	while (left <= right) {
		if (teamcheck(k,a,f,(left+right)/2)) {
			right = (left + right) / 2-1;
		}
		else {
			left= (left + right) / 2+1;
		}
	}
	cout<<left<<endl;
}

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

int main(){
    int n,m,x,a,l=0,r=0;
    cin>>n>>m>>x;
    for(int i=0;i<m;i++){
        cin>>a;
        if(a<x)l++;
        else r++;
    }
    cout<<min(l,r)<<endl;
}


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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

void solve() {
    //const i64 mod = 1'000'000'007;
    i64 K,A,B;
    cin >> K >> A >> B;
    if(B-A<=2){
        print("case1");
        cout << 1+K << endl;
        return;
    }

    // B-A>=3

    if(1+(K-2)<A){
        print("case2");
        cout << 1+K << endl;
        return;
    }

    // 1+(K-2)>=A

    K-=A-1;
    print(K);
    if(K%2==0){
        print("case3");
        cout << A+(B-A)*(K/2) << endl;
        return;
    }else{
        print("case4");
        cout << A+(B-A)*((K-1)/2)+1 << endl;
        return;
    }
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
n, a, b = map(int, input().split())
total = 0
tmp = 0
for i in range(n+1):
    i2 = [int(x) for x in list(str(i))]
    for s in list(i2):
        tmp += int(s)
    if(a<=tmp and tmp<=b):
        total+=i
    tmp = 0
print(total)

Measured memory_bytes: 3060
a = input()
b = input()
relsa = {}
relsb = {}
possible = True
for i in range(len(a)):
  if a[i] not in relsa:
    relsa[a[i]] = b[i]
  else:
    if relsa[a[i]] != b[i]:
      possible = False
  if b[i] not in relsb:
    relsb[b[i]] = a[i]
  else:
    if relsb[b[i]] != a[i]:
      possible = False
      
if possible:
  print("Yes")
else:
  print("No")

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    long long a, b, c;
    cin >> a >> b >> c;
    cout << min(min((c % 2) * a * b, (b % 2) * a * c), (a % 2) * b * c);
    return 0;
}


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

int main() {
	string S;
	cin >> S;
	string s = "CODEFESTIVAL2016";
	int count = 0;
	for (int i = 0;i < S.size();++i) {
		if (S[i] != s[i]) {
			count += 1;
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

const ll mod = 1000000007;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

struct combination {
  std::vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

ll n, m;
ll a[100010];
std::map<ll, ll> mp;
std::vector<ll> p;
combination comb( 100010 );

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

  rep( i, n+1 )
    std::cin >> a[i], --a[i], ++mp[a[i]];

  rep( i, n ) if( mp[i] > 1 )
    m = i;

  rep( i, n+1 ) if( a[i] == m )
    p.emplace_back( i );

  repi( k, 1, n+2 )
  {
    mint ans = comb( n+1, k );

    ans -= comb( p[0]+n-p[1], k-1 );

    std::cout << ans.x << std::endl;
  }

  return 0;
}

Measured memory_bytes: 9984
#include <bits/stdc++.h>
#define pii pair<int, int>
#define ss second
#define ff first
#define all(x) ((x).begin(), (x).end())

using namespace std;
using ll = long long;

const int mod = 1e9 + 7;
const ll oo = 1e14;
const double PI = 3.14159265;

ll exp(ll a, ll b){
    ll ans = 1;

    while (b){
        if (b&1){
            ans = (ans*a)%mod;
        }
        a = (a*a)%mod;
        b >>= 1;
    }
    return ans;
}

ll combina(ll a, ll b){
    ll lim = max(b, a-b), ini = min(b, a-b);
    ll ans = 1;
    for (ll x = a; x>lim; x--) ans = (ans*x)%mod;

    for (ll x = 2; x <=ini; x++) ans = (ans*exp(x, mod-2))%mod;
    return ans;
}


int main(){
    ios_base::sync_with_stdio(false);
    int a = 0 , b =0, x, y;
    cin >> x >> y;

    while (x > 0 || y > 0){
        if ( x >= y){
            x-=2;
            y-=1;
            a++;
        }
        else {
            x-=1;
            y-=2;
            b++;
        }
    }

    if (x != 0 || y != 0){
        cout << "0" << endl;
        return 0;
    }

    cout << combina(a+b, b) << endl;
    return 0;
}

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

int main(){
  int n,k; cin>>n >>k;
  long long a[n],ans=INT_MAX;
  for(int i=0;i<n;i++)cin>>a[i];
  for(int i=0;i<n-k+1;i++){
    long long cost=0,cost2=0;
    cost=abs(a[i])+abs(a[i]-a[k+i-1]);
    cost2=abs(a[k+i-1])+abs(a[i]-a[k+i-1]);
    ans=min({ans,cost,cost2});
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <regex>

#define rep(i, n) for(int i=0;i<(int)(n);i++)

using namespace std;

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

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

string _;
string S;

int main() {
    cin >> _ >> S;
    printf("A%cC\n", S[0]);
}



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

int main()
{
	long n,m;
	cin >> n >> m;
	long h[n+1];
	long a[m+1];
	long b[m+1];
	long nlog[n];
	rep(i, n)
	{
		nlog[i] = i;
		cin >> h[i];
	}
	rep(i,m)
	{
		cin >> a[i] >> b[i];
		if (h[a[i]] <= h[b[i]])
			nlog[a[i]] = -1;
		if (h[b[i]] <= h[a[i]])
			nlog[b[i]] = -1;
	}
	long cnt = 0;
	rep(i, n)
	{
		if (nlog[i] != -1)
			cnt++;
	}
	cout << cnt << endl;
	return (0);
}

Measured memory_bytes: 6688
n, a, b = map(int, input().split())

mod = 10 ** 9 + 7

ret = pow(2, n, mod) - 1

def comb(n, r) :
  ret = 1
  for i in range(n - r + 1, n + 1) :
    ret *= i
    ret %= mod
  for i in range(1, r + 1) :
    ret *= pow(i, mod - 2, mod)
    ret %= mod
  return ret

ret -= comb(n, a)
ret -= comb(n, b)

print(ret % mod)

Measured memory_bytes: 40048
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;

int main(){
	int length[3];
	int w = 0, x = 0, y = 0, z = 0;

	while(cin >> length[0] >> length[1] >> length[2]){
		sort(length, length+3);

		if(length[2] < length[0] + length[1]){
			w++;
			if(pow(length[2], 2) == pow(length[0], 2) + pow(length[1], 2)) y++;
			else if(pow(length[2], 2) < pow(length[0], 2) + pow(length[1], 2)) z++;
			else x++;
		}
		else {
			cout << w << ' ' << y << ' ' << z << ' ' << x << endl;
			break;
		}
	}

}

Measured memory_bytes: 1176
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
int n,m;
vector<int>factor;
int main(){
	cin>>n>>m;factor.push_back(1); 
	for(int i=2;i*i<=m;i++)if(m%i==0)factor.push_back(i);
	for(auto x:factor){
		if(x>=n){
			cout<<m/x<<endl;
			return 0;
		}
	}
	reverse(factor.begin(),factor.end());
	for(auto x:factor){
		if(m/x>=n){
			cout<<x<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! {
        a: usize,
        b: usize,
        t: usize,
    }
    let t = t * 10 + 5;
    let a = a * 10;
    let mut sum = 0;
    if a > t {
        println!("{}", sum);
        return;
    }
    let mut i = 1;
    loop {
        if a * i < t {
            sum += b;
            i+=1;
        } else {
            println!("{}", sum);
            return;
        }
    }
}

Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <algorithm>


using namespace std;



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

    vector<vector<int>> A(n, vector<int>(m, 0));

    for (int row = 0; row < n; ++row)
        for (int col = 0; col < m; ++col)
            cin >> A[row][col];

    vector<int> x(m, 0);

    for (int i = 0; i < m; ++i)
        cin >> x[i];
    

    vector<int> ans(n, 0);

    for (int row = 0; row < n; ++row)
        for (int col = 0; col < m; ++col)
            ans[row] += A[row][col] * x[col];

    for (auto a : ans)
        cout << a << endl;

    
    return 0;
} 

Measured memory_bytes: 3168
import math
import sys
A, B = map(int, input().split())

if A == 1 or B == 1:
    print(1)
    sys.exit()


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lis_a = prime_factorize(A)
lis_b = prime_factorize(B)
lis_a.append(1)
lis_b.append(1)
ans = len(set(lis_a) & set(lis_b))
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
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;}

int main() {
    ll n;
    cin >> n;
    vector<pair<int,int>>prime;
    for(ll i = 2;i*i<=n;i++) {
        if(n%i == 0) {
            int cnt = 0;
            while(n%i==0) {
                cnt++;
                n /= i;
            }
            prime.push_back(make_pair(i,cnt));
        }
    }
    if(n != 1) prime.push_back(make_pair(n,1));
    int ans = 0;
    for(auto p : prime) {
        int tmp = 0;
        int lim = p.second;
        for(ll i = 1;i*(i+1)<=2*lim;i++) {
            tmp++;
        }
        ans += tmp;
    }
    cout << ans << endl;
}



Measured memory_bytes: 3588
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */
int main() {
  
  lint n, k; cin >> n >> k;
  vector<lint> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
  }

  int cur = 0;
  for (lint j = 0; j < 62; j++) {
    if (k & (1LL << j)) cur = a[cur];
    vector<lint> na(n);
    for (int i = 0; i < n; i++) {
      na[i] = a[a[i]];
    }
    swap(a, na);
  }

  cout << cur + 1 << endl;
  return 0;
}



Measured memory_bytes: 6728
#include <iostream>
#include <iomanip>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)

int main()
{

    int a, b, c;
    cin >> a >> b >> c;
    cout << (a <= c && c <= b || b <= c && c <= a ? "Yes" : "No") << endl;
    return 0;
}

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

typedef priority_queue<int> maxHeap;
typedef priority_queue<int, vector<int>, greater<int>> minHeap;
#define endl "\n"
#define int long long
#define MOD 1000000007
#define ump unordered_map
#define pb push_back
#define mp make_pair
#define pie acos(-1)
#define max(x, y) ((x > y) ? x : y)
#define min(x, y) ((x < y) ? x : y)
#define mid(s, e) ((s + (e - s) / 2))

bool test_cases;

struct precompute {
    void compute() {
    }
};

void init(bool k) {
    test_cases = k;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

struct test_cases {
    void test_case(int test) {
        string s;
        cin >> s;
        int i = 0;
        int sum = 0;
        while(i != s.length()) {
            int dig = s[i] - 48;
            sum += dig;
            i++;
        }

        if(sum % 9 == 0) {
            cout << "Yes" << endl;
            return; 
        }

        cout << "No" << endl;
    }
};

int32_t main() {
    init(false);
    int tc;
    if (test_cases) {
        cin >> tc;
    } else {
        tc = 1;
    }
    struct precompute l;
    l.compute();
    for (int i = 0; i < tc; i++) {
        struct test_cases o;
        o.test_case(i + 1);
    }
    return 0;
};

Measured memory_bytes: 3732
while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == "?":
        break
    elif op == "-":
        s=a-b
        print(s)
    elif op == "*":
        s=a*b
        print(s)
    elif op == "/":
        s=a//b
        print(s)
    elif op == "+":
        s=a+b
        print(s)  


Measured memory_bytes: 5596
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

int main(){
	int n,m,v,a[100],b[100],g;
	
	while(1){
		cin >> n >> m ;
		if((n==0)&&(m==0)){
			return 0;
		}
		for(int i=0;i<m;i++){
			a[i]=0;
			b[i]=i+1;
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				cin >> v;
				a[j]+=v;
			}
		}
		for(int i=1;i<n;i++){
			for(int j=0;j<m-i;j++){
				if(a[j]<a[j+1]){
					g=a[j]; a[j]=a[j+1]; a[j+1]=g;
					g=b[j]; b[j]=b[j+1]; b[j+1]=g;
				}
			}
		}
		for(int j=0;j<m;j++){
			if(j!=0){
				cout << " " ;
			}
			cout << b[j] ;
		}
		cout << "\n" ;
	}
	
	
return 0;
}

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

const int size=1001;
unsigned long int dp[size][size];
char matrix[size][size];
int main()
{
	std:ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	unsigned long div=1000000007;	
	int row,col;
	cin>>row>>col;
	
	for(int i=0;i<row;i++)
		for(int j=0;j<col;j++){
			cin >> matrix[i][j];
		}
		
	for(int i=0;i<=row;i++)
		for(int j=0;j<=col;j++)
			dp[i][j]=0;
	
	dp[1][1]=1;
	
	for(int i=1;i<=row;i++){
		for(int j=1;j<=col;j++)
		{
			if(matrix[i-1][j-1]!='#'){
				dp[i][j]+=dp[i-1][j]+dp[i][j-1];
				dp[i][j]=dp[i][j]%div;
			}
			else 
				dp[i][j]=0;
		}
	}
		
	cout<<dp[row][col]<<endl;
	return 0;
}

Measured memory_bytes: 9088
#include <algorithm>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <limits>

using namespace std;



int main(int argc, char* argv[]) {
    constexpr int N = 2019;

    int L, R;
    cin >> L >> R;

    // check  L <= k * N  <=R
    int min = numeric_limits<int>::max();
    for (int k=N; k<=R; k+=N) {
        if (L<=k && k<=R) {
            cout << 0;
            return 0;
        }
    }

    L = L % N;
    R = R % N;

    for (int i=L; i<=R-1; i++) {
        for (int j=i+1; j<=R; j++) {
            int r = i * j % N;
            if (r<min) {
                min = r;
            }
        }
    }
    cout << min;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <string>
#include <algorithm>
#define CHAR_NUM 80
using namespace std;

int main(void) {
    string str;
    int i, j;
    
    while(getline(cin,str)) {
        for(i = 0; ;i++) {
            for(j = 0; str[j]; j++) {
                if(isalpha(str[j])) {
                    str[j]++;
                    if(str[j] > 'z')
                        str[j] -= 26;
                }
            }
            if(str.find("this") != string::npos || str.find("that") != string::npos || str.find("the") != string::npos) {
                cout << str << endl;
                break;
            }
        }
    }
    return(0);
}

Measured memory_bytes: 1184
#include <iostream>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    if(a==1)a=14;
    if(b==1)b=14;
    if(a>b){
        cout<<"Alice"<<endl;
    }
    else if(b>a){
        cout<<"Bob"<<endl;
    }
    else if(a==b){
        cout<<"Draw"<<endl;
    }
    }


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

int main(){
  int x[3000], y[3000], i=0;
 
  while(1){
    cin >> x[i] >> y[i];
    if(x[i]==0 && y[i]==0) break;
    else i++;
  }

  for(int j = 0; j < i; j++){
    if(x[j] < y[j] || x[j] == y[j]){
      cout << x[j] << " " << y[j] << endl;
    }
    else{
      cout << y[j] << " " << x[j] << endl;
    }
  }

  return 0;
}

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

typedef long long ll;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const ll INF = 1<<21;
// static const ll MOD = 1e9 + 7;

bool compPair(const pair<int, int>& arg1, const pair<int, int>& arg2) {
    return arg1.first > arg2.first;
}

int main(void) {
    ll a, b, c;
    cin >> a >> b >> c;

    ll left, right;
    left = 4*a*b;
    right = a*a+b*b+c*c-2*a*c-2*b*c+2*a*b;

    if(c>a+b) {
        if(left<right) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    else {
        cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#define int long long
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define mi(N) int N; cin >> N;
#define ms(s) string s; cin >> s;
#define md(d) double d; cin >> d;
#define mv(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

template<typename T>
void say(vector<T> s, char r) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << r << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("yes");
	else say("no");
}

void Yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

void YN(bool b) {
	if (b)say("YES");
	else say("NO");
}

void Yay(bool b) {
	if (b)say("Yay!");
	else say(":(");
}

template<typename T>
void maxi(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T& a, T b) {
	a = min(a, b);
}

void exact_say(double x) {
	cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}

template<typename T>
vector<vector<T>> fill_vector(int h, int w, T val) {
	vector<vector<T>> ret;
	vector<T> v(w, val);
	rep(h)ret.push_back(v);
	return ret;
}

template<typename T>
T maxi(vector<T> v) {
	T ret = v[0];
	Rep(1, v.size())maxi(ret, v[i]);
	return ret;
}

template<typename T>
T mini(vector<T> v) {
	T ret = v[0];
	Rep(1, v.size())mini(ret, v[i]);
	return ret;
}

signed main() {
	mi(a);
	mi(b);
	mi(c);
	if (a < c && c < b)Yn(true);
	else if (b < c && c < a)Yn(true);
	else Yn(false);
}

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

int main() {
  int A, B, K;
  cin >> A >> B >> K;

  int cnt = 0;
  for (int i = 100; i > 0; --i) {
    if ((A % i == 0) && (B % i == 0)) cnt++;

    if (cnt == K) {
      cout << i << endl;
      break;
    }
  }
}


Measured memory_bytes: 256
# AOJ 2831: Check answers
# Python3 2018.7.12 bal4u

n = int(input())
if n == 0: print(0)
else:
	s = input()
	ans = 1; pre = s[0]
	for t in s[1:]:
		if pre == 'x' and t == 'x': break
		pre = t; ans += 1
	print(ans)



Measured memory_bytes: 5788
#include <iostream>

int main()
{
	int r, c;
	std::cin >> r >> c;

	int table[101][101] = { 0 };

	for (int i = 0; i < r; i++) {
		for (int j = 0; j < c; j++) {
			std::cin >> table[i][j];
			table[i][c] += table[i][j];
			table[r][j] += table[i][j];
			table[r][c] += table[i][j];
		}
	}

	for (int i = 0; i <= r; i++) {
		for (int j = 0; j < c; j++) {
			std::cout << table[i][j] << " ";
		}
		std::cout << table[i][c] << std::endl;
	}
}

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

using namespace std;

int main () {
  int N, M; cin >> N >> M;
  vector<int> num(N);
  
  for (int i = 0; i < M; i++) {
    int a, b; cin >> a >> b;
    
    num.at(a-1) += 1;
    num.at(b-1) += 1;
  }
  
  for (int i = 0; i < N; i++) {
    cout << num.at(i) << endl;
  }
}

Measured memory_bytes: 256
L=[[0 for j in range(3)] for i in range(3)]
for i in range(3):
  c=list(map(int,input().split()))
  L[i]=c
if L[0][0]-L[1][0]==L[0][1]-L[1][1]==L[0][2]-L[1][2] and L[0][0]-L[2][0]==L[0][1]-L[2][1]==L[0][2]-L[2][2]:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 9048
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
#include<climits>
#include<stack>
#include<unordered_map>
#include<map>
#include<set>

#define loopi(x,y) for(int i = x;i<(y);i++)
#define rloopi(x,y) for(int i = x;i>=(y);i--)
#define rloopj(x,y) for(int j = x;j>=(y);j--)
#define loopj(x,y) for(int j = x;j<(y);j++)


#define nl cout<<"\n";
#define ll long long int
using namespace std;
#define mod  1000000007


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

	int n, W;
	cin >> n >> W;
	vector<int> w(n);
	vector<int> v(n);
	ll max_val = 0;

	loopi(0, n)
	{
		cin >> w[i] >> v[i];
		max_val += v[i];
	}

	vector<int> dp(max_val + 1, 1000000001);
	dp[0] = 0;
	loopj(0, n)
	{
		rloopi(max_val, v[j])
		{
			dp[i] = min(dp[i - v[j]] + w[j], dp[i]);

		}
	}

	int ans;
	rloopi(max_val, 0)
	{
		if (dp[i] <= W)
		{
			ans = i;
			break;
		}
	}

	cout << ans;
	return 0;
}

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

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s, t;
	cin >> s >> t;

	int a[30] = {0};
	int b[30] = {0};
	n = s.size();

	rep(i, n){
		a[s[i] - 'a'] += 1;
		b[t[i] - 'a'] += 1;
	}

	sort(a, a+26);
	sort(b, b+26);

	f = 1;

	rep(i, 27){
		if(a[i] != b[i]) f = 0;
	}

	if(f) cout << "Yes";
	else cout << "No";


}

Measured memory_bytes: 776
x,n = map(int,input().split())
if n ==0:
    print(x)
    exit()
p = set(list(map(int,input().split())))
s = {i for i in range(-5,102)}
kouho = s.difference(p)
sa = float('inf')
ans = float('inf')
for i in kouho:
    if sa > (abs(i-x)):
        sa = abs(i-x)
        ans = i

print(ans)


Measured memory_bytes: 9196
#!/usr/bin/env python3
import sys
from math import *
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7

a,b,x=map(int,input().split())

d = degrees(atan(2*((b-(x/(a**2)))/a)))
if d>=degrees(atan(b/a)):
    d=degrees(atan(1/(2*x/a/b/b)))
print(d)
# print(degrees(atan(2*((b-(x/(a**2)))/a))))
# print(degrees(atan(2*((a-(x/(b**2)))/b))))


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

// @author: pashka

int main() {
    ios::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;
    vector<int> a(n + 1);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int t = 0; t < k; t++) {
        vector<int> aa(n + 1);
        for (int i = 0; i < n; i++) {
            int l = max(i - a[i], 0);
            int r = min(i + a[i], n - 1);
            aa[l]++;
            aa[r + 1]--;
        }
        for (int i = 1; i <= n; i++) {
            aa[i] += aa[i - 1];
        }
        if (aa == a) {
            break;
        }
        a = aa;
    }
    for (int i = 0; i < n; i++) {
        cout << a[i] << " ";
    }
    cout << "\n";

    return 0;
}

Measured memory_bytes: 4884
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define all(a) (a).begin(), (a).end()


int main(){
    int A, B;
    cin >> A >> B;
    cout << 6 - A - B << endl;
}


Measured memory_bytes: 3488