akhauriyash/Code-Regression huggingface dataset:
open Base
open Stdio

let () =
  match In_channel.input_line In_channel.stdin with
  | None -> failwith "cannot read input"
  | Some k -> let k = Int.of_string k in
    match In_channel.input_line In_channel.stdin with
    | None -> failwith "cannot read input"
    | Some x -> let length = String.length x in
      if length <= k
      then print_endline x
      else print_endline ((String.sub x ~pos:0 ~len:k) ^ "...")



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

int main()
{
    int D;
    cin >> D;
    
    if (D == 25) {
        cout << "Christmas" << endl;
    }else if (D == 24) {
        cout << "Christmas Eve" << endl;
    }else if (D == 23) {
        cout << "Christmas Eve Eve" << endl;
    }else{
        cout << "Christmas Eve Eve Eve" << endl;
    }
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string str = Console.ReadLine();
		int N = int.Parse(str);
		int min = 999999;
		for(var i=1;i<=N/2;i++){
			int count = 0;
			count += i/100000;
			count += (i/10000) % 10;
			count += (i/1000) % 10;
			count += (i/100) % 10;
			count += (i/10) % 10;
			count += i%10;
			int j = N-i;
			count += j/100000;
			count += (j/10000) % 10;
			count += (j/1000) % 10;
			count += (j/100) % 10;
			count += (j/10) % 10;
			count += j%10;
			min = Math.Min(min,count);
		}
		Console.WriteLine(min);
	}
}

Measured memory_bytes: 11092
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF (1LL<<60)
#define MOD1 1000000007
#define MAX_N (1 << 17)


void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
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;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{
    ll aa;
    ll bb;
}frequent;
ll h,w;

int main(void){
    // char ;
    scanf("%lld%lld",&h,&w);
    // ll [n];
    char s[h][w];
    rep(i,0,h){
        scanf("%s",s[i]);
    }
    // ll dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
    ll d[5]={1,0,-1,0,1};
    ll mk;
    rep(i,0,h){
        rep(j,0,w){
            if(s[i][j]=='#'){
                mk=0;
                rep(k,0,4){
                    if(s[i+d[k]][j+d[k+1]] == '#' ){
                        mk=1;
                        break;
                    }
                }
                if(mk==0){
                    printf("No\n");
                    return 0;
                }
            }
        }
    }
    printf("Yes\n");
    return 0;
}


Measured memory_bytes: 128
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x*x; }

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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18



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

	int cnt = 0;
	for (int i = 0; i < s.size(); i++) cnt += s[i] == 'E';

	int mi = INF;

	int now = 0;

	//左端から順番にみていく。
	//それより右側にあるEの数は、全体のEの数と等しい。
	//* abcd
	//*bcd
	//EをまたぐたびにEを減らしていけば現在位置より右にあるEの数はわかる。
	//Wの数を記録する変数を用意する。

	for (int i = 0; i< s.size(); i++) {
		//i番目の人間をリーダーにする。
		//リーダーは計算に含まないので、もしリーダーがEだったら
		//Eの残りの数を1減らしておく。
		//リーダーより右にあるWの数と、リーダーより左にあるEの数を足して
		//値を比較更新する。
		cnt -= s[i] == 'E';
		mi = min(mi, cnt + now);

		//更新後にiはずれるのでWならWのカウントを増やす。
		now += s[i] == 'W';
	}

	cout << mi << endl;

	return 0;
}

Measured memory_bytes: 900
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

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

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

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    bool solve() {
        input();
        string s;
        cin >> s;
        if (s == "#") return false;
        string left = "qwertasdfgzxcvb";
        set<char> leftset;
        for (char c : left) {
            leftset.insert(c);
        }

        int ans = 0;
        int state = -1;

        for (char c : s) {
            int nstate = !!(leftset.count(c));
            if (state == -1) state = nstate;
            else if (state != nstate) {
                ans++;
                state = nstate;
            }
        }
        cout << ans << endl;
        return true;

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    while (Solve().solve()) {};


    return 0;
}



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

using namespace std;
#define int long long
#define endl '\n'


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

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n; cin >> n;
    cout << 360 / gcd(360, n) << endl;
    return 0;
}


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

int main() {
    string s; cin >> s;
    int count = 0;
    for (int i=0; i<s.size(); i++) {
        if (s[i] == '+') count++;
        else count--;
    }

    cout << count << endl;

    return 0;
}


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

string s;

lli q3n(lli x, lli n){
    while(n--) x/=3;
    return x;
}

int main(void){
    cin >> s;
    lli ans = 0;
    for(int d = 3; d <= s.size(); d++){
        string t(d, '0');
        rep(j, pow(3, d)){
            int a, b, c;
            a = b = c = 0;
            rep(k, d){
                int r = q3n(j, k)%3;
                if(r == 0){
                    t[k] = '3';
                    a++;
                }else if(r == 1){
                    t[k] = '5';
                    b++;
                }else{
                    t[k] = '7';
                    c++;
                }
            }
            if(a > 0 && b > 0 && c > 0 && stoll(t) <= stoll(s)){
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4100
#include <stdio.h>

int factorize(long long n, int p[], int m[])
{
	int i, k;
	for (i = 2, k = 0; i * i <= n; i++) {
		if (n % i != 0) continue;
		p[k] = i;
		for (m[k] = 0; n % p[k] == 0; m[k]++, n /= p[k]);
		k++;
	}
	if (n > 1) {
		p[k] = n;
		m[k++] = 1;
	}
	return k;
}

int main()
{
	long long X;
	scanf("%lld", &X);
	
	int i, j, k, p[101], m[101], l[101] = {};
	long long A, B, C, Y = 1, Z = X;
	k = factorize(X, p, m);
	while (l[k] == 0) {
		for (B = 0; B > -Y; B--) {
			A = B + Y;
			if ((long double)A * A * (A * A + A * B + B * B) + (long double)B * B * B * (A + B) > (long double)Z * 2) continue;
			C = A * A * (A * A + A * B + B * B) + B * B * B * (A + B);
			if (C == Z) {
				printf("%lld %lld\n", A, B);
				fflush(stdout);
				return 0;
			}
		}
		for (B = 1; 1; B++) {
			A = B + Y;
			if ((long double)A * A * (A * A + A * B + B * B) + (long double)B * B * B * (A + B) > (long double)Z * 2) break;
			C = A * A * (A * A + A * B + B * B) + B * B * B * (A + B);
			if (C == Z) {
				printf("%lld %lld\n", A, B);
				fflush(stdout);
				return 0;
			} else if (C > Z) break;
		}
		for (B = -Y; 1; B--) {
			A = B + Y;
			if ((long double)A * A * (A * A + A * B + B * B) + (long double)B * B * B * (A + B) > (long double)Z * 2) break;
			C = A * A * (A * A + A * B + B * B) + B * B * B * (A + B);
			if (C == Z) {
				printf("%lld %lld\n", A, B);
				fflush(stdout);
				return 0;
			} else if (C > Z) break;
		}
		
		for (i = 0; i < k && l[i] == m[i]; i++);
		for (l[i]++, Y *= p[i--]; i >= 0; l[i--] = 0) {
			for (j = 0; j < m[i]; j++) Y /= p[i];
		}
		Z = X / Y;
	}
}

Measured memory_bytes: 1688
#include <iostream>
#include <iomanip> 
#include <cstdlib>
#include <cmath>
#include<map>
#include<string.h>
#include <algorithm>
#include <bits/stdc++.h> 
#include<vector>
 
using namespace std;
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define vi vector<int>
#define vb vector<bool>
#define vs vector<string>
#define vl vector<long long int>
//#define viadj[n+1] vector<int>adj[n+1] 
#define sortA(arr)   sort(arr.begin(),arr.end())
#define sortC(arr,n)   sort(arr,arr+n,comparefunc())
#define search(arr,c)  binary_search(arr.begin(),arr.end(),c)
#define pb   push_back
#define ll long long
#define LCM(a,b) boost::math::lcm(a,b)
#define mp make_pair
#define pll pair<long long int,long long int>
 vb isprime(1e7+1,true);
 
struct node{
     ll lenght;};
        
void Sieve(ll maxn){ 
    ll j;isprime[0]=isprime[1]=false;
    rep(i,2,sqrt(maxn)+1)
    {
        if(isprime[i]){
            for(j=i*i;j<=maxn;j+=i){
                isprime[j]=false;
            }
        }
    }
} 
 struct comparefunction{
bool operator()(const pll c,const pll d)const{
    ll lenc=c.second-c.first+1;
    ll lend=d.second-d.first+1;
    if(lenc!=lend)
    return lenc>lend;
    else
    return c.first<d.first;
   
     
}};
 
  
 
   void dfs(ll v,vb visited,vi adj[]) {
    visited[v] = true;
 
    
    for (int u : adj[v]) {
       if (!visited[u])
            dfs(u,visited,adj);
    }
   
    
}
 
 ll modpow(ll x, ll n,ll p){
     if(n==0)
     return 1;
     if(n==1)
     return x%p;
     if(n%2==0)
     return (modpow(x,n/2,p)%p)*(modpow(x,n/2,p)%p);
     else
     return (x%p)* (modpow(x,n/2,p)%p)*(modpow(x,n/2,p)%p);
 }
 
 
 
int main()
{
    
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 
   
    ll check1=0,check2=0,check3=0;
    ll counti=0, i=0,j;
    ll sum=0,count=0,t,k,q,l,r;ll s;
  // cin>>t;
  //while(t--){
  ll m,n;check1=0;ll x;
cin>>n;
vl h(n+1);
rep(i,1,n+1)
cin>>h[i];
vi dp(n+1);
dp[1]=0;
if(n>=2)
dp[2]=abs(h[2]-h[1]);
rep(i,3,n+1)
dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
cout<<dp[n];


//}
    
}
  



 
   
 
 

Measured memory_bytes: 2688
#include<stdio.h>

void sort(int a[],int n){
  int i,j,t;
  for(i=0;i<n;i++){
    for(j=n-1;j>i;j--){
      if(a[j]<a[j-1]){
        t=a[j];
        a[j]=a[j-1];
        a[j-1]=t;
      }
    }
  }
}



int main(void)
{
  int i,n,s=0;
  int a[1000];

  scanf("%d",&n);
  for(i=0;i<2*n;i++)
    scanf("%d",&a[i]);

  sort(a,2*n);

  for(i=0;i<2*n;i+=2)
    s+=a[i];

  printf("%d\n",s);

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE( cout << #x" = " << x << endl)
#define PRINT(x) TRACE(printf(x))
#define WATCHR(a, b) TRACE( for(auto c = a; c != b;) cout << *(c++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})
#define rep(i, a, b) for(int i = (a); (i) < (b); ++(i))
#define trav(a, x) for(auto& a : x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) static_cast<int>(x.size())
#define mp make_pair
#define fi first
#define se second

using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

void buff() { ios::sync_with_stdio(false); cin.tie(nullptr); }

constexpr ll MOD = 1e9 + 7;

inline ll pow_mod(ll a, ll b, ll mod = MOD) {
    ll res = 1; a %= mod; assert(b >= 0);
    for(;b;b>>=1) {
        if(b & 1) res = (res * a) % mod;
        a = (a * a) % mod;
    }
    return res;
}

template<typename T> inline void remin(T& x, const T& y) { x = min(x, y); }
template<typename T> inline void remax(T& x, const T& y) { x = max(x, y); }

template<typename T> ostream& operator<<(ostream &os, const vector<T>& v) {
    os << "{"; string sep; for(const auto& x : v) os << sep << x, sep = ", "; return os << "}"; 
}

template<typename T, size_t size> ostream& operator<<(ostream& os, const array<T, size>& arr) {
    os << "{"; string sep; for(const auto& x : arr) os << sep << x, sep = ", "; return os << "}"; 
}

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

int main() {
    buff();
    string s, t;
    cin >> s >> t;
    int S = sz(s);
    int T = sz(t);
    int best = T; 
    for(int i = 0; i + T - 1 < S; ++i) {
        int chg = 0;
        for(int j = 0; j < T; ++j) {
            chg += (t[j] != s[i + j] ? 1 : 0);
        }
        remin(best, chg);
    }
    cout << best << '\n';
    return 0;
}



Measured memory_bytes: 3640
#include <stdio.h>
#include <math.h>
#define max(a,b) (a)>=(b)?(a):(b)
int main(){
int a,b,c,k;
  scanf("%d%d%d%d",&a,&b,&c,&k);
  int ans=max(a*pow(2,k)+b+c,max(a+c+b*pow(2,k),a+b+c*pow(2,k)));
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 256
//Heaplax
//别让自己后悔
#include<bits/stdc++.h>
#define N 100001
#define int long long
#define LOG(x) cerr<<#x<<" = "<<x<<endl
#define add_edge(u,v) nxt[++cnt]=head[u],head[u]=cnt,to[cnt]=v
#define open(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
char ch;bool fs;void re(int& x)
{
	while(ch=getchar(),ch<33);
	if(ch=='-')fs=1,x=0;else fs=0,x=ch-48;
	while(ch=getchar(),ch>33)x=x*10+ch-48;
	if(fs)x=-x;
}
using namespace std;
int n,L,T,id=1,x[N],w[N],y[N];
main()
{
	re(n);
	re(L);
	re(T);
	for(int i=1;i<=n;++i)
	{
		re(x[i]),re(w[i]);
		if(w[i]==1)
		{
			y[i]=(x[i]+T)%L;
			id-=(x[i]+T)/L;
		}
		else
		{
			y[i]=(x[i]-T%L+L)%L;
			id+=(L-1+T-x[i])/L;
		}
	}
	sort(y+1,y+n+1);
	id=(id%n+n)%n;
	if(!id)id=n;
	for(int i=1;i<=n;++i,id=id%n+1)
		x[id]=y[i];
	for(int i=1;i<=n;++i)
		printf("%lld\n",x[i]);
}


Measured memory_bytes: 3584
def main():
    N=int(input())
    A=[int(_) for _ in input().split()]
    M=1000
    for i in range(N-1):
        stock = 0
        if A[i]<A[i+1]:
            stock=M//A[i]
        M+=(A[i+1]-A[i])*stock
    print(M)

main()

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

int main(){

  int x,y,z,t;

  cin >> x >> y >> z;

  if (y > z){

  	t=z;
  	z=y;
    y=t;

  } 

  if (x > y){

  	t=y;
  	y=x;
  	x=t;

  }
  
  if (y > z){

  	t=z;
  	z=y;
    y=t;

  }   

  cout << x <<" "<< y <<" "<< z << endl;

 
  return 0;

}

Measured memory_bytes: 3072
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U>
inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U>
inline void cmin(T& a, U b) { if (a > b) a = b; }

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    cerr << fixed << setprecision(15);
  }
} io_setup;

constexpr char el = '\n';

template<class T, class U>
ostream &operator<<(ostream &os, const pair<T, U>& p) {
  os << p.first << " " << p.second;
  return os;
}
template<class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.first >> p.second;
  return is;
}
template<class T>
ostream &operator<<(ostream &os, const vector< T > &v) {
  rep(i, v.size())
    os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template<class T>
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}
#line 2 "a2.cpp"

int main() {
  ll n = 3;
  vl a(n);
  cin >> a;
  ll sum = 0;
  rep(i, n) {
    sum += a[i];
  }

  if (a[0] == a[1] and a[1] == a[2]) {
    if (a[0]%2 == 1) {
      cout << 0 << el;
    } else {
      cout << -1 << el;
    }
    return 0;
  }

  ll ans = 0;
  while (1) {
    bool f = 0;
    rep(i, n) {
      f |= a[i]%2 == 1;
    }
    if (f) break;

    rep(i, n) {
      a[i] = (sum-a[i])/2;
    }
    ans++;
  }
  cout << ans << el;
}


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

int main() {
  int n;
  cin >> n;
  
  int i;
  if(n%1000) i=(n/1000)+1;
  else		 i=n/1000;
  
  cout << i*1000-n << endl;
  
  return 0;
}

Measured memory_bytes: 3596
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int n,k;
  cin >> n >> k;

  vector<int> a(n);
  REP(i,n) cin >> a[i];
  
  int ans = 0;
  REP(i,n) if(a[i]>=k) ans++;
  
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
package main

import (
	"fmt"
	"sort"
)

func calc_gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return calc_gcd(b, a%b)
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func main() {
	var n int
	fmt.Scan(&n)
	xs := make([]int, n)
	for i := range xs {
		fmt.Scan(&xs[i])
	}

	gcd := xs[0]
	for _, x := range xs {
		gcd = calc_gcd(gcd, x)
	}

	for i := range xs {
		xs[i] /= gcd
	}

	sort.Sort(sort.Reverse(sort.IntSlice(xs)))
	v1 := xs[0]
	modifiable := true
	for _, x := range xs {
		v := calc_gcd(v1, x)
		if modifiable && v == 1 {
			modifiable = false
			continue
		}
		v1 = v
	}

	v2 := xs[1]
	for _, x := range xs[1:] {
		v2 = calc_gcd(v2, x)
	}

	fmt.Println(max(v1, v2) * gcd)
}


Measured memory_bytes: 5504
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        InputStream in = System.in;
        OutputStream out = System.out;
        FastScanner fs = new FastScanner(in);
        PrintWriter pw = new PrintWriter(out);
        int A = fs.nextInt(), B = fs.nextInt(), C = fs.nextInt();
        if(A * C <= B) {
            pw.println(C);
        } else {
            pw.println(B / A);
        }
        pw.close();
    }
}

class FastScanner {

    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
 
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }
 
    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                    throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }
 
    public long nextLong() {
        return Long.parseLong(next());
    }
 
    public int nextInt() {
        return Integer.parseInt(next());
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
 
    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }
 
    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        return a;
    }
 
}


Measured memory_bytes: 21204
#n = int(input())
n, k = map(int, input().split())
al = list(map(int, input().split()))
#al=[list(input()) for i in range(n)]
dic = {i: False for i in range(1, n+1)}
tel = [1]
bef = 1
tempInd = 1
while True:
    nex = al[bef-1]
    if dic[nex] == False:
        dic[nex] = tempInd
        tel.append(nex)
        bef = nex
        tempInd += 1
    else:
        lastind = dic[nex]-1
        break
tel.remove(1)
if len(tel) >= k:
    ans = tel[k-1]
else:
    repnum = len(tel)-lastind
    k -= len(tel)
    ans = tel[(k-1) % repnum + lastind]
print(ans)


Measured memory_bytes: 41016
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
    int n,r;
  while(1){
   cin>>n>>r;
   if(n==0||r==0)return 0;
   V<int> a(n);
   for(int i=0;i<n;i++)a[i]=i+1;
   reverse(all(a));
   int p,c;
   for(int i=0;i<r;i++){
       V<bool> used(n,false);
       V<int> tmp;
       cin>>p>>c;
       for(int j=p-1;j<p+c-1;j++){
            tmp.push_back(a[j]);
            used[j]=true;
       }
       for(int j=0;j<n;j++)if(!used[j])tmp.push_back(a[j]);
       a=tmp;
   }
   cout<<a[0]<<endl;
  }
}


Measured memory_bytes: 3068
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long tmp =  (long) Math.pow((b-1),(a-1));
        if (tmp == 0) System.out.println(b);
        else System.out.println((int)b*tmp);
    }
}

Measured memory_bytes: 9808
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>

using namespace std;

/* エラトステネスのふるい

   O(n log log n) だいたい線形。 10万とかは余裕
*/
template<typename T>
std::vector<T> sieve(T n)
{
    std::vector<T> primes;
    std::vector<bool> is_prime(n, true);
    is_prime[0] = is_prime[1] = false;

    for (T i = 2; i <= n; ++i) {
        if (is_prime[i]) {
            primes.push_back(i);
            for (T j = 2 * i; j <= n; j += i) {
                is_prime[j] = false;
            }
        }
    }
    return primes;
}

int main()
{
    int64_t N;
    std::cin >> N;

    auto primes = sieve<int64_t>(55555);

    std::vector<int64_t> ans;
    for (auto itr = primes.begin(); ; ++itr) {
        if (*itr % 5 == 1) {
            ans.push_back(*itr);
            if (ans.size() == N) {
                break;
            }
        }
    }

    for (auto e: ans) {
        std::cout << e << " ";
    }
    std::cout << std::endl;

    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
using namespace std;
using vint = vector<int>;
using ll = long long;
using vll = vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int main() {
    int n; cin >> n;
    vint d(n);
    rep(i, n) cin >> d[i];
    sort(all(d));
    int bd = 0, cnt = 0;
    rep(i, n) {
        if(bd < d[i]) {
            cnt++;
            bd = d[i];
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define X first
#define Y second
#define pie 3.14159265358979323846
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;


template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int mod =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}
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;
}

ll RS(ll N,ll P,ll M){
    if(P==0){
        return 1;
    }else{
        if(P%2==0){
            ll t=RS(N,P/2,M);
            return t*t%M;
        }else{
            return N*RS(N,P-1,M)%M;
        }
    }
}
bool greater_pair(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first!=b.first){
        return a.first>b.first;
    }else{
        return a.second>b.second;
    }
}
int main() {
    ios::sync_with_stdio(false);
    double A,B,X;
    cin>>A>>B>>X;
    double S=X/A;
    double ans;
    if(S>=(double)A*B/2){
        double h=(A*B-S)*2/A;
        ans=atan2(h,A);
        ans=ans/(2*acos(-1))*360;
    }else{
        double h=2*S/B;
        ans=atan2(B,h);
        ans=ans/(2*acos(-1))*360;
    }
    Sp(ans);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define per(i,n) for(int i = n-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
const long long mod = 998244353LL;

ll fac[220000];
ll finv[220000];
ll inv[220000];

ll modpow(ll n, ll p, ll m) {
  if(p==0) return 1LL;
  if(p%2==0) {
    ll t = modpow(n, p/2, m);
    return t * t % m;
  }
  return n * modpow(n, p-1, m) % m;
}

void compre() {
  fac[0] = fac[1] = 1LL;
  finv[0] = finv[1] = 1LL;
  inv[1] = 1LL;
  for(ll i = 2LL; i<(ll)220000; i++) {
    fac[i] = fac[i-1] * i % mod;
    inv[i] = mod - inv[mod%i] * (mod/i) % mod;
    finv[i] = finv[i-1] * inv[i] % mod;
  }
}

long long modcom(long long n, long long k) {
  if(n<k) return 0;
  if(n<0 || k<0) return 0;
  return fac[n] * (finv[k] * finv[n-k] % mod) % mod;
}

int main() {
  ll N, M, K;
  cin >> N >> M >> K;
  compre();
  ll ans = 0LL;
  for(ll i = 0LL; i<=(ll)K; i++) {
    ll tmp = 1LL;
    ll c = i;
    tmp *= M;
    tmp %= mod;
    ll a = modpow(M-1,N-c-1,mod);
    a %= mod;
    tmp *= a;
    tmp %= mod;
    ll b = modcom(N-1,c);
    b %= mod;
    tmp *= b;
    tmp %= mod;
    ans += tmp;
    ans %= mod;
  }
  ans %= mod;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 8796
#include<stdio.h>
int main(void)
{
long long a,b,m,n,k,gcd,lcm;
  
  while(scanf("%lld %lld",&a,&b)!=EOF)
    {
      k=1;
      m=a;
      n=b;
      while(k!=0)
	{
	  k=m%n;
	  m=n;
	  n=k;
	}
      gcd=m;
      
      lcm=a*b/gcd;
      
      printf("%lld %lld\n",gcd,lcm);
      
    }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main()
{
 int r,d,x ;
 cin>>r>>d>>x;
 int res = r*x-d ;
 cout<<res<<endl ;
 for (int i=0 ; i<9 ; i++){
    res=res*r-d ;
     cout << res<<endl ;
 }
  return 0 ;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

ll ret;
int N, M, Q;
vector<vector<int>> v;
int w[15];

void solve(int ii, int mn){
  if(ii >= N){
    //rep(i,N) cout << w[i] << " "; cout << endl;

    ll score = 0;
    rep(i,Q){
      if(w[v[i][1]] - w[v[i][0]] == v[i][2]) score += v[i][3];
    }
    ret = max(ret, score);
    return;
  }

  REP(i,mn,M+1){
    w[ii] = i;
    solve(ii+1, i);
  }
}

int main(){
  cin >> N >> M >> Q;
  rep(i,Q){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    a--;
    b--;
    v.push_back({a,b,c,d});
  }

  ret = 0;

  solve(0, 1);
  
  cout << ret << endl;
  
  return 0;
}



Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define irep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
int main() {
    int w,a,b;
    cin>>w>>a>>b;
    int ans=0;
    if(a+w<b) ans=b-a-w;
    if(b+w<a) ans=a-b-w;
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int n,m,a;
  int sum=0;
  scanf("%d %d",&n,&m);
  for(int loop=0;loop<m;loop++){
    scanf("%d",&a);
    sum+=a;
  }
  if(n<sum){
    printf("-1");
  }else{
    printf("%d",n-sum);
  }
  return 0; 
}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin>>a;
  if(a==111)cout<<3<<endl;else{
  if(a%3==0)cout<<0<<endl;
  else{if(a%3==1)cout<<1<<endl;else{if(a%3==2)cout<<2<<endl;}}}
 
}

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


#define SIZE 200005


ll fact[SIZE],inv_fact[SIZE];

ll mod_pow(ll x,ll count, ll mod){

	if(count == 0)return 1;
	ll ret = mod_pow((x*x)%mod,count/2,mod);
	if(count%2 == 1){

		ret = (ret*x)%mod;
	}
	return ret;
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}


int main(){

	fact[0] = 1;
	for(ll i = 1; i < SIZE; i++){
		fact[i] = i*fact[i-1];
		fact[i] %= MOD;
	}
	inv_fact[SIZE-1] = mod_inverse(fact[SIZE-1],MOD);
	for(ll i = SIZE-1; i >= 1; i--){

		inv_fact[i-1] = inv_fact[i]*i;
		inv_fact[i-1] %= MOD;
	}

	ll N,A,B;
	scanf("%lld %lld %lld",&N,&A,&B);

	ll ans = mod_pow(2,N,MOD);
	ans -= 1;
	if(ans < 0){

		ans += MOD;
	}

	ll mult = N;
	for(ll i = 1; i < A; i++){

		mult *= (N-i);
		mult %= MOD;
	}
	mult *= inv_fact[A];
	mult %= MOD;

	ans -= mult;
	if(ans < 0){

		ans += MOD;
	}

	mult = N;
	for(ll i = 1; i < B; i++){

		mult *= (N-i);
		mult %= MOD;
	}
	mult *= inv_fact[B];
	mult %= MOD;

	ans -= mult;
	if(ans < 0){

		ans += MOD;
	}

	printf("%lld\n",ans);

	return 0;
}


Measured memory_bytes: 3328
#include <stdio.h>
#define N 1000
int main()
{
  int n,v,i,j,k;
  int A[N];
  
  scanf("%d",&n);
  
  for(i=0; i<n; i++)
    {
      scanf("%d",&A[i]);
    }
  for(i=0;i<n;i++){
    v = A[i];
    j = i-1;
    while(j>=0&&A[j]>v){
      A[j+1]=A[j];
      j--;
    }
    
    A[j+1]=v;
    
    for(k=0; k<n; k++)
      {
	printf("%d",A[k]);
	if(k<n-1)
	  printf(" ");
      }
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 2060
package main

import (
    "fmt"
    "bufio"
    "os"
)

func main(){
    r := bufio.NewReader(os.Stdin)
    var n, m int
    
    fmt.Fscan(r, &n, &m)
    
    if n < m {
        fmt.Println("a < b");
    } else if n > m {
        fmt.Println("a > b");
    } else {
        fmt.Println("a == b");
    }
    
}


Measured memory_bytes: 1124
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(Arr.length!=0){
   var result=[];
   var NT=(Arr.shift()).split(" ").map(Number);
   for(var i=0;i<NT[0];i++){
      var arr=(Arr.shift()).split(" ");
      var a=arr[0].split(":").map(function(v){return parseInt(v,10);});
      if(i>0){
         var A=a[0]*60+a[1];
         var B=b[0]*60+b[1];
         if(A-B>=NT[1])result.push(c+" "+(A-B));
      }
      var b=arr[2].split(":").map(function(v){return parseInt(v,10);});
      var c=arr[3];
   }
   console.log(result.length);
   result.forEach(function(v){
      console.log(v);
   });
}

Measured memory_bytes: 7648
import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String N = sc.next();
if((N.charAt(0) == N.charAt(1) && N.charAt(0) == N.charAt(2)) || (N.charAt(3) == N.charAt(1) && N.charAt(3) == N.charAt(2))){
System.out.println("Yes");
} else {
System.out.println("No");
}
}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define fast std::ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
using namespace std;

void solve(){
    fast
      int a,b;
      cin>>a>>b;
      cout<<(a-1)*(b-1);

    
}
int main()
{
    solve();
    return 0;
}


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

int i,stk,x[3];
char tex[1000000],code[1000000];
char encode[64][6]={
"11010",
"",
"",
"",
"",
"",
"",
"11110",
"",
"",
"",
"",
"11100",
"11101",
"11011",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"11111",
"",
"00000",
"00001",
"00010",
"00011",
"00100",
"00101",
"00110",
"00111",
"01000",
"01001",
"01010",
"01011",
"01100",
"01101",
"01110",
"01111",
"10000",
"10001",
"10010",
"10011",
"10100",
"10101",
"10110",
"10111",
"11000",
"11001",
"",
"",
"",
"",
""}
,decode[30000000];

int main(){
	decode[212]=' ';
	decode[111111]='\'';
	decode[111122]=',';
	decode[21121112]='-';
	decode[121112]='.';
	decode[111112]='?';
	decode[211212]='A';
	decode[21122121]='B';
	decode[1212]='C';
	decode[1112]='D';
	decode[221]='E';
	decode[12112]='F';
	decode[21122122]='G';
	decode[121111]='H';
	decode[1222]='I';
	decode[21122111]='J';
	decode[1221]='K';
	decode[11211]='L';
	decode[21122112]='M';
	decode[21122221]='N';
	decode[11212]='O';
	decode[222]='P';
	decode[21122222]='Q';
	decode[2111]='R';
	decode[11221]='S';
	decode[11222]='T';
	decode[21122211]='U';
	decode[21122212]='V';
	decode[111121]='W';
	decode[21121121]='X';
	decode[21121122]='Y';
	decode[21121111]='Z';

	while(fgets(tex,900000,stdin)!=NULL){
		strcpy(code,"");
		for(i=0;i<(signed)strlen(tex);i++){
			strcat(code,encode[tex[i]-' ']);
		}
		stk=0;
		for(i=0;i<(signed)strlen(code);i++){
			stk=stk*10+code[i]-'0'+1;
			if(decode[stk]>0){
				printf("%c",decode[stk]);
				stk=0;
			}
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 6656
#include<iostream>

using namespace std;

int main () {

    int a, b;

    cin >> a >> b;

    if (a < b) cout << "a < b" << endl;
    if (a > b) cout << "a > b" << endl;
    if (a == b) cout << "a == b" << endl;

    return 0;
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
#define int long long
int MOD = (int)1e9 + 7;
int INF = (int)2e18;
// Comment out below and program paste
// #include "UnionFind.h"
// #include "power.h"

signed main() {
    int A, B, C;
    cin >> A >> B >> C;
    cout << min({A % 2 == 0 ? 0 : B * C, B % 2 == 0 ? 0 : A * C, C % 2 == 0 ? 0 : A * B}) << endl;
}

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

using namespace std;
using ll = long long;

const int MOD = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  int A[N + 5], B[M + 5];
  for (int i = 0; i < N; i++)
    cin >> A[i];
  for (int i = 0; i < M; i++)
    cin >> B[i];
  sort(A, A + N, greater<int>());
  sort(B, B + M, greater<int>());
  A[N] = 0;
  B[M] = 0;

  ll ans = 1, h = 0, w = 0;
  for (int i = N * M; i > 0; i--) {
    if (A[h] == i) {
      h++;
      if (B[w] == i)
        w++;
      else
        ans = 1LL * (ans * w) % MOD;
    } else if (B[w] == i) {
      w++;
      ans = 1LL * (ans * h) % MOD;
    } else {
      ans = 1LL * (ans * (h * w - (N * M - i))) % MOD;
    }
    if (ans == 0) break;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 string a;
  bool flag = false;
  cin >> a ;
  
  if(a =="AAA" || a =="BBB"){
  cout << "No" << endl;
  }
  else{
  cout << "Yes" << endl;
  }
  
}

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

int main(){
  long S, X, Y;
  const int c=1e9;
  cin >> S;
  X = (c-S%c)%c;
  Y = (S+X)/c;
  cout << "0 0 1000000000 1 " << X << " " << Y << endl;
  return 0;
}

Measured memory_bytes: 256
_find=str(input())
n=int(input())

count=0

for i in range(n):
    s=str(input())
    l=list(s)

    for j in range(len(_find)-1):
        l.append(s[j])

    ss="".join(l)

    if _find in ss:
        count=count+1

print(count)

Measured memory_bytes: 7676
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	n <- readLn
	(a:as) <- reverse . sort <$> replicateM n readLn
	print $ a `div` 2 + sum as

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

using namespace std;

namespace {

constexpr size_t MOD = 1e9+7;
constexpr size_t MAX = 2e6+2;

size_t mod_pow(size_t x, size_t p) {
  size_t u = x;
  size_t t = 1;
  while (p) {
    if (p & 1) {
      t = t * u % MOD;
    }
    u = u * u % MOD;
    p>>=1;
  }
  return t;
}

size_t mod_inv(size_t x) {
  return mod_pow(x, MOD-2);
}

vector<size_t> fact(MAX+1), ifact(MAX+1);

void init() {
  fact[0] = 1;
  for (size_t i = 1; i <= MAX; i++) {
    fact[i] = fact[i-1]*i%MOD;
  }
  ifact[MAX] = mod_inv(fact[MAX]);
  for (long long i = MAX-1; i >= 0; i--) {
    ifact[i] = ifact[i+1] * (i+1) % MOD;
  }
}

size_t mod_cmb(size_t x, size_t y) {
  return fact[x] * ifact[x-y] % MOD * ifact[y] % MOD;
}

}

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

  init();

  int r1,r2,c1,c2;
  cin>>r1>>c1>>r2>>c2;

  auto f=[&](int r, int c) {
    return mod_cmb(r+c, c);
  };
  auto g=[&](int r, int c) {
    return f(r+1, c+1)-f(r,0);
  };

  auto ans = g(r2, c2);
  ans = ans + MOD - g(r1-1, c2);
  ans %= MOD;
  ans = ans + MOD - g(r2, c1-1);
  ans %= MOD;
  ans = ans + g(r1-1, c1-1);
  ans %= MOD;

  cout << ans << endl;

  return 0;
}


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

#define debug(...) fprintf(stderr, __VA_ARGS__)

#ifndef AT_HOME
#define getchar() IO::myGetchar()
#define putchar(x) IO::myPutchar(x)
#endif

namespace IO {
	static const int IN_BUF = 1 << 23, OUT_BUF = 1 << 23;

	inline char myGetchar() {
		static char buf[IN_BUF], *ps = buf, *pt = buf;
		if (ps == pt) {
			ps = buf, pt = buf + fread(buf, 1, IN_BUF, stdin);
		}
		return ps == pt ? EOF : *ps++;
	}

	template<typename T>
	inline bool read(T &x) {
		bool op = 0;
		char ch = getchar();
		x = 0;
		for (; !isdigit(ch) && ch != EOF; ch = getchar()) {
			op ^= (ch == '-');
		}
		if (ch == EOF) {
			return false;
		}
		for (; isdigit(ch); ch = getchar()) {
			x = x * 10 + (ch ^ '0');
		}
		if (op) {
			x = -x;
		}
		return true;
	}

	inline int readStr(char *s) {
		int n = 0;
		char ch = getchar();
		for (; isspace(ch) && ch != EOF; ch = getchar())
			;
		for (; !isspace(ch) && ch != EOF; ch = getchar()) {
			s[n++] = ch;
		}
		s[n] = '\0';
		return n;
	}

	inline void myPutchar(char x) {
		static char pbuf[OUT_BUF], *pp = pbuf;
		struct _flusher {
			~_flusher() {
				fwrite(pbuf, 1, pp - pbuf, stdout);
			}
		};
		static _flusher outputFlusher;
		if (pp == pbuf + OUT_BUF) {
			fwrite(pbuf, 1, OUT_BUF, stdout);
			pp = pbuf;
		}
		*pp++ = x;
	}

	template<typename T>
	inline void print_(T x) {
		if (x == 0) {
			putchar('0');
			return;
		}
		static int num[40];
		if (x < 0) {
			putchar('-');
			x = -x;
		}
		for (*num = 0; x; x /= 10) {
			num[++*num] = x % 10;
		}
		while (*num){
			putchar(num[*num] ^ '0');
			--*num;
		}
	}

	template<typename T>
	inline void print(T x, char ch = '\n') {
		print_(x);
		putchar(ch);
	}

	inline void printStr_(const char *s, int n = -1) {
		if (n == -1) {
			n = strlen(s);
		}
		for (int i = 0; i < n; ++i) {
			putchar(s[i]);
		}
	}

	inline void printStr(const char *s, int n = -1, char ch = '\n') {
		printStr_(s, n);
		putchar(ch);
	}
}
using namespace IO;

const int P = 1000000007;

int n;

int qpow(int a, int b) {
	int s = 1;
	for (; b; b >>= 1) {
		if (b & 1) {
			s = 1ll * s * a % P;
		}
		a = 1ll * a * a % P;
	}
	return s;
}

int fac[2005], inv[2005];

void init(int n) {
	fac[0] = 1;
	for (int i = 1; i <= n; ++i) {
		fac[i] = 1ll * fac[i - 1] * i % P;
	}
	inv[n] = qpow(fac[n], P - 2);
	for (int i = n; i; --i) {
		inv[i - 1] = 1ll * inv[i] * i % P;
	}
}

int C(int n, int m) {
	if (m < 0 || m > n) {
		return 0;
	}
	return 1ll * fac[n] * inv[m] % P * inv[n - m] % P;
}

int main() {
	read(n);
	init(n);
	int ans = 0;
	for (int i = 1; i <= n / 3; ++i) {
		ans = (ans + C(n - 2 * i - 1, i - 1)) % P;
	}
	print(ans);
}

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

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

int main() {

    int x, y;
    cin >> x >> y;

    cout << gcd(x, y) << endl;

    return 0;

}


Measured memory_bytes: 3120