akhauriyash/Code-Regression huggingface dataset:
package main

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

var (
	BufferSize = 100
)

func readLine(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func scanStr(sc *bufio.Scanner) string {
	if !sc.Scan() {
		panic(nil)
	}
	return sc.Text()
}

func scanInt(sc *bufio.Scanner) int {
	if !sc.Scan() {
		panic(nil)
	}
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, BufferSize)
	sc.Buffer(buf, BufferSize)
	sc.Split(bufio.ScanWords)

	a := scanInt(sc)
	p := scanInt(sc)

	fmt.Println((a*3 + p) / 2)
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pl;
#define all(a) (a).begin(),(a).end()
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,n) for(ll (i)=(n)-1;(i)>=0;i--)
#define SHOW(x) cout << #x << ": " << x << endl;
const ll INF=1e18;
const int iINF = 1e9;
int main(){
    ll n,cnt = 0;
    double ans = 0;
    cin>>n;
    vector<double>x(n),y(n);
    rep(i,n)cin>>x[i]>>y[i];
    vector<int>num(n);
    rep(i,n)num[i] = i;
    do{
        rep(i,n-1){
            ans += sqrt(pow(x[num[i]]-x[num[i+1]],2) + pow(y[num[i]]-y[num[i+1]],2));
        }
        cnt++;
    }while(next_permutation(all(num)));
    printf("%.7f\n",ans/cnt);
}

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	int H=in(),A=in();

	out((int)ceil(H/(double)A));

	return 0;
}

Measured memory_bytes: 256
n = int(input())
r = []
g = []
b = []
s = input()
blen = 0
glen = 0
rlen = 0
for i in range(n):
    if(s[i]=='R'):
        r.append(i)
        rlen += 1
    elif(s[i]=='G'):
        g.append(i)
        glen += 1
    else:
        b.append(i)
        blen += 1

ans = 0
minus = 0
t = 0
for i in r:
    for j in g:
        mn = min(i,j)
        mx = max(i,j)

        mid2 = mx + (mx-mn)
        mid3 = mn - (mx-mn)

        if((mx-mn)%2==0):
            mid1 = mn + (mx-mn)//2
            if(mid1 >= 0 and mid1 < n):
                if(s[mid1]=='B'):
                    minus += 1
        if(mid2 >= 0 and mid2 < n):
            if(s[mid2] == 'B'):
                minus += 1
                #print("2",i,j,mid2,s[i],s[j],s[mid2])

                
        if(mid3 >= 0 and mid3 < n):
            if(s[mid3]=='B'):
                minus += 1
                #print("3",i,j,mid3,s[i],s[j],s[mid3])

        t += blen
                

ans = rlen * glen * blen
ans -= minus
print(ans)
        

Measured memory_bytes: 9280
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n ;
    cin >> n ;
    ll ans[n+1];
    memset(ans, 0, sizeof(ans));
    ll N = 10001;
    for(ll x = 1; x < n ; x++){
    	ll num = n / x;
    	for(ll y = 1; y <= num+1; y++){
    		ll m = min(num, n / y);
    		for(ll z = 1; z <= m + 1; z++){
    			ll unko = x*x+y*y+z*z+x*y+y*z+z*x;
    			if(unko > n) continue;
    			ans[unko]++;
    		}
    	}
    }
    for(int i=1;i<=n;i++){
    	cout << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;

int main() {
	int X, A, B;
	cin >> X >> A >> B;

	cout << (X - A) % B << endl;
}

Measured memory_bytes: 3600
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()

class SegmentTree(object):
    def __init__(self, A, dot, unit):
        n = 1 << (len(A) - 1).bit_length()
        tree = [unit] * (2 * n)
        for i, v in enumerate(A):
            tree[i + n] = v
        for i in range(n - 1, 0, -1):
            tree[i] = dot(tree[i << 1], tree[i << 1 | 1])
        self._n = n
        self._tree = tree
        self._dot = dot
        self._unit = unit

    def __getitem__(self, i):
        return self._tree[i + self._n]

    def update(self, i, v):
        i += self._n
        self._tree[i] = v
        while i != 1:
            i >>= 1
            self._tree[i] = self._dot(self._tree[i << 1], self._tree[i << 1 | 1])

    def add(self, i, v):
        self.update(i, self[i] + v)

    def sum(self, l, r):
        l += self._n
        r += self._n
        l_val = r_val = self._unit
        while l < r:
            if l & 1:
                l_val = self._dot(l_val, self._tree[l])
                l += 1
            if r & 1:
                r -= 1
                r_val = self._dot(self._tree[r], r_val)
            l >>= 1
            r >>= 1
        return self._dot(l_val, r_val)

from operator import add
def resolve():
    n, q = map(int, input().split())
    A = list(map(int, input().split()))
    tree = SegmentTree(A, add, 0)

    for _ in range(q):
        t, l, r = map(int, input().split())
        if t == 0:
            tree.add(l, r)
        else:
            print(tree.sum(l, r))
resolve()

Measured memory_bytes: 138320
///supercalifragilisticexpialidocious.
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <cstdlib>
#include <cctype>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <utility>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <list>
#include <bitset>
#include <complex>
using namespace std;
#define f first
#define s second
#define PB pop_back
#define pb push_back
#define mp make_pair
#define int long long
#define sz(s) (int)s.size()
#define seper(n) setprecision(n)
#define all(v) v.begin(),v.end()
#define mem(a,b) memset(a,b,sizeof a)
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
typedef long long ll;
typedef map<int , int> mii;
typedef pair<int , int> pii;
typedef map<string , int> msi;
typedef pair<int , string> pis;
typedef pair<int , pair<int , int> > piii;
const int MAXN = 1e5 + 10;
int n , m , x , y , cnt , ans , a[MAXN] , cm[MAXN];
vector<int> adj[MAXN];
bool bo[MAXN];
void dfs(int u)
{
	bo[u] = true , cm[u] = cnt;
	for(auto v : adj[u])
		if(!bo[v])
			dfs(v);
	return;
}
void dfs_all()
{
	for(int i = 0 ; i < n ; i ++)
		if(!bo[i])
			dfs(i) , cnt ++;
	return;
}
void input()
{
	cin >> n >> m;
	for(int i = 0 ; i < n ; i ++)
		cin >> a[i] , a[i] --;
	for(int i = 0 ; i < m ; i ++)
		cin >> x >> y , x -- , y -- , adj[x].pb(y) , adj[y].pb(x);
	return;
}
int32_t main()
{
	input() , dfs_all();
	for(int i = 0 ; i < n ; i ++)
		if(cm[i] == cm[a[i]])
			ans ++;
	return cout << ans << endl , 0;
}


Measured memory_bytes: 9344
#include <bits/stdc++.h>
#define int int64_t
#define rep(i, N) for(int i=0; i<N; i++)
#define repr(i, N) for(int i=N-1; i>=0; --i)
using namespace std;
//using pair = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;

//プロトタイプ宣言
//int myfunc(int, vvec);

//グローバル変数
//int N, M;
//vvec data(N, vec(M));



signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin>>n;
	if(n%2==0){
		cout<<n/2-1<<endl;
	}
	if(n%2==1){
		cout<<n/2<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<cmath>
using namespace std;

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	
	if(a+b >= c) cout << "Yes" <<endl;
	else cout << "No" <<endl;
	
	
	return 0;
}



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

data = {}
for n in range(N):
	s0 = input()
	s = ''.join(sorted(s0))
	if s in data:
		data[s] += 1
	else:
		data[s] = 1

ans = 0
for n in data.values():
	ans += (n-1)*n//2
print(ans)


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

//const long double PIL = 3.141592653589793238462643383279502884L;
//const double PI = 3.14159265358979323846;

#define sz(a) (int)((a).size())
#define all(c) (c).begin(), (c).end()
#define debug(v) {for (auto z : v) {cerr << z << ' ';} cerr << endl;}

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vll = vector<long long>;
using vii = vector<pair<int,int>>;

const ll MOD = 1e9 + 7;

int main() {
	//~ ios::sync_with_stdio(0);
	//~ cin.tie(0);
	string s; cin >> s;
	for (char c : s) {
		if (c == '7') {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}


Measured memory_bytes: 3624
import java.util.Scanner;
 
public class Main {
    private static Scanner sc;
     
    public static void main(String[] args) {
        sc = new Scanner(System.in);
        int a = sc.nextInt();
        String op = sc.next();
        int b = sc.nextInt();
         
        for (;!op.equals("?");) {
            int ans = 0;
            switch (op) {
            case "+":
                ans = a + b;
                break;
            case "-":
                ans = a - b;
                break;
            case "*":
                ans = a * b;
                break;
            case "/":
                if (a == 0) {
                    break;
                }
                ans = a / b;
            }
            System.out.println(ans);
            a = sc.nextInt();
            op = sc.next();
            b = sc.nextInt();
        }
    }
}


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

void Sort(int *x, int *y);

int main(){
    while(1){
        int n,m;    cin>>n>>m;
        if(n==0&&m==0)break;

        int a[n];   for(int i=0;i<n;i++)cin>>a[i];

        for(int i=1;i<n;i++){
            int j=i-1;

            int min=a[i];

            while(j>=0 && a[j]>min){
                swap(a[j],a[j+1]);
                j--;
            }
        }

        int sum=0;
        for(int i=n-1;i>0;i--){
            for(int j=i-1;j>=0;j--){
                //cout<<"a[i]="<<a[i]<<":"<<"a[j]="<<a[j]<<endl;

                if((a[i]+a[j])<=m && a[i]+a[j]>sum){
                    sum = a[i]+a[j];
                }
            }
        }

        if(sum>0)cout<<sum<<endl;
        else cout<<"NONE"<<endl;
    }
    return 0;
}


void Sort(int *x,int *y){
    int hoge;
    hoge=*x;
    *x=*y;
    *y=hoge;
}



Measured memory_bytes: 3032
# -*- coding: utf-8 -*-
N = int(raw_input()) #Ｎの整数を入力
A = map(int, raw_input().split()) #N個の正の整数Ａを入力
Count = 0 #何回操作したか
while True: #奇数になるまでループ
  f = 0 #奇数になったら１にする
  for i in range(N): #A[0]~A[N]まで/2をする
    if A[i] %2 != 0:f = 1 #奇数だったら1にする
    A[i]=A[i]/2 #/2をする
  if f==1:break #ループを抜ける
  Count += 1 #全ての個数が偶数なら+1
print Count #結果

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

int f(int n)
{
  return n*(n+1)/2;
}

signed main()
{
 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 int n;
 cin>>n;
 int sum = 0;
 for(int i=1;i <=n ;i++)
 {
   sum += i*f(n/i);

 }
  cout<<sum<<"\n";
 return 0;
}


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

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

void insertionSort(int A[],int n,int g) {
    for(int i=g;i<n;i++) {
        int v=A[i];
        int j=i-g;
        while(j>=0 && A[j]>v) {
            A[j+g]=A[j];
            j-=g;
            cnt++;
        }
        A[j+g]=v;
    }
}

void shellSort(int A[],int n) {
    for(int h=1;;) {
        if(h>n) break;
        G.push_back(h);
        h=3*h+1;
    }
    for(int i=G.size()-1;i>=0;i--) {
        insertionSort(A,n,G[i]);
    }
}

int main() {
    cin>>n;
    for(int i=0;i<n;i++) scanf("%d",&A[i]);
    cnt=0;

    shellSort(A,n);

    cout<<G.size()<<endl;

    for(int i=G.size()-1;i>=0;i--) {
        printf("%d",G[i]);
        if(i) printf(" ");
    }
    printf("\n");
    printf("%lld\n",cnt );
    for(int i=0;i<n;i++) printf("%d\n",A[i] );

    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef double db;

const ll mod  = 1e9+7;
const db eps  = 1e-9 ;
const ll maxn = 1e5+1;
const ll inf = LLONG_MAX;

#define mp make_pair
#define pb push_back
#define endl "\n"
#define deb(x) cout << #x << " " << x << endl

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

    ll n,sum=0;
    cin >> n;

    for(ll i=1 ; i<=n ; ++i)
    {
        for(ll j=1 ; j<=n ; ++j)
        {
            for(ll k=1 ; k<=n ; ++k)
            {
                sum += __gcd(__gcd(i,j),k);
            }
        }
    }
    
    cout << sum;
    return 0;
} 

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

using ll = long long;
int n, m;

int main() {
    while (true) {
        std::cin >> n >> m;
        if (n == 0 && m == 0) {
            return 0;
        }
        std::vector<int> vec(n);
        for (int i = 0; i < n; i++) {
            std::cin >> vec[i];
        }
        std::vector<int> a;
        for (int i = 0; i < n; i++) {
            a.push_back(vec[i]);
            for (int j = 0; j < n; j++) {
                a.push_back(vec[i] + vec[j]);
            }
        }
        a.push_back(0);

        std::sort(a.begin(), a.end());
        ll ans = 0;
        for (int r = 0; r < a.size(); r++) {
            if (a[r] > m) {
                break;
            }
            auto e = std::lower_bound(a.begin(), a.end(), m - a[r]);
            ll res;
            if (*e == m - a[r]) {
                res = m;
            }
            else {
                e--;
                res = (a[r]) + *e;
            }
            ans = std::max(ans, res);
        }
        std::cout << ans << std::endl;
    }
}



Measured memory_bytes: 10812
using System;
using System.Collections.Generic;
using System.Linq;

namespace ABC107C
{
    static class MainClass
    {

        public static void Main(string[] args)
        {


            string[] input1 = Console.ReadLine().Split(' ');
            int N = int.Parse(input1[0]);
            int K = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            var xlist = new List<int>();
            for(int i = 0; i < N; i++)
            {
                xlist.Add(int.Parse(input2[i]));
            }

            var anslist = new List<int>();
            int s = 0;
            int e = 0;
            int ans = 0;
            for(int j = 0; j < N - K + 1; j++)
            {
                s = xlist[j];
                e = xlist[j + K - 1];
                if(s<0&& e >= 0)
                {
                    if(Math.Abs(s) > Math.Abs(e))
                    {
                        ans = -s + 2 * e;
                    }
                    else
                    {
                        ans = -2 * s + e;
                    }
                }else if (s <0)
                {
                    ans = -s;
                }
                else
                {
                    ans = e;
                }
                anslist.Add(ans);
            }

            Console.WriteLine(anslist.Min());



        }



        public static long Gcd(long a, long b)
        {
            long tmp;
            // a<bにする
            if (a >= b)
            {
                tmp = a;
                a = b;
                b = tmp;
            }

            if (a == 0)
            {
                return b;
            }

            tmp = a;
            a = b % a;
            b = tmp;
            return Gcd(a, b);

        }


        public static IEnumerable<long> PF(long n)
        {
            long i = 2;
            long tmp = n;

            while (i * i <= n) //※1
            {
                if (tmp % i == 0)
                {
                    tmp /= i;
                    yield return i;
                }
                else
                {
                    i++;
                }
            }
            if (tmp != 1) yield return tmp;//最後の素数も返す
        }




    }

}






Measured memory_bytes: 21600
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)


const long long MOD = 1000000007;
//const long long MOD = 998244353;
const long long INF = 1LL << 60;


long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	unsigned r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a * g / b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}




const long double PI = 3.14159265359;
const int MAX_N = 100010;

// dp[i][j][k]:x_1,x_2…x_iからj枚選んでx_tの合計をkにするような選び方の総数
int dp[55][55][2510];


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, a; cin >> n >> a;
	VE x(n); rep(i, n)cin >> x[i];
	int X = a;
	rep(i, n)chmax(X, x[i]);
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= n; j++) {
			for (int k = 0; k <= n * X; k++) {
				// 初期状態
				if (i == 0 && j == 0 && k == 0) {
					dp[i][j][k] = 1;
				}
				// k < x[j-1]なのでそもそもkを作れない
				else if (i >= 1 && k < x[i - 1]) {
					dp[i][j][k] = dp[i - 1][j][k];
				}
				// 今度はsを作ることが可能。
				else if (i >= 1 && j >= 1 && k >= x[i - 1]) {
					dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]];
				}
				else {
					dp[i][j][k] = 0;
				}
			}
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += dp[n][i][i*a];
	}
	cout << ans << endl;
	return 0;
}

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

const int MAXN = 2e3+10;

bitset<MAXN> a[MAXN],dpl[MAXN],dpr[MAXN];

int main()
{
    int n;
    scanf("%d",&n);
    for (int i = 2;i<=n;i++)
    {
        getchar();
        for (int j = 1;j<i;j++)
        {
            a[j][i] = !(a[i][j] = getchar() - 48);
        }
        dpl[i][i] = dpr[i][i] = 1;
    }
    dpr[1][1] = dpl[1][1] = 1;
    for (int k = 1;k<=n-1;k++)
    {
        for (int i = 1;i<=n-k;i++)
        {
            int j = i + k;
            dpl[j][i] = (a[i] & dpl[j] & dpr[i+1]).any();
            dpr[i][j] = (a[j] & dpl[j-1] & dpr[i]).any();
        }
    }
    int ans = 0;
    for (int i = 1;i<=n;i++)
    if (dpl[n][i] && dpr[1][i]) ans++;
    printf("%d",ans);
    return 0;
}

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

struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;
using intpair = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define ceiv(a, b) ((int)((a) + (b) - 1)/(int)(b))
#define int long long

signed main(){
    int n; cin >> n;
    vector<int> A(n), B(n), C(n);
    rep(i,n) cin >> A[i];
    rep(i,n) cin >> B[i];
    rep(i,n) cin >> C[i];
    sort(ALL(A)); sort(ALL(B)); sort(ALL(C));
    
    vector<int> B_cnt(n, 0);
    int c = 0;
    rep(b,n){
        for(; c < n; c++){
            if(B[b] < C[c]) break;
        }
        if(B[b] < C[c]) B_cnt[b] = n - c;
    }
    
    for(int i = n-1; i > 0; i--){
        B_cnt[i-1] += B_cnt[i];
    }
    
    int ans = 0;
    int b = 0;
    rep(a,n){
        for(; b < n; b++){
            if(A[a] < B[b]) break;
        }
        if(A[a] < B[b]) ans += B_cnt[b];
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 3456
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
const int N=2e5+5;
int n;
map<string,int>m;
map<string,int>::iterator it;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin>>n;
	int mn=0;
	for(int i=0;i<n;i++){
		string str;
		cin>>str;
		m[str]++;
		mn=max(mn,m[str]);
	}
	for(it=m.begin();it!=m.end();it++){
		if((*it).second==mn){
			cout<<(*it).first<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 24576
// clang-format off
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort(all(x), greater<>())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl;
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;}
const int INF = 1e9;
const ll LINF = 1e18;
// clang-format on

void solve(long long A, long long B, long long C) {
  ANS(max(0LL, C + B - A));
}

int main() {
  long long A;
  scanf("%lld", &A);
  long long B;
  scanf("%lld", &B);
  long long C;
  scanf("%lld", &C);
  solve(A, B, C);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define mp make_pair
#define eb emplace_back

const int MAX_N = 10;
int H, W, K;
string g[MAX_N];

int check(int rf, int cf)
{
	int cnt = 0;
	for(int i=0;i<H;++i)for(int j=0;j<W;++j){
		if(rf>>i&1) continue;
		if(cf>>j&1) continue;
		if(g[i][j]=='#') cnt++;
	}
	return cnt;
}

void solve()
{
	int ans = 0;
	for(int i=0;i<(1<<H);++i)for(int j=0;j<(1<<W);++j){
		if(check(i,j) == K) ans++;
	}
	cout << ans << '\n';
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> H >> W >> K;
	for(int i=0;i<H;++i) cin >> g[i];
	solve();
	return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <vector>
#include <valarray>
#include <array>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <complex>
#include <random>

using namespace std;
typedef long long ll;

const int MN = 330;
int dist[MN];
int main() {
    int n, e, t;
    cin >> n >> e >> t; t--;
    fill_n(dist, MN, 100000);
    for (int i = 0; i < n; i++) {
        int w;
        cin >> w;
        if (w == 1) {
            dist[i] = 1;
        }
    }
    vector<pair<int, vector<int>>> ed;
    for (int i = 0; i < e; i++) {
        int g;
        cin >> g; g--;
        int c;
        cin >> c;
        vector<int> v;
        for (int j = 0; j < c; j++) {
            int d;
            cin >> d; d--;
            v.push_back(d);
        }
        ed.push_back(pair<int, vector<int>>(g, v));
    }
    for (int i = 0; i < n; i++) {
        for (auto &p: ed) {
            auto &v = p.second;
            vector<int> u;
            for (int d: v) {
                u.push_back(dist[d]);
            }
            sort(u.begin(), u.end(), greater<int>());
            int res = 0;
            for (int j = 0; j < (int)u.size(); j++) {
                res = max(res, u[j]+j);
            }
            dist[p.first] = min(dist[p.first], res);
        }
    }
    if (dist[t] == 100000) dist[t] = -1;
    cout << dist[t] << endl;
    return 0;
}

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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const int T = 3e3 + 3;
int dp[T][T];
int choose[T][T];
int n,m;
string a,s,t;

int solve(int i, int j) {
    if(i == n or j == m) return 0;
    if(dp[i][j] != -1) return dp[i][j];

    int a = 0, b = 0, c = 0;
    a = solve(i+1, j);
    b = solve(i,j+1);

    if(s[i] == t[j]) c = solve(i+1,j+1)+1;
    if(a >= b and a >= c) choose[i][j] = 0;
    else if(b >= c and b >= a) choose[i][j] = 1;
    else choose[i][j] = 2;
    return dp[i][j] = max({a,b,c});
}

void build(int i, int j) {
    if(i == n or j == m) return;
    if(choose[i][j] == 2) a += s[i], build(i+1,j+1);
    else if(choose[i][j] == 1) build(i,j+1);
    else build(i+1,j);
}

int main() {
    ios_base::sync_with_stdio(false);
    memset(dp, -1, sizeof dp);
    cin >> s >> t;
    n = s.size(); m = t.size();
    solve(0,0);
    build(0,0);
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 71296
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <cassert>

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
typedef long long int ll;
const ll INF = 1000000000000000000;
const double PI = acos(-1);

// 入力numが素数かどうか判定する関数
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

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

    string me;
    ll ans = 0;
    rep(i, n) {
        if (i < k) {
            if (t[i] == 'r') {
                me += 'p';
                ans += p;
            }
            else if (t[i] == 's') {
                me += 'r';
                ans += r;
            }
            else {
                me += 's';
                ans += s;
            }
        }
        else {
            if (t[i] == 'r') {
                if (me[i - k] == 'p') {
                    if (i >= (n - k)) {
                        me += 'r';
                    }
                    else if (t[i + k] == 'r') {
                        me += 'r';
                    }
                    else if (t[i + k] == 's') {
                        me += 's';
                    }
                    else {
                        me += 'r';
                    }
                }
                else {
                    me += 'p';
                    ans += p;
                }
            }
            if (t[i] == 's') {
                if (me[i - k] == 'r') {
                    if (i >= (n - k)) {
                        me += 's';
                    }
                    else if (t[i + k] == 'r') {
                        me += 's';
                    }
                    else if (t[i + k] == 's') {
                        me += 's';
                    }
                    else {
                        me += 'p';
                    }
                }
                else {
                    me += 'r';
                    ans += r;
                }
            }
            if (t[i] == 'p') {
                if (me[i - k] == 's') {
                    if (i >= (n - k)) {
                        me += 'p';
                    }
                    else if (t[i + k] == 'r') {
                        me += 'r';
                    }
                    else if (t[i + k] == 's') {
                        me += 'p';
                    }
                    else {
                        me += 'p';
                    }
                }
                else {
                    me += 's';
                    ans += s;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

int main(){
int x,y;
    cin >> x >> y;
    vector<tuple<ll,ll,int > > z;
    for(int a = 0; a < y; a++){
        ll p,q;
        cin >> p >> q;
        z.push_back(make_tuple(p,q,a));
    }
    sort(z.begin(),z.end());
    int turn[99999];
    int num[99999];
    int seq = 1;
    int seqn = -1;
    for(int b = 0; b < y; b++){
        if(seqn == get<0>(z[b]))seq++;
        else seq = 1;
        seqn = get<0>(z[b]);
        num[get<2>(z[b])] = seq;
        turn[get<2>(z[b])] = b;
    }

    for(int c = 0; c < y; c++){
        printf("%06d",get<0>(z[turn[c]]));
        printf("%06d",num[c]);
        cout << endl;
    }
    return 0;
}

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

int main() {
  vector<int> V(3);
  cin >> V.at(0) >> V.at(1) >> V.at(2);
  sort(V.begin(), V.end());
  cout << V.at(2) * 10 + V.at(1) + V.at(0) << endl;
}

Measured memory_bytes: 256
n = int(input())
p = list(int(x) for x in input().split())

count = 0
for i in range(1, n-1):
    if (p[i-1] < p[i] and p[i] < p[i+1]):
        count += 1
    elif(p[i-1] > p[i] and p[i] > p[i+1]):
        count += 1

print(count)

Measured memory_bytes: 3064
#include<stdio.h>

int main(void)
{
   int n, k, h[100000], s=0, i;

   scanf("%d%d",&n,&k);
   for(i=0;i<n;i++){
      scanf("%d",&h[i]);
      if(h[i]>=k)
         s++;
   }
   printf("%d\n",s);
   return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cmath>

using namespace std;

typedef long long ll;

int main()
{
    ll N;
    
    cin >> N;
    double n = double(N);
    int a = int(sqrt(n));
    int ans = 0;
    for (int i = 2; i <= a; i++) {
        ll e = 0, z = 0;
        while (N % i == 0) {
            e++;
            if (e > z) {
                ans++;
                z = e;
                e = 0;
            }
            N /= i;
        }
    }
    if (N != 1) {
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

int main(){
    double l;
    cin>>l;
    double a=l/3;
    cout<<fixed<<setprecision(10)<<a*a*a<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<cmath>

using namespace std;

long long dp[3][100100] = {};
const long long INF = 1LL << 60; 
#define MOD 1000000007

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

/**
* @fn
* 最大値を取ります.Vector<int>を渡すこと.
*/
long long int imax(vector<int> a) {
	int MAX = -10000000;
	for (int i = 0; i < a.size(); i++) {
		if (MAX < a.at(i)) MAX = a.at(i);
	}
	return MAX;
}

/**
* @fn
* 最小値を取ります.Vector<int>を渡すこと.
*/
long long int imin(vector<int> a) {
	int MIN = 1000000000;
	for (int i = 0; i < a.size(); i++) {
		if (MIN > a.at(i)) MIN = a.at(i);
	}
	return MIN;
}


long long int absmin(vector<int> a, long long int b) {
	int mini = 100000000;
	int d = 0;
	for (int i = 0; i < a.size(); i++) {
		if (mini > abs(a.at(i) - b)) {
			mini = abs(a.at(i) - b);
			d = i;
		}
	}
	return d;
}

//ここまでライブラリ
//ここから本文

long long int tpimin(vector<int> a) {
	int MIN = 1000000000;
	int number = 0;
	for (int i = 0; i < a.size(); i++) {
		if (MIN > a.at(i)) MIN = a.at(i);
		number = i;
	}
	return number;
}


int main() {
	int n;
	cin >> n;
	vector<int> a(n+1);
	vector<int> d(n + 1);
	for (int i = 1; i < 1+n; i++) {
		cin >> a.at(i);
	}
	int b = 1;
	int c = 0;
	int i;
	for (i = 1; true; i++) {
		b = a.at(b);
		if (b == 2) break;
		if (d.at(b) == 1) {
			cout << -1 << endl;
			return 0;
		}
		d.at(b)++;
	}
	cout << i << endl;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
typedef pair<ll, ll> P;
#define FOR(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const ll INF = numeric_limits<ll>::max();
int main()
{
    int n; cin >> n;
    int a = 8;
    if (n<600){
        a = 8;
    }else if (n < 800){
        a = 7;
    }else if (n < 1000){
        a = 6;
    }else if (n < 1200){
        a = 5;
    }else if (n < 1400){
        a = 4;
    }else if (n < 1600){
        a = 3;
    }else if (n < 1800){
        a = 2;
    }else if (n < 2000){
        a = 1;
    }
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int X, Y, Z;
  scanf("%d %d %d", &X, &Y, &Z);
  int one = Y + 2 * Z;
  int i = 0;
  int sum = 1;

  while(one + i* (Y + Z) <= X) {
    i++;
    sum++;
  } 
  printf("%d\n",i);
}

Measured memory_bytes: 3784
#from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"




def main():
    n,k = mi()
    a = li()
    for i in range(n):
        a[i]-=1
    tmp = 0
    if a[0] == 0:
        print(1)
        exit()

    donelist = [0 for i in range(n)]
    cnt = 0

    while donelist[tmp]==0:
        donelist[tmp] = cnt
        tmp = a[tmp]
        cnt+=1
        if cnt == k:
            print(tmp+1)
            exit()
    anstmp = k-donelist[tmp]
    anstmp%=cnt-donelist[tmp]
    for i in range(anstmp):
        tmp = a[tmp]
    print(tmp+1)







main()




Measured memory_bytes: 34060
#include <bits/stdc++.h>
using namespace std;
const int M = 1e6;
set<int> adj[M];
int nd, indeg[M];
bool vis[M];
int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	int n;
	cin >> n;
	map<pair<int, int>, int > mp;
	int mat[n][n - 1];
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n - 1; j++) {
			cin >> mat[i][j];
			mat[i][j]--;
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n - 2; j++) {
			pair<int, int> p1 = {i, mat[i][j]}, p2 = {i, mat[i][j + 1]};
			if (p1.first > p1.second)
				swap(p1.first, p1.second);
			if (p2.first > p2.second)
				swap(p2.first, p2.second);
			if (mp.find(p1) == mp.end())
				mp[p1] = nd++;
			if (mp.find(p2) == mp.end())
				mp[p2] = nd++;
			if (adj[mp[p1]].find(mp[p2]) == adj[mp[p1]].end()) {
				adj[mp[p1]].insert(mp[p2]);
				indeg[mp[p2]]++;
			}
		}
	}
	queue<pair<int, int> > q;
	for (int i = 0; i < nd; i++) {
		if (indeg[i] == 0) {
			vis[i] = true;
			q.push({i, 1});
		}
	}
	int ans = -1;
	while (!q.empty()) {
		int v = q.front().first, d = q.front().second;
		q.pop();
		for (auto nbr : adj[v])
			indeg[nbr]--;
		ans = d;
		for (auto nbr : adj[v]) {
			if (!vis[nbr] && indeg[nbr] == 0) {
				vis[nbr] = true;
				q.push({nbr, d + 1});
			}
		}
	}
	for (int i = 0; i < n; i++) {
		if (!vis[i])
			ans = -1;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 134816
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;


int main(){
    int a,b,c;
    int ans=0;
    cin>>a>>b>>c;
    ans=a+b+c+max(max(a,b),c)*9;
    cout<<ans<<endl;
    
}

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

using namespace std;

#define si(x) scanf("%d",&x);
#define SZ 1000001

int N, A = 0, arr[SZ] = {0}, freq[SZ] = {0};

int main()
{

    si(N);
    for(int i = 0; i < N; i++)
    {
        si(arr[i]);
        freq[arr[i]]++;
    }
    sort(arr, arr + N);
    for(int i = 2; i < SZ; i++)
        A = max(A, freq[i - 2] + freq[i - 1] + freq[i]);
    printf("%d", A);
}


Measured memory_bytes: 4736
using System;

class Program
{
    static void Main()
    {

        while (true)
        {
            string input = Console.ReadLine();
            if (input == null) return;

            int n = int.Parse(input);
            int count = 0;

            for (int a = 0; a <= 9; a++)
            {
                for (int b = 0; b <= 9; b++)
                {
                    for (int c = 0; c <= 9; c++)
                    {
                        for (int d = 0; d <= 9; d++)
                        {
                            if (n == a + b + c + d)
                            {
                                count = count + 1;
                            }

                        }
                    }
                }
            }
            Console.WriteLine(count);
        }
    }
}


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

int N;
vector<ll> v;

int main()
{
    cin >> N;
    vector<ll> a(N);
    v.push_back(0);
    for (int i = 0; i < N; i++)
        cin >> a[i];
    sort(a.begin(), a.end());
    for (int i = 0; i < N; i++)
        v.push_back(v.back() + a[i]);
    int ans = 1;
    for (int i = N - 2; i >= 0; i--)
    {
        if (a[i + 1] <= 2 * (a[i] + v[i]))
            ans++;
        else
            break;
    }
    cout << ans << endl;
}

Measured memory_bytes: 2168
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N,i,a;
    int Ans = 0;
    vector<int> card(0);

    cin >> N;
    for(i=0;i<N;i++){
        cin >> a;
        card.push_back(a);
    }

    sort(card.begin(),card.end());
    reverse(card.begin(),card.end());

    for(i=0;i<N;i++){
        if(i%2==0){
            Ans += card.at(i);
        }
        else{
            Ans -= card.at(i);
        }
    }

    cout << Ans << endl;
}

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

using namespace std;

int n,m;
int p[11];
vector<int> v[11];

int can(int x)
{
	for(int i=0;i<m;i++)
	{
		int cur=0;
		for(int j=0;j<v[i].size();j++)
		{
			cur+=(x&(1<<v[i][j]))>0;
		}
		if(cur%2 != p[i]%2) return 0;
	}
	return 1;
}

int main()
{
	cin >> n >> m;
	for(int i=0;i<m;i++)
	{
		int x;
		cin >> x;
		while(x--)
		{
			int y;
			cin >> y;
			v[i].push_back(y-1);
		}
	}
	for(int i=0;i<m;i++)
		cin >> p[i];
	int ans=0;
	for(int i=0;i<(1<<n);i++)
		ans+=can(i);
	cout << ans << endl;
}

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

int main() {
    int n;
    cin >> n;
    long long diff = -1000000000;
    long long r;
    cin >> r;
    long long small = r;
    for (int i = 1; i < n; ++i) {
        cin >> r;
        diff = max(diff, r-small);
        small = min(small, r);
    }
    cout << diff << endl;
}



Measured memory_bytes: 3104
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[ohara], b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n;
  rep(i, n) {
    cin >> a[i];
    ans = (ans xor a[i]);
  }
  rep(i, n) { cout << (ans xor a[i]) << " "; }
  cout << "\n";
  return 0;
}

Measured memory_bytes: 5212
#include <iostream>

int main() {
	using namespace std;

	int n, k;
	string s;
	char tmp;

	cin >> n >> s >>k;

	tmp = s[k - 1];

	for (int i = 0; i < s.length(); i++) {
		if (s[i] != tmp) {
			cout << "*";
		} else {
			cout << s[i];
		}
	}
	cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <set>
#include <map>
using namespace std;
typedef long long ll;

// #define DEBUG

int counter;
void my_margesort(int a[], int left, int right);

void printarray(int n, int a[])
{
    for (int i = 0; i < n; i++)
    {
        cout << a[i];
        if (i != n - 1)
            cout << " ";
    }
    cout << endl;
}

void merge(int a[], int left, int right, int middle)
{
    int const inf = 1e9 + 7;
    int n1 = middle - left;
    int n2 = right - middle;

    int leftarray[n1 + 1], rightarray[n2 + 1];
    for (int i = 0; i < n1; i++)
    {
        leftarray[i] = a[left + i];
    }
    leftarray[n1] = inf;

    for (int i = 0; i < n2; i++)
    {
        rightarray[i] = a[middle + i];
    }
    rightarray[n2] = inf;

    int i = 0, j = 0;
    for (int k = left; k < right; k++)
    {
        counter++;
        if (leftarray[i] <= rightarray[j])
        {
            a[k] = leftarray[i];
            i++;
        }
        else
        {
            a[k] = rightarray[j];
            j++;
        }
    }
}

void my_margesort(int a[], int left, int right)
{
    int middle;
    if (left + 1 < right)
    {
        middle = (left + right) / 2;
        my_margesort(a, left, middle);
        my_margesort(a, middle, right);
        merge(a, left, right, middle);
    }
}

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    my_margesort(a, 0, n);
    printarray(n, a);
    cout << counter << endl;

    return 0;
}

// getline(cin,s);
// a = strtok(s, ",");  ","で分解
// for (int i = 0; i < n; i++)


Measured memory_bytes: 6924
use proconio::input;

fn main() {
    input! {
        large_n: i64,
    };
    for h in 1..=3500_i64 {
        for n in 1..=3500_i64 {
            let w_d = (4_i64 * h * n) - (large_n * n) - (large_n * h);
            if w_d <= 0 {
                continue;
            }
            let w = (large_n * h * n) / w_d;
            if (1..=3500_i64).contains(&w)
                && w * (4 * h * n - large_n * n - large_n * h) == large_n * h * n
            {
                println!("{} {} {}", h, n, w);
                return;
            }
        }
    }
}


Measured memory_bytes: 2160
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
    int N;cin>>N;
    string S;cin>>S;
    vector<int> reds(N,0);
    for(int i = 0;i < N;i++){
        if(S[i] == 'R'){
            if(i == 0)reds[i] = 1;
            else reds[i] = reds[i-1] + 1;
            continue;
        }
        if(i == 0)reds[i] = 0;
        else reds[i] = reds[i-1];
    }
    if(reds[N-1] == 0){
        cout<<0<<endl;
        return 0;
    }
    cout<<reds[N-1] - reds[reds[N-1]-1]<<endl;
}

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

int main()
{
    ios::sync_with_stdio(false);
    string s, t;
    int n;
    cin >> n;
    cin >> s >> t;
    string ans;
    
    for (int i = 0; i < n; ++ i )
    {
        ans.push_back(s[i]);
        ans.push_back(t[i]);
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  println {
    sc.nextInt() match {
      case 25 => "Christmas"
      case 24 => "Christmas Eve"
      case 23 => "Christmas Eve Eve"
      case 22 => "Christmas Eve Eve Eve"
      case _ => ???
    }
  }

}


Measured memory_bytes: 55328
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int a, b;
    cin >> a >> b;
    vi v;
    v.pb(a+b);
    v.pb(a-b);
    v.pb(a*b);
    sort(all(v));
    cout << v[(v.size()-1)];
    

    return 0;
}

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

#define fi first
#define se second
#define vi vector<int>
#define vpi vector<pair<int,int>>
#define vll vector<ll>
#define vpll vector<pair<ll,ll>>
#define endl '\n'

#define si(v) int(v.size())
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep2(i, n, m) for (ll i = n; i <= (m); ++i)
#define rep3(i, n, m) for (ll i = n; i >= (m); --i)

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

using ll = long long;
using ld = long double;
using namespace std;

constexpr ll MOD = 1000000007;

signed main()
{
  cout << fixed << setprecision(20);
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  int n; cin >> n;

  set<int> se;
  int cnt = 0;
  
  rep(i, n) {
    int r; cin >> r;
    if (r >= 3200) {
      ++cnt;
      continue;
    }
    se.emplace(r / 400);
  }

  if (se.empty()) cout << 1 << " " << cnt << endl;
  else cout << si(se) << " " << cnt + si(se) << endl;
  
  return (0);
}

Measured memory_bytes: 3592