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

using namespace std;

#define fRead(x)        freopen(x,"r",stdin)
#define fWrite(x)       freopen (x,"w",stdout)

#define LL              long long
#define ULL             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define PI              acos(-1.0)
#define mk              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define FastRead        ios_base::sync_with_stdio(0);cin.tie(nullptr);
#ifdef VAMP
     #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template < typename Arg1 >
    void __f(const char* name, Arg1&& arg1){
        cout << name << " = " << arg1 << std::endl;
    }
    template < typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names+1, ',');
        cout.write(names, comma - names) << " = " << arg1 <<" | ";
        __f(comma+1, args...);
    }
#else
    #define debug(...)
#endif


int main()
{
    #ifdef VAMP
        clock_t tStart = clock();
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int n;
    cin >> n;
    n = n % 10;
    if(n == 0 or n == 1 or n == 6 or n == 8){
        cout << "pon\n";
    }else if(n == 3){
        cout << "bon\n";
    }else{
        cout << "hon\n";
    }


    #ifdef VAMP
        fprintf(stderr, "\n>> Runtime: %.10fs\n", (double) (clock() - tStart) / CLOCKS_PER_SEC);
    #endif
}


Measured memory_bytes: 3624
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define rep(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
#define pb push_back
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2;
	while (cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2) {
		bool xisout = false;
		bool yisout = false;
		if ((xa1<=xb1&&xb1 <= xa2) || (xb1<=xa1&&xa1 <= xb2)) {
			xisout = true;
		}
	    if((ya1 <= yb1&&yb1 <= ya2) || (yb1 <= ya1&&ya1 <= yb2))
		{
			yisout = true;
		}
		if (xisout&&yisout) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
		return 0;
}


Measured memory_bytes: 3180
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(){
  int n,k,q; cin>>n>>k>>q;
  vi p(n);
  rep(i,q){
    int a; cin>>a; a--;
    p[a]++;
  }
  rep(i,n){
    if(k+p[i]-q>0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
}


Measured memory_bytes: 3788
#include <iostream>


using namespace std;


using ll = long long;


int main()
{
    ll N, K;
    cin >> N >> K;
    for (ll i = 0; i < N; i++) {
        ll tmp;
        cin >> tmp;
    }
    if ((N - 1) % (K - 1) == 0) {
        cout << (N - 1) / (K - 1) << endl;
    } else {
        cout << (N - 1) / (K - 1)  + 1<< endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,m,h[100010],aa[100010],cnt;
int main(){
	int i,j,k,a,b;
	cin>>n>>m;
	for(i=1;i<=n;i++)cin>>h[i];
	for(i=1;i<=m;i++){
		cin>>a>>b;
		aa[a]=max(aa[a],h[b]);
		aa[b]=max(aa[b],h[a]);
	}
	for(i=1;i<=n;i++)
	if(aa[i]<h[i])cnt++;
	cout<<cnt;
	getchar();getchar();
}

Measured memory_bytes: 4416
// std::ifstream in ("input.txt");
// std::cin.rdbuf(in.rdbuf());

#include <bits/stdc++.h>
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ALL(v) v.begin(), v.end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define INF 1e9
using namespace std;
typedef long long ll;

int main() {
  // std::ifstream in ("input.txt");
  // std::cin.rdbuf(in.rdbuf());

  int a, b;
  cin >> a >> b;
  cout << max(max(a + b, a - b), a * b) << endl;

}


Measured memory_bytes: 256
import heapq

def main():
	n,m = map(int,input().split())
	res = 0
	h = []
	for i in input().split():
		heapq.heappush(h, -int(i))
	for j in range(m):
		x = heapq.heappop(h)
		y = -((-x) // 2)
		heapq.heappush(h, y)
	
	res = -sum(h)
	print(res)
	return 0;

if __name__ == "__main__":
	main()

Measured memory_bytes: 14184
#include<stdio.h>

int main(){
  char s[100], p[100];
  int i = 0, j = 0, k = 0, l = 0, ans = 1;
  scanf("%s", s);
  scanf("%s", p);
  while (1) {
    if (s[i] == '\0')
      break;
    i++;
  }
  while (1) {
    if (p[j] == '\0')
      break;
    j++;
  }

  for (k = 0; k < i; k++) {
    ans = 1;
    for (l = 0; l < j; l++) {
      if (s[(k + l) % i] != p[l]){
        ans = 0;
        break;
      }
    }
    if (ans)
      break;
  }
  if (ans)
    printf("Yes\n");
  else
    printf("No\n");
  
  return 0;
}

Measured memory_bytes: 524
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;

int main() {
	char S[20];
	int cnt = 0;
	cin >> S;
	size_t size = strlen(S);
	if (S[0] == 'A') {
		for (int i = 2; i <= size - 2; i++) {
			if (S[i] == 'C') cnt++;
		}
	}
	for (int i = 1; i < size - 1; i++) {
		if (S[i] != 'C') {
			if (S[i] >= 'a'&&S[i] <= 'z');
			else {
				puts("WA");
				return 0;
			}
		}

	}
	if (S[size - 1] >= 'a'&&S[size - 1] <= 'z');
	else cnt = 2;
	(cnt == 1) ? puts("AC") : puts("WA");

	return(0);
}

Measured memory_bytes: 256
#include <unistd.h>
#include <stdlib.h>

char ibuf[3000000];
char *ibufe = ibuf-1;

extern inline void readall(){
  int k, t = 0;
  while((k=read(STDIN_FILENO, ibuf+t, sizeof(ibuf)-t))>0) t += k;
}

int read_uint(){
  int x=0;
  while(*(++ibufe) <'0');
  do {
    x *= 10;
    x += *ibufe-'0';
  } while(*(++ibufe) >='0');

  return x;
}

char buf[40];
char *bufe = buf;

void write_uintln(long long int x){
  int i;
  static char tmp[23];
  if(x==0){
    *bufe++ = '0';
    *bufe++ = '\n';
    return;
  }

  for(i=0; x; i++){
    tmp[i] = '0' + x % 10;
    x /= 10;
  }
  for(i--; i >= 0; i--){
    *bufe++ = tmp[i];
  }
  *bufe++ = '\n';
}

extern inline void writeall(){
  int k, t = 0;
  while((k=write(STDOUT_FILENO, buf+t, bufe-buf-t))>0) t += k;
}


int n;
int A[200000];

inline void swap(int *a, int *b){
  int z;
  z = *a;
  *a = *b;
  *b = z;
}

int median(int *A, int n){
  int ll = 0;
  int rr = n;
  const int k = n/2;
  while(1){
    int i, l, r, pivot;
    swap(A+ll, A+(ll+rr)/2);
    pivot = A[ll];
    l = ll;
    r = rr;
    i = ll+1;
    while(i < r){
      if(A[i] < pivot) swap(A+l++, A+i++);
      else if(A[i] > pivot) swap(A+--r, A+i);
      else i++;
    } 
    if(k < l) rr = l;
    else if(k >= r) ll = r;
    else return pivot;
  }
}

int main(){
  int i, m;
  long long int r;
  readall();
  n = read_uint();
  for(i=0;i<n;i++){
    A[i] = read_uint()-(i+1);
  }
  m = median(A, n);
  r = 0;
  for(i=0;i<n;i++) r += abs(A[i] - m);
  write_uintln(r);
  writeall();
  return 0;
}


Measured memory_bytes: 2944
<?php
$n = trim(fgets(STDIN));
$h = explode(" ", trim(fgets(STDIN)));

$max = 0;
$tmp = 0;
for ($i = 0; $i < $n - 1; $i++) { 
    if($h[$i] >= $h[$i + 1]) {
         $tmp++;
    } else {
        if($max < $tmp) {
            $max = $tmp;
        }
        $tmp = 0;
    }
}
 if($max < $tmp) {
    $max = $tmp;
}

echo $max;

Measured memory_bytes: 14840
#include <cstdio>
using namespace std;

int main(){
	int n;
	scanf("%d", &n);
	
	int a[n];
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);
	
	for(int i = 1; i < n; i++){
		for(int i = 0; i < n; i++){
			printf("%d", a[i]);
			if(i != n - 1) printf(" ");
		}
		printf("\n");
		int temp = a[i];
		int j = i - 1;
		while(j >= 0 && a[j] > temp){
			a[j + 1] = a[j];
			j--;
		}
		a[j + 1] = temp;
	}
	
	for(int i = 0; i < n; i++){
			printf("%d", a[i]);
			if(i != n - 1) printf(" ");
		}
		printf("\n");
	
	return 0;
}

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
ll MAX_V = 1e5 + 5;
struct edge {
  ll to,cost;
  edge(ll x,ll y):to(x),cost(y){};
};

//<最短距離, 頂点の番号>using P = pair<ll, ll>;
vector<ll> dist(MAX_V); //各頂点への最短距離
void dijkstra(ll s,vector<vector<edge>>&g) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(dist.begin(),dist.begin()+g.size(), INF);
    dist[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
        P p = que.top();
        que.pop();
        ll v = p.second;
        if (dist[v] < p.first) continue;

        for (ll i=0; i<g[v].size(); i++) {
            struct edge e = g[v][i];
            if (dist[e.to] > dist[v] + e.cost) {
                dist[e.to] = dist[v] + e.cost;
                que.push(P(dist[e.to], e.to));
            }
        }
    }
}
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<vector<edge>>g(n+1);
  rep(i,0,n){
    g[i].EB((i+1)%n,1);
    g[i].EB((i*10)%n,0);
  }
  g[n].EB(1,1);
  dijkstra(n,g);
  cout<<dist[0]<<endl;
  return 0;
}

Measured memory_bytes: 9212
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


K = readint()
A, B = readnums()

for i in range(A, B + 1):
    if not i % K:
        print('OK')
        sys.exit()

print('NG')


Measured memory_bytes: 9176
#include <iostream>
#include <cstring>
#include <cstdio>
#define INF 0x3f3f3f3f
using namespace std;

const int MAXN=100010;

int main()
{
    int n;
    while (scanf("%d",&n)!=EOF) {
        bool flag=false;
        char ch;
        for(int i=1;i<=n;i++){scanf(" %c",&ch);if(ch=='Y')flag=true;}
        if(flag)cout<<"Four"<<endl;
        else cout<<"Three"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll k, x;
    cin >> k >> x;
    reps(i, x - k + 1, x + k) {
        printf("%lld%s", i, (i == (x + k - 1)) ? "\n" : " ");
    }
    return 0;
}


Measured memory_bytes: 384
#[allow(unused_imports)]
use proconio::{
    fastout, input,
};

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [u32; n],
    }
    let x = a.iter().fold(0, |s, t| s ^ t);
    println!("{}", a.iter().map(|v| (v ^ x).to_string()).collect::<Vec<_>>().join(" "));
}


Measured memory_bytes: 18556
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(i,v) for(auto &(i):(v))
#define eachr(i,v) for(auto &(i)=(v).rbegin();(i)!=(v).rend();(i)++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define endl "\n"

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b=mod-2,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a/gcd(a,b)*b;}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
    oreno_initializer() {
        cin.tie(0);
        ios::sync_with_stdio(0);
    }
} oreno_initializer;



int n, x, d, l, res = 1;

signed main() {
    cin >> n >> x;
    rep(i,n) {
        cin >> l;
        d += l;
        if (d<=x) res++;
    }
    cout << res << endl;
}


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

using namespace std;
typedef long long ll;

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
	int a, b, c, d; cin >> a >> b >> c >> d;
  	cout << (a != c) << endl;
    return 0;
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll long long
const int M=1e9+7;
#define test int t; cin>>t; while(t--)
#define f for(int i=0;i<n;i++)
#define f1 for(int i=1;i<n-1;i++)
#define read(x) ll x; cin>>x;
#define TIME  cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";

using namespace std;
/*ll gcd(ll a , ll b){return b==0?a:gcd(b,a%b);}
int combi(int n, int k)
{
    int C[k+1];
    memset(C, 0, sizeof(C));

    C[0] = 1;

    for (int i = 1; i <= n; i++)
    {
        for (int j = min(i, k); j > 0; j--)
            C[j] = C[j] + C[j-1];
    }
    return C[k];
}
int factorial(int n)
{
    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
ll power(ll x,ll n)
{
    if(n==0) return 1;
    if(n&1) return x*power(x,n/2)*power(x,n/2);
    else
        return power(x,n/2)*power(x,n/2);
}*/

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

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

/*ll mod(ll x)
{
    return ((x%M + M)%M);
}
ll add_mod(ll a,ll b)
{
    return mod(mod(a) + mod(b));
}
ll mul_mod(ll a,ll b)
{
    return mod(mod(a) * mod(b));
}*/  //modular

/*void transpose(vector<vector<ll> >& arr,ll x) {
     for (ll j = 0; j <= x; j++) // transpose
               {
                   for (ll c = j; c <= x; c++)
                   {
                       swap(arr[j][c],arr[c][j]);
                   }
               }

}*/  //transpose

int main(){

   ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t; cin>>t;
    if(t==1) cout<<0<<endl;
    else if(t==0) cout<<1<<endl;
}

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

// Problem https://atcoder.jp/contests/abc049/tasks/arc065_a

int main(void){
    string S,answer;
    vector<string> strs(4);
    answer = "YES";
    strs.at(0)="dream";
    strs.at(1)="dreamer";
    strs.at(2)="erase";
    strs.at(3)="eraser";
    cin >> S;
    reverse(S.begin(),S.end());
    for(int j=0;j<4;j++){
        reverse(strs.at(j).begin(),strs.at(j).end());
    }
/**     cout << S << endl;
    for(int j=0;j<4;j++){
        cout << strs.at(j) << " ";
    }
    cout << endl;**/
    bool cancut=true;
    for(int j=0;j<S.size();){
        bool cancutS=false;
        for(int k=0;k<4;k++){
            string checkingStr=strs.at(k);
            string checkedStr=S.substr(j,checkingStr.size());
            if(checkingStr == checkedStr){
                cancutS=true;
                j=j+checkedStr.size();}
        }
        if(cancutS == false){
            cancut=false;
            break;
        }
    }
    if(cancut){
        answer="YES";
    }
    else{
        answer="NO";
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
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;}

const int L=2019;

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

  string S;
  cin>>S;

  map<int,ll> mp;
  ll ans=0;
  mp[0]=1;
  ll sum=0;
  ll ten=1;
  for(int i=S.size()-1;i>=0;i--){
    sum=ten*(S[i]-'0')+sum;
    sum%=L;
    ten*=10;
    ten%=L;
    if(mp.count(sum)) ans+=mp[sum];
    mp[sum]++;
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 3788
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define REPE(i, a, b) for (int i = (a); i <= int(b); ++i)
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define EB emplace_back
using LL = long long;
using PII = pair<int, int>;
#define F first
#define S second

vector<int> g[100010];
int n, m;
vector<int> p, ans;

bool v[100010];
void dfs(int x) {
  v[x] = true;
  p.PB(x);
  for (int y : g[x]) if (!v[y]) {
    dfs(y);
    break;
  }
}

int main() {
  scanf("%d%d", &n, &m);
  REP(i, m) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].PB(v);
    g[v].PB(u);
  }
  v[1] = true;
  int cnt = 0;
  for (int x : g[1]) {
    if (!v[x]) {
      p.clear();
      dfs(x);
      cnt++;
      if (cnt == 1) {
        reverse(ALL(p));
        ans = p;
        ans.PB(1);
      } else if (cnt == 2) {
        for (int y : p) ans.PB(y);
      } else {
        break;
      }
    }
  }
  printf("%d\n", SZ(ans));
  REP(i, SZ(ans)) printf("%d%c", ans[i], " \n"[i + 1 == SZ(ans)]);
  return 0;
}



Measured memory_bytes: 10128
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int a1,m1,a2,m2,a3,m3;
	while(cin>>a1>>m1>>a2>>m2>>a3>>m3,a1|m1|a2|m2|a3|m3){
		int x=1,y=1,z=1;
		long long n=0,m=0,k=0,s,t;
		do{
			x=a1*x%m1;
			n++;
		}while(x!=1);
		do{
			y=a2*y%m2;
			m++;
		}while(y!=1);
		do{
			z=a3*z%m3;
			k++;
		}while(z!=1);
		s=n/__gcd(n,m)*m;
		t=s/__gcd(s,k)*k;
		cout<<t<<endl;
	}
	return 0;
}

Measured memory_bytes: 1156
import java.util.Scanner;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int num = s.nextInt();
		for(int i=0 ; i<num ; i++){
			BigInteger a = new BigInteger(s.next());
			BigInteger b = new BigInteger(s.next());
			BigInteger c = a.add(b);
			String d = c.toString();
			if(d.length()>80)
				System.out.println("overflow");
			else
				System.out.println(c);
		}
    }
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int cur = 1, res = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] == cur) {
      cur++;
    } else {
      res++;
    }
  }
  if (res == N) {
    cout << -1 << endl;
  } else {
    cout << res << endl;
  }
  return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  
  for(int i = 0; i < n; i++) {
  	cin >> p.at(i);
  }
  int ans = 0;
  for(int i = 1; i < n-1; i++) {
  	int maximum = max({p.at(i-1), p.at(i), p.at(i+1)});
  	int minimum = min({p.at(i-1), p.at(i), p.at(i+1)});
  if(p.at(i) != maximum && p.at(i) != minimum){
  	ans++;
  }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
/*https://atcoder.jp/contests/abc081/tasks/abc081_b*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
	int n, count = 0;
	cin >> n;
	long long a[n];
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		if (a[i] % 2 != 0)
		{
			cout << count;
			return 0;
		}
	}
	int flag = 0;
	do {
		for (int i = 0; i < n; i++)
		{
			if (a[i] % 2 == 0)
				a[i] /= 2;
			else
			{
				flag = 1;
				break;
			}
		}
		if (flag != 1)
			count++;

	} while (flag == 0);
	cout << count;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

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

  int A,B;
  cin >> A >> B;
  if(A+B>16 | A>8 | B>8) cout << ":(" << endl;
  else cout << "Yay!" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
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;
    }
 }    



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

int main(){
  string s,t,u;
  int a,b;
  cin >>s >>t >>a >>b >>u;
  if(s==u) a--;
  if(t==u) b--;
  cout << a << " " << b << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=10000000000000000;


int main(){
  string s;
  cin >> s;
  int ans=0;
  rep(i,4){
    if (s[i]=='2') ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
# 28
N = int(input())
An = list(map(int, input().split(' ')))

ans = -1
flag = 0
while True:
    ans += 1
    for i in An:
        if i % 2 != 0: 
            flag = 1
            break
        An[An.index(i)] /= 2
    if flag != 0: break

print(ans)

Measured memory_bytes: 9220
#!venv/bin/python

import math

K,A,B = [int(x) for x in input().split()]

num = 1
money = 0


if B - A <= 2:
    num += K
else:
    turn = K
    turn -= (A - num)
    num = A
    if turn % 2 == 0:
        add = (B - A) * int((turn / 2))
        num += add
    else:
        num += (B - A) * int(math.floor(turn / 2))
        num += 1
print(int(num))


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

int main() {
  int n,m,l;
  cin >> n >> m >> l;
  vector<vector<int>> m1(m, vector<int>(n, 0));
  vector<vector<int>> m2(l, vector<int>(m, 0));
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < m; y++) {
      cin >> m1[y][x];
      // printf("x = %d y = %d c = %d\n", x, y, m1[y][x]);
    }
  }
  for (int x = 0; x < m; x++) {
    for (int y = 0; y < l; y++) {
      cin >> m2[y][x];
    }
  }

  vector<vector<int64_t>> m3(l, vector<int64_t>(n, 0));
  for (int x = 0; x < n; x++) {
    for (int y = 0; y < l; y++) {
      for (int k = 0; k < m; k++) {
        m3[y][x] += (int64_t)m1[k][x] * m2[y][k];
        //printf("m1[%d][%d](= %d) * m2[%d][%d](= %d) = %d\n", x, k, m1[k][x], k, y, m2[y][k], m1[k][x] * m2[y][k]);
      }
      cout << m3[y][x];
      if (y < l - 1) {
        cout << " ";
      } else {
        cout << endl;
      }
    }
  }
}



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

vector<int> g[100001];
int cache[100001];
bool visited[100001];
void dfs(int node) {
	visited[node] = true;
	
	for (int i=0; i<g[node].size(); i++) {
		int nei = g[node][i];
		if(!visited[nei]) {
			dfs(nei);
		}
		cache[node] = max(cache[node], cache[nei]+1);
	}
}

int main() {
	int n,m;
	cin>>n>>m;
	for (int i=0; i<m; i++) {
		int x,y;
		cin>>x>>y;
		x--;y--;
		g[x].push_back(y);
	}
	
	for (int i=0; i<100001; i++) {
		cache[i]=0;
	}
	
	for (int i=0; i<n; i++) {
		if(!visited[i]) {
			dfs(i);
		}
	}
	int mx = 0;
	for (int i=0; i<n; i++) {
		mx = max(mx, cache[i]);
	}
	
	cout << mx;
	return 0;
}

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

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

        vector<int> v;

        for(int i=0;i<n;i++){
                int temp;
                cin>>temp;

                v.push_back(temp);
        }

        unordered_map<int,int> m;

        for(int i=0;i<n;i++){
                m[v[i]]=i+1;
        }

        for(int i=1;i<=n;i++){
                cout<<m[i]<<" ";
        }
        cout<<endl;
}

Measured memory_bytes: 5264
#include<cstdio>
#include<cmath>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
typedef long long ll;
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	int N,i;
	cin >> N;
	ll a[114514], b[114514];
	for (i = 0; i < N; i++) {
		cin >> a[i] >> b[i];
	}
	ll cnt = 0;

	for (i = N - 1; i >= 0; i--) {
		cnt += (b[i] - ((a[i] + cnt) % b[i])) % b[i];
	}
	cout << cnt << endl;
}

Measured memory_bytes: 1792
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
 
if (Number(input) === 25) {
  console.log('Christmas');
} else if (Number(input) === 24) {
  console.log('Christmas Eve');
} else if (Number(input) === 23) {
  console.log('Christmas Eve Eve');
} else {
  console.log('Christmas Eve Eve Eve');
}

Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define fore(x, a) for(auto &x : a)
#define pb push_back
#define mp make_pair
#define INF 100100100100
#define inf 2001001001
#define MOD 1000000007
#define ALL(x) begin(x),end(x)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vii = vector<int>;
using vll = vector<ll>;
template<class T>using vv = vector<T>;
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<class T>void show(const vector<T> &a) { for (int i = 0; i < (int)a.size(); ++i) cout << a[i] << (i != (int)a.size()-1 ? " " : "\n"); }
template<class T>T gcd(T a, T b){ return b ? gcd(b, a % b) : a; }
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
int dy[]={0, 1, -1, 0};
int dx[]={1, 0, 0, -1};
ll n, m;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    cin >> n >> m;
    ll ans = 0;
    vll div;
    for (ll i = 1; i * i <= m; ++i) {
      if (m % i == 0) {
        div.pb(i); div.pb(m / i);
      }
    }
    sort(ALL(div));
    rep(i, 0, div.size()) {
      if (div[i] >= n) {
        ans = m / div[i];
        break;
      }
    }
    cout << ans << endl;
    return 0;
}



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

#define pi 3.141592654
#define fix(n) cout << fixed << setprecision(n)

#define rep(i,a,b) for(int i=a;i<b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)

#define ll  long long
#define ull unsigned long long

#define mp make_pair
#define pb push_back
#define fi first
#define se second

#define vi      vector<int>
#define pii     pair<int,int>
#define piii    pair<pair<int,int>,int>
#define all(v)  v.begin(), v.end()

int mod = 1000000007;
const int N = 1005;

// gcd
ll gcd(ll a , ll b)
{
    if ( b == 0)
    return a;
    return gcd( b, a % b);
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	int x = n % 10;
	int cnt = 1;
	n /= 10;
	while ( n )
	{
		int p = n % 10;
		n /= 10;
		if ( x == p)
		{
			cnt ++;
		}
		else
			x = p, cnt = 1;
		if ( cnt == 3)
		{
			cout << "Yes\n";
			return 0;
		}

	}
	cout << "No";

	return 0;
}


Measured memory_bytes: 256
open System
               
let N,M = 
    let t = Console.ReadLine().Split()
            |> Array.map(int64)
    t.[0],t.[1]

match N,M with
| 1L,1L -> 1L
| 1L,_  -> M - 2L
| _ ,1L -> N - 2L
| _     -> (N - 2L) * (M - 2L) 
|> printfn "%i"

Measured memory_bytes: 14040
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        java.util.Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        int t = sc.nextInt();
        int c = 0;
        c = (n%x == 0)?n/x:n/x+1;
        System.out.println(c*t);
    }
}

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

int main(){
  int a, b;
  
  cin >> a >> b;
  
  if(a%3==0 || b%3==0 || (a+b)%3==0)
    cout << "Possible";
  else 
    cout << "Impossible";
  
  return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import deque

N, M = map(int, input().split())
adj = [[] for _ in range(N)]
for i in range(M):
    a, b = map(lambda x: int(x)-1, input().split())
    adj[a].append(b)
    adj[b].append(a)

def DFS(now, visited):
    if len(visited) == N:
        return 1
    else:
        count = 0
        for u in adj[now]:
            if u not in visited:
                count += DFS(u, visited+[u])
        return count


def main():
    queue = deque([0])
    visited = [0]
    ans = DFS(0, visited)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3316
n,a,b=map(int,input().split())
if not a+b-1<=n<=a*b:
  print(-1)
  exit()
n-=a
l=list()
for i in range(b,a*b+1,b):
  t=min(n,b-1)
  l+=[i-j for j in range(t+1)]
  n-=t
d=dict()
g=sorted(l)
for i,x in enumerate(g,1):
  d[x]=i
l=list(map(lambda x:d[x],l))
print(*l)

Measured memory_bytes: 46032
#include <iostream>
#include <math.h>
#include <fstream>

using namespace std;


int main(){
  int count;
  cin>> count;
  int a[count];
  for (int i=0; i<count;i++){
    cin>>a[i];
  }
  int numofi, leastsofar;
  numofi=1;
  leastsofar=a[0];
  for (int i=1; i<count;i++){
    if (a[i]<leastsofar){
      
    leastsofar=a[i];
    numofi+=1;
    
    }
    



    
  }
cout<<numofi;

}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
typedef long long ll;
typedef vector<vector<ll>> vvl;
typedef vector<ll> vl;
typedef vector<vector<char>> vvc;
typedef vector<char> vc;
typedef pair<ll,ll> pll;
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
  return x+y-max(x,y);
}


int main() {
  string s;cin >> s;ll n= s.size();
  ll cnt0=0;
  ll cnt1=0;
  rep(i,n){
    if(s[i]=='0')cnt0++;
    else cnt1++;
  }
  cout << min(cnt0,cnt1)*2 << endl;
}

Measured memory_bytes: 512
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;

#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

typedef long long ll;

int Z(int y, int x){
    return y * 4 + x;
}

string swp(string s, int a, int b){
    string ret = s;
    swap(ret[a], ret[b]);
    return ret;
}

int main(){
    map<string, int> MAP;
    // 01234567?????????????????¨????????????????????§
    string s = "01234567";
    queue<string> que;
    que.push(s);
    MAP[s] = 0;
    int vy[4] = {-1, 0, 1, 0};
    int vx[4] = {0, 1, 0, -1};
    while(!que.empty()){
        string nows = que.front();que.pop();
        int z = nows.find('0');
        int nowx = z % 4;
        int nowy = z / 4;
        FOR(i,0,4){
            int nexty = nowy + vy[i];
            int nextx = nowx + vx[i];
            if(nexty < 0 || nexty >= 2 || nextx < 0 || nextx >= 4) continue;
            string nexts = swp(nows, z, Z(nexty, nextx));
            if(MAP.count(nexts)!=0) continue;
            MAP[nexts] = MAP[nows] + 1;
            que.push(nexts);
        }
    }
    string line;
    stringstream ss;
    while(getline(cin, line)){
        ss << line;
        string t = "";
        FOR(i,0,8){
            char c;
            ss >> c;
            t += c;
        }
        cout << MAP[t] << endl;
    }
}

Measured memory_bytes: 5368
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		if(A - B >= 0) {
			System.out.println("delicious");
		} else if(B - A <= X) {
			System.out.println("safe");
		} else {
			System.out.println("dangerous");
		}
		
	}
}


Measured memory_bytes: 23252
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <climits>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

int main(int argc, char const* argv[])
{
  ll x, y;
  cin >> x >> y;
  ll res = linf;
  ll tmp = - x - y + 1;
  if(tmp >= 0)res = min(res, tmp);
  tmp = x + y + 1;
  if(tmp >= 0)res = min(res, tmp);
  tmp = x - y + 2;
  if(tmp >= 2)res = min(res, tmp);
  tmp = y - x;
  if(tmp >= 0)res = min(res, tmp);
  cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
/*input
7
5 15
1 10 16 2 7 20 12
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

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


int main(){
	int n,a,b;
	cin>>n>>a>>b;
	int cnt[3]={0};
	REP(i,n){
		int tmp;
		cin>>tmp;
		if(tmp<=a) cnt[0]++;
		else if(tmp<=b) cnt[1]++;
		else cnt[2]++;
	}
	cout<<min({cnt[0],cnt[1],cnt[2]})<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
//debug() << imie(x) imie(y);
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
int main()
{
long long a,b,c,ans;
cin>>a>>b>>c;
if((a==0 && b==0))
{cout<<"1";return 0;}
if((a%c)!=0 )
a=a-a%c+c;
b-=b%c;

if(a>b )
{cout<<"0";return 0;}
ans=(b-a)/c + 1;
cout<<ans;
return 0;
}


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

int a[100005];

int main() {
    int n;

    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    sort(a, a + n);
    
    cout << a[n / 2] - a[n / 2 - 1] << endl;

    return 0;
}


Measured memory_bytes: 640
fun main(args: Array<String>) {

    val s = readLine()!!.toInt()

    val list = mutableListOf(s)

    var n = list[0]

    var i = 1

    while (true) {
        i++

        val a = f(n)

        if (list.find { it == a } != null) {
            println(i)
            break
        }

        list.add(a)
        n = a
    }
}


fun f(n: Int): Int {
    return if (n % 2 == 0) {
        n / 2
    } else {
        3 * n + 1
    }
}

Measured memory_bytes: 33692
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N,K,C;
    string str;
    cin >> N >> K >> C >> str;
    int L[K],R[K];
    int n=0;
    for(int i=0; i<K; i++){
        while(str.at(n)!='o'){
            n++;
        }
        L[i]=n;
        n+=C+1;
    }
    n=N-1;
    for(int i=K-1; i>=0; i--){
        while(str.at(n)!='o'){
            n--;
        }
        R[i]=n;
        n-=C+1;
    }
    for(int i=0; i<K; i++){
        if(L[i]==R[i]){
            cout << L[i]+1 << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3332
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double[] x = new double[n];
        String[] y = new String[n];
        double ans = 0.0;
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextDouble();
            y[i] = sc.next();
            if(y[i].equals("BTC")) {
                ans += x[i] * 380000.0;
            } else {
                ans += x[i];
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 37384
#include <bits/stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define BUF 50
using namespace std;
ll MOD = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S;
ll ans = 0;

int main() {
	cin >> A >> B >> C;
	if (A + B >= C)cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
#include <cstring>
#include <functional>
using namespace std;
typedef pair<int,int> P;
typedef unsigned long long int ull;
#define pb push_back
#define INF 1000000000
#define fi first
#define sec second
int dist1[100100],dist2[100100];
int c[40100],d[40100];
ull dp[100100];
struct edge
{
	int to,cost;
	edge(int to,int cost):to(to),cost(cost){}
};
vector<edge> g[100100];
int comp(int x,int y)
{
	return dist1[x]<dist1[y];
}
void dijkstra(int s,int t)
{
	for(int i=0;i<100100;i++)dist1[i]=INF,dist2[i]=INF;
	dist1[s]=0,dist2[t]=0;
	priority_queue<P,vector<P>,greater<P> >q;
	q.push(P(0,s));
	while(!q.empty())
	{
		P a = q.top();
		q.pop();
		int v = a.sec;
		for(int i=0;i<g[v].size();i++)
		{
			edge e = g[v][i];
			if(dist1[e.to]>dist1[v]+e.cost)
			{
				dist1[e.to] = dist1[v]+e.cost;
				q.push(P(dist1[e.to],e.to));
			}
		}
	}
	q.push(P(0,t));
	while(!q.empty())
	{
		P a = q.top();
		q.pop();
		int v = a.sec;
		for(int i=0;i<g[v].size();i++)
		{
			edge e = g[v][i];
			if(dist2[e.to]>dist2[v]+e.cost)
			{
				dist2[e.to] = dist2[v]+e.cost;
				q.push(P(dist2[e.to],e.to));
			}
		}
	}
	return;
}
int S,R,Q;
int a,b;
int main()
{
	scanf("%d %d",&S,&R);
	for(int i=0;i<R;i++)
	{
		int u,v,w;
		scanf("%d %d %d",&u,&v,&w);
		u--;v--;
		g[u].pb(edge(v,w));
		g[v].pb(edge(u,w));
	}
	scanf("%d %d %d",&a,&b,&Q);
	a--;b--;
	dijkstra(a,b);
	/*for(int i=0;i<S;i++)
	{
		cout << dist1[i] << ' ' << dist2[i] << endl;
	}*/
	vector<int> tp;
	for(int i=0;i<S;i++)tp.pb(i);
	sort(tp.begin(),tp.end(),comp);
	//for(int i=0;i<S;i++)cout << tp[i] << ' ';
	for(int i=0;i<Q;i+=60)
	{
		memset(dp,0,sizeof(dp));
		for(int j=0;j<min(60,Q-i);j++)
		{
			cin >> c[j] >> d[j];
			c[j]--;d[j]--;
			dp[c[j]]|=(1ull<<j);
		} 
		for(int j=0;j<S;j++)
		{
			int f = tp[j];
			if(dist1[f]+dist2[f]!=dist1[b])continue;
			for(int k=0;k<g[f].size();k++)
			{
				edge e = g[f][k];
				if(dist1[e.to]+dist2[e.to]!=dist1[b])continue;
				if(dist1[e.to]!=dist1[f]+e.cost)continue;
				dp[e.to]|=dp[f];
			}
		}
		for(int j=0;j<min(60,Q-i);j++)
		{
			if(dp[d[j]]&(1ull<<j))cout << "Yes" << endl;
			else cout << "No" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 10752
#include <iostream>
#include <cmath>
#include <vector>

typedef long long ll;
int N;
ll luca[87];
using namespace std;

int main()
{
  cin >> N;
  ll ans;
  luca[0] = 2LL;
  luca[1] = 1LL;

  for(int i=2; i<=N; i++) {
    luca[i] = luca[i-1] + luca[i-2];
  }
  ans = luca[N];
  cout << ans << endl;
}

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

#define lint long long
#define P pair<int, int>


int main() {
    int N, D, X;
    cin >> N >> D >> X;
    int A[N];

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

    int ans = X;
    
    for(int i = 0; i < N; ++i){
        ans += (D - 1) / A[i] + 1;
    }


    cout << ans << endl;
}

Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn main() {
    let n: u32 = read();
    let v: Vec<i32> = read_vec();
    let ans = run(v, 0);
    println!("{}", ans);
}
fn run(i: Vec<i32>, count: i32) -> i32 {
    if i.iter().all(|x| x % 2 == 0) {
        run(i.iter().map(|x| x / 2).collect(), count + 1)
    } else {
        count
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<double,double> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;

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

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const double PI = 4*atan(1);
const ll INF = 1e18;
const int MX = 100001;

vi res[6];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    FOR(i,1,30001) res[i%6].pb(i);
    
    int n; cin >> n;
    if (n == 3) {
        cout << "2 5 63";
        return 0;
    } else if (n == 4) {
        cout << "2 5 20 63";
        return 0;
    } else if (n == 5) {
        cout << "2 3 4 6 9";
        return 0;
    }
    int t = 20000;
    while (t > n) {
        if (t-n == 1) {
            res[0].pop_back();
            t --;
        } else {
            if (sz(res[0]) >= max(sz(res[2]),sz(res[3]))) {
                res[0].pop_back(); res[0].pop_back();
            } else if (sz(res[3]) >= max(sz(res[2]),sz(res[0]))) {
                res[3].pop_back(); res[3].pop_back();
            } else {
                res[2].pop_back(); res[4].pop_back();
            }
            t -= 2;
        }
    }
    F0R(i,6) if (__gcd(i,6) != 1) for (int j: res[i]) cout << j << " ";
}

// read the question correctly (is y a vowel?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?)

Measured memory_bytes: 640