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

int main(){
	string s;
	cin>>s;
	if(s=="RRR"){
		cout<<3;
	}else if(s.substr(0,2)=="RR"){
		cout<<2;
	}else if(s.substr(1,2)=="RR"){
		cout<<2;
	}else{
		int flag=1;
		for(int i=0;i<3;++i){
			if(s[i]=='R'){
				cout<<1;
				flag=0;
				break;
			}
		}
		if(flag) cout<<0;
	}
	return 0;
}


Measured memory_bytes: 3196
#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
        cout << "Possible\n";
    } else {
        cout << "Impossible\n";
    }
}

Measured memory_bytes: 256
import std.stdio, std.algorithm, std.range, std.conv, std.string;
import core.stdc.stdio;
// foreach, foreach_reverse, writeln

void main() {
	int n;
	scanf("%d", &n);
	int[] a = new int[n];
	int[] b = new int[n];
	foreach (i; 0..n) scanf("%d", &a[i]);
	foreach (i; 0..n) scanf("%d", &b[i]);
	int ans = 0;
	foreach (k; 0..29) {
		int mask = (1<<k)-1;
		int s = 0;
		if (n&1) {
			foreach (x; a) s ^= x>>k&1;
			foreach (x; b) s ^= x>>k&1;
		}
		int[] c = new int[n];
		c[] = b[]&mask;
		sort(c);
		auto sorted = assumeSorted(c);
		foreach (x; a) {
			x &= mask;
			int l = n - to!int(sorted.lowerBound((1<<k)-x).length);
			s ^= l&1;
		}
		ans |= s<<k;
	}
	writeln(ans);
}



Measured memory_bytes: 11388
from scipy.spatial import ConvexHull as CH
import numpy as np
norm=np.linalg.norm
n,*t=map(int,open(0).read().split())
a=np.reshape(t,(n,2))
try:
	h = CH(a).vertices
except:
	a=a-10**6
	if np.all(a[:,0]==a[0,0]):
		a=np.fliplr(a)
	b=a[:,0]
	M=np.argmax(b)
	m=np.argmin(b)
	for i in range(n):
		print(0.5*(i in (m,M)))
	exit()
l=len(h)
for i in range(n):
	if i in h:
		j=np.where(h==i)[0]
		f,s,t=a[h[j-1]],a[i],a[h[(j+1)%l]]
		print(np.arccos(np.inner(t-s,s-f)/(norm(t-s)*norm(s-f)))[0,0]/(2*np.pi))
	else:
		print(0.)

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

int main() {
  int N; // 支払い
  int A;  // 1円の枚数
  cin >> N >> A;

  int odd = N % 500;
  if (odd == 0) {
    cout << "Yes" << endl;;
  } else if (A >= odd) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int k = Integer.parseInt(str[1]);
    int q = Integer.parseInt(str[2]);
    int[] a = new int[q];
    int[] count = new int[n];
    for(int i=0; i<q; i++) {
      a[i] = Integer.parseInt(in.readLine());
      count[a[i]-1]++;
    }
    
    for(int i=0; i<n; i++) {
      if(k-(q-count[i])<=0)
        System.out.println("No");
      else
        System.out.println("Yes");
    }
  }
}

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

int main(){
  string s;
  int t = 0;
  
  for(int i = 1;i < 4;i++){
    cin >> s[i];
    if(s[i] == '1'){
      t = t + 1;
    }
  }
  cout << t << endl;
  return 0;
}

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

#define x first
#define y second
#define pb push_back
#define mp make_pair
#define For(i, j, k) for(int i = j; i <= k; i++)
#define Forr(i, j, k) for(int i = j; i >= k; i--)

using namespace std;

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

const int M = 12, N = 310;

int d[M][M], dis[M][M], A, B;
int f[N][N];

int main(){

	scanf("%d%d", &A, &B);
	For(i, 1, A) For(j, 1, B) scanf("%d", &d[i][j]), dis[i][j] = 1e9;
	For(i, 0, 100) For(j, 0, 100) For(u, 1, A) For(v, 1, B) 
		f[i][j] = max(f[i][j], d[u][v] - u * i - v * j);
	For(u, 1, A) For(v, 1, B) For(i, 0, 100) For(j, 0, 100)
		dis[u][v] = min(dis[u][v], f[i][j] + i * u + j * v);
	For(u, 1, A) For(v, 1, B) if(d[u][v] != dis[u][v]){
		puts("Impossible");
		return 0;
	}


	puts("Possible");
	int n = 101;
	printf("%d %d\n", n * 2, n * n + 2 * (n - 1));
	For(i, 1, n) For(j, 1, n) printf("%d %d %d\n", i, j + n, f[i - 1][j - 1]);
	For(i, 2, n) printf("%d %d X\n", i - 1, i);
	For(i, 2, n) printf("%d %d Y\n", i + n, i + n - 1);
	printf("%d %d\n", 1, n + 1);

	return 0;
}

Measured memory_bytes: 512
n=int(input())
A=list(map(int,input().split()))

cash=1000
stock=0
for i in range(n):
  if i==n-1:
    if stock!=0:
      cash+=A[i]*stock
      stock=0
    break
  if A[i]==A[i+1]:pass
  elif A[i]<A[i+1]:
    stock+=cash//A[i]
    cash%=A[i]
  else:
    if stock!=0:
      cash+=A[i]*stock
      stock=0
    
print(cash)

Measured memory_bytes: 61756
n, m = map(int, input().split())
sc_list = [[int(i) for i in input().split()] for _ in range(m)]

number_list = [-1 for _ in range(n)]
flag = True

for sc in sc_list:
    s = sc[0]
    c = sc[1]
    if number_list[s-1] != -1 and number_list[s-1]!=c:
        print(-1)
        flag = False
        break
    else:
        number_list[s-1] = c
        
if number_list[0] == 0 and len(number_list)>1:
    print(-1)
    flag = False
else:
    while -1 in number_list:
        i = number_list.index(-1)
        number_list[i] = 0
        
if number_list[0] == 0 and len(number_list)>1:
    number_list[0] = 1
    
if flag:
    print(''.join([str(i) for i in number_list]))

Measured memory_bytes: 3064
#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 N; cin>>N;
    string S; cin>>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 ans = R*G*B;
    
    for(int i=0; i<N-2; i++){
        for(int j=i; j<N-1; j++){
            if(2*j-i>=N) break;
            if((S[i]!=S[j]) && (S[i]!=S[2*j-i]) && (S[j]!=S[2*j-i])){
                ans--;
            }
        }
    }
    
    cout << ans << endl;
}


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

public class Main {
	private static final int READ_COUNT = 1;
	private static List<String> strList = new ArrayList<>();
	
	public static void main(String[] args) {
		read();
		
		String[] str = strList.get(0).split(" ");
		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);
		
		System.out.println(n % k == 0 ? 0 : 1);
	}
	
	private static void read() {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			for (int i = 0; i < READ_COUNT; i++) {
				strList.add(br.readLine());
			}
		} catch (IOException e) {
		}
	}
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  string s,t; cin>>s>>t;
  int size=s.size();
  vector<vector<ll>> num(26);
  s+=s;
  for(ll i=0;i<s.size();i++){
    int x=s[int(i)]-'a';
    num[x].push_back(i+1);
  }
  int k=0;
  ll sum=0;
  for(int i=0;i<t.size();i++){
    int y=t[i]-'a';
    if(num[y].size()==0){
      cout<<-1<<endl;
      return 0;
    }
    int z=*lower_bound(num[y].begin(),num[y].end(),k);
    if(z>size){
      z-=size;
      sum+=size;
    }
    k=z+1;
  }
  cout<<sum+k-1<<endl;
}

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

#include <iostream>
#include <fstream>

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

#ifndef JHELPER1_COMMON_H
#define JHELPER1_COMMON_H

typedef long long ll;
using namespace std;

constexpr ll MOD = 1000 * 1000 * 1000 + 7;

// Returns x^y modulo MOD. O(log2(y)).
ll modPow(ll x, ll y) {
  ll res = 1, a = x;
  while (y > 0) {
    if ((y & 1) > 0) {
      res = (res * a) % MOD;
    }
    a = (a * a) % MOD;
    y >>= 1;
  }
  return res;
}

// Returns a^-1 module MOD.
ll inverse(ll a) {
  /*
   * Fermat's little theorem
   * http://en.wikipedia.org/wiki/Proofs_of_Fermat's_little_theorem
   *
   * <pre>
   * a^p = a (mod p)
   * a^(p-1) = 1 (mod p)
   * ..
   * 1/a = a^(p-2) (mod p)
   * </pre>
   */
  return modPow(a, MOD - 2);
}


#endif //JHELPER1_COMMON_H

#ifndef JHELPER1_NCK_H
#define JHELPER1_NCK_H





#ifndef JHELPER1_FACTORIAL_H
#define JHELPER1_FACTORIAL_H





// return n! module MOD
// memory: O(n)
// 0! = 1, 1! = 1, 2! = 2, 3! = 6 ...
ll fact(ll n) {
  static vector<ll> facs;
  ll csize = facs.size();
  if (csize > n) return facs[n];

  facs.resize(n+1);
  for (int i = csize; i <= n; ++i) {
    facs[i] = (i == 0 ? 1 : (facs[i - 1] * i)) % MOD;
  }
  return facs[n];
}

#endif //JHELPER1_FACTORIAL_H


// Returns nCk module MOD
// Memory: O(n) used in factorial
ll nCk(ll n, ll k) {
  if (k > n) return 0;
  if (n > 3 && k > 3 && k > n / 2) {
    k = n - k;
  }

  // n!/(n-k)!k!
  ll ret = (fact(n) * inverse(fact(n-k))) % MOD;
  return (ret * inverse(fact(k))) % MOD;
}

#endif //JHELPER1_NCK_H


typedef long long ll;
using namespace std;

class FStrivore {
public:
  void solve(std::istream& in, std::ostream& out) {
    ll K;
    string S;
    in >> K;
    in >> S;
    ll L = S.length();

    ll N = K+ L;
    ll ans = 0;
    for (int i = L; i <= N; ++i) {
      ll c = nCk(i - 1, L - 1);
      c = (c * modPow(25, i - L)) % MOD;
      c = (c * modPow(26, N - i)) % MOD;
      ans = (ans + c) % MOD;
    }

    out << ans << endl;
  }
};


int main() {
	FStrivore solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

const ll mod = 1e9+7;

int main(){ 
  ll a,b;
  cin>>a>>b;
  
  ll ans = 0;
  ll p = 1;
  rep(i,48){
    ll res = ((a/(2*p))*p)%2+max((ll)0,a%(2*p)-p);
    res %= 2; 
    ll res2 = (((b+1)/(2*p))*p)%2+max((ll)0,(b+1)%(2*p)-p);
    res2 %= 2; 
    ans += p*abs(res2-res);
    p *= 2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		new Main().run();
	}

	private void run() {
		Scanner scanner = new Scanner(System.in);
		boolean[] tri = new boolean[1000001];
		for (int i = 1; i * (i + 1) / 2 <= 1000000; i++)
			tri[i * (i + 1) / 2] = true;
		loop: while (true) {
			int n = scanner.nextInt();
			if (n == 0)
				break;
			int[] a = new int[10001];
			int sum = 0;
			for (int i = 1; i <= n; i++) {
				a[i] = scanner.nextInt();
				sum += a[i];
			}
			if (tri[sum]) {
				int res = 0;
				int R = n;
				while (res <= 10000) {
					if (slove(R, a)) {
						System.out.println(res);
						continue loop;
					}
					int L = 1;
					for (int i = 1; i <= R; i++) {
						if (a[i] == 1)
							continue;
						a[L++] = a[i] - 1;
					}
					a[L] = R;
					R = L;
					res++;
				}
			}
			System.out.println(-1);

		}
	}

	private boolean slove(int r, int[] a) {
		for (int i = 1; i <= r; i++)
			if (i != a[i])
				return false;
		return true;
	}
}

Measured memory_bytes: 23744
# coding: utf-8
# Your code here!

s = input().rstrip().split(' ')
trick = int(s[0])
sunuke = []

for i in range(int(s[1])):
  kind = str(input())
  has = input().rstrip().split(' ')
  
  for j in range(len(has)):
    sunuke.append(has[j])

sunuke = set(sunuke)


print(trick - len(sunuke))

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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

int main() {
  LL A, B ,K;
  cin >> A >> B >> K;
  
  if(A > K) {
    A -= K;
  }
  else {
    B += A -K;
    A = 0;
  }
  if(B < 0) B = 0;
  
  cout << A << " " << B << endl;
  
  return 0;
}

Measured memory_bytes: 256
/*Code by 520 -- 11.2*/
#include<bits/stdc++.h>
#pragma GCC optimize(2)
#define il inline
#define ll long long
#define RE register
#define For(i,a,b) for(RE int (i)=(a);(i)<=(b);(i)++)
#define Bor(i,a,b) for(RE int (i)=(b);(i)>=(a);(i)--)
using namespace std;
ll T,n,x,ans;

ll gi(){
	ll a=0;char x=getchar();
	while(x<'0'||x>'9') x=getchar();
	while(x>='0'&&x<='9') a=(a<<3)+(a<<1)+(x^48),x=getchar();
	return a;
}

il void solve(ll a,ll b){
	if(a<b) swap(a,b);
	if(!b) return;
	ans+=a/b*b*3;
	solve(b,a%b);
}

int main(){
	n=gi(),x=gi();
	ans=0,solve(x,n-x);
	printf("%lld\n",ans);
	return 0;
}

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

int mp[16][16];
int dp[16][16];
int main() {
	int x, y;
	while (cin >> x >> y, x) {
		memset(dp, 0, sizeof(dp));
		rep(i, y)rep(j, x)cin >> mp[i][j];
		rep(i, x)if (!mp[0][i])dp[0][i] = 1;
		rep(i, y - 1)rep(j, x) {
			if (mp[i][j] == 0) {
				if (j > 0 && !mp[i + 1][j - 1])dp[i + 1][j - 1] += dp[i][j];
				if (mp[i + 1][j] != 1)dp[i + 1][j] += dp[i][j];
				if (j + 1 < x && !mp[i + 1][j + 1])dp[i + 1][j + 1] += dp[i][j];
			}
			if (mp[i][j] == 2 && i + 2 < y&&mp[i + 2][j] != 1)
				dp[i + 2][j] += dp[i][j];
		}
		int sum = 0;
		rep(i, x) {
			if (mp[y - 2][i] == 2)sum += dp[y - 2][i];
			sum += dp[y - 1][i];
		}
		cout << sum << endl;
	}
}

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

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

//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
//const ll INF = LONG_LONG_MAX / 10;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef pair<char, int> P;

void print_line(vector<P> &line) {
    if (line.size() == 0ll) {
        cout << endl;
        return;
    }
    for (ll i = 0; i < line.size(); i++) {
        cout << line[i].second;
        if (i == line.size() - 1) cout << endl;
        else cout << ' ';
    }
}


typedef priority_queue<long long, vector<long long>, greater<long long> > PQ_ASK;
const int mod = 1000000007;

struct Child {
    int id, parent, depth;
};

void bfs(int n, vector<vector<int> > &tos, vector<int> &parents, vector<int> &depths) {

    set<int> s;
    rep(i, n) s.insert(i);
    rep(i, n) {
        rep(j, tos[i].size()) {
            s.erase(tos[i][j]);
        }
    }
    int root = *s.begin();


    queue<Child> q;
    q.push(Child{root, -1, 0});

    while (!q.empty()) {
        Child parent = q.front();
        q.pop();

        parents[parent.id] = parent.parent;
        depths[parent.id] = parent.depth;

        for (int i = 0; i < tos[parent.id].size(); i++) {
            int to = tos[parent.id][i];
            Child next{to, parent.id, parent.depth + 1};
            q.push(next);

        }
    }

}

string get_types(int i, vector<int> &parents, vector<vector<int> > &tos) {
    if (parents[i] == -1) return "root";
    if (tos[i].empty()) return "leaf";
    return "internal node";

}

string get_children(int i, vector<int> &tos) {
    if (tos.empty()) {
        return "[]";
    }

    ostringstream oss;
    oss << "[";
    for (int i = 0; i < tos.size(); i++) {
        oss << tos[i];
        if (i == tos.size() - 1) oss << "]";
        else oss << ", ";
    }
    return oss.str();
}

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

    vector<vector<int> > tos(n);

    rep(i, n) {
        int j, k;
        cin >> j >> k;
        rep(l, k) {
            int to;
            cin >> to;
            tos[j].push_back(to);
        }
    }

    vector<int> parents(n);
    vector<int> depths(n);

    bfs(n, tos, parents, depths);

    rep(i, n) {
        string type = get_types(i, parents, tos);
        string children = get_children(i, tos[i]);

        printf("node %d: parent = %d, depth = %d, %s, %s\n", (int) i, parents[i], depths[i], type.c_str(),
               children.c_str());
    }

}




Measured memory_bytes: 11528
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String[] s=br.readLine().split(" ");
		int M=Integer.parseInt(s[0]);
		int D=Integer.parseInt(s[1]);
		int count=0;
		for(int i=4;i<=M;i++){
			for(int j=22;j<=D;j++){
				int unit=j%10;
				int tens=j/10;
				if(unit<2 || tens<2)
				continue;
				if((unit*tens)==i){
					count++;
				}
			}
		}
		System.out.println(count);
	}
}

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  string t;
  cin >> s;
  cin >> t;
  int n=0;
  for(int i=0;i<3;i++)
    if(s[i]==t[i]) n++;

  cout<<n<<endl;
  return 0;
}


Measured memory_bytes: 888
#include<stdio.h>
int main()
{
  int n,x;
  int l[100];
  int d1,d2;
  int i,count;
  
  scanf("%d %d",&n, &x);
  for(i=0;i<n;i++){
    scanf("%d ",&l[i]);
  }
  
  d1=0;
  count=1;
  
  for(i=1;i<=n;i++){
    d2=d1+l[i-1];
    d1=d2;
    if(x>=d2){
      count++;
    }
  }
  
  printf("%d",count);
    
  return 0;
}

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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll A, B;
    cin >> A >> B;
    if(A == 2 || B == 2) cout << "No";
    else cout << "Yes";
    cout << endl;
    return 0;
}


Measured memory_bytes: 3532
n, x = gets.chomp.split(' ').map{|i| i.to_i}
m = Array.new(n)
n.times do |i|
        m[i] = gets.chomp.to_i
end
min = 1000
cnt = 0
m.each do |i|
        min = (i < min) ? i : min
        x -= i
        cnt += 1
end
cnt += x / min
puts cnt

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

int a, b, c;
int x;
int sum=0;

int solve(){
    for(int i = 0; i <= a; i++){
        for(int j = 0; j <= b; j++){
            for(int k = 0; k <= c; k++){
                 if(i*500+j*100+k*50==x)
                    sum++;               
            }
        }
    }
}
int main(void)
{
    //input
    cin >> a >> b >> c >> x;
    //calculate
    solve();
    //output
    cout << sum << endl;   
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll dpa[100005],dpb[100005],dpc[100005];

int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n],c[n];
  for(int i=0;i<n;i++){
    cin>>a[i]>>b[i]>>c[i];
  }
  dpa[n-1]=a[n-1];
  dpb[n-1]=b[n-1];
  dpc[n-1]=c[n-1];
  for(int i=n-2;i>=0;i-- ){
   dpa[i]=a[i]+max(dpb[i+1],dpc[i+1]);
   dpb[i]=b[i]+max(dpa[i+1],dpc[i+1]);
   dpc[i]=c[i]+max(dpb[i+1],dpa[i+1]);
  }
  cout<<max(dpa[0],max(dpb[0],dpc[0]));
    return 0;
}


Measured memory_bytes: 8236
#include<iostream>
using namespace std;
int main()
{
  int a,b,c,sum,i=0;
  cin>>a>>b>>c;
  sum=a;
  if(b>=a*c){
    cout<<c<<"\n";
  }
  else{
    while(sum<=b){
      sum+=a;
      i++;
    }
    cout<<i<<"\n";
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
   ll dp[2000000];
 int gcd(int a, int b)
{
  if (a%b == 0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
int main(){
  string a;cin>>a;
  rep(i,a.size())if(a[i]==',')a[i]=' ';
  cout<<a;
}



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

map <long long int,long long int> memo;
int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	long long int x;

	cin >> x;

	for(long long int i=-1000;i<=1000;i++)
	{
		long long int B = i*i*i*i*i;
		//cout << ' ' << B << ' ' << i << '\n';
		memo[B] = i;
	}

	for(long long int i=-1000;i<=1000;i++)
	{
		long long int B = i*i*i*i*i;
		long long int X = x + B;
		if(memo.find(X)!=memo.end())
		{
			cout << memo[X] << ' ' << i << '\n';
			break;
		}
	}

	return 0;
}


Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> N(26, 0);
  while (1){
    string s;
    getline(cin, s);
    if (s == "") break;
    for (int i = 0; i < s.size(); i++){
      if (isupper(s[i])){
        s[i] = tolower(s[i]);
      }
      if (islower(s[i])){
        N[s[i] - 'a']++;
      }
    }
  }
  for (int i = 0; i < 26; i++){
    cout << (char)('a' + i) << " : " << N[i] << endl;
  }
}


Measured memory_bytes: 3128
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] ball = new int[10];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < 10; j++) {
        ball[j] = sc.nextInt();
      }
      int aTop = 0;
      int bTop = 0;
      boolean res = true;
      for (int j = 0; j < 10; j++) {
        if (aTop > bTop && ball[j] > aTop) {
          aTop = ball[j];
        }
        else if (ball[j] > bTop) {
          bTop = ball[j];
        }
        else if (ball[j] > aTop) {
          aTop = ball[j];
        }
        else {
          res = false;
        }
      }
      System.out.println(res ? "YES":"NO");
    }
  }
}

Measured memory_bytes: 11000
i,j,k;
long a[444],p[444][444],S,T,P;
main()
{
	scanf("%*d");
	for(;~scanf("%ld",&T);)
	{
		for(a[i=j++]=T;i--;p[i][j]=P)
		{
			P=9e18;
			for(T+=a[k=i];++k<j;)
			{
				P=fmin(P,p[i][k]+p[k][j]+T);
			}
		}
	}
	printf("%ld",P);
}

Measured memory_bytes: 1536
#include <cstdio>
#include <cstring>
#include <algorithm>
void Unused(...) {}
#ifndef DEBUG
  #define echo(...) Unused(__VA_ARGS__)
#else
  #define echo(...) fprintf(stderr, __VA_ARGS__)
#endif

const int MaxN = int(1e5) + 7;

int n;
int dir[MaxN];
int tot[MaxN];

int main()
{
    n = 0;
    for (int peek = getchar(); peek == 'L' || peek == 'R'; peek = getchar())
        dir[++n] = peek == 'L' ? -1 : 1;
    int odd = 0, even = 0;
    for (int pos = 1; pos <= n; ++pos)
        if (dir[pos] == -1)
        {
            tot[pos - 1] += odd;
            tot[pos] += even;
            odd = even = 0;
        }
        else
        {
            std::swap(odd, even);
            ++odd;
        }
    for (int i = 1; i <= n; ++i)
        echo("%d ", tot[i]);
    echo("\n");
    odd = even = 0;
    for (int pos = n; pos >= 1; --pos)
        if (dir[pos] == 1)
        {
            tot[pos + 1] += odd;
            tot[pos] += even;
            odd = even = 0;
        }
        else
        {
            std::swap(odd, even);
            ++odd;
        }
    for (int i = 1; i <= n; ++i)
        printf("%d ", tot[i]);
    printf("\n");
    return 0;
}



Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  if(S=="SSS")puts("0");
  else if(S=="SSR")puts("1");
  else if(S=="SRS")puts("1");
  else if(S=="SRR")puts("2");
  else if(S=="RSS")puts("1");
  else if(S=="RSR")puts("1");
  else if(S=="RRS")puts("2");
  else puts("3");
}

Measured memory_bytes: 3596
// Aizu Vol-3 0345: Rectangle
// 2017.8.25

#include <stdio.h>

int e[4], f[4];

int main()
{
	int i, j, k;

	for (i = 0; i < 4; i++) e[i] = -1, f[i] = 0;
	for (i = 0; i < 4; i++) { 
		scanf("%d", &k);
		for (j = 0; j < 4; j++) {
			if (k == e[j]) { f[j]++; break; } 
			else if (e[j] < 0) { e[j] = k, f[j] = 1; break; }
		}
	}
	puts((f[0] & 1) || (f[1] & 1) ? "no" : "yes");
	return 0;
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define pi pair<int ,int >
#define pl pair<ll ,ll >
#define pb push_back
#define vl vector <long long int >
#define vi vector <int >
#define vp vector <pi>
#define mod 1000000007
#define eps 1e-9
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define _ <<" "<<
#define forn(x,	n) for(int x = 0; x < n ;++ x) 
#define forn1n(x,n) for(int x = 1; x <= n ;++ x)
#define forn1(x,n) for(int x = 1; x < n ;++ x)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#pragma GCC optimize ("Ofast")
void scan(){}
template<typename F, typename... R> void scan(F &f,R&... r){cin>>f;scan(r...);}
int di_; string dnms_, co_ = ",";
void debug_(){cout<<endl;}
template<typename F, typename... R> void debug_(F &f, R&... r){while(dnms_[di_] != ',')cout<<dnms_[di_++];di_++;cout<<": "<<f<<",";debug_(r...);}
#define debug(...) dnms_=#__VA_ARGS__+co_,di_=0,debug_(__VA_ARGS__)

template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &a){
    return out<<"("<<a.first<<","<<a.second<<")";}
template<class A> ostream& operator<<(ostream& out, const vector<A> &a){
	out<<"";for(auto it=a.begin();it!=a.end();it++){if(it!=a.begin())out<<" ";out<<*it;}out<<"";
	return out;}
template<class A, class B> istream& operator>>(istream& in, pair<A,B> &a){in>>a.first>>a.second;return in;}
template<class A> istream& operator>>(istream& in, vector<A> &a){for(A &i:a)in>>i;return in;}

ll fastexpo(ll x, ll y)
{
	if(y==0)
		return 1;
	if(y%2==0)
		return fastexpo((x*x)%mod,y/2)%mod;
	else
		return ((x%mod)*(fastexpo((x*x)%mod,y/2)%mod))%mod;
}
int main(){
	IOS

	ll x,y;
	cin>>x>>y;
	ll a = 2*y-x;
	ll b = 2*x -y;
	if(a<0||b<0||a%3!=0||b%3!=0)
	{
		cout<<0; return 0;
	}
	a/=3;
	b/=3;

	ll facta=1, factb=1,factab=1;

	for(ll i=2;i<=a+b;i++)
	{
		if(i<=a)
		{
			facta *= i;
			facta%=mod;
		}
		if(i<=b)
		{
			factb *=i;
			factb%=mod;
		}
		factab *=i;
		factab%=mod;
	}
	// debug(facta,factb,factab);
 	ll ifacta = fastexpo(facta,mod-2);
 	ll ifactb = fastexpo(factb, mod-2);
 	// debug(ifacta,ifactb);
 	ll ans = (factab*ifacta)%mod;
 	ans = (ans*ifactb)%mod;
 	cout<<ans;
	return 0;	
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(){
    int a,b;
    cin >> a >> b;
    a--;
    b--;
    int i,c;
    rep(i,20){
        if(a*i>=b){
            c=i;
            break;
        }
    }
    cout << c;
}

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

long long int n,i,a[100010],b[100010],ans;

signed main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>n;
	for (i=1;i<n+2;i++) cin>>a[i];
	for (i=1;i<n+1;i++) cin>>b[i];
	ans=0;
	for (i=1;i<n+1;i++)
	{
		if (a[i]>b[i]) ans=ans+b[i];else
		{
			b[i]=b[i]-a[i];
			ans=ans+a[i]+min(b[i],a[i+1]);
			a[i+1]=a[i+1]-min(b[i],a[i+1]);
		}
	}
	cout<<ans;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define int long long
#define for1(i, n) for(int i = 1; i <= (n);i++)
#define puts(x) cout << x << "\n"
constexpr int mod = 1000000007;
using namespace std;
int n, k, a[123456], ans;
int f1(int a, int p) {
	if (p == 1)return a;
	if (p % 2)return f1(a, p - 1) * a % mod;
	else return f1(a * a % mod, p / 2) % mod;
}
signed main() {
	cin >> n >> k;
	for1(i, k) a[i] = ((i == 1 || k / i != k / (i - 1)) ? f1(k / i, n) : a[i - 1]);
	for (int i = k; i >= 2; i--)for1(j, sqrt(i)) if (i%j == 0) {
		a[j] -= a[i]; if (a[j] < 0)a[j] += mod;
		if (j > 1 && j*j != i) { a[i / j] -= a[i]; if (a[i / j] < 0)a[i / j] += mod; }
	}
	for1(i, k) { ans += a[i] * i; ans %= mod; }
	puts(ans);
}

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

#define ll long long

int main(){

    ll n,W;
    cin>>n>>W;
    vector<ll> dp(W+1);

    for(ll i=0;i<n;i++){
        ll w,v;
        cin>>w>>v;
        for(ll j=W-w;j>=0;--j){
            dp[j+w] = max(dp[j+w],dp[j]+v);
        }
    }
    cout<<dp[W];
    
    return 0;
}

Measured memory_bytes: 4052
N, K = map(int, input().split())
h_list = [int(input()) for h in range(N)]

h_list.sort()

min_index = 0
max_index = min_index + K - 1

hmax_hmin = 99999999999999

while len(h_list) >= max_index + 1:
  if hmax_hmin > h_list[max_index] - h_list[min_index]:
  	hmax_hmin = h_list[max_index] - h_list[min_index]
  
  min_index += 1
  max_index += 1

print(hmax_hmin)
  

Measured memory_bytes: 7488
import itertools
N = int(input())
l = list(itertools.permutations([i for i in range(1, N + 1)]))
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
P_c = 0
Q_c = 0
for i in range(len(l)):
    if l[i] == P:
        P_c = i
    if l[i] == Q:
        Q_c = i
print(abs(P_c - Q_c))


Measured memory_bytes: 8052
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>

using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;
const int MAX = 100000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }


int main(){
    int N; cin >> N;
    map<ll,ll> m;
    for(int i=0;i<N;i++){
        ll a; cin >> a;
        ll tmp = m[a];
        m[a] = tmp+1;
    }
    ll cnt=0;
    for(auto i=m.begin();i!=m.end();i++){
        ll n = i->first;
        ll c = i->second;
        //cerr << n << " " << c << endl;
        if(n>c){
            cnt += c;
        }else if(n<c){
            cnt += c-n;
        }
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 6272
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M=1e9+7;
ll memo[100005][2];
vector<int>adj[100005];
ll solve(int idx,int color,int prev)
{
    if(adj[idx].size()==1 && adj[idx][0]==prev) return 1;
    if(memo[idx][color]!=-1) return memo[idx][color];
    
    ll ret=1;
    
    if(color==0)
    {
        for(int i=0;i<adj[idx].size();i++)
        {
            if(adj[idx][i]!=prev)
            {
                ret=(ret%M*(solve(adj[idx][i],0,idx)+solve(adj[idx][i],1,idx))%M)%M;
            }
        }
    }
    
    else
    {
        for(int i=0;i<adj[idx].size();i++)
        {
            if(adj[idx][i]!=prev)
            {
                ret=(ret%M*(solve(adj[idx][i],0,idx))%M)%M;
            }
        }
    }
    
    //cout<<idx<<" "<<color<<" "<<prev<<" "<<ret<<endl;
    return memo[idx][color]=ret%M;
}
int main()
{
    memset(memo,-1,sizeof(memo));
    int n;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int u,v;
        cin>>u>>v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }
    
    ll ans=solve(1,0,0);
    ans=(ans%M+solve(1,1,0)%M)%M;
    cout<<ans<<endl;
}

Measured memory_bytes: 15616
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

p,q,r = LI()

print(min(p+q,q+r,p+r))

Measured memory_bytes: 38384
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	a := nextInt()
	b := nextInt()
	t := nextInt()

	cnt := 0
	for i := 1; i <= t; i++ {
		if i%a == 0 {
			cnt += b
		}
	}

	fmt.Println(cnt)

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1780
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#include<unistd.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll INF = 1LL << 60;
const ll mod = 1000000007;
typedef pair<ll,ll> P;
using graph = vector<vector<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;}
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}
//printf("%.10f\n", N);
/*
ll fibo(ll n){
    if(memo[n] != 0)return memo[n];
    if(n <= 1)return n;
    else return memo[n] = fibo(n - 1)+ fibo(n - 2);
}*/
/*  vector<ll> vec = {1,2,5,6,8,9,10};
    cout << binary_search(all(vec),5) << endl; -> true*/
/*
    vector<ll> vec = {1,2,5,6,8,9,10};
    auto n = upper_bound(all(vec),4);
    cout << *n << endl; -> 5*/
/*
    cout << fixed << setprecision(15);
    */
int main(){
    ll N;
    cin >> N;
    if(N % 2 == 0)cout << N << endl;
    else cout << 2 * N << endl;
}

Measured memory_bytes: 256
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
 
using ull = unsigned long long int;
using ll = long long int;
using du = double;
using ld = long du;
using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;
using vdu = vector<du>;
using vs = vector<string>;
using vc = vector<char>;
using si = set<int>;
using sll = set<ll>;
using sdu = set<du>;
using sld = set<ld>;
using pii = pair<int, int>;
using pll = pair<ll,ll>;
using pdu = pair<du,du>;
using pld = pair<ld,ld>;
using pis = pair<int,string>;
 
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define sp(x) setprecision(x)<<fixed
#define loop(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define pi acos(-1)
#define meme(a,x) memset(a,x,sizeof(a))
 
//debugger
 
#ifdef KAIZER
#include "debug.h"
#else
#define debug(x...)
#endif
//debugger
 
//functions
bool check_pow(ll a)
{
    if((a&(a-1))==0) return true;
    else return false;
}
ld my_pow(ld a,int b)
{
    ld ans=1;
    for(int i=0;i<b;i++) ans*=a;
    return ans;
}
ll digits(ll a)
{
    string line=to_string(a);
    return line.size();
}
bool prime_check(ll a)
{
    bool flag=true;
    for(ll i=2;i<=sqrt(a);i++)
    {
        if(a%i==0) {flag=false; break;}
    }
    return flag;
}
bool comp(const ll &a , const ll &b)
{
    return a>b;
}
const ll xyz=2e5+10;
ll fact[xyz];
void mod_fact(ll m=1)
{
    fact[0]=1;
    loop(i,(2e5)) 
    {
        ll p=i+1;
        //if(p%2==0) p/=2;
        fact[i+1]=(((fact[i])%m)*(p%m))%m;
    }
}

//functions


int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    FASTIO;
    ll t;
    cin>>t;
    string fir,sec;
    cin>>fir>>sec;
    loop(i,t) cout<<fir[i]<<sec[i];
    cout<<endl;
}


Measured memory_bytes: 3656
using System;
using System.IO;
using System.Linq;

namespace ABC118
{
    class C
    {
        static void Main(string[] args)
        {

            //StreamReader sr = new StreamReader(@"./testcase/in/testcase");
            long N = long.Parse(Console.ReadLine());
            long[] A = Console.ReadLine().Split().Select(long.Parse).OrderByDescending(x => x).ToArray();
            //long N = long.Parse(sr.ReadLine());
            //long[] A = sr.ReadLine().Split().Select(long.Parse).OrderByDescending(x => x).ToArray();

            long res = A[0];
            for (long i = 1; i < N; i++)
            {
                res = gcd(res, A[i]);
            }

            Console.WriteLine(res);
        }

        static long gcd(long a, long b)
        {
            if (b == 0) return a;
            return gcd(b, a % b);
        }

    }
}


Measured memory_bytes: 26080
#define _USE_MATH_DEFINES
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <tuple>
#include <climits>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<double> VD;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<long long>> VVLL;
typedef vector<vector<bool>> VVB;
typedef vector<vector<double>> VVD;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(a) (a).begin(),(a).end()

const int MOD = 1000000007;

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

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

void debug(VI &arr){
	int n=arr.size();
	rep(i,n){
		cout<<arr.at(i)<<endl;
	}
}

void debug(VVI &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout << board.at(i).at(j) << " ";
		}
		cout<<endl;
	}
}

void debug(VVLL &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout<<board.at(i).at(j)<<" ";
		}
		cout<<endl;
	}
}

void debug(VS &board){
	int h = board.size();
	rep(i,h){
		cout<<board.at(i)<<endl;
	}
	return;
}

LL gcd(LL a,LL b){
	return b==0?a:gcd(b,a%b);
}

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

int main(){
	//cout<<fixed;
	//cout<<setprecision(9)<<...
	string s;
	cin>>s;
	int tmp = 0, ans = 0;
	for(int i=0;i<3;i++){
		if(s[i]=='R'){
			tmp++;
		}else{
			ans = max(tmp, ans);
			tmp = 0;
		}
	}
	ans = max(tmp,ans);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3628
#include<stdio.h>
int main(){
  int n,a,b,x=0,i,j,t;
  scanf("%d%d%d",&n,&a,&b);
  for(i=1;i<=n;i++){t=0;for(j=i;j;j/=10)t+=j%10;if(t>=a&&t<=b)x+=i;}
  printf("%d",x);
}

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

int main() {
  int h,n;
  cin >> h >> n;
  int sum=0;
  for(int i=0;i<n;i++){
    int a;
    cin >> a;
    sum += a;
  }
  if(sum >= h){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return(0);
}

Measured memory_bytes: 3596
import itertools as itr
N,M,Q = map(int,input().split())
sheat = list()
for i in range(Q):
    sheat.append(list(map(int,input().split())))

comb = tuple(itr.combinations_with_replacement(range(1,M+1),N))
Maxsum = 0
# print(sheat)
# print(comb)
sumd = 0
for i in range(len(comb)):
    ansum = 0
    for j in range(Q):
        if(comb[i][sheat[j][1]-1]-comb[i][sheat[j][0]-1] == sheat[j][2]):
            ansum += sheat[j][3]
           
    if(Maxsum < ansum):
        Maxsum = ansum
    # print(ansum)
print(Maxsum)      
# for i in range(Q):
#     sumd += sheat[i][3]
# print(sumd)
#nCm

#A_1,A_2,A_3,...A_n,M
#A_b-i - A_a-i = C_i  :Sum di

# A= {1,3,4} :comb          ↓sheat
#  i = 1:4 - 1 = 3o 100     [1,3,3]
#      2:3 - 1 = 2o  10     [1,2,2]
#      3:4 - 3 = 1*  10     [2,3,2]
#                   110


Measured memory_bytes: 21772
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
    cin>>arr[i];
}
sort(arr,arr+n);
cout<<arr[n/2]-arr[n/2-1]<<endl;
return 0;
}


Measured memory_bytes: 640
#include <string>
#include<iostream>
#include<vector>
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;

int main() {
  int n,t,a;
  cin >> n >> t >> a;
  vector<int> vec(n);
  vector<int> tmp(n);
  int ans;
 long long int dif=10000000000000;
  for(int i=0;i<n;i++){
    cin >> vec.at(i);
    tmp.at(i)=t*1000-vec.at(i)*6;
    if(dif>abs(tmp.at(i)-a*1000)){
      dif=abs(tmp.at(i)-a*1000);
      ans=i+1;
    }
  }
  cout << ans << endl;
}
  

Measured memory_bytes: 256
N = int(input())
V = sorted([int(x) for x in input().split()])

import heapq

heapq.heapify(V)

while len(V) >= 2:
    x = heapq.heappop(V)
    y = heapq.heappop(V)
    heapq.heappush(V, (x + y) / 2)

print(V[0])






Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>

#define MAX_SIZE 100000000
typedef unsigned long long ull;
using namespace std;

bool solve(const int n, const int x, const int y) {
  if(n - ((4 * x) + (7 * y)) == 0) {
    return true;
  } else {
    return false;
  }
}

int main() {
  int N; cin >> N;
  if(N < 4) {
    cout << "No" << endl;
    exit(0);
  }

  bool ans = false;
  for(int x = 0; x < N; x++) {
    for(int y = 0; y < N; y++) {
      if(solve(N,x,y)) {
        ans = true;
      }
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
    int k, a, b;
    cin >> k >> a >> b;
    bool ans = false;
    for(int i = 1; k * i <= b; i++) {
        if(a <= k * i) {
            ans = true;
            break;
        }
    }
    cout << (ans ? "OK" : "NG") << endl;
}


Measured memory_bytes: 3652
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
#define fcout cout << fixed << setprecision(10)
int main(){
    string s;
    cin>>s;
    int w;
    cin>>w;
    for(int i=0;i<s.size();i+=w)cout<<s[i];
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned uint;
typedef pair<uint, uint> pairUInt;
#define FOR(i,n) for(int i=0; i<int(n); i++)
#define FOR1(i,m,n) for(int i=int(m); i<int(n); i++)

const int MAXN=1e5;

int main(int argc, char *argv[])
{
    int N, M, a, b;
    int hist[MAXN+1] {0};

    cin >> N >> M;

    FOR(i,M) {
        cin >> a >> b;
        hist[a]++;
        hist[b]++;
    }

    FOR1(i,1,N+1) {
        if (hist[i]%2 == 1) {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    
    return 0;
}


Measured memory_bytes: 640