akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <bitset>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dcm(a) setprecision(a)<<fixed
#define MOD 1000000007
#define clr(memo, a) memset(memo,a,sizeof(memo))
#define PI acos(-1)

void solve()
{
int n,k;
cin>>n>>k;
vector<int > dp(k+5);
vector<int> a(n+1);
for(int i=0;i<n;i++)
    cin>>a[i];
for(int i=0;i<=k;i++)
    for(int j=0;j<n;j++)
    if(i>=a[j]&&dp[i-a[j]]==0)
    dp[i]=1;
cout<<(dp[k]?"First" : "Second")<<endl;
}
int main()
{
    fast;
    solve();

    return 0;
}


Measured memory_bytes: 640
#define REP(i, n) for(int i = 0;i < n;i++)
#define INF 2e9
#define ll long long
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ALL(v) v.begin(), v.end()

#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b; cin >> a >> b;
    if (a == b) cout << a + a << endl;
    else cout << max(a, b) * 2 - 1 << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ft first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=1e5+7;
static const ll MOD=1e9+7;



int main(void) {
    ll N, K;
    cin >> N >> K;
    ll a[MAX];
    ll i, j;
    ll cnt[44]={};
    
    for(i=0; i<N; i++) {
        cin >> a[i];
        
        for(j=0; j<40; j++) {
            if(1&a[i]>>j) cnt[j]++;
        }
    }
    
    ll ans=0;
    for(i=0; i<N; i++) ans+=K^a[i];
    
    for(j=0; j<40; j++) {
        if(!(1&K>>j)) continue;
        
        ll mask=(K>>(j+1))<<(j+1);
        for(i=0; i<j; i++) {
            if(cnt[i]<=N-cnt[i])
                mask+=(ll)1<<i;
        }
        
        
        ll t=0;
        for(i=0; i<N; i++)
            t+=mask^a[i];
        
        chmax(ans, t);
    }
    
    pt(ans);
    
}







Measured memory_bytes: 1024
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N = int(sys.stdin.buffer.readline())
ans = 0
for d in range(1, math.ceil(math.sqrt(N)) + 10):
    if (N - d) % d == 0:
        m = (N - d) // d
        if m > 0 and N // m == N % m:
            ans += m

print(ans)


Measured memory_bytes: 15228
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>

#define max(a,b) ((a)>(b))?(a):(b)
#define min(a,b) ((a)>(b))?(b):(a)

typedef long long ll;
typedef unsigned long long ull;

int main(void)
{
	int n, d[100], sum = 0;
	scanf("%d", &n);
	for (size_t i = 0; i < n; i++)
	{
		scanf("%d", d + i);
	}
	for (size_t i = 0; i < n-1; i++)
	{
		for (size_t j = i+1; j < n; j++)
		{
			assert(i != j);
			sum += d[i] * d[j];
		}
	}

	printf("%d", sum);
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string s, t; cin >> s >> t;
	for (int i = 0; i < s.size() - 1; i++) {
		for (int j = s.size() - 2; j >= 0; j--) {
			if (s[j] > s[j + 1])swap(s[j], s[j + 1]);
		}
	}
	for (int i = 0; i < t.size() - 1; i++) {
		for (int j = t.size() - 2; j >= 0; j--) {
			if (t[j] < t[j + 1])swap(t[j], t[j + 1]);
		}
	}
	if (s < t)cout << "Yes\n"; else cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
typedef long long ll;
typedef bitset <MAXN> bits;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
bits all, sub[MAXN], fat[MAXN], path[MAXN], g[MAXN];
int n, m, lca[MAXN][MAXN], step[MAXN][MAXN], father[MAXN];
vector <int> a[MAXN], tmp;
void efs(int pos, int fa, int from, int val) {
	step[from][pos] = val;
	tmp.push_back(pos);
	for (auto x : a[pos])
		if (x != fa) efs(x, pos, from, val);
}
void dfs(int pos, int fa) {
	father[pos] = fa;
	path[pos] = path[fa];
	path[pos].set(pos);
	sub[pos].set(pos);
	for (auto x : a[pos])
		if (x != fa) {
			dfs(x, pos);
			tmp.clear();
			efs(x, pos, pos, x);
			for (auto y : tmp)
			for (int i = sub[pos]._Find_first(); i <= n; i = sub[pos]._Find_next(i))
				lca[y][i] = lca[i][y] = pos;
			sub[pos] |= sub[x];
		}
	fat[pos] = all ^ sub[pos];
	fat[pos].set(pos);
}
int main() {
	read(n), read(m);
	for (int i = 1; i <= n; i++)
		all.set(i);
	for (int i = 1; i <= n - 1; i++) {
		int x, y; read(x), read(y);
		a[x].push_back(y);
		a[y].push_back(x);
	}
	dfs(1, 0);
	int l = 1, r = 0;
	static pair <int, int> q[MAXN * MAXN];
	for (int i = 1; i <= n; i++)
		g[i].set(i);
	for (int i = 1; i <= m; i++) {
		int x, y; read(x), read(y);
		g[x].set(y), g[y].set(x);
		q[++r] = make_pair(x, y);
	}
	while (l <= r) {
		int x = q[l].first, y = q[l++].second;
		if (sub[y][x]) swap(x, y);
		bits ex, ey;
		if (sub[x][y]) ex = ey = sub[y] | path[y] | fat[step[x][y]];
		else {
			ex = ey = sub[y] | (path[y] ^ path[x]) | sub[x];
			ex.set(lca[x][y]), ey.set(lca[x][y]);
		}
		ex &= ~g[x] & g[y], ey &= ~g[y] & g[x];
		for (int i = ex._Find_first(); i <= n; i = ex._Find_next(i)) {
			g[i].set(x), g[x].set(i);
			q[++r] = make_pair(i, x);
		}
		for (int i = ey._Find_first(); i <= n; i = ey._Find_next(i)) {
			g[i].set(y), g[y].set(i);
			q[++r] = make_pair(i, y);
		}
	}
	cout << r << endl;
	return 0;
}

Measured memory_bytes: 50176
#include <iostream>
#include <queue>
#include <vector>

int main()
{
    int n, m;
    std::cin >> n >> m;

    std::priority_queue<int> queue;
    for (int i = 0; i < n; i++) {
        int temp;
        std::cin >> temp;
        queue.push(temp);
    }

    for (int i = 0; i < m; i++) {
        int temp = queue.top() / 2;
        queue.pop();
        queue.push(temp);
    }

    long long sum = 0;
    while (queue.size()) {
        sum += queue.top();
        queue.pop();
    }

    std::cout << sum << std::endl;
}


Measured memory_bytes: 892
n = int(input())
a = list(map(int, input().split()))
l = [i for i in range(10 ** 5 + 2)]
m = [0] * (10 ** 5 + 2)
for i in a:
  m[i] += 1
s = sum(a)
q = int(input())
for i in range(q):
  b, c = map(int, input().split())
  if m[b] != 0:
    s += (c - b) * m[b]
    m[c] += m[b]
    m[b] = 0
  print(s)

Measured memory_bytes: 83440
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
     ll n,m;
     cin>>n>>m;
     double arr[n],sum=0.0;
     ll i;
     for(i=0;i<n;i++)
     	{cin>>arr[i];sum+=arr[i];}
     double num=0;
     double z=sum/(4*m);
     
     for(i=0;i<n;i++)
     {
     	if(arr[i]>=z)
     		m--;
     	
     }

     if(m<=0)
     	cout<<"Yes";
     else
     	cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
typedef long long ll;


int main(void) {
  int x;
  cin >> x;
  puts(x == 7 || x == 5 || x == 3 ? "YES" : "NO");
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define repk(i,m,n) for(int i=m;i<n;i++)
#define OKawaiiKoto ios::sync_with_stdio(false);cin.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD1=1e9+7;
const int MOD2=998244353;
const ll INF=2*1e18;
const ld PI=3.14159265358979323846;
ll a[200005],b[200005];
int main()
{
    OKawaiiKoto
    ll n,m,k,ans=0;
    cin>>n;
    rep1(i,n)
    {
        k=n/i;
        ans+=k*(k+1)/2*i;
    }
    cout<<ans;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int,int>;
using pll = pair<long long, long long>;
const int INF = 1<<29;

int unko(int n, vector<int> like2017){
  int s = like2017.size();
  for(int i=0;i<s;i++){
    if(n < like2017.at(i))return i;
  }
  return s;
}

int main(){
  int q;
  cin >> q;
  vector<pii> num(q);
  for(int i=0;i<q;i++){
    cin >> num.at(i).first >> num.at(i).second;
  }
  vector<int> sosu(100001,1);
  sosu.at(0) = 0;
  sosu.at(1) = 0;
  for(int i=2;i<=317;i++){
    if(sosu.at(i) == 1){
      for(int j=2;i*j<=100000;j++){
        sosu.at(i*j) = 0;
      }
    }
  }
  vector<int> like2017;
  for(int i=3;i<100001;i++){
    if(sosu.at(i) && sosu.at((i+1)/2)){
      like2017.push_back(i);
    }
  }
  int s = like2017.size();
  for(int i=0;i<q;i++){
    int ans = unko(num.at(i).second,like2017) - unko(num.at(i).first-1,like2017);
    cout << ans << endl;
  }
}

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

using namespace std;

#define int long long

#define  mod 1000000007
#define  N   10005
#define  inf 1e18

int a[5];

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

        string s;
        cin>>s;

        for(int i=0; i<s.length(); i++)
        {
                if(s[i]=='N')
                        a[0] = 1;
                else if(s[i]=='S')
                        a[1] = 1;
                else if(s[i]=='W')
                        a[2] = 1;
                else 
                        a[3] = 1; 
        }

        if( (a[0]&&a[1]&&a[2]&&a[3]) || (a[0] && a[1] && !a[2] && !a[3]) || ( !a[0] && !a[1] && a[2] && a[3]) )
        {
                cout<<"Yes"<<endl;
        }
        else
        {
                cout<<"No"<<endl;
        }
        

        return 0;
}



Measured memory_bytes: 256
def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5+1)):
        if n % i == 0:
            return False
    return True

def main():
    X = int(input())
    while True:
        if is_prime(X):
            print(X)
            exit()
        X+= 1

if __name__ == '__main__':
    main()

Measured memory_bytes: 3188
from collections import Counter
n = int(input())
j = Counter(list(map(int, input().split())))
l = r = 0
for m, b in sorted(list(j.items()), key=lambda x: -x[0]):
    if b > 3 and (not l and not r):
        print(m * m)
        exit()
    if b > 1 and (not l or not r):
        if not l:
            l = m
        elif not r:
            r = m
print(l * r)


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

int main() {
int a[10],b[11],c[11];
int n;
cin>>n;
for (int jjj=1;jjj<=n;jjj++){
	for(int kk=0;kk<10;kk++) cin>>a[kk];
int bb=0,cc=0;
b[0]=0;
c[0]=0;
for (int k=0;k<10;k++){
	if(a[k]>b[bb] && b[bb]>=c[cc]){
		b[bb+1]=a[k];
		bb=bb+1;
	}
	else{
		c[cc+1]=a[k];
		cc=cc+1;
	}
}
	int l=0,m=0;
	for(int i=1;i<=bb;i++){
		if(b[i]-b[i-1]<0){
			l=2;
		}
	}
	for(int j=1;j<=cc;j++){
		if(c[j]-c[j-1]<0){
			m=2;
		}
	}
	if(l+m==0){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
	
}

	return 0;
}

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

#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)

int main() {
	int r, c, b[110][110];
	cin >> r >> c;
	rep(i,r) {
		rep(j,c) {
			cin >> b[i][j];
		}
	}
	rep(i,r) {
		int sr = 0;
		rep(j,c) {
			sr += b[i][j];
			cout << b[i][j] << " ";
		}
		cout << sr << endl;
	}
	int total = 0;
	rep(i,c) {
		int sc = 0;
		rep(j,r) {
			sc += b[j][i];
		}
		total += sc;
		cout << sc << " ";
	}
	cout << total << endl;
	return 0;
}

Measured memory_bytes: 1204
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	n := nextInt()
	b := make([]int, n)
	a := make([]int, n)

	for i := 0; i < n-1; i++ {
		b[i] = nextInt()
	}
	sum := 0
	a[0] = b[0]
	a[n-1] = b[n-2]
	sum += a[0] + a[n-1]
	for i := 1; i < n-1; i++ {
		a[i] = min(b[i], b[i-1])
		sum += a[i]
	}

	fmt.Println(sum)

}
func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9 + 10;
const ll MOD = 1000000007;
int dp[1010][1010];
int main() {
  int H, W;
  cin >> H >> W;
  vector<string> a(H);
  REP(i, H) cin >> a[i];
  dp[0][0] = 1;
  dp[H - 1][W - 1] = 0;
  REP(i, H) {
    int b = 10;
    REP(j, W) {
      if (j < W - 1) {
        if (a[i][j + 1] == '.') {
          dp[i][j + 1] += dp[i][j];
          dp[i][j + 1] %= MOD;
        }
      }
      if (i < H - 1) {
        if (a[i + 1][j] == '.') {
          dp[i + 1][j] += dp[i][j];
          dp[i + 1][j] %= MOD;
        }
      }
    }
  }
  // if (dp[H - 1][W - 1] == INF) dp[H - 1][W - 1] = 0;
  cout << dp[H - 1][W - 1] << endl;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const int INF=1e9;
const int MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) for (auto i = mp.begin(); i != mp.end(); ++i) { cout << i->first <<":"<<i->second << endl;}
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<" ";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a;
    ll b;
    ll tap=0;
    ll consent=1;
    cin>>a>>b;
    if(b != 1) {
        for(ll i=0; i<b; i++){
            consent=consent+(a-1);
            tap++;
            if(consent>=b){
                break;
            }
        }
    }
    cout<<tap<<endl;
    return  0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
const int INFTY =2147483647;
int main(){
    int n,m,A[105],sum=0,cnt=0;
    string s ="No";
    cin>>n>>m;
    REP(i,n){
        cin>>A[i];
        sum+=A[i];
    }
    REP(i,n) if(A[i]*4*m>=sum) cnt++;
    if(cnt>=m) s="Yes";
    cout<<s<<endl;

}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(N), B(N), C(M), D(M);
  for (int i = 0; i < N; i++) cin >> A.at(i) >> B.at(i);
  for (int i = 0; i < M; i++) cin >> C.at(i) >> D.at(i);
  
  for (int i = 0; i < N; i++) {
    int MD, MDI;
    MD = 2000000000;
    MDI = -1;
    for (int j = 0; j < M; j++) {
      if (abs(A.at(i) - C.at(j)) + abs(B.at(i) - D.at(j)) < MD) {
        MD = abs(A.at(i) - C.at(j)) + abs(B.at(i) - D.at(j));
        MDI = j + 1;
      }
    }
    cout << MDI << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner(System.in);
        int a1 = scan.nextInt();
        float total = 0;
        float f[] = new float[10000];
        for(int i = 0; i < a1; i++){
            f[i] = scan.nextFloat();
            total += 1/f[i];
        }
        System.out.println(1/total);
    }
}


Measured memory_bytes: 24404
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<ll,ll> P;
typedef pair<ll,ll> Pll;
//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく
//大きな数を扱うときは素因数分解した形で持っておく
// (l/a[i]) = l*powmod(a[i],MOD-2)%MOD;
//auto itr=lower_bound(ALL(a),key) a[itr-a.begin()]
const int MAX = 2001001;
const int MOD = 1000000007;

ll fac[MAX],finv[MAX],inv[MAX];
void COMinit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i % MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i) % MOD;
        finv[i]=finv[i-1]*inv[i] % MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0 || k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k] % MOD) % MOD;
}

int main(){
    int a,b,c,d;
    cin >> c >> a >> d >> b;
    COMinit();
    ll ans=COM(b+d+2,d+1)+COM(a+c,c);
    ans%=MOD;
    ll res=COM(b+c+1,c)+COM(a+d+1,d+1);
    res%=MOD;
    ans-=res;
    if(ans<0) ans+=MOD;
    cout << ans << endl;
    
}


Measured memory_bytes: 47104
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
const int N = 1e5 + 5;
#define int long long int

int32_t main() {
    IOS ;
    // int t ; cin >> t ; while(t--) {}
    int a, b, c, d ; cin >>a >> b>> c>>d ;
    int x = max(a, b) ; 
    int y = max(c, d) ; 
    int z = min(a, b) ; 
    int w = min(c, d) ;
    
    int val = max({x*y, x*w, y*z, z*w}) ;
    cout << val ;
    return 0 ;
}


Measured memory_bytes: 3660
#include <stdio.h>
 
int main(){
 char S[10];
  
  scanf("%s",S);
  if(strcmp(S,"Sunny")==0){
    printf("Cloudy");
  }
  else if(strcmp(S,"Cloudy")==0){
    printf("Rainy");
  }
  else if(strcmp(S,"Rainy")==0){
    printf("Sunny");
  }
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1e9+7;

#define vec     vector<int>
#define vecll   vector<ll>
#define vec2    vector<vector<int>>
#define vec2ll  vector<vector<ll>>
#define vpair   vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define mpair(v1, v2)    make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << var << "\n"
#define scn(var)         cin >> var;
#define pYes()           prt("Yes")
#define pNo()            prt("No")
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(var)      rep(i,var.size()){cout << var[i] << " ";} cout << "\n"

//----------------------------------------------------------------
class Graphs{

public:
  vector<vector<int>> graph;
  vector<int> check; // For DFS
  vector<ll> dist;   // For BFS
  queue<int> q; // For BFS

  Graphs(int n){
    graph.resize(n);
    init(n);
  }
  ~Graphs(){}

  void addedge(int u, int v){
    u--; v--;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }

  void addedge_cin(int m){
    rep(i,m){
      int a, b;
      cin >> a >> b;
      addedge(a, b);
    }
  }

  void init(int n){
    check.assign(n, false);
    dist.assign(n, -1);
  }

  void dfs(int v){
    check[v] = true;

    for(auto next_v : graph[v]){
      if(check[next_v]) continue;
      dfs(next_v);
    }
  }

  void bfs(int v){
    dist[v] = 0;
    q.push(v);

    while(!q.empty()){
      int cur_v = q.front();
      q.pop();

      for(int next_v : graph[cur_v]){
        if(dist[next_v] != -1){
          continue;
        }

        dist[next_v] = dist[cur_v] + 1;
        q.push(next_v);
      }
    }
  }
};

int main(void) {
  int x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  arrll(p,a);
  arrll(q,b);
  arrll(r,c);

  sort(all(p), greater<ll>());
  sort(all(q), greater<ll>());
  sort(all(r), greater<ll>());

  vecll zenb;
  rep(i,x){
    zenb.pb(p[i]);
  }
  rep(i,y){
    zenb.pb(q[i]);
  }
  rep(i,c){
    zenb.pb(r[i]);
  }

  sort(all(zenb),greater<ll>());

  ll ans=0;
  rep(i,x+y){
    ans+=zenb[i];
  }

  prt(ans);



}


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

int main() {
	int n;
	cin>>n;
	vector<long long> a(86);
	a[0]=2;
	a[1]=1;
	for(int i=0; i<n-1; i++){
		a[i+2]=a[i+1]+a[i];
	}
	cout<<a[n]<<endl;
	return 0;
}

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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

struct DisjointSet{
    vector<int> p;
    DisjointSet(int N) : p(N){
        rep(i,N) p[i] = i;
    }

    int root(int x){
        if(p[x] == x) return x;
        return root(p[x]);
    }

    void unite(int x, int y){
        int rx = root(x);
        int ry = root(y);
        if(rx == ry) return;
        p[rx] = ry;
    }

    bool same(int x, int y){
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main()
{
    int N, M; cin >> N >> M;
    int a[M], b[M];
    rep(i,M) cin >> a[i] >> b[i], --a[i], --b[i];
    // このループでカウントしない辺を決めている
    int cnt = 0;
    rep(i,M){
        DisjointSet dis = DisjointSet(N);
        rep(j,M){
            if(j == i) continue;
            else dis.unite(a[j], b[j]);
        }
        rep(k,N){
            if(!dis.same(0,k)){
                cnt++;
                break;
            }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3640
using System;
using System.Collections.Generic;

public class CSharp
{
    public static void Main()
    {
        Kyopuro chokudai = new Kyopuro();
        chokudai.AtCoder();
    }
}

public class Kyopuro
{

    int n, m, k;

    public void AtCoder()
    {
        string[] input;
        input = Console.ReadLine().Split(' ');
        n = int.Parse(input[0]);
        m = int.Parse(input[1]);
        int ans = 0;
        ans = n / (2 * m + 1);
        if (n % (2 * m + 1) != 0) ans++;

        Console.WriteLine(ans);
    }
    public static void DebugWL(object x) { System.Diagnostics.Debug.WriteLine(x); }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;
	int a[n];
	rep(i, n) cin >> a[i];
	int ans = inf;
	repl(i, -100, 101) {
		int now = 0;
		rep(j, n) { now += abs(a[j] - i) * abs(a[j] - i); }
		ans = min(ans, now);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
import math

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def prime_list(n): 
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f


def return_N(n):
    prob = math.floor(math.sqrt(2*n))
    if (prob -1 ) * (prob ) <= 2*n < (prob + 1) * (prob):
        return  prob -1
    elif (prob -2 ) * (prob -1) <= 2*n < (prob -1) * (prob):
        return prob - 2
    elif (prob) * (prob + 1) <= 2*n < (prob + 1) * (prob +2):
        return prob

    
    
N = int(readline())
PP = prime_list(N)
ans = 0 
for i in range(len(PP)):
    ans += return_N(PP[i][1])
print(ans)


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

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

    int a, b;
    cin >> a >> b;

    int cnt = 0;
    for(int i = a; i <= b; i++){
        int tmp = i, e, f, g, h;
        e = tmp / 10000; tmp %= 10000;
        f = tmp / 1000;  tmp %= 1000;  tmp %= 100;
        g = tmp / 10;
        h = tmp % 10;
        if(e == h and f == g){
            cnt++;
        }
    }
    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>

#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
using namespace std;

int main(int argc, char *argv[]) {
	int n, k;
	cin >> n >> k;
	long long int res = 0;
	vector<pair<long long int, long long int>> v;
	// first = delicious second = type
	for (int i = 0; i < n; i++) {
		long long int a, b;
		cin >> a >> b;
		v.push_back(make_pair(b, a));
	}
	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());
	long long int c = 0;
	unordered_map<long long int, int> um;
	for (int i = 0; i < k; i++) {
		c += v[i].first;
		um[v[i].second]++;
	}
	long long int s = um.size();
	res = c + s * s;
	int index1 = k - 1, index2 = k;
	while (index1 >= 0 && index2 < v.size()) {
		while (index1 >= 0 && um[v[index1].second] <= 1) {
			index1--;
		}
		while (index2 < v.size() && um.find(v[index2].second) != um.end()) {
			index2++;
		}
		if (index1 < 0 || index2 >= v.size())
			break;
		c = c - v[index1].first + v[index2].first;
		um[v[index1].second]--;
		um[v[index2].second]++;
		s = um.size();
		res = max(res, c + s * s);
		index1--;
		index2++;
	}
	cout << res << endl;
}














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

using namespace std;

#define pb			push_back
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define hastr(s, c)		((s).find(c) != string::npos)

template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v)
    is >> x;
  return is;
}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int n;
    cin >> n;
    ll s = 0;
    for(int i = 1; i <= n; ++i) {
    	for(int j = 1; j <= n; ++j) {
    		for(int k = 1; k <= n; ++k) {
    			s += __gcd(i,__gcd(j, k));
    		}
    	}
    }
    cout << s;
    cout << endl;

    return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool visited[100010][4];

void _main()
{
    int N, M;
    cin >> N >> M;
    vector<vector<int>> g(N);
    rep(i, 0, M)
    {
        int u, v;
        cin >> u >> v;
        --u; --v;
        g[u].push_back(v);
    }

    int S, T;
    cin >> S >> T;
    --S; --T;

    set<int> currS;
    currS.insert(S);

    int ans = 0;

    while (true)
    {
        ++ans;

        queue<pair<int, int>> q;
        for (const int S : currS)
        {
            q.emplace(S, 0);
        }

        set<int> nextS;
        while (!q.empty())
        {
            const int currNode = q.front().first;
            const int currStep = q.front().second;

            q.pop();

            if (currStep == 3)
            {
                if (currNode == T)
                {
                    cout << ans << endl;
                    return;
                }

                if (currS.find(currNode) == currS.end())
                {
                    nextS.insert(currNode);
                }

                continue;
            }

            const int nextStep = currStep + 1;

            for (const int nextNode : g[currNode])
            {
                if (visited[nextNode][nextStep])
                {
                    continue;
                }

                visited[nextNode][nextStep] = true;

                q.emplace(nextNode, nextStep);
            }
        }

        if (currS == nextS)
        {
            cout << -1 << endl;
            return;
        }

        currS = nextS;
    }
}


Measured memory_bytes: 6528
#include <bits/stdc++.h> 
using namespace std; 
#define int int64_t
const int M = 35;
int n, m, a[M];

int32_t main() 
{ 
    	ios_base::sync_with_stdio(0);   cin.tie(0);     cout.tie(0);
    	cin >> n >> m;
    	for(int i = 1; i <= n; i++)
    	{
    		int k;		cin >> k;
    		while(k--)
    		{
    			int x;		cin >> x;
    			a[x]++;
    		}
    	}
    	int ans = 0;
    	for(int i = 1; i <= m; i++)
    		if(a[i] == n)
    			ans++;
    	cout << ans;
	return 0; 
} 


Measured memory_bytes: 256
#include<cstdio>
#include<queue>
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<map>
#include<cmath>

using namespace std;

int n, k, sc[100] , dp[100][100][3];

int ans(int N, int K, int flag){
	if (dp[N][K][flag] > 0)return dp[N][K][flag];
	if (flag == 2)return 0;
	long long int ret = 0;
	if (K != sc[N] && sc[N] >= 0)return 0;
	if (N == n - 1)return 1;
	for (int i = 0; i < 3; i++){
		if (i == K)ret += ans(N + 1, i, flag + 1);
		else ret += ans(N + 1, i, 0);
	}
	return dp[N][K][flag] = ret % 10000;
}

int main(){
	int answer = 0;
	for (int i = 0; i < 100; i++){
		sc[i] = -1;
	}
	scanf("%d %d", &n, &k);
	for (int i = 0; i < k; i++){
		int a,b;
		scanf("%d %d", &a, &b);
		sc[a-1] = b-1;
	}
	for (int i = 0; i < 3; i++){
		answer += ans(0, i, 0);
		answer %= 10000;
	}
	printf("%d\n", answer);
	return 0;
}

Measured memory_bytes: 1308
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

#define Pai 3.141592653589793
int main(void)
{
	double x=0,y=0,l=90,n,m;
	
	while(1){
		scanf("%lf,%lf",&n,&m);
		if (n==0&&m==0) {
			break;
		}
		y+=(double)n*sin((double)l*Pai/180.0);
		x+=(double)n*cos((double)l*Pai/180.0);
		l-=(double)m;
	}
	printf("%d\n%d\n",(int)x,(int)y);
	
	return (0);
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
int main(){
    int k,a,b;
    cin>>k>>a>>b;
    int cn=0;
    for(int i=a;i<=b;i++){
        if(i%k==0) cn++;
    }
    if(cn>0) cout<<"OK"<<endl;
    else cout<<"NG"<<endl;
}

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

char field[70][70];
string numberTable[70][70];
int dy[] = {-1, 0}, dx[] = {0, -1};

void clearLeftZero(string& str) {
    while (str.empty() == false && str[0] == '0') {
        str.erase(0, 1);
    }
}

string compare(const string str1, const string str2) {
    if (str1.length() != str2.length()) {
        return (str1.length() > str2.length()) ? str1 : str2;
    }
    if (str1 > str2) {
        return str1;
    }
    return str2;
}

int main() {
    while (true) {
        int w, h;
        cin >> w >> h;
        if ((w | h) == 0) {
            break;
        }
        memset(field, 0, sizeof(field));
        for (int y = 0; y < h; y++) {
            cin >> field[y];
        }
        string res;
        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {
                numberTable[y][x].clear();
                if ('0' <= field[y][x] && field[y][x] <= '9') {
                    string num = string(1, field[y][x]);
                    for (int i = 0; i < 2; i++) {
                        int ny = y + dy[i], nx = x + dx[i];
                        if (0 <= ny && 0 <= nx && numberTable[ny][nx].empty() == false) {
                            num = compare(numberTable[ny][nx] + field[y][x], num);
                        }
                    }
                    clearLeftZero(num);
                    if (num.empty() == false) {
                        numberTable[y][x] = num;
                    }
                }
                if (numberTable[y][x].empty() == false) {
                    res = compare(numberTable[y][x], res);
                }
            }
        }
        cout << res << endl;
    }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define eps LDBL_EPSILON
#define moder 1000000007
#define int long long
#define double long double
#define ll long long
#define INF LLONG_MAX/3
#define prique priority_queue<int,vector<int>,greater<int>>
using namespace std;
int n,k,l[60];
signed main(){
	cin>>n>>k;
	rep(i,n)cin>>l[i];
	sort(l,l+n,greater<int>());
	int ans=0;
	rep(i,k)ans+=l[i];
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn update_used(num: usize, used: &mut Vec<bool>) {
    let mut num = num;
    for i in 0..20 {
        if num % 2 == 1 {
            used[i] = !used[i];
        }
        num /= 2;
    }
}

fn criterion(used: &Vec<bool>, num: usize) -> bool {
    let mut num = num;
    for i in 0..20 {
        if used[i] && num % 2 == 1 {
            return false;
        }
        num /= 2;
    }
    true
}

fn main() {
    let _ = read::<usize>();
    let a = read_vec::<usize>();

    let mut used = vec![false; 20];
    let mut s: usize = 0;
    let mut t: usize = 0;
    let mut res = 0;
    loop {
        while t < a.len() && criterion(&used, a[t]) {
            // println!("updated by t = {:?}", t);
            update_used(a[t], &mut used);
            t += 1;
            if t == a.len() {
                break;
            }
        }
        res += t - s;
        // println!("updated by s = {:?}", s);
        update_used(a[s], &mut used);
        s += 1;
        if s == a.len() {
            break;
        }
    }
    println!("{:?}", res);
}


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

//関数宣言
//int func(int x, int y);

int main(void){

  //スカラー入力
  int A,P;

  scanf("%d %d", &A, &P);

  int ans;

  ans = (A*3+P)/2;
  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 128
import java.io.*;
import java.math.BigInteger;
import java.util.*;


public class  Main{
    public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("reduce.in");
        PrintWriter pw=new PrintWriter(System.out);
        int n=sc.nextInt();int k=sc.nextInt();
        double ans=0;
        for(int i=1;i<=n;i++) {
        	int j=i;double base=1;
        	while(j<k) {
        		j*=2;
        		base=0.5*base;
        	}
        	ans+=base;
        }
        pw.println(ans*(1.0/n));
        pw.flush();
    }
    
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

Measured memory_bytes: 21332
#include<bits/stdc++.h>
using namespace std;
#define int                 long long
#define FF(i,a,b)           for(int i=a;i<b;i++)
#define BF(i,a,b)           for(int i=a;i>=b;i--)
#define vi                  vector<int>
#define MAP                 map<int,int>
#define pb                  push_back
#define MP                  make_pair
#define F                   first
#define S                   second
#define pi                  pair<int,int>
#define all(v)              v.begin(),v.end()
#define PIE                 3.1415926535897932384626433832795
#define print0(a)           cout<<a<<"\n"
#define print1(a)           cout<<a<<' '
#define print2(a,b)         cout<<a<<" "<<b<<" ";
#define print3(a,b,c)       cout<<a<<" "<<b<<" "<<c<<" ";
#define print4(a,b,c,d)     cout<<a<<" "<<b<<" "<<c<<" "<<d<<" ";
#define FastIO              ios::sync_with_stdio(0); cin.tie(0);cout.tie(0)
/**************************************************************************************/
                       /*Global Variables*/
const int mod = 1e9+7;
const int N = 2e5+10;
const int inf = 3e18;

/**************************************************************************************/
template <typename A>istream& operator>>(istream& input,vector<A>& x) {for(auto& i:x)input>>i;return input;}
template<typename A>ostream& operator<<(ostream& output,vector<A>& x) {for(auto& i:x)output<<i<<' ';return output;}
int add(int a, int b){return (a%mod + b%mod + mod)%mod;}
int sub(int a, int b){return (a%mod - b%mod + mod)%mod;}
int mul(int a, int b){return ((a%mod)*(b%mod) + mod)%mod;}
int Power(int a,int b)
{
    int res=1;
    while(b)
    {
        if(b&1)res*=a;
        a*=a;
        b>>=1;
    }
    return res;
}
signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    FastIO;
    int T=1;
    //cin>>T;
    while(T--)
    {
        string s;
        cin>>s;
        if(s=="ABC")
        {
            cout<<"ARC\n";
        }
        else
        {
            cout<<"ABC\n";
        }
    }

}
/*
|| Do what you can with all you have,wherever you are. ||

|| Knowing is not enough, we must apply. Wishing is not enough, we must do. ||

|| A goal is a dream with deadline. ||

|| Whether you think you can or you think you can't, you're right. ||
*/



Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define RI register int
int a,b;
int main()
{
	scanf("%d%d",&a,&b);
	if(a<=0&&b>=0) puts("Zero");
	else if(a<0&&b<0&&(b-a+1)%2) puts("Negative");
	else puts("Positive");
	return 0;
}

Measured memory_bytes: 256
import sys

n = int(input())
h = [int(i) for i in input().split()]
for k in range(n):
    if k == n-1:
        break
    if h[k+1] > h[k]:
        h[k+1] -= 1
    elif h[k+1] < h[k]:
        print('No')
        sys.exit()
    if k+1 == n-1:
        break
print('Yes')

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

using namespace std;
 
#define END '\n'
#define int long long
#define pb push_back
#define pii pair<int, int>
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i)
void fastscan(int &x)
 {
        bool neg=false;
        register int c;
        x =0;
        c=getchar();
        if(c=='-')
        {
            neg = true;
            c=getchar();
        }
        for(;(c>47 && c<58);c=getchar())
            x = (x<<1) + (x<<3) +c -48;
        if(neg)
            x *=-1;
    } 
string alpha = "abcdefghijklmnopqrstuvwxyz";
const int mod = 1e9+7;
const int inf = 2e18+5;
const int nax = 100010;
const int mod1 = 998244353;

signed main()
 {
 double x;
cin>>x;
double s = x/3;
double v = s *s *s;
cout<<fixed<<setprecision(7)<<v;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int arr[110];
int cnt;
int main(){
	int n;
	cin>>n;
	int x;
	for(x=1;x<=n;x++)
	{
		cin>>arr[x];
		if(arr[x]!=x)
		{
			cnt++;
		}
	}
	if(cnt<=2)
	{
		cout<<"YES"<<endl;
		return 0;
	}
	cout<<"NO"<<endl;
}

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

int main()
{
   int a,b,c,d;
   cin >>a;
   cin >>b;
   c=(a*b);
   d=(c%2);
   if (d==0)
   {
     cout << "Even"<< endl;
   }
   else 
   {
     cout << "Odd"<< endl;
   }
   return 0;
}  

Measured memory_bytes: 3644
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      abcs: [(usize,usize,usize); n],
    }

    let mut dp = vec![vec![0; 3]; n+1];
    for i in 0..n {
        let (a, b, c) = abcs[i];
        dp[i+1][0] = max(dp[i+1][0], max(dp[i][1] + b, dp[i][2] + c));
        dp[i+1][1] = max(dp[i+1][1], max(dp[i][0] + a, dp[i][2] + c));
        dp[i+1][2] = max(dp[i+1][2], max(dp[i][0] + a, dp[i][1] + b));
    }
    let ans = dp[n].iter().max().unwrap();
    puts!("{}\n", ans);
}


Measured memory_bytes: 14588
import           Control.Applicative
import           Control.Monad
import           Control.Monad.ST
import qualified Data.ByteString             as B
import           Data.List
import qualified Data.Set                    as S
import           Data.STRef
import qualified Data.Vector                 as V
import qualified Data.Vector.Unboxed         as VU
import qualified Data.Vector.Unboxed.Mutable as VUM


readInt :: IO [Int]
readInt = map read . words <$> getLine

readIntlines :: Int -> IO [[Int]]
readIntlines n = map (map read . words) <$> replicateM n getLine

main :: IO ()
main = do
    [a, b, c, d] <- readInt
    print $ solve a b c d

solve :: Int -> Int -> Int -> Int -> Int
solve a b c d = maximum $ (*) <$> [a, b] <*> [c, d]


Measured memory_bytes: 3932
# 数列aの最小値min_aの最大値はM//N
# 他の要素がmin_aの倍数であれば、min_aが最大公約数となる
# すなわち、(M-min_a)をmin_aで割った余りが0でありかつ、商がN-1以上
 
N, M = map(int, input().split())
 
for i in range(M//N, 0, -1):
    r, q = divmod((M - i), i)
    if r >= N - 1 and q == 0:
        break
print(i)

Measured memory_bytes: 40172
N,M=map(int,input().split())

ps_dic={}
for i in range(M):
  pi,si=input().split()
  if pi not in ps_dic:
    ps_dic[pi]=[si]
  else:
    ps_dic[pi].append(si)
  
#print(ps_dic)
total_ac=0
total_wa=0
for p in ps_dic:
  num_wa=0
  for s in ps_dic[p]:
    if s == "WA":
      num_wa+=1
    elif s == "AC":
      total_ac+=1
      total_wa+=num_wa
      break

print(str(total_ac) + " " + str(total_wa))

Measured memory_bytes: 30152
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>

using namespace std;

#define int long long
#define rep(i, n) for (int i=0;i<(int)n;++i)
#define rep1(i, n) for (int i=1;i<=(int)n;++i)
#define unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
ll read(){ll a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 10;

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

	int ans = 0;

	rep(i, n-1) {
		if (a[i] == i + 1) {
			swap(a[i], a[i + 1]);
			ans++;
		}
	}

	if (a[n - 1] == n) {
		ans++;
	}

	cout << ans << endl;
}




Measured memory_bytes: 1024