akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

const int INF = 1000000000;

int n, m;
vector<pair<int, int> > data[150];
int dp[150][10][80];

main(){
  while(cin >> n >> m && (n || m)){
    for(int i=0;i<n;i++) data[i].clear();
    for(int i=0;i<n;i++){
      int a;
      cin >> a;
      for(int j=0;j<a;j++){
        int b, c;
        cin >> b >> c;
        data[i].push_back(pair<int, int>(b, c));
      }
    }
    fill(dp[0][0], dp[150][0], INF);
    for(int j=0;j<=1;j++){
      if(m-j<0) continue;
      for(int i=0;i<data[j].size();i++){
        dp[j][i][m-j] = 0;
      }
    }
    for(int i=0;i<n-1;i++){
      for(int j=0;j<data[i].size();j++){
        for(int i1=0;i1<=m;i1++){
          if(dp[i][j][i1] != INF){
            for(int l=0;l<=1;l++){
              if(i1-l<0) continue;
              int next = i+1+l;
              if(next >= n) continue;

              for(int k=0;k<data[next].size();k++){
                dp[next][k][i1-l] = min(dp[next][k][i1-l],
                                   dp[i][j][i1] + (data[i][j].second + data[next][k].second) *
                                   (abs(data[i][j].first - data[next][k].first)));
              }
            }
          }
        }
      }
    }
    int ans = INF;
    for(int j=0;j<=1;j++){
      if(m-j<0) continue;
      for(int i=0;i<data[n-1-j].size();i++){
        for(int k=j;k<=m;k++){
          ans = min(ans, dp[n-1-j][i][k]);
        }
      }
    }
    cout << ans << endl;
  }

  return 0;
}

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

#define ll long long
#define pb push_back
#define INF 1e9+7
#define cases int t;cin>>t;while(t--)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define per(i,a,b) for(ll i=a;i>=b;i--)
#define ff first
#define ss second

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;

int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	
	ll a,b;
	cin>>a>>b;
	a*=b;
	cout<<a;
	
	
	
	return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <iomanip>
#include <cstring>
#include <algorithm> 
#include <math.h>
#include <queue>
#include <functional>
#include <map>
#include <vector>
#include <string>
#include <set> 
using namespace std;

typedef long long ll;
typedef pair<ll, int> P;
typedef pair<pair<int, int>, int> PP;

const ll INF = 1e15;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


const ll MAX = 510000;
const ll MOD = 1000000007;

int N, Q;
vector<int> v[200010];
ll d[200010];

void dfs(int par, int child) {
	if (par != -1) d[child] += d[par];
	for (int i = 0; i < v[child].size(); i++) {
		int  c = v[child][i];
		if (c != par) dfs(child, c);
	}
	return;
}
int main(void) {
	cin >> N >> Q;
	for (int i = 0; i < N - 1; i++) {
		int a, b; cin >> a >> b;
		a--; b--;
		v[a].push_back(b); v[b].push_back(a);
	}

	for (int i = 0; i < Q; i++) {
		int p, x; cin >> p >> x;
		p--;
		d[p] += x;
	}

	dfs(-1, 0);

	for (int i = 0; i < N; i++) cout << d[i] << endl;

}


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

typedef long long ll;

int n,m;
int dian[100005];
vector<int>pt[100005];

int main(){
	scanf("%d %d", &n, &m);
	for(int i = 1; i <= n; i++) scanf("%d", &dian[i]);
	while(m--){
		int X, Y;
		scanf("%d %d", &X, &Y);
		pt[X].push_back(Y);
		pt[Y].push_back(X);
	}
	int ans = 0;
	for(int i = 1; i <= n; i++){
		bool flag = true;
		for(auto Now : pt[i]){
			if(dian[Now] >= dian[i]){
				flag = false;
				break;
			}
		}
		if(flag) ans++;
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 9352
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define vl vector<ll>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = a; i < (b); ++i)

int main() {

    ll K;
    cin >> K;

    vector<bool> k(K, false);

    ll num = 7;
    ll ans = 0;
    while(true) {
        // cout << "num : " << num << endl;
        if (num%K == 0) {
            ans++;
            break;
        }
        else {
            num *= 10;
            num += 7;
            ans++;
            num %= K;
            if (k[num]) {
                ans = -1;
                break;
            }
            k[num] = true;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3728
var n,a,b,i,j,k,sum,tmp:longint;
    s:ansistring;
begin
  readln(n,a,b);
  for i:=1 to n do
  begin
    tmp:=0;
    str(i,s);
    for j:=1 to length(s) do
    begin
      val(s[j],k);
      tmp:=tmp+k;
    end;
    if (tmp>=a) and (tmp<=b) then
      sum:=sum+i;
  end;
  writeln(sum);
end.

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

using namespace std;
using namespace atcoder;

int main() {
	//input
	int K;
	cin >> K;

	//calculation
    string S = "ACL";
    string output = "";
    for (int i = 0; i < K; i++) {
        output += S;
    }

    cout << output << endl;
		
	return 0;
}


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

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

    long long A;
    long long Amin = LONG_LONG_MAX;
    map<long long, int> count;
    for (int i = 0; i < N; i++)
    {
        cin >> A;
        Amin = min(Amin, A);
        count[A - Amin]++;
    }
    cout << count.rbegin()->second << endl;
}


Measured memory_bytes: 6528
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    
    let list = {};
    let stringCnt = [...new Set(S)].length;
    let cnt = 0;

    for(let i in S) {
        if(list[S[i]]) {
            list[S[i]]++;
        } else {
            list[S[i]] = 1;
        }
    }
    
    for(let key of Object.keys(list)) {
        let previous = S;
        
        while(stringCnt !== 1) {
            let next = [];
            
            for(let i=0; i<previous.length-1; i++) {
                if(previous[i] === key || previous[~~i+1] === key) {
                    next.push(key);
                } else {
                    next.push(S[i]);
                }
            }
            
            previous  = next.join("");
            stringCnt = [...new Set(previous)].length;
        }
        
        cnt = Math.max(previous.length, cnt);
        stringCnt = [...new Set(S)].length;
    }
    
    console.log(S.length - cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 10384
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
using namespace std;
typedef long long int llint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long &x, long long &y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a%b, y, x);
	y -= a / b * x;
	return d;
}

bool check(char a, char b) {
	return a > b;
}

int main() {
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	c *= 2;
	int ans = 0;
	if (a + b > c) {
		ans += c*min(x, y);
		if (x < y) {
			ans += (y - x)*min(b, c);
		}
		else {
			ans += (x - y)*min(a, c);
		}
	}
	else {
		ans = a*x + b*y;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define max 1000
void divisor(int,int[max]);

int main(){
    int array[max];
    int leng;
    scanf("%d",&leng);
    for(int i=0;i<leng;i++){
        scanf("%d",&array[i]);
    }

    divisor(leng,array);

    return 0;
}

void divisor(int n,int array[max]){
    int a,j;
    for(int k=0;k<n;k++){
        printf("%d",array[k]);
        if(k<n-1)printf(" ");
    }
    printf("\n");
    for(int i=1;i<n;i++){
        a=array[i];
        j=i-1;
        while(j>=0 && array[j]>a){
            array[j+1]=array[j];
            j--;
        }
        array[j+1]=a;

        for(int k=0;k<n;k++){
            printf("%d",array[k]);
            if(k<n-1)printf(" ");
        }
        printf("\n");
    }
}


Measured memory_bytes: 2140
#include<stdio.h>
int mbk(long long a,int n,int m){return n?(mbk((a*a)%m,n/2,m)*(n%2?a:1))%m:1;}
int main(){
  int n,m,i,j,M=1e9+7;
  long long ans=0,d[200010];
  scanf("%d %d",&m,&n);
  for(i=n;i;i--){
    d[i]=mbk(n/i,m,M);
    for(j=2;i*j<=n;j++)d[i]=(d[i]+M-d[i*j])%M;
    ans=(ans+(d[i]*i)%M)%M;//printf("%d %lld\n",i,d[i]);
  }
  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 2508
import java.io.*;
import java.util.Scanner;
 
public class Main {
    public static boolean circleInRec(int W, int H, int x, int y, int r) {
        return x + r <= W && x - r >= 0 && y + r <= H && y - r >= 0;
    }
 
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int W = sc.nextInt();
        int H = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        if (circleInRec(W, H, x, y, r)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


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

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  
  int ans=0;
  rep(pin100,10){
    rep(pin10,10){
      rep(pin1,10){
        bool flag100=false,flag10=false,flag1=false;
        rep(i,n){
          if(flag100==false and (s[i]-'0')==pin100){flag100=true; continue;}
          if(flag100==true and flag10 ==false and (s[i]-'0')==pin10){flag10=true; continue;}
          if(flag10==true and flag1 ==false and (s[i]-'0')==pin1){flag1=true; break;}
        }
        if(flag1==true) ans++;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 3664
#ifdef __APPLE__
#include <cassert>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <stack>
#include <string>
#include <cstring>
#include <sstream>
#include <map>
#include <set>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <cctype>
#include <list>
#include <cmath>
#include <limits>
#include <bitset>
#include <numeric>
#include <climits>
#include <complex>
#else
#include<bits/stdc++.h>
#endif // __APPLE__
using namespace std;
typedef pair<int,int>   II;
typedef vector<II>     VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int LL;
typedef  unsigned long long int ULL;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define SET(a,b) memset(a,b,sizeof(a))
#define LET(x,a) __typeof(a) x(a)
#define ALL(c) (c).begin(),(c).end()
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define REP(i,a,b) for(int i = (int)a; i < (int)b; i++)
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)

//B


const int N = int(1e5)+10;

VI g[N];
int n,m;
bool vis[N];
vector<int> v1,v2;
void dfs1(int u)
{
    if(vis[u])
    return;
    vis[u]=1;
    v1.PB(u);
    
    for(int i=0;i<SZ(g[u]);i++)
    {
        int w=g[u][i];
        if(!vis[w])
            {
                dfs1(w);
                break;
            }
    }
}

void dfs2(int u)
{
    if(vis[u])
    return;
    vis[u]=1;
    v2.PB(u);
    
    for(int i=0;i<SZ(g[u]);i++)
    {
        int w=g[u][i];
        if(!vis[w])
            {
                dfs2(w);
                break;
            }
    }
}


int main()
{
	//fr;fw;
	fast_io;
    cin>>n>>m;
    int xxx,yyy;
    REP(i,0,m)
    {
        int u,v;
        cin>>u>>v;
        xxx=u;yyy=v;
        g[u].PB(v);
        g[v].PB(u);
    }
    if(m==1)
    {
        cout<<2<<endl;
        cout<<xxx<<" "<<yyy<<endl;
        return 0;
        
    }
    int xx=0;
    for(int i=1;i<=n;i++)
    {
        if(SZ(g[i])>=2)
        {
            vis[i]=1;
            int j=0;
            for(;j<SZ(g[i]);j++)
            {
                if(!vis[g[i][j]])
                {
                    dfs1(g[i][j]);
                    break;
                }
            }
            for(;j<SZ(g[i]);j++)
            {
                if(!vis[g[i][j]])
                {
                    dfs2(g[i][j]);
                    break;
                }
            }
            xx=i;
            break;
        }
    }
    
    cout<<SZ(v1)+SZ(v2)+1<<endl;
    //trace("ola");
    for(int i=SZ(v1)-1;i>=0;i--)
        cout<<v1[i]<<" ";
    cout<<xx<<" ";
    for(int i=0;i<SZ(v2);i++)
        cout<<v2[i]<<" ";

	return 0;
}





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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;
typedef tuple<ll, ll, ll, ll, ll> t5;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

using namespace std;

static const ll INF = 1e15;

struct warshall_floyd {
	static void solve(vector<vector<ll>>& d) {
		int n = d.size();
		rep(k, n) {
			rep(i, n) {
				rep(j, n) {
					d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
				}
			}
		}
	}
};

int main() {
	int n;
	cin >> n;
	vector<vector<ll>> dist(n, vector<ll>(n, INF));
	rep(i, n) {
		dist[i][i] = 0;
	}
	rep(i, n) {
		int a, v;
		cin >> a >> v;
		rep(j, v) {
			int t;
			cin >> t;
			t--;
			dist[i][t] = 1;
		}
	}
	warshall_floyd::solve(dist);
	rep(i, n) {
		if (dist[0][i] == INF) {
			cout << i + 1 << " " << -1 << endl;
		}
		else {
			cout << i + 1 << " " << dist[0][i] << endl;
		}
	}
	return 0;
}



Measured memory_bytes: 3252
y,_=gets.chomp.split(' ').map{|n| n.to_i}
if(y==1)
	puts "Hello World"
else
	a,_=gets.chomp.split(' ').map{|n| n.to_i}
	b,_=gets.chomp.split(' ').map{|n| n.to_i}
	puts a+b
end


Measured memory_bytes: 1788
import std.stdio;
import std.conv;
import std.string;

void main() {
	string s;
	while((s = readln()).length != 0) {
		int [] c = [500, 100, 50, 10, 5, 1];
		int res = 0;
		int a;
		a = to!int(chomp(s));
		if(a == 0) break;
		a = 1000 - a;
		for(int i = 0; i < c.length; i++) {
			if(a >= c[i]) {
				res++;
				a -= c[i];
				i--;
			}
		}

		writeln(res);
	}
}

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

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

signed main() {
    ll N;
    cin>>N;
    vector<ll> s(N);
    rep(i,0,N)
        cin>>s[i];

    ll ans = 0;
    // C=A-B
    // k=何度もどりが発生するか
    // A + kC = N-1
    // kc <= N-1
    for (ll C=1; C<N; C++) {
        set<ll> used;
        ll t = 0;
        for (ll k=0; k*C<=N-1; k++) {
            ll A = N-1 - k*C;
            ll B = A - C;
            if (!(0<B && B<A && A<=N-1)) {
                break;
            }
            if (used.find(k*C) != used.end()) {
                break;
            }
            used.insert(k*C);
            if (used.find(N-1-k*C) != used.end()) {
                break;
            }
            used.insert(N-1-k*C);
            t += s[k*C] + s[N-1-k*C];
            // cout<<"C="<<C<<" A="<<A<<" B="<<B<<" t="<<t<<endl;
            ans = max(ans, t);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 7808
H, N = map(int, input().split())
AB = []
for _ in range(N):
    A, B = map(int, input().split())
    AB.append([A, B])
AB = sorted(AB, key=lambda x:x[0], reverse=True)
INF = float("inf")
dp = [INF for _ in range(H+1)]
dp[0] = 0

# DP
for i in range(1, H+1):
    for a, b in AB:
        if a >= i:
            dp[i] = min(dp[i], b)
            continue
        else:
            dp[i] = min(dp[i], dp[i-a]+b)
print(dp[-1])

Measured memory_bytes: 74508
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007
typedef long long ll;

int main(){
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  while(a >= b){
    if(k > 0){
      k--;
      b *= 2;
    }else{
      cout << "No" << endl;
      return 0;
    }
  }
  while(b >= c){
    if(k > 0){
      k--;
      c *= 2;
    }else{
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
  
  
  
  

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

int main(){
  int m, f, r;

  while(1){
    cin>>m>>f>>r;
    if(m==-1&&f==-1&&r==-1) break;

    if(m==-1||f==-1) cout<<"F"<<endl;
    else if(m+f>=80) cout<<"A"<<endl;
    else if(m+f>=65) cout<<"B"<<endl;
    else if(m+f>=50) cout<<"C"<<endl;
    else if(m+f>=30){
      if(r>=50) cout<<"C"<<endl;
      else cout<<"D"<<endl;
    }else cout<<"F"<<endl;
  }
  return 0;
}

Measured memory_bytes: 3100
n, l = map(int, input().split())
x = []          
lst1 = []
lst2 = []                

for i in range(n):
    x.append(l+i)

for i in range(n-1):
    lst1.append(sum(x[:i])+sum(x[i+1:]))

lst1.append(sum(x[:n-1]))

for i in range(n):
    lst2.append(abs(sum(x)-lst1[i]))

for i in range(n):
    if lst2[i] == min(lst2):
        print(lst1[i])

Measured memory_bytes: 3064
//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//等価なものに変換する思考
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//配列はvector<>を使う：意味わからないエラーがなくなる。
//背反な事象にちゃんとわける
//チェックリストはマップを使う
//数が大きい時の比較はstring型で行う
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//円周率
const double PI = 3.14159265358979323846;

int main() {
	string a, b; cin >> a >> b;

	string s;
	int m = min(a.size(), b.size());
	for (int i = 0; i < m; i++) {
		s += a[i];
		s += b[i];
	}

	if (a.size() > b.size()) s += a[a.size() - 1];
	if (a.size() < b.size()) s += b[b.size() - 1];

	cout << s << endl;
}

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


void solve(){
    ll n, k;
    cin >> n >> k;
    if (n > k){
        n = n % k;
    }
    cout << min(n, k - n) << endl;
}

int main(){
    clock_t startTime = clock();
    solve();
    //cout << double( clock() - startTime ) / (double)CLOCKS_PER_SEC<< " seconds." << endl;
}



Measured memory_bytes: 384
#include<bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mod 1000000007ll
const ll maxn = 9e18;
using namespace std;

void solve() {
	int k, s;
	ll ans = 0;
	cin >> k >> s;
	for(int x = 0; x <= k; ++x) {
		for(int y = 0; y <= k; ++y) {
			int z = s - x - y;
			if(z >= 0 && z <= k) ans++;
			}
		}
		cout << ans << endl;
}

int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(35);
	solve();
	return 0;
	}


Measured memory_bytes: 3620
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	String a,b;
	public void solve() {
		a = next();
		b = next();

		if(a.length() > b.length()){
			out.println("GREATER");
		}else if(a.length() < b.length()){
			out.println("LESS");
		}else{

			for(int i = 0;i < a.length();i++){

				if(a.charAt(i) < b.charAt(i)){
					out.println("LESS");
					return;
				}else if (a.charAt(i) > b.charAt(i)){
					out.println("GREATER");
					return;
				}
			}
			out.println("EQUAL");
		}
	}

	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 22484
n,a,b=map(int,input().split())
s=input()
total=0
bb=0
for i in s:
    if i=="a":
        if total<a+b:
            print('Yes')
            total+=1
        else:
            print('No')
    elif i=="b":
        if total<a+b and bb<b:
            print("Yes")
            total+=1
            bb+=1
        else:
            print('No')
    else:
        print("No")

Measured memory_bytes: 4016
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int MAX = 10555;
const string INF = "-";
string dp[MAX];

void chmax(string &a, string b){
    if(b.size() > a.size()) a = b;
    else if(b.size() < a.size()) a = a;
    else{
        if(b > a) a = b;
    }
}

int main(){
    int N, M; cin >> N >> M;
    int match[9] = {2,5,5,4,5,6,3,7,6};
    vector<int> A(M);
    for(int i=0; i<M; i++) cin >> A[i];

    for(int i=0; i<MAX; i++) dp[i] = INF;
    dp[0] = "";
    for(int i=0; i<N; i++){
        if(dp[i] == INF) continue;
        for(int j=0; j<A.size(); j++){
            chmax(dp[i+match[A[j]-1]], dp[i]+(char)('0'+A[j]));
        }
    }

    cout << dp[N] << endl;
}

Measured memory_bytes: 43776
#include<bits/stdc++.h>
#include<vector>
#include<stdio.h>
#define M 1000000007
#define VI vector<int>
#define VVI vector<vector<int> >
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;

int N;
string s,t;
int dp[100001][26];
int main(void){
    cin>>N;
    cin>>s>>t;
    dp[0][s[0]-'a']=1;
    for(int i=1;i<N;i++){
        dp[i][s[i]-'a']=(dp[i][s[i]-'a']+dp[i-1][t[i]-'a'])%M;
        REP(j,26){
            dp[i][j]=(dp[i][j]+dp[i-1][j])%M;
        }
    }
    cout<<dp[N-2][t[N-1]-'a']<<endl;
    return 0;
}


Measured memory_bytes: 13460
import itertools
import math

N, D = input().split()
cnt = 0
X = [list(map(int, input().split())) for _ in range(int(N))]
N = [i for i in range(0, int(N))]
N_list = list(itertools.combinations(N, 2))

for n in N_list:
    length = 0
    for x_1, x_2 in zip(X[n[0]], X[n[1]]):
        length += (x_1-x_2)**2
    length = math.sqrt(length)
    if length == int(length):
        cnt += 1
        
print(cnt)

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

using namespace std;

inline int gi()
{
	int f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

const int N = 100003, M = N << 1;

int n, k;
int a[N];
int tot, head[N], ver[M], nxt[M];

inline void add(int u, int v)
{
    ver[++tot] = v, nxt[tot] = head[u], head[u] = tot;
}

int main()
{
    n = gi(), k = gi();
    for (int i = 1; i <= n; i+=1) a[i] = gi();
    for (int i = 1; i <= k; i+=1)
    {
        int u = gi(), v = gi();
        add(u, v), add(v, u);
    }
    int cnt = 0;
    for (int i = 1; i <= n; i+=1)
    {
        bool fl = true;
        for (int j = head[i]; j; j = nxt[j])
        {
            int v = ver[j];
            if (a[v] >= a[i]) {fl = false; break;}
        }
        if (fl) ++cnt;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 5960
using System;

namespace abc165A
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int K = int.Parse(Console.ReadLine());
            string[] str = Console.ReadLine().Split();
            int A = int.Parse(str[0]);
            int B = int.Parse(str[1]);
            if ((B/K)-(A-1)/K==0)
                Console.WriteLine("NG");
            else
                Console.WriteLine("OK");
        }
    }
}


Measured memory_bytes: 27548
n=int(input())
a,b=map(int,input().split())
l=list(map(int,input().split()))
x,y,z=0,0,0
for i in l:
  if(i<=a):
    x+=1
  elif(i>a and i<=b):
    y+=1
  elif(i>b):
    z+=1
print(min(x,y,z))

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define REPW(i,n) for(i=0;i<(int)(n);++i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : "\n"); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,v) is >> *i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> " " >> p.second; return is; }
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;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    string s;
    cin>>s;
    cout<<(s[0]==s[2]?"Yes":"No")<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

    }
}

Measured memory_bytes: 21972
import java.util.Scanner;

public class Main {

public static void main(String[] args){
Scanner input = new Scanner(System.in);
int tot = input.nextInt();
int hours = tot / 3600;
tot = tot - (hours*3600);
int mins = tot / 60;
tot = tot - (mins * 60);
System.out.println(hours+":"+mins+":"+tot);

}
}


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

using namespace std;

int main(){
	int n,m;
	cin>>n>>m;
	int tmp=1;
	for(int i=0;;i++){
		tmp+=i*(n-1);
		if(tmp>=m){
			cout<<i<<endl;break;
		}
		else tmp=1;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int M = Integer.parseInt(sc.next());//int型
        int D = Integer.parseInt(sc.next());
        sc.close();

        int ans = 0;
        for(int j = 1; j <= M; j++) {
            for (int i = 1; i <= D; i++) {
                int d1 = i % 10;
                int d10 = i / 10;
                if (d1 >= 2 && d10 >= 2 && j == d1 * d10) {
                    ans++;
                }
            }
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>
#include <functional>
#include <chrono>
#include <cstring>
#include <limits.h>

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;

typedef vector<lint> vl;
typedef pair<lint,lint> pll;

#define mpr make_pair


int main()
{
    ios_base::sync_with_stdio(0);    cin.tie(NULL);    cout.tie(NULL);

    lint a,b,n; cin>>a>>b>>n;

    lint rn = min(b-1, n);
    cout<< a*rn/b;
}


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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define pb(n) push_back(n);
#define mp make_pair
#define MOD 1000000007
#define INF 9223372036854775807
#define MAX_N 100000

int n,ans;
bool f;
string s[2];

signed main() {
    cin >> n;
    rep(i,2) cin >> s[i];
    if (s[0][0] == s[1][0]) ans = 3;
    else ans = 6,f=true;
    rep(i,n-1) {
        if (f) i++,f=false;
        if (s[0][i] == s[1][i]) {
            if (s[0][i+1] != s[1][i+1]) i++;
            ans = (ans*2)%MOD;
        } else if (s[0][i+1] != s[1][i+1]) ans = (ans*3)%MOD,i++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
//#if 1
//#include"pch.h"
//#define _CRT_SECURE_NO_WARNINGS
//#endif
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main() {
	string s;
	cin >> s;
	s[3] = '8';
	cout << s << endl;

	
	return(0);
}

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

#define debug(a) cout << #a << " " << a << endl;
#define _debug(a, i) cout << #a << "[" << i << "]" << " = " << a[i] << endl;
#define fastio ios_base::sync_with_stdio(false); \
			cin.tie(0);							     \
			cout.tie(0);
#define sz(arr) ll(arr.size())

using namespace std;

using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1e18 + 9;
const double PI = 4.0 * atan(1.0);

ll powmod(ll a, ll b, const ll MOD) { ll res = 1; a %= MOD; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a % MOD; a = a * a % MOD; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
ll div_floor(ll a, ll b) { return a / b - (((a ^ b) < 0) and a % b); }
ll div_ceil(ll a, ll b) { return a / b + (((a ^ b) >= 0) and a % b); }
ll kCn(ll k, ll n, ll f[]) { return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

	

int main() {
	//#ifndef ONLINE_JUDGE
	//	(void)freopen("input.txt", "r", stdin);
	//	(void)freopen("output.txt", "w", stdout);
	//#endif // !ONLINE_JUDGE
	fastio;

	ll x;
	cin >> x;
	ll ans = 100;
	int i;
	for (i = 1; i <= 100000; ++i) {
		ans = ans + ans / 100;
		if (ans >= x)
			break;
	}
	cout << i;
	return 0;
}

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

int selectionSort(int A[], int n) {
  int sw = 0;
  int minj;
  for (int i=0; i<n-1; i++) {
    minj = i;
    for (int j=i+1; j<n; j++) {
      if (A[minj] > A[j]) {
        minj = j;
      }
    }
    if (i != minj) {
      swap(A[i], A[minj]);
      sw++;
    } 
  }
  return sw;
}


int main() {
  int n;
  cin >> n;
  int sw = 0;
  int A[n];
  for (int i=0; i<n; i++) cin >> A[i];
  
  sw = selectionSort(A, n);
  
  // バブルソート済み配列の出力
  for (int i=0; i<n; i++) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;
  return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define m_k make_pair
#define inf 1e18
#define int long long
using namespace std;
const int N=1e5+100;
int n,m,q[N],a[N],w,MIN;
int cnt[N],ti[N];
void solve(int x,int y,int i)
{
	ti[i]+=x/a[i]*y;
	int j=upper_bound(a+1,a+1+w,x%a[i])-a-1;
	if (j==0)
	{
		cnt[1]+=y,cnt[x%a[i]+1]-=y;
		return;
	}
	solve(x%a[i],y,j);
}
signed main()
{
	scanf("%lld%lld",&n,&m);
	for (int i=1;i<=m;i++) scanf("%lld",&q[i]);
	MIN=inf+inf;
	q[0]=n;
	for (int i=m;i>=0;i--)
	{
		if (MIN>q[i]) a[++w]=q[i];
		MIN=min(MIN,q[i]);
	}
	reverse(a+1,a+1+w);
	ti[w]=1;
	for (int i=w;i>=2;i--) solve(a[i],ti[i],i-1);
	cnt[1]+=ti[1],cnt[a[1]+1]-=ti[1];
	for (int i=1;i<=n;i++) cnt[i]+=cnt[i-1];
	for (int i=1;i<=n;i++) printf("%lld\n",cnt[i]);
}

Measured memory_bytes: 6976
#include<stdio.h>

int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4;
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	x3=x2+y1-y2;
	y3=y2+x2-x1;
	x4=x1+y1-y2;
	y4=y1+x2-x1;
	printf("%d %d %d %d",x3,y3,x4,y4);
	return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <set>
#include <stack>
#include <cassert>
#define SIZE 500005

using namespace std;

int A[SIZE];
int pos[SIZE];
int back[SIZE];
int n,K;

int main()
{
	scanf("%d %d",&n,&K);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&A[i]);
		A[i]--;
		pos[A[i]]=i;
	}
	memset(back,-1,sizeof(back));
	set <int> st;
	st.insert(n);
	set <int>::iterator it,its;
	for(int i=n-1;i>=0;i--)
	{
		//pos[i]<pos[j]+K なる min j>i を探す
		//<=> pos[i]-K+1<=pos[j]
		it=st.lower_bound(pos[i]-K+1);
		int v=*it;
		back[pos[i]]=back[v];
		back[v]=pos[i];
		while(it!=st.end())
		{
			int f=*it;
			if(f>pos[i]) break;
			its=it;it++;
			st.erase(its);
		}
		st.insert(pos[i]);
	}
	stack <int> ans;
	int now=n;
	for(int i=n-1;i>=0;i--)
	{
		now=back[now];
		pos[i]=now;
	}
	for(int i=0;i<n;i++) A[pos[i]]=i;
	for(int i=0;i<n;i++) printf("%d\n",A[i]+1);
	return 0;
}


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

int main(){
	int n,m,p;
	int x[101];
	while( cin >> n >> m >> p , n|m|p ){
		int sum = 0;
		for(int i=1 ; i<=n ; ++i ){
			cin >> x[i];
			sum += x[i];
		}
		int ans = 0;
		if( x[m] ) ans = sum * 100*(100-p) / 100.0 / x[m];
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    ll n;cin>>n;
    map<ll,ll> mp;
    for(ll i=2;i<=sqrt(n);i++){
        while(n%i==0){
            mp[i]++;
            n/=i;
        }
    }
    if(n>1)mp[n]++;
    ll res=0;
    for(auto& p:mp){
        ll x=p.second;
        ll tmp=1;
        while(x>=tmp){
            res++;
            x-=tmp;
            tmp++;
        }
    }
    cout<<res<<endl;
}

Measured memory_bytes: 3732
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <numeric>
#include <string>
#include <functional>

using namespace std;

#define rep(i,n) for(int i = 0; i < (int)(n); i++)

vector<int> divisor(int x){
    vector<int> ret;
    for(int i=1;i*i<=x;i++){
        if(x%i==0){
            ret.push_back(i);
            if(i*i!=x){
                ret.push_back(x/i);
            }
        }
    }
    return ret;
}

int main(void){
    int N,K;
    cin>>N>>K;
    vector<int> A(N);
    rep(i,N){cin>>A[i];}

    int sum=accumulate(A.begin(),A.end(),0);
    vector<int> div=divisor(sum);
    sort(div.begin(),div.end());
    reverse(div.begin(),div.end());
    int ans=1;

    for(int d:div){
        vector<int> A_copy=A;
        rep(i,N){A_copy[i]%=d;}
        sort(A_copy.begin(),A_copy.end());
        vector<int>::iterator max=A_copy.end()-1;
        vector<int>::iterator min=lower_bound(A_copy.begin(),A_copy.end(),1);
        int count=0;
        do{
            if(*max==0){break;}
            if((d-*max)>*min){
                count+=*min;
                *max=*max+*min;
                *min=0;
                min++;
            }else{
                count+=d-*max;
                *min=*min-(d-*max);
                *max=0;
                max--;
            }
        }while(count<=K);

        if(*max==0&&count<=K){ans=d;break;}
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
"""
N = int(input())
A, B = map(int,input().split())
A = list(map(int,input().split())) ## 横一列
A = [int(input()) for _ in range(N)] ## 縦一列
lst = [list(map(int,input().split())) for i in range(M)] ## 二次元
"""

N, K, Q = map(int,input().split())
A = [int(input()) for _ in range(Q)] ## 縦一列

cnt = [0]*N
for i in range(Q):
  cnt[A[i]-1] += 1
#print(cnt)

for i in range(N):
  if cnt[i] + K - Q > 0:
    print('Yes')
  else:
    print('No')
    

Measured memory_bytes: 8592
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
 
int main()
{
	int n, a ,c = 0;
	cin >> n;
  //cout << lcm(a, b) << endl;

	for (int i = 0; i < n; i++) {
		cin >> a;
      	if (a % 2 == 0 ){
          if ( a % 3 == 0 || a % 5 == 0 ){
          } else {
            cout << "DENIED" << endl;
            c = 1;
            break;
          }  
        }
	}
  	if ( c == 0 ) {
      cout << "APPROVED" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<set>
#include<string.h>
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    set<int>st;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        if(st.count(x))
        {
            st.erase(x);
        }
        else
            st.insert(x);
    }
    cout<<st.size()<<endl;
    return 0;
}

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

bool is_enough(std::vector<long long>& h, long long a, long long b, long long t) {
    auto cnt = 0ll;
    for (auto c : h) {
        if (c - b * t > 0) cnt += (c - b * t) / (a - b) + ((((c - b * t) % (a - b)) == 0) ? 0 : 1);
    }

    return (cnt <= t);
}

int main() {
    long long n, a, b, ret, m = 0;
    std::cin >> n >> a >> b;
    std::vector<long long> h(n);
    for (auto i = 0ll; i < n; i++) {
        std::cin >> h[i];
        if (m < h[i]) m = h[i];
    }
    
    auto sup = m / b + 1;
    auto inf = 0ll;

    ret = sup / 2;
    while (true) {
        if (is_enough(h, a, b, ret)) {
            sup = ret;
            ret = (ret + inf) / 2;
        } else {
            inf = ret;
            ret = (ret + sup) / 2;
        }

        if (sup - inf == 1) break;
    }

    std::cout << sup << std::endl;

    return 0;
}

Measured memory_bytes: 1024
/* Maximum Profit */

#include <stdio.h>

int main(void) {
  int n, x, min, maxdiff, i, diff;
  scanf("%d", &n);
  scanf("%d", &x);
  min = x;
  scanf("%d", &x);
  maxdiff = x - min;
  if(x < min) min = x;
  for(i = 2; i < n; i++) {
    scanf("%d", &x);
    diff = x - min;
    if(diff > maxdiff) maxdiff = diff;
    if(x < min) min = x;
  }

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

  return 0;
}

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

double med (long *X, long N){
	sort(X,X+N);
	if (N%2 == 0) return 0.5*(X[N/2-1] + X[N/2]);
	else return X[(N+1)/2-1];
}

int main(void){
	long N;
	cin >> N;
	long A[N], B[N];
	for (long i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
	}

	double med_min = med(A,N);
	double med_max = med(B,N);
	long N_med;
	if (N%2 ==0) N_med = 2*(med_max-med_min) + 1;
	else  N_med = med_max-med_min + 1;
	
	cout << N_med << endl;

return 0;
}




Measured memory_bytes: 6276
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long 
#define f(z) for(int i=1;i<=z;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define vi vector<int>
#define pb push_back
#define si set<int>
int cl(int n ,int m) { if(n%m)return n/m + 1 ;else return n/m ;}
int pw(int a,int b){int r=1;while(b>0){if(b&1)r=r*a;a=a*a;b>>=1;}return r;}
#define mod  1000000007
#define T() int TT; cin>>TT; while(TT--)
#define P pair<int,int>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 1e6 + 5 ;
map<char , int > t ;
signed main(){
	string s ;
	int cnt = 0 ; 
	cin >> s ;
	int j = s.size()-1 ;
	for ( int i = 0 ; i<s.size()/2 ;i++){
		if( s[i] != s[j] ) cnt++ ;
		j-- ;
	} 
	cout << cnt ;
}







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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;

int main() {
    int x, y;
    cin >> x >> y;
    cout << x + y / 2 << endl;
    return 0;
}

Measured memory_bytes: 3592
#include <iostream>
int main(){
    int a;
    int b;
    int c;
    std::cin>>a>>b>>c;
    if (a<b && b<c&& a<c){
        std::cout<<"Yes"<<std::endl;
    }
    else {
        std::cout<<"No"<<std::endl;
    }
    return 0;
}


Measured memory_bytes: 3092
#include <iostream>
using namespace std;
int main(){
  long long int n,a;
  cin>>n>>a;
  
  for(int i=0;i<=n;i++){
    for(int m=0;m<=n;m++){
      int l=n-i-m;
      if(l>=0&&10000*i+5000*m+1000*l==a){
        cout<<i<<" "<<m<<" "<<l<<endl;
        return 0;
      }
    }
  }
  cout<<"-1 -1 -1"<<endl;
}

Measured memory_bytes: 384
#include <stdio.h>

int main( void )
{
     int S, h, m, s;
     scanf( "%d" , &S );
     h = S/3600;
     m = ( S % 3600 )/60;
     s = S % 60;
     printf ("%d:%d:%d\n", h, m, s);
     return 0;
}
     


Measured memory_bytes: 1976
import math as ma
l = list(map(int,input().split()))
N = int(input())
N *= 4
dp = [0 for i in range(9)]
for i in range(1,9):
    dp[i] = min([dp[i-2**j]+l[j] for j in range(min(4,int(ma.log2(i)+1)))])
ans = float('inf')
for i in range(1,9):
    ans = min(ans,N//i*dp[i] + dp[N-N//i*i])
print(ans)
        


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

using namespace std ;

const int MAX = 1e5 + 10 ;

int arr[MAX] ;
int n ;

string s , t ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>s>>t ;
	n = s.size() ;
	int ans = 0 ;
	for(int i = 0 ; i < n ; ++i)
	{
		if(s[i] != t[i])
			ans++ ;
	}
	return cout<<ans<<"\n" , 0 ;
}		

Measured memory_bytes: 3788
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define GG  {puts("No");continue;}
const int maxn=100005;
typedef long long ll;
int ufs1[maxn];ll w1[maxn];
int ufs2[maxn];ll w2[maxn];
struct node{
  int x,y,val;
  void read(){
    scanf("%d%d%d",&x,&y,&val);
  }
}P[maxn];
bool cmpx(const node &A,const node &B){
  return A.x<B.x;
}
bool cmpy(const node &A,const node &B){
  return A.y<B.y;
}
int find1(int x){
  if(x==ufs1[x])return x;
  int rt=find1(ufs1[x]);
  w1[x]+=w1[ufs1[x]];
  return ufs1[x]=rt;
}
int find2(int x){
  if(x==ufs2[x])return x;
  int rt=find2(ufs2[x]);
  w2[x]+=w2[ufs2[x]];
  return ufs2[x]=rt;
}
bool link1(int a,int b,ll w){
  if(find1(a)!=find1(b)){
    int ra=find1(a),rb=find1(b);
    ufs1[ra]=ufs1[rb];
    w1[ra]=w+w1[b]-w1[a];
    return true;
  }else{
    return w1[a]==w+w1[b];
  }
}
bool link2(int a,int b,ll w){
  if(find2(a)!=find2(b)){
    int ra=find2(a),rb=find2(b);
    ufs2[ra]=ufs2[rb];
    w2[ra]=w+w2[b]-w2[a];
    return true;
  }else{
    return w2[a]==w+w2[b];
  }
}
ll Min1[maxn],Min2[maxn];
int main(){
//  freopen("then.in","r",stdin);
//  freopen("then.out","w",stdout);
  int tests;tests=1;
  while(tests--){
    bool flag=true;
    int R,C;scanf("%d%d",&R,&C);
    for(int i=1;i<=R;++i){
      ufs1[i]=i;w1[i]=0;
    }
    for(int i=1;i<=C;++i){
      ufs2[i]=i;w2[i]=0;
    }
    int n;scanf("%d",&n);
    for(int i=1;i<=n;++i)P[i].read();
    for(int i=1;i<=n;++i)if(P[i].val<0)flag=false;
    sort(P+1,P+n+1,cmpx);
    for(int i=1;i<n;++i)
      if(P[i].x==P[i+1].x)
	if(!link2(P[i].y,P[i+1].y,P[i+1].val-P[i].val))flag=false;

    sort(P+1,P+n+1,cmpy);
    for(int i=1;i<n;++i)
      if(P[i].y==P[i+1].y)
	if(!link1(P[i].x,P[i+1].x,P[i+1].val-P[i].val))flag=false;

    memset(Min1,0x3f,sizeof(Min1));
    memset(Min2,0x3f,sizeof(Min2));
    for(int i=1;i<=n;++i){
      int rt=find1(P[i].x);
      Min1[rt]=min(Min1[rt],P[i].val+w1[P[i].x]);
    }
    for(int i=1;i<=R;++i){
      int rt=find1(i);
      Min2[rt]=min(Min2[rt],-w1[i]);
    }
    for(int i=1;i<=R;++i)
      if(ufs1[i]==i&&Min1[i]+Min2[i]<0)
	flag=false;

    // memset(Min1,0x3f,sizeof(Min1));
    // memset(Min2,0x3f,sizeof(Min2));
    // for(int i=1;i<=n;++i){
    //   int rt=find2(P[i].y);
    //   Min1[rt]=min(Min1[rt],P[i].val+w2[P[i].y]);
    // }
    // for(int i=1;i<=C;++i){
    //   int rt=find2(i);
    //   Min2[rt]=min(Min2[rt],-w2[i]);
    // }
    // for(int i=1;i<=C;++i)
    //   if(ufs2[i]==i&&Min1[i]+Min2[i]<0)
    // 	flag=false;
    
    printf("%s\n",flag?"Yes":"No");
  }
  return 0;
}

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


void solve() {
  int A,B;
  cin >> A >> B;

  cout << A*B << "\n";
}

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


Measured memory_bytes: 3612