akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

// マクロ群
#define REP(i,n) for(int i=0;i<n;++i)
#define REP2(i,a,b) for (int i=(a);i<(b);++i)
#define rep(n) REP(i,n)
#define SF(f,v) scanf(f,v)
#define SF_N(v) SF("%d",&v)
#define SF_S(v) SF("%s",v)
#define PF(f,v) printf(f,v)
#define PFS_N(v) PF("%d ",v)
#define PFS_S(v) PF("%s ",v)
#define PFL_N(v) PF("%d\n",v)
#define PFL_S(v) PF("%s\n",v)


using namespace std;

const int ARRMAX = 1024;

void Slove()
{
	int N;
	SF_N(N);
	int a;

	bool ans = true;
	rep(N)
	{
		SF_N(a);
		if (bitset<1>(a)[0] != 0) ans = !ans;
	}

	PFL_S( ans ? "YES" : "NO");
}

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

Measured memory_bytes: 256
#B
n = int(input())
robot = []
for i in range(n):
    x,l = map(int, input().split())
    ri = x - l
    le = x + l
    robot.append([ri, le])
robot.sort(key=lambda x: x[1])
# print(robot)
a = robot[0][1]
count=1
for i in range(1, n):
    if a > robot[i][0]:
        pass
    else:
        # print(robot[i])
        #残せる
        a = robot[i][1]
        count += 1
print(count)

Measured memory_bytes: 21336
import java.util.Scanner;
public class Main{
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int K=sc.nextInt();
		int X=sc.nextInt();
		sc.close();
		int min=Math.max(X-K+1, -1000000);
		int max=Math.min(X+K-1, 1000000);
		for(int i=min;i<=max;i++) {
			System.out.print(i+" ");
		}
	}
}

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

#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 LL long long
#define INF INT_MAX

const double EPS = 1e-14;
const double PI  = acos(-1.0);


LL dp[41][101][101];

struct Mat {
  int a;
  int b;
  int c;
};

int main(){
  int n, ma, mb;
  cin >> n >> ma >> mb;

  vector<Mat> v(n);
  int a, b, c;
  REP (i, n) {
    cin >> a >> b >> c;
    v[i] = {a, b, c};
  }

  REP (i, 41) REP (j, 101) REP (k, 101) {
    if (j == 0 || k == 0) dp[i][j][k] = 0;
    else dp[i][j][k] = INF;
  }
  FOR (i, 1, n + 1) {
    REP (j, 101) {
      REP (k, 101) {
        int l = 1;
        int al = v[i - 1].a * l;
        int bl = v[i - 1].b * l;
        if (0 == j - al && 0 == k - bl) {
          dp[i][j][k] = min(dp[i - 1][j][k], (LL)(v[i - 1].c * l));
        } else if (0 < j - al && 0 < k - bl && dp[i - 1][j - al][k - bl] != INF) {
          dp[i][j][k] = min(dp[i - 1][j][k], dp[i - 1][j - al][k - bl] + v[i - 1].c * l);
        } else {
          dp[i][j][k] = min(dp[i - 1][j][k], dp[i][j][k]);
        }
      }
    }
  }

  LL ans = INF;
  FOR (i, 1, 101) {
    FOR (j, 1, 101) {
      if (i / ma == j / mb && i % ma == 0 && j % mb == 0) {
        ans = min(ans, dp[n][i][j]);
      }
    }
  }

  if (ans == INF) cout << -1 << endl;
  else cout << ans << endl;
}


Measured memory_bytes: 3456
#include <iostream>
#include <map>
#include <climits>
using namespace std;

unsigned long long to(string w , int base){
	unsigned long long ans = 0;
	for(int i = 0 ; i < w.size() ; i++) ans = ans * base + (w[i] >= 'A' ? w[i] - 'A' + 10 : w[i] - '0');
	return ans;
}

map<int,int> factor(int n){
	map<int,int> w;
	for(int i = 2 ; i*i<=n ; i++)
		while(n%i==0) w[i]++ , n /= i;
	if(n!=1) w[n]++;
	return w;
}
int main(){
	int n;
	string m;
	while(cin >> n >> m && (n||m!="0") ){
		unsigned long long v = to(m,n) , ans = ULLONG_MAX;
		map<int,int> r = factor(n);
		for( map<int,int>::iterator it = r.begin() ; it != r.end() ; ++it){
			int a = it->first;
			int d = it->second;
			unsigned long long t = v;
			unsigned long long ok = 0;
			while(t){ ok += (t / a) ; t /= a;}
			ans = min(ok / d , ans);
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 0
#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  string s ;
  cin >> s  ;
  
  int former , latter ;
  former = stoi(s.substr(0,2)) ;
  latter = stoi(s.substr(2,2)) ;
  
  if(former>=1 && former<=12){
    if(latter>=1 && latter<=12){
    cout << "AMBIGUOUS" << endl ;
    }else{
      cout << "MMYY" << endl ;
    }}else if(latter>=1 && latter<=12){
      cout << "YYMM" << endl ;
  }else{
      cout << "NA" << endl ;
    }
  
  return 0 ;
}


Measured memory_bytes: 256
#include <cstdio>
int main() {
int n;
while(scanf("%d",&n),n) {
	int five=0;
	for(int i=1;i<=n;i++) {
		for(int j=i;j%5==0;j/=5)five++;
	}
	printf("%d\n",five);
}
}

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

int main(void) {
    int A, B;
    cin >> A >> B;
    vector<int> vis(4, 0);
    ++ vis[A];
    ++ vis[B];
    for (int i = 1; i <= 3; ++ i) if (!vis[i]) cout << i << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

int main(){
    int h,w;
    cin>>h>>w;
    char grid[h][w];
    int recgrid[h][w];
    rep(i,h){
        rep(j,w){
            cin>>grid[i][j];
            recgrid[i][j] = 0;
        }
    }

    int tmp=0;
    rep(i,h){
        rep(j,w){
            if(grid[i][j] == '#'){
                tmp = 0;
            }
            else{
                ++tmp;
                recgrid[i][j] = tmp;
            }
        }
        tmp = 0;
        for(int j=w-1;j>=0;--j){
            if(grid[i][j] == '#'){
                tmp = 0;
            }
            else{
                ++tmp;
                recgrid[i][j] += tmp;
            }
        }
        tmp = 0;
    }
    rep(i,w){
        rep(j,h){
            if(grid[j][i] == '#'){
                tmp = 0;
            }
            else{
                ++tmp;
                recgrid[j][i] += tmp;
            }
        }
        tmp = 0;
        for(int j=h-1;j>=0;--j){
            if(grid[j][i] == '#'){
                tmp = 0;
            }
            else{
                ++tmp;
                recgrid[j][i] += tmp;
            }
        }
        tmp = 0;
    }

    int MAX = 0;
    rep(i,h){
        rep(j,w){
            MAX = max(MAX,recgrid[i][j]);
        }
    }
    cout<<MAX-3;
}

Measured memory_bytes: 19712
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define repi(i,x) for(auto i=(x).begin(),i##_fin=(x).end();i!=i##_fin;i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int , int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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;}
template <class T, class U>ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T>ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "{";
	rep(i, v.size()) {
		if (i) os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}
template <class T, class U>istream& operator>>(istream& is, pair<T, U>& p) {
	is >> p.first >>p.second ;
	return is;
}
template <class T>istream& operator>>(istream& is,  vector<T>& v) {
	rep(i, v.size()) {
		is >> v[i];
	}
	return is;
}
const long long INFLL = 1LL<<60;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	int n;
	int ans=0;
	cin >>n;
Vi c(n-1), s(n-1), f(n-1);//T,init, next 
	VPi data(n-1);
//	VP ans(n, mp(0LL, 0LL));  //マージン、lawtimeto next
	V det(n, 0LL);
	 rep(i,n-1){
	cin >> c[i] >>s[i]>> f[i];
	 	}	c.pb(0);
	s.pb(0);
	f.pb(1);
	ll cnt = 0LL;
	rep(i, n) {
		cnt = (ll)s[i];

		for (int j = i; j < n-1;j++){
			cnt += c[j];
			chmax(cnt, (ll)s[j + 1]);
			cnt = (cnt + f[j + 1] - 1) / f[j + 1] * f[j + 1];
	}
	cout << cnt << endl;
	}
}

Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>

#define INF 100000000
#define MOD (int) (1e9+7)
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;

int main(){
    string K;
    int D;
    cin >> K >> D;

    long long int dp[10010][2][100];

    dp[0][0][0] = 1;

    for(int i = 0; i < K.size(); i++){
        for(int j = 0; j < 2; j++){
            for(int k = 0; k < D; k++){
                int lim;
                if(j == 1){
                    lim = 9;
                }else{
                    lim = K[i] - '0';
                }

                for(int d = 0; d < lim+1; d++){
                    dp[i+1][j || d < lim][(k+d)%D] += dp[i][j][k];
                    dp[i+1][j || d < lim][(k+d)%D] %= MOD;
                }
            }
        }
    }

    cout << (dp[K.size()][0][0]+dp[K.size()][1][0]-1+MOD)%MOD << endl;//答えに0が含まれるのでそれを除くために-1
}


Measured memory_bytes: 15872
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int N=60;
int n,m,a[N],max1;
long long ans,d[N*N][N];
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		max1+=a[i];
	}
	d[0][0]=1;
	sort(a+1,a+n+1);
	for(int k=1;k<=n;k++)for(int i=max1;i>=0;i--)for(int j=0;j<=n;j++)d[i+a[k]][j+1]+=d[i][j];
	for(int i=1;i<=n;i++)ans+=d[i*m][i];
	printf("%lld",ans);
	return 0;
}

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

int main(){
    int n;
    cin>>n;
    int arr[n],a[n]={0};
    for(int i=0;i<n-1;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n-1;i++){
        a[arr[i]-1]++;
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<"\n";
    }
    return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<string> S(N);
    for(int i=0; i<N; ++i) {
        cin >> S[i];
    }
    string T;
    cin >> T;
    int pre = 0, post = 0;
    for(int i=0; i<N; ++i) {
        string s1, s2;
        for(int j=0; j<S[i].size(); ++j) {
            if(S[i][j] == '?') {
                s1 += 'a';
                s2 += 'z';
            } else {
                s1 += S[i][j];
                s2 += S[i][j];
            }
        }
        if(s1 <= T) {
            pre++;
        }
        if(s2 >= T) {
            post++;
        }
    }
    for(int i=N-post; i<=pre; ++i) {
        cout << i+1 << " \n"[i == pre] << flush;
    }
}


Measured memory_bytes: 896
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace A
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var ab = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            Console.WriteLine(ab[0] <= 8 && ab[1] <= 8 ? "Yay!" : ":(");
        }
    }
}


Measured memory_bytes: 13396
using System;
using System.Collections.Generic;
using System.Text;

namespace test
{
	class MainClass
	{

		static int[,] mas = new int[10, 10];

		public static void Main (string[] args)
		{

			string input;
			while ((input = Console.ReadLine()) != null) {
				string[] inputArray = input.Split (',');
				int x = int.Parse (inputArray [0]);
				int y = int.Parse (inputArray [1]);
				int size = int.Parse (inputArray [2]);
				switch(size){
				case 1:
					SmallDrop (x, y);
					break;
				case 2:
					MiddleDrop (x, y);
					break;
				case 3:
					BigDrop (x, y);
					break;
				}
			}

			int noDropCount = 0;
			int maxDrop = 0;
			for(int i=0;i<10;i++){
				for(int j=0;j<10;j++){
					if(mas[i,j] == 0){
						noDropCount++;
					}
					else if(mas[i,j] > maxDrop){
						maxDrop = mas [i, j];
					}
				}
			}

			Console.WriteLine (noDropCount);
			Console.WriteLine (maxDrop);

		}

		static void Drop(int x,int y){
			if (x >= 0 && x <= 9 && y >= 0 && y <= 9) {
				mas [x, y]++;
			}
		}

		static void SmallDrop(int x,int y){
			Drop (x, y - 1);
			Drop (x - 1, y);
			Drop (x, y);
			Drop (x + 1, y);
			Drop (x, y + 1);

		}

		static void MiddleDrop(int x,int y){
			SmallDrop (x, y);
			Drop (x - 1, y - 1);
			Drop (x + 1, y - 1);
			Drop (x - 1, y + 1);
			Drop (x + 1, y + 1);
		}

		static void BigDrop(int x,int y){
			MiddleDrop (x, y);
			Drop (x, y - 2);
			Drop (x - 2, y);
			Drop (x + 2, y);
			Drop (x, y + 2);
		}
	}
	
}

Measured memory_bytes: 5628
#include <bits/stdc++.h>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <stack>
#define LL long long
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=1;i<=n;i++)
#define repp(i,x,y) for(int i=x;i<=y;i++)
#define INF INT_MAX
using namespace std;
int n;
int main(){
	string st;
	cin>>st>>n;
	for(int i=0;i*n<st.size();i++)cout<<st[i*n];
	puts("");
	return 0;
}


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

using namespace std;

int main(void){
  long long H, W;
  cin >> H >> W;
  if(H % 3 == 0 || W % 3 == 0){
    cout << 0 << endl;
    return 0;
  }
  long long ans = H * W;
  for(long long h = 0; h <= H; h++){
    ans = min(ans, max((H - h) * W, (h + 1) / 2 * W) - min((H - h) * W, h / 2 * W));
    ans = min(ans, max((H - h) * W, h * ((W + 1) / 2)) - min((H - h) * W, h * (W / 2)));
  }
  swap(H, W);
  for(long long h = 0; h <= H; h++){
    ans = min(ans, max((H - h) * W, (h + 1) / 2 * W) - min((H - h) * W, h / 2 * W));
    ans = min(ans, max((H - h) * W, h * ((W + 1) / 2)) - min((H - h) * W, h * (W / 2)));
  }
  cout << ans << endl;
}


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

int main()
{
    int n;
    cin >> n;
    vector<char> vect;
    for(int i=0;i<n;i++)
    {
        char temp;
        cin >> temp;
        vect.push_back(temp);
    }
    vect.erase(unique(vect.begin(),vect.end()),vect.end());
    cout << vect.size() << endl;
    return 0;
}


Measured memory_bytes: 512
INF = 10**9


def solve():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))

    # 初期化
    dp = [INF] * N

    # 初期条件
    dp[0] = 0

    # DPループ
    for i in range(1, N):
        for j in range(min(i, K)):
            dp[i] = min(dp[i], dp[i - j - 1] + abs(h[i] - h[i - j - 1]))

    print(dp[-1])


if __name__ == "__main__":
    solve()

Measured memory_bytes: 84268
INF = 999999999999999999L
EPS = 1e-12

def read():
    return raw_input().strip()

def read_ints():
    return map(int,read().split())

n = int(read())
s = read()
A = s.count("#")
B = s.count(".")
a = 0
b = 0
best = INF 

for i in range(len(s)):
    best = min(best, a+(B-b))
    if s[i] == ".":
        b += 1
    else:
        a += 1
best = min(best, a+(B-b))

print best 


Measured memory_bytes: 9192
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1000000007;



int main(){
  ll n,K;
  cin >> n >> K;
  vector<ll>v(n);
  for(int i=0; i<n; i++) cin >> v[i];
  
  
  ll a = min(n,K);
  
  ll ans = 0;
  for(int i=1; i<=a; i++){
    for(int j=0; j<=i; j++){
      priority_queue<ll,vector<ll>,greater<ll>>pq;
      ll count = K-i;
      ll res = 0;
      for(int k=0; k<j; k++){
        pq.push(v[k]);
        res+=v[k];
        //cout << res << " ";
      }
      for(int l=0; l<i-j; l++){
        pq.push(v[n-1-l]);
        res+=v[n-1-l];
        //cout << res << " ";
      }
      
      while(count){
        if(pq.top()<0){
          //cout << pq.top() << " ";
          ll x = pq.top();
          pq.pop();
          res-=x;
        }
        count--;
        if(pq.size()==0)break;
      }
      
      ans = max(ans,res);
      //cout << res << endl;
    }
  }
  
  cout << ans << endl;
  
}
       
        
      
  
    


Measured memory_bytes: 3640
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if((a>=1 && a<=9) && (b>=1 && b<=9))
    {
        cout<<(a*b)<<"\n";
    }
    else
    cout<<-1<<"\n";
}

Measured memory_bytes: 3608
#include <iostream>
#include <algorithm>

using namespace std;

int arr[10000];
int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    while(true) {
        int N;
        cin >> N;
        if(!N) break;
        for(int i = 0; i < N; ++i) {
            cin >> arr[i];
        }
        sort(arr, arr+N);
        long long ans = 0;
        long long acc = 0;
        for(int i = 0; i < N; ++i) {
            ans += acc;
            acc += arr[i];
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 1248
import operator as op

n = int(input())
s = []
for i in range(n):
  a , b  = input().split()
  s.append((a,int(b),i+1))

s1 = sorted(s,key = op.itemgetter(1),reverse=True)
s2 = sorted(s1,key = op.itemgetter(0))
for i in range(n):
  print(s2[i][2])

Measured memory_bytes: 9164
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int x;
  cin >> x;
  int ans = 0;
  if (1800 <= x) {
    ans = 1;
  } else if (1600 <= x) {
    ans = 2;
  } else if (1400 <= x) {
    ans = 3;
  } else if (1200 <= x) {
    ans = 4;
  } else if (1000 <= x) {
    ans = 5;
  } else if (800 <= x) {
    ans = 6;
  } else if (600 <= x) {
    ans = 7;
  } else {
    ans = 8;
  }
  cout << ans << endl;
  return 0;
}

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

int main(){
  int n,k;
  cin >> n >> k;
  string s;
  cin >> s;
  if(s[k-1] == 'A') s[k-1] = 'a';
  else if (s[k-1] == 'B') s[k-1] = 'b';
  else s[k-1] = 'c' ;
  cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>

using ll = long long;

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    int a = 1, b = m+1;
    while (b > a) {
        cout << a << ' ' << b << '\n';
        a++; b--;
    }
    a = m+2; b = 2*m+1;
    while (b > a) {
        cout << a << ' ' << b << '\n';
        a++; b--;
    }
    return 0;
}

Measured memory_bytes: 3628
S = input()
T = input()

len_S = len(S)
len_T = len(T)

if len_S < len_T:
    print("UNRESTORABLE")
    quit()

candidates = tuple((S[:i] + T + S[i + len_T:]).replace("?", "a") for i in range(len_S - len_T + 1) if all(s in ("?", t) for s, t in zip(S[i:], T)))

print(min(candidates) if candidates else "UNRESTORABLE")


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


int main() {
    int n, m; cin >> n >> m;
    vector<ll> a(m);
    rep(i, m) cin >> a[i];

    ll total = accumulate(all(a), 0ll);

    if (total > n) {
        cout << -1 << endl;
    } else {
        cout << n - total << endl;
    }
}


Measured memory_bytes: 3704
#include<iostream>
#include<iomanip>

double halfadjust(double x){
	int tmp = (x*10000);
	tmp = tmp%10;
	double ans = static_cast<double>(static_cast<int>(x*1000));
	ans = ans/1000;
	if(tmp >= 5)
		ans += 0.001;
	if(tmp <= -5)
		ans -= 0.001;
	return ans;
}

double a,b,c,d,e,f;

void solve(){
	using namespace std;
	double x = (c*e-b*f)/(a*e-b*d);
	double y = (c*d-a*f)/(b*d-a*e);
	cout << setprecision(3) << fixed << halfadjust(x) << ' ';
	cout << halfadjust(y) << endl;
	cout << setprecision(6);
}

int main(){
	using std::cin;
	while(cin >> a&& cin >> b&& cin >> c&& cin >> d&& cin >> e&& cin >> f){
		solve();
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const int dx[4] = { 0, -1, 1, 0 };
const int dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}

template<class T1, class T2> void chmin(T1 &a, T2 b) { if (a>b)a = b; }

template<class T1, class T2> void chmax(T1 &a, T2 b) { if (a<b)a = b; }
template<class T>
void Add(T &a, const T &b, const T &mod = 1000000007) {
	int val = ((a % mod) + (b % mod)) % mod;
	if (val < 0) { val += mod; }
	a = val;
}
////////////////////////////////////////


int main() {
	int N; cin >> N;
	string S, T; cin >> S >> T;
	string ans = "";
	REP(i, N) {
		ans += S[i];
		ans += T[i];
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;

int main()
{
    string s;
    cin >> s;
    string year = s.substr(0, 4);
    string month = s.substr(5, 2);
    string day = s.substr(8, 2);
    stringstream yy, mm, dd;
    yy << year;
    mm << month;
    dd << day;
    int y, m , d;
    yy >> y;
    mm >> m;
    dd >> d;

    if (y < 2019)
    {
        cout << "Heisei\n";
    }
    else if (y > 2019)
    {
        cout << "TBD\n";
    }
    else
    {
        if (m > 4)
        {
            cout << "TBD\n";
        }
        else if ( m < 4 )
        {
            cout << "Heisei\n";
        }
        else
        {
            if (d > 30)
            {
                cout << "TBD\n";
            }
            else
            {
                cout << "Heisei\n";
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
#![allow(non_snake_case)]

fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let mut v: Vec<usize> = sc.vec(7);
    let mut ans:usize = v[1];
    let mut even:usize = 0;
    if v[0]%2 == 0{
        even += 1;
    }
    if v[3]%2 == 0{
        even += 1;
    }
    if v[4]%2 == 0{
        even += 1
    }
    if even <= 1{
        if (v[0] > 0) && (v[3] > 0) && (v[4] > 0){
            ans += 3;
            v[0] -= 1;
            v[3] -= 1;
            v[4] -= 1;
        }
    }
    ans += v[0]/2*2;
    ans += v[3]/2*2;
    ans += v[4]/2*2;
    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
        .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}




Measured memory_bytes: 4352
#include <cstdio>
#include <utility>
using namespace std;

#define gcu getchar_unlocked
int in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;}
int in() {return in(gcu());}
bool scan(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
bool scan(char &c){c=gcu();gcu();return c!=EOF;}
//bool scan(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#define pcu putchar_unlocked
#define vo inline void out
template <typename T>
vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
vo(const char *s){while(*s)pcu(*s++);}
vo(char c){pcu(c);}
//vo(string &s){for (char c: s) pcu(c);}
template <typename head, typename... tail> vo(head&& h, tail&&... t){out(h);out(move(t)...);}
//template <typename T> vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
#undef vo


int main() {
	for (int p; (p = in());) {
		for (int i = 9; i--;)
			p -= in();
		out(p, '\n');
	}
}


Measured memory_bytes: 2472
n = int(input())
l = [int(_) for _ in input().split()]
ans = 0
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if l[i]+l[j] > l[k] and l[i]+l[k] > l[j] and l[k]+l[j] > l[i] and l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
                ans += 1
                # print(i, j, k)
print(ans)


Measured memory_bytes: 9188
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final char[] chs = sc.next().toCharArray();
			
			int ans = 0;
			for(int i = 0; i < chs.length; i++) {
				int answer = 0;
				
				for(int j = i; j < chs.length; j++) {
					if(chs[j] == 'S') { break; }
					answer++;
				}
				
				ans = Math.max(ans, answer);
			}
			
			System.out.println(ans);
		}
	}

	public static class Scanner implements Closeable {
		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 double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


Measured memory_bytes: 32632
#include<iostream>
using namespace std;
int main(){
    int n,m,count=0;
    cin>>n;
    int s[n];
    for(int i=0;i<n;i++){
        cin>>s[i];
    }
    cin>>m;
    int t[m];
    for(int i=0;i<n;i++){
        cin>>t[i];
    }
    
    int right,left,mid;
    for(int i=0;i<m;i++){
        left=0;
        right=n;
        while(left<right){
            mid=(left+right)/2;
            if(s[mid]==t[i]){
                count++;;
                break;
            }
            else if(t[i]<s[mid]){
                right=mid;
            }
            else{
                left=mid+1;
            }
        }
    }
    cout<<count<<endl;
    
    return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()
 
using namespace std;
using ll = long long;
 
struct edge { int to, cost; };
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = ~(1<<31);
const int MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
 
const int mx4[] = {0,1,0,-1};
const int my4[] = {1,0,-1,0};
const int mx8[] = {0,1,1,1,0,-1,-1,-1};
const int my8[] = {1,1,0,-1,-1,-1,0,1};

int a[100010];

int main(){
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;

	

	int l = 1,r = n-2;
	while(k > 0 && l < r){
		while(l < r && s[l-1] == s[l]){
			l++;
		}	
		while(l < r && s[r] == s[r+1]){
			r--;
		}
		if(l < r){
			a[l]++;
			a[r+1]--;
		}else{
			if(k > 0){
				cout << n-1 << endl;
				return 0;
			}
		}
		
		l++,r--;
		k--;
	}
	
	for(int i = 1; i < n; i++) a[i] += a[i-1];
	for(int i = 0; i < n; i++) if(s[i] == 'R') a[i]++;

	//for(int i = 0; i < n; i++) cout << (a[i]%2 ? 'R' : 'L');
	//cout << endl;

	int sum = 0,cnt = 0;
	for(int i = 0; i < n; i++){
		if(a[i]%2 != a[i+1]%2 || i == n-1){
			sum += cnt;
			cnt = 0;
		}else{
			cnt++;
		}
	}

	cout  << sum << endl;

	return 0;
}

Measured memory_bytes: 896
// AtCoder ABC127: B - Algae
// 2019.9.8 bal4u

#include <stdio.h>

int main()
{
	int i, r, D, x;
	
	scanf("%d%d%d", &r, &D, &x);
	for (i = 1; i <= 10; i++) {
		x = r*x - D;
		printf("%d\n", x);
	}
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;


int main(int argc, char const *argv[]) {
    int h, w, k;
    cin >> h >> w >> k;
    ll dp[h+10][w+10];
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    if (w == 1) {
        cout << 1 << endl;
        return 0;
    }
    for (int I = 0; I <= h; ++I) {
        for (int J = 0; J < w; ++J) {
            for (int bit = 0; bit < (1<<(w-1)); ++bit) {
                bitset<7> st(bit);
                bool nex = false;
                if (w != 2) {
                    for (int i = 1; i < 8; ++i) {
                        if (st[i] && st[i-1]) {
                            nex = true;
                            break;
                        }
                    }
                }
                if (nex) continue;
                if (J-1 >= 0 && J+1 < w) {
                    if (!st[J-1] && !st[J]) dp[I+1][J] = (dp[I+1][J]+dp[I][J])%MOD;
                    else if (st[J-1] && !st[J]) dp[I+1][J] = (dp[I+1][J]+dp[I][J-1])%MOD;
                    else if (!st[J-1] && st[J]) dp[I+1][J] = (dp[I+1][J]+dp[I][J+1])%MOD;
                    else if (st[J-1] && st[J]) dp[I+1][J] = (dp[I+1][J]+(dp[I][J+1]+dp[I][J-1])%MOD)%MOD;
                }
                else if (J-1 >= 0 && J+1 >= w) {
                    if (!st[J-1]) dp[I+1][J] = (dp[I+1][J]+dp[I][J])%MOD;
                    else if (st[J-1]) dp[I+1][J] = (dp[I+1][J]+dp[I][J-1])%MOD;
                }
                else if (J-1 < 0 && J+1 < w) {
                    if (!st[J]) dp[I+1][J] = (dp[I+1][J]+dp[I][J])%MOD;
                    else if (st[J]) dp[I+1][J] = (dp[I+1][J]+dp[I][J+1])%MOD;
                }
            }
        }
    }
    cout << dp[h][k-1] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int binarySearch(int s[],int key,int head,int tail){
    if(head>tail)return 0;
    
    int mid=(head+tail)/2;
    if(s[mid]==key)return 1;
    else if(s[mid]>key)tail=mid-1;
    else head=mid+1;
    
    return binarySearch(s,key,head,tail);
}

int main(void){
    int i;
    
    int n;
    scanf("%d\n",&n);
    int s[n];
    for(i=0;i<n;i++)scanf("%d",&s[i]);
    
    int q;
    scanf("%d\n",&q);
    
    int t;
    int count=0;
    while(q--){
        scanf("%d",&t);
        count+=binarySearch(s,t,0,n-1);
    }
    printf("%d\n",count);
    
    return 0;
}



Measured memory_bytes: 2112
#!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit


def make_destination(wx, wy):
    data = [[] for _ in range(5)]

    x1 = wx[0]
    y1 = wy[0]
    append = data[0].append
    append(('R' if x1[0] == '1' else '.') +
           ('D' if y1[0] == '1' else '.') + '..')
    for i in range(3):
        append(('R' if x1[i+1] == '1' else '.') +
               ('D' if y1[i+1] == '1' else '.') +
               ('L' if x1[i] == '1' else '.') + '.')
    append('.' + ('D' if y1[4] == '1' else '.') +
           ('L' if x1[3] == '1' else '.') + '.')

    for j in range(1, 4):
        y0 = y1
        x1 = wx[j]
        y1 = wy[j]
        append = data[j].append
        append(('R' if x1[0] == '1' else '.') +
               ('D' if y1[0] == '1' else '.') + '.' +
               ('U' if y0[0] == '1' else '.'))
        for i in range(3):
            append(('R' if x1[i+1] == '1' else '.') +
                   ('D' if y1[i+1] == '1' else '.') +
                   ('L' if x1[i] == '1' else '.') +
                   ('U' if y0[i+1] == '1' else '.'))
        append('.' + ('D' if y1[4] == '1' else '.') +
               ('L' if x1[3] == '1' else '.') +
               ('U' if y0[4] == '1' else '.'))

    y0 = y1
    x1 = wx[4]
    append = data[4].append
    append(('R' if x1[0] == '1' else '.') + '..' +
           ('U' if y0[0] == '1' else '.'))
    for i in range(3):
        append(('R' if x1[i+1] == '1' else '.') + '.' +
               ('L' if x1[i] == '1' else '.') +
               ('U' if y0[i+1] == '1' else '.'))
    append('..' + ('L' if x1[3] == '1' else '.') +
           ('U' if y0[4] == '1' else '.'))

    return data


def walk(data):
    destination = {'R': (1, 0), 'D': (0, 1), 'L': (-1, 0), 'U': (0, -1)}
    permutation = {'R': (3, 0, 1, 2), 'D': (0, 1, 2, 3),
                   'L': (1, 2, 3, 0), 'U': (2, 3, 0, 1)}

    print('R', end='')

    x = 1
    y = 0
    move = 'R'

    while x != 0 or y != 0:
        ways = data[y][x]
        for per in permutation[move]:
            m = ways[per]
            dest = destination.get(m)
            if dest is not None:
                break
        x += dest[0]
        y += dest[1]
        move = m
        print(move, end='')
    print()


def main():
    wall = stdin.read().split()
    walk(make_destination(wall[::2], wall[1::2]))
    exit(0)


main()

Measured memory_bytes: 4456
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_D main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif


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


    int N, Z, W; cin >> N >> Z >> W;
    vi A(N); REP(i, N) cin >> A[i];
    
    int ans = abs(A[N - 1] - W);
    if (N > 1) ans = max(ans, abs(A[N - 2] - A[N - 1]));

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
	static final int dx[]= {0,-1,0,1};
	static final int dy[]= {-1,0,1,0};

	public static void main(String[] $){
		Scanner s=new Scanner(System.in);
		int h=s.nextInt();
		int w=s.nextInt();
		int n=s.nextInt();
		int sy=s.nextInt();
		int sx=s.nextInt();

		int u=sy;
		int d=h-sy+1;
		int l=sx;
		int r=w-sx+1;

		char[]t=s.next().toCharArray(),a=s.next().toCharArray();

		for(int i=0;i<n;++i) {
			if(t[i]=='U')if(--u==0){System.out.println("NO");return;};
			if(t[i]=='D')if(--d==0){System.out.println("NO");return;};
			if(t[i]=='L')if(--l==0){System.out.println("NO");return;};
			if(t[i]=='R')if(--r==0){System.out.println("NO");return;};

			if(a[i]=='U')if(d<h)++d;
			if(a[i]=='D')if(u<h)++u;
			if(a[i]=='L')if(r<w)++r;
			if(a[i]=='R')if(l<w)++l;
		}
		System.out.println("YES");
	}
}

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

#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define rep0(i,n) rep(i,0,n)
#define rep1(i,n) rep(i,1,n+1)

int main() {
  while(true) {
    string s;
    cin >> s;
    if (s[0] == '-') break;

    int m;
    cin >> m;
    int start = 0;
    rep0(i, m) {
      int t;
      cin >> t;
      start += t;
    }
    start %= s.size();
    rep0(i, s.size()) {
      cout << s[(start + i) % s.size()];
    }
    cout << "\n";
  }
  return 0;
}


Measured memory_bytes: 3084
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		long C = sc.nextLong();
		
		if (A % 2 == 1 && B % 2 == 1 && C % 2 == 1) {
			long[] map = new long[] {A, B, C};
			Arrays.sort(map);
			System.out.println(map[0] * map[1]);
		} else {
			System.out.println(0);
		}
	}
}

Measured memory_bytes: 21972
#include<iostream>
#include<stdlib.h>
int main(){
    int N, L;
    std::cin >> N >>L;
    std::cout << std::endl;
    //std::cout << N << L << std::endl;;
    int apple_taste[N];
    int min_taste = 0;
    for(int i = 0; i < N; ++i){
        apple_taste[i] = L + i;
        if(apple_taste[i] < abs(apple_taste[min_taste])) min_taste = i;
    }
    //for(int i = 0; i < N; ++i)std::cout << apple_taste[i] << std::endl;
    int sum = 0;
    for(int i = 0; i < N; ++i)sum += apple_taste[i];
    //std::cout << apple_taste[min_taste] << std::endl;
    sum -= apple_taste[min_taste];
    std::cout << sum;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int d[4] = {};
	rep(i, 0, 3){
		int a, b;
		cin >> a >> b;
		a--; b--;
		d[a]++;
		d[b]++;
	}
	sort(d, d + 4);
	if(d[0] == d[1] && d[1] == 1 && d[2] == d[3] && d[2] == 2) cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <fstream>
#include <numeric>
#include <unordered_set>
#include <sstream>
#include <cassert>
#include <tuple>
#include <iomanip>
#include <random>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <chrono>
#include <stack>
#include <string>
#include <bitset>
#include <unordered_map>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
 
using namespace std;
 
#define ll long long
const int N = (ll)(2e5) + 100;
 
int ptr = 0;

void solve() {
    ll n,m;cin >> n >> m;
    ll maxi = 0;
    ll a[n + 1][3];
    for (int i = 1;i <= n;i ++) {
        for (int j = 0;j < 3;j ++) {
            cin >> a[i][j];
        }
    }
    ll res = 0;
    for (int k = 0;k < 8;k ++) {
        vector<ll> _sum;
        for (int i = 1;i <= n;i ++) {
            ll cur = 0;
            for (int j = 0;j < 3;j ++) {
                if (k & (1 << j)) cur += a[i][j];
                else cur -= a[i][j];
            }
            _sum.push_back(cur);
        }
        ll now = 0;
        sort(_sum.begin(), _sum.end());
        reverse(_sum.begin(), _sum.end());
        for (int i = 0;i < m;i ++) {
            now += _sum[i];
        }
        res = max(res, now);
    }
    cout << res << "\n";
}

void test() {
}

int main() {
    freopen("debug.txt", "w", stderr);
    solve();
    return 0;
}

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

int Get2s(int a)
{
	int d = 0;
	while ((a & 1) == 0)
	{
		a >>= 1;
		d++;
	}
	return d;
}

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

	int sum = 0;
	for (size_t i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		sum += Get2s(a);
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){

  int N;
  cin >> N;
  
  string S;
  string T;
  cin >> S >> T;
  
  string A;
  
  int num;
  
  for(int i = 0;i < N * 2;++i){
    if(i % 2 == 0){
      num = i / 2;
      A[i] = S[num];
    }
    else{
      num = i / 2;
      A[i] = T[num];
    }
    cout << A[i];
  }
  
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
 
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) < (b) ? (a) : (b))

int main(void) {
	long double a, b;
	scanf("%Lf %Lf", &a, &b);
	printf("%lld\n", (long long)(a * b) / 1);
	
	return 0;
}

Measured memory_bytes: 1752
class Pairs:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __lt__(self, other):
        if self.x < other.x:
            return True
        elif self.x == other.x:
            return self.y < other.y
        else:
            return False

    def __str__(self):
        return "{} {}".format(self.x, self.y)


n = int(input())
L = []
for i in range(n):
    x, y = [int(x) for x in input().split() ]
    L.append(Pairs(x,y))
L.sort()

for i in L:
    print(i)



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    EACH(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
    REP(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
    REP(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}
// SegmentTree<int> seg(n, 0x7FFFFFFF, [](int a, int b){return min(a, b);});
template <typename T>
class SegmentTree {
    using func_t = function<T(T, T)>;
    const int n;
    const T id;
    func_t merge;
    vector<T> data;
    T sub(int l, int r, int node, int lb, int ub) {
        if (ub <= l || r <= lb) return id;
        if (l <= lb && ub <= r) return data[node];
        T vl = sub(l, r, node * 2 + 0, lb, (lb + ub) / 2);
        T vr = sub(l, r, node * 2 + 1, (lb + ub) / 2, ub);
        return merge(vl, vr);
    }
    int size(int n) {
            int res;
            for (res = 1; res < n; res <<= 1);
            return res;
    }
public:
    SegmentTree(int n, T id, func_t merge) :
        n(size(n)), id(id), merge(merge), data(size(n) * 2, id) {}
    void update(int p, T val) {
        assert (0 <= p && p < n);
        p += n;
        data[p] = val;
        while (p /= 2) {
            int l = p * 2, r = p * 2 + 1;
            data[p] = merge(data[l], data[r]);
        }
    }
    T find(int l, int r) {
        return sub(l, r, 1, 0, n);
    }
};

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n; cin >> n;
    vector<int> v(n); cin >> v;
    SegmentTree<P> seg(n, P(inf, inf), [](const P& p1, const P& p2) {
        return min(p1, p2);
    });
    REP(i, n) {
        seg.update(i, P(v[i], i));
    }
    ll ans = 0;
    stack<P> S; S.push({0, n});
    while ( !S.empty() ) {
        P p = S.top(); S.pop();
        ll l, r; tie(l, r) = p;
        if (l < r) {
            ll val, pos; P p = seg.find(l, r); tie(val, pos) = p;
            ll left = pos-l+1, right = r-pos;
            ans += left * right * val;
            S.push({l, pos});
            S.push({pos+1, r});
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 12544
#include <bits/stdc++.h>
using namespace std;
int A[2000001],B[2000001];
void CountingSort(int n,int k)
{
	int C[k+1]={0};
	for(int j=1;j<=n;j++)
		C[A[j]]++;
	for(int i=1;i<=k;i++)
		C[i] += C[i-1];
	for(int j=1;j<=n;j++){
		B[C[A[j]]] = A[j];
		C[A[j]]--;
	}
}
int main()
{
	int n,k=0; 
	cin>>n;
	for(int i=1;i<=n;i++){
		scanf("%d",&A[i]);
		k = max(k,A[i]);
	}
	CountingSort(n,k);
	for(int i=1;i<=n;i++)
		if(i==n) printf("%d\n",B[i]);
		else printf("%d ",B[i]);
	return 0;
}


Measured memory_bytes: 18760
#include <bits/stdc++.h>
#define FLASH ios_base::sync_with_stdio(0);
#define ll long long
#define debt(x,y)cout<<"#x = "<<(x)<<" and "<<"#y = "<<(y)<<endl;
#define deb(x)cout<<"#x = "<<(x)<<endl;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define arr(a,n) for(ll i=1;i<=n;i++) cout<<a[i]<<" "; cout << "\n";
#define vecc(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout << "\n";


using namespace std;

ll maxx=0;
ll maxxx=0;
map<pair<ll,ll>,ll>used;
ll row[300010];
ll column[300010];
ll n,m,k;

int main(){
FLASH;
cin>>n>>m>>k;
while(k--)
{
  ll x,y;
  cin>>x>>y;
  row[x]++;
  column[y]++;	
  used[mp(x,y)]=1;
}
ll posx=0;
ll posy=0;
for(ll i=1;i<=n;i++)
{
 if(row[i]>maxx){maxx=row[i];posx=i;}
}
ll maxxxx=0;
for(ll i=1;i<=m;i++)
{
  ll el=maxx;
  ll sig=0;
  if(used[mp(posx,i)])sig=1;
  ll cena=maxx+column[i]-sig;
  if(column[i]>maxxxx){maxxxx=column[i];posy=i;}
  
  if(cena>maxxx){maxxx=cena;}	
}

ll ans=0;

for(ll i=1;i<=n;i++)
{
  ll sig=0;
  if(used[mp(i,posy)])sig=1;
  ll cena=maxxxx+row[i]-sig;

  
  if(cena>ans){ans=cena;}	
}

cout<<max(ans,maxxx)<<endl;






return 0;
} 


Measured memory_bytes: 64552
#include<stdio.h>
#include <cstdlib>

int main ()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
//	a=abs(a);
//	b=abs(b);
//	c=abs(c);

	int temp=0;
	if(a>temp)
		temp=a;
	if(b>temp)
		temp=b;
	if(c>temp)
		temp=c;
	
	
	temp=a+b+c-temp;
	
	if(a==b&&a==c)
		temp=a+b;
	printf("%d\n",temp);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define fore(i,a,b) for(int i=a;i<b;i++)
#define maxe(a,b,c) max(a,max(b,c))
#define eb emplace_back
#define em emplace
#define print(x) cout<<x<<endl;
#define in(k) int k;cin>>k
typedef long long int ll;
const ll mod=1e9+7;
int c=0;
int n,m;
vector<vector<int>> g;
vector<int> e,f;
void dfs(int n)
{
    for(auto to:g[n])
    {
        if(f[to]==0)
        {
            f[to]=1;
            dfs(to);
        }
        e[n]=max(e[n],e[to]+1);
        c=max(c,e[n]);
    }
}
int main()
{
    fastio;
    cin>>n>>m;
    g=vector<vector<int>>(n);
    e.assign(n,0);
    f.assign(n,0);
    fore(i,0,m)
    {
        in(x);in(y);
        g[--x].eb(--y);
    }
    fore(i,0,n)
    {
        if(f[i]!=1)
        {
            f[i]=1;
            dfs(i);
        }
    }
    cout<<c;
    return 0;
}
    

Measured memory_bytes: 8576
n=int(input())
a=list(map(int,input().split()))
a.sort()
num1=a[-1]
num2=a[-1]/2
num3=a[-1]
ans=-1
for i in range(n-1):
    if abs(a[i]-num2)<num3:
        ans=a[i]
        num3=abs(a[i]-num2)
print(num1,ans)


Measured memory_bytes: 19952
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#define pb push_back
using namespace std;
typedef pair<int,int> pii;
typedef long long int lli;

int n;
vector<lli> a;

int main(void){
  cin>>n;

  lli t;
  for(int i=1;i<=n;i++){
    cin>>t;
    a.pb(t-i);
  }
  sort(a.begin(),a.end());

  if(a.size()%2==1){
    t=a[n/2];
    lli res=0;
    for(int i=0;i<n;i++){
      res+=abs(a[i]-t);
    }
    cout<<res<<endl;

}
  else{
    t=a[n/2]+a[n/2 -1];
    t/=2;
    lli res1,res2,res3;
    res1=res2=res3=0;
    for(int i=0;i<n;i++){
      res1+=abs(a[i]-t);
      res2+=abs(a[i]-t-1);
      res3+=abs(a[i]-t+1);
    }
    cout<<min(res1,min(res2,res3))<<endl;
    }
  return 0;
}

Measured memory_bytes: 2420