akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <stack>
using namespace std;

void calc(char ch, stack<int> & nums){
    int num = nums.top();
    nums.pop();
    if (ch == '*'){
        nums.top() *= num;
    }else if (ch == '+'){
        nums.top() += num;
    }else if (ch == '-'){
        nums.top() -= num;
    }
}


int main()
{
    string equation;
    getline(cin, equation);    
    stack<int> nums;
    int eqlen = equation.size();
    int num = 0;
    bool isNumber = true;
    for (int i = 0; i!= eqlen; ++i){
        auto ch = equation[i];
        if (ch == ' '){
            if (isNumber){
                nums.push(num);
                num = 0;
            }
        }else if(ch == '*' || ch == '+' || ch == '-'){
            isNumber = false;
            calc(ch, nums);
        }else{
            isNumber = true;
            num *= 10;
            num += static_cast<int>(ch) - static_cast<int>('0');
        }
    }
    cout << nums.top() << endl;
    
    return 0;
}

Measured memory_bytes: 3228
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// #include <ext/pb_ds/detail/standard_policies.hpp>
// using namespace __gnu_pbds;
using namespace std;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
//     tree_order_statistics_node_update>;
 
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
typedef long long int ll;
typedef long double ld;
const ll N = 1e5+9;
// const ll m = 1e9 + 7;
// const ll inf= 1e14;
const ll mod =998244353;
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define pld pair<ld,ld>
ll powm(ll a, ll b) { a = a%mod;ll res = 1; while (b) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; b >>= 1; } return res; }
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); 
    #endif  
    int t = 1;
    // cin>>t;
    while(t--){
        ll H,W,h,w;cin>>H>>W>>h>>w;
        if(H%h == 0 && W%w==0){
            cout<<"No\n";
        }
        else{
            ll ans[H][W];
            ll v = 1000*(h*w-1);v++;
            cout<<"Yes\n";
            for(int i = 0;i<H;i++){
                for(int j = 0;j<W;j++){
                    ans[i][j] = 1000;
                    if((i+1)%h==0 && (j+1)%w==0){
                        ans[i][j] = -v;
                    }
                }
            } 
            for(int i = 0;i<H;i++){
                for(int j = 0;j<W;j++){
                    cout<<ans[i][j]<<" ";
                }
                cout<<'\n';
            }
        }

    }
}

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

template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}

template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}

int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}

vector<int> p;
vector<int> r;

void init(int n) {
  p.reserve(n);
  r.reserve(n);
  for (int i = 0; i < n; i++) {
    p[i] = i;
    r[i] = 0;
  }
}

int root(int x) { return p[x] == x ? x : p[x] = root(p[x]); }

bool same(int x, int y) { return root(x) == root(y); }

void unite(int x, int y) {
  x = root(x);
  y = root(y);
  if (x == y)
    return;

  if (r[x] < r[y])
    p[x] = y;
  else {
    p[y] = x;
    if (r[x] == r[y])
      r[x]++;
  }
}

int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int e = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'E')
      e++;
  }
  int w = 0;
  int ans = INT_MAX;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'E')
      e--;
    if (ans > e + w)
      ans = e + w;
    if (S[i] == 'W')
      w++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 900
#include <iostream>

using std::cout;
using std::cin;
using std::endl;

void call(int n);

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

    call(n);

    return 0;
}

void call(int n)
{
    int i = 1;

    while (i++ < n) {
        int x = i;

        // divided by 3
        if (x % 3 == 0) {
            cout << " " << i;
            continue;
        }

        // include 3
        do {
            if (x % 10 == 3) {
                cout << " " << i;
                break;
            }
        } while ((x /= 10) > 0);

    }

    cout << endl;
}

Measured memory_bytes: 1160
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include<random>
#include <bitset>
using namespace std;
#define N (1000000000+7)
//#define N 998244353
#define INF 1e16
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> Q;
 
const int inf = (int)1e9; 
 

int main(void){
	int h,w,m;
	cin>>h>>w>>m;
	vector<P>p(m);
	map<int,int>mp1,mp2;
	map<P,bool>exist;
	for(int i=0;i<m;i++){
		int hi,wi;
		cin>>hi>>wi;
		hi--;
		wi--;
		p[i].first=hi;
		p[i].second=wi;
		mp1[hi]++;
		mp2[wi]++;
		exist[P(hi,wi)]=true;
	}
	int colmax = 0,rowmax=0;
	for(auto [x,y]:mp1){
		colmax = max(colmax,y);
	}
	for(auto [x,y]:mp2){
		rowmax = max(rowmax,y);
	}
	set<int>p1,p2;
	for(auto [x,y]:mp1){
		if(colmax==y){
			p1.insert(x);
		}
	}
	for(auto [x,y]:mp2){
		if(rowmax==y){
			p2.insert(x);
		}
	}
	int cnt = 0;
	for(int i=0;i<m;i++){
		int hi = p[i].first;
		int wi = p[i].second;
		if(p1.count(hi)==1 && p2.count(wi)==1){
			cnt++;
		}
	}
	if(cnt == p1.size()*p2.size())cout<<rowmax+colmax-1<<endl;
	else cout<<rowmax+colmax<<endl;
	return 0;
}

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

int main(){
  ll n,k,s;
  cin >> n;
  s=0;
  for(k=1;k<=n;k++){
    s += (1+n/k)*(n/k)*k/2;
  }
  cout << s << endl;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;
uint64_t gcd(uint64_t a, uint64_t b);
uint64_t lcm(uint64_t a, uint64_t b);

template <typename T>
static inline void ArrayInput(vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cin >> *itr;
}

template <typename T>
static inline void ArrayPut(const vector<T>& A) {
  for (auto itr = A.begin(); itr < A.end(); ++itr) cout << *itr << " ";
  cout << endl;
}

bool Sec_compare(pair<uint64_t, uint64_t> a, pair<uint64_t, uint64_t> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

int main() {
  uint32_t H, W, N;
  cin >> H >> W >> N;
  uint32_t cnt;

  if (H > W) {
    cnt = H;
  } else {
    cnt = W;
  }
  uint32_t res = 0;
  while (res * cnt < N) {
    res++;
  }
  cout << res << endl;

  return 0;
}

uint64_t gcd(uint64_t a, uint64_t b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }

  return b ? gcd(b, a % b) : a;
}

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

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int A,B;
	scanf("%d%d",&A,&B);
	
	if(A > B){
		printf("%d",2*A-1);
	}
	else if(B > A){
		printf("%d",2*B-1);
	}
	else{
		printf("%d",2*A);
	}
}

Measured memory_bytes: 128
//
// Created by 伊東麻沙美 on 2019/10/22.
//

#include<iostream>
#include<algorithm>
#include<stdlib.h>
using namespace std;


int main() {
    int N;
    cin>>N;
    int n;
    int d[N];
    for(n =0;n<N;n++){
        cin>>d[n];
    }
    int i,j;
    int souwa =0;
    int num;
    for(i=0;i<N;i++){
        for(j=i+1;j<N;j++){
                num = d[i]*d[j];
                souwa = souwa+num;

            }
        }

    cout<<souwa<<endl;
return 0;
}



Measured memory_bytes: 256
// B - Cut and Count
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)

int main(){
	int N; cin>>N;
	string S; cin>>S;
	int maxi = 0;
	rp(sep, 1, N){
		set<char> c1, c2;
		rp(i, 0, sep) c1.insert(S[i]);
		rp(i, sep, N) c2.insert(S[i]);
		int count = 0;
		for(auto a:c1) if(c2.count(a))count++;
		maxi = max(maxi, count);
	}
	cout<< maxi <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef priority_queue<P,vector<P>,greater<P>> SPQ;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<endl;}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<endl;}
template<class T> void outvp(T v){rep(i,v.size())outp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
template<class T> void outvv(T v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<endl;}}
ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}
ll modpow(ll a,ll b){
    a%=mod;
    if(b==0)return 1;
    if(b&1)return a*modpow(a,b-1)%mod;
    ll k=modpow(a,b/2);
    return k*k%mod;
}
int main(){
    ll n,k;cin>>n>>k;
    vvi v(n,vi(3));
    ll sum=0;
    rep(i,n){
        v[i][2]=k+n*2+i;
        sum+=v[i][2];
    }
    if(sum<(k+(k+n*2-1))*n){
        out(-1);
        return 0;
    }
    for(int i=0;i*2<n;i++){
        v[i*2][0]=k+i;
        v[i*2][1]=k+n+n/2+i;
    }
    for(int i=0;i*2+1<n;i++){
        v[i*2+1][0]=k+(n+1)/2+i;
        v[i*2+1][1]=k+n+i;
    }
    outvv(v);
}

Measured memory_bytes: 13184
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define int ll
#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
using vi=vector<int>;
#define PB push_back
#define ALL(x) x.begin()
using pi=pair<int,int>;

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}
int const inf=LLONG_MAX/3;
void chmin(int&a,int b){a=a<b?a:b;}
void chmax(int&a,int b){a=a>b?a:b;}

signed main(){
	int n=read(),e=read(),t=read();
	vi x{0};
	REP(i,n)x.PB(read());
	n++;
	vi dp(n,inf);
	priority_queue<pi,vector<pi>,greater<pi>> pq;
	pq.push(pi(0,0));
	int j=0;
	REP(i,n){
		int w;
		while(1){
			pi r=pq.top();
			if(i<=r.second){
				w=min(r.first,dp[i]);
				break;
			}else
				pq.pop();
		}
		if(i==n-1){
			cout<<w+e<<endl;
			return 0;
		}
		chmin(dp[i+1],dp[i]+(x[i+1]-x[i])*2);
		while(j<n&&(x[j]-x[i+1])*2<=t)j++;
		pq.push(pi(w+t,j-1));
		if(j<n)chmin(dp[j],w+(x[j]-x[i+1])*2);
	}
}


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define MOD 1000000007
#define mod 1000000037
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 1e9+1e7

int main()
{
    fastio;
    string s,t;
    cin >> s >> t;
    int n1=s.length(),n2=t.length();
    int dp[n1+1][n2+1];
    for(int i=0;i<=n1;i++)
    {
        for(int j=0;j<=n2;j++)
        {
            if(i==0 or j==0)
            {
                dp[i][j]=0;
                continue;
            }
            if(s[i-1]==t[j-1])
            {
                dp[i][j]=1+dp[i-1][j-1];
                continue;
            }
            int a1=dp[i-1][j-1],a2=dp[i-1][j],a3=dp[i][j-1];
            dp[i][j]=max({a1,a2,a3});
        }
    }
    pair<int,int>p=make_pair(n1,n2);
    string ans="";
    int l=dp[n1][n2];
    while(l>0)
    {
        int i=p.first,j=p.second;
        if(s[p.first-1]==t[p.second-1])
        {
            string a(1,s[p.first-1]);
            ans+=a;
            l-=1;
            p=make_pair(p.first-1,p.second-1);
        }
        else
        {
            int a1=dp[i-1][j-1],a2=dp[i-1][j],a3=dp[i][j-1];
            int a4=max({a1,a2,a3});
            if(a4==a1)
                p=make_pair(p.first-1,p.second-1);
            else if(a4==a2)
                p=make_pair(p.first-1,p.second);
            else
                p=make_pair(p.first,p.second-1);
        }
    }
    reverse(ans.begin(),ans.end());
    cout << ans << endl;
}

Measured memory_bytes: 35456
n, m = map(int, input().split())
l = [set([int(i) for i in input().split()][1:]) for j in range(n)]
ans = 0

for x in range(1, m+1):
	flag = 1
	for y in l:
		if x not in y:
			flag = 0
	ans += flag
print(ans)
			

Measured memory_bytes: 3060
#include <stdio.h>

char s[5001], t[6];
int sl, tl;
int k, i, iM, j;
char c[6];
inline int strin() {
  i = 0;
  iM = sl - tl;
  while (i <= iM) {
    for (j = 0; j < tl; ++j) {
      if (s[i + j] != t[j]) goto continue_while;
    }
    return 1;
  continue_while:
    ++i;
  }
  return 0;
}
void solve() {
  if (!strin()) return;
  if (k == 0) {
    printf("%s\n", t);
    k = -1;
    return;
  }
  --k;
  ++tl;
  for (c[tl] = 'a'; c[tl] <= 'z'; ++c[tl]) {
    t[tl - 1] = c[tl];
    solve();
    if (k < 0) return;
  }
  --tl;
  t[tl] = 0;
}
int main() {
  scanf("%s", s);
  sl = 5000;
  while (sl - i > 1) {
    j = (sl + i) >> 1;
    if (s[j]) {
      i = j;
    } else {
      sl = j;
    }
  }
  scanf("%d", &k);
  solve();
}


Measured memory_bytes: 2092
n = input()
n_split = list(n)
count = 0

for i in range(len(n_split)):
    if i != 0:
        if n_split[i] == n_split[i-1]:
            if n_split[i] == "0":
                n_split[i] = "1"
            else:
                n_split[i] = "0"
            count += 1

print(count)

Measured memory_bytes: 3956
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
#define MP make_pair
#define PB push_back
typedef long long LL;
typedef unsigned long long ULL;
const LL MOD = 998244353;
const int N = 505;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n,x,a[N][N];
LL s1[N][N], s2[N][N], dp[N][N];

int main(){
	//freopen("test.in","r",stdin);
	scanf("%d",&n);
	rep(i,1,n)rep(j,1,n-1){
		scanf("%d",&x);
		a[i][j+(j>=i)]=x;
	}
	
	rep(i,1,n){
		LL sum1 = 0, sum2 = 0;
		rep(j,i,n){
			sum1 += a[i][j], sum2 += a[j][i];
			s1[i][j] = s1[i-1][j] + sum1;
			s2[i][j] = s2[i-1][j] + sum2;
			//cout<<i<<" "<<j<<" "<<s1[i][j]<<" "<<s2[i][j]<<endl;
		} 
	}
	
	rep(i,0,n+1)rep(j,0,n+1)dp[i][j]=1e18;
	rep(i,2,n)dp[i][1] = s1[i-1][i-1];
	rep(i,2,n)rep(j,1,i-1)rep(x,i+1,n){
		LL sum1 = s1[x-1][x-1] - s1[i-1][x-1];
		LL sum2 = s2[i-1][n] - s2[j-1][n] - s2[i-1][x-1] + s2[j-1][x-1];
		dp[x][i] = min(dp[x][i], dp[i][j] + sum1 + sum2);
		//cout<<x<<" "<<i<<" "<<j<<" "<<dp[x][i]<<endl;//<<sum1<<" "<<sum2<<endl;
	}
	LL ans = s1[n][n];
	rep(i,2,n)rep(j,1,i-1) ans = min(ans, dp[i][j]+s1[n][n]-s1[i-1][n]);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 7168
#include <iostream>

using namespace std;

int main()
{
	int n;
	cin	>> n;
	int t[7] = { 1,2,4,8,16,32,64 };
	if (n >= t[6]) {
		cout << t[6] << endl;
	}
	else if (n >= t[5]) {
		cout << t[5] << endl;
	}
	else if (n >= t[4]) {
		cout << t[4] << endl;
	}
	else if (n >= t[3]) {
		cout << t[3] << endl;
	}
	else if (n >= t[2]) {
		cout << t[2] << endl;
	}
	else if (n >= t[1]) {
		cout << t[1] << endl;
	}
	else {
		cout << t[0] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define db(x) cout<<x<<" "
#define db1(x) cout<<x<<'\n'
#define db2(x,y) cout<<x<<" "<<y<<'\n'
#define db3(x,y,z) cout<<x<<" "<<y<<" "<<z<<'\n'
#define rep(i,n) for(int i=0;i<(n);++i)
#define repA(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pair(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define ff first
#define ss second
using namespace std;
using ll = long long int;
// ll ans = INT_MAX;

// ll recur(vector<pair<ll,ll>>&v,int i,ll h,ll move,vector<vector<ll>> &dp){

// 	if(h<=0){
// 		return 0;
// 	}

// 	if(i==v.size())
// 	{
// 		return INT_MAX;
// 	}

// 	if(dp[i][h]!=-1)
// 		return dp[i][h];

// 	ll op1 = recur(v,i,h-v[i].first,move+1,dp);
// 	if(op1!=INT_MAX)
// 		op1+=v[i].second;
// 	ll op2 = recur(v,i+1,h,move,dp);

// 	return dp[i][h]= min(op1,op2);

// }

void solve(){

	ll h;
	cin>>h;

	// vector<pair<ll,ll>>v;

	// vector<vector<ll>> dp(n+1,vector<ll>(h+1,-1));

	// int i=0;

	// rep(i,n){
	// 	ll a,b;
	// 	cin>>a>>b;
	// 	v.pb(make_pair(a,b));
	// }

	// ll ans = recur(v,0,h,0,dp);

	ll ans=0;
	ll count=0;
	while(h!=1){
		ans+=(pow(2,count));
		count++;
		h=h/2;
	}
	
	ans+=(pow(2,count));
	
	db1(ans);

}



int main(){

  
 int t=1;
 //cin>>t;


while(t--){
  solve();
  }
      
  



	return 0;
}


Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1000000007;
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(){
  int n; cin >> n;
  vi imos(1e5+3,0);
  REP(i,n){
    size_t tmp;
    cin >> tmp;
    imos[tmp]++;
    cin >> tmp;
    imos[tmp+1]--;
  }
  int sum = 0;
  int ans = 0;
  FOR(i,2,n+2) {
    sum += imos[i];
    if(i<=sum+1){
      ans = i-1;
    }
  }
  cout << ans << endl;
}



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

int main(){
    int h, a, b;
    cin >> h >> a >> b;
    
    int count = 0;
    for( int i = a; i <= b; i++ ){
        if( h % i == 0 ){
            count++;
        }
    }
    
    cout << count << endl;
}


Measured memory_bytes: 3112
/****************************************************
*   Template for coding contests                    *
*   Author    :    Sanjeev Sharma                   *
*   Email     :    thedevelopersanjeev@gmail.com    *
*****************************************************/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, k;
    cin >>n >>k;
    double ans = 0;
    for(int i = 1; i <= n; i++){
        double temp = 1.0 / n;
        int now = i;
        while(now < k){
            now *= 2;
            temp /= 2;
        }
        ans += temp;
    }
    cout <<fixed <<setprecision(12) <<ans;
    return 0;
}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let n: i32 = read(&mut stdin_lock, &mut buf, b'\n');
    let ans = (1..10).map(|i| i * 111).find(|&x| x >= n).unwrap();
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 100000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define OUT(a) cout<<(a)<<endl
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
	int h,n;
    cin>>h>>n;
    int sum=0;
    REP(i,n){
        int a;
        cin>>a;
        sum+=a;
    }
    if(sum>=h) OUT("Yes");
    else OUT("No");
	return 0;
}

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

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string s, t;
	cin>>s>>t;
	if(s.size() == (t.size()-1)) {
		for(int i=0; i<s.size(); i++) {
			if(s[i] != t[i]) {
				cout<<"No";
				return 0;
			}
		}
		cout<<"Yes";
	}
	else
		cout<<"No";
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
#define pb emplace_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=998244353;

int32_t main(){
	int n,d;
	cin>>n>>d;
	if(n%(2*d+1)==0) cout<<n/(2*d+1)<<endl;
	else cout<<n/(2*d+1)+1<<endl;	
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;

int main(){
    char s[4];
    for(int i=0;i<4;i++){
        cin>>s[i];
    }
    string ans="Good";
    for(int i=0;i<3;++i){
        if(s[i]==s[i+1]){
            ans="Bad";
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        String fa = s.substring(0, 2);
        String ea = s.substring(2);
        int f = Integer.parseInt(fa);
        int e = Integer.parseInt(ea);
        if(e == 0){
            if(f == 0 || f > 12){
                System.out.println("NA");
                return;
            }
            System.out.println("MMYY");
            return;
        }
        if(f == 0){
            if(e == 0 || e > 12){
                System.out.println("NA");
                return;
            }
            System.out.println("YYMM");
            return;
        }
        if(e <= 12){
            if(f <= 12){
                System.out.println("AMBIGUOUS");
                return;
            }else{
                System.out.println("YYMM");
                return;
            }
        }else{
            if(f <= 12){
                System.out.println("MMYY");
                return;
            }else{
                System.out.println("NA");
                return;
            }
        }
    }
}


Measured memory_bytes: 26800
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <stdio.h>
#include <vector>
#include <time.h>

//     MLE,TLE魔
//↓↓↓↓↓↓↓↓↓↓↓↓
#define int long long
//↑↑↑↑↑↑↑↑↑↑↑↑
//     MLE,TLE魔
#define endre getchar();getchar();return 0
#define moder 1000000007
#define inf 5000000000000000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x%mod;
		}
		x = x * x%mod;
		y >>= 1;
	}
	return res;
}
int kai(int x) {
	if (x == 0)return 1;
	return (kai(x - 1)*x) % moder;
}
int comb(int x, int y) {
	return kai(x)*mod_pow(kai(x - y), moder - 2, moder) % moder*mod_pow(kai(y), moder - 2, moder) % moder;
}
struct edge { int to, cost; };
int dx[5] = { 0,1,0,-1 }, dy[5] = { 1,0,-1,0 };
map<int, int>factor(int x) {
	map<int, int>res;
	for (int i = 2; i*i <= x; i++) {
		while (x%i == 0) {
			x /= i;
			res[i]++;
		}
	}
	if (x != 1)res[x]++;
	return res;
}
/*--------Library Zone!--------*/

int n, maxi, x[55], y[55], ans = inf;
signed main() {
	cin >> n >> maxi;
	rep(i, n) {
		cin >> x[i] >> y[i];
	}
	rep(i, n) {
		rep(j, n) {
			if (x[i] <= x[j])continue;
			rep(k, n) {
				rep(l, n) {
					if (y[k] <= y[l])continue;
					int cnt = 0;
					rep(m, n) {
						if (x[m] <= x[i] && x[m] >= x[j] && y[m] <= y[k] && y[m] >= y[l])cnt++;
					}
					if (cnt >= maxi) {
						ans = min(ans, (x[i] - x[j])*(y[k] - y[l]));
					}
				}
			}
		}
	}
	cout << ans << endl;
	endre;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,N;
string str,ans;
int used[10],dig[10];

ll s2i(string a){
  ll res=0;
  for(int i=0;i<a.size();i++) res=res*10+a[i]-'0';
  return res;
}

string i2s(int a[10]){
  string res;
  for(int i=0;i<n;i++) res+=a[i]+'0';
  return res;
}

bool check(){
  ll p=s2i(str);
  ll a=s2i(ans);
  ll b=s2i(i2s(dig));
  ll A=min(abs(p-a),N-abs(p-a));
  ll B=min(abs(p-b),N-abs(p-b));
  return (A<B)||(A==B&&a>b);
}

void dfs(int idx){
  if(idx==n&&check())ans=i2s(dig);
  if(idx==n)return;
  for(int i=0;i<10;i++){
    if(used[i])continue;
    used[i]=1;
    dig[idx]=i;
    dfs(idx+1);
    used[i]=0;
  }
}

int main(){
  cin>>str;
  n=str.size();
  memset(dig,-1,sizeof(dig));
  N=1;
  for(int i=0;i<n;i++) N*=10,ans+=i+'0';
  dfs(0);
  cout <<ans<<endl;
  return 0;
}

Measured memory_bytes: 3188
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    private const int INF = 1000000007;
    private struct Pair<T> { public T x, y; public Pair(T x, T y) { this.x = x; this.y = y; } }
    public static void Solve()
    {
        int N = NextInt();
        int K = NextInt();
        Console.WriteLine((K == 1 ? 0 : N - K));
    }
    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}

public class Input
{
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static char NextChar() { Confirm(); return char.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}


Measured memory_bytes: 11220
from collections import Counter
from functools import lru_cache

@lru_cache(maxsize=20000)
def combi2(n):
  return n * (n-1) // 2

N = int(input())
A = list(map(int, input().split()))
c = Counter(A)

# print(c)

base = 0
for value in c.values():
  base += combi2(value)

for a in A:
  ans = base
  ans -= combi2(c[a])
  ans += combi2(c[a]-1)
  print(ans)


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

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++) 
#define REP(i, n) for (int i = 0; i < (n); i++)

int main(int argc, char const *argv[])
{
    string res = "AC\n";
    int cnt = 0; 
    string S; cin >> S;
    if (S[0] != 'A') res = "WA\n";
    FOR(i, 1, S.size()){
        if (isupper(S[i])){
            if (i == 1 || i == S.size() - 1 || S[i] != 'C'){
                res = "WA\n";
            }
            cnt++;
        }
    }
    if (cnt != 1) res = "WA\n";
    cout << res;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define db double
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repn(i,a,b)   for(ll i=a;i>=b;i--)
#define F first
#define S second
#define qi queue<ll>
#define pii pair<ll,ll>
#define vi vector<ll>
#define si set<ll>
#define vii vector<pii>
#define mi multiset<ll>
#define mii multiset<pii>
#define MI map<ll,ll>
#define pb push_back
#define mp  make_pair
#define all(v) (v).begin(), (v).end()
#define allr(v) (v).rbegin(), (v).rend()
#define mod 998244353
#define mod2 998244353

const ll N=1e12;

int fexp(int a, int b){int ans = 1;while(b){if(b&1) ans = ans*a%mod2; b/=2;a=a*a%mod2;}return ans;}
int inverse(int a, int p){return fexp(a, p-2);}

ll solve(){
    ll a;
    cin>>a;
    vi v(2*a,0);
    rep(i,0,2*a) cin>>v[i];
    sort(all(v));
    cout<<v[a+1]-v[a]<<"\n";
    return 0;
}

signed main(){
    IOS
// 	#ifndef ONLINE_JUDGE
//     	freopen("input.txt", "r", stdin);
// 		freopen("output.txt", "w", stdout);
// 	#endif
    ll n,d;
    cin>>n>>d;
    d=d*d;
  	ll ans=0;
  	rep(i,0,n){
      	ll x,y;
      	cin>>x>>y;
      	ll a=x*x;
      	ll b=y*y;
      	if(a+b<=d){
            ans++;
        }
    }
    cout<<ans;
    return 0;
}
// size_t f= str.find(string s,0); find s in str from start
// if found then (f != string::npos)
// m.insert({x,y}); m[x]=y;

Measured memory_bytes: 3616
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N;
  cin >> N;
  vector<ll> a(N);
  bool all_is_even = true;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    all_is_even &= (a[i] % 2 == 0);
  }
  string ans = (all_is_even) ? "second" : "first";
  cout << ans << endl;
  return 0;
}

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


int main() {
    ll S; cin >> S;
    ll h = 1;
    ll w = S;
    if(S > 1000000000){
        h = (S / 1000000000);
        if(S%1000000000!=0) h++;
        w = 1000000000*h-S;
        cout << 0 << " " << 0 << " " << 1000000000 << " " << 1 << " " << w << " " <<  h << endl;

    }
    else{
        w = S; h = 1;
        cout << 0 << " " << 0 << " " << w << " " << 0 << " " << 0 << " " <<  h << endl;
    }
    //cout << S / 1000000000 << endl;
}

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

int main() {
  int N;
  std::cin >> N;
  std::vector<int> l(N);
  std::vector<int> r(N);
  for (int i = 0; i < N; ++i) {
    std::cin >> l[i] >> r[i];
  }

  int num = 0;
  for (int i = 0; i < N; ++i) {
    num += r[i] - l[i] + 1;
  }
  std::cout << num << std::endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;
const int MOD = 1e9+7;
using ll = long long;
using vi = vector<int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(x) x.begin(), x.end()
int main() {
  int a;
  cin >> a;
  int b = a/100,c= a%100;
  if(1<=b&&b<=12){
        if(1<=c&&c<= 12)cout << "AMBIGUOUS" << endl;
        else cout << "MMYY" << endl;
    }else{
        if(1<=c&&c<=12)cout << "YYMM" << endl;
        else cout << "NA" << endl;
    }
} 


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

int main() {
    int n; cin>>n;
    int b[n]={0};
    int a[n-1];
    rep(i,0,n-1){
        cin>>a[i];
        a[i]--;
        b[a[i]]++;
    }
    rep(i,0,n) cout<<b[i]<<endl;
}

Measured memory_bytes: 5196
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

int cnt[30];
string s;

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> s;
	FOR(i, s.size()) cnt[s[i]-'a']++;
	bool ok = true;
	FOR(i, 26) {
		if (cnt[i] & 1) ok = false;
	}
	cout << (ok ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
class WeightedUnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
        self.weight = [0] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            px = self.find(self.parents[x])
            self.weight[x] += self.weight[self.parents[x]]
            self.parents[x] = px
            return px

    def union(self, x, y, w):
        w += self.weight[x] - self.weight[y]
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y, w = y, x, -w
        self.parents[x] += self.parents[y]
        self.parents[y] = x
        self.weight[y] = w
        return

    def weig(self, x):
        self.find(x)
        return self.weight[x]

    def diff(self, x, y):
        return self.weig(y) - self.weig(x)
    
    def same(self, x, y):
        return self.find(x) == self.find(y)

while 1:
    n = int(input())
    if n == 0:
        exit()
    Q, d = [], set()
    while n:
        _, a, _, p, b = input().split()
        Q += (a, b, int(p[3:])),
        d |= {a, b}
        n -= 1
    D = {c : e for e, c in enumerate(d)}
    UF = WeightedUnionFind(len(d))
    for a, b, p in Q:
        a, b = D[a], D[b]
        if UF.same(a, b):
            if p != UF.diff(a, b):
                print("No"); break
        else:
            UF.union(a, b, p)
    else:
        print("Yes")


Measured memory_bytes: 5680
using namespace std;
#include<bits/stdc++.h>
#define int long long
#define pb push_back 
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

signed main()
{
    IOS;
    int n; cin>>n;
    string skeleton;

    for (int i=0; i<n; ++i)
    {
        int x,y;
        cin>>x>>y;
        if ( x==y )
            skeleton+='1';
        else
            skeleton+='0';
    }    

    int pos = skeleton.find("111");

    if ( pos==-1 )
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;
}


Measured memory_bytes: 3612
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

template<class T>
bool ckmin(T &a, const T &b) {
    return a > b ? a = b, 1 : 0;
}

template<class T>
bool ckmax(T &a, const T &b) {
    return a < b ? a = b, 1 : 0;
}

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class CMaximalValue {
public:
    void solve(std::istream &in, std::ostream &out) {
        int n;
        in >> n;
        vi B(n - 1);
        in >> B;
        int res = 0;
        FOR(i, 0, n) {
            int x = min(i ? B[i - 1] : INT_MAX, i < n - 1 ? B[i] : INT_MAX);
            res += x;
        }
        out << res << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    CMaximalValue solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3612
#! python3
# printChessboard.py - 長方形を描くプログラム

flag = True
rectangles = []
while flag:
    size = [int(i) for i in input().split()]
    H = size[0]
    W = size[1]
    if H == 0:
        flag = False
        break

    rectangle = []
    for h in range(H):
        row = []
        for w in range(W):
          if h % 2 == 0:
            if w % 2 == 0:
              row.append('#')
            else :
              row.append('.')
          else :
            if w % 2 == 0:
              row.append('.')
            else :
              row.append('#')
        rectangle.append(row)
    rectangles.append(rectangle)

for rectangle in rectangles:
    for row in rectangle:
        print(''.join(row))
    print('')


Measured memory_bytes: 5984
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <utility>
using namespace std;

int main() {

	int n;
	cin>>n;
	int az[n][26]={};
	for(int i=0; i<n; i++){
		string s;
		cin >> s;
		for(int k=0; k<s.length(); k++){
			az[i][s[k]-'a']++;
		}
	}
	
	for(int i=0; i<26; i++){
		int num=100;
		for(int c=0; c<n; c++){
			num=min(num,az[c][i]);
		}
		
		for(int k=0; k<num; k++){
			cout<<(char)(i+'a');
		}
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cctype>
#include<climits>
#include<string>
#include<bitset>
#include<cfloat>
#include<iomanip>
#include<numeric>

//#define int long long
#define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x,v) for(auto& (x) : (v))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fsort(v,lambda) sort(all((v)),(lambda))
#define vin(v) rep(i,(v).size())cin >> (v)[i];
#define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second

using namespace std;
using ll =  long long;
using pint =  pair<int,int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vpint = vector<pint>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>void put_double(T a){if(cout.precision()!=12)cout<<setprecision(12);cout<<a<<endl;}
template<class T>void print(T a){cout << a << endl;}
//lambda: [](int x, int y){return x<y;}

signed main(void) {
    string o, e; cin >> o >> e;
    rep(i, o.size()) {
        cout << o[i];
        if(i < e.size()) cout << e[i];
    }

    return 0;
}


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

#define ll long long
#define F first
#define S second
#define ii pair < int , int >
#define ever (;;)

const int N = 200100;

int n;
vector <ll> a,h,pos;
ll ans;

struct segtree
{
    int sz;

    vector <ll> maxs;

    void init(int n)
    {
        sz = n;
        maxs.resize(n<<2);
    }

    void update(int nd,int l,int r,int pos,ll val)
    {
        if( l == pos && r == pos )
        {
            maxs[nd] = val;
            return;
        }

        int mid = (l+r)/2;

        if( pos <= mid )
            update(nd<<1,l,mid,pos,val);
        else
            update(nd<<1|1,mid+1,r,pos,val);

        maxs[nd] = max( maxs[nd<<1] , maxs[nd<<1|1] );
    }

    void update(int pos,ll val) { update(1,1,sz,pos,val); }

    ll querymax(int nd,int l,int r,int from,int to)
    {
        if( from <= l && r <= to )
            return maxs[nd];
        if( from > r || l > to )
            return 0;

        int mid = (l+r)/2;

        return max( querymax(nd<<1,l,mid,from,to) , querymax(nd<<1|1,mid+1,r,from,to) );
    }

    ll querymax(int l,int r) { return querymax(1,1,sz,l,r); }
};

int main()
{
    scanf("%d",&n);
    h.resize(n+10);
    a.resize(n+10);
    pos.resize(n+10);

    for(int i=1;i<=n;i++)
    {
        scanf("%lld",&h[i]);
        pos[h[i]] = i;
    }
    for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);

    segtree st;
    st.init(n);

    for(int i=n;i>=1;i--)
    {
        ll x = st.querymax(pos[i],n);

        ans = max( ans , x+a[pos[i]] );

        st.update(pos[i],x+a[pos[i]]);
    }

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


Measured memory_bytes: 14364
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

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

int N, M, Q;
int a[50], b[50], c[50], d[50];

int solve(vector<int> A, int k) {
    if (k == N) {
        int score = 0;
        rep(i,Q) if (A[b[i]] - A[a[i]] == c[i]) score += d[i];
        return score;
    }
    int ans = 0;
    int bottom = (k == 0 ? 1 : A[k - 1]);
    for (int i = bottom; i <= M; i++) {
        A[k] = i;
        ans = max(ans, solve(A, k + 1));
    }
    return ans;
}

int main() {

    cin >> N >> M >> Q;
    rep(i,Q) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        a[i]--; b[i]--;
    }
    vector<int> A(N, 0);
    cout << solve(A, 0) << endl;
    
    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

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

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

void solve()
{
	string s;
	cin>>s;
	int ans=0;
	int res=0;
	rep(i,3){
		if(s[i]=='R')++res;
		else {
			res=0;
		}
		chmax(ans,res);
	}
	cout<<ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 3648
h, w = map(int,input().split())
n = int(input())
a_l = list(map(int,input().split()))

ans = []
for _ in range(h):
    ans.append([0]*w)

direction = 0
posx = 0
posy = 0
for i in range(n):
    for j in range(a_l[i]):
        ans[posy][posx] = i+1
        if w == 1:
            direction = 1
        if direction == 0:
            posx += 1
            if posx == w-1:
                direction = 1
        elif direction == 1:
            posy += 1
            direction = 2
        elif direction == 2:
            posx -= 1
            if posx == 0:
                direction = 3
        elif direction == 3:
            posy += 1
            direction = 0

for val in ans:
    print(' '.join(map(str,val)))

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

int s(int n){
  int ans=0;
  while(n){
    ans+=n%10;
    n/=10;
  }
  return ans;
}

int main(){
  int n;
  scanf("%d",&n);
  if(n%s(n)==0)
    printf("Yes\n");
  else
    printf("No\n");
}


Measured memory_bytes: 128
//38
#include<iostream>
#include<algorithm>
#include<utility>

using namespace std;

int main(){
  for(int n;cin>>n,n;){
    pair<int,int> e[200];
    for(int i=0;i<n;i++){
      int m,a,b;
      cin>>m>>a>>b;
      e[2*i]=make_pair(a,m);
      e[2*i+1]=make_pair(b,-m);
    }
    sort(e,e+2*n);
    int w=0;
    int i;
    for(i=0;i<2*n;i++){
      w+=e[i].second;
      if(w>150)break;
    }
    cout<<((i<2*n)?"NG":"OK")<<endl;
  }
  return 0;
}

Measured memory_bytes: 1156
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void map(string s,vector<int>&t){
	int point=0;
	int flag=0;
	int pen=0;
	while(point<s.size()){
		if(s[point]=='A'){
			flag=1;
			point++;
			t.push_back(pen);
		}else if(flag==1&&s[point]=='C'){
			flag=0;
			pen++;
			t.push_back(pen);
			point++;
		}else{
			flag=0;
			point++;
			t.push_back(pen);
		}
	}
	return;
}
int count(vector<int> t,int n){
	//t[i]<=n<t[i+1]となるiを出力
	int ok=-1,ng=t.size(),mid;
	while(ng-ok>1){
		mid=(ok+ng)/2;
		if(t[mid]<=n){
			ok=mid;
		}else{
			ng=mid;
		}
	}
	return ok;
}
int main(){
	int n,q;
	string s;
	cin>>n>>q>>s;
	int ll,rr;
	vector<int>l(q);
	vector<int>r(q);
	for(int i=0;i<q;i++){
		cin>>ll>>rr;
		l[i]=ll-1;
		r[i]=rr-1;
	}
	vector<int> t;
	map(s,t);
	/*
	for(int i=0;i<t.size();i++){
		cout<<t[i]<<endl;
	}
*/

	for(int i=0;i<q;i++){
		//cout<<count(t,l[i])<<endl;
		//cout<<count(t,r[i])<<endl;
		cout<<t[r[i]]-t[l[i]]<<endl;
	}

	return 0;
}

Measured memory_bytes: 2296