akhauriyash/Code-Regression huggingface dataset:
parseInt(x::SubString{String}) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	n,hp = readline() |> split |> parseMap
	x = Tuple{Int,Int}[]
	maxa = 0
	for i in 1:n[1]
		a,b = readline() |> split |> parseMap
		push!(x,(a,b))
		maxa = max(maxa,a)
	end
	useb = Int[]
	for i in 1:n
		if x[i][2] > maxa
			push!(useb, x[i][2])
		end
	end
	useb = sort(useb, rev=true)
	count = 0
	for i in 1:length(useb)
		if hp > 0
			hp -= useb[i]
			count += 1
		end
	end
	if hp > 0
		if hp%maxa == 0
			count += div(hp, maxa)
		else
			count += div(hp, maxa)+1
		end
	end
	print(count)
end

main()

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

using namespace std;

int main()
{
    int N;
    cin >> N;
    
    int num=0;
    if(N%2 == 0) N--;
    for(int i = N; i > 104; i-=2){
        int cnt = 0;
        for(int j = 1; j < N+1; j+=2){
            if(i%j == 0) cnt++;
        }
        if(cnt == 8) num++;
    }
    cout << num << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>

int main() {
	int N, T;
	std::cin >> N >> T;
	bool is_in_time = false;
	int min_elem = 1000 + 1;
	int min_index = 100 + 1;
	for (int i = 0; i < N; ++i) {
		int c, t;
		std::cin >> c >> t;
		if (c < min_elem && t <= T) {
			min_elem = c;
			min_index = i;
			is_in_time = true;
		}
	}
	if (is_in_time) {
		printf("%d", min_elem);
	}
	else printf("TLE");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
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; }
typedef long long ll;
const long long INF = 1LL << 60;
int main()
{
    int N;
    cin >> N;

    int A[N];
    rep(i, N) cin >> A[i];

    bool flag = true;
    int cnt = 0;
    while (flag) {
        rep(i, N) {
            if (A[i] % 2 == 0) {
                A[i] /= 2;
            }
            else {
                flag = false;
                break;
            }
        }
        if (flag) cnt++;
    }

    cout << cnt << endl;
    return 0;
}

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

int main(){
    int N, M;
    cin >> N >> M;
    int a[60], b[60];
    for(int i = 0; i < M; ++i) cin >> a[i] >> b[i];
    int num[60] = {0};
    for(int i = 0; i < M; ++i){
        num[a[i]]++;
        num[b[i]]++;
    }
    for(int i = 1; i <= N; ++i) cout << num[i] << endl;
    return 0;
}

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

void make_vs(int N, vector<pair<ll,ll>> const &xv, vector<ll> &vs) {
    ll tmp = 0;
    for (int i = 0; i < N; i++) {
        tmp += xv.at(i).second;
        vs.at(i) = tmp - xv.at(i).first;
    }
}

void make_vspmpos(int N, vector<ll> const &vs, vector<ll> &vspmpos) {
    ll tmp = vs.at(0);
    int curmax = 0;
    for (int i = 0; i < N; i++) {
        if (tmp < vs.at(i)) {
            curmax = i;
            tmp = vs.at(i);
        }
        vspmpos.at(i) = curmax;
    }
}

void make_table(int N, vector<pair<ll,ll>> const &xv, vector<ll> &vs, vector<ll> &vspmpos) {
    make_vs(N, xv, vs);
    make_vspmpos(N, vs, vspmpos);
}

ll calc(int N, vector<pair<ll, ll>> const &xv, vector<ll> const &vs, vector<ll> const &revvs, vector<ll> const &revvspmpos) {
    ll opt = 0;
    for (int right = -1; right < N; right++) {
        int left = right < N-1 ? revvspmpos.at(N - 2 - right) : -1;

        ll got = 0;
        if (right != -1) got = vs.at(right);
        ll will_get = 0;
        if (left != -1)  will_get = (right == -1 ? 0 : -xv.at(right).first) + revvs.at(left);
        opt = max(opt, got + max(0ll, will_get));
    }
    return opt;
}

int main() {
    int N;
    ll C;
    cin >> N >> C;
    vector<pair<ll,ll>> xv(N);
    for (int i = 0; i < N; i++) cin >> xv.at(i).first >> xv.at(i).second;

    sort(xv.begin(), xv.end());
    vector<ll> vs(N), vspmpos(N);
    make_table(N, xv, vs, vspmpos);

    vector<pair<ll,ll>> revxv(xv);
    for (auto &x: revxv) x.first = C - x.first;
    reverse(revxv.begin(), revxv.end());
    vector<ll> revvs(N), revvspmpos(N);
    make_table(N, revxv, revvs, revvspmpos);

    ll opt = max(calc(N, xv, vs, revvs, revvspmpos), calc(N, revxv, revvs, vs, vspmpos));

    cout << opt << endl;

    return 0;
}


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

int main() {
	long long A, B, C, K;
	cin >> A >> B >> C >> K;
	
	long long ans;
	if (K % 2 == 0) {
		ans = A - B;
	}
	else {
		ans = B - A;
	}

	if (llabs(ans) > 1e18)cout << "Unfair" << endl;
	else cout << ans << endl;

	return 0;
}

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

#define MAX 2000000000

void print(vector<int>& S)
{
	for (int i = 0; i < S.size(); i++)
	{
		if (i) cout << " ";
		cout << S.at(i);
	}
	cout << endl;
	return;
}

int merge(vector<int>& S, int left, int mid, int right)
{
	int n1 = (mid - left);
	int n2 = (right - mid);

	vector<int> L(n1), R(n2);
	for (int i = 0; i < n1; i++) L.at(i) = S.at(left + i);
	for (int i = 0; i < n2; i++) R.at(i) = S.at(mid + i);
	L.push_back(MAX);
	R.push_back(MAX);

	int i = 0;
	int j = 0;
	for (int k = left; k < right; k++)
	{
		if (L.at(i) <= R.at(j))
		{
			S.at(k) = L.at(i);
			i++;
		}
		else {
			S.at(k) = R.at(j);
			j++;
		}
	}

	return (i + j);
}

int mergeSort(vector<int>& S, int left, int right)
{
	if (left + 1 >= right) return 0;

	int ans = 0;

	int mid = (left + right) / 2;
	ans += mergeSort(S, left, mid);
	ans += mergeSort(S, mid, right);
	ans += merge(S, left, mid, right);

	return ans;
}

int main(void) {

	int N, ans;
	cin >> N;
	vector<int> S(N);
	for (int i = 0; i < N; i++) cin >> S.at(i);

	ans = mergeSort(S, 0, N);

	print(S);
	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 8804
import bisect
import collections
import itertools


def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [input() for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n,a,b=getints()
hs=[getint() for _ in range(n)]
mx=max(hs)

min_cast = 0
max_cast = mx+1
c = a-b

hs = list(sorted(hs,reverse=True))

while min_cast < max_cast:
    cast = (min_cast + max_cast) // 2
    #values= list(filter(lambda s: s > 0, map(lambda s: s - b*cast, hs)))
    #need = sum(map(lambda v: (v + c - 1) // c, values))
    need = 0
    dec = b * cast
    for v in hs:
        v = v - dec
        if v <= 0:
            break
        need += (v + c - 1) // c
    if need <= cast:
        max_cast = cast
    else:
        min_cast = cast + 1

print(min_cast)

Measured memory_bytes: 52184
#A_Beginning
import sys

N = list(map(int, input().split()))

wk = [99 for _ in range(len(N))]
flg = True
for i in range(len(N)) :
    if N[i] == 1 or N[i] == 9 or N[i] == 7 or N[i] == 4 :
        for _ in range(len(wk)) :
            if wk[_] == N[i] :
                flg = False
                break
        if flg == False :
            break
        else :
            wk[i] = N[i]
            flg = True
    else :
        flg = False
        break

if flg == True :
    print("YES")
else :
    print("NO")

Measured memory_bytes: 3064
N = int(input())
alist = input().split()
aint = list(map(int, alist))
aint = sorted(aint, reverse=True)
count = 1
alice = 0
bob = 0

for a in aint:
    if count % 2:
        alice += a
    else:
        bob += a
    count = count + 1
print(alice - bob)

Measured memory_bytes: 3060
/*
ID: thanhvq1
LANG: C++14
PROB: namenum
*/

#pragma GCC optimize ("O2")
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
//#define int long long
#define double long double
#define vec vector
#define vi vector<int>
#define FZ(n) memset((n),0,sizeof(n))
#define FMO(n) memset((n),-1,sizeof(n))
#define unset unordered_set
#define ii pair<int, int>
#define vii vector<ii>
#define F first
#define S second
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)(x).size())
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)
#define bitcount(n) __builtin_popcountll(n)
template <typename T,typename U>
std::pair<T,U> operator+(const std::pair<T,U> & l,const std::pair<T,U> & r) {
  return {l.first+r.first, l.second+r.second};
} 
typedef void (*callback_function)(void); // type for conciseness
const long long ZERO = 0LL;
const long long INF64 = 1e18;
const int INF32 = 1e9;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0L);
const double EPS = static_cast<double>(1e-9);
typedef long long ll;

void FILEIO() {  freopen("in.txt", "r", stdin);  freopen("out.txt", "w", stdout); }
//void FILEIO() {  freopen("namenum.in", "r", stdin);  freopen("namenum.out", "w", stdout); }
void input() {   }
const int M = 1e6;

void solve() {
	int a, b; cin >> a >> b;
	if(a <=5) cout << "0" << endl;
	if(a>=6 and a<=12) cout << b/2 << endl;
	if(a >12) cout << b << endl;
}

//#undef int
signed main() {
//#define int long long
  ios_base::sync_with_stdio(false); cin.tie();
//  FILEIO();
//auto beginProgram = chrono::steady_clock::now();

//  while (1)
//  {
//	  int k; cout << " num : "; cin >> k; cout << endl;
//	  FORE(j, 2, 10) {
//		  cout << " base: " << j << endl;
//		  cout << k << " in base " << j << " : " << to_baseB(k, j) << endl;
//	  }

		input();
		solve();
//  }

  //auto endProgram = chrono::steady_clock::now();

  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)

int main() {

	ll N, K;

	scanf("%lld %lld", &N, &K);

	ll sum = 0;

	rep(i, N) {
		sum += max(0ll, (N + 1) / (i + 1) * max(0ll, i + 1 - K) + max(0ll, (N % (i + 1) == i) ? 0ll : N % (i + 1) - K + 1) - (K ? 0 : 1));
	}


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

	return 0;
}


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

#define int long long
#define rep(i,a,n) for(int i = a; i < n; i++)
#define pb push_back
#define eb emplace_back
#define dump(x) cout << #x << " = " << (x) << endl
#define chk() cout << "now" << endl;
#define SORT(c) sort((c).begin(), (c).end())
#define SORTG(c) sort((c).begin(), (c).end(), greater<int>());
#define fi first
#define se second
  
typedef pair<int,int> P;
typedef vector<int> vi;

bool pairCompare(const P& firstElof, const P& secondElof)
{
    return firstElof.second < secondElof.second;
}

int N;
vector<P> C;

signed main() {
    cin>>N;
    rep(i,0,N) {
        int a,b; cin>>a>>b; C.pb(P(a,b));
    }

    sort(C.begin(),C.end(),pairCompare);
    int time=0;
    bool flag=true;
    rep(i,0,C.size()) {
        time+=C[i].fi;
        if(time>C[i].se) {
            flag=false;
            break;
        }
    }
    if(flag==true) {
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    cout<<endl;
    return 0;
}




Measured memory_bytes: 6384
parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n,m=parseMap(split(readline()))
    nC2=Vector{Int}([0 for i in 1:2*10^5+1])
    for i in 3:2*10^5+1
        nC2[i]=(i-1)*(i-2)÷2
    end
    println(nC2[n+1]+nC2[m+1])
end
main()

Measured memory_bytes: 169300
#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

#define REP(i,n) for(int i = 0; i < int(n); i++)
#define FOR(i, m, n) for(int i = int(m);i < int(n);i++)
#define ALL(obj) (obj).begin(),(obj).end()

const ll MOD = (ll)1e9 + 7;
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;

template<class T> void corner(bool flg, T hoge) { if (flg) { cout << hoge << endl; exit(0); } else return; }
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) { o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o; }
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) { o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o; }
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) { o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o; }
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) { o << "{" << obj.first << ", " << obj.second << "}"; return o; }
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) { o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o; }
void print(void) { cout << endl; }
template <class Head> void print(Head&& head) { cout << head; print(); }
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) { cout << head << " "; print(forward<Tail>(tail)...); }
template <class T> void chmax(T& a, const T b) { a = max<T>(a, b); }
template <class T> void chmin(T& a, const T b) { a = min<T>(a, b); }
void YN(bool flg) { cout << ((flg) ? "YES" : "NO") << endl; }
void Yn(bool flg) { cout << ((flg) ? "Yes" : "No") << endl; }
void yn(bool flg) { cout << ((flg) ? "yes" : "no") << endl; }

int main() {
	ll N, A, B; cin >> N >> A >> B;
	corner(A + B - 1 > N, -1);
	corner(A*B < N, -1);

	if(A >= B){
		int p = 1;
		int M = N;
		V<V<int>> node(A);
		for(int i = 0; i < A; ++i){
			node[i].push_back(p);
			p++;
			M--;
			for(int j = 1; j < B && M > A - (i + 1); ++j){
				node[i].push_back(p);
				p++;
				M--;
			}
			sort(ALL(node[i]), greater<int>());
		}
		for(auto u:node){
			for(auto v:u){
				cout << v << " ";
			}
		}
		cout << endl;
	}
	else {
		int p = N;
		int M = N;
		V<V<int>> node(B);
		for (int i = 0; i < B; ++i) {
			node[i].push_back(p);
			p--;
			M--;
			for (int j = 1; j < A && M > B - (i + 1); ++j) {
				node[i].push_back(p);
				p--;
				M--;
			}
			sort(ALL(node[i]));
		}
		for (auto u : node) {
			for (auto v : u) {
				cout << v << " ";
			}
		}
		cout << endl;
	}

	return 0;
}



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

#define MAX 60

int main() {
    int h, w; cin >> h >> w;
    vector<vector<char>> s(h, vector<char> (w));
    for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++) cin >> s[i][j];
    }

    for(int i = 0; i < h; i++) {
        for(int j = 0; j < w; j++) {
            if(s[i][j] == '#') {
                bool flag = false;
                int h_diff[] = {0, 1, -1, 0};
                int w_diff[] = {1, 0, 0, -1};
                for(int k = 0; k < 4; k++) {
                    int new_h = i + h_diff[k];
                    int new_w = j + w_diff[k];
                    if(0 <= new_h && new_h < h && 0 <= new_w && new_w < w && s[new_h][new_w] == '#') {
                        flag  = true;
                    }
                }
                if(!flag) {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }

    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;

const ll MOD = 1e9+7;
ll kai[2005];
ll gyaku[2005];

ll beki(ll n,ll a)
{
	ll ret=1;
	ll k=n;
	while(a>0)
	{
		if(a&1LL)
		{
			ret*=k;
			ret%=MOD;
		}
		k=k*k;
		k%=MOD;
		a>>=1LL;
	}
	if(ret<0)
		ret+=MOD;
	return ret;
}

ll combi(int n,int k)
{
	if(n<k)
		return 0;
	ll ret=kai[n]*gyaku[k];
	ret%=MOD;
	ret*=gyaku[n-k];
	ret%=MOD;
	if(ret<0)
		ret+=MOD;
	return ret;
}

int main()
{
	int n,k;
	ll ans=0;
	cin>>n>>k;
	kai[0]=1;
	gyaku[0]=beki(1,MOD-2);
	for(int i=1;i<2005;i++)
	{
		kai[i]=kai[i-1]*(ll)i;
		kai[i]%=MOD;
		gyaku[i]=beki(kai[i],MOD-2);
	}
	cout<<n-(k-1)<<endl;
	for(int i=2;i<k+1;i++)
	{
		ans=combi(n-k+1,i)*combi(k-1,i-1);
		ans%=MOD;
		if(ans<0)
			ans+=MOD;
		cout<<ans<<endl;
	}
	return 0;
}

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

int main()
 {
   int N,t,i;
   cin>>N;
   if(N%10==3)
{
  cout<<"bon";
}
else if(N%10==0 || N%10==1 || N%10==6 || N%10==8)
  cout<<"pon";
else
cout<<"hon";
return 0;
 }


Measured memory_bytes: 3564
import java.util.*;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.rmi.server.UnicastRemoteObject;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
 
public class Main{
    static long mod=1000000007;
//    static int dx[]={-1,0,1,0};
//    static int dy[]={0,-1,0,1};

    public static void main(String[] args)   throws Exception, IOException{        
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n = sc.nextInt();
        int d = sc.nextInt();
        d=2*d+1;
  
        out.println(n/d+(n%d==0?0:1));
        out.flush();
    }



    static boolean validpos(int x,int y,int r, int c){
        return x<r && 0<=x && y<c && 0<=y;
    }

    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }
}

class P {
	int x, y;
	P(int  x, int y) {
	  this.x=x;
	  this.y=y;
	}
}


//class P {
//    int id, d;
//    P(int  id, int d) {
//        this.id=id;
//        this.d=d;
//    }
//}

//class P implements Comparable<P>{
//    int a,b;
//    P(int a, int b) {
//    	this.b=b;
//    	this.a=a;
//    }
//
//    public int compareTo(P p){
//        return b-p.b;
//    }
//}

class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public int[] nextIntArray(int size) throws IOException{
        int r[] = new int[size];
        for (int i = 0; i < size; i++) {
            r[i] = this.nextInt(); 
        }
        return r;
    }
    public long[] nextLongArray(int size) throws IOException{
        long r[] = new long[size];
        for (int i = 0; i < size; i++) {
            r[i] = this.nextLong(); 
        }
        return r;
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}


Measured memory_bytes: 21460
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;


int main(void){
  long N, M;
  cin >> N >> M;
  unsigned long long ans = 1;
  long inf = 1e09 +7;
  if (N==M){
    for (int i= 1; i<= N; i++){
      ans = (ans * i *i)% inf;
    }
    ans =(2*ans)% inf;
   
  } else if(abs(N-M) == 1){
    if (N>M){
      for (int i=1; i<=M; i++){
        ans = (ans *i*i)% inf;
      }
      ans = (ans*N)% inf;
    }
    else {
      for (int i=1; i<=N; i++){
        ans = (ans *i*i)% inf;
      }
      ans = (ans*M)% inf;
    }
  } else{
    ans = 0;
  }
   cout << ans << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool comp(pair<long long int,long long int>a,pair<long long int,long long int>b)
{
    if(a.first==b.first)
    {
        if(a.second<=b.second)
        return true;
        else
        return false;
    }
    if(a.first>b.first)
    return true;
    else return false;
}
long long int gcd(long long int bdda,long long int chota)
{
    if(chota==0)
        return bdda;
    return gcd(chota,bdda%chota);
}
void solve()
{
    int n,m;
    cin>>n>>m;
    char a[n+2][m+2];
    for(int i=1;i<n+1;i++)
    for(int j=1;j<m+1;j++)
    cin>>a[i][j];
    
    for(int i=0;i<n+2;i++)
    {
        for(int j=0;j<m+2;j++)
        {
            //cout<<i<<" "<<j<<endl;
            if(i==0 || i==n+1 || j==0 || j==m+1)
            {
                cout<<"#";
            }
            else
            cout<<a[i][j];
        }
        cout<<endl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;    
    t=1;

    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int a,b,m;
    cin>>a>>b>>m;
    vector<int>l(a),r(b);
    int min1=1e9,min2=1e9;
    rep(i,a){
        cin>>l[i];
        min1=min(min1,l[i]);
    }
    rep(i,b){
        cin>>r[i];
        min2=min(min2,r[i]);
    }
    int ans=min1+min2;
    rep(i,m){
        int x,y,c;
        cin>>x>>y>>c;
        ans=min(ans,l[x-1]+r[y-1]-c);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
n = int(input())
a = list(map(int, input().split()))
ans = [0] * (n+1)

i = n
while i > 0:
    cnt = 0
    for j in range(1, n+1):
        if i * j  > n:
            break
        cnt += ans[i*j]
    if cnt % 2 != a[i-1]:
        ans[i] = 1
    i -= 1
    #print(cnt)
print(ans.count(1))
for i in range(1,n+1):
    if ans[i] == 1:
        print(i)

Measured memory_bytes: 64220
object Main extends App {
  import scala.io.StdIn._

  val n = readInt
  val numbers = readLine.trim.split(' ').map(_.toInt).sorted
  val isSearched = Array.tabulate(n){i ⇒ Array.tabulate(n - i){_ ⇒ false}}
  var max = 0
  for (i ← 0 until n; j ← i + 1 until n){
    val len = search(i, numbers(j))
    if (len > max) max = len
  }
  println(max)
  def search(init: Int, next: Int): Int = {
    val pos = lowerBound(numbers, next)
    if (numbers(pos) != next) 1
    else {
      if (isSearched(init)(pos - init)) 1
      else {
        isSearched(init)(pos - init) = true
        search(pos, next - numbers(init) + next) + 1
      }
    }
  }
  @inline
  def lowerBound(array: Array[Int], target: Int): Int = {
    var left = 0
    var right = array.length - 1
    while(left < right){
      if (array((left + right) / 2) < target) {
        left = (left + right) / 2 + 1
      }else {
        right = (left + right) / 2
      }
    }
    right
  }

  implicit class Scope[T](val value: T) extends AnyVal{
    @inline
    def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline
    def let[A](func: T ⇒ A): A = func(value)

  }
}



Measured memory_bytes: 244424
#include<bits/stdc++.h>
using namespace std;
int n,a[100];
int main()
{
	cin>>n;
	int maxn=-998244353,minn=998244353;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		maxn=max(maxn,a[i]);
		minn=min(minn,a[i]);
	}
	long long g1=998244353,g2;
	int i;
	for(i=minn;i<=maxn;i++)
	{
		g2=0;
		for(int j=0;j<n;j++)
		{
			g2+=(a[j]-i)*(a[j]-i);
		}
		g1=min(g1,g2);
	}
	cout<<g1;
}

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

using namespace std;

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    priority_queue<P> pq;
    for (int i = 0; i < n; i++) {
        ll a;
        cin >> a;
        pq.emplace(a, 1);
    }

    for (int i = 0; i < m; i++) {
        ll b, c;
        cin >> b >> c;
        pq.emplace(c, b);
    }

    ll cnt = 0;
    ll ans = 0;
    while (!pq.empty()) {
        P p = pq.top();
        pq.pop();
        if (cnt + p.second >= n) {
            ans += p.first * (n - cnt);
            cnt = n;
            break;
        } else {
            ans += p.first * p.second;
            cnt += p.second;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6384
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

# a^n
def power(a,n,mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod

# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n-1
    while(tmp >= l):
        a = a*tmp%mod
        tmp -= 1
    return a

inf = 10**18
mod = 10**9+7

n,p = lr()
f = factorization(p)
ans=1
for k,v in f:
    if v//n!=0:
        ans*=(k**(v//n))
print(ans)

Measured memory_bytes: 64620
#include<stdio.h>

int main(){
	
	int a,b,c;
	
	scanf("%d %d %d",&a,&b,&c);
	
	if(a<=c && b>=c){
		printf("Yes\n");
	}
	
	else{
		printf("No\n");
	}
	
	return 0;
}

Measured memory_bytes: 128
import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        MyReader r = new MyReader();
        int N, A, B, C, D;
        {int[] a = r.ii(); N = a[0]; A = a[1]; B = a[2]; C = a[3]; D = a[4];}
        char[] S = r.s().toCharArray();
        for(int i = A; i < C-2; i++){
            if(S[i] == '#'){
                if(++i < C-1 && S[i] == '#'){
                    println("No");
                    return;
                }              
            }
        }
        for(int i = B; i < D-2; i++){
            if(S[i] == '#'){
                if(++i < D-1 && S[i] == '#'){
                    println("No");
                    return;
                }              
            }
        }
        
        if(C < D)
            println("Yes");
        else{
            for(int i = B-2; i < D-1; i++){
                if(S[i] == '.'){
                    if(++i < D && S[i] == '.'){
                        if(++i < D+1 && S[i] == '.'){
                            println("Yes");
                            return;
                        }
                    }
                }
            }
            println("No");
        }
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static int Int(String s){
        return Integer.parseInt(s);
    }
    static long Long(String s){
        return Long.parseLong(s);
    }
    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }
        long l() throws IOException{
            return Long(s());
        }
        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long.parseLong(ss[j]);            
            return ll;
        }
    }
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((int)(x).size())

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

using ll = long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 45;
const int mod = 1000000007;

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

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

int main()
{
  string s, t;
  cin >> s >> t;
  t.pop_back();
  if(s == t) cout << "Yes" << endl;
  else cout << "No" << endl;

}

Measured memory_bytes: 3604
n = int(input())
A1 = [int(i) for i in input().split()]
A2 = [int(i) for i in input().split()]

def sum_list(A, index_start, num_sum):
    s = 0
    for i in A[index_start:num_sum]:
        s = s + i
    return s


sumA1_left = [sum_list(A1,0,i+1) for i in range(n)]
sumA2_right = [sum_list(A2[::-1],0,i+1) for i in range(n)]

sum_max = 0
for i in range(n):
    sum_all = sumA1_left[i] + sumA2_right[-(i+1)]
    if sum_all > sum_max:
        sum_max = sum_all
print(sum_max)

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

int main() {
  int N,M;
  cin>>N>>M;
  vector<bool> broken(N+1,false);
  rep(i,M){
    int a; cin>>a;
    broken.at(a)=true;
  }
  vector<int64_t> ans(N+1,0);
  ans.at(0)=1;
  if(!(broken.at(1)))ans.at(1)=1;
  for(int i=2;i<N+1;i++){
    if(!(broken.at(i))){
      ans.at(i)=(ans.at(i-1)+ans.at(i-2))%MOD;
    }
  }
  cout<<ans.at(N);
}


Measured memory_bytes: 4000
N,K=map(int,input().split())
A=list(map(int,input().split()))
for i in range(N):
    if A[i]==1:
        k=i
        break
sum=0
S=k
K-=1
for i in range(N):
    S+=K
    sum+=1
    if S>=N-1:
        r=S-(N-1)
        break
k-=r

if k<=0:
    print(sum)
    quit()
S=0
for i in range(N):
    S+=K
    sum+=1
    if S>=k:
        print(sum)
        quit()


Measured memory_bytes: 52732
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const int INF = 2e9;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
    ll n, X;
    cin >> n >> X;
    vi x(n+1);
    rep(i, n) cin >> x[i];
    x[n] = X;
    sort(all(x));
    ll mini = INF;
    for (ll i = 1; i <= n;i++){
        chmin(mini, x[i] - x[i - 1]);
    }
    ll ans;
    for (ll i = mini; i > 0; i--){
        bool z = true;
        ll mod = x[0] % i;
        rep(j,n+1){
            if(x[j]%i!=mod)z = false;
        }
        if(z){
            ans = i;
            break;
        }
    }
    print(ans);
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <boost/math/constants/constants.hpp>
using namespace std;
typedef long long ll;
long double e = boost::math::constants::e<long double>();
long double pi = boost::math::constants::pi<long double>();
// 条件を見落としていませんか？
int H, W, K;
int d[10][1010];
int main () {
    cin >> H >> W >> K;
    for (int i = 0; i < H; i++) {
        string S;
        cin >> S;
        S = "#"+S;
        for (int j = 1; j < S.size(); j++) {
            d[i][j] = d[i][j-1]+(S[j]-'0');
        }
    }
    ll ans = INT_MAX;
    for (int i = 0; i < (1 << (H-1)); i++) {
        vector<int> v;
        v.push_back(0);
        ll res = 0;
        for (int j = 0; j < H-1; j++) {
            if (i & (1 << j)) {
                v.push_back(j+1);
                res++;
            }
        }
        v.push_back(H);
        int jj = 0;
        for (int j = 1; j <= W; j++) {
            bool f = 1;
            for (int k = 1; k < v.size(); k++) {
                int a = 0;
                for (int l = v[k-1]; l < v[k]; l++) {
                    a += d[l][j]-d[l][jj];
                }
                if (a > K) {
                    f = 0;
                }
            }
            if (!f) {
                res++;
                if (jj == j-1) {
                    res = INT_MAX;
                    break;
                }
                jj = j-1;
            }
        }
        ans = min(ans, res);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repn(i, n) for (int i = 0; i <= (int)(n); i++)
#define srep(i, l, n) for (int i = l; i < (int)(n); i++)
#define srepn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
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; }

const int MOD = 1000000007;
const int INF = 1e9;
#define PI 3.14159265369;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};

int main(){
	int n;
	cin >> n;
	int now = 1;
	int keta = 0;
	map<pair<int, int>, int> mp;
	while(1){
		int l = pow(10,keta);
		int r = min((int)pow(10,keta+1), n+1);
		for(int i = l; i < r; i++){
			int a = i%10;
			if(a==0) continue;
			int b = i/pow(10,keta);
			mp[P(a, b)]++;
		}
		keta++;
		if(r==n+1) break;
	}
	ll ans = 0;
	for(int i = 1; i < 10; i++){
		for(int j = 1; j < 10; j++){
			ans += mp[P(i,j)]*mp[P(j,i)];
		}
	}
	cout << ans << endl;
}

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

using namespace std;
using ll =long long;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
//Write From this Line

int main()
{
	ll n ,a , b ;
	cin >> n >>a >> b ;
	//a + b がいくつ入るか。
	ll a_b = (n)  / ( a + b );
	n -= (a+b) * (a_b);
	n = max(n,(ll)0);
	ll ans = a_b * a ;
	ans += min(n,a);
	cout << ans << endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = LI()
    if b - a == c - b:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()


Measured memory_bytes: 39152
n = int(input())
s1 = input()
s2 = input()
s3 = input()
ans = 0
for i in range(n):
    if s1[i] == s2[i] and s2[i] == s3[i] and s3[i] == s1[i]:
        True
    elif s1[i] != s2[i] and s2[i] != s3[i] and s3[i] != s1[i]:
        ans += 2
    else:
        ans += 1
print(ans)

Measured memory_bytes: 3064
/*******************************
 * written by Koki Riho
 * Rih0z https://github.com/Rih0z
 *******************************/

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

#define DEBUG false

#define FOR(i , a, b) for(size_t i = a ; i < b ; i++ )
#define REP(i,b) FOR(i , 0 , b)
#define RFOR(i,a,b) for(size_t i = a-1 ; i >= b ; i--)
#define RREP(i,a) RFOR(i,a,0)



typedef long long ll;
using namespace std;

int scanInt(void);
string scanString(void);

void scanLlArr(ll *a , int n);
void scanCharArr(char *string);

void printInt(int p);
void printLlArr(ll *a);
void printCharArr(char *string);


void perSum(ll *a , ll *sum ,int n);

/*************Global variable  **************/
int N ;
std::map<char,int> M ;
/*******************************/

int main(){
  if (DEBUG){
    std::printf("******debug mode********\n");
  }
  string board[110];
  int X,Y ;
  cin >> X >> Y ;
  bool goodx[X],goody[Y] ;
  REP(i,X)
    goodx[i] = false ;
  REP(i,Y)
    goody[i] = false;
  for( int i = 0 ; i < X ; i++ ){
    cin >> board[i];
  }
  for(int i = 0 ; i < X ; i++){
    for(int j = 0  ; j < Y ; j++){
      if( board[i][j] == '#'){
        goodx[i] = true ;
        goody[j] = true ;
      }
    }
  }
  for(int i = 0 ; i < X ; i++){
    if(goodx[i]){
      for(int j = 0 ; j < Y ; j++){
        if(goody[j]){
            cout << board[i][j];
        }
      }
      cout << endl;
    }
  }
  if (DEBUG){
    std::printf("******debug********\n");

    std::printf("******debug********\n");
  }
  return 0 ;
}

//各地点までの部分和を計算する
void perSum(ll *a , ll *sum ,int n){
  int i ;
  sum[0] = a[0];
  for(i = 1 ; i < n ; i++){
    sum[i] = a[i] + sum[i-1];
  }

}


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

public class Main{
    static boolean n[] = new boolean[32769];
    static int output;
    public static void main(String arg[]){
	Scanner in = new Scanner(System.in);

	n[0] = false;
	n[1] = false;
	for(int i = 2;i<32769;i++){
	    n[i] = true;
	}
	for(int i = 2;i<32769;i++){
	    if(n[i]){
		era(i);
	    }
	}
	while(true) { 
	    output = 0;
	    int input = in.nextInt();
	    if( input == 0 ) break;
	    exec(input);
	    System.out.println(output);
      	}
    }

    public static void era(int input){
	for(int i = input*2;i<32769;i += input){
	    n[i] = false;
	}
    }

    public static void exec(int input){
	for(int i = 2;i<=input/2;i++){
	    if(n[i]){
		if(n[input - i]){
		    output++;
		}
	    }
	}
    }

}

Measured memory_bytes: 26508
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 /*int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }*/
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int a){
	par= vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0)
      return a;
    else
      return par[a]=find(par[a]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int gcm(int a,int b){
    if(b==0)
        return a;
    return gcm(b,a%b);
}
int lcm(int a,int b){
    return a/gcm(a,b)*b;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){

}*/
signed main(){
  string a;
  cin>>a;
  int b=1,c=0;
  if(a[0]!='A')
    b=0;
  for(int i=2;i<a.sz-1;i++){
    if(a[i]=='C')
      c=1;
  }
  Sort(a);
  if(a[2]<'a')
    b=0;
  if(b&&c)
    cout<<"AC"<<endl;
  else
    cout<<"WA"<<endl;
}

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

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

    int k;
    cin>>k;

    if(a[0]+k<a[4]){
        cout<<":("<<endl;
        return 0;
    }



    cout<<"Yay!"<<endl;
}

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

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            System.out.println(Integer.numberOfTrailingZeros((1 << 1) ^ (1 << 2) ^ (1 << 3) ^ (1 << A) ^ (1 << B)));
        }
    }
}

Measured memory_bytes: 26908
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <climits>
#include <tuple>
#include <ctime>
#include <cstring>
#include <numeric>
#define FOR(i,a,n) for (int i = a; i < n; i++)
#define IFOR(i,n,a) for (int i = n; i >= a; i--)
#define mp make_pair
#define full(a) a.begin(), a.end()
#define sz(x) ((int)(x).size())
#define pii pair<int, int>
#define trav(a,x) for (auto& a : x)
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using namespace std;
const ll mod = 1e9 + 7;
const int N = 5005;

void solve()
{
    string s, t; cin >> s >> t;
    map<string, int> m;
    int a, b; cin >> a >> b;
    m[s] = a;
    m[t] = b;
    string j; cin >> j;
    m[j]--;
    cout << m[s] << " " << m[t];
}

int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    /*int tc;  cin >> tc;
    while (tc--)*/
        solve();
    return 0;
}







Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
typedef long long int LLI;
LLI n, q, pot = 1, stare_n;
const int stala = 100007;
//const LLI mini = 10000000007LL;
LLI dlug[stala];
vector<LLI> S;

struct str_set {
	LLI co;
	LLI ile;
};
str_set do_dod, pom;
bool operator<(str_set s1, str_set s2) {
	return s1.co < s2.co;
}
set<str_set> rozklad;
set<str_set>::iterator it;

LLI drzewo[stala*3];

void dodaj(LLI x, LLI a, LLI b, LLI pocz, LLI kon, LLI ile) {
	if(pocz >= a && kon <= b) {
		drzewo[x] += ile;
		return;
	}
	LLI sr = (pocz+kon)/2;
	if(sr >= a) dodaj(2*x, a, b, pocz, sr, ile);
	if(sr < b) dodaj(2*x+1, a, b, sr+1, kon, ile);
}
LLI zlicz(int x) {
	LLI wy = 0;
	while(x > 0) {
		wy += drzewo[x];
		x >>= 1;
	}
	return wy;
}

int wyszukanie(LLI dokad) {
	int alfa = 0, beta = S.size()-1, wy = -1;
	while(alfa < beta) {
		//cout << "alfa == " << alfa << "; beta == " << beta << "; wy == " << wy << endl;
		int sr = (alfa+beta)/2;
		if(S[sr] >= dokad) {
			beta = sr;
		} else {
			wy = sr;
			alfa = sr+1;
		}
	}
	//cout << "wy == " << wy << endl;
	if(S[alfa] < dokad) return alfa;
	return wy;
}

str_set lolol;

void dodaj() {
	if(do_dod.co == 0) return;
	it = rozklad.find(do_dod);
	if(it != rozklad.end()) {
		do_dod.ile += it->ile;
		//cout << "it->ile == " << it->ile << endl;
		rozklad.erase(it);
	}
	//cout << "DODAJE: co == " << do_dod.co << "; ile == " << do_dod.ile << endl; 
	rozklad.insert(do_dod);
}

void oblicz() {
	do_dod.co = S[ S.size()-1 ];
	do_dod.ile = 1;
	rozklad.insert(do_dod);
	
	while(!rozklad.empty()) {
		it = rozklad.end();
		it--;
		pom = *it;
		rozklad.erase(it);
		//cout << "co == " << pom.co << "; ile == " << pom.ile << endl;
		if(pom.co <= n) {
			dodaj(1, 1, pom.co, 1, pot, pom.ile);
			continue;
		}
		int gdzie = wyszukanie(pom.co);
		LLI reszta = pom.co%S[gdzie], iloraz = pom.co/S[gdzie];
		
		do_dod.co = S[gdzie];
		do_dod.ile = pom.ile*iloraz;
		dodaj();
		do_dod.co = reszta;
		do_dod.ile = pom.ile;
		dodaj();
	}
	
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	
	cin >> n >> q;
	if(!q) {
		for(int i = 1; i <= n; i++) cout << "1\n";
		return 0;
	}
	
	for(int i = 0; i < q; i++) {
		cin >> dlug[i];
	}
	for(int i = q-1; i >= 0; i--) {
		
		if(S.empty() || S[ S.size()-1 ] > dlug[i]) S.push_back(dlug[i]);
	}
	
	stare_n = n;
	if(n > S[S.size()-1] ) n = S[S.size()-1];
	else S.push_back(n);
	while(pot < n) pot <<= 1;
	
	sort(S.begin(), S.end());
	oblicz();
	
	for(int i = 0; i < n; i++) {
		cout << zlicz(i+pot) << "\n";
	}
	for(int i = n+1; i <= stare_n; i++) cout << 0 << "\n";
	return 0;
}


Measured memory_bytes: 10740
#include<bits/stdc++.h>
using namespace std;
bool check[4];
int main()
{
    int a,b;
    cin>>a>>b;
    check[a]=1;
    check[b]=2;
    for(int i=1;i<4;i++)
    {
        if(!check[i])
        {
            cout<<i<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256