akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

// vectorの重複削除
// std::sort(test.begin(), test.end());
// test.erase(std::unique(test.begin(), test.end()), test.end());

using namespace std;
using ll = long long;
using P = pair<int, int>; // vector<P> ba(n); みたいな感じですぐ使える ba[i] = P(a, b); make_pairをしなくてもいい
// typedef vector<int> v;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}
#define rep(i, c) for(int i = 0; i < int(c); i++)
#define ALL(x) (x).begin(), (x).end() //sort(ALL(obj))みたいな
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値
#define pb push_back //
// const int MOD = 1000000007;
// string alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
// printf("%.20f\n", ans); あれ
// const double PI = 3.141592653589793238462643383;


int main() {
  int a,b,k; cin>>a>>b>>k;
  std::vector<int> v;
  int num = a;
  rep(i,k) {
    if (num > b) {
      rep(l,v.size()) {
        cout << v[l] << endl;
      }
      return 0;
    }
    v.pb(num);
    num++;
  }
  int max_num = num-1;
  num = b-k+1;
  rep(j,k) {
    if (num <= a) break;
    if (max_num < num) {
      v.pb(num);
    }
    num++;

  }
  rep(i,v.size()) {
    cout << v[i] << endl;
  }
}


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

int q, r;

int main(){
    scanf("%d", &q);
    for(int x, k; q--; ){
        scanf("%d%d", &x, &k);
        while(x % k) x -= (x % k + x / k) / (x / k + 1) * (x / k + 1);
        r ^= (x / k);
    }
    puts(r ? "Takahashi" : "Aoki");
}

Measured memory_bytes: 256
from fractions import gcd

def main():
    mod = 10**9 + 7

    N = int(input())
    A = input().split()
    AP = set(A)
    num = 1
    for n in AP:
        num = (num*int(n))//gcd(num,int(n))

    t = 0
    for n in A:
        t = (t + num//int(n))
    print(t%mod)


if __name__ == "__main__":
    main()


Measured memory_bytes: 6496
<?php
list($n, $m, $x, $y) = explode(" ", trim(fgets(STDIN)));
$xArray = explode(" ", trim(fgets(STDIN)));
$yArray = explode(" ", trim(fgets(STDIN)));
$xArray[] = $x;
$yArray[] = $y;
echo min($yArray) > max($xArray) ? "No War" : "War";

Measured memory_bytes: 4604
#include <iostream>
#include <bitset>
#include <vector>
using namespace std;

int main() {
    int n; cin >> n; // 実行回数を入力
    int L,R;         // 最後に入力
    
    // エラトステネスのふるい
    bitset<1000000> is_prime(0); // 十分大きなサイズを確保します
    for (int i = 2; i <= 100000; ++i) is_prime.set(i); // とりあえず全部ふるいに入れます
    for (int i = 2; i <= 100000; ++i) {
        if (is_prime[i]) { // 素数 i を発見したら
            for (int j = i * 2; j <= 100000; j += i) {
                is_prime.reset(j); // i の倍数をふるい落とす
            }
        }
    }
    
    // 2017-like 数かどうか
    vector<int> a(100000+1, 0);
    for (int i = 0; i < 100000+1; ++i) {
        if (i % 2 == 0) continue;
        if (is_prime[i] && is_prime[(i+1)/2]) a[i] = 1;
    }

    // 累積和
    vector<int> s(100000+1, 0);
    for (int i = 0; i < 100000+1; ++i) s[i+1] = s[i] + a[i];


    // 結果出力
  for(int i=0;i<n;++i){
    cin>>L>>R;
    cout << s[R+1]-s[L] << endl;
  }
}

Measured memory_bytes: 1536
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main() {
    ull N, K;
    cin >> N >> K;

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

    ull IX = 0ULL;
    vector<int> C(64);
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < 64; ++j) {
            C[j] += (A[i] >> j) & 1;
        }
    }

    for (int i = 0; i < 64; ++i) {
        if (C[i] <= N - C[i]) IX |= 1ULL << i;
    }

    ull ans = 0;
    for (int i = 0; i < 64; ++i) {
        ull mask = (1ULL << i) - 1ULL;
        ull Xi = (K & ~mask) | (IX & (mask >> 1));

        if (Xi > K) continue;

        ull xorSum = 0;
        for (int j = 0; j < N; ++j) {
            xorSum += A[j] ^ Xi;
        }

        ans = max(ans, xorSum);
    }

    cout << ans << std::endl;
}

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

int main()
{
  int N, M;
  cin >> N >> M;
  //int broken[N + 1];
  vector<int> broken(N + 1);
  for (int i = 0; i < M; i++)
  {
    int a;
    cin >> a;
    broken[a] = 1;
  }
  //int dp[N + 2];
  vector<int> dp(N + 2);
  const int mod = 1000000007;
  dp[N] = 1;
  for (int i = N - 1; i >= 0; i--)
  {
    if (broken[i])
    {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i + 1] + dp[i + 2]) % mod;
  }
  cout << dp[0] << endl;
  return 0;
}

Measured memory_bytes: 1024
import math


def list_divisor(n):
    divisor1 = {1}
    for i in range(2, int(math.sqrt(n)) + 1):
        if n % i == 0:
            divisor1.add(i)

    divisor2 = {n}
    for i in divisor1:
        divisor2.add(n // i)

    return divisor1 | divisor2


def main():
    n = int(input().rstrip())

    sub_only = len(list_divisor(n - 1)) - 1

    div_included = 0
    for d in (list_divisor(n) - {1}):
        n1 = n // d
        while n1 % d == 0:
            n1 = n1 // d

        if n1 == 1:
            div_included += 1
            continue

        if d in list_divisor(n1 - 1):
            div_included += 1

    print(sub_only + div_included)


if __name__ == '__main__':
    main()


Measured memory_bytes: 40940
#include <stdio.h>

int main()
{

    int h, w, i, j;

    while (1)
    {
        scanf("%d %d", &h, &w);
        if (h == 0 && w == 0)
        {
            break;
        }

        for (j = 1; j <= h; j++)
        {
            for (i = 1; i <= w; i++)
            {
                if ((i + j) % 2 == 0)
                {
                    printf("#");
                }
                else
                {
                    printf(".");
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


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

using namespace std;


int main(void) {
    int a,N,M,X,Y,x,y,z;

    cin >> N >> M >> X >> Y >> x;

    for( z=1 ; z<N ; z++ ){
        cin >> a;
        if( x < a ) x = a;
    }

    cin >> y;
    for( z=1 ; z<M ; z++ ){
        cin >> a;
        if( y > a ) y = a;
    }

    if( x<y && x<Y && y>X ) cout << "No War\n";
    else cout << "War\n";


}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int a[100],i,j,n,m,count=0;

  scanf("%d",&n);

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

  for(i=0;i<n-1;i++){
    for(j=n-1;j>=i+1;j--){

      if(a[j]<a[j-1]){
	m=a[j];
	a[j]=a[j-1];
	a[j-1]=m;
	count++;
      }

    }
  }

  for(i=0;i<n;i++){
    if(i>0) printf(" ");
    printf("%d",a[i]);
  }
  printf("\n%d\n",count);

  return 0;
}

Measured memory_bytes: 604
s = [list(input()) for _ in range(3)]

c = ['A', 'B', 'C']
d = ['a', 'b', 'c']

p = 0
while 1:
    if len(s[p]) == 0:
        print(c[p])
        exit()
    n = s[p][0]
    del s[p][0]
    p = d.index(n)


Measured memory_bytes: 3060
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;

const ll LINF = 1001002003004005006LL;
const int INF = 1001001001;

const int mod = 1000000007;

int main() {
    int n; cin >> n;
    ll d; cin >> d;
    d = d*d;
    vector<ll> x(n), y(n);
    rep(i,n) cin >> x[i] >> y[i];
    int ans = 0;
    rep(i,n) {
        ll tmp = x[i]*x[i]+y[i]*y[i];
        if (tmp<=d) ++ans;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6424
//In The Name Of God
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define L(x) (2*(x))
#define R(x) ((2*(x))+1)
#define pii pair<int, int>
#define pb push_back
using namespace std;
const int N = 2e6 + 5, Mod = 1e9 + 7, P = 727, Lg = 17, TOF = 1900;

int main(){
      ios_base::sync_with_stdio(0); cin.tie(0);
      int a[4];
      for(int i = 0; i < 4; i++)
            cin >> a[i];
      sort(a, a + 4);
      if(a[0] == 1 && a[1] == 4 && a[2] == 7 && a[3] == 9)
            return cout << "YES", 0;
      return  cout << "NO", 0;

}


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

using namespace std;


#define int long long
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)


using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

signed main() {
    int n, k;
    cin >> n >> k;
    for (int b = 0; b < (1 << n); b++) {
        if (__builtin_popcount(b) != k) continue;
        cout << b << ":";
        for (int i = 0; i < n; i++)
            if ((b >> i) & 1) cout << " " << i;
        cout << "\n";
    }
    cout << flush;
    return 0;
}


Measured memory_bytes: 3096
#include<stdio.h>
#include<stdlib.h>

int main()
{
	char S[100];
	int N;
	int count=0;
	int strongpalindrome=1;
	scanf("%s",&S);
	for(int i=0;i<100;i++)
	{
		if (S[i] < 'a') break;
		if (S[i] > 'z') break;
		count++;
	}
	for(int i=0;i<count/2;i++) 
		if (S[i]!=S[count-1 - i]) strongpalindrome=0;
	for(int i=0;i<count/4;i++) 
		if (S[i]!=S[count/2 - i-1]) strongpalindrome=0;
	for(int i=0;i<count/4;i++)
		if (S[i+count/2 +1]!=S[count-1 - i]) strongpalindrome=0;
	if (strongpalindrome==1)
	{
		printf("Yes\n");
	}else{
		printf("No\n");
	}

	return 0;
}


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

v = {}
for i in range(m):
    a,b = map(int,input().split())
    if a not in v:
        v[a] = [b]
    else:
        v[a].append(b)

    if b not in v:
        v[b] = [a]
    else:
        v[b].append(a)

st = [1]

ans = [-1 for i in range(n)]
ans[0] = 0

while True:
    buf = set()
    updates = {}
    for s in st:
        nex = v[s]
        for to in nex:
            if ans[to-1] != -1:
                continue
            else:
                buf.add(to)
                # buf.append(to)
                updates[to-1] = s
    for u in updates.keys():
        ans[u] = updates[u]
    st = buf
    # print(st)
    if len(buf) == 0:
        break

print("Yes")
for i in range(1,n):
    print(ans[i])



Measured memory_bytes: 136440
#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define dbg(x) cout<<#x<<" "<<x<<endl
#define clr(x,v) memset(x, v, sizeof(x))
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const double PI = acos(-1.0);

int sum(int l, int r, int pre[])
{
    if(r < 0)
        return 0;
    l = max(l, 0);
    return (l ? pre[r] - pre[l - 1] : pre[r]);
}

void cp()
{
    int n, k, c;
    cin >> n >> k >> c;
    string s;
    cin >> s;
    bool did_i[n + 1];
    clr(did_i, false);
    int count = 0;
    for(int i = 0; i < n; i++)
    {
        if(s[i] == 'o')
        {
            did_i[i] = true;
            i += c;
            count++;
        }

    }
    if(count != k)
        return;
    vector<int> days;
    for(int i = n - 1; i >= 0; i--)
    {
        if(s[i] == 'o')
        {

            if(did_i[i])
            {
                days.pb(i + 1);
            }
            i -= c;
        }
    }
    for(int i = sz(days) - 1; i >= 0; i--)
    {
        cout << days[i] << endl;
    }
}

int main()
{
    FASTIO;
    int t;
    t = 1;
    // cin >> t;
    while(t--)
    {
        cp();
    }
    return 0;
}

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

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

    //500円玉出払った残りの額
    int rest = N - N / 500 * 500;

    if (rest <= A) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAXN 52
#define MOD 1000000007
#define pii pair<int,int>
#define lowbit(x) ((x)&(-(x)))

using namespace std;
void get(int &v)
{
	char c;
	while((c=getchar())!=EOF&&isdigit(c)==0);
	v=c-'0';
	while((c=getchar())!=EOF&&isdigit(c))
		v=(v<<1)+(v<<3)+c-'0';
	return ;
}
int get()
{
    int v;
	char c;
	while((c=getchar())!=EOF&&isdigit(c)==0);
	v=c-'0';
	while((c=getchar())!=EOF&&isdigit(c))
		v=(v<<1)+(v<<3)+c-'0';
	return v;
}
int dp[MAXN+2];
char Map[2][MAXN+2];
bool same(int x)
{
	return Map[0][x]==Map[1][x];
}
int main()
{
	int n,i;
	get(n);
	scanf("%s%s",Map[0]+1,Map[1]+1);
	dp[0]=1;
	for(i=1;i<=n;)
	{
		if(same(i))
		{
			if(i==1)
				dp[i]=3;
			else if(same(i-1))
				dp[i]=2*dp[i-1]%MOD;
			else
				dp[i]=dp[i-2];
			i++;
		}
		else
		{
			if(i==1)
				dp[i]=6;
			else if(same(i-1))
				dp[i]=2*dp[i-1]%MOD;
			else
				dp[i]=3LL*dp[i-2]%MOD;
			i+=2;
		}
	}
	printf("%d\n",same(n)?dp[n]:dp[n-1]);
    return 0;    
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cassert>
using namespace std;

#define REP(i,n) for (int i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long ll;

int main ()
{

    ll N; cin >> N;
    vector < ll > a(N);
    REP(i,N) cin >> a[i];

    ll a_n = 0;
    REP(i,N) a_n += a[i];

    int idx = -1;
    ll min_d = 1e18;

    REP(i,N) {
        if (min_d > abs(a_n - a[i] * N)) {
            min_d = abs(a_n - a[i] * N);
            idx = i;
        }
    }

    cout << idx << endl;

    return 0;
}


Measured memory_bytes: 256
price, size = map(int, input().split())
dislikes = list(map(int, input().split()))
likes = list(set(range(10)) - set(dislikes))
digits = [int(digit) for digit in str(price)]
r_digits = list(reversed(digits))
res = []
for i in range(len(r_digits)):
    if r_digits[i] in likes:
        res.append(r_digits[i])
    elif max(likes) > r_digits[i]:
        res = [min(likes) for i in range(i)] + [min(x for x in likes if x > r_digits[i])]
    else:
        res = [min(likes) for i in range(i+1)]
        if i == len(r_digits)-1:
            res.append(min(x for x in likes if x > 0))
            
        else:
            r_digits[i+1] += 1

ans = "".join([str(num) for num in list(reversed(res))])
print(ans)

Measured memory_bytes: 3064
import numpy as np
a,b=map(int,input().split())
#print(a)
n_l=list(map(int,input().split()))
n_l.append(n_l[0]+a)
n_l=list(sorted(n_l))
# 一次元配列を作成
arr = np.array(n_l)

# 隣り合う要素同士の差分を計算
diff = np.diff(arr)
#print(diff)
#print(max(diff))
print(a-max(diff))

Measured memory_bytes: 34140
#include<iostream>
#include <queue>
#include <vector>
using namespace std;

int main(){
    //input
    long long N;
    cin >> N;
    long long A[N][N], A_copy[N][N];
    long long i,j,k;
    for(i=0; i<N; i++){
        for(j=0; j<N; j++){
            cin >> A[i][j];
            A_copy[i][j] = A[i][j];
        }
    }

    //calc_minimized or not
    for(k=0; k<N; k++){
        for(i=0; i<N; i++){
            for(j=0; j<N; j++){
                A_copy[i][j] = min(A_copy[i][j],A_copy[i][k]+A_copy[k][j]);
            }
        }
    }
    bool minimized = 1;
    for(i = 0; i<N; i++){
        for(j=0; j<N; j++){
            if(A[i][j]!=A_copy[i][j]){
                minimized = 0;
            }
        }
    }
    
    //calc_keiyu or not
    long long sum=0;
    bool keiyu;
    for(i=0; i<N; i++){
        for(j=i+1; j<N; j++){
            keiyu = 0;
            for(k=0; k<N; k++){
                if(k==i) continue;
                if(k==j) continue;
                if(A[i][j]==A[i][k]+A[k][j]) keiyu = 1;
            }
            if(keiyu==0) sum += A[i][j];
        }
    }

    //answer
    if(minimized == 1) cout << sum << endl;
    else cout << -1 << endl;
    system("pause");
    return 0;
}

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

static const long long mod = 1000000007;
struct mint {
  long long x;
  mint(ll x = 0):x(x%mod) {}
  mint& operator+=(const mint a) {
    (x += a.x) %= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    (x += mod-a.x) %= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint ret(*this);
    return ret += a;
  }
  mint operator-(const mint a) const {
    mint ret(*this);
    return ret -= a;
  }
  mint operator*(const mint a) const {
    mint ret(*this);
    return ret *= a;
  }
  mint pow(ll t) const {
    if(t==0) return mint(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 ret(*this);
    return ret /= a;
  }
};
ostream &operator<<(ostream& os, const mint& x) {
  os << x.x;
  return os;
}
class modutils {
  vector<mint> fact, invfact;
public:
  modutils(int n = 2000005):fact(n+1),invfact(n+1) {
    fact[0] = 1;
    for(int i=1; i<=n; i++) fact[i] = fact[i-1] * i;
    invfact[n] = fact[n].inv();
    for(int i=n; i>=1; i--) invfact[i-1] = invfact[i] * i;
  }
  mint pow(mint x, ll n) {
    return x.pow(n);
  }
  mint comb(ll n, ll k) {
    if(n<0 || k<0 || n<k) return 0;
    return fact[n] * invfact[k] * invfact[n-k];
  }
  mint perm(ll n, ll k) {
    if(n<0 || k<0 || n<k) return 0;
    return fact[n] * invfact[n-k];
  }
  mint fac(ll n) {
    return fact[n];
  }
};
modutils mutil;

int main(){
  ll N, M;
  cin >> N >> M;

  mint ret = mutil.perm(M,N);

  REP(i,1,N+1){
    if(i%2==1){
      ret -= mutil.comb(N,i) * mutil.perm(M-i,N-i);
    }else{
      ret += mutil.comb(N,i) * mutil.perm(M-i,N-i);
    }
  }

  ret *= mutil.perm(M,N);
  
  cout << ret << endl;
  
  return 0;
}



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

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define st first
#define nd second
#define endl '\n'
#define what_is(x) cerr << #x << " is " << x << endl;
#define what_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << e << ' '; cerr << '\n'; //vector, set
#define what_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << x[i] << ' '; cerr <<  '\n'; //n first element of array
#define cerr_pair(x) '{' << x.st << ", " << x.nd << '}'
#define pwhat_is(x) cerr << #x << " is " << cerr_pair(x) << endl;
#define pwhat_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << cerr_pair(e) << ' '; cerr << '\n'; //vector, set
#define pwhat_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << cerr_pair(x[i]) << ' '; cerr <<  '\n'; //n first element of array
#define int long long
// #define pow mypow

typedef pair<int,int> pii;
const int N = 1e5+5;
const int INF = 1e9+5;
const int MOD = 1e9+7;

map<string, int> Map;
int32_t main()
{
	IOS
	// freopen("input.txt", "r", stdin);
	string s, t, u;
	int a, b;
	cin >> s >> t >> a >> b >> u;
	Map[s] = a;
	Map[t] = b;
	Map[u] -= 1;
	cout << Map[s] << ' ' << Map[t] << endl; 
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp33 {
    class Program {
        static void Main(string[] args) {
            var st = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = st[0];
            int M = st[1];

            Console.WriteLine(Math.Pow(2, M) * (1900 * M + 100 * (N - M)));


        }
    }
}


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

using namespace std;

typedef long long/*--------------------*/lli;
typedef long double/*------------------*/ld;
typedef pair<lli, lli >/*--------------*/plli;
typedef vector<lli>/*------------------*/vlli;
typedef vector<plli >/*----------------*/vplli;

#define rep(i,a)/*---------------------*/for(i = 0 ; i < a ; i++)
#define repr(i,a)/*--------------------*/for(i = a ; i >= 0 ; i--)
#define REP(i,a,b)/*-------------------*/for(i = a ; i <= b ; i++)
#define REPR(i,a,b)/*------------------*/for(i = a ; i >= b ; i--)

#define scan(N)/*----------------------*/scanf("%lld",&N)
#define print(N)/*---------------------*/printf("%lld",N)
#define scan2(N1,N2)/*-----------------*/scanf("%lld %lld",&N1,&N2)
#define print2(N1,N2)/*----------------*/printf("%lld %lld",N1,N2)
#define scan3(N1,N2,N3)/*--------------*/scanf("%lld %lld %lld",&N1,&N2,&N3)
#define print3(N1,N2,N3)/*-------------*/printf("%lld %lld %lld",N1,N2,N3)

#define mem(a,b)/*---------------------*/memset(a,b,sizeof(a))
#define opt/*--------------------------*/ios_base::sync_with_stdio(false);cin.tie(NULL);
#define gcd(a, b)/*--------------------*/__gcd(a, b)
#define lcm(a, b)/*--------------------*/((a)*((b)/gcd(a,b)))
#define sqr(x)/*-----------------------*/(x)*(x)
#define all(a)/*-----------------------*/a.begin(),a.end()
#define makepair/*---------------------*/make_pair

#define endl/*-------------------------*/'\n'
#define inf/*--------------------------*/(lli)2000000000000
#define MOD/*--------------------------*/(lli)1000000007
#define MAXN/*-------------------------*/100005

template<class T> bool is_prime(T n) 
{ 
	if((n%2 == 0 and n > 2) or n < 2 )
		return false; 
	for(T i = 3; i*i <= n ; i += 2)
	{ 
		if( n % i == 0) 
			return false;
	}
	return true;
}
lli power(lli a,lli b)
{
    lli value;
    if(!b)
    	return 1;
    else if(b%2==0)
    {
        value = power(a,b/2)%MOD;
        return (value * value)%MOD;
    }
    else
    {
        value = power(a,b/2)%MOD;
        return ((a*value)%MOD*(value))%MOD;
    }
}

int main()
{
	opt;
	lli a,b,c,d;
    cin >> a >> b >> c >> d;
    if(a+b > c+d)
        cout << "Left";
    else if(a+b < c+d)
        cout << "Right";
    else 
        cout << "Balanced";
	return 0;
}

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

int main() {
    int A,B; 
    cin >> A >> B;

    int outlet = 1;
    int ans = 0;
    while(outlet<B){
        outlet += A-1;
        ans += 1;
    }
    cout << ans << endl;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;


int main(){
  ios_base::sync_with_stdio(false);

  int a, b, c;

  cin >> a >> b >> c;

  cout << min(b/a, c) << endl;

  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define int long long
#define INF 1e+15
using namespace std;

signed main(){
	int n,m,l,x[2000],s[100001] = {},dp[2010][2010];
	cin >> n >> m >> l;
	for(int i = 0;i < n;i++) cin >> x[i];
	for(int i = 1;i <= m;i++) {
		cin >> s[i];
		s[i] += s[i - 1];
	}
	sort(x,x + n);
	for(int i = 0;i <= n;i++){
		for(int j = 0;j <= n;j++) dp[i][j] = INF;
	}
	dp[0][0] = 0;
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++){
			int next = max(i,j) + 1;
			if(next == n){
				if(i == n - 1) dp[n - 1][n - 1] = min(dp[n - 1][n - 1],dp[i][j] + (s[x[n - 1]] - s[x[j] - 1]) / l);
				else dp[n - 1][n - 1] = min(dp[n - 1][n - 1],dp[i][j] + (s[x[n - 1]] - s[x[i] - 1]) / l);
			}else {
				dp[i][next] = min(dp[i][next],dp[i][j] + (s[x[next]] - s[x[j] - 1]) / l);
				dp[next][j] = min(dp[next][j],dp[i][j] + (s[x[next]] - s[x[i] - 1]) / l);
			}
		}
	}
	cout << dp[n - 1][n - 1] << endl;
	return 0;
}

Measured memory_bytes: 35364
n, x = map(int, input().split())

a_list = [0]*(n+1)
a_list[0] = 1
p_list = [0]*(n+1)
p_list[0] = 1
for i in range(1, n+1):
    a_list[i] = 2 * a_list[i-1] + 3
    p_list[i] = 2 * p_list[i-1] + 1


def Recursive_function(n, x):
    if n == 0:
        if x <= 0:
            return 0
        else:
            return 1
    elif x <= a_list[n-1] + 1:
        return Recursive_function(n - 1, x - 1)
    elif x == a_list[n-1] + 2:
        return p_list[n-1] + 1
    elif x == 2 * a_list[n-1] + 3:
        return 2 * p_list[n-1] + 1
    else:
        return p_list[n-1] + 1 + Recursive_function(n-1, x - 2 - a_list[n-1])


print(Recursive_function(n, x))

Measured memory_bytes: 38256
import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        BigInteger a=new BigInteger(str);
        str=sc.next();
        BigInteger b=new BigInteger(str);
        System.out.println(a.multiply(b));
    }
}



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

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
			int N = scanner.nextInt();
			int[] mochi = new int[N];
			int counter = 1;
			
			for(int i = 0; i < N; i++) 
			{
				mochi[i] = scanner.nextInt();
			}
		    Arrays.sort(mochi);
		    for(int i = 1; i < N; i++) 
			{
				if(mochi[i] != mochi[i - 1] ) 
				{
					counter++;
				}
			}
			System.out.println(counter);
		    
		    scanner.close(); }
		  }

Measured memory_bytes: 23764
#include<iostream>
using namespace std;
int main()
{
	long long h;
	int n;
	long long a;
	long long cnt=0;
	cin>>h;
	cin>>n;
	while(n--)
	{
		cin>>a;
		cnt+=a;
	}
	if(cnt>=h) cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 888
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase
 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# ------------------- fast io --------------------
from math import gcd, ceil
 
def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi
 
 
def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans
 
def lcm(a, b): return a * b // gcd(a, b)
 
 
def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y





def solve(h, w, k, board):
    ans = 0
    for row in range(1 << h):
        for col in range(1 << w):
            count = 0
            for i in range(h):
                for j in range(w):
                    if (row >> i) & 1 == 0:
                        continue
                    if (col >> j) & 1 == 0:
                        continue
                    if board[i][j] == '#':
                        count += 1
            if count == k:
                ans += 1
    return ans





h, w, k = map(int, input().split())
board = []
for i in range(h):
    board += [list(input())]
print(solve(h, w, k, board))


Measured memory_bytes: 74248
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int q;
    cin >> q;
    vi k(q);
    for (int i = 0; i < q; ++i) {
        cin >> k[i];
    }
    vl dp(3, 0); // d, m, dm
    for (int i = 0; i < q; ++i) {
        ll ret = 0;
        dp.assign(3, 0);
        for (int j = 0; j < n; ++j) {
            if (s[j] == 'D')
                dp[0]++;
            if (s[j] == 'M') {
                dp[1]++;
                dp[2] += dp[0];
            }
            if (s[j] == 'C')
                ret += dp[2];
            if (j + 1 >= k[i]) {
                if (s[j + 1 - k[i]] == 'D') {
                    dp[0]--;
                    dp[2] -= dp[1];
                }
                if (s[j + 1 - k[i]] == 'M')
                    dp[1]--;
            }
        }
        cout << ret << "\n";
    }
    return 0;
}

Measured memory_bytes: 1412
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,sum=0;
    cin >> n;
    for(i=1;i<=n;i++)
    {
      if(i%3==0 || i%5==0)
        sum=sum;
      else
         sum=sum+i;
    }
    cout << sum <<endl;
}

Measured memory_bytes: 3636
S = int(input())
kami = S//100
simo = S%100

if kami > 0 and kami < 13:
    kami = 1
else:
    kami = 0

if simo > 0 and simo < 13:
    simo = 1
else:
    simo = 0

if kami == 1 and simo == 0:
    print('MMYY')
elif kami == 0 and simo == 1:
    print('YYMM')
elif kami == 1 and simo == 1:
    print('AMBIGUOUS')
else:
    print('NA')

Measured memory_bytes: 38256
import * as fs from "fs"

const process = (n: number, x: number, L: number[]): string => {
  // n 回数
  // x 領域
  // L 数直線

  let sum = 1
  // どれだけ数直線を進んだか
  let length = 0

  for (let i = 0; i < n; i++) {
    // 次のバウンドが範囲外かどうか確かめる
    if (length + L[i] > x) {
      // 範囲外なので終わり
      break
    }

    // バウンドする
    sum += 1
    length += L[i]
  }

  return sum + ""
}

const Main = (input: string): string => {
  const aa: string[][] = input.split("\n").map((e) => e.split(" "))
  const n = parseInt(aa[0][0])
  const x = parseInt(aa[0][1])
  const L = aa[1].map((e) => parseInt(e))

  const res = process(n, x, L) + ""
  console.log(res)
  return res
}
Main(fs.readFileSync("/dev/stdin", "utf8"))


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

int value(char c) {
    return c - 'a';
}

int main() {
    int N;  cin >> N;
    string S;  cin >> S;
    vector<int> l(26), r(26);
    for (int i = 0; i < N; ++i) {
        ++r[value(S[i])];
    }
    int ans = 0;
    // i より前
    for (int i = 0; i < N; ++i) {
        ++l[value(S[i])];
        --r[value(S[i])];
        int cnt = 0;
        for (int i = 0; i < 26; ++i) {
            if (l[i] > 0 && r[i] > 0) ++cnt;
        }
        ans = max(ans, cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import collections
n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))

d = dict(collections.Counter(d))
t = dict(collections.Counter(t))

for k, v in t.items():
    if d.get(k, 0) < v:
        print("NO")
        exit()
else:
    print("YES")


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

using namespace std;

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

    vector<int> a(N + 2, 0);
    int cost;
    for (int i = 1; i <= N; ++i) {
        cin >> a[i];
        cost += abs(a[i] - a[i - 1]);
    }
    cost += abs(a[N]);

    for (int i = 1; i <= N; ++i) {
        int minus = abs(a[i] - a[i - 1]) + abs(a[i + 1] - a[i]);
        int plus = abs(a[i + 1] - a[i - 1]);
        cout << cost - minus + plus << endl;
    }

    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
int main(){
long long a,b,c,k,i;
cin>>a>>b>>c>>k;
 long long d =1000000000000000000;
       //123456789012345678
bool even=true;
if(k%2==1)even=false;

bool t=true;
if(a-b>d||b-a>d){
  cout<<"Unfair"<<endl;
  t=false;
  }
if(t&&even){
  cout<<a-b<<endl;
  }
if(t&&!even){
  cout<<b-a<< endl;
  }

return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(N):
    ans += B[A[i]-1]
    if i > 0 and A[i] == A[i-1] + 1:
        ans += C[A[i]-2]
print(ans)

Measured memory_bytes: 9196
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int a, b;

int solve() {
    for (int i = 1; i < 20000; i++) {
        if (i * 8 / 100 == a && i /10 == b)
            return i;
    }
    return -1;
}

void input() {
    cin >> a >> b;
}

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

    input();
    cout << solve() << endl;
}


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

int main(){
  ll n,count=1,ans=0; cin>>n;
  vector<ll> a(n);
  for(int i=0; i<n; i++) {
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  for(int i=0; i<n; i++) {
    if(a[i]==a[i+1]) count++;
    else {
      if(count%2==1) ans++;
      count=1;
    }
  }
  cout<<ans;
}

Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    long double r;
    cin >> r;
    
    cout<< setprecision(6) << fixed << r*r*M_PI << " " << 2*r*M_PI << endl;

    return 0;
}



Measured memory_bytes: 3224
#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 h,w;
  cin >>h >>w;
  vector<vector<char>> a(h+2, vector<char>(w+2));
  for(int i = 0; i<h+2; i++){
    for(int j = 0; j<w+2; j++){
      if(i==0 || j==0 || i==h+1 || j==w+1) a[i][j] = '#';
      else cin>> a[i][j];
    }
  }
  for(int i = 0; i<h+2; i++){
    for(int j = 0; j<w+2; j++){
      cout << a[i][j];
      if(j==w+1) cout << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string.h>
using namespace std;
int main()
{

  string s;
  cin >> s;

  if(  s[s.length()-1] =='s')
  {
    cout << s << "es" << endl;
  }else{    
    cout << s << "s" << endl;
  } 
  
  return 0;
}

Measured memory_bytes: 3592
n, k = map(int, input().split())
x = list(map(int, input().split()))
dis = 10**9
for i in range(n - k + 1):
    r = x[i]
    l = x[i + k - 1]
    if r * l >= 0:
        dis = min(dis, max(abs(r), abs(l)))
    else:
        dis = min(dis, max(abs(r), abs(l)) + 2 * min(abs(r), abs(l)))
print(dis)

Measured memory_bytes: 14224
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<int,int>;

int main(){
    ll a,b,c;
    cin>>a>>b>>c;
    if(a==b&&b!=c){
        cout<<"Yes"<<endl;
        return 0;
    }
        if(a==c&&b!=c){
        cout<<"Yes"<<endl;
        return 0;
    }
        if(c==b&&a!=c){
        cout<<"Yes"<<endl;
        return 0;
    }
    
    cout<<"No"<<endl;
    }


Measured memory_bytes: 3568
#include <stdio.h>
#define N_MAX 100000

int main(void)
{
  int go[N_MAX];
  int i,n,idx,last,tmp,total;

  while(1){
    idx=0; total=0;

    scanf("%d",&n);
    if(n==0) break;
    scanf("%d",&last);
    go[0] = 1;

    for(i=1;i<n;i++){
      scanf("%d",&tmp);

      if(tmp==last)
	go[idx]++;
      else if(i&1){
	if(idx)
	  go[--idx] = go[idx]+go[idx+1]+1;
	else
	  go[0]++;
	last = tmp;
      }else{
	go[++idx] = 1;
	last = tmp;
      }
    }

    for(i=idx-last; i>=0; i-=2)
	total+=go[i];

    printf("%d\n",total);
  }

  return 0;
}

Measured memory_bytes: 0
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
mxbit = 0
for i in range(N):
  mxbit = max(mxbit, a[i].bit_length())
cs = [0] * mxbit
for i in range(N):
  for j in range(mxbit):
    t = 1 << j
    #print(a[i], t, a[i] & t)
    x = (a[i] & t) > 0
    cs[j] += x
res = 0
#print(cs[-1])
#print(cs)
for i in range(N):
  t = 0
  for j in range(mxbit):
    x = 1 << j
    if a[i] & x != 0:
      x %= mod
      #if i == 1: print((1 << j) * (N - i - 1), (cs[-1][j] - cs[i + 1][j]))
      t += x * (N - (cs[j]))
    else:
      x %= mod
      #if i == 1: print(a[i] & (1 << j), (cs[-1][j] - cs[i + 1][j]))
      t += x * cs[j]
    #print(t)
    t %= mod
  res += t
  res %= mod
print(res % mod * pow(2, mod - 2, mod) % mod)


Measured memory_bytes: 123084
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

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

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
// const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1},
//           dx[] = {0, -1, -1, -1, 0, 1, 1, 1};

struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(10);
  }
} iosetup;
/*-------------------------------------------------*/
int main() {
  int n; cin >> n;
  string s, t; cin >> s >> t;
  REP(i, n) cout << s[i] << t[i];
  cout << '\n';
  return 0;
}


Measured memory_bytes: 256
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            int b;
            int c;

            string str = Console.ReadLine();
            string[] str1 = str.Split(' ');


            a = int.Parse(str1[0]);
            b = int.Parse(str1[1]);
            c = int.Parse(str1[2]);

            if (a == b)
            {
                if (b != c && a != c)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");

                }

            }
            else if (b == c)
            {
                if (a != c && a != b)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");

                }


            }
            else if (a == c)
            {
                if (b != c && b != a)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");

                }
            }
            else
            {
                Console.WriteLine("No");
            }

            Console.ReadKey();

        }
    }
}


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

int main(){
    int n;
    string s;
    cin>>n>>s;
    ll r=0,g=0,b=0;
    rep(i,n){
        if(s[i]=='R') r++;
        if(s[i]=='G') g++;
        if(s[i]=='B') b++;
    }
    ll sum =r*g*b;
    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            if (s[i]==s[j])continue;
            if(s[i]+s[j]=='R'+'G'){
                if (s[j+j-i]=='B')sum --;
            }
            if(s[i]+s[j]=='R'+'B'){
                if (s[j+j-i]=='G')sum --;
            }
            if(s[i]+s[j]=='B'+'G'){
                if (s[j+j-i]=='R')sum --;
            }

        }
    }
    cout << sum;
}

Measured memory_bytes: 3624
import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		
		int a = in.nextInt();
      	int b = in.nextInt();
      int max = -99999;
      
      	 max = Math.max(max,a+b);
         max = Math.max(max,a-b);
         max = Math.max(max,a*b);
      
      

      System.out.print(max);
      
	}
}


Measured memory_bytes: 22740
n = int(input())
s = input()

result = s.count('R') * s.count('G') * s.count('B')

for fst_idx in range(n):
    for scd_idx in range(fst_idx + 1, n):
        trd_idx = scd_idx * 2 - fst_idx
        if trd_idx >= n:
            break
        elif s[fst_idx] != s[scd_idx] and s[scd_idx] != s[trd_idx] and \
                s[trd_idx] != s[fst_idx]:
            result -= 1

print(result)

Measured memory_bytes: 9196
#include <stdio.h>

int main(void){
	int n;
	int t[1000] = {0}, a[1000] = {0};
	unsigned long x, y, p, q;

	scanf("%d", &n);
	for(int i=0; i < n; i++) {
		scanf("%d%d", &t[i], &a[i]);
	}

	x = y = 1;
	for(int i=0; i < n; i++) {
		if(x%t[i])
			x += t[i] - x%t[i];
		if(y%a[i])
			y += a[i] - y%a[i];
		p = x / t[i];
		q = y / a[i];
		if(p < q)
			p = q;

		x = p * t[i];
		y = p * a[i];
	}
	printf("%lu", x + y);

	return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>

using namespace std;

int main(){

	int n,m;
	cin >> n >> m;
	string s[n],t[m],split[m];
	
	for(int i=0;i<n;i++){
		cin >> s[i];
	}
	
	for(int i=0;i<m;i++){
		cin >> t[i];
	}
	
	int cnt;
	for(int i=0;i<s[0].size()-m+1;i++){
		for(int j=0;j<n-m+1;j++){
			cnt=0;
			for(int x=0;x<m;x++){
				for(int y=0;y<m;y++){
					if(t[x][y]!=s[i+x][j+y])continue;
					if(t[x][y]==s[i+x][j+y])cnt++;
					if(cnt==m*m){
						cout << "Yes" << endl;
						return 0;
					}
				}
			}
		}
	}
	
	cout << "No" << endl;
	return 0;
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;

// region template
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;

ll gcd(ll a, ll b) { return __gcd(a, b); }

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

typedef unsigned long long ull;
typedef long double ld;
ull mod_mul(ull a, ull b, ull M) {
    ll ret = a * b - M * ull(ld(a) * ld(b) / ld(M));
    return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull mod_pow(ull b, ull e, ull mod) {
    ull ans = 1;
    for (; e; b = mod_mul(b, b, mod), e /= 2)
        if (e & 1)
            ans = mod_mul(ans, b, mod);
    return ans;
}

const ll mod = 1000000007;
struct Mod {
    ll x;
    Mod(ll xx) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1);
        return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e)
            return Mod(1);
        Mod r = *this ^ (e / 2);
        r = r * r;
        return e & 1 ? *this * r : r;
    }
};
// endregion

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    cin.exceptions(cin.failbit);

    for (;;) {
        int n, w; cin >> n >> w;
        if (!n) break;
        
        vector<int> g(101);

        int maxgp = 0;
        int highest = 0;
        rep(i, 0, n) {
            int t; cin >> t;
            maxgp = max(maxgp, t / w);
            g[t / w]++;
            highest = max(highest, g[t / w]);
        }

        double sum = 0.01;
        rep(i, 0, maxgp + 1) {
            sum += 1.0 * (maxgp - i) / maxgp * g[i] / highest;
        }
        cout << fixed << setprecision(12) << sum << endl;
        
    }
}



Measured memory_bytes: 3252