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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N; cin >> N;
	vector<double>v(N); rep(i, 0, N) { cin >> v[i]; }
	sort(all(v));

	rep(i, 1, N) {
		v[i] = (v[i] + v[i - 1]) / 2;
	}

	cout << v.back() << endl;


	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int main(){
	int N;
	cin >> N;
	int D[N];
	for(int i = 0; i < N; i++){
		cin >> D[i];
	}
	sort(D, D+N);
	cout << D[N/2] - D[N/2-1] << "\n";
}


Measured memory_bytes: 640
#define y1 askjdkasldjlkasd
#include <bits/stdc++.h>
#undef y1

using namespace std;

#define pb push_back
#define mp make_pair
#define fi(a, b) for(int i=a; i<=b; i++)
#define fj(a, b) for(int j=a; j<=b; j++)
#define fo(a, b) for(int o=a; o<=b; o++)
#define fdi(a, b) for(int i=a; i>=b; i--)
#define fdj(a, b) for(int j=a; j>=b; j--)
#define fdo(a, b) for(int o=a; o>=b; o--)
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;

#ifdef LOCAL
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...) while (0)
#endif

double START_TIME;

void exit() {
#ifdef LOCAL	
	cerr << "TIME: " << setprecision(5) << fixed << (clock() - START_TIME) / CLOCKS_PER_SEC << endl;
#endif	
	exit(0);
}

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

template<typename T>
ostream& operator<<(ostream& os, vector<T> v) {
	fi(0, sz(v) - 1) {
		os << v[i] << " ";
	}
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T> t) {
	for (auto z : t) {
		os << z << " ";
	}
	return os;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
	cerr << endl;
	for (auto z : t) {
		os << "\t" << z.first << " -> " << z.second << endl;
	}
	return os;
}

#ifdef LOCAL
#define dbg(x) {cerr << __LINE__ << "\t" << #x << ": " << x << endl;}
#define dbg0(x, n) {cerr << __LINE__ << "\t" << #x << ": "; for (int ABC = 0; ABC < n; ABC++) cerr << x[ABC] << ' '; cerr << endl;}
#else
#define dbg(x) while(0){}
#define dbg0(x, n) while(0){}
#endif

#ifdef LOCAL
#define ass(x) if (!(x)) { cerr << __LINE__ << "\tassertion failed: " << #x << endl, abort(); }
#else
#define ass(x) assert(x)
#endif

///////////////////////////////////////////////////

const int MAX = 3e5 + 41;
const int MOD = 998244353;

int n;
char s[MAX];
int ans;

int add(int a, int b) {
	a += b;
	if (a >= MOD) a -= MOD;
	return a;
}

int mul(int a, int b) {
	return (ll) a * b % MOD;
}

int qbit(int m) {
	return __builtin_popcount(m);
}

bool bit(int m, int i) {
	return (1 & (m >> i));
}

int getcol(char c) {
	if (c == 'R') return 0;
	if (c == 'G') return 1;
	return 2;
}

void solve () {
	ans = 1;
	vi cnt( (1 << 3), 0);
	cnt[0] = n;	
	fdi(n * 3 - 1, 0) {
		int cur = getcol(s[i]);
		int bm = 0;
		fo(1, (1 << 3) - 2) {
			if (bit(o, cur)) continue;
			if (cnt[o] == 0) continue;
			if (qbit(o) < qbit(bm)) continue;
			bm = o;
		}
		int v = cnt[bm];
		/*
		err("i = %d\n", i);
		dbg(cnt);
		err("bm = %d v = %d\n", bm, v);
		*/
		ans = mul(ans, v);
		cnt[bm]--;
		bm |= (1 << cur);
		cnt[bm]++;
	}
	printf("%d\n", ans);
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	START_TIME = (double)clock();
#endif
	
	scanf("%d", &n);
	scanf("%s", s);
	solve();

	exit();
	return 0;
}





Measured memory_bytes: 512
Public Class Program
  Shared Sub Main()
    Dim n As Integer = Cin.Int()
    Dim a As Integer() = Cin.IntArr()
    Dim ans As String = "APPROVED"
    For i As Integer = 0 To n - 1
      If a(i) Mod 2 = 0 Then
        If Not (a(i) Mod 3 = 0 OrElse a(i) Mod 5 = 0) Then
          ans = "DENIED"
          Exit For
        End If
      End If
    Next
    Console.WriteLine(ans)
  End Sub
End Class

Public Class Cin
  Public Shared Function Str() As String
    Return Console.ReadLine().Trim()
  End Function
  Public Shared Function Int() As Integer
    Return Integer.Parse(Str())
  End Function
  Public Shared Function Lng() As Long
    Return Long.Parse(Str())
  End Function
  Public Shared Function Dbl() As Double
    Return Double.Parse(Str())
  End Function
  Public Shared Function StrArr(Optional separator As String = " ") As String()
    Return Str().Split(separator)
  End Function
  Public Shared Function IntArr(Optional separator As String = " ") As Integer()
    Return Array.ConvertAll(Of String, Integer)(StrArr(separator), AddressOf Integer.Parse)
  End Function
  Public Shared Function LngArr(Optional separator As String = " ") As Long()
    Return Array.ConvertAll(Of String, Long)(StrArr(separator), AddressOf Long.Parse)
  End Function
  Public Shared Function DblArr(Optional separator As String = " ") As Double()
    Return Array.ConvertAll(Of String, Double)(StrArr(separator), AddressOf Double.Parse)
  End Function
End Class

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

int main(){
	char s[101];
	int flagc=0, flagf=0;
	cin >> s;
	for(int i=0; s[i]!='\0'; i++){
		if(s[i]=='C'){
			flagc = 1;
		}
		if(s[i]=='F' && flagc==1){
			flagf = 1;
		}
	}
	if(flagc == 1 && flagf == 1){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

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

int main(){
  int N = 0;
  cin >> N;
  int S = 0;
  for (int i; i < N; i++){
    int R, L;
    cin >> R >> L;
    S += L - R + 1;
  }
  cout << S << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int i, j, k, h, w;
   
    cin >> h >> w;
    while(h>0 || w>0)
    {
        for(i=1; i<=h; i++)
        {
            for(j=1; j<=w; j++)
            {
                if(i==1||i==h||j==1||j==w)
                cout << "#";
                
                else
                cout << "." ;
            }
            cout << endl;
        }
        cout << endl;
        cin >> h >> w;
    }
}


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

Measured memory_bytes: 256
n,m=map(int,input().split())

lr=[list(map(int,input().split())) for _ in range(m)]
#print(lr)

imos=[0]*(n+1)
for i in lr:
    start,end=i
    imos[start-1]+=1
    imos[end]-=1
for i in range(1,n):
    imos[i]=imos[i-1]+imos[i]

print(imos.count(m))

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

int main() {
    int n, sum = 0;
    cin >> n;
    vector<int> a(n + 2);
    a.at(0) = 0;
    a.at(n + 1) = 0;
    rep(i, n) cin >> a.at(i + 1);
    rep(i, n + 1) sum += abs(a.at(i + 1) - a.at(i));
    rep(i, n) cout << sum - abs(a.at(i + 1) - a.at(i)) - abs(a.at(i + 2) - a.at(i + 1)) + abs(a.at(i + 2) - a.at(i)) << endl;
}

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

int main(){
  int A,B,C,K;
  cin >> A >> B >> C >> K;
  int max_score;
  if(A >= K){
    max_score = K;
  }
  else {
    if(A+B >= K){
      max_score = A;
    }
    else{
      max_score = A - (K-A-B);
    }
  }
  cout << max_score << endl;
}

Measured memory_bytes: 3620
#include <iostream>

using namespace std;

int main()
{
    int a, b, c; cin >> a >> b >> c;
    int startRemainder = a % b;
    // bool canSelect = false;

    for (int i = 2; ;i++) {
        if (startRemainder == (a * i) % b) {
            cout << "NO" << endl;
            break;
        } else if ((a * i) % b == c) {
            cout << "YES" << endl;
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 888
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}
int main(){
    map<pii,int>mp;
    int n;
    cin >> n;
    vector<int>a(n),b(n);
    rep(i,n)cin >> a[i] >> b[i];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i!=j)mp[pii(a[i]-a[j],b[i]-b[j])]++;
        }
    }
    int ma = 0;
    for(auto x : mp)ma = max(ma, x.second);
    cout << n - ma << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>

using namespace std;

void b_great_ocean_view(void) {
	int n;
	int* h;
	cin >> n;
	h = (int*)calloc(n, sizeof(int));
	for (int i = 0; i < n; i++) cin >> h[i];

	int cnt = 1;

	for (int i = 1; i < n; i++) {
		bool higher_detect = false;
		for (int j = 0; j < i; j++) {
			if (h[i] < h[j]) {
				higher_detect = true;
				break;
			}
		}
		if (!higher_detect)cnt++;
	}

	cout << cnt << endl;
}

int main()
{
    b_great_ocean_view();

    return 0;
}

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

int main()
{
    int a, b, c;

    cin>>a>>b>>c;

    if((a==5&&b==5&&c==7) || (a==5&&b==7&&c==5) || (a==7&&b==5&&c==5))
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;

    return 0;
}


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

typedef long long LL;

const int N = 50;
const int M = 250;

bool mat[N][N];

int n, m, s;
LL mod;

LL pow_mod(LL x, int p){
    LL s = 1;
    while(p){
        if(p & 1)   s = s * x % mod;
        x = x * x % mod;
        p >>= 1;
    }
    return s;
}

int query(int a, int b, int c, int d){
    printf("? %d %d %d %d\n", a, b, c, d);
    fflush(stdout);
    int x;
    scanf("%d", &x);
    return x;
}

void solve(int x1, int x2, int y1, int y2, int div, int s){
    if(s == 0 || x1 > x2 || y1 > y2)  return;
    int area = (x2 - x1 + 1) * (y2 - y1 + 1);
    if(area == s){
        for(int i=x1; i<=x2; i++){
            for(int j=y1; j<=y2; j++){
                mat[i][j] = 1;
            }
        }
        return;
    }
    if(x1 == x2 && div){
        div ^= 1;
    } else if(y1 == y2 && !div){
        div ^= 1;
    }
    if(div){
        int mid = x1 + x2 >> 1;
        int ans = query(x1, y1, mid, y2);
        solve(x1, mid, y1, y2, 1^div, ans);
        solve(mid+1, x2, y1, y2, 1^div, s - ans);
    } else {
        int mid = y1 + y2 >> 1;
        int ans = query(x1, y1, x2, mid);
        solve(x1, x2, y1, mid, 1^div, ans);
        solve(x1, x2, mid+1, y2, 1^div, s - ans);
    }
}

int main(){
    while(~scanf("%d %d %d %lld", &n, &m, &s, &mod)){
        memset(mat, 0, sizeof(mat));
        for(int i=0; i<n; i++){
            int g = query(i, 0, i, m-1);
            if(g){
                solve(i, i, 0, m-1, 1, g);
            }
        }
        LL ans = 0;
        for(int i=0; i<n; i++){
            for(int j=0; j<m; j++){
                if(mat[i][j]){
                    ans = (ans + pow_mod(2, i*m+j)) % mod;
                }
            }
        }
        printf("! %lld\n", ans);
        fflush(stdout);
    }
    return 0;
}


Measured memory_bytes: 724
#include<bits/stdc++.h>
#define ios std::ios::sync_with_stdio(false)
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,n,a) for (int i=n;i>=a;i--)
#define ll long long
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(),a.end()
#define mst(a,n) memset(a,n,sizeof(a))
#define dbg(a, b) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<endl;
#define debug(a, b, c, d)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define printa(a,l,r) for(int i = l; i <= r; i++){cout << a[i] << " \n"[i==r];}
#define printset(st) for(auto it:st){cout << it << " ";} cout << '\n';
#define printmap(mp) for(auto &it:mp){cout << it.se << " ";} cout << '\n';
//ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
//ll lcm(ll a,ll b){return a*b/gcd(a,b);}
//ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}
//ll fact_pow(ll n,ll p){ll res=0;while(n){n/=p;res+=n;}return res;}
//ll mult(ll a,ll b,ll p){a%=p;b%=p;ll r=0,v=a;while(b){if(b&1){r+=v;if(r>p)r-=p;}v<<=1;if(v>p)v-=p;b>>=1;}return r;}
//freopen("C:/Users/zyj19/Desktop/out.txt","w",stdout);int num = 0;time_t begin,end;double ret;begin=clock();end=clock();ret=double(end-begin)/CLOCKS_PER_SEC;cout<<"runtime: "<<ret<<endl;fclose(stdout);
using namespace std;
template<typename T>void read(T &res){bool flag=false;char ch;while(!isdigit(ch=getchar()))(ch=='-')&&(flag=true);for(res=ch-48;isdigit(ch=getchar());res=(res<<1)+(res<<3)+ch - 48);flag&&(res=-res);}
template<typename T>void Out(T x){if(x<0)putchar('-'),x=-x;if(x>9)Out(x/10);putchar(x%10+'0');}
//struct Edge{int nxt,to;}e[N<<1];int head[N],TOT;void add_edge(int u,int v){e[++TOT].nxt=head[u];e[TOT].to = v;head[u] = TOT;}
//struct node{int k,l,r;bool operator <(const node& A)const{return k < A.k;}};
const int N = 2e5 + 10, MOD = 1e9+7, inf = 0x3f3f3f3f;
//const ll INF = 0x3f3f3f3f3f3f3f3f;

signed main()
{ll a; string b;
	while(cin >> a >> b){
		
	ll sum = 0;
	ll bb = b[0]-'0';
	sum += a * bb;
	bb = b[2]-'0';
	sum += (a * bb)/10;
	float summ = (a*bb)%10/10.0;
	bb = b[3]-'0';
	sum += (a * bb)/100;
	summ += (a*bb)%100/100.0;
	cout << sum + (int)summ<< "\n";
	}
	
    return 0;
}



Measured memory_bytes: 3532
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
 
typedef int64_t ll; typedef vector<int> VI; typedef pair<ll,int> pii;
const ll mod = 1e9+7;
 

 
int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	ll d[4],n;
	cin >>d[0] >>d[1] >>d[2] >>d[3] >>n;
	vector<pii> kt(4);
	
	kt[0] = pii(d[0]*8LL, 0);
	kt[1] = pii(d[1]*4LL, 1);
	kt[2] = pii(d[2]*2LL, 2);
	kt[3] = pii(d[3],   3);
	
	sort(all(kt));
	
	//for(auto x :kt) printf("%lld:%d, ",x.first,x.second); puts("");
	ll sm =0;
	ll nw = n*4LL;
	ll zx[4] = {1,2,4,8};
	while(nw>0){
		rep(i,4){
			int cx = kt[i].second;
			ll p = nw / zx[cx];
			sm += d[cx] * p;
			nw -= zx[cx] * p;
		}
	}
	
	cout << sm << "\n";
	return 0;
}

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

int main()
{
    int N, t, x, y;
    int pt = 0, px = 0, py = 0;
    cin >> N;

    // 入力データ処理
    for (int i = 0; i < N; i++) {
        cin >> t >> x >> y;
        int dt, dx, dy;
        dt = t - pt;
        dx = x > px ? x - px : px - x;
        dy = y > py ? y - py : py - y;
        if (dt < dx + dy || (dx + dy) % 2 != dt % 2) {
            cout << "No" << endl;
            return 0;
        }
        pt = t, px = x, py = y;
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main implements Runnable {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        // Run with 32MB stack
        Thread thread = new Thread(null, new Main(), "", 32 * 1024 * 1024);
        thread.start();
    }

    @Override
    public void run() {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static void solve(Scanner scanner) {
        int[] a = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int N = a[0], K = a[1];
        String S = scanner.nextLine();
        if (!S.contains("0") || !S.contains("1")) {
            System.out.println(N);
            return;
        }
        List<Integer> starts = new ArrayList<>();
        List<Integer> ends = new ArrayList<>();
        boolean one = false;
        for (int i = 0; i < N; i++) {
            if (S.charAt(i) == '1') {
                if (!one) {
                    one = true;
                    starts.add(i);
                }
            } else {
                if (one) {
                    ends.add(i - 1);
                    one = false;
                }
            }
        }
        if (one) {
            ends.add(N - 1);
        }

        int max = 0;
        for (int i = 0; i < starts.size(); i++) {
            int endIdx = i + K >= ends.size() ? ends.size() - 1 : i + K;
            max = Math.max(max, ends.get(endIdx) - starts.get(i) + 1);
        }

        int endIdx = K - 1 >= ends.size() ? ends.size() - 1 : K - 1;
        max = Math.max(max, ends.get(endIdx) + 1);
        int startIdx = Math.max(starts.size() - K, 0);
        max = Math.max(max, N - starts.get(startIdx));
        System.out.println(max);
    }

}

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

int main(){
  int X, A, B, C;
  cin >> A >> B >> C >> X;
  int ans = 0;
  for(int i = 0; i <= A; i++){
    for(int j = 0; j <= B; j++){
      for(int k = 0; k <= C; k++){
        int Y = X - 500*i -100*j-50*k;
        if(Y == 0){
          ans += 1;
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
//#include"functions.h"
#define pb push_back
#define pf push_front
#define ppb pop_back
#define mp make_pair
#define np next_permutation
#define fi first
#define sc second
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pff pair<float,float>
#define pdd pair<double,double>
#define psi pair<string,int>
#define pis pair<int,string>
#define ppi pair<pii,int>
#define pdi pair<pii,pii>
#define INF 0x7fffffff
#define LLINF 0x7fffffffffffffff
#define EPS 1e-5
#define LDEPS 1e-9
#define MOD 1000000007
#define E 2.7182818284
#define PI 3.1415926535
#define FOR(a,b) for(int a=0;a<b;a++)
#define FORN(a,m,n) for(int a=m;a<n;a++)
#define REP(a,m,n) for(int a=0;a<m;a+=n)
#define REPN(a,m,n,p) for(int a=m;a<n;a+=p)
#define frestream freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define stdfopen(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
#define ifopen(a) freopen(a,"r",stdin);
#define ofopen(a) freopen(a,"w",stdout);
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
using namespace std;

int main(){
	int a,b,k;
	cin>>a>>b;
	if((a-b)%2==0){
		k=abs(a-b)/2+min(a,b);
	}
	else{
		cout<<"IMPOSSIBLE\n";
		return 0;
	}
	cout<<k<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        char[] s = sc.next().toCharArray();

        for(int i = 0;i < s.length;i++){
            for(int j = 0;j < n;j++){
                if(s[i] == 'Z'){
                    s[i] = 'A';
                }else{
                    s[i]++;
                }
            }
        }

        for(char ch:s)
            System.out.print(ch);
    }
}

Measured memory_bytes: 25812
O = list(input())
E = list(input())
ans = []

if len(O) == len(E):
    for i in range(len(O)):
        ans.append(O[i])
        ans.append(E[i])
else:
    for i in range(len(O)-1):
        ans.append(O[i])
        ans.append(E[i])
    ans.append(O[-1])
    
print("".join(ans))



Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

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

  string S; cin >> S;
  vector<int> l(Q), r(Q);
  for(int i = 0; i < Q; i++) cin >> l[i] >> r[i];

  vector<int> sum(N+1);
  sum[0] = 0; sum[1] = 0;
  for(int i = 1; i < N; i++){
    if(S[i-1] == 'A' && S[i] =='C') sum[i+1] = sum[i] + 1;
    else sum[i+1] = sum[i];
  }

  for(int i = 0; i < Q; i++){
    cout << sum[r[i]] - sum[l[i]] << endl;
  }

  return 0;
}



Measured memory_bytes: 2176
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int x,y,t;
  int field[30][30] = {0};
  for(;;){
    if(scanf("%d,%d,%d",&x,&y,&t) == EOF){break;}
    field[x+10][y+10]++;
    field[x+9][y+10]++;
    field[x+11][y+10]++;
    field[x+10][y+9]++;
    field[x+10][y+11]++;
    if(t>1){
      field[x+9][y+11]++;
      field[x+9][y+9]++;
      field[x+11][y+11]++;
      field[x+11][y+9]++;
    }
    if(t>2){
      field[x+10][y+12]++;
      field[x+10][y+8]++;
      field[x+12][y+10]++;
      field[x+8][y+10]++;
    }
  }
  int ans[2] = {0};
  for(int i=0; i<10; i++){
    for(int j=0; j<10; j++){
      if(!field[i+10][j+10]){ans[0]++;}
      if(field[i+10][j+10] > ans[1]){ans[1] = field[i+10][j+10];}
    }
  }
  cout <<ans[0]<<endl<<ans[1]<<endl;
  return 0;
}

Measured memory_bytes: 1208
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
typedef long long ll;

ll inf = 998244353;
ll fact[3000010] = {0};
ll finv[3000010] = {0};
ll inv[3000010] = {0};

ll mult(ll n, ll m){
	if(m==1) return n%inf;
	else if(m%2==0){
		ll t = mult(n,m/2);
		return t*t%inf;
	}else{
		ll t = mult(n,m-1);
		return t*n%inf;
	}
}

void factorial(ll N){
	fact[0] = fact[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for(ll i=2;i<=N;i++){
		fact[i] = i*fact[i-1]%inf;
		inv[i] = inf-inv[inf%i]*(inf/i)%inf;
		finv[i] = finv[i-1]*inv[i]%inf;
	}
}

ll comb(ll n,ll k){
	if(n<k) return 0;
	if(n<0 || k<0) return 0;
	else return (((fact[n]*finv[k])%inf)*finv[n-k])%inf;
}

ll hcomb(ll n,ll k){
	if(n==0 && k==0) return 1;
	return comb(n+k-1,k);
}

int main(){
    ll N,M;
    cin >> N >> M;
    factorial(N+3*M);
	ll ans = hcomb(N,3*M);
	for(ll k=M+1;k<=min(N,3*M);k++){
		if((3*M-k)%2==1) continue;
		(ans += -comb(N,k)*hcomb(N,(3*M-k)/2)%inf+inf)%=inf;
	}
	(ans += -hcomb(N,M-1)*N%inf+inf)%=inf;
	cout << ans << endl;
}

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

int main() 
{ 
    double s, x;
	double res = 0;
    cin>>s;
    x = s / 3.0000000000000000000000000;
    res = x * x * x;
    cout <<fixed<<setprecision(10)<<res<<endl;
    return 0; 
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(ll i=0; i<(n); ++i)
#define rep1(i,n) for(ll i=1; i<=(n); ++i)
#define repi(i,a,b) for(ll i=a; i<=(b); ++i)
#define rrep(i,n) for(ll i=(n-1); i>=0; --i)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define print(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
using Edge = pair<ll,ll>;
using Graph = vector<vector<Edge>>;
typedef pair<ll,ll> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
ll MOD = 1e9 + 7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll devc(ll x, ll y){return 1 + (x-1)/y;}
ll modpow(ll x, ll y, ll m) {
    if (y == 0) return 1;
    ll res = modpow(x, y / 2, m);
    return res * res % m * (y & 1 ? x : 1) % m;
}
ll modinv(ll x) { return modpow(x, MOD - 2, MOD); }

int main(){
    ll N; cin >> N;
    ll memo[10][10];
    rep1(i,9) rep1(j,9) memo[i][j] = 0;
    rep1(i,N){
        ll digit = sz(to_s(i));
        ll k = 1;
        rep(_, digit-1) k *= 10;
        memo[i/k][i%10]++;
    }
    
    ll ans = 0;
    rep1(i,9) rep1(j,9){
        ans += memo[i][j] * memo[j][i];
    }
    
    print(ans);
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int d;
  scanf("%d",&d);
  if(d==25){
    printf("Christmas\n");
  }
   if(d==24){
    printf("Christmas Eve\n");
  }
   if(d==23){
    printf("Christmas Eve Eve\n");
  }
   if(d==22){
    printf("Christmas Eve Eve Eve \n");
  }
  return 0;
}
  
           
           
           
           
           
         

Measured memory_bytes: 1604
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <string>
#include <map>

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

struct Obj{
  int lv;
  map<string,string> strs;
  map<string,Obj*> objs;

  int find(vector<string>& path, string& res, int idx = 0){
	if(path.size() == idx+1){
	  if(strs.count(path[idx])){
		res = strs[path[idx]];
		return 1;
	  }
	  else if(objs.count(path[idx]))
		return 0;
	  return -1;
	}
	else{
	  if(!objs.count(path[idx])) return -1;
	  return objs[path[idx]]->find(path, res, idx+1);
	}
  }
};

int N;
vector<int> level;
vector<string> vs;

vector<string> split(string s, const string &delim) {
    vector<string> res;
    int pos;
    while((pos = s.find(delim)) != string::npos) {
        if(pos) res.emplace_back(s.substr(0, pos));
        s = s.substr(pos + 1);
    }
    if(s.size()) res.emplace_back(s);
    return res;
}

void dfs(int& idx, int lv, Obj* obj){
  for(;idx<N;){
	if(idx == N || level[idx] <= lv) return;
	int lv_c = level[idx];
	int p = vs[idx].find(":");

	string key = vs[idx].substr(level[idx], p-level[idx]);
	if(p+1 == vs[idx].size()){
	  Obj* c = new Obj();
	  c->lv = lv_c;
	  ++idx;
	  dfs(idx, lv_c, c);
	  obj->objs[key] = c;
	}
	else{
	  string str = vs[idx].substr(p+2);
	  obj->strs[key] = str;
	  ++idx;
	}
  }
}

void debug(Obj* obj){
  cout << obj->lv << ": " << endl;
  for(auto& ss: obj->strs)
	cout << ss.first << " -> " << ss.second << endl;
  for(auto& ss: obj->objs){
	cout << ss.first << " -> *" << endl;
	debug(ss.second);
  }
}

int main(){
  string query; cin >> query; cin.ignore();

  string line;
  N = 0;
  while(getline(cin, line)){
	int lv = 0;
	for(;line[lv]==' ';++lv);
	level.push_back(lv);
	vs.push_back(line);
	++N;
  }
  Obj* yaml = new Obj();
  yaml->lv = -1;
  int idx = 0;
  dfs(idx,-1,yaml);

  //  debug(yaml);

  vector<string> path = split(query, ".");

  string res;
  switch(yaml->find(path, res)){
  case 1:
	cout << "string \"" << res << "\"" << endl;
	break;
  case 0:
	cout << "object" << endl;
	break;
  default:
	cout << "no such property" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1436
#include<iostream>
#include<cmath>

using namespace std;
int main()
{
    int m,f,b;
    cin >> m >> f >> b;
    if((m+f)<b){
        cout << "NA" << endl;
    }else{
        if(m>=b){
            cout << "0" << endl;
        }else{
            cout << b-m << endl;
        }
    }
    return 0;
}



Measured memory_bytes: 3092
//#include "bits/stdc++.h"

#include <iostream>
#include <vector>
// #include <map>
// #include <string>
// #include <algorithm>
// #include <numeric>
// #include <limits>

using namespace std;

void rectangle(int h, int w) {
	for (int i = 0; i < h; i++ ) {
		for (int j = 0; j < w; j++ ) {
			if (i % 2 == 0) {
				if (j % 2 == 0) {
					cout << "#";
				} else {
					cout << ".";
				}
			} else {
				if (j % 2 == 0) {
					cout << ".";
				} else {
					cout << "#";
				}
			}
		}
		cout << endl;
	}
	cout << endl;
}

int main() {
	while (1) {
		int H, W;
		cin >> H >> W;
		if (H == 0 and W == 0) {
			break;
		}
		rectangle(H, W);
	}
	return 0;
}



Measured memory_bytes: 3064
N=list(map(int,input().split()))
#A=list(map(int,input().split()))
if N[1]>=((673-N[0]%673)+N[0]):
  if N[1]==N[0]+1:
    p=(N[1]*N[0])%2019
  else:
    p=0
else:
 a=N[0]%2019
 b=N[1]%2019
 max1=2018
 for i in range(a,b):
     for j in range(i+1,b+1):
         if max1>(i*j)%2019:
           max1=(i*j)%2019
 p=max1

print(p)
 



Measured memory_bytes: 3064
N = int(input())
P = [int(input()) for _ in [0]*N]
m = [0]*N
for i,p in enumerate(P): m[p-1] = i
ans = 0
c = 0
j=-1
for i in m:
    c = (c+1) if j<i else 1
    j=i
    ans = max(ans,c)
print(N-ans)

Measured memory_bytes: 18860
n=int(input())
h=[int(x) for x in input().split()]
a=[0]*n
a[1]=abs(h[0]-h[1])

for i in range(2,n):
  a[i]=min(a[i-2]+abs(h[i]-h[i-2]),a[i-1]+abs(h[i]-h[i-1]))
  
print(a[n-1])

Measured memory_bytes: 20608
//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#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<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
using namespace std;
ll A,B,C,D;
int main(){
    cin>>A>>B;
    if(A==B){
        cout<<1<<endl;
        return 0;
    }
    int k=61;
    while((A>>k)==(B>>k)){
        if(A&(1ll<<k)){
            A^=(1ll<<k);
            B^=(1ll<<k);
        }
        --k;
    }
    C=1ll<<k;
    D=C;
    for(int i=k-1;i>=0;--i){
        if(B&(1ll<<i)){
            D+=(2ll<<i)-1;
            break;
        }
    }
    cout<<C-A+min(C,D-A+1)<<endl;
    //system("pause");
    return 0;
}


Measured memory_bytes: 256
### 17.07.2017
### ???W ??????H???????????¢?????????r ??§?¨?(x,y)???????????????????????????????????\??????

w, h, x, y, r = map(int, input().split())

if x - r >= 0 and x + r <= w:
	if y - r >= 0 and y + r <= h:
		print('Yes')
	else:
		print('No')
else:
	print('No')
	

Measured memory_bytes: 7672
li= [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[int(input())-1])

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <climits>
int main()
{
    long N,M;
    std::cin >> N >> M;
    if(N>M/2){
        std::cout << M/2 << std::endl;
    }else{
        std::cout << N+(M-2*N)/4 << std::endl;
    }
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<utility>
#include<queue>
#include<functional>
#include<cstring>
#include<vector>
#include<climits>
#include<map>
using namespace std;
#define FOR(i,n) for(int i=0;i<(int)n;i++)
#define FORI(i,k,n) for(int i=k;i<(int)n;i++)
#define ALL(x) (x).begin(),(x).end()
typedef pair<int,int> pii;
typedef vector<int> vi;

const int M=1010000;
vi pri;
int pf[M]={1,1};

void calc_pri()
{
	FORI(i,2,M)
	{
		if(!pf[i])
		{
			pri.push_back(i);
			for(int j=i+i;j<M;j+=i)
			{
				pf[j]=1;
			}
		}
	}
}	



int a[M];

int main()
{
	calc_pri();
	int x,n;
	while(cin>>n>>x&&n)
	{
		FOR(i,M)a[i]=0;
		a[0]=1;
		FOR(i,n)
		{
			int k;cin>>k;
			FOR(j,M)
			{
				if(j+k>=M)break;
				if(a[j])a[j+k]=1;
			}
		}
		for(int i=x;i>=0;i--)
		{
			if(i==0)cout<<"NA"<<endl;
			if(a[i]&&!pf[i])
			{
				cout<<i<<endl;
				break;
			}
		}
	}
	
}

Measured memory_bytes: 11104
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

int main(){
  int n = in();
  vector<int> line(n);
  foreach(i,line)i=in();
  int q = in();
  rep(_,q){
    int x = in();
    cout << lower_bound(all(line),x)-line.begin() << endl;
  }
}



Measured memory_bytes: 3448
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tp3 = tuple<int, int, int>;
using Mat = vector<vector<ll>>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
// ============ template finished ============

set<int> generate_divs(int num) {
    set<int> st;
    REP(i, 1, sqrt(num) + 1)if (num%i == 0) {
        st.insert(i);
        st.insert(num / i);
    }
    st.erase(num);
    return st;
}

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

    map<int, int> mp;
    rep(i, N) {
        int num;
        cin >> num;
        mp[num]++;
    }
    int res = 0;
    for (auto itr : mp) {
        if (1 < itr.second)continue;
        auto divs = generate_divs(itr.first);
        bool safe = true;
        for (auto div : divs)if (mp.find(div) != mp.end())safe = false;
        if (safe)res++;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 12940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>

#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>

#define INF 100100100

typedef long long int llint;

using namespace std;

typedef pair<int, int>Pii;

void trans(string & s) {
	transform(s.begin(), s.end(), s.begin(), ::toupper);
}

int main() {
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;
	trans(s1);
	trans(s2);
	trans(s3);
	cout << s1[0] << s2[0] << s3[0] << endl;
	return 0;
}

Measured memory_bytes: 256
// In the name of GOD
#include<bits/stdc++.h>
using namespace std;

#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";

#define     IOS         ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define 	setprecn(x) cout<<fixed<<setprecision(x);
#define 	ll          long long int
#define 	pb          push_back
#define 	pll         pair<ll,ll>
#define 	vll         vector<ll>
#define 	ff          first
#define 	ss          second
#define 	all(a)      (a).begin(),(a).end()
#define 	sz(x)       (ll)x.size()
#define 	mod         1000000007
#define 	inf         10000000000000007
#define 	rep(i,n)    for(ll i=0;i<n;i++)
#define 	repe(i,a,b) for(ll i=a;i<b;i++)
#define 	lbnd        lower_bound
#define 	ubnd        upper_bound
#define 	bs          binary_search

ll power(ll a,ll b,ll m)
{
	if(b==0)
		return 1;
	if(b==1)
		return a;
	ll c=power(a,b/2,m);
	if(b%2==0)
		return((c%m)*(c%m))%m;
	return ((((c%m)*(c%m))%m)*(a%m))%m;
}

/********************************************************/
//	d.erase(unique(all(d)), d.end());




int main()
{
	IOS;
	ll n,k,m,i,j,c=0,cs=0,t;
	t=1;

	// cin>>t;
	string s;
	while(t--)
	{
		cin>>n>>m;
		// n=s.length();
		// ll a[n];
		if(n<m) c=0;
		else c=10;
		
		
		cout<<c;
		
		if(t!=0)
	   		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
struct Process{
    string name;
    int time;
};


int main(void){
    int n, q, t = 0, a, c, i = 0, j = 0;
    string b;
    cin >> n >> q;
    Process P[n];
    int m = 0;
    for (int i = 0; i < n; i++) {
        cin >> b >> a;
        if (a <= q) {t += a; cout << b << " " << t <<  endl; }
        else {P[m].name = b; P[m].time = a-q; m++; t += q; }
    }
    Process p[m]; c = m;
    while (true) {
        if (m == 0) break;
        if (i == c) {
            for (int k = 0; k < m; k++) {
                P[k].name = p[k].name; P[k].time = p[k].time;
             }
            c = m; i = 0; j = 0;
        }
        if (P[i].time > q) { p[j].name = P[i].name; p[j].time = P[i].time-q; t+=q; j++;}
        else { t += P[i].time; m--; cout << P[i].name << " " << t << endl; }
        i++;
    }
    return 0;
}


Measured memory_bytes: 4980
#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s,a[16]={"KIHBAR","KIHABR","KIHBR","KIHABAR","AKIHBAR","AKIHABR","AKIHBR","AKIHABAR","KIHBARA","KIHABRA","KIHBRA","KIHABARA","AKIHBARA","AKIHABRA","AKIHBRA","AKIHABARA"};
	int i;
	cin>>s;
	for(i=0;i<16;i++)
	{
		if(s==a[i])
		{
			cout << "YES";
			return 0;
		}
	}
	cout << "NO\n";
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long Max=sc.nextLong();
		long Min=sc.nextLong();
		long tmp=0;
		if(Max<Min){
			tmp=Max;
			Max=Min;
			Min=tmp;
		}
		long num=0;

		if(Max>=2 && Min>=2) num=(Max-2)*(Min-2);
		else if(Min==1 && Max>=2) num=1*(Max-2);
		else if(Min==1 && Max==1) num=1;
		else num=0;

		System.out.println(num);

	}
}

Measured memory_bytes: 21716
H,W = map(int,input().split())
List=[input() for i in range(H)]
A =[[1]*(W) for i in range(H)]
B =[[1]*(H) for i in range(W)]
for i in range(H):
    k = 0
    a = 0
    while k < W:
        if List[i][k]==".":
            a += 1
            k = k+1
        else:
            for j in range(a):
                A[i][k-j-1]=a
            A[i][k]=a
            a = 0
            k = k+1
    for j in range(a):
                A[i][k-j-1]=a
for i in range(W):
    k = 0
    a = 0
    while k < H:
        if List[k][i]==".":
            a += 1
            k = k+1
        else:
            for j in range(a):
                B[i][k-j-1]=a
            B[i][k] = 0
            a = 0
            k = k+1
    for j in range(a):
                B[i][k-j-1]= a
max = 0
for i in range(H):
    for j in range(W):
        if max < A[i][j] + B[j][i]:
            max = A[i][j] + B[j][i]
print(max-1)
        


Measured memory_bytes: 123224
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int N;
	long long A[119];
	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> A[i];
	}
	long long max = 0;
	long long min = 999999999999;
	for (int i = 1; i <= N; i++) {
		if (A[i] > max)max = A[i];
		if (A[i] < min)min = A[i];
	}
	cout << max - min;
}

Measured memory_bytes: 256
#include <cstdio>
#define ll long long
#define maxn 100

int main() {
    int n, m, sum = 0;
    int v[maxn+1];
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d", &v[i]);
        sum += v[i];
    }
    scanf("%d", &m);
    for (int i = 1; i <= m; i++) {
        int x, y;
        scanf("%d%d", &x, &y);
        int rez = sum - v[x] + y;
        printf("%d", rez);
        printf("\n");

    }
}


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

using namespace std;

typedef long long int ll;

const int NMax = 2e5 + 5;
const int LIM = 1e9;


int main(){

    /*#ifndef ONLINE_JUDGE
    freopen("debug.in", "r", stdin);
    #endif // ONLINE_JUDGE*/

    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n, t, m;
    cin >> n >> t >> m;

    int ways = 0;
    int profit = 0;
    for(int i = 2; i <= n; i++) {
        int x;
        cin >> x;

        int value = x - m;
        if(value == profit) {
            ways++;
        }
        if(value > profit) {
            ways = 1;
            profit = value;
        }

        m = min(m, x);
    }

    cout << ways;
    return 0;

}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin, output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line.split(" "));
});
reader.on('close', solve);

function getInt(strArr){
  var rtn = [];
  for(elem of strArr)rtn.push(parseInt(elem));
  return rtn;
}

function getFloat(strArr){
  var rtn = [];
  for(elem of strArr)rtn.push(parseFloat(elem));
  return rtn;
}

function solve(){
  var [a,b] = getInt(lines[0]);
  if(b>a)[a,b]=[b,a];
  var ans = "";
  for(i=0; i<a; i++)ans+=b;
  console.log(ans);
}

Measured memory_bytes: 29740
N = int(input())
A = [int(input()) for i in range(N)]

FIRST = max(A)
if A.count(FIRST) > 1:
    for i in range(N):
        print(FIRST)
else:
    SECOND = max([a for a in A if a != FIRST])
    for a in A:
        if a == FIRST:
            print(SECOND)
        else:
            print(FIRST)

Measured memory_bytes: 71000
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;


void ABC157B()
{
	vi A(9);
	for (int i = 0; i < 9; ++i)
		cin >> A[i];
	vvi B(3, vi(3, 0));
	int N;
	cin >> N;
	for (int i = 0; i < N; ++i)
	{
		int b;
		cin >> b;
		for (int j = 0; j < 9; ++j)
		{
			if (A[j] == b)
			{
				B[j / 3][j % 3] = 1;
			}
		}
	}
	for (int i = 0; i < 3; ++i)
	{
		if (B[i][0] * B[i][1] * B[i][2] == 1)
		{
			cout << "Yes" << endl;
			return;
		}
		if (B[0][i] * B[1][i] * B[2][i] == 1)
		{
			cout << "Yes" << endl;
			return;
		}
	}
	if (B[0][0] * B[1][1] * B[2][2] == 1)
	{
		cout << "Yes" << endl;
		return;
	}
	if (B[0][2] * B[1][1] * B[2][0] == 1)
	{
		cout << "Yes" << endl;
		return;
	}
	cout << "No" << endl;
}


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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  string s;
  cin >> s;
  int ans = 0;
  rep(i, 0, s.size()) if (s[i] == '1') ans++;
  cout << ans << endl;
}


Measured memory_bytes: 256
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
using namespace std;

typedef long long ll;
#define eps 1e-10
#define LL_INF 0x33ffffffffffffff
#define INF 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back

const int maxn = 2e5+5;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
ll po(ll a, ll b,ll mod) { ll res = 1; a %= mod; for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
ll gcd(ll a,ll b){ if(a==0){return b;}else{ return gcd(b%a,a);}}

int n;
int val[maxn],vis[maxn];

void solve()
{
	scanf("%d",&n);
	repp(i,1,n)
	{
		sa(val[i]);
	}
	int res=0;
	repp(i,1,n)
	{
		if(vis[i])continue;
		int k=val[i];
		if(val[k]==i)
		{
			res++;
			vis[k]=1;
		}
	}
	printf("%d\n",res);
}

int main()
{

    solve();
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int>vec(n);
  for(int i = 0;i<n;i++) cin >> vec[i];
  int count = 0;
  bool box = false;
  while(true){
    for(int i=0;i<n;i++){
      if(vec[i]%2 == 1){
        box=true;
      }
    }
    if(box) break;
    for(int i=0;i<n;i++){
      vec[i] = vec[i]/2;
    }
    count++;
  }
 cout << count << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pi 3.14159265358979
int main() {
	int h, w;
	while (1) {
		cin >> h >> w;
		if (h == 0 && w == 0)break;
		rep(i, h) {
			rep(j, w) {
				cout << "#";
			}
			cout << endl;
		}
		cout<<endl;
	}
	return 0;
}


Measured memory_bytes: 3128