akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<string>
#include<cstring>
#include <cstdio>
#include<utility>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
#include<stack>
#include<set>
#include <limits>
#include <climits>
#include <numeric>
#include <cassert>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int>VI;
typedef pair<int,int>P;
typedef pair<double,double>P_D;
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define reprev(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define ALL(a)  (a).begin(),(a).end()
#define C_MAX(a, b) ((a)>(b)?(a):(b))
#define fi first
#define se second
#define MAX 100100//5
#define MAX_N 200100
#define MAX_B 1001001//6
#define MAX_S 10010010//7
#define SENTINEL 2000000000//9
#define NIL -1
#define MOD 1000000007
#define INF 1 << 29
#define INFTY 1000000000000000000LL
#define MAX_INT INT_MAX
using Graph=vector<vector<P> >;
//ツリー探索dfs
/*
void tree_dfs(const Graph &G,int v,int p){
    for(auto nv:G[v]){
        if(nv==p)continue;
        tree_dfs(G,nv,v);
    }
}
*/
vector<int>color;
void dfs(const Graph &G,int v,int p,int c){
    color[v]=c;
    for(auto e:G[v]){
        if(e.fi==p)continue;
        if(e.se&1)dfs(G,e.fi,v,1-c);
        else dfs(G,e.fi,v,c);
    }
}
int main(){
    int n;cin>>n;
    Graph G(n);
    color.assign(n,0);
    rep(i,n-1){
        int u,v,w;cin>>u>>v>>w;
        u--;v--;
        G[u].push_back(P(v,w));
        G[v].push_back(P(u,w));
    }
    dfs(G,0,-1,1);
    for(auto v:color)cout<<v<<endl;

}

Measured memory_bytes: 9728
#include <cstdio>
#include <utility>
#include <vector>
#include <cmath>
using namespace std;

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

vector<bool> sieve;
vector<int> sieve_list;

void make_sieve(int n) {
	sieve = vector<bool>(n, true);
	sieve[1] = false;
	for (int i = 4; i < n; i += 2)
		sieve[i] = false;
	for (int i = 3, e = sqrt(n); i <= e; i += 2) {
		if (!sieve[i])
			continue;
		for (int j = i * i; j < n; j += i)
			sieve[j] = false;
	}
	sieve_list.push_back(2);
	for (int i = 3 ; i < n; i += 2)
		if (sieve[i])
			sieve_list.push_back(i);
}

bool is_prime(int n) {
	return sieve[n];
}

int main() {
	make_sieve(50001);
	for (int n; (n = in());) {
		int c = 0;
		if (n % 2)
			c = is_prime(n - 2);
		else
			for (int i = 0; sieve_list[i] <= n / 2; i++)
				if (is_prime(n - sieve_list[i]))
					c++;
		out(c, '\n');
	}
}


Measured memory_bytes: 2648
#include<bits/stdc++.h>
using namespace std;
 
int main () {
  int n,k;
  cin >> n >> k;
  int ans=1;
  
  for(int i=0;i<n;i++){
    if(ans<k){
      ans=ans*2;
    }
    else {
      ans+=k;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
var a:string;
i,j,k,l:longint;
begin
readln(a);
l:=pos(' ',a);
delete(a,l,1);
for i:=1 to length(a) do
  k:=k*10+ord(a[i])-ord('0');
 if sqrt(k)=trunc(sqrt(k)) then writeln('Yes') else writeln('No');
 end.

Measured memory_bytes: 128
N = int(input())
T = list(map(int,input().split()))
A = list(map(int,input().split()))
mami = []
ans = 1
mod = 10**9 + 7
for i in range(N):
    mi, ma = 1 , min(T[i], A[i])+1
    if i != N-1:
        if A[i] > A[i+1]:
            mi = A[i]
    else :
        mi = A[i]
    if i != 0 :
        if T[i] > T[i-1]:
            mi = T[i]
    else :
        mi = T[i]            
    ans = (max(ma - mi, 0) * ans ) % mod
print (ans)


Measured memory_bytes: 19136
#pragma warning(disable:4996)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>

#pragma region 定義
#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin4(X,Y,Z,W) scanf("%d %d %d %d",&X,&Y,&Z,&W)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define f_cin(X) scanf("%f",&X)
#define l_cin2(X,Y) scanf("%ld %ld",&X,&Y)
#define s_cin(X) scanf("%s",&X)
#define c_cin(X) scanf("%c",&X);
#define ll_cin(X) scanf("%lld", &X)
#define ull_cin(X) scanf("%llu", &X)
#define lf_cin(X) scanf("%lf", &X)

#define  i_cout(X) printf("%d\n",X)
#define  f_cout(X) printf("%g\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)

#define  c_cout(X) printf("%c",X)


#define  ll_cout(X) printf("%lld\n",X)
#define  ull_cout(X) printf("%llu\n",X)



typedef long long  ll;
typedef unsigned long long  ull;

#define rept(x, s, n) for (int x = s; x < n; x++)

#define S_RTN(S)  s_cout(S);return 0


#define _itoa(A,N) sprintf(A, "%d", N);

int i_cins(int n, int* A);
int l_cins2(int n, long* A, long* B);
int s_dsort(const void* a, const void* b);
int s_asort(const void* a, const void* b);

int  _gcd(int a, int b);
int  _swp(int* a, int* b);
int _cknum(char* a, int n);
int _atoi(char* s, int len);


int s_asorts(const void* a, const void* b);

//昇順
int s_asorts(const void* a, const void* b) {
	return(strcmp((char*)a, (char*)b));
}
int s_dsort(const void* a, const void* b) {
	return(*(int*)b - *(int*)a);
}
int s_asort(const void* a, const void* b) {
	return(*(int*)a - *(int*)b);
}
int l_cins2(int n, long* a, long* b) {
	int i;
	rept(i, 0, n) {
		l_cin2(*(a + i), *(b + i));
	}
	return 0;
}
int i_cins(int n, int* a) {
	int i;
	for (i = 0; i < n; i++) {
		i_cin(*(a + i));
	}

	return 0;
}
int _gcd(int a, int b) {
	int r, tmp;
	if (a < b) { tmp = a; a = b; b = tmp; }
	r = a % b;
	while (r) {
		if (!r) break;
		a = b; b = r;
		r = a % b;
	}
	return(b);
}

long _max(long a, long b) {
	return a > b ? a : b;
}
long _min(long a, long b) {
	return a < b ? a : b;
}
int _swp(int* a, int* b)
{
	int tmp;
	tmp = *b; *b = *a; *a = tmp;
	return 0;
}

int _cknum(char* a, int n) {
	int i;
	char t = '0';

	for (i = 0; i < n; i++) {
		if (a[i] < '0' || a[i]>'9') return 1;
	}
	return 0;
}


int _atoi(char* s, int len) {
	char tmp[20];
	memcpy(tmp, s, len);
	tmp[len] = 0x00;
	return (atoi(tmp));
}

#pragma endregion

//167-B


int main(void) {
	long a, b, c, k, tmp = 0;

	scanf("%ld %ld %ld %ld", &a, &b, &c, &k);

	tmp = _min(k, a);
	if (a >= k){l_cout(k); return 0;}
	k -= a; 
	if (k <= b) { l_cout(a); return 0; }
	k -= b;
	tmp = _min(k, c)*-1;
	l_cout(a+tmp);
	return 0;

}



//#define _N 1000000000

//int main(void)
//{
//
//	int  n,i;
//	ull   tmp=1;
//
//	i_cin(n);
//
//	for (i = 1; i <= n; i++) {
//		if (!(tmp % ((ull)_N + 7)))
//			tmp = 1;
//		tmp *= (ull)i;
//	}
//	tmp %= ((ull)_N + 7);
//		
//	ull_cout(tmp);
//	return 0;
//}



Measured memory_bytes: 1736
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
#define int long long 
using namespace std;
signed main(){
	int n,m;
	cin>>n>>m;
	if(n==1||m==1){
		puts("1");
	}
	else{
		if(n*m%2==0){
			cout<<n*m/2<<endl;
		}
		else{
			cout<<n*m/2+1<<endl;
		}
	}
	return 0;
}


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

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        String ans = "";
        String x = "1";

        for(int i=0; i<3; i++){
            if(n.charAt(i)==x.charAt(0)){
                ans += "9";
            }
            else{
                ans += "1";
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
int main(){
	int N;
	cin >> N;
	if (N<=90 and N>=65){
		cout << "1" << endl;
	}else if (N<=122 and N>=97){
		cout << "2" << endl;
	}else{
		cout << "0" << endl;
}
}


Measured memory_bytes: 3112
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int A=scan.nextInt();
		int B=scan.nextInt();
		int C=scan.nextInt();
		int D=scan.nextInt();
		while(A>0||C>0){
			C=C-B;
			if(C<=0){
				System.out.println("Yes");
				break;
			}
			A=A-D;
			if(A<=0){
				System.out.println("No");
				break;
			}
		}

	}

}


Measured memory_bytes: 35744
#include<bits/stdc++.h>
using namespace std;
int n,a[2][100];
int main()
{
	cin>>n;
	for (int i=0;i<n;i++){
		cin>>a[0][i];
		if (i) a[0][i]+=a[0][i-1];
	}
	for (int i=0;i<n;i++){
		cin>>a[1][i];
		int v=a[0][i];
		if (i) v=max(v,a[1][i-1]);
		a[1][i]+=v;
	}
	cout<<a[1][n-1]<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    string s; cin>>s;
    for(int S=0;S<(1<<3);S++){
        string ans="-------=7";

        vint v(4);
        REP(i,4) v[i]=s[i]-'0';

        int res=v[0];
        REP(i,3){
            if(S>>i&1){
                res+=v[i+1];
            }
            else{
                res-=v[i+1];
            }
        }
        if(res!=7) continue;

        REP(i,4) ans[2*i]=(char)('0'+v[i]);
        REP(i,3){
            if(S>>i&1){
                ans[2*i+1]='+';
            }
            else{
                ans[2*i+1]='-';
            }
        }

        cout<<ans<<endl;
        return 0;
    }
 
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define rep(i,l,n) for(i=l;i<n;i++)

int main(void){
	double x1,y1,x2,y2,z,ans;
	
	scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
	
	z=pow(x1-x2,2)+pow(y1-y2,2);
	ans=pow(z,0.5);
	
	printf("%f\n",ans);
	return 0;
}

Measured memory_bytes: 688
K = int(input())

N = 50
res = [i for i in range(N)]
for i in range(K % N):
    for j in range(N):
        if i == j:
            res[j] += N
        else:
            res[j] -= 1
for j in range(N):
    res[j] += K // N

print(N)
print(" ".join([str(n) for n in res]))


Measured memory_bytes: 63268
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111;
using namespace std;
typedef long long lint;

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	string S;
	cin >> S;

	if (S <= "2019/04/30") cout << "Heisei";
	else cout << "TBD";

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
    int n;
    cin>>n;
    int rem=n%10;
    if(rem==2 || rem==4 || rem==5 || rem==7 || rem==9)cout<<"hon"<<endl;
    else if(rem==0 || rem==1 || rem==6 || rem==8)cout<<"pon"<<endl;
    else if(rem==3)cout<<"bon"<<endl;
}


Measured memory_bytes: 3636
#include <iostream>

using namespace std;

int main(){
    int n, T;
    cin >> n >> T;
    int c[n], t[n];
    for(int i = 0; i < n; i++){
        cin >> c[i] >> t[i];
    }
    int minc = c[0];
    bool isTLE = true;
    for(int i = 0; i < n; i++){
        if(t[i] <= T){
            isTLE = false;
            if(c[i] < minc) minc = c[i];
        }
    }
    if(isTLE) cout << "TLE" << endl;
    else cout << minc << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> P;
typedef pair<P,P> PP;
map<P,P> G;
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};

set<PP> used;
set<P> checked;
int check(P head){
  P leg = G[head];
  if(used.count(PP(head,leg)))return 1;
  if(used.count(PP(leg,head)))return 0;
  used.insert(PP(head,leg));
  checked.insert(head);
  checked.insert(leg);

  int res = 1;
  for(int i=0;i<4;i++){
    int nx = head.second+dx[i];
    int ny = head.first+dy[i];
    P nhead = P(ny,nx);
    if(nhead == leg || !G.count(nhead))continue;
    res &=check(nhead);
  }

  for(int i=0;i<4;i++){
    int nx = leg.second+dx[i];
    int ny = leg.first+dy[i];
    P nleg = P(ny,nx);
    if(nleg == head || !G.count(nleg))continue;
    res &=check(G[nleg]);
  }
  return res;
}

signed main(){
  int n;
  while(cin>>n,n){
    G.clear();
    for(int i=0;i<n;i++){
      int x,y;
      char dir;
      cin>>x>>y>>dir;
      int a = x + (dir == 'x');
      int b = y + (dir == 'y');
      G[P(y,x)] = P(b,a);
      G[P(b,a)] = P(y,x);
    }

    int ans = 1;
    checked.clear();
    for(PP a:G){
      if(!ans || checked.count(a.first))continue;
      used.clear();
      if(check(a.first)) continue;
      used.clear();
      if(check(a.second))continue;
      ans = 0;
    }
    cout<<(ans? "Yes":"No")<<endl;
  }
  return 0;
}

Measured memory_bytes: 12688
from sys import stdin, setrecursionlimit
from bisect import bisect_left
from collections import deque

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


def main():
    N = int(input())
    A = tuple(int(input()) for _ in range(N))
    B =deque([A[0]])

    for a in A[1:]:
        if a <= B[0]:
            B.appendleft(a)
        else:
            B[bisect_left(B, a) - 1] = a

    print(len(B))


if __name__ == '__main__':
    main()


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

int main(){
    int N;
    string S;
    cin >> N;
    cin >> S;
    int ans = 0;
    for(int i=0;i<1000;i++){
        char num[4];
        sprintf(num, "%03d", i);
        int dig = 0;
        for(int pos=0;pos<N;pos++){
            if(S[pos]==num[dig]){
                if(dig==2){
                    ans++;
                    break;
                }else{
                    dig++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pir pair<int,int>
#define qmin(x,y) (x=min(x,y))
#define qmax(x,y) (x=max(x,y))
#define rsort(x,y) sort(x,y),reverse(x,y)
#define fr first
#define se second
using namespace std;
typedef long long ll;
const int Maxn=2100000;
const int inf=0x3f3f3f3f;

int p,ans;

signed main() {
    // freopen("test.in","r",stdin);
    scanf("%d",&p);
    ll now=7%p,temp=70%p;
    for(int i=1;i<=100000000;i++) {
        if(now==0) {
            ans=i;
            break;
        }
        now=(temp+now)%p;
        temp=temp*10%p;
    }
    if(ans) printf("%d\n",ans);
    else printf("-1");
    return 0;
}

Measured memory_bytes: 3864
#include<iostream>
using namespace std;
static const int MAX = 200000;
int main(){
        int n;
        int R[MAX];
        cin>>n;
        for(int i = 0; i < n; i++){
                cin>>R[i];
        }
        int maxBest = -10e10;
        int minN = R[0];
        for(int i = 1; i < n; i++){
                maxBest = max(maxBest, R[i] - minN);
                minN = min(minN, R[i]);
        }
        cout<<maxBest<<endl;

        return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int mod;
int m;

int cal(string x){	
	if(x.size() == 1) return (x[0]-'0')/m + 1;
	int dp[2][600][10][2][2]; //桁数, 余り, 数字, 最大, 増減
	memset(dp,0,sizeof(dp));
	dp[0][0][0][0][0] = 1;
	int top = x[0]-'0';
	for (int i = 1;i < top;i++){
		dp[0][i%m][i][0][0] = 1;
		dp[0][i%m][i][0][1] = 1;
	}
	dp[0][top%m][top][1][0] = 1;
	dp[0][top%m][top][1][1] = 1;
	int cur = 0, next = 1;
	for (int d = 0;d < x.size()-1;d++){
		memset(dp[next],0,sizeof(dp[next]));
		for (int rem = 0;rem < m;rem++){
			for (int num = 0;num < 10;num++){
				for (int isMax = 0;isMax<2;isMax++){
					for (int isL = 0;isL<2;isL++){
						if(dp[cur][rem][num][isMax][isL] == 0) continue;
						int crt = dp[cur][rem][num][isMax][isL];
						crt %= mod;
						if(num == 0 && isL == 0){
							dp[next][0][0][0][0] += crt;
							for (int i = 1;i < 10;i++){
								dp[next][i%m][i][0][0] += crt;
								if(d != x.size()-2)dp[next][i%m][i][0][1] += crt;
							}
						}else if(isMax == 1){
							int xn = x[d+1]-'0';
							if(isL == 0){
								for (int i = num-1;i >= 0;i--){
									if(i > xn) continue;
									else if(i == xn) dp[next][(rem*10+i)%m][i][1][1] += crt;
									else dp[next][(rem*10+i)%m][i][0][1] += crt;
								}
							}else{
								for (int i = num+1;i <= xn;i++){
									if(i == xn) dp[next][(rem*10+i)%m][i][1][0] += crt;
									else dp[next][(rem*10+i)%m][i][0][0] += crt;
								}
							}
						}else if(isL == 0){
							for (int i = num-1;i >= 0;i--){
								dp[next][(rem*10+i)%m][i][0][1] += crt;
							}
						}else if(isL == 1){
							for (int i = num+1;i <= 9;i++){
								dp[next][(rem*10+i)%m][i][0][0] += crt;
							}
						}
					}
				}
			}
		}
		swap(cur,next);
	}
	int ret = 0;
	for (int i = 0;i < 10;i++){
		for (int j = 0;j < 2;j++){
			for (int k = 0;k < 2;k++){
				ret += dp[cur][0][i][j][k];
				//if(dp[cur][0][i][j][k] != 0) cout << i << " " << ret << endl;
				ret %= mod;
			}
		}
	}
	return ret;
}

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

	string  a,b; cin >> a >> b >> m;
	mod = 10000;

	bool f = false;
    
	for (int i = a.size()-1;i >= 0;i--){
		if(f && a[i] == '0'){
			a[i] = '9';
		}else if(f){
			a[i]--; break;
		}else if(a[i] == '0'){
			a[i] = '9'; f = true;
		}else{
			a[i]--; break;
		}
	}
	
	if(a[0] == '0' && a.size() >= 2){
		string c = "";
		for (int i = 0;i < a.size()-1;i++){
			c += a[i+1];
		}
		a = c;
	}


	//cout << a << endl;

	//cout << cal(a) << " " << cal(b) << endl;
	cout << (mod+cal(b) - cal(a))%mod << endl;

	return 0;

}



Measured memory_bytes: 3400
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
//change null_type here for map/set
typedef tree<int,null_type,less<int>,rb_tree_tag,
            tree_order_statistics_node_update> indexed_set;
typedef long long int  ll;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define F first
#define S second

template<class T>inline bool read(T &x){
    int c=getchar();int sgn=1;
    while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}
    for(x=0;~c&&'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
    x*=sgn; return ~c;
}
///START HERE
///indexed_set pbd;
//pbd.insert()
//auto x = pbd.find_by_order(2);
//int od=pbd.order_of_key(7)
///rope<int> rp;
//rp.push_back()
//RandomAccess like vector
//mutable_begin, mutable_end()

int main(){
    ///read()+printf
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //fast;
    char a,b;
    cin>>a;
    if(isupper(a)){
        cout<<"A";
    }
    else{
        b=toupper(a);
        cout<<"a";
    }


    return 0;
}


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

using namespace std;

int INF = 10000000;

int n,m;

int w[1510];
int h[1510];

int wf[1510 * 1000];
int hf[1510 * 1000];



int main()
{

	while(1)
	{
		memset(wf,0,1510*1000 * sizeof(int));
		memset(hf,0,1510*1000 * sizeof(int));

		cin >> n >> m;

		if(!n && !m)break;


		for(int i = 0;i < n;i++)
		{
			cin >> w[i];
		}
		for(int i = 0;i < m;i++)
		{
			cin >> h[i];
		}



		for(int i = 0;i < n;i++)
		{
			int sum = 0;
			for(int j = i;j < n;j++)
			{
				sum += w[j];
				wf[sum]++;
			}
		}

		for(int i = 0;i < m;i++)
		{
			int sum = 0;
			for(int j = i;j < m;j++)
			{
				sum += h[j];
				hf[sum]++;
			}
		}

		int sum = 0;

		for(int i = 0;i < 1510*1000;i++)
		{
			sum += wf[i] * hf[i];
		}
	
		cout << sum << endl;
	}

  return 0;
}

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

int main()
{
	int a = 0,b = 0,c = 0;
	int n;
	int l,r;
	cin>>n;
	cin>>l>>r;
	int ans = 0x3f3f3f3f;
	for(int i=0;i<n;i++){
		int xx;
		cin>>xx;
		if(xx <= l)a ++;
		if(xx > l && xx <= r) b ++;
		if(xx > r) c ++;
	}
	ans = min(ans, a);
	ans = min(ans, b);
	ans = min(ans, c);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <sys/time.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldo;
#define endl            "\n"
#define pi              3.1415926535897932384626433832795
#define mod             (ll)1000000007
#define pp              pair<ll,ll>
#define vii             vector<int>
#define vll             vector<ll>
#define vpp             vector<pp>
#define vss             vector<string>
#define pb              push_back
#define pob             pop_back
#define mp              make_pair
#define pf              push_front
#define pof             pop_front
#define eb              emplace_back
#define ff              first
#define ss              second
#define bs(v,x)         binary_search(v.begin(),v.end(),x)
#define ub(v,x)       upper_bound(v.begin(),v.end(),x)
#define lb(v,x)       lower_bound(v.begin(),v.end(),x)
#define print(A,n)      for(ll i=0;i<n;++i)cout<<A[i]<<' ';cout<<endl;
#define take(A,n)       for(ll i=0;i<n;++i)cin>>A[i];
#define set(x)          memset(x,0,sizeof(x));
#define Sort(x)         sort(x.begin(),x.end())
#define fast            ios_base::sync_with_stdio(false);cin.tie(NULL);
#define setd(s,s1,S1)   set_difference(s.begin(),s.end(),s1.begin(),s1.end(),inserter(S1,S1.end())); //set and multi set
#define trace1(x)                cout<<#x<<": "<<x<<endl
#define trace2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define trace(f) for(auto it=f.begin();it!=f.end();it++)cout<<*it<<" ";cout<<endl;


int main()
{
    fast;
    ll L=1;
//    cin>>L;
    while(L--){
        string s,t;
        cin>>s;
        cin>>t;
        ll n=s.size();
        ll ans=0;
        for(ll i=0;i<n;i++){
            if(s[i]!=t[i])
                ans++;
        }
        cout<<ans<<endl;
    }
    return 0;
}



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

int main(){
    using namespace std;
    constexpr unsigned long MOD = 1000000007;
    unsigned long Q;
    cin >> Q;
    long C, T, x;
    cin >> T >> x >> C;
    C -= x;
    priority_queue<long, deque<long>, greater<>> sm, la;
    for(long i = 1, a, b, c; i != Q; ++i)if(cin >> a, a == 1){
        cin >> b >> c;
        if(x < b){
            la.push(b);
            C += c + b;
        }else{
            sm.push(-b);
            C += c - b;
        }
        if(sm.size() + 1 < la.size()){
            sm.push(-x);
            x = la.top();
            C -= 2 * x;
            la.pop();
        }
        if(sm.size() > la.size()){
            la.push(x);
            C += 2 * x;
            x = -sm.top();
            sm.pop();
        }
        T ^= 1;
    }else cout << x << " " << C + T * x << endl;
    return 0;
}

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

int main()
{
	string s;
	cin >> s;
	if (s[s.size() - 1] == 's') {
		cout << s + "es" << endl;
	}
	else {
		cout << s + "s" << endl;
	}
	return 0;
}


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

using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, x, y;
	cin >> n >> x;
	vector <int> v(n + 1);
	v[0] = 0;
	for (int i = 1; i <= n; ++i){	
		cin >> y;
		v[i] = v[i-1] + y;
	}
	int ans = 0;
	for (auto u:v){
		if ( u <= x){
			++ans;
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# agc039/agc039_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    K = i2n()
    ps = S[0]
    cnt = 0
    s_n = []
    for s in S:
        if ps == s:
            cnt += 1
        else:
            s_n.append(cnt)
            cnt = 1
            ps = s
    s_n.append(cnt)
    if len(s_n) == 1:
        print((s_n[0] * K) // 2)
        return
    sum_n = sum((x//2 for x in s_n[1:-1])) * K
    if S[0] == S[-1]:
        sum_n += (s_n[0] // 2 + s_n[-1] // 2)
        sum_n += ((s_n[0] + s_n[-1]) // 2) * (K-1)
    else:
        sum_n += (s_n[0] // 2 + s_n[-1] // 2) * K
    print(sum_n)
    return

main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define int long long
#define rep(i,m,n) for(int i=m;i<n;i++)
#define repr(i,n,m) for(int i=n;i>=m ;i--)
#define mod 1000000007
#define float long double
#define pb push_back
#define mp make_pair
#define pp pop_back
#define pi 3.141592653589793238
#define print(v) for(int i=0;i<v.size();i++) cout<<v[i]<<" ";cout<<endl
using namespace std;
bool sortbysec(const pair<int,int> &a,
             const pair<int,int> &b)
{
   return (a.second < b.second);
}
bool sortinrev(const pair<int,int> &a,  
              const pair<int,int> &b)
{
      return (a.first > b.first);
}
int ispal(string s)
{
    int x=s.length();
    for(int i=0,j=x-1;i<x/2,j>=x-x/2;i++,j--)
        if(s[i]!=s[j])
            return 0;
    return 1;
}
void solve()
{
     int n;
     cin>>n;
     int arr[n-1];
     map<int,int>mp;
     rep(i,0,n-1){
     cin>>arr[i];
     mp[arr[i]]++;}
     for(int i=1;i<n+1;i++)
     {
     	cout<<mp[i]<<"\n";
     }
}    
signed main()
{
                   // #ifndef ONLINE_JUDGE
                   // freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
                   // #endif 
  int t=1;
 //cin>>t;
  while(t--){
  solve();
  cout<<"\n";
}
  cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
 return 0;
}  

Measured memory_bytes: 17888
N, K = map(int, input().split())
_A = list(map(int, input().split()))
ans = 0

A = []
for a in _A:
    if a >= K:
        ans += 1
    else:
        A.append(a)

A.sort(reverse=True)
M = len(A)
isNess = [False] * M

accA = [0] * (M + 1)
for i in range(1, M + 1):
    accA[i] = accA[i - 1] + A[i - 1]

left = 0
for right in range(1, M):
    while accA[right] - accA[left] >= K:
        left += 1

    for i in range(right, M):
        if (accA[right] - accA[left]) + A[i] >= K:
            isNess[i] = True
            for j in range(left, right):
                isNess[j] = True

ans += sum(isNess)
print(N - ans)

Measured memory_bytes: 44508
a,b=map(int,input().split())

if a<0 and b<0:
    aa=a%2
    bb=b%2

    if (aa+bb)%2==1:
        print("Positive")
    else:
        print("Negative")
    exit()

if a<=0 and 0<=b:
    print("Zero")
    exit()

if 0<a and 0<b:
    print("Positive")
    exit()


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

using namespace std;
int main(){
    int n, h, w;
    cin >> n >> h >> w;
    int a[n];
    int b[n];
    int count = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i] >> b[i];
        if(a[i] >= h && b[i] >= w) count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define M 998244353
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define zero(dp) memset(dp,0,sizeof(dp))
#define pb emplace_back
#define sublime 
using namespace std;
int32_t main(){
ios
int t=1;
//cin>>t;
while(t--)
{
	int a,b;cin>>a>>b;int flag=1;
	for(int i=1;i<=1005;i++)
	{
		double a1=i*0.08;
		double a2=i*0.1;
		int r1=floor(a1);
		int r2=floor(a2);
		if(r1==a and r2==b)
			{cout<<i;flag=0;break;}
	}
	if(flag)cout<<-1<<'\n';
}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <set>
#include <cmath>
using namespace std;
#define ll long long

int main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    
    ll n, a, b;
    cin >> n >> a >> b;
    if (b < a || (n == 1 && b != a)){
        cout << 0;
        return 0;
    }
    ll minSum = a * (n - 1) + b;
    ll maxSum = a + (n - 1) * b;
    cout << maxSum - minSum + 1 << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <queue>
#include <cstring>
#include <algorithm>
using namespace std;
#define mst(a,b) memset((a),(b),sizeof(a))
#define rush() int T;scanf("%d",&T);while(T--)

typedef long long ll;
const int maxn = 105;
const ll mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;

int n,m,k;
int a[maxn*maxn];
int mp[maxn][maxn];

int main()
{
    while(~scanf("%d%d",&n,&m))
    {
        mst(mp,0);
        scanf("%d",&k);
        for(int i=1; i<=k; i++)
        {
            scanf("%d",&a[i]);
        }
        int sum=0;
        int cnt=0;
        int color=1;
        mp[0][0]=1;
        int x=0,y=0;
        cnt++;
        sum++;
        while(sum<n*m)
        {
            if(cnt>=a[color])
            {
                color++;
                cnt=0;
            }
            while(x+1<n&&!mp[x+1][y])
            {
                mp[++x][y]=color;
                cnt++,sum++;
                if(cnt>=a[color])
                {
                    color++;
                    cnt=0;
                }
            }
            while(y-1>=0&&!mp[x][y-1])
            {
                mp[x][--y]=color;
                cnt++,sum++;
                if(cnt>=a[color])
                {
                    color++;
                    cnt=0;
                }
            }
            while(x-1>=0&&!mp[x-1][y])
            {
                mp[--x][y]=color;
                cnt++,sum++;
                if(cnt>=a[color])
                {
                    color++;
                    cnt=0;
                }
            }
            while(y+1<m&&!mp[x][y+1])
            {
                mp[x][++y]=color;
                cnt++,sum++;
                if(cnt>=a[color])
                {
                    color++;
                    cnt=0;
                }
            }
        }
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<m-1;j++)
            {
                printf("%d ",mp[i][j]);
            }
            printf("%d\n",mp[i][m-1]);
        }
    }
    return 0;
}


Measured memory_bytes: 256
using System;
class a
{
    public static void Main()
    {
        string[] str = Console.ReadLine().Split(' ');
        long l = long.Parse(str[0]);
        long r = long.Parse(str[1]);

     
        long min0 ;
    

        if (r - l + 1 >= 2019)
        {
            min0 = 0;
           
        }
        else
        {
            min0 = (l % 2019) * ((l + 1) % 2019) % 2019;
            for (long j = l; j < r; j++)
            {
                for (long i = l + 1; i < r + 1; i++)
                {
                    if (min0 > (j % 2019) * (i % 2019) % 2019)
                        min0 = (j % 2019) * (i % 2019) % 2019;
                }
            }
        }
        Console.WriteLine(min0);
    }
}

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


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		char[] s = sc.next().toCharArray();

		boolean[] a = new boolean[26];
		for (char c : s) {
			a[c - 'a'] = true;
		}

		for (int i = 0; i < 26; i++) {
			if (!a[i]) {
				pr.println((char)(i + 'a'));
				return;
			}
		}

		pr.println("None");
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 26796
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll n,c;
  cin >> n >> c;
  vec v(n);
  for(ll i=0;i<n;i++) {
    cin >> v[i];
  }
  ll ans=-inf;
  for(ll i=1;i<=min(c,n);i++) {
    for(ll j=0;j<=i;j++) {
      ll tans=0;
      priority_queue<ll,vec,greater<ll>> q;
      for(ll k=0;k<j;k++) {
        tans+=v[k];
        q.push(v[k]);
      }
      for(ll k=0;k<i-j;k++) {
        tans+=v[n-1-k];
        q.push(v[n-1-k]);
      }
      ll cnt=c-i;
      while(cnt&&q.size()&&q.top()<0) {
        tans-=q.top();
        q.pop();
        cnt--;
      }
      ans=max(ans,tans);
    }
  }
  cout << ans << endl;
}

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

int main(){
  double n;
  vector<double> vec;
  while (cin >> n){
    vec.push_back(n);
  }
  sort(vec.begin(), vec.end());
  double ans = vec.back() - vec.front();
  cout << fixed << setprecision(3) << ans << endl;
}



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

int main() {
    while (true) {
        int x, y;
        cin >> x >> y;
        if (x == 0 && y == 0) {
            break;
        }
        if (x < y) {
            int temp = x;
            x = y;
            y = temp;
        }
        int count = 0;
        while (y > 0) {
            int temp = x % y;
            x = y;
            y = temp;
            count++;
        }
        cout << x << " " << count << endl;
    }
}

Measured memory_bytes: 0
n,a,b=map(int,input().split())

s=a+b

shou=int(n//s)

amari=int(n%s)

if n<s:
    if a<n:
        print(a)
    else :
        print(n)
else :
    if amari<a:
        print(a*shou+amari)
    else :
        print(a*shou+a)
        

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

const int N = 100000 + 10;

int n, k, ans;
std::vector <int> e[N];
int v[N];

int dfs (int u, int dep = 0) {
    int ret = dep;
    for (auto i : e[u]) ret = std::max(ret, dfs(i, dep + 1));
    if (v[u] ^ 1 && ret - dep == k - 1) {
        ans++;
        return 0;
    }
    return ret;
}

int main () {
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n; i++) scanf("%d", v + i);
    if (v[1] ^ 1) v[1] = 1, ans++;
    for (int i = 2; i <= n; i++) e[v[i]].push_back(i);
    dfs(1); printf("%d", ans);
    return 0;
}



Measured memory_bytes: 12288
s = list(input().split())

stack = []

for x in s:
    try:
        t = int(x)
        stack.append(t)
    except:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(a+b)
        elif x == '-':
            stack.append(b-a)
        else:
            stack.append(a*b)

print(stack[0])


Measured memory_bytes: 5604
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
	int x=0,f=1;
	char ch;
	do
	{
		ch=getchar();
		if (ch=='-')
		{
			f=-f;
		}
	}while (ch<'0' || ch>'9');
	do
	{
		x=x*10+ch-'0';
		ch=getchar();
	}while (ch>='0' && ch<='9');
	return x*f;
}
#define ll long long
const ll Mod=998244353;
const int maxn=310;
int n,a[maxn],s;
ll f[maxn][maxn*maxn/2],g[maxn][maxn*maxn/2];
void upd(ll &x,ll v)
{
	x=(x+v)%Mod;
}
ll pw(ll x,ll y)
{
	ll res=1;
	while (y)
	{
		if (y&1)
		{
			res=res*x%Mod;
		}
		x=x*x%Mod;
		y>>=1;
	}
	return res;
}
int main()
{
	n=read();
	for (int i=1;i<=n;i++)
	{
		a[i]=read();
		s+=a[i];
	}
	int m=s/2;
	f[0][0]=1;
	g[0][0]=1;
	for (int i=1;i<=n;i++)
	{
		for (int j=0;j<=m;j++)
		{
			upd(f[i][j],f[i-1][j]);
			upd(g[i][j],g[i-1][j]);
			if (j>=a[i])
			{
				upd(f[i][j],f[i-1][j-a[i]]*2);
				upd(g[i][j],g[i-1][j-a[i]]);
			}
		}
	}
	ll ans=0;
	for (int i=0;i<=m;i++)
	{
		upd(ans,f[n][i]);
	}
	if (s%2==0)
	{
		ans=(ans-g[n][m]+Mod)%Mod;
	}
	ans=ans*3%Mod;
	ans=(pw(3,n)-ans+Mod)%Mod;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 229120
#include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	int n,max_num = -1000001,min_num = 1000001,tmp;
	long long int sum = 0;
	scanf("%d",&n);
	for(int i = 0; i < n; i++){
		scanf("%d",&tmp);
		sum += tmp;
		max_num = max(max_num,tmp);
		min_num = min(min_num,tmp);
	}
	printf("%d %d %lld\n",min_num,max_num,sum);
}



Measured memory_bytes: 2720
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  int n; scanf("%d", &n);
  vector<int> p; p.resize(n);
  for(int i=0; i<n; i++) scanf("%d", &p[i]);
  sort(p.begin(), p.end());
  
  printf("%d\n" , p[n/2] - p[n/2-1]);
} 

Measured memory_bytes: 640
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
int main(void){
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    ll ans = INF;
    for(int bit = 0; bit < (1 << n); bit++){
        vector<bool> choose(n, false);
        int cnt = 0;
        for(int i = 0; i < n; i++){
            if(bit & (1 << i)){
                choose[i] = true;
                cnt++;
            }
        }

        if(cnt < k) continue;

        ll highest = 0;
        ll tmpans = 0;
        for(int i = 0; i < n; i++){
            if(choose[i]){
                if(a[i] <= highest){
                    tmpans += highest - a[i] + 1;
                    highest++;
                } else {
                    highest = a[i];
                }
            } else {
                highest = max(a[i], highest);
            }
        }
        ans = min(ans, tmpans);
    }
    cout << ans << endl;
}   

Measured memory_bytes: 256
array=[-1]*87
array[0]=2
array[1]=1
def ryuka(n):
    if array[n] != -1: return array[n]
    if(n==0 or n==1): return array[n]
    else:
        array[n]=ryuka(n-1)+ryuka(n-2)
        return array[n]

N = int(input())

print(ryuka(N))


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int X, Y, A, B, C;
	cin >> X >> Y >> A >> B >> C;
	vector<ll> P(A), Q(B), R(C);
	for (auto& x : P) cin >> x;
	for (auto& x : Q) cin >> x;
	for (auto& x : R) cin >> x;
	sort(P.rbegin(), P.rend());
	sort(Q.rbegin(), Q.rend());
	sort(R.rbegin(), R.rend());
	ll res = 0;
	for (int i = 0; i < X; ++ i) res += P[i];
	for (int i = 0; i < Y; ++ i) res += Q[i];
	int p = X-1, q = Y-1;
	for (int i = 0; i < C; ++ i) {
		int k = -1;
		if (p >= 0 && q >= 0) {
			if (P[p] <= Q[q]) k = 0; else k = 1;
		} else if (p >= 0) {
			k = 0;
		} else if (q >= 0) {
			k = 1;
		}
		if (k == 0) {
			if (P[p] >= R[i]) break;
			res -= P[p];
			res += R[i];
			-- p;
		} else if (k == 1) {
			if (Q[q] >= R[i]) break;
			res -= Q[q];
			res += R[i];
			-- q;
		} else break;
	}
	cout << res << endl;
}


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

template <int MOD_> struct modnum {
	static constexpr int MOD = MOD_;
	static_assert(MOD_ > 0, "MOD must be positive");

private:
	using ll = long long;

	int v;

	static int minv(int a, int m) {
		a %= m;
		assert(a);
		return a == 1 ? 1 : int(m - ll(minv(m, a)) * ll(m) / a);
	}

public:

	modnum() : v(0) {}
	modnum(ll v_) : v(int(v_ % MOD)) { if (v < 0) v += MOD; }
	explicit operator int() const { return v; }
	friend std::ostream& operator << (std::ostream& out, const modnum& n) { return out << int(n); }
	friend std::istream& operator >> (std::istream& in, modnum& n) { ll v_; in >> v_; n = modnum(v_); return in; }

	friend bool operator == (const modnum& a, const modnum& b) { return a.v == b.v; }
	friend bool operator != (const modnum& a, const modnum& b) { return a.v != b.v; }

	modnum inv() const {
		modnum res;
		res.v = minv(v, MOD);
		return res;
	}
	modnum neg() const {
		modnum res;
		res.v = v ? MOD-v : 0;
		return res;
	}

	modnum operator- () const {
		return neg();
	}
	modnum operator+ () const {
		return modnum(*this);
	}

	modnum& operator ++ () {
		v ++;
		if (v == MOD) v = 0;
		return *this;
	}
	modnum& operator -- () {
		if (v == 0) v = MOD;
		v --;
		return *this;
	}
	modnum& operator += (const modnum& o) {
		v += o.v;
		if (v >= MOD) v -= MOD;
		return *this;
	}
	modnum& operator -= (const modnum& o) {
		v -= o.v;
		if (v < 0) v += MOD;
		return *this;
	}
	modnum& operator *= (const modnum& o) {
		v = int(ll(v) * ll(o.v) % MOD);
		return *this;
	}
	modnum& operator /= (const modnum& o) {
		return *this *= o.inv();
	}

	friend modnum operator ++ (modnum& a, int) { modnum r = a; ++a; return r; }
	friend modnum operator -- (modnum& a, int) { modnum r = a; --a; return r; }
	friend modnum operator + (const modnum& a, const modnum& b) { return modnum(a) += b; }
	friend modnum operator - (const modnum& a, const modnum& b) { return modnum(a) -= b; }
	friend modnum operator * (const modnum& a, const modnum& b) { return modnum(a) *= b; }
	friend modnum operator / (const modnum& a, const modnum& b) { return modnum(a) /= b; }
};
using num = modnum<998244353>;

const int MAXV = 2.1e7;
const int V = int(2e7) + 100;
num fact[MAXV];
num ifact[MAXV];

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	fact[0] = 1;
	for (int i = 1; i <= V; i++) fact[i] = fact[i-1] * num(i);
	ifact[V] = fact[V].inv();
	for (int i = V; i >= 1; i--) ifact[i-1] = ifact[i] * num(i);
	auto choose = [&](int n, int r) -> num {
		if (0 <= r && r <= n) return fact[n] * ifact[r] * ifact[n-r];
		else return 0;
	};

	int N, A, B; cin >> N >> A >> B;

	num ans = 0;
	for (int k = 0; k <= A && B + k <= N; k++) {
		int jumps = N - B - k;
		int slack = A - k;
		if (slack) {
			if (!jumps) {
				continue;
			}
			jumps--;
		}
		// jumps can go anywhere among slack + 1 things
		num jumpWays = choose(jumps + slack, jumps);
		// strictly below, except at the start
		num moveWays = k == 0 ? 1 : choose(B + k-1, B-1) - choose(B + k-1, B);
		ans += jumpWays * moveWays;
	}
	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 164352
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;

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

  vector<int> odd(1010000,0);
  vector<int> even(1010000,0);
  vector<pair<int,int> > pairEven;
  vector<pair<int,int> > pairOdd;

  // count even odd
  for(int i = 0; i < n; i++){
    if(i % 2)   odd[a[i]] ++;
    else        even[a[i]] ++;
  }

  //int -> pair
  for(int i = 0; i < odd.size() ; i++) {
    if(odd[i] != 0){
      pair<int,int> x;
      x.first = odd[i];
      x.second = i;
      pairOdd.push_back(x);
    }
  }

  for(int i = 0; i < even.size(); i++) {
    if(even[i] != 0){
      pair<int,int> x;
      x.first = even[i];
      x.second = i;
      pairEven.push_back(x);
    }
  }

  pair<int,int> x;
  x.first = 0;
  x.second = 0;
  pairOdd.push_back(x);
  pairEven.push_back(x);

  sort(pairEven.begin(),pairEven.end(),greater<pair<int,int>>());
  sort(pairOdd.begin(),pairOdd.end(),greater<pair<int,int>>());

  // == 多く登場するものを出力
  int ans ;
  if(pairEven[0].second == pairOdd[0].second){
    ans = min(n - pairEven[0].first - pairOdd[1].first, n - pairEven[1].first - pairOdd[0].first);
  }else ans = n - pairEven[0].first - pairOdd[0].first;

  cout << ans << endl;
  return 0;
}


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

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

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int, int> pii;
const int mod = (int)1e9 + 7;


int main()
{

	ll x,y;
	cin >>x >>y;
	ll ans = 1e16;
	
	if(x<=y)   ans = min(ans, y-x);
	if(-x<=y)  ans = min(ans, 1+y-(-x));
	if(x<=-y)  ans = min(ans, -y-x+1);
	if(-x<=-y) ans = min(ans, -y+x+2);
	cout << ans << endl;
}


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

int main() {
	string s;
	string sub;
	cin >> s;
	bool flag = true;
	for (int i = s.size()-1; i >=0; --i) {
		if (s[i] == 'm') {
			if (i - 4 < 0) {
				flag = false;
				break;
			}
			sub = s.substr(i - 4, 5);
			if (sub != "dream") {
				flag = false;
				break;
			}
			i -= 4;
		}
		else if (s[i] == 'e') {
			if (i - 4 < 0) {
				flag = false;
				break;
			}
			sub = s.substr(i - 4, 5);
			if (sub != "erase") {
				flag = false;
				break;
			}
			i -= 4;
		}
		else if (s[i] == 'r') {
			if (i - 2 < 0) {
				flag = false;
				break;
			}
			if (s[i - 2] == 'm') {
				if (i - 6 < 0) {
					flag = false;
					break;
				}
				sub = s.substr(i - 6, 7);
				if (sub != "dreamer") {
					flag = false;
					break;
				}
				i -= 6;
			}
			else if (s[i - 2] == 's') {
				if (i - 5 < 0) {
					flag = false;
					break;
				}
				sub = s.substr(i - 5, 6);
				if (sub != "eraser") {
					cout << "NO" << endl;
					return 0;
				}
				i -= 5;
			}
		}
	}
	if(flag)cout << "YES" << endl;
	if (flag == false)cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 512
n, m = [int(x) for x in input().split()]

a = sorted([[int(x) for x in input().split()] for _ in range(n)], key=lambda x: x[0])

result = 0
for x in a:
  cnt = min(m, x[1])
  result += x[0] * cnt
  m -= cnt
print(result)

Measured memory_bytes: 27892
#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
    int X, N;
    std::cin >> X >> N;
    std::vector<int> p(N);
    for(int i=0; i<N; i++)  std::cin >> p[i];

    // ソートする 
    std::sort(p.begin(), p.end());

    // ない数を見る 
    int tmp1 = -999;
    for(int j=0; j<=101; j++)
    {
        // ない数か？ 
        bool isnotP = true;
        for(int i=0; i<N; i++)
        {
            if(j==p[i])
            {
//                std::cout << j << "is not in p\n";
                isnotP = false;
            }
        }
        
        // Xとの差はどうか？ 
        if(isnotP == true)
        {
//            printf("%d is juged\n", j);
            // 同じ場合は小さい方 
            if(abs(X-j) < abs(X-tmp1))
            {
                tmp1 = j;
            }
        }
    }
    std::cout << tmp1 << std::endl;
    return 0;
}

Measured memory_bytes: 3636