akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdlib.h>
#include<inttypes.h>
int cmp(const void *x,const void *y){
    int64_t a=*(const int64_t*)x;
    int64_t b=*(const int64_t*)y;
    return a>b ?-1:a<b;
}
int N;
int64_t M,A[200000],A_ruiseki[200000];
int64_t gcount(int64_t* sum,int64_t target){
    int i;
    int64_t count=0;
    if(sum)
        *sum=0;
    for(i=0;i<N;i++){
        int ge=0,less=N-1;
        if(A[i]+A[0]<target)
            count+=0;
        else if(A[i]+A[N-1]>=target){
            count+=N;
            if(sum)
                (*sum)+=A[i]*N+A_ruiseki[N-1];
        }
        else{
            while(ge+1<less){
                int mid=ge+(less-ge)/2;
                if(A[i]+A[mid]>=target)
                    ge=mid;
                else{
                    less=mid;
                }
            }
            count+=ge+1;
            if(sum)
                (*sum)+=A[i]*(ge+1)+A_ruiseki[ge];
        }
    }
    return count;
}
int main(void){
    int i;
    int64_t less,ge=0,nyan,wa;
    if(scanf("%d%"SCNd64,&N,&M)!=2) return 1;
    for(i=0;i<N;i++){
        if(scanf("%"SCNd64,&A[i])!=1) return 1;
    }
    qsort(A,N,sizeof(*A),cmp);
    A_ruiseki[0]=A[0];
    for(i=1;i<N;i++)
        A_ruiseki[i]=A_ruiseki[i-1]+A[i];
    less=A[0]*2+1;
    while(less-1>ge){
        int64_t mid=ge+(less-ge)/2;
        if(gcount(NULL,mid)>=M)
            ge=mid;
        else
            less=mid;
    }
    nyan=gcount(&wa,ge);
    printf("%" PRId64 "\n",wa-(nyan-M)*ge);
    return 0;
}

Measured memory_bytes: 1788
//libs

#include <bits/stdc++.h>

//other stuff

using namespace std;

//function call

//main

int main () {
	int a,b,c,s2,s3,s1,g=0;
	cin >> a >> b >> c;
	if (a==b&&c==b&&a%2==0) {
        	cout<<-1<<endl;
        	return 0;
    	}
    	while (a%2==0&&b%2==0&&c%2==0) {
		g++;
		s1 = (b/2)+(c/2);
		s2 = (c/2)+(a/2);
		s3 = (a/2)+(b/2);
        	a=s1;
        	b=s2;
        	c=s3;
    	}
    	cout<<g<<endl;	
return 0;
}

//functions



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int top = 0, S[1000];

void push(int x) {
  S[++top] = x;
}

int pop(void) {
  top--;
  return S[top+1];
}

int main(void) {
  int a, b;
  top = 0;
  char s[100];
  while(scanf("%s",s) != EOF) {
    if(s[0] == '+') {
      a = pop();
      b = pop();
      push(a + b);
    } else if(s[0] == '-') {
      b = pop();
      a = pop();
      push(a - b);
    } else if(s[0] == '*') {
      a = pop();
      b = pop();
      push(a * b);
    } else {
      push(atoi(s));
    }
  }
  printf("%d\n",pop());

  return 0;
}


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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define int long long
#define f(i,a,b) for(int i=(a);i<(b);i++)
const int MOD=1e9+7;
using pii=std::pair<int,int>;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); <-- PUT IN main()/solve()!

using namespace std;

int x,y,fact[1000005]={0};
map<pii,int> ans;
class DKnight {
public:
	void solve(std::istream& in, std::ostream& out) {
		in >> x >> y;
		if(2*y<x||y>2*x||(x+y)%3!=0)
			out << "0\n";
		else
		{
			int n=((x+y)/3);
			int steps=y-n;
			if(steps==0)
			{
				out << "1\n";
				return;
			}
			fact[0]=1;
			f(i,1,n+2)
			{
				fact[i]=(fact[i-1]*i);
				if(fact[i]>=MOD)
					fact[i]%=MOD;
			}
			int ans=(((fact[n]*mod_inv(fact[steps]))%MOD)*mod_inv(fact[n-steps]))%MOD;
			//out << steps << "\n";
			out << ans%MOD << "\n";
		}
	}
	int mod_inv(int x)
	{
		return mod_exp(x,MOD-2);
	}
	int mod_exp(int x,int p)
	{
		int result=1;
		while(p>0)
		{
			if(p&1)
			{
				result*=x;
				if(result>=MOD)
					result%=MOD;
			}
			x*=x;
			if(x>=MOD)
				x%=MOD;
			p/=2;
		}
		return result%MOD;
	}
};


int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	DKnight solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 6400
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

const ll INF = 1LL << 50;

const ll mod = 1000000007;

int main() {
  ll n;
  cin >> n;
  vector<string> ss(n);
  vll acc(n, 0);
  ll ans = 0;
  rep(i, n) {
    ll t;
    cin >> ss[i];
    cin >> t;
    ans += t;
    acc[i] += t;
    if (i > 0) acc[i] += acc[i - 1];
  }
  string x;
  cin >> x;
  ll idx = -1;
  rep(i, n) {
    if (ss[i] == x) {
      idx = i;
      break;
    }
  }

  cout << ans - acc[idx] << endl;

  return 0;
}
 

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





char S[100001];
long long dp[100001][13];

int main() {
  map<char, int> m = {
    {'1', 1},
    {'2', 2},
    {'3', 3},
    {'4', 4},
    {'5', 5},
    {'6', 6},
    {'7', 7},
    {'8', 8},
    {'9', 9},
    {'?', -1}
  };
  scanf("%s", S);
  dp[0][0] += 1;

  rep(i, strlen(S)) {
    int n = m[S[i]];
    rep(j, 10) {
      if (n != -1 && n != j) continue;
      rep(ki, 13) {
        dp[i + 1][(ki * 10 + j) % 13] += dp[i][ki];
      }
    }
    rep(j, 13) dp[i + 1][j] %= MOD;
  }
  cout << dp[strlen(S)][5] << endl;
  return 0;
}


Measured memory_bytes: 10496
N = int(input())

def f(a, b, c):
    return a**2 + b**2 + c**2 + a*b + b*c + c*a

ans = [0] * N

for x in range(1, 101):
    for y in range(x, 101):
        for z in range(y, 101):
            p = f(x, y, z)
            if (p <= N):
                if (x == y and y == z):
                    ans[p-1] += 1
                elif (x == y or y == z or z == x):
                    ans[p-1] += 3
                else:
                    ans[p-1] += 6

for a in ans:
    print(a)

Measured memory_bytes: 9268
import sys
input = sys.stdin.readline
INF = 10**10
MOD = 10**9 + 7
sys.setrecursionlimit(100000000)
from functools import lru_cache
from itertools import permutations
from math import factorial


def main():
    s = input()
    n = len(s)
    ans = 0
    for i in range(n):
        if i%2 == 0:
            if s[i] == 'p':
                ans -= 1
        else:
            if s[i] == 'g':
                ans += 1
    
    print(ans)

if __name__=='__main__':
    main() 

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

using namespace std;
 
/// ----------------------------- (Debug) ------------------------------
#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 {
#ifndef ONLINE_JUDGE
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
};
vector<char*> tokenizer(const char* args) {
  char *token = new char[111]; strcpy(token, args); token = strtok(token, ", ");
  vector<char*> v({token});
  while(token = strtok(NULL,", ")) v.push_back(token);
  return reverse(v.begin(), v.end()), v;
}
void debugg(vector<char*> args) { cerr << "\b\b "; }
template <typename Head, typename... Tail>
void debugg(vector<char*> args, Head H, Tail... T) {
  debug() << " [" << args.back() << ": " << H << "] ";
  args.pop_back(); debugg(args, T...);
}
#define harg(...) #__VA_ARGS__
#ifndef ONLINE_JUDGE
#define dbg(...) { debugg(tokenizer(harg(__VA_ARGS__, \b\t-->Line)), __VA_ARGS__, __LINE__); cerr << endl;}
#else
#define dbg(...) { }
#endif
/// -----------------------------------------------------------------------
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi; 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)    
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define print(x) cout << x << "\n";
#define REP(i,a,b) for(i=a;i<=b;i++)
#define RAP(i,a,b) for(i=a;i>=b;i--)
#define spa <<" "<<
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
ll mod=998244353;
const int MX=0x3f3f3f3f;

int main(){
    IOS;
    int n,i,k;
    cin>>n>>k;
    vector<ll> v(n+1);
    REP(i,0,n-1) cin>>v[i]; 
    int flag=0;
    while(1){
    	vector<ll> ne(n+1);
    	flag=0;
    	REP(i,0,n-1){
    		ne[max(i-v[i],1ll*0)]++;
    		ne[min(i+v[i]+1,1ll*n)]--;
 	   }
 	   dbg(ne);
 	   REP(i,0,n-1) {
 	   		if(i>0) {
 	   			ne[i]+=ne[i-1];
 	   		}
 	   		if(ne[i]!=n) flag=1;
 	   }
 	   k--;
 	   v=ne;
 	   if(!flag||!k) break;
	}
	REP(i,0,n-1) cout<<v[i]<<" ";
    return 0;   
}




Measured memory_bytes: 6352
N,M = [int(zz) for zz in input().split()]
li = [[int(zz) for zz in input().split()] for _ in range(N)]

li.sort()

ans = 0
for i in range(N):
    if li[i][1] < M:
        ans += li[i][0]*li[i][1]
        M -= li[i][1]
    else:
        ans += li[i][0]*M
        print(ans)
        exit()


Measured memory_bytes: 60632
import Data.List
import Control.Monad
import qualified Data.IntMap as IM
import Data.Maybe

type Map = IM.IntMap Int

solve :: [(Int, [Int])] -> [Map] -> [Bool]
solve pss [] = []
solve pss (m:ms) = res : solve pss ms
  where res = and $ check pss m

check :: [(Int, [Int])] -> Map -> [Bool]
check [] _ = []
check ((p, ss):pss) m = res : check pss m
  where res = calc ss m `mod` 2 == p

calc :: [Int] -> Map -> Int
calc [] _ = 0
calc (s:ss) m = res + calc ss m
  where res = fromJust $ IM.lookup s m

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  kss <- replicateM m $ tail . map read . words <$> getLine :: IO [[Int]]
  ps <- map read . words <$> getLine :: IO [Int]
  let pss = zip ps kss
  let ms = IM.fromList . zip [1..] <$> replicateM n [0, 1]
  print . length . filter (==True) $ solve pss ms

Measured memory_bytes: 1020
import java.util.*;
public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}//standard output
        static void myerr(Object t){System.err.println(t);}//standard error
        static String getStr(){return sc.next();}
        static int getInt(){return Integer.parseInt(getStr());}
        static long getLong(){return Long.parseLong(getStr());}
        static boolean hasNext(){return sc.hasNext();}
        static char[] mySplit(String str){return str.toCharArray();}
        static String toKaigyo(String[] list){return String.join("\n",list);}
        static String toHanSp(String[] list){return String.join(" ",list);}
        public static void main(String[] args){
          long X = getLong();
          long first = 100;
          long output = 0;
          while(first < X){
            first = (long)Math.floor(first * 1.01);
            output++;
          }
          myout(output);
        }
        //Method addition frame start

        //Method addition frame end
}


Measured memory_bytes: 35716
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <cmath>

using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

using ll = long long int;

int main(void) {
  int k;
  cin >> k;
  if (k % 2 == 0)
    std::cout << pow(k / 2, 2) << std::endl;
  else
    std::cout << k / 2 * ceil((float)k / (float)2) << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007 // 10^9+7
#define INF 10000000000
#define P pair<int,int>
int n,k,ans=0;;
signed main(){
    cin>>n>>k;
    int time=n/k;
    ans=time*time*time;
    int ev=(n+k/2)/k;
    if(k%2==0)ans+=ev*ev*ev;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <numeric>
#include <list>
#include <iomanip>
 
#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <forward_list>
 
#define cauto const auto&
#else
 
#endif
 
using namespace std;
 
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll;
typedef vector<vector<long long> > vvll;
 
#define VV(T) vector<vector< T > >
 
template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}
 
template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}
 
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i,n) _rep2((i),0,(n))
#define _rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define fi first
#define se second
#define mkp make_pair
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif
 
#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)


int main() {
    int N, K;
    cin >> N >> K;
    if (K == 1) {
        cout << 0 << endl;
        return 0;
    }
    cout << (N-K) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin >> n;
    if(n>=64){
        cout << 64 << endl;
    }
    else if(n>=32){
        cout << 32 << endl;
    }
    else if(n>=16){
        cout << 16 << endl;
    }
    else if(n>=8){
        cout << 8 << endl;
    }
    else if(n>=4){
        cout << 4 << endl;
    }
    else if(n>=2){
        cout << 2 << endl;
    }
    else cout << 1 << endl;
}


Measured memory_bytes: 256
//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL<<60LL)
typedef long long ll;

using namespace std;



int main() {
	string s; cin >> s;
	vector<char> v(s.size());
	rep(i, s.size()) {
		v[i] = s[i];
	}
	sort(all(v));
	bool ans = true;
	ll co = 1;
	rep(i, v.size() - 1) {
		if (v[i] == v[i + 1]) co++;
		else {
			if (co % 2 == 0) {
				co = 1;
			}
			else {
				ans = false;
				break;
			}
		}
	}
	if (co % 2 == 1) ans = false;
	if (ans) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
cin>>S;
int longest[S.size()]={0},cnt=0;
for(int i=0;i<S.size();i++){
    if(S[i]=='A'||S[i]=='C'||S[i]=='G'||S[i]=='T'){
        cnt++;
        longest[i]=cnt;
    }
    else cnt=0;
}
sort(longest,longest+(S.size()));
cout<<longest[(S.size())-1];
return 0;
}


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

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        
        String[] input = br.readLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int a = Integer.parseInt(input[1]);
        int b = Integer.parseInt(input[2]);
        int ans = 0;
        
        for(int i = 1; i <= n; i++){
            
            int num = i;
            int total = 0;
            boolean isLast = false;
            
            while(num > 0){
                total += num % 10;
                num /= 10;
            }
            
            if(a <= total && total <= b){
                ans += i;
            }
            
        }
        
        out.println(ans);
        out.close();
        
    }
}

Measured memory_bytes: 32568
<?php
  list($n) = explode(" ", trim(fgets(STDIN)));

  $a = array_map('intval', explode(" ", trim(fgets(STDIN))));

  $mod = 1000000007;
  $ans = 0;
  for($i=0; $i<=60; $i++){
    $zero = 0;
    $one = 0;
    $bit = pow(2, $i);
    for($j=0; $j<count($a); $j++){
      $xor = $a[$j] & $bit;
      //echo $a[$j]." ".$bit." ".$xor.PHP_EOL;
      if($xor == 0){
        $zero++;
      }else{
        $one++;
      }
    }
    //echo $zero." ".$one.PHP_EOL;
    $bit = $bit%$mod;
    $bit = $bit*$zero%$mod;
    $bit = $bit*$one%$mod;
    $ans = $ans+$bit%$mod;
  }
  
  echo $ans%$mod;

Measured memory_bytes: 40936
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String lis[] = {
            "dream", "dreamer", "erase", "eraser"
        };
        int slen = s.length();
        
        while (true) {
            if (slen == 0) {
                System.out.println("YES");
                return;
            }
            boolean updated = false;
            for (int i = 0; i < 4; ++i) {
                String k = lis[i];
                if (slen >= k.length()) { //  && s.substring(s.length() - k.length(), s.length()).equals(k)) {
                    boolean ok = true;
                    for (int j = k.length() - 1; j >= 0; --j) {
                        if (k.charAt(j) == s.charAt(slen - k.length() + j)) {
                            // ok
                        } else {
                            ok = false;
                            break;
                        }
                    }
                    if (ok) {
                        slen = slen - k.length();
                        updated = true;
                        break;
                    }
                } else {
                    continue;
                }
            }
            if (!updated) {
                System.out.println("NO");
                return;
            }
        }
    }
}


Measured memory_bytes: 25828
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
#define int long long
using namespace std;
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
char a[114][114];
int b[114],c[114];
signed main(){
	ic(h) ic(w)
	rep(0,i,h)rep(0,j,w)cin>>a[i][j];
	int sum=0;
	rep(0,i,h){
		sum=0;
		rep(0,j,w){
			if(a[i][j]=='#'){	
				sum++;
			}
		}
		if(sum==0){
			b[i]=1;
		}
	}
	rep(0,i,w){
		sum=0;
		rep(0,j,h){
			if(a[j][i]=='#'){	
				sum++;
			}
		}
		if(sum==0){
			c[i]=1;
		}
	}
	rep(0,i,h){
		sum=0;
		rep(0,j,w){
			if(b[i]==0&&c[j]==0){
				cout<<a[i][j];
				sum++;
			}	
		}
		if(sum>0)cout<<endl;	
	}
}				


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cstring>
#include <cmath>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define io() ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define fi first
#define se second
#define IN(i,l,r) (l<i&&i<r)
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define v(T) vector<T>
#define p(T, N) pair<T, N>
#define tp(A, B, C) tuple<A, B, C>
#define ii p(int, int)
#define vi v(int)
#define vii v(p(int, int))
#define vvi v(v(int))
#define vl v(long long)
#define vll v(p(long long, long long))
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define qsortsi(v) sort(v.begin(), v.end(), [](pair<int, int> a, pair<int, int> b){return a.se < b.se;})
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(make_pair(a, b))
#define pt(a, b, c) emplace_back(make_tuple(a, b, c))
#define elif else if
#define fori(i, n) for(ll i = 0; i < n; ++i)
#define foris(i, a, b) for(ll i = a; i < b; ++i)
#define forise(i, a, b) for(ll i = a; i <= b; ++i)
#define ford(i, n) for(ll i = n; i >= 0; --i)
#define fords(i, a, b) for(ll i = a; i >= b; --i)
#define fordse(i, a, b) for(ll i = a; i > b; --i)
#define fora(i, a) for (auto &i: a)
#define rev(a) reverse(a.begin(), a.end())
#define revf(a, b, c) (reverse(a.begin() + b, a.begin() + c))
#define digits(i) (int)((log(i)/(log(10))+1)
#define umap unordered_map
#define uset unordered_set
#define pq(T) priority_queue<T>
#define rpq(T) priority_queue<T, vector<T>, greater<T> >
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
const int mod = 1000000007;



int main() {
  io();
  
  string a, b;
  int n;
  cin >> n >> a >> b;
  string ret = "";
  fori(i, n) {
  	ret += a[i];
    ret += b[i];
  }
  cout << ret;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define fsp(x) fixed << setprecision(x)
#define xout cerr
const ll inf = LLONG_MAX;
const long double pi = acosl(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    //const ll p = 1e9 + 7;
    //const ll p = 998244353;
    
    clock_t start = clock();
    
    ll d;
    cin >> d;
    vector<ll> c(26);
    for (ll i = 0; i < 26; i++) cin >> c[i];
    vector<vector<ll>> s(d, vector<ll>(26));
    for (ll i = 0; i < d; i++) {
        for (ll j = 0; j < 26; j++) {
            cin >> s[i][j];
        }
    }
    
    vector<ll> w(0);
    for (ll i = 0; i < 26; i++) {
        w.push_back(i);
        for (ll j = 0; j < c[i]; j++) {
            w.push_back(i);
        }
    }
    ll m = w.size();
    
    random_device rand;
    vector<ll> ans(d);
    for (ll i = 0; i < d; i++) ans[i] = w[rand() % m];
    
    auto calc_score = [&] () {
        vector<ll> v(26, -1);
        ll ret = 0;
        for (ll i = 0; i < d; i++) {
            v[ans[i]] = i;
            ret += s[i][ans[i]];
            for (ll j = 0; j < 26; j++) {
                ret -= c[j] * (i - v[j]);
            }
        }
        return ret;
    };
    
    ll score = calc_score();
    
    auto f = [&] () {
        double prob = - pow((clock() - start) / CLOCKS_PER_SEC / 1.95, 8) + 1;
        return ((double)rand() / RAND_MAX < prob);
    };
    
    while (clock() - start <= 1.95 * CLOCKS_PER_SEC) {
        ll change_at1 = rand() % d, into1 = w[rand() % m];
        ll change_at2 = rand() % d, into2 = w[rand() % m];
        ll memo1 = ans[change_at1], memo2 = ans[change_at2];
        ll memo_score = score;
        ans[change_at1] = into1; ans[change_at2] = into2;
        score = calc_score();
        if (score < memo_score && clock() - start > CLOCKS_PER_SEC) {
            ans[change_at1] = memo1; ans[change_at2] = memo2;
            score = memo_score;
        }
        else if (score < memo_score && f()) {
            ans[change_at1] = memo1; ans[change_at2] = memo2;
            score = memo_score;
        }
    }
    
    for (ll i = 0; i < d; i++) cout << ans[i] + 1 << endl;
    xout << score << endl;
}

Measured memory_bytes: 4076
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <iostream>

using namespace std;
typedef long long ll;
ll a,b,c,i,j,k,n,m,t,r,s,p;
ll arr[100005];
bool cmp(const int a,const int b){
	return a>b;
}
int main(){
	scanf("%lld%lld%lld",&n,&m,&a);
	if(m>n)
		n=m;
	a=(a-1)/n+1;
	printf("%lld",a);
	return 0;
}


Measured memory_bytes: 256
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            if (input[0] == '7' || input[1] == '7' || input[2] == '7')
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }
    }
}


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

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;


int x,a;

int main(){
  cin >> x >> a;
  if(x<a)cout << 0 << endl;
  else cout << 10 << endl;
}

Measured memory_bytes: 256
def step(num):
	a = 1
	b = 1
	for i in range(1,num):
		c = a
		a = b
		b += c
	return b

def main():
	data = input().split()
	person = 0
	road = 1
	for i in range(int(data[1])):
		a = int(input())
		if a - person == 0:
			print(0)
			return
		length = a - 1 - person
		road_1 = step(length)
		road *= (road_1 % 1000000007)
		person = a + 1
	length = int(data[0]) - person
	road_1 = step(length)
	road *= (road_1 % 1000000007)
	print(road % 1000000007)
	return

if __name__ == "__main__":
	main()

Measured memory_bytes: 3064
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <bits/stdc++.h>

using namespace std;

int main()
{
	std::ios::sync_with_stdio(false);
	long long n, x, t;
	cin >> n >> x >> t;
	cout << (n + x - 1) / x * t << endl;
	return 0;
}


Measured memory_bytes: 3644
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class Program
{
    static void Main()
    {
        var VE = ReadLine().Split().Select(int.Parse).ToArray();
        var f = new Dinic(VE[0]);
        for (int i = 0; i < VE[1]; i++)
        {
            var line = ReadLine().Split().Select(int.Parse).ToArray();
            f.AddEdge(line[0],line[1],line[2]);
        }
        WriteLine(f.MaxFlow(0,VE[0]-1));
    }
}

class FEdge
{
    public int to;
    public int capacity;
    public int reverse;
}

public class Dinic
{
    List<FEdge>[] graph;
    int[] level;
    int[] iter;

    public Dinic(int V)
    {
        graph = new List<FEdge>[V];
        for (int i = 0; i < V; i++)
        {
            graph[i] = new List<FEdge>();
        }
        level = new int[V];
        iter = new int[V];
    }

    public void AddEdge(int from, int to, int capacity)
    {
        graph[from].Add(new FEdge { to = to, capacity = capacity, reverse = graph[to].Count });
        graph[to].Add(new FEdge { to = from, reverse = graph[from].Count - 1 });
    }

    void BFS(int s)
    {
        for (int i = 0; i < level.Length; i++)
        {
            level[i] = -1;
        }
        var q = new Queue<int>();
        level[s] = 0;
        q.Enqueue(s);
        while (q.Count != 0)
        {
            var v = q.Dequeue();
            for (int i = 0; i < graph[v].Count; i++)
            {
                var e = graph[v][i];
                if (e.capacity > 0 && level[e.to] < 0)
                {
                    level[e.to] = level[v] + 1;
                    q.Enqueue(e.to);
                }
            }
        }
    }

    int DFS(int v, int t, int f)
    {
        if (v == t) return f;
        while(iter[v]<graph[v].Count)//for (ref int i = ref iter[v]; i < graph[v].Count; i++)
        {
            var e = graph[v][iter[v]];//var e = graph[v][i];
            if (e.capacity > 0 && level[v] < level[e.to])
            {
                var d = DFS(e.to, t, Math.Min(f, e.capacity));
                if (d > 0)
                {
                    e.capacity -= d;
                    graph[e.to][e.reverse].capacity += d;
                    return d;
                }
            }
            iter[v]++;//
        }
        return 0;
    }

    public int MaxFlow(int s, int t)
    {
        var flow = 0;
        while (true)
        {
            BFS(s);
            if (level[t] < 0) return flow;
            for (int i = 0; i < iter.Length; i++)
            {
                iter[i] = 0;
            }
            var f = 0;
            while ((f = DFS(s, t, int.MaxValue)) > 0)
            {
                flow += f;
            }
        }
    }
}



Measured memory_bytes: 20780
//https://atcoder.jp/contests/abc149/tasks/abc149_d
//D - Prediction and Restriction
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
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 main() {
#if LOCAL&01
    std::ifstream in("./test/sample-1.in"); //input.txt
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll N,K; cin>>N>>K;
    ll R,S,P; cin>>R>>S>>P;
    string T; cin>>T;
    vector<vector<ll>> dp(2,vector<ll>(N,0));
    auto get_score = [&](char c)->ll{
        if(c=='r') return P;
        if(c=='s') return R;
        if(c=='p') return S;
        assert(0);
        return 0;
    };
    for(ll i=0;i<K;++i){
        dp[0][i] = get_score(T.at(i));
    }
    FOR(j,0,K){
        for(ll i=j+K;i<N;i+=K){
            ll nxt=i;
            ll cur=i-K;
            if(T.at(cur)==T.at(nxt)){
                dp[0][nxt] = dp[1][cur] + get_score(T.at(nxt));
                dp[1][nxt] = max(dp[0][cur],dp[1][cur]);
            }else{
                dp[0][nxt] = max(dp[0][cur],dp[1][cur]) + get_score(T.at(nxt));
                dp[1][nxt] = max(dp[0][cur],dp[1][cur]);
            }
        }
    }
    ll ans=0;
    for(ll j=0;j<K;++j){
        ans += max(dp[0][N-1-j],dp[1][N-1-j]);
    }
    cout<<ans<<endl;
    return 0;
}

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

int main (){
  int a, b;
  std::cin >> a >> b;
  auto d = a/b;
  auto r = a%b;
  auto f = static_cast<double>(a) / b;
  std::cout << std::setprecision(20) << std::fixed;
  std::cout << d << " " << r << " " << f << std::endl;
}



Measured memory_bytes: 3292
import collections

h,w=map(int,input().split())

r=[list(map(int,input().split())) for _ in range(10)]

route={i:10**3 for i in range(10)}
route[1]=0
nonFixPosi=set([0,2,3,4,5,6,7,8,9])
FixPosi=set([1])

for _ in range(11):
  for i in nonFixPosi:
    temp=[route[i]]
    for j in FixPosi:
      temp.append(r[i][j]+route[j])
    route[i]=min(temp)
  
  minKey=[]
  minValue=10**4
  for i in nonFixPosi:
    if route[i]==minValue:
      minKey.append(i)
    elif route[i]<minValue:
      minKey=[i]
      minValue=route[i]
  for item in minKey:
    nonFixPosi.remove(item)
    FixPosi.add(item)
  if len(nonFixPosi)<=0:
    break
    
result=[]
for _ in range(h):
  result+=list(map(int,input().split()))
k=collections.Counter(result)
#print(k)
val=0
for i in range(10):
  val+=k[i]*route[i]

print(val)

Measured memory_bytes: 3836
import numpy as np
from decimal import Decimal

N, K = map(int, input().split())
p = np.array(list(map(int, input().split())))

if N==1:
    print((p.max() + 1) / Decimal(2))
elif N==K:
    print((p.sum() + K) / Decimal(2))
else:
    p = np.cumsum(p)

    ans = []
    for i in range(N - K):
        ans.append(p[i + K]-p[i])

    ans = (max(ans) + K) / Decimal(2)

    print(ans)

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

int main(void){
    int a,b;
    cin >> a >> b;
    int k = (a+b)/2;
    if(abs(a-k) == abs(b-k)){
        cout << k << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

long gcd(int m, int n) {
    if (m % n == 0) return n;
    else return gcd(n, m % n);
}

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

int getMinimimTimes(int a, int b) {
    // find least n at which a^n % b == 1
    int k = a;
    int n = 1;
    while(1) {
        if (a % b == 1) break;
        a *= k;
        a %= b;
        n++;
    }
    return n;
}

int main() {
    int a,b,c,d,e,f;
    while (cin>>a>>b>>c>>d>>e>>f,a+b+c+d+e+f) {
        int p, q, r;
        p = getMinimimTimes(a,b);
        q = getMinimimTimes(c,d);
        r = getMinimimTimes(e,f);
        long s;
        s = lcm(p,q);
        s = lcm(s, r);
        cout << s << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#ABC144 B
N=int(input())
S=input()
#print(N)
result=0

for i in range(N-2):
    if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
        #print(i)
        result+=1
    else:
        #print("after"+str(i))
        p=1

print(result)

Measured memory_bytes: 2940
#include <iostream>
//#include <iomanip>
//#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
//#include <vector>
#include <string>
//typedef long long LL;
using namespace std;

int main(){
    string s;
    string t;
    cin >> s >> t;
    cout << t << s << endl;
}


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

int a[10002]={0}, b[101][101]={0};

int main(){
    int h, w, n;
    cin >> h >> w >> n;
    for(int i=1;i<=n;++i)cin >> a[i];

    int y=0, x=0, c=1;
    bool inc = true;
    for(int i=0;i<h*w;++i){
        b[y][x] = c;
        a[c]--;
        if(a[c] <= 0)c++;
        if(inc){
            x++;
            if(x >= w){
                x = w-1;
                inc = false;
                y++;
            }
        }else{
            x--;
            if(x < 0){
                x = 0;
                inc = true;
                y++;
            }
        }
    }

    for(int i=0;i<h;++i){
        for(int j=0;j<w;++j){
            cout << b[i][j];
            if(j == w-1)cout << endl;
            else cout << ' ';
        }
    }

    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define SORTR(v,n) sort(v, v+n, greater<int>());
// #define int long long    // %d=>%lld
#define pb push_back
#define INF 100000000
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;

int a;
int b;




signed main(){
    scanf("%d", &a);
    scanf("%d", &b);

    if(a+b<10){
        printf("%d\n", a+b);
    }else{
        printf("error\n");
    }

    return 0;
}

Measured memory_bytes: 256
n = int(input())
s = input()
total_triplets = sum(int(val=="R") for val in s)*sum(int(val=="G") for val in s)*sum(int(val=="B") for val in s)
num_missing = 0
for centre_point in range(1, n-1):
  for halfwidth in range(1, 1+min(centre_point, n-centre_point-1)):
    if s[centre_point-halfwidth] != s[centre_point]:
      if s[centre_point] != s[centre_point+halfwidth]:
        if s[centre_point-halfwidth] != s[centre_point+halfwidth]: num_missing += 1
print(total_triplets-num_missing)

Measured memory_bytes: 9212
while line = gets
	num = []
	num = line.split(nil).map{|n| n.to_i}.sort!
	avoid  = [num[0],num[1]]
	while num[0] != num[1]
		num[1] = num[1] - num[0]
		num.sort!
	end
	max = num[0]
	x = avoid[0] / max
	y = avoid[1] / max
	min = x * y * max
	puts "#{max} #{min}"
end
	

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

int main()
{
    /* ------- 宣言と入力 ------- */

    int H, N;

    cin >> H >> N;

    int A[N];
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }

    /* ------- 計算 ------- */

    for (int i = 0; i < N; i++)
    {
        H -= A[i];
    }

    if (H <= 0)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 640
fun main(args: Array<String>) {
    val s = read()
    val t = read()

    if (t.substring(0, s.length) == s) {
        println("Yes")
    } else {
        println("No")
    }


}

private fun read() = readLine()!!

private fun readInt() = read().toInt()

private fun readLong() = read().toLong()

private fun readDouble() = read().toDouble()

private fun readListString() = read().split(" ")

private fun readListInt() = readListString().map { it.toInt() }

private fun readListLong() = readListString().map { it.toLong() }

private fun readListDouble() = readListString().map { it.toDouble() }

private fun readMatrixString(n: Int): List<List<String>> {
    val matrix = mutableListOf<List<String>>()
    for (i in 0 until n) {
        val list = readListString()
        matrix.add(list)
    }
    return matrix
}

private fun readMatrixInt(n: Int): List<List<Int>> {
    val matrix = mutableListOf<List<Int>>()
    for (i in 0 until n) {
        val list = readListInt()
        matrix.add(list)
    }
    return matrix
}

private fun readMatrixDouble(n: Int): List<List<Double>> {
    val matrix = mutableListOf<List<Double>>()
    for (i in 0 until n) {
        val list = readListDouble()
        matrix.add(list)
    }
    return matrix
}

private fun readMatrixLong(n: Int): List<List<Long>> {
    val matrix = mutableListOf<List<Long>>()
    for (i in 0 until n) {
        val list = readListLong()
        matrix.add(list)
    }
    return matrix
}



Measured memory_bytes: 34552
#include<iostream>
#include<vector>
using namespace std;
int main()
{
  int p,q;
  while(cin>>p>>q){
    vector<int>r,used(q,0);
    p%=q;
    while(!used[p]){
      if(p==0)break;
      used[p]=1;
      r.push_back(p);
      p*=10;
      cout<<p/q;
      p%=q;
    }
    if(p!=0){
      puts("");
      bool f=false;
      for(int i=0;i<r.size();i++){
	if(r[i]==p)f=true;
	cout<<(f?"^":" ");
      }
    }
    puts("");
  }
}

Measured memory_bytes: 5200
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(ll i=0;i<N;++i)
typedef long long int ll;
const ll INF = 1<<30;

int main(){
    ll N; cin >> N;
    bool AllE = true;
    rep(i,N){
        ll a; cin >> a;
        if(a%2) AllE = false;
    }
    if(AllE) cout << "second" << endl;
    else cout << "first" << endl;
}

Measured memory_bytes: 384
N, Y = input().split()
N = int(N)
Y = int(int(Y)/1000)
flag = 0

for x in range(Y//10+1):
  for y in range((Y - 10 * x)//5 +1):
      if x * 10 + y * 5 + (N - x - y) == Y:
        print("%d %d %d" %(x, y, N-x-y))
        flag = 1
        break
  if flag == 1:
    break

if flag == 0:
  print("-1 -1 -1")

Measured memory_bytes: 40684
A, B, C, D = gets.split.map(&:to_i)

lcm = C.lcm(D)

# Bまで
bc = B/C
bd = B/D
blcm = B/lcm

ans_b = B - (bc+bd-blcm)

# Aまで
ac = (A-1)/C
ad = (A-1)/D
alcm = (A-1)/lcm

ans_a = (A-1) - (ac+ad-alcm)

# B - A
puts ans_b - ans_a

Measured memory_bytes: 1788
#include<stdio.h>

int main(){
  
  int a,b,c;
  int temp;
  
  scanf("%d %d %d",&a,&b,&c);
  
  temp=a;
  a=b;
  b=temp;
  
  temp=a;
  a=c;
  c=temp;
  
  printf("%d %d %d",a,b,c);
  
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  int q;
  cin >> q;
  while (q--) {
    int com, b, e;
    cin >> com >> b >> e;
    if (com == 0) {
      cout << *min_element(A.begin() + b, A.begin() + e) << endl;
    } else if (com == 1) {
      cout << *max_element(A.begin() + b, A.begin() + e) << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 3092
int main()
{
	/* ??\?????¨ */
	int input;
	
	/* ????????¨ */
	int out[3];
	
	/* ????\???¨ */
	int in_count;
	int out_count;
	int temp;
	
	/* ????????? */
	input = 0;
	temp = 0;
	
	/* ??\????????? */
	for( in_count = 0; in_count < 3; in_count++ ){
		scanf( "%d", &input );
		out[in_count] = input;
	}
	
	/* ?????? */
	for( in_count = 0; in_count < 2; in_count++ ){
		for( out_count = 0; out_count < 2; out_count++ ){
			if( out[out_count + 1] < out[out_count] ){
				temp = out[out_count + 1];
				out[out_count + 1] = out[out_count];
				out[out_count] = temp;
			}
			else{
				/* ???????????? */
			}
			temp = 0;
		}
	}
	
	/* ?????? */
	printf( "%d %d %d\n", out[0], out[1], out[2] );
	return 0;
	
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define pf push_front
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 

int main() {
	string s;
	cin >> s;
	if(s == "Sunny") cout << "Cloudy" << endl;
	else if(s == "Cloudy") cout << "Rainy" << endl;
	else cout << "Sunny" << endl;
	return 0;
}



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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

int n, t;

int main() {
    cin >> n;
    int mi = 1e9;
    int mx = 1;
    for (int i = 0; i < n; ++i) {
        cin >> t;
        mi = min(mi, t);
        mx = max(mx, t);
    }
    cout << mx - mi << endl;
    return 0;
}


Measured memory_bytes: 3548
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<string.h>
#include <iomanip>
#include <sstream>
using namespace std;

int main() {
  int N;
  long long ans = 0;
  long long sum = 0;

  cin >> N;

  vector<long long> A(N);
  vector<long long> B(N);
  for(int i = 0; i < N; i++){
    cin >> A[i];
    B[i] = A[i]-(i+1);
  }

  // for(int i = 0; i < N; i++){
  //   cout << B[i] << ", ";
  // }
  // cout << endl;

  sort(B.begin(), B.end());

  long long center;
  if(N % 2 == 1){
    center = B[N/2];
  }else{
    center = (B[N/2] + B[N/2-1])/2;
  }
  // cout << center << endl;

  for(int i = 0; i < N; i++){
    ans += abs(B[i] - center);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	vl a(4);
	cin>>a;
	puta(sum(a)/60);
	puta(sum(a)%60);
	return 0;
}


Measured memory_bytes: 3240
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<'\n';
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;

int n,m;
vector<int> k(20),p(20);
vector<vector<int> > s(20,vector<int>(20));
int ans=0;

void dfs(int now,vector<bool> used){
  if(now==n+1){
    bool flag=true;
    FOR(i,1,m+1){
      int cnt=0;
      FOR(j,1,k[i]+1){
        if(used[s[i][j]]) cnt++;
      }
      if(cnt%2!=p[i]%2){
        flag=false;
      }
    }
    if(flag) ans++;
    return ;
  }
  vector<bool> used1(used);
  vector<bool> used2(used);
  used1[now]=true;
  used2[now]=false;
  dfs(now+1,used1);
  dfs(now+1,used2);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>n>>m;
    FOR(i,1,m+1){
      cin>>k[i];
      FOR(j,1,k[i]+1){
        cin>>s[i][j];
      }
    }
    FOR(i,1,m+1){
      cin>>p[i];
    }
    //cout_vec(p);
    /*
    FOR(i,1,m+1){
      cout<<k[i]<<'\n';
      FOR(j,1,k[i]+1){
        cout<<s[i][j]<<' ';
      }
      cout<<endl;
    }
    */
    vector<bool> used(20,false);
    dfs(1,used);
    cout<<ans<<endl;
}

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

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

	int n,m;cin >> n >> m;
	int* a = new int[n];
	int sum = 0;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		sum += a[i];
	}
	int ans = n;
	for(int i = 0; i < n; i++){
		double tmp = (double)sum/(m*4);
		if((double)a[i] < tmp){
			ans--;
		}
	}
	cout << (ans>=m?"Yes":"No") << endl;

	delete a;
	return 0;
}


Measured memory_bytes: 256
N,A,B=map(int,input().split())
S=list(input())
p=0
f=1
for (i,s) in enumerate(S):
    if s=="a":
        if p<A+B:
            print("Yes")
            p+=1
        else:
            print("No")
    if s=="b":
        if p<A+B and f<=B:
            print("Yes")
            f+=1
            p+=1
        else:
            print("No")
    if s=="c":
        print("No")


Measured memory_bytes: 4708