akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.rmi.server.UnicastRemoteObject;

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

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

        int n = sc.nextInt();
        int k = sc.nextInt();
        int sz=2002;
        long fr[] = new long[sz];
        long inv[]= new long[sz];

        fr[0] = inv[0] = 1;
        fr[1] = inv[1] = 1;
        int mod = 1000000007;

        for (int i = 2; i <sz; ++i){
            inv[i] = inv[mod % i] * (mod - mod / i) % mod ;
        }

        for (int i = 2; i <sz; ++i){
            fr[i] = fr[i-1]*i %mod;
            inv[i] = inv[i-1]*inv[i] %mod;
        }
        
        int r=n-k,b=k;

        for (int i = 1; i <= k; i++) {
        	if(b<i ||r+1-i<0) {
        		out.println(0);
        		continue;
        	}
			long ans=fr[r+1]*inv[i];
			ans%=mod;
			ans*=inv[r+1-i];
			ans%=mod;
			ans*=fr[b-1];
			ans%=mod;
			ans*=inv[i-1];
			ans%=mod;	
	        out.println((ans*inv[b-i])%mod);
		}
        
        out.println();
        out.flush();
    }

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

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

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


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

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

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


Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(void){
    int n,a=0;
    cin>>n;
    vector<int> vec(n);
    rep(i,0,n)cin>>vec[i];
    sort(vec.begin(),vec.end());
    cout<<(vec[n-1]-vec[0]);
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/perl

my ($r,$g,$b,$n) = map {$_ - 0} split(/\s+/o,<STDIN>);

my $res = 0;
for(my $r1 = 0; $r1 <= 3000; $r1 ++){
  last if $r1 * $r > $n;
  for(my $g1 = 0; $g1 <= 3000; $g1 ++){
    my $n_b = $n - ( $r1 * $r + $g1 * $g );
    last if $n_b < 0;
    $res ++ if( ($n_b % $b)==0 );
  }
}
print "$res\n";

exit(0);



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

int main() {
  int64_t N,Q=1000000007,T=1;
  cin>>N;
  for(int64_t i=1;i<N;i++){
    T*=i;
    T%=Q;
  }
  vector<int64_t> C(N,T);
  for(int64_t i=1;i<N;i++){
    int64_t N=Q-2; //ここから
       int64_t a=1,b=0,c=1;
       while(N>0){
         a*=2;
         if(N%a!=0){
           N-=a/2;
           int64_t d=i;
           for(int j=0;j<b;j++){
            d=d*d;
             d=d%Q;
          }
           c=c*d;
          c=c%Q;
         }
        b++;
      } //ここまで
    C[i]=(C[i]*c)%Q;
  }
  vector<int64_t> p(N);
  for(int i=0;i<N;i++){
    cin>>p[i];
  }
  vector<int64_t> q(N-1);
  for(int i=1;i<N;i++){
    q[i-1]=p[i]-p[i-1];
  }
  int64_t Z=0,A=0;
  for(int i=0;i<N-1;i++){
    A+=C[1+i];
    A%=Q;
    Z+=A*q[i];
    Z%=Q;
  }
  cout<<Z<<endl;
}

Measured memory_bytes: 5576
#include<bits/stdc++.h>
#define lint long long int
#define rep(i,n) for(int i=0;i<int(n);i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define arep(i,a,n) for(int i=a;i<n;i++)
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define fill(a,x) fill(a.begin(),a.end(),x)
#define eb(data) emplace_back(data)
#define pb(data) emplace_back(data)
#define mp make_pair
#define ALNUM 26
#define vint vector<int>
#define vlint vector<lint>
#define F first
#define S second
#define ALL(data) data.begin(),data.end()
#define GEts(s) getline(cin,s);
#define UNIQUE(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end())

using namespace std;
template<typename Rast>inline void out(Rast rast){cout<<rast<<"\n";return;}
template<typename Rast>inline void in(Rast& rast){cin>>rast;return;}
template<typename T>istream& operator >> (istream& is, vector<T>& vec){for(T& x: vec) is >> x;return is;}
template<typename First, typename... Rest>void in(First& first, Rest&... rest){cin >> first;in(rest...);return;}
template<typename First, typename... Rest>void out(First first, Rest... rest){cout << first<<" ";out(rest...);return;}
template<typename T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<typename T1,typename T2>bool chmax(T1& a,T2 b){if(a<b){a=b;return true;}else{return false;}}
template<typename T1,typename T2>bool chmin(T1& a,T2 b){if(a>b){a=b;return true;}else{return false;}}
template<typename T>T lcm(T a, T b){return a * b / gcd(a, b);}
static const double pi = 3.141592653589793;
int modpow(int a,int n,int p){if (n==0)return 1%p; if(n==1)return a%p;if(n%2==1)return (a*modpow(a,n-1,p))%p;lint t=modpow(a,n/2,p);return (t*t)%p;}//a^n%p
lint MOD=pow(10,9)+7;
//lint MOD=998244353;
lint inf=pow(2,50);
int intinf=pow(2,30);
/**int dirx[]={1,0};int diry[]={0,1};//*///右、下
/**int dirx[]={0,1,0,-1};int diry[]={-1,0,1,0};//*///四方位
/**int dirx[]={-1,0,1,1,1,0,-1,-1};int diry[]={-1,-1,-1,0,1,1,1,0};//*///八方位


class unionfind{
public:
	vector<int> table;
	void init(int size){
		table.resize(size);
		rep(i,size)table[i]=i;
	};
	int root(int index){
		if(table[index]==index)return index;
		else{
			int hoge=root(table[index]);
			table[index]=hoge;
			return hoge;
		}
	};
	bool same(int x,int y){
		return(root(x)==root(y));
	};
	int marge(int x,int y){
		int yroot=root(y);
		int xroot=root(x);
		if(xroot==yroot)return 0;
		table[yroot]=xroot;
		return 0;
	}
};


int main(){
	cin.tie(0);ios::sync_with_stdio(false);cout<<std::fixed<<std::setprecision(19);
	int a,b,c,k;
	in(a,b,c,k);
	int count=0;
	while(b<=a){
		b*=2;
		count++;
	}
	while(c<=b){
		c*=2;
		count++;
	}
	if(count<=k)out("Yes");
	else out("No");
	return 0;
}


Measured memory_bytes: 3652
// #include {{{
#include <array>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iterator>
#include <tuple>
#include <utility>
#include <random>
#include <limits>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cstdint>
#include <cassert>

#ifdef DEBUG
#include <fmt/format.h>
#endif
// }}}

using namespace std;

// macros {{{
template<typename T, size_t N>
constexpr size_t NELEMS(T (&)[N]) { return N; }

template<typename InputIt>
void PRINT_RANGE(InputIt first, InputIt last)
{
    for(; first != last; ++first)
        cout << *first << (first==last ? "" : " ");
    cout << "\n";
}

template<typename T>
void PRINT_MATRIX(T mat, size_t nr, size_t nc)
{
    for(size_t r = 0; r < nr; ++r) {
        for(size_t c = 0; c < nc; ++c) {
            cout << mat[r][c] << (c==nc-1 ? "" : " ");
        }
        cout << "\n";
    }
}

#define FOR(i, start, end) for(int i = (start); i < (end); ++i)
#define REP(i, n) FOR(i, 0, n)
// }}}

// types {{{
using s64 = int64_t;
using u64 = uint64_t;
// }}}

int N, M;

void solve()
{
    vector<int> cnts(N+1);

    REP(_, M) {
        int a, b;
        cin >> a >> b;
        ++cnts[a];
        ++cnts[b];
    }

    bool ans = all_of(begin(cnts), end(cnts), [](int cnt) { return cnt % 2 == 0; });
    cout << (ans ? "YES" : "NO") << "\n";
}

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

    solve();

    return 0;
}


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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

int main(){
  ll i, j;
  ll n;
  string str;
  cin >> str;
  for(i = 0; i < 3; i++){
    if(str[i] == '9')
      str[i] = '1';
    else
      str[i] = '9';
  }
        
  cout << str << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int calc(VI w, VI v, int x){
    int n = w.size();
    VI dp(x+1);
    REP(i,n) REP(j,x){
        if (j + w[i] <= x)
            dp[j+w[i]] = max(dp[j+w[i]], dp[j]+v[i]);
    }
    int res = 0;
    REP(i,x+1) res = max(res, dp[i]+x-i);
    return res;
}

int main() {
    int n, d, x;
    cin >> n >> d >> x;
    VVI p(d);
    REP(i,d) REP(j,n){
        int a;
        cin >> a;
        p[i].push_back(a);
    }

    REP(i,d-1){
        x = calc(p[i],p[i+1],x);
    }

    cout << x << endl;

    return 0;
}

Measured memory_bytes: 3220
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int A,B;
    cin >> A >> B;
    if(A!=2 && B!=2) cout << "Yes" << endl;
    else cout << "No" << endl;



}


Measured memory_bytes: 256
N, A, B = map(int, input().split())
S = input()
a_cnt = 0
b_cnt = 0
p = 0
for i in range(N):
    if S[i] == 'a':
        a_cnt += 1
        if p < A + B:
            p += 1
            print("Yes")
        else:
            print("No")
    elif S[i] == 'b':
        b_cnt += 1
        if p < A + B and b_cnt <= B:
            p += 1
            print("Yes")
        else:
            print("No")

    else:
        print("No")




Measured memory_bytes: 4016
import java.io.IOException;
import java.util.Arrays;
import java.util.OptionalLong;
import java.util.Scanner;
import java.util.stream.LongStream;

class Main {

	public static void main(String[] args) throws IOException {

		Scanner scane = new Scanner(System.in);

		int n = scane.nextInt();

		long[] nums = new long[n];

		for(int i =0; i<n; i++){
			nums[i] = scane.nextInt();
		}

	  LongStream stream = Arrays.stream(nums);
	  LongStream stream2 = Arrays.stream(nums);
	  LongStream stream3 = Arrays.stream(nums);

	  OptionalLong min = stream.min();
	  OptionalLong max = stream2.max();
	  long total = stream3.sum();

	  System.out.println(min.getAsLong()+" "+max.getAsLong()+" "+total);

	}
}

Measured memory_bytes: 45940
/* author:hellojim */
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
string int_to_string(int n)
{
	string s="";
	while(n)
	{
		int now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
int string_to_int(string s)
{
	int n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
string s,t;
string ans;  
int main()
{
	ios::sync_with_stdio(0);
	bool fl=0;
	//think twice,code once
	cin>>s>>t;
	for(int i=0;i<s.size();i++)
	{
		if(i+t.size()>s.size())break;
		bool f=0;
		for(int j=0;j<t.size();j++)
			if(s[i+j]!='?'&&s[i+j]!=t[j])f=1;
		if(!f)
		{
			fl=1;
			string ss=s;
			for(int j=0;j<s.size();j++)if(ss[j]=='?')ss[j]='a';
			for(int j=0;j<t.size();j++)
				ss[i+j]=t[j];
			ans=ss;
		}
	}
	if(fl==1)cout<<ans<<endl;
	else cout<<"UNRESTORABLE\n";
	return 0;
}



Measured memory_bytes: 3632
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
	
	public static void CountingSort(int[] A, int[] B, final int n, final int k){
		int[] C = new int[k];
		for(int i = 0; i < k; i++){
			C[i] = 0;
		}
		
		for(int i = 0; i < n; i++){
			C[A[i]]++;
		}
		
		for(int i = 1; i < k; i++){
			C[i] += C[i - 1];
		}
		
		for(int i = n - 1; i >= 0; i--){
			B[C[A[i]] - 1] = A[i];
			C[A[i]]--;
		}
	}
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		int[] array = new int[n];
		int max = Integer.MIN_VALUE;
		for(int i = 0; i < n; i++){
			array[i] = sc.nextInt();
			max = Math.max(max, array[i]);
		}
		
		int[] output = new int[n];
		CountingSort(array, output, n, max + 1);
	
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < n; i++){
			sb.append(i == 0 ? "" : " ");
			sb.append(output[i]);
		}
		System.out.println(sb.toString());
	}
	
	public static class Scanner {
	    private BufferedReader br;
	    private StringTokenizer tok;

	    public Scanner(InputStream is) throws IOException {
	        br = new BufferedReader(new InputStreamReader(is));
	    }

	    private void getLine() throws IOException {
	        while (!hasNext()) { tok = new StringTokenizer(br.readLine()); }
	    }

	    private boolean hasNext() {
	        return tok != null && tok.hasMoreTokens();
	    }

	    public String next() throws IOException {
	        getLine(); return tok.nextToken();
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    
	    public long nextLong() throws IOException {
	    	return Long.parseLong(next());
	    }
	    
	    public void close() throws IOException {
	        br.close();
	    }
	}

}

Measured memory_bytes: 159448
#include<bits/stdc++.h>
#define ll long long int 
#define fori(i,n) for(int i=0; i<n; ++i)
#define ford(i,n) for(int i=n-1; i>=0; --i)
#define vi vector<int> 
#define vs vector<string>
#define vll vector<ll>
#define di deque<int>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define pqi priority_queue<int>
#define pqll priority_queue<ll>
#define mod1 1000000007
#define mod2 998244353
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gcd __gcd

//Printing template
#define pf2(a,b) cout<<a<<" "<<b<<"\n"
#define pf3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define pf4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n"

#define fast_cin() ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> i_set;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ll_set; 
/* new_data_set p; */
/* *p.find_by_order(3); The value at third place */
/* p.order_of_key(7); The expected index in the set in sorted order */

bool sortbysec(pair<ll,ll> &p1, pair<ll, ll> &p2){
    return (p1.se<p2.se);
}

int main(int argc, char const *argv[]){
    fast_cin();
    ll h, a;
    cin>>h>>a;
    ll temp=ceil((double)h/a);
    cout<<max((ll)1,temp)<<"\n";
    return 0;
}


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

#define N 300005

#define ls (t<<1)
#define rs ((t<<1)|1)
#define mid ((l+r)>>1)

#define mk make_pair
#define pb push_back
#define fi first
#define se second

using namespace std;

const long long inf=(long long)1e18;

priority_queue<int>Q;

int i,j,m,n,p,k,a[N];

long long ans,H[N],T[N];

int main()
{
	scanf("%d",&n);
	for (i=1;i<=3*n;++i)
	{
			scanf("%d",&a[i]);
			if (Q.size()<n) Q.push(-a[i]),ans+=a[i];
			else 
			{
					int x=Q.top();
					if (-x<a[i]) ans+=x+a[i],Q.pop(),Q.push(-a[i]);
			}
			if (Q.size()==n) H[i]=ans; else H[i]=-inf;
	}
	while (!Q.empty()) Q.pop();
	ans=0;
	for (i=3*n;i;--i)
	{
			if (Q.size()<n) Q.push(a[i]),ans+=a[i];
			else 
			{
					int x=Q.top();
					if (x>a[i]) ans+=-x+a[i],Q.pop(),Q.push(a[i]);
			}
			if (Q.size()==n) T[i]=ans; else T[i]=inf;
	}
	long long A=-inf;
	for (i=1;i<3*n;++i) A=max(A,H[i]-T[i+1]);
	cout<<A<<endl; 
}


Measured memory_bytes: 6648
#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;

#define ll long long

void exgcd(int a, int b, int& x, int& y) {
	if (!b) {
		x = 1, y = 0;
	} else {
		exgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
}

int inv(int a, int n) {
	int x, y;
	exgcd(a, n, x, y);
	return (x < 0) ? (x + n) : (x);
}

int Mod;

typedef class Z {
	public:
		int v;

		Z() : v(0) {	}
		Z(int x) : v(x){	}
		Z(ll x) : v(x % Mod) {	}

		friend Z operator + (const Z& a, const Z& b) {
			int x;
			return Z(((x = a.v + b.v) >= Mod) ? (x - Mod) : (x));
		}
		friend Z operator - (const Z& a, const Z& b) {
			int x;
			return Z(((x = a.v - b.v) < 0) ? (x + Mod) : (x));
		}
		friend Z operator * (const Z& a, const Z& b) {
			return Z(a.v * 1ll * b.v);
		}
		friend Z operator ~(const Z& a) {
			return inv(a.v, Mod);
		}
		friend Z operator - (const Z& a) {
			return Z(0) - a;
		}
		Z& operator += (Z b) {
			return *this = *this + b;
		}
		Z& operator -= (Z b) {
			return *this = *this - b;
		}
		Z& operator *= (Z b) {
			return *this = *this * b;
		}
		friend boolean operator == (const Z& a, const Z& b) {
			return a.v == b.v;
		} 
} Z;

Z qpow(Z a, int p) {
	Z rt = Z(1), pa = a;
	for ( ; p; p >>= 1, pa = pa * pa) {
		if (p & 1) {
			rt = rt * pa;
		}
	}
	return rt;
}

typedef Z Zi;

const int N = 102;

int n, m, K;
Zi comb[N][N];
Zi f[2][N][N];
Zi coef1[N * N], ceof2[N];

int main() {
	scanf("%d%d%d%d", &n, &m, &K, &Mod);
	comb[0][0] = 1;
	int qaq = max(n, m);
	for (int i = 1; i <= qaq; i++) {
		comb[i][0] = comb[i][i] = 1;
		for (int j = 1; j < i; j++) {
			comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
		}
	}
	int cur = 0;
	f[cur][0][0] = 1;
	for (int k = 1; k <= K; k++) {
		memset(f[cur ^= 1], 0, sizeof(f[0]));
		coef1[0] = 1, coef1[1] = K - k + 1;
		for (int i = 2, _ = n * m; i <= _; i++)
			coef1[i] = coef1[i - 1] * coef1[1];
		for (int i = 0; i <= n; i++) {
			for (int j = 0; j <= m; j++) {
				Zi v = f[cur ^ 1][i][j];
				if (!v.v)
					continue;
				Zi y = qpow(k, m - j) - qpow(k - 1, m - j), pw = 1;
				for (int x = 0; i + x <= n; x++, pw *= y)
					f[cur][i + x][j] += v * comb[n - i][x] * coef1[x * j] * pw;
			}
		}
		memset(f[cur ^= 1], 0, sizeof(f[0]));
		coef1[0] = 1, coef1[1] = k;
		for (int i = 2, _ = n * m; i <= _; i++)
			coef1[i] = coef1[i - 1] * coef1[1];
		for (int i = 0; i <= n; i++) {
			Zi y = qpow(K - k + 1, i) - qpow(K - k, i);
			for (int j = 0; j <= m; j++) {
				Zi v = f[cur ^ 1][i][j];
				if (!v.v)
					continue;
				Zi pw = 1;
				for (int x = 0; j + x <= m; x++, pw *= y)
					f[cur][i][j + x] += v * comb[m - j][x] * pw * coef1[(n - i) * x];
			}
		}
	}
	Zi ans = f[cur][n][m];
	printf("%d\n", ans.v);
	return 0;
}


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

int main(){
	int x, y;
	for(int i=0; i>=0; i++){
		cin >> x >> y;
		if(x==0 && y==0) break;
		if(x<y) cout << x << " " << y << endl;
		else cout << y << " " << x << endl;
	}
	return 0;
}

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

using namespace std;
using ll = long long;

int main() {
	int x, y, a, b, c; scanf("%d %d %d %d %d", &x, &y, &a, &b, &c);
	vector<ll> red(a), green(b), colorless(c);
	for (int i = 0; i < a; ++i) {
		scanf("%lld", &red[i]);
	}
	for (int i = 0; i < b; ++i) {
		scanf("%lld", &green[i]);
	}
	for (int i = 0; i < c; ++i) {
		scanf("%lld", &colorless[i]);
	}
	sort(begin(red), end(red));
	sort(begin(green), end(green));
	sort(begin(colorless), end(colorless));
	reverse(begin(green), end(green));
	reverse(begin(red), end(red));
	reverse(begin(colorless), end(colorless));
	vector<ll> potFinal;
	potFinal.insert(begin(potFinal), begin(red), begin(red) + x);
	potFinal.insert(begin(potFinal), begin(green), begin(green) + y);
	sort(begin(potFinal), end(potFinal));
	int clptr = 0;
	for (ll &x : potFinal) {
		if (clptr < c && x < colorless[clptr]) {
//			printf("replacing %lld with %lld\n", x, colorless[clptr]);
			x = colorless[clptr++];	
		} else {
//			printf("keeping %lld\n", x);
		}
	}
	ll ans = 0;
	for (ll x : potFinal) ans += x;
	printf("%lld\n", ans);
	return 0;
}


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

using namespace std;

int main(){
	int n;
  	cin >>n;
  int k=0;
  	for(int i=1;i<10;i++){
    	if(n%i ==0 && n/i >0 && n/i < 10){
        	k++;
        }
    }
  	if(k!=0){
    	cout << "Yes" << endl;
    }else{
    	cout << "No" << endl;
    }
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		int c = scanner.nextInt();
		int min = 0;
		int mid = 0;
		int max = 0;
		if(a<b) {
			if(b<c) {
				min = a;
				mid = b;
				max = c;
			}else {
				if(a<c) {
					min = a;
					mid = c;
					max = b;
				}else {
					min = c;
					mid = a;
					max = b;
				}
				
			}
		}else {
			if(a<c) {
				min = b;
				mid = a;
				max = c;
			}else {
				if(b<c) {
					min = b;
					mid = c;
					max = a;
				}else {
					min = c;
					mid = b;
					max = a;
				}
			}
		}
		System.out.println(min + " " + mid + " " + max);
		scanner.close();
	}
}



Measured memory_bytes: 26124
import sys

def minimumCostSort(A):
    B = sorted(A)
    V = [False] * len(A)
    T = [0] * 10001
    ans = 0
    s = min(A)

    for i in range(len(A)):
        T[B[i]] = i

    for i in range(len(A)):
        if V[i]:
            continue
        S = an = 0
        j = i
        m = 10000
        while True:
            V[j] = True
            an += 1
            v = A[j]
            m = min(m, v)
            S += v
            j = T[v]
            if V[j]:
                break
        ans += min(S + (an - 2) * m, m + S + (an + 1) * s)
    return ans

if __name__ == "__main__":
    lines = sys.stdin.readlines()
    A = map(int, lines[1].split())
    print minimumCostSort(A)

Measured memory_bytes: 6576
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    n = int(input().strip())
    a = (n % 100) // 10
    b = (n % 10)
    # if a == b == 0:
    #     print(1)
    #     return
    if b == 0:
        k = 0
    elif 1 <= b <= 5:
        k = 1
    else:
        k = 2
    s = a * 2 + k
    # print(s, a, b)
    if s <= n / 100:
        print(1)
    else:
        print(0)



if __name__ == '__main__':
    main()


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

using Weight = int;
struct Edge {
    int src, dst;
    Weight weight;
    Edge(int src_, int dst_, Weight weight_) :
        src(src_), dst(dst_), weight(weight_) { }
};
bool operator < (const Edge &e, const Edge &f) {
    return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
        e.src != f.src ? e.src < f.src : e.dst < f.dst;
}

using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

vector<int> kosaraju(const Graph &g){
    int n = g.size(), sz = 0; Graph rg(n);
    vector<int> stk(n), cmp(n, -1), added(n), visited(n), ord(n);
    for(const Edges &es : g){
        stk.resize(stk.size() + es.size());
        for(const Edge &e : es) rg[e.dst].eb(e.dst, e.src, e.weight);
    }
    for(int i = 0; i < n; i++){
        if(visited[i]) continue;
        int s = 0; stk[s++] = i;
        while(s != 0){
            int v = stk[s-1]; visited[v] = true;
            bool pushed = false;
            for(auto & e : g[v]){
                int dst = e.dst;
                if(!visited[dst]){ stk[s++] = dst; pushed = true; }
            }
            if(pushed) continue;
            int t = stk[s-1];
            if(!added[t]){ added[t] = true; ord[sz++] = t; }
            --s;
        }
    }
    int k = 0;
    for(int i = 0; i < n; i++){
        int u = ord[n-i-1];
        if(cmp[u] != -1) continue;
        int s = 0; stk[s++] = u;
        while(s != 0){
            int v = stk[--s]; cmp[v] = k;
            for(auto & e : rg[v]){
                int d = e.dst;
                if(cmp[d] == -1) stk[s++] = d;
            }
        }
        ++k;
    }
    return cmp;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n,m;
    cin >> n >> m;
    Graph g(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        g[a].eb(a,b,0);
    }
    vector<int> c = kosaraju(g);
    int q; cin >> q;
    rep(i,q){
        int a,b;
        cin >> a >> b;
        cout << (c[a] == c[b]) << '\n';
    }
}

Measured memory_bytes: 4340
#include <bits/stdc++.h>
 
#define pb push_back
#define mp make_pair
#define ft first
#define sc second
#define ull unsigned long long int
#define lli long long int
#define li long int
 
#define si(n) scanf("%d",&n)
#define sl(n) scanf("%ld",&n)
#define sll(n) scanf("%lld",&n)
 
#define pi(n) printf("%d",n)
#define pl(n) printf("%ld",n)
#define pll(n) printf("%lld",n)
 
using namespace std;
 
const int MAX=2e5+5;
 
lli A[MAX];
int main() {
    // freopen("a.in","r",stdin);
    // freopen("a.out","w",stdout);
    lli N;
    cin >> N;
    for(lli i=0; i<N; i++) {
        cin >> A[i]; A[i] -= (i+1);
    }
 
    sort(A,A+N);
 
    lli val = A[(N>>1)];
    lli ans = 0;
    for(int i=0; i<N; i++) {
        ans += abs(A[i]-val);
    }
 
    cout << ans << "\n";
 
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    // Your code here!
   ll n,wt;
   cin>>n>>wt;
   ll p[n],w[n];
   for(ll i=0;i<n;i++)
   {
       cin>>w[i]>>p[i];
   }
   ll dp[n+1][wt+1];
   for(ll i=0;i<=n;i++)
   {
       dp[i][0]=0;
   }
   for(ll i=0;i<=wt;i++)
   {
       dp[0][i]=0;
   }
   for(ll i=1;i<=n;i++)
   {
       for(ll j=1;j<=wt;j++)
       {
           if(j<w[i-1])
           {
               dp[i][j]=dp[i-1][j];
               continue;
           }
           dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+p[i-1]);
       }
   }
   cout<<dp[n][wt];
   return 0;
}


Measured memory_bytes: 79104
#include<bits/stdc++.h>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 1000000000
#define ninf -1000000000
#define endl '\n' 
#define she_told_me_dont_worry ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;
// Use cout.flush() for interactive problems.
// Use this for increased stack size: g++ -o a.exe -Wl,--stack=256000000 -O2 source.cpp
inline long long  MAX2(long long  a, long long int b){return (a)>(b)?(a):(b);}
inline long long  MAX3(long long  a, long long  b,long long  c){return (a)>(b)?((a)>(c)?(a):(c)):((b)>(c)?(b):(c));}
inline long long  MIN2(long long  a, long long  b){return (a)<(b)?(a):(b);}
inline long long  MIN3(long long  a, long long b,long long c){return (a)<(b)?((a)<(c)?(a):(c)):((b)<(c)?(b):(c));}
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;
int main()
{
    she_told_me_dont_worry
    int a, p;
    cin>>a>>p;
    int cnt = 3*a + p;
    int ans = cnt/2;
    cout<<ans;
    cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
}

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

using namespace std;

using ll = long long;

const long long MOD = 1e9 + 7;
const int INF = 1e9 + 7;

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, B;
    cin >> A >> B;
    ll g = gcd(A, B);
    vector<bool> prime(1e6 + 1, true);
    prime[0] = prime[1] = false;
    for (ll i = 2; i * i <= g; ++i) {
        for (ll j = i * i; j <= 1e6; j += i) {
            prime[j] = false;
        }
    }
    ll ans = 0;
    ll x = g;
    ll i = 2;
    while (x > 1) {
        while (i * i <= g && !prime[i]) {
            ++i;
        }
        if (i * i > g) {
            ++ans;
            break;
        }
        if (x % i == 0) {
            ++ans;
            while (x % i == 0) x /= i;
        }

        ++i;
    }
    ++ans;
    cout << ans << endl;
}

Measured memory_bytes: 384
#!/usr/bin/env python3
import sys


def solve(N: int, P: int):
        ## 約数の列挙O(√N)
    def divisor(n): #nの約数を全て求める
        i = 1
        table = []
        while i * i <= n:
            if n%i == 0:
                table.append(i)
                table.append(n//i)
            i += 1
        table = sorted(list(set(table)))
        return table

    divisors = divisor(P)

    answer = 1
    if N > 40:
        print(answer)
        return 
    for div in divisors:
        if div**N > P:
            break

        if P%(div**N) == 0:
            answer = div

    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    P = int(next(tokens))  # type: int
    solve(N, P)

if __name__ == '__main__':
    main()


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

#define FastRead        ios_base::sync_with_stdio(0);cin.tie(NULL);
#define endl            "\n"
#define NUM             1000005
typedef long long ll;

map<ll,ll>mp;

void primeFactors(ll A)
{
    while(A%2==0)
    {
        mp[2]++;
        A/=2;
    }

    for(ll i=3;i<=sqrt(A);i+=2)
    {
        while(A%i==0)
        {
            mp[i]++;
            A/=i;
        }
    }

    if(A>2)
        mp[A]++;
}

int main()
{
    FastRead

    ll a,b,ans=1;

    cin>>a>>b;

    ll gcd = __gcd(a,b);

    primeFactors(gcd);

    ans+=mp.size();

    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rt "\n"
#define sp " "
#define test1 cout << "test1" << endl;
#define test2 cout << "test2" << endl;
#define fixprecision(n) fixed; cout << setprecision(n)
#define kyopro ios::sync_with_stdio(false);cin.tie(NULL)
#define MOD 1000000007
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define iikae auto&
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

int main(){
  kyopro;
  ll N, M;
  cin >> N >> M;
  vector<ll> a(M), DP(N + 3);
  for(auto&& i : a){
    cin >> i;
  }
  DP.at(0) = 1;
  a.push_back(N + 2);
  a.push_back(N + 2);
  ll koetayuka{};
  rep(now, 0, N){
    DP.at(now) = DP.at(now) % MOD;
    //cout << DP.at(now) << rt;
    iikae tsugi = a.at(koetayuka);
    iikae sonotsugi = a.at(koetayuka + 1);
    if(now + 1 == tsugi && now + 2 == sonotsugi){
    }
    else if(now + 1 == tsugi){
      DP.at(now + 2) += DP.at(now);
      koetayuka++;
    }
    else if(now + 2 == tsugi){
      DP.at(now + 1) += DP.at(now);
    }
    else{
      DP.at(now + 2) += DP.at(now);
      DP.at(now + 1) += DP.at(now);
    }
  }
  cout << DP.at(N) % MOD << rt;
}


Measured memory_bytes: 2560
//Bismillahir Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std;

typedef long long              ll;
typedef long double            ld;
typedef pair<int, int>         pi;
typedef vector<int>            vi;
typedef vector<pair<int, int>> vpi;

#define pb       push_back
#define all(x)   begin(x), end(x)
#define sz(x)    (int)(x).size()
#define ff       first
#define ss       second
#define mp       make_pair
#define lb       lower_bound
#define ub       upper_bound
#define tcase()  int t; cin >> t; while(t--)

const int MOD = 1e9 + 7; // 998244353;
const int MX  = 2e5 + 5;
const ll  INF = 1e18;
const ld  PI  = acos((ld) -1);

void setIO(string name = "") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    if(sz(name)){
        freopen((name+".in").c_str(), "r", stdin);
        freopen((name+".out").c_str(), "w", stdout);
    }
}

ll powmod(ll x, ll y){

    ll res = 1;

    for(ll i = 0; i < y; i++){
        res = res * x % MOD;
    }
    return res;
}

int main(){

    setIO();

    ll n;
    cin >> n;

    ll Ans = powmod(10, n) - 2 * powmod(9, n) + powmod(8, n);
    Ans %= MOD;
    Ans = (Ans + MOD) % MOD;

    cout << Ans;
}


Measured memory_bytes: 3648
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define EACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class Value>using vec = vector< Value >;
using ll = long long;
using P = pair< long long, long long >;
#define fi first
#define se second
#define el endl
#pragma endregion

void Main();

int main(){
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


void Main(){
    int r;
    cin >> r;
    cout << r*r << el;
}



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

 int main()
 {
 	long long int k,a,b,ans=1;
 	cin >> k>>a>>b;
 	if(b-a<2){
 		cout << k+1 << endl;
 		return 0;
 	}
 	k=k-(a-ans);
 	ans=ans+(a-ans);
 	if(k%2==1){
 		ans++;
 	}
 	ans=ans+(b-a)*(k/2);
 	cout << ans << endl;
 }

Measured memory_bytes: 256
mod = 998244353

class mod_combination:
    def __init__(self, N):
        self.fac = [1] * (N + 1)
        for i in range(1, N + 1):
            self.fac[i] = (self.fac[i - 1] * i) % mod
        self.invmod = [1] * (N + 1)
        self.invmod[N] = pow(self.fac[N], mod - 2, mod)
        for i in range(N, 0, -1):
            self.invmod[i - 1] = (self.invmod[i] * i) % mod
        
    def calc(self, n, k): # nCk
        return self.fac[n] * self.invmod[k] % mod * self.invmod[n - k] % mod


n, m, k = map(int, input().split())
C = mod_combination(n)
ans = 0
for x in range(k + 1):
    ans = (ans + C.calc(n - 1, n - x - 1) * m * pow(m - 1, n - x - 1, mod) % mod) % mod
print(ans)


Measured memory_bytes: 24580
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define in(e,l) (std::find(l.begin(), l.end(), e) != l.end())
#define asort(l) (std::sort(l.begin(), l.end()))
#define dsort(l) (std::sort(l.rbegin(), l.rend()))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;

int main() {
  ll N;
  cin >> N;
  v(ll) A(N);
  rep(i, N){
    cin >> A[i];
    --A[i];
  }
  v(ll) B(N);
  rep(i, N){
    cin >> B[i];
  }
  v(ll) C(N - 1);
  rep(i, N - 1){
    cin >> C[i];
  }
  ll ans = 0;
  rep(i, N) {
    ans += B[A[i]];
    if(i != N-1 && A[i + 1] - A[i] == 1){
      ans += C[A[i]];
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> myList = new ArrayList<Integer>();
		
		
		// 整数の入力
		String a = sc.next();
		int b = a.length();
		int c =  a.length();
		int d = 753;
		String e;
		int f;
		int g;
		b = b - 2;
		
		for (int i = 0; i < b; i++) {
			e = a.substring(i, i + 3);
			f =  Integer.parseInt(e);
			g = d - f;
		//	System.out.println(g);
		//	System.out.println( d + "-" + f + "=" + g);
			
			myList.add(Math.abs(g));
			
		}
		System.out.println(Collections.min(myList));
	}
}


Measured memory_bytes: 23764
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
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; }
typedef long long ll;
typedef pair<int,int> P;

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

Measured memory_bytes: 3148
#include <bits/stdc++.h>
typedef long long int lint;

#define PI acos(-1)
#define INF64 1LL << 60
#define INF32 1 << 29
#define LIMIT(d_in, d_min, d_max) max(d_min, min(d_max, d_in))
#define all(a) (a).begin(), (a).end()
#define INV ((long long int)1000000007)

using namespace std;

void execute()
{
	int N;
	string S, T, ans;

	cin >> N;
	cin >> S >> T;

	ans.resize(N * 2);

	for (int i = 0; i < 2 * N; i++)
	{
		ans[i] = (i & 1 ? T[i / 2] : S[i / 2]);
	}

	cout << ans << endl;
	return;
}

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

	int stop;
	cin >> stop;

	return 0;
}

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

using namespace std;

long long a[5];

int main()
{
	cin >> a[0] >> a[1] >> a[2];
	if(a[0] % 2 == 0 || a[1] % 2 == 0 || a[2] % 2 == 0)
	{
		cout << 0;
		return 0;
	}
	sort(a , a + 3);
	cout << a[0] * a[1];
}

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

int main() {
  int a,b;
  cin>>a>>b;
  if(b == 100){
    if(a == 2){
      cout<<1010000<<endl;
    }else{
      cout<<pow(100,a)*101<<endl;
    }
  }else{
    cout<<pow(100,a)*b<<endl;
  }
}

Measured memory_bytes: 256
#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,a,b;cin>>n>>a>>b;
    if((b-a)%2==0){
        cout<<(b-a)/2<<endl;
        return 0;
    }
    ll buf1=a-1+(b-a+1)/2,buf2=(n-b)+(b-a+1)/2;
    ll res=min(buf1,buf2);
    cout<<res<<endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
 
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a) for(int i = s; i < n; i++) cin >> a[i]
#define couta(n, a) for(int i = 0; i < n; i++) cout << a[i] << ' '
#define copy(s, n, a, b) for(int i = s; i < n; i++) b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD  (int)1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef std::vector<int> vi;
typedef std::pair <int, int> pii;
typedef std::pair <ll, ll> pll;
typedef std::vector<pii> vpii;
using namespace std;
 
void solve(){
    int n, a, b;
    cin >> n >> a >> b;
    cout << min(n * a, b);
}
 
int main(){
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int q = 1;
    //cin >> q;
    for(int i = 1; i <= q; i++){
        solve();
    }
}
 


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  long long int N, Q;
  cin >> N;
  long long int A[N];
  for(int i=0; i<N; i++) cin >> A[i];
  cin >> Q;
  long long int B[Q], C[Q];
  for(int i=0; i<Q; i++) cin >> B[i] >> C[i];
  long long int cnt[100001], ans=0;
  for(int i=0; i<100001; i++) cnt[i]=0;
  for(int i=0; i<N; i++) cnt[A[i]]++;
  for(int i=0; i<N; i++) ans += A[i];
  for(int i=0; i<Q; i++){
    ans += cnt[B[i]]*(C[i]-B[i]);
    cout << ans << endl;
    cnt[C[i]] += cnt[B[i]];
    cnt[B[i]] = 0;
  }
  return 0;
}


Measured memory_bytes: 6704
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
    //int T; cin >> T;
    //while(T--) 
 	//{
  //    
  //}
  	int N;
  	cin>>N;
  	map<ll,int> m;
  	ll ans=0;
  	F0R(x,N)
  	{
  		ll nb;
  		cin>>nb;
  		ans+=m[x-nb];
  		m[x+nb]++;
  	}
	cout<<ans<<endl;
	return 0;
}
 // j-i=ai+aj
 // aj-j=-ai-i
 // j-aj=ai+i


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

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

    int m = int(sqrt(n));
    for(int i=m;i>=1;--i)
        if(n%i == 0)
        {
            cout << (i-1) + (n/i-1) << endl;
            return 0;
        }

    return 0;
}

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

int main() {
	int N, M;
	cin >> N >> M;
	vector<int> A(N);
	int sum = 0;
	rep(i, N) {
		cin >> A.at(i);
		sum += A.at(i);
	}
	int count = 0;
	rep(i, N) {
		if (A.at(i) < (double)sum / 4 / M) count++;
	}
	cout << (N - count >= M ? "Yes" : "No") << endl;
	return 0;
}

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

const int INF = numeric_limits<int>::max()/2;
typedef pair<int,int> P;

struct Edge{
    int to,cost;
    Edge(int to,int cost): to(to), cost(cost){}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

bool operator < (const Edge &e, const Edge &f){
    return e.cost > f.cost;
}

vector<int> dijkstra(const Graph &g, int s){
    vector<int> d(g.size(),INF);
    d[s] = 0;
    priority_queue<P, vector<P>, greater<P>> que;
    que.push(P(0,s)); // P(dis, pos)
    while(!que.empty()){
        int dist = que.top().first;
        int v = que.top().second;
        que.pop();
        if(d[v]<dist) continue;
        for(const auto &e: g[v]){
            if(d[e.to]<=d[v]+e.cost) continue;
            d[e.to] = d[v] + e.cost;
            que.push(P(d[e.to], e.to));
        }
    }
    return d;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    int n,m;
    cin>>n>>m;
    vector<int> p(m),q(m),c(m);
    map<P,int> mp;
    int idx=1;
    for(int i=0;i<n;i++){
        mp[P(i,-1)]=idx;
        idx++;
    }
    for(int i=0;i<m;i++){
        cin>>p[i]>>q[i]>>c[i];
        p[i]--;q[i]--;
        if(mp[P(p[i],c[i])]==0){
            mp[P(p[i],c[i])]=idx;
            idx++;
        }
        if(mp[P(q[i],c[i])]==0){
            mp[P(q[i],c[i])]=idx;
            idx++;
        }
        
    }
    Graph g(idx+10);
    for(int i=0;i<m;i++){
        int st=mp[P(p[i],c[i])], gt=mp[P(q[i],c[i])];
        int spre=mp[P(p[i],-1)],gpre=mp[P(q[i],-1)];
        g[spre].push_back(Edge(st,1));
        g[st].push_back(Edge(spre,1));
        g[st].push_back(Edge(gt,0));
        g[gt].push_back(Edge(st,0));
        g[gpre].push_back(Edge(gt,1));
        g[gt].push_back(Edge(gpre,1));
    }
    int st=mp[P(0,-1)],gt=mp[P(n-1,-1)];
    vector<int> dis=dijkstra(g,st);
    if(dis[gt]==INF) cout<<-1<<endl;
    else cout<<dis[gt]/2<<endl;
}

Measured memory_bytes: 66808
#include <stdio.h>

void sort(int n, int a[n]);
int main(){
  int n,q;
  int S[10000], T[500];
  int count=0;
  int i,j;
  int si;
  scanf("%d", &n );
  //printf("%d\n", n);
  for (i=0 ; i<n; i++ ) {
    scanf("%d", &S[i] );
    //printf("%d ", S[i] );
  }
  //printf("\n");
  scanf("%d", &q );
  for (i=0 ; i<q; i++ ) {
    scanf("%d", &T[i] );
  }

  //??????S,T????????????
  sort(n, S);
  sort(q, T);

  /*for (i=0 ; i<n; i++ ) {
    printf("%d ", S[i] );
  }
  printf("\n");
  for (i=0 ; i<q; i++ ) {
    printf("%d ", T[i] );
  }
  printf("\n");
  */

  si=0;
  for(i=0; i<q; i++){
    for(j=si; j<n ; j++){
      //printf("S=%d T=%d",j,i);
      if(S[j]==T[i]){
        count++;
        si=j+1;
        //printf("?????´\n");
        break;
      }else if(S[j]>T[i]){
        //printf("s<t\n");
        break;
      }
    }
  }
  printf("%d\n", count );
  return 0;
}

void sort(int n, int a[n]){
  int i, j, tmp;
  for (i = 1; i < n; i++) {
    tmp = a[i];
    if (a[i-1] > tmp) {
        j = i;
        do {
            a[j] = a[j-1];
            j--;
        } while (j > 0 && a[j-1] > tmp);
        a[j] = tmp;
    }
  }
}

Measured memory_bytes: 1864