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


int main(){
    char S[3],T[3];
    cin >> S >> T;

    int count = 0;
    for(int i=0; i<3; i++){
        if(S[i] == T[i]){
            count++;
        }

    }

    cout << count;

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int d,g;
int p[25], c[21];

int main(){
  scanf("%d%d",&d,&g);
  REP(i,d)scanf("%d%d",p+i,c+i);
  int ans = 1<<30;
  REP(msk,1<<d){
    int tmp = 0;
    int sum = 0;
    REP(i,d)if((msk>>i)&1){
      tmp += p[i];
      sum += p[i] * 100 * (i+1);
      sum += c[i];
    }
    if(sum >= g){
      CHMIN(ans, tmp);
    }else{
      int it = d-1;
      while((msk>>it)&1)it--;
      int cnt = p[it];
      int pnt = 100*(it+1);
      while(cnt>0 && sum<g){
        sum += pnt;
        tmp++;
        cnt--;
      }
      if(sum>=g){
        CHMIN(ans,tmp);
      }
    }
  }
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  int max = a;
  if(a < b){
    max = b;
  }
  if(max < c){
    max = c;
  }
  printf("%d\n",a + b + c - max);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));
int main(){
	int N; cin >> N;

	int maxN = 0; 
	int answer = 1;
	FOR(i, 1, N+1){
		int counter = 0;
		int n = i;
		while(n % 2 == 0){
			n /= 2; 
			++counter;
		}
		if(maxN < counter) maxN = counter, answer = i; 
	}

	cout << answer << endl;
}


Measured memory_bytes: 256
def kaibun(S):
    return S == S[::-1]
def solve():
    S = input()
    n = len(S)
    if not kaibun(S):
        return "No"
    if not kaibun(S[:n // 2]):
        return "No"
    if not kaibun(S[(n + 3) // 2 - 1:]):
        return "No"
    return "Yes"
print(solve())


Measured memory_bytes: 2940
// ------------------------------------
// Date:2018/ 4/ 7
// Problem:/ / / a.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

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

  string ans;
  CIN(x, a, b);
  if(abs(x - a) < abs(x - b)) ans = 'A';
  else ans = 'B';

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  vector<int>arr(n);
  for(int i=0;i<n;i++)
  {	
    cin>>arr[i];
  }
  sort(arr.begin(),arr.end());
  long long ans=0;
  for(int i=0;i<n-k;++i)
  {
    ans+=arr[i];
  }
  cout<<ans<<endl;
      }

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
using namespace std;
vector<ll> v[100005];
ll dp[100005][2];
ll sol(ll src,ll constrall,ll parent)
{
    if(dp[src][constrall]!=-1)
        return dp[src][constrall];
    ll ans=0;
    ll w1=1;
    for(auto child:v[src])
    {
        if(child!=parent)
            w1=(w1*sol(child,0,src))%mod;
    }
    ans+=w1;
    if(!constrall)
    {
        ll w2=1;
    for(auto child:v[src])
    {
        if(child!=parent)
            w2=(w2*sol(child,1,src))%mod;
    }
    ans=(ans+w2)%mod;
    }
    return dp[src][constrall]=ans;

}
int main()
{
    ll n;
    cin>>n;
    for(ll i=1;i<=n-1;i++)
    {
        ll x,y;
        cin>>x>>y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    memset(dp,-1,sizeof(dp));
    ll ans=sol(1,0,-1);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 17416
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;

// dp[i] - TRUE if the first player wins if there are i stones remaining

int main() {
    int n, k;
    scanf("%d%d", &n, &k);
    vector<int> a(n);
    for(int& x : a) {
        scanf("%d", &x);
    }
    vector<bool> dp(k + 1);
    for(int stones = 0; stones <= k; ++stones) {
        for(int x : a) {
            if(stones >= x && !dp[stones-x]) {
                dp[stones] = true;
                break;
            }
        }
    }
    
    puts(dp[k] ? "First" : "Second");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mpp make_pair
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll mod=1000000007;
ll bix(ll a,ll n)
{
    if(n==0)
    {
        return 1;
    }
    if(n&1)
    {
        return (a*bix(a,n-1))%mod;
    }
    ll x=bix(a,n/2);
    return (x*x)%mod;
}
int main()
{
    fast;
    ll n,esq=0,sumsq=0;
    vector<ll>v;
    cin>>n;
    for(ll i=0; i<n; i++)
    {
        ll x;
        cin>>x;
        v.pb(x);
    }
    for(ll i=0; i<n; i++)
    {
        //v[i]=(v[i]+mod)%mod;
        sumsq+=(v[i]);
        sumsq=(sumsq)%mod;
        ll sq=((v[i]*v[i]))%mod;
        esq+=sq;
        esq=(esq)%mod;
    }
    // sumsq=(sumsq+mod)%mod;
    sumsq=((sumsq*sumsq))%mod;
    ll ans=((sumsq-esq+100*mod)%mod);
    ans=ans*bix(2,mod-2);
    cout<<ans%mod<<endl;

}
/*
4
141421356 17320508 22360679 244949
*/


Measured memory_bytes: 5288
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
using namespace std;
//namespace mp = boost::multiprecision;
//using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
//using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  //cout<<fixed<<setprecision(10);
  ll n,d,a,ans=0;
  cin>>n>>d>>a;
  vector<ll>x;
  vector<pair<ll,ll> >v;
  ll xx,hh;
  for(ll i=0;i<n;i++){
    cin>>xx>>hh;
    hh=hh/a+(hh%a==0?0:1);
    x.push_back(xx);
    v.push_back(make_pair(xx,hh));
  }
  sort(x.begin(),x.end());
  sort(v.begin(),v.end());
  vector<ll>vv(n+1,0);
  ll t=0;
  for(ll i=0;i<n;i++){
    t+=vv[i];
    ll h=v[i].second-t;
    if(h>0){
      ans+=h;
      ll xe=upper_bound(x.begin(),x.end(),x[i]+2*d)-x.begin();
      vv[i+1]+=h;
      vv[xe]-=h;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 7524
import java.io.*;
import java.util.*;
import java.math.*;
// import java.awt.Point;

public class Main {
    public Main(){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int[] A=new int[N];
        int[] B=new int[N];
        int[] C=new int[N];
        for(int i=0;i<N;i++){
            A[i]=sc.nextInt();
        }
        for(int i=0;i<N;i++){
            B[i]=sc.nextInt();
            C[i]=A[i]-B[i];
        }
        Arrays.sort(C);
        long need=0;
        int result=0;
        for(int i=0;i<N;i++){
            if(C[i]<0){
                need-=C[i];
                result++;
            }else{
                break;
            }
        }
        for(int i=0;i<N;i++){
            if(need>0){
                if(C[N-1-i]>0){
                    need-=C[N-1-i];
                    result++;
                }else{
                    System.out.println(-1);
                    return;

                }
            }else{
                break;
            }
        }
        System.out.println(result);
        return;

    }
    public static void main(String[] args){
        Main main=new Main();
    }

}


Measured memory_bytes: 82392
#include <stdio.h>

int main()
{
  char str[5];
  scanf("%s", str);
  if(str[0]==str[1] && str[2]==str[3] && str[0]!=str[2]){
    printf("Yes\n");
  }else if(str[0]==str[2] && str[1]==str[3] && str[0]!=str[1]){
    printf("Yes\n");
  }else if(str[0]==str[3] && str[1]==str[2] && str[0]!=str[1]){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
#pragma warning (disable: 4996)

int main() {
	string S; cin >> S;
	if (S[0] == '7' || S[1] == '7' || S[2] == '7') cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3620
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        
        for ( var i = 0; i <5;i++)
        {
            if(input[i]=="0")
            {
                Console.WriteLine(i+1);
                break;
            }
        }
    }
}


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

namespace ABC125_D
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            string[] strs_a = Console.ReadLine().Split(' ');

            long[] a = new long[n];

            long sum = 0;
            long minus_count = 0;
            long min = long.MaxValue;

            for (long i = 0; i < n; ++i)
            {
                a[i] = long.Parse(strs_a[i]);

                if (a[i] < 0)
                {
                    ++minus_count;
                }

                if (min > Math.Abs(a[i]))
                {
                    min = Math.Abs(a[i]);
                }

                sum += Math.Abs(a[i]);
            }

            min = Math.Min(min, Math.Min(Math.Abs(a[0]), Math.Abs(a[n - 1])));

            if (minus_count % 2 == 1)
            {
                sum -= min * 2;
            }

            Console.WriteLine("{0}", sum);


        }
    }
}


Measured memory_bytes: 29404
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

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

  int H; cin >> H;
  int W; cin >> W;
  int h; cin >> h;
  int w; cin >> w;

  int HxW = H * W;
  int hxW = h * W;
  int Hxw = H * w;
  int hxw = h * w;
  
  cout << HxW - hxW - Hxw + hxw;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = (1LL << 60);

int main()
{
  int N;
  cin >> N;
  vector<pair<ll, ll>> r(N);
  for (int i = 0; i < N; i++)
  {
    ll X, L;
    cin >> X >> L;
    r.at(i) = make_pair(X + L, X - L);
  }
  sort(r.begin(), r.end());
  int ans = 0;
  ll last = -INF;
  for (int i = 0; i < N; i++)
  {
    if (last <= r.at(i).second)
    {
      ans++;
      last = r.at(i).first;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<map>

using namespace std;

#define rep(i,N) for(int i=0;i<N;i++) //0から


typedef long long ll;




ll binary_search(vector<ll> a, ll n, ll key){
    ll right = n, left = -1;
    ll md = (right + left) / 2;

    while(right - left > 1){
        if(a[md] <= key){
            right = md;
        }else{
            left = md;
        }
        md = (right + left) / 2;
    }
    if(left == -1) return -1; //無い場合
    return right;
}

vector<ll> prime;
void Prime(ll n){ //線形篩,素数列挙
    vector<ll> p(n,0);
    p[0]=1;
    p[1]=1;
    for(ll i=2;i<n;i++){
        if(p[i]==0){
            prime.push_back(i);
            p[i]=i;
        }
        ll k=prime.size();
        for(ll j=0;j<k && i*prime[j]<n && prime[j]<=p[i];j++){
            p[i*prime[j]]=prime[j];
        }
    }
}

ll gcd(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    //a>=b
    ll r=a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}

#define MOD ((ll)1e+9 + 7)



//cout<<fixed<<setprecision(10);
int main(){
    int r;
    cin>>r;
    cout<<3*r*r<<endl;

    return 0;
}



Measured memory_bytes: 3604
from functools import cmp_to_key
n, w = [int(e) for e in input().split()]
d = [[int(e) for e in input().split()] for i in range(n)]
d.sort(key = cmp_to_key(lambda x, y: y[1] / y[0] - x[1] / x[0]))
t = {}
t[w] = 0
for i in range(n):
  keys = list(sorted(t.keys())) # sort しないと品物iを複数回ナップサックに詰める可能性がある
  tw, tv = d[i]
  updates = []
  for j in keys:
    nw = j - tw
    if nw < 0:
      continue
    nv = t[j] + tv
    if nw not in t or nv > t[nw]:
      updates.append([nw, nv])
  for u in updates:
    t[u[0]] = u[1]
print(max(t.values()))


Measured memory_bytes: 107352
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        long c = (long)a * b;

        int tmp;
        while(a % b != 0) {
            tmp = b;
            b = a % b;
            a = tmp;
        }

        System.out.println(c / b);

    }
}


Measured memory_bytes: 22356
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;


ll gcd(ll x,ll y){
  return y==0? x:gcd(y,x%y);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;cin>>S;
  int ans = 0;
  repeat(i,S.length()/2-1){
    if(S.substr(0,i+1)==S.substr(i+1,i+1))ans=2*(i+1);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
N,T=list(map(int,input().split()))
l=[]
for i in range(N):
  l.append(list(map(int,input().split())))
l.sort(key=lambda x:(x[1],x[0]))

if l[0][1] > T:
  print('TLE')
  quit()
else:
  minimum = l[0][0]

for i in range(1,N):
  if l[i][1] > T:
    break
  elif l[i][1] == l[i-1][1]:
    pass
  else:
    minimum = min(l[i][0], minimum)
print(minimum)

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"os"
	"strconv"
	"strings"
)

const INFTY = 1 << 30

var H int

type Heap []int

func (h Heap) maxHeapify(idx int) {
	var largest int
	l := 2 * idx
	r := 2*idx + 1

	if l <= H && h[l] > h[idx] {
		largest = l
	} else {
		largest = idx
	}
	if r <= H && h[r] > h[largest] {
		largest = r
	}

	if largest != idx {
		h[idx], h[largest] = h[largest], h[idx]
		h.maxHeapify(largest)
	}
}

func (h Heap) extract() int {
	if H < 1 {
		return -INFTY
	}
	maxv := h[1]
	h[1] = h[H]
	H--
	h.maxHeapify(1)
	return maxv
}

func (h *Heap) increaseKey(idx, key int) {
	(*h)[idx] = key
	for idx > 1 && (*h)[idx/2] < (*h)[idx] {
		(*h)[idx], (*h)[idx/2] = (*h)[idx/2], (*h)[idx]
		idx = idx / 2
	}
}

func (h *Heap) insert(key int) {
	H++
	*h = append(*h, -INFTY)
	h.increaseKey(H, key)
}

func answer(reader io.Reader) string {
	sc := bufio.NewScanner(reader)
	sc.Split(bufio.ScanWords)

	A := &Heap{0}
	var out bytes.Buffer
	for {
		sc.Scan()
		com := sc.Text()
		switch com {
		case "insert":
			sc.Scan()
			k, _ := strconv.Atoi(sc.Text())
			A.insert(k)
		case "extract":
			out.WriteString(fmt.Sprintf("%d\n", A.extract()))
		case "end":
			return strings.TrimRight(out.String(), "\n")
		}
	}
}

func main() {
	fmt.Println(answer(os.Stdin))
}



Measured memory_bytes: 57952
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int N,A[100000],B[100000],C[100000];
int PA[100000],PB[100000],PC[100000];
int main(){
    cin>>N;
    for(int i=0 ; i<N ; i++){
        cin>>A[i]>>B[i]>>C[i];
        PA[i] = max(PB[i-1]+A[i],PC[i-1]+A[i]);
        PB[i] = max(PC[i-1]+B[i],PA[i-1]+B[i]);
        PC[i] = max(PA[i-1]+C[i],PB[i-1]+C[i]);
    }
    cout<<max(PA[N-1],max(PB[N-1],PC[N-1]));
}

Measured memory_bytes: 2560
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
 
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef pair<int, int> pi;


int main() {
  int n;
  cin >> n;
  vi a(n), b(n), c(n);
  rep(i, n) cin >> a[i] >> b[i] >> c[i];

  int dp[n][3];
  rep(i, 3) rep(j, 3) dp[i][j] = 0;
  dp[0][0] = a[0];
  dp[0][1] = b[0];
  dp[0][2] = c[0];

  for(int i=1;i<n;i++){
    dp[i][0] = max(dp[i-1][1], dp[i-1][2]) + a[i];
    dp[i][1] = max(dp[i-1][0], dp[i-1][2]) + b[i];
    dp[i][2] = max(dp[i-1][0], dp[i-1][1]) + c[i];
    // printf("%d %d %d %d\n", i, dp[i][0], dp[i][1], dp[i][2]);
  }
  int ans = max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2]));
  cout << ans << endl;
  return 0;
}

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

int main(){
    unsigned long L, A, B, M;
    cin >> L >> A >> B >> M;
    auto modpow = [&M](auto n, auto b){
        unsigned long ret = b, p = 10;
        while(n){
            if(n & 1)(ret *= p) %= M;
            (p *= p) %= M;
            n >>= 1;
        }
        return ret;
    };
    auto cal = [&M](auto N, auto A, auto B, auto R){
        unsigned long ret = 0;
        A %= M;
        B %= M;
        while(N){
            if(N & 1){
                ((ret *= R) += A) %= M;
                (A += B) %= M;
            }
            ((A *= R + 1) += B) %= M;
            (B *= 2 * (R + 1)) %= M;
            (R *= R) %= M;
            N >>= 1;
        }
        return ret;
    };
    cout << [impl = [&M, &cal, &modpow](auto f, auto L, auto A, auto B) -> pair<unsigned long, unsigned long> {
        if(to_string(A).size() < to_string(A + (L - 1) * B).size()){
            auto a = f(f, L / 2, A, B), b = f(f, (L + 1) / 2, A + B * (L / 2), B);
            return {a.first + b.first, (modpow(b.first, a.second) + b.second) % M};
        }
        return {to_string(A).size() * L, cal(L, A, B, modpow(to_string(A).size(), 1UL))};
    }](auto L, auto A, auto B){return impl(impl, L, A, B).second;}(L, A, B) << endl;
    return 0;
}

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

int main() {
  ll a, b, r, x, tmp, ans;
  cin >> a >> b;
  x = a * b;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  ans = x / b;
  cout << ans;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int max(int a,int b,int c)
{
  int i;
  i=a;
  if(a<=b)
    i=b;
  if(i<=c)
    i=c;
  return i;
}
int main(void)
{
  int  p,q,r;
  int a=0;
  
  scanf("%d %d %d",&p,&q,&r);
  
  printf("%d",p+q+r-max(p,q,r));
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define REP(i,n) for( (i)=0 ; (i)<(n) ; (i)++ )
#define rep(i,x,n) for( (i)=(x) ; (i)<(n) ; (i)++ )
#define REV(i,n) for( (i)=(n) ; (i)>=0 ; (i)-- )
#define FORIT(it,x) for( (it)=(x).begin() ; (it)!=(x).end() ; (it)++ )
#define foreach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define rforeach(it,c) for(__typeof((c).rbegin()) it=(c).rbegin();it!=(c).rend();++it)
#define foreach2d(i, j, v) foreach(i,v) foreach(j,*i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define SZ(x) ((int)(x).size())
#define MMS(x,n) memset(x,n,sizeof(x))
#define mms(x,n,s) memset(x,n,sizeof(x)*s)
#define pb push_back
#define mp make_pair
#define NX next_permutation
#define UN(x) sort(all(x)),x.erase(unique(all(x)),x.end())
#define CV(x,n) count(all(x),(n))
#define FIND(x,n) find(all(x),(n))-(x).begin()
#define ACC(x) accumulate(all(x),0)
#define PPC(x) __builtin_popcountll(x)
#define LZ(x) __builtin_clz(x)
#define TZ(x) __builtin_ctz(x)
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define low(x,i) lower_bound(all(x),i)
#define upp(x,i) upper_bound(all(x),i)
#define NXPOW2(x) (1ll << ((int)log2(x)+1))
#define PR(x) cout << #x << " = " << (x) << endl ;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const int OO = (int) 2e9;
const double eps = 1e-9;

const int N = 5e5 + 5;
const int BLOCK = sqrt(N); // ~ SQRT(N)
int n, m;
int a[N], ans[N];
int M[N];
int cnt;

struct Q {
	int L, R, i; // Left, Right, Index
	bool operator <(const Q& tmp) const {
		if (L / BLOCK != tmp.L / BLOCK)
			return L / BLOCK < tmp.L / BLOCK;
		return R < tmp.R;
	}
} q[N];

inline void add(int idx) {
	if (M[a[idx]] == 0)
		cnt++;
	M[a[idx]]++;
}

inline void remove(int idx) {
	if (M[a[idx]] == 1)
		cnt--;
	M[a[idx]]--;
}

void solve() {
	sort(q, q + m);
	int curL = 0, curR = 0;
	for (int i = 0; i < m; i++) {
		int L = q[i].L, R = q[i].R;
		while (curL < L)
			remove(curL++);
		while (curL > L)
			add(--curL);
		while (curR <= R)
			add(curR++);
		while (curR > R + 1)
			remove(--curR);
		ans[q[i].i] = cnt;
	}
}

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
//	freopen("in.txt", "rt", stdin);
//	freopen("out.txt", "wt", stdout);
#endif
	cin >> n >> m;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < m; i++)
		cin >> q[i].L >> q[i].R, q[i].L--, q[i].R--, q[i].i = i;
	solve();
	for (int i = 0; i < m; i++)
		cout << ans[i] << "\n";
	return 0;
}


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

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define MOD 1000000007
// #define MOD 998244353
// #define MOD LLONG_MAX
const double PI=3.14159265358979323846;
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; }

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0,};

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

// 繰り返し二乗法
ll power(ll a, ll b){
    if(a==1)return a;
    // if(a==0)re
    ll res=1;
    while(b>0){
        if(b&1) res=res*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return res;
}

const int MAX=2100000;

ll fact[MAX], fact_inv[MAX];

void init_fact(ll n){
    fact[0]=1;
    // 階乗の計算
    for(ll i=0; i<n; i++) fact[i+1]=fact[i]*(i+1)%MOD;
    fact_inv[n]=power(fact[n], MOD-2);
    // 逆元の計算
    for(ll i=n-1;i>=0;i--) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;
}

ll comb(ll n, ll r){
    return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}

ll perm(ll n, ll r){
    return (fact[n]*fact_inv[n-r])%MOD;
}

int main() {
    cout<<fixed<<setprecision(10);

    string s; cin>>s;
    bool ok = false;
    for(auto e:s){
        if(e=='7') ok = true;
    }
    if(ok) puts("Yes");
    else puts("No");

    return 0;

}

Measured memory_bytes: 3632
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String text = sc.next();
    text = text.replace("eraser", "-");
    text = text.replace("erase", "-");
    text = text.replace("dreamer", "-");
    text = text.replace("dream", "-");
    text = text.replace("-", "");
    if (text.isEmpty()) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
      
  }
}


Measured memory_bytes: 28840
#include <iostream>
#include <stack>
#include <queue>

int main() {
	std::stack<int> stCar;
	std::queue<int> qOut;
	int number;

	while (std::cin >> number) {
		if (number != 0) {
			stCar.push(number);
		} else {
			qOut.push(stCar.top());
			stCar.pop();
		}
	}

	while (!qOut.empty()) {
		std::cout << qOut.front() << '\n';
		qOut.pop();
	}
	return 0;
}

Measured memory_bytes: 0
#include<cstdio>
#include<cstring>
#include<algorithm>
#define fo(i, x, y) for(int i = x; i <= y; i ++)
using namespace std;

const int N = 2e5 + 5;

const int M = N * 60 * 6;

int fi[M], nt[M], to[M], tot;

int n, a[N], b[N], bz[N];

void link(int x, int y) {
	nt[++ tot] = fi[x], to[tot] = y, fi[x] = tot;
}

int bx[N], ans;

void dg(int x) {
	bx[x] = 1;
	for(int i = fi[x]; i; i = nt[i]) {
		int y = to[i]; if(bx[y]) continue;
		dg(y);
		ans += min(b[y], b[x]);
		b[x] -= min(b[y], b[x]);
	}
}


int main() {
	scanf("%d", &n);
	fo(i, 1, n) scanf("%d", &a[i]);
	sort(a + 1, a + n + 1);
	int n0 = n; n = 0;
	fo(i, 1, n0) {
		if(i == 1 || a[i] != a[i - 1])
			a[++ n] = a[i], b[n] = 1; else b[n] ++;
	}
    for(long long w = 2; w <= 2e9; w *= 2) {
    	int j = n;
    	fo(i, 1, n) {
    		while(a[i] + a[j] > w && j > 0) j --;
    		if(!j) break;
    		if(a[i] + a[j] == w) {
	    		if(a[i] != a[j]) {
	    			link(i, j);
				} else bz[i] = 1;
			}
		}
	}
	fo(i ,1, n) if(!bx[i]) dg(i);
	fo(i, 1, n) if(bz[i]) ans += b[i] / 2;
	printf("%d", ans);
}

Measured memory_bytes: 9600
#include<bits/stdc++.h>
#define ll long long
#define mp make_pair
#define F first
#define S second
#define db double
#define pb push_back
using namespace std;



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll tests=1;
   // cin>>tests;
    while(tests--)
    {
      char c;
      cin>>c;
      c=(int)c +1;
      cout<<c;
    }
    
    return 0;
}


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

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

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

    ll k;
    cin >> k;

    ll res = 0;
    rep1(i, k+1){
        rep1(j, k+1){
            rep1(l, k+1){
                res += gcd(i, gcd(j, l));
            }
        }
    }

    cout << res << endl;


    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
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; }

int main() {
  int N, x;
  cin >> N >> x;
  int sz = N*2-1;
  if (N == 2 && x == 2) {
    cout << "Yes" << endl;
    rep(i, sz)
      cout << i+1 << endl;
    return 0;
  }
  if (x <= 1 || x >= sz) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> ans(sz);
  if (x > 2) {
    ans[sz/2] = x;
    ans[sz/2-1] = x-1;
    ans[sz/2+1] = x+1;
    ans[sz/2+2] = x-2;
    int num = 1;
    rep(i, sz) {
      while(num >= x-2 && num <= x+1)
        num++;
      if (!ans[i]) {
        ans[i] = num;
        num++;
      }
    }
  } else {
    ans[sz/2] = x;
    ans[sz/2-1] = x+1;
    ans[sz/2+1] = x-1;
    ans[sz/2+2] = x+2;
    int num = 1;
    rep(i, sz) {
      while(num >= x-1 && num <= x+2)
        num++;
      if (!ans[i]) {
        ans[i] = num;
        num++;
      }
    }
  }
  cout << "Yes" << endl;
  rep(i, sz) cout << ans[i] << endl;
  return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

short dp[3001][3001];

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	string s, t; cin >> s >> t;
	rep(i, s.size()) rep(j, t.size()){
		if(s[i] == t[j] && dp[i + 1][j + 1] < dp[i][j] + 1){
			dp[i + 1][j + 1] = dp[i][j] + 1;
		}
		if(dp[i + 1][j] < dp[i][j]) dp[i + 1][j] = dp[i][j];
		if(dp[i][j + 1] < dp[i][j]) dp[i][j + 1] = dp[i][j];
	}
	int x = 0, y = 0, ans = 0;
	string res;
	rep(i, s.size() + 1) rep(j, t.size() + 1) if(dp[i][j] > ans){
		ans = dp[i][j];
		x = i; y = j;
	}
	
	while(dp[x][y] > 0){
		assert(x && y);
		if(s[x - 1] == t[y - 1] && dp[x - 1][y - 1] == dp[x][y] - 1){
			res += s[x - 1];
			x--; y--;
			continue;
		}
		if(dp[x - 1][y] == dp[x][y]) x--;
		else if(dp[x][y - 1] == dp[x][y]) y--;
		else assert(0);
	}
	reverse(all(res));
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 17920
#include<iostream>
#include<cstdio>
using namespace std;
char field[22][22];
int cnt=0;
void tansaku(int y,int x){
	if(field[y][x+1]=='.'){
		field[y][x+1]='#';
		cnt++;
		tansaku(y,x+1);
	}
	if(field[y][x-1]=='.'){
		field[y][x-1]='#';
		cnt++;
		tansaku(y,x-1);
	}
	if(field[y+1][x]=='.'){
		field[y+1][x]='#';
		cnt++;
		tansaku(y+1,x);
	}
	if(field[y-1][x]=='.'){
		field[y-1][x]='#';
		cnt++;
		tansaku(y-1,x);
	}
}
int main(){
	while(1){
		int w,h;
		cnt=0;
		cin >> w >> h;
		if(!w&&!h)	break;
		for(int i=1;i<=h;i++)
			scanf("%s",(field[i]+1));
		for(int i=0;i<=w+1;i++){
			field[0][i]='#';
			field[h+1][i]='#';
		}
		for(int i=0;i<=h+1;i++){
			field[i][0]='#';
			field[i][w+1]='#';
		}
		for(int y=1;y<=h;y++){
			for(int x=1;x<=w;x++){
				if(field[y][x]=='@'){
					tansaku(y,x);
					break;
				}
			}
		}
		cout << cnt+1 << endl;
	}
}


Measured memory_bytes: 3164
#include<bits/stdc++.h>
#include<cmath>
#include<cstring>
#include<climits>
#define int long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define asc(a,n) sort(a,a+n);
#define dsc(a,n) sort(a,a+n,comp);
#define fo(i,x,y) for(int i=x;i<y;i++)
#define inarr(x) int n; cin>>n; int x[n]; fo(i,0,n){cin>>x[i];}
#define test int t; cin>>t; while(t--)
using namespace std;

int basic(){freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);return 0;}
bool comp(int a,int b){return a>b;}



int32_t main()
{ //basic(); 
  fast; 
  int a,b,n; cin>>a>>b>>n;
  int c=min(n,b-1);
  cout<<floor((a*c)/b)-(a*floor(c/b));
  	
   
return 0;
}







Measured memory_bytes: 3808
#include <bits/stdc++.h>
#include <stdio.h>
 
using namespace std;
 
#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(i, a) for (auto &i: (a))
#define sz(x) (int)(x).size()
#define all(v) (v).begin(), (v).end()
#define fr(i, a, b) for (int i = (a); i <= (b); ++i)

void solve();

signed main () {
    clock_t beg = clock();
    cout << fixed << setprecision(15);
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    #endif 
    int t = 1; 
    // cin >> t;    
    int tt = t;
    while (t--) {
        // cout << "Case #" << tt - t << ": "; 
        solve();
    }
    cerr << "\nExecution time: " << (clock() - beg) / 1000 << '\n';
    return 0;
}
typedef long long ll;
const ll mod = 998244353; // change to something else

ll euclid(ll a, ll b, ll &x, ll &y) {
    if (b) { ll d = euclid(b, a % b, y, x);
        return y -= a/b * x, d; }
    return x = 1, y = 0, a;
}
struct Mod {
    ll x;
    Mod(ll xx = 0) : x(xx) {}
    Mod operator+(Mod b) { return Mod((x + b.x) % mod); }
    Mod operator-(Mod b) { return Mod((x - b.x + mod) % mod); }
    Mod operator*(Mod b) { return Mod((x * b.x) % mod); }
    Mod operator/(Mod b) { return *this * invert(b); }
    Mod invert(Mod a) {
        ll x, y, g = euclid(a.x, mod, x, y);
        assert(g == 1); return Mod((x + mod) % mod);
    }
    Mod operator^(ll e) {
        if (!e) return Mod(1);
        Mod r = *this ^ (e / 2); r = r * r;
        return e&1 ? *this * r : r;
    }
};
const int N = 5e5;
Mod fac[N], ifac[N];
int n, m, k;
Mod c (int n, int r) {
    if (r > n)
        return 0;
    return (fac[n] * ifac[n - r]) * ifac[r];
}
void solve() {  
    fac[0] = Mod(1);
    for (int i = 1; i < N; ++i) {
        fac[i] = fac[i - 1] * Mod(i);
    }
    ifac[N - 1] = Mod(1)/fac[N - 1];
    for (int i = N - 2; i >= 0; --i) {
        ifac[i] = ifac[i + 1] * Mod(i + 1);
    }
    cin >> n >> m >> k;
    Mod ans = 0;
    for (int blocks = 1; blocks <= n; ++blocks) {
        int cnt = (n - 1) - (blocks - 1);
        if (cnt <= k) {
            ans = ans + (c(n - 1, blocks - 1) * Mod(m) * (Mod(m - 1) ^ blocks - 1));
        }
    }
    cout << ans.x;
}       
    

Measured memory_bytes: 11464
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FORR(i,a,b) for (int i = b - 1; i >= a; --i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)

int main() {
	int x;
	REP(i, 5) {
		cin >> x;
		if (x == 0) cout << i + 1 << endl;
	}

	return 0;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4,sse4.1,sse4.2,tune=native")

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7; typedef vector<ll> VL;
void dbg(){ cerr << "\n"; }  template <class T, class ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T> void amax(T& a,T b){ a=max(a,b);}




int main() {
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	string s, t;
	cin >>n >>s >>t;
	
	rep(i, n){
		cout <<s[i] <<t[i];
	}
	cout <<"\n";
	return 0;
}


Measured memory_bytes: 256
#ifdef _WIN32
#define NOMINMAX
#define _CRT_SECURE_NO_WARNINGS
#include <Windows.h>
#define DEBUGBREAK() ::DebugBreak()
#else
#define DEBUGBREAK() static_cast<void>(0)
#endif

#include <iostream>
#include <sstream>
#include <iomanip>
#include <valarray>
#include <vector>
#include <string>
#include <fstream>
#include <cstdlib>
#include <queue>
#include <array>
#include <functional>
#include <stack>
#include <bitset>
#include <random>
#include <algorithm>
#include <unordered_map>

using namespace std;

const int dx4[4] = { 0, -1, 1, 0 };
const int dy4[4] = { -1, 0, 0, 1 };
const int dx5[5] = { 0, -1, 0, 1, 0 };
const int dy5[5] = { -1, 0, 0, 0, 1 };
const int dx8[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int dy8[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dx9[9] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
const int dy9[9] = { -1, -1, -1, 0, 0, 0, 1, 1, 1 };

#define REP(i, K) for (int i = 0; i < K; ++i)
#define REPYX() for (int y = 0; y < H; ++y) for (int x = 0; x < W; ++x)
#define REPX() REP(x, W)
#define REPY() REP(y, H)
#define INSIDE(x_, y_) (0 <= (x_) && 0 <= (y_) && (x_) < W && (y_) < H)
#define INSIDE_MARGIN(x_, y_, m_) ((m_) <= (x_) && (m_) <= (y_) && (x_) < W - (m_) && (y_) < H - (m_))

int get_assert_level() {
    const char* s = getenv("ASSERT_LEVEL");
    if (s) { return atoi(s); }
    return 0;
}
static int g_assert_level = get_assert_level();

#define LV_1() if (g_assert_level >= 1)
#define LV_2() if (g_assert_level >= 2)
#define LV_3() if (g_assert_level >= 3)
#define ASSERT_1(expr) do { const bool b = bool(expr); if (g_assert_level >= 1 && !b) { std::cerr << "[ASSERT 1] (" << #expr << ") failed." << std::endl; exit(-1); } } while (false)
#define ASSERT_2(expr) do { const bool b = bool(expr); if (g_assert_level >= 2 && !b) { std::cerr << "[ASSERT 2] (" << #expr << ") failed." << std::endl; exit(-1); } } while (false)
#define ASSERT_3(expr) do { const bool b = bool(expr); if (g_assert_level >= 3 && !b) { std::cerr << "[ASSERT 3] (" << #expr << ") failed." << std::endl; exit(-1); } } while (false)

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

    int N;
    cin >> N;

    vector<uint64_t> As(N);
    REP(i, N) cin >> As[i];
    if (*std::min_element(As.begin(), As.end()) == 0) {
        cout << 0 << endl;
    } else {
        constexpr uint64_t limit = 1000000000000000000ull;
        uint64_t mult = 1;
        REP(i, N) {
            constexpr uint64_t low32 = 0xffffffffull;
            uint64_t mH = (mult >> 32) & low32;
            uint64_t mL = mult & low32;
            uint64_t aH = (As[i] >> 32) & low32;
            uint64_t aL = As[i] & low32;
            uint64_t mult_low = mL * aL;
            uint64_t mult_mid0 = mH * aL;
            uint64_t mult_mid1 = mL * aH;
            uint64_t mult_hi = mH * aH;
            bool overflow = mult_hi + ((mult_mid0 >> 32) & low32) + ((mult_mid1 >> 32) & low32) > 0;
            uint64_t next = mult * As[i];
            if (overflow || next > limit) {
                cout << -1 << endl;
                return 0;
            }
            mult = next;
        }
        cout << mult << endl;
    }

    return 0;
}



Measured memory_bytes: 3976
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
const int INF = 2147483647;
const ll MOD = 1000000007;

using namespace std;

int main() {
  vi a(3);
  cin >> a[0] >> a[1] >> a[2];
  sort(ALL(a));
  int diff = 2 * a[2] - a[1] - a[0];
  if (diff % 2 == 0) {
    cout << diff / 2 << endl;
  } else {
    cout << (diff + 3) / 2 << endl;
  }
}


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

struct Problem {

	void Solve() {
		UL V, E; cin >> V >> E;
		vector<pair<pair<UL, UL>, LL>> G(E);
		rep(i, E) {
			UL a, b; LL d; cin >> a >> b >> d;
			G[i] = { { a, b }, d };
		}
		rep(r, V) {
			const LL INF = 1000000000000;
			vector<LL> ans(V, INF);
			ans[r] = 0;
			rep(i, V - 1) {
				for (auto e : G) {
					UL u = e.first.first, v = e.first.second;
					LL d = e.second;
					if (ans[u] == INF) continue;
					ans[v] = min(ans[v], ans[u] + d);
				}
			}
			for (auto e : G) {
				UL u = e.first.first, v = e.first.second;
				LL d = e.second;
				if (ans[u] == INF) continue;
				if (ans[v] > ans[u] + d) { cout << "NEGATIVE CYCLE" << endl; return; }
			}
			rep(i, V) {
				if (i) cout << " ";
				if (ans[i] == INF) cout << "INF";
				else cout << ans[i];
			} cout << endl;
		}
	}


	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}


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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;

template<class T,class U> void chmax(T& a, U b) {if(a<b)a=b;}
template<class T,class U> void chmin(T& a ,U b) {if(b<a)a=b;}

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 50);

#include <iostream>

/* recursion ver
 *
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
*/

long long gcd(long long m, long long n) {

  if (m < n)
    std::swap(m, n);

  long long tmp;
  while (m % n != 0) {
    tmp = n;
    n = m % n;
    m = tmp;
  }

  return n;
}

long long lcm(long long m, long long n) { return m * n / gcd(m, n); }

void solve(long long N, long long M, std::vector<long long> a){
    int x = -1;
    int l = 1;
    rep(i, N) {
        a[i] /= 2;
        int tmp = 0;
        while(a[i] % 2 == 0) {
            a[i] >>= 1;
            tmp++;
        }

        if (x < 0) x = tmp;
        if (x != tmp) {
            cout << 0 << endl;
            return;
        }

        l = lcm(l, a[i]);
        if (l * (1LL << x) > M) {
            cout << 0 << endl;
            return;
        }
    }

    // debug(x)
    // debug(l)
    int ans = 0;
    if (M >= l * (1LL << x)) {
        ans = (M - l * (1LL << x)) / (2LL * l * (1LL << x)) + 1;
    }
    cout << ans << endl;
    return;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    solve(N, M, std::move(a));
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100

stack<int> si;
string s;

int main() {
	while (cin >> s) {
		if (s == "+" || s == "-" || s == "*") {
			ll num1 = si.top();
			si.pop();
			ll num2 = si.top();
			si.pop();
			if (s == "+")num2 += num1;
			if (s == "-")num2 -= num1;
			if (s == "*")num2 *= num1;
			si.push(num2);
		}
		else {
			ll num = stoi(s);
			si.push(num);
		}
	}
	cout << si.top() << endl;
}

Measured memory_bytes: 3176
#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long int n;
    cin>>n;
    int count=0;
    while(n>1) {
        if (n%3==0) {
            n=n/3;
        } else {
            n=(n/3)+1;
        }
        count++;
    }
    cout<<count<<endl;
}


Measured memory_bytes: 3100
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int cou[200004];
vector<int> edge[200004];
int ans[200004];
void func(int pos,int nowcou,int bef){
    int nowans=nowcou+cou[pos];
    ans[pos]=nowans;
    for(int i=0;i<edge[pos].size();i++){
        if(edge[pos][i]!=bef)func(edge[pos][i],nowans,pos);
    }
}



int main(){
    int N,Q;
    cin>>N>>Q;
    for(int i=0;i<N-1;i++){
        int a,b;
        cin>>a>>b;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    for(int i=0;i<Q;i++){
        int a,b;
        cin>>a>>b;
        cou[a]+=b;

    }
    func(1,0,-1);

    for(int i=1;i<=N;i++){
        cout<<ans[i];
        if(i!=N)cout<<' ';
    }
    cout<<endl;
    return 0;
}


Measured memory_bytes: 27264