akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<vector>
#define Starseven main
#define ll long long
namespace lyt {
	void read(int &x){
	char ch=getchar();int re=0,op=1;
	while(ch<'0'||ch>'9'){if(ch=='-') op=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){re=(re<<3)+(re<<1)+ch-'0';ch=getchar();}
	x = re * op;
	return ;
	}
	void read(long long &x){
	char ch=getchar();long long re=0,op=1;
	while(ch<'0'||ch>'9'){if(ch=='-') op=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){re=(re<<3ll)+(re<<1ll)+ch-'0';ch=getchar();}
	x = re * op;
	return ;
	}
	void write(int x){
		if(x<0){putchar('-');x=-x;}
		if(x>9) write(x/10);
		putchar(x%10+'0');
		return ;
	}//¼ÇµÃ×Ô¼º¼Ó¿Õ¸ñºÍ»»ÐÐ 
	void write(long long x){
		if(x<0){putchar('-');x=-x;}
		if(x>9) write(x/10);
		putchar(x%10+'0');
		return ;
	}//¼ÇµÃ×Ô¼º¼Ó¿Õ¸ñºÍ»»ÐÐ
	int max(int x,int y){return x<y?y:x;}
	int min(int x,int y){return x<y?x:y;}
	int abs(int x){return x<0?-x:x;}
	long long max(long long x,long long y){return x<y?y:x;}
	long long min(long long x,long long y){return x<y?x:y;}
	long long abs(long long x){return x<0?-x:x;}
	double max(double x,double y){return x<y?y:x;}
	double min(double x,double y){return x<y?x:y;}
	double abs(double x){return x<0?-x:x;}
	void swap(int &a,int &b) {a ^= b ^= a ^= b;}
	void swap(long long &a,long long &b) {a ^= b ^= a ^= b;}
	ll Power(ll a, ll b, ll p) {
		ll re = 1;
		while(b) {
			if(b & 1ll) re = (re * a) % p;
			b >>= 1ll;
			a = (a * a) % p; 
		}
		return re;
	}
	int Power(int a, int b, int p) {
		int re = 1;
		while(b) {
			if(b & 1) re = 1ll * re * a % p;
			b >>= 1;
			a = 1ll * a * a % p; 
		}
		return re;
	}
}using namespace lyt;
const int mod = 1e9 + 7;
const int N = 1e2 + 20;
int va[N], minn[N][N];

struct xyx {
	int res1, res2;
};

xyx Dfs(int l, int r, int pre_dep) {
	int judge = minn[l][r], num = 0;
	xyx re;
	std::vector<int> v;
	v.push_back(l - 1);
	for (int i = l; i <= r; i++) {
		if(va[i] == judge) {
			v.push_back(i);
			num++;
		}
	}
	v.push_back(r + 1);
	re.res1 = re.res2 = 1;
	for (int i = 0; i < num + 1; i++) {
		if(v[i] + 1 >= v[i + 1]) continue;
		xyx hack = Dfs(v[i] + 1, v[i + 1] - 1, judge);
		re.res1 = 1ll * re.res1 * hack.res1 % mod;
		re.res2 = 1ll * re.res2 * 1ll * ( (hack.res2 + 1ll * hack.res1 * 2 % mod) % mod) % mod;
	}
	xyx ans;
	ans.res1 = 1ll * Power(2, judge - pre_dep, mod) * re.res1 % mod;
	ans.res2 = (1ll * Power(2, num, mod) * re.res2 % mod + ( (mod - 2ll * re.res1) % mod + mod) % mod) % mod;
	return ans;
}

int Starseven(void) {
	int n;
	read(n);
	for (int i = 1; i <= n; i++) {
		read(va[i]);
	}
	if(n == 1) {
		int ans = Power(2, va[1], mod);
		write(ans);
		puts("");
		return 0;
	}
	for (int i = 1; i <= n; i++) {
		minn[i][i] = va[i];
		for (int j = i + 1; j <= n; j++) {
			minn[i][j] = min(minn[i][j - 1], va[j]);
		}
	}
	xyx ans = Dfs(1, n, 0);
	ans.res1 = 1ll * (ans.res1 + ans.res2) % mod;
	write(ans.res1);
	puts("");
	return 0;	
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  V< pair<int, int> > res;
  if (~n & 1) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j < i; ++j) {
        if (i + j != n + 1) {
          res.emplace_back(i, j);
        }
      }
    }
  } else {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j < i; ++j) {
        if (i + j != n) {
          res.emplace_back(i, j);
        }
      }
    }
  }
  cout << res.size() << '\n';
  for (const auto& e : res) {
    cout << e.first << ' ' << e.second << '\n';
  }
}

Measured memory_bytes: 384
#include <iostream>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int dp[1001];

int main() {
	string s,t;
	cin >> s >> t;
	dp[0]=1;
	REP(i,s.size())REP(_j,t.size()){
		int j=t.size()-1-_j; // j??????????????????
		if(s[i]==t[j]){
			dp[j+1] += dp[j];
			dp[j+1] %= int(1e9) + 7;
		}
	}
	cout << dp[t.size()] << endl;
	return 0;
}

Measured memory_bytes: 3180
#include<bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef pair<pair<int,int>,pair<int,int> > P;
bool c(P&f,P&s){return f.s.s<s.s.s;}
int main()
{
	int i,n,m,p,y;
	P a[100010];
	cin>>n>>m;
	for(i=0;i<m;i++)
	{
		cin>>p>>y;
		a[i].f.f=p;
		a[i].f.s=y;
		a[i].s.f=0;
		a[i].s.s=i;
	}
	sort(a,a+m);
	p=a[0].f.f;
	for(y=i=0;i<m;i++)
	{
		if(p!=a[i].f.f)p=a[i].f.f,y=0;
		a[i].s.f=++y;
	}
	sort(a,a+m,c);
	for(i=0;i<m;i++)printf("%012ld\n",(long)(a[i].f.f*1e6+a[i].s.f));
}

Measured memory_bytes: 3072
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
#define mod 1000000007
#define inf 1e15
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y)* mod_pow(kai(y, y), mod - 2, mod) % mod;
}
struct edge { int to, cost; };
signed main() {
	int a, b;
	cin >> a >> b;
	cout << lcm(a, b) << endl;
	ggr
}


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

class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split();
        int N = int.Parse(input[0]);
        int Z = int.Parse(input[1]);
        int W = int.Parse(input[2]);

        int[] a = new int[N];
        string[] aInput = Console.ReadLine().Split();
        for (int i = 0; i < N; i++) a[i] = int.Parse(aInput[i]);

        int now = Math.Abs(W - a[N - 1]);
        if (N == 1) Console.WriteLine(now);
        else
        {
            int next = Math.Abs(a[N - 1] - a[N - 2]);
            Console.WriteLine(Math.Max(now, next));
        }

        Console.ReadLine();
    }
}



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

typedef long long ll;
typedef pair<int, pair<int, int>> piii;
//loop
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
//STL
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

//const
#define MOD 1000000007 //10^9+7:合同式の法

//acronym
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素

const int INF = 1e9;

#define deg_to_rad(deg) ((deg)*M_PI / 180.0)

// const int MOD = 998244353;

void Main()
{
    int N, A, B;
    cin >> N >> A >> B;

    if (A * N < B)
    {
        cout << A * N << endl;
    }
    else
    {
        cout << B << endl;
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Main();
    return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
const int maxN = 3 * (int)1e5 + 10;
const int mod = 998244353;
int fact[maxN];
int a, b, n;
long long k;
int invfact[maxN];
int inv[maxN];
int sum(int a, int b) {
    int s = a + b;
    if (s >= mod) s -= mod;
    return s;
}
int mult(int a, int b) {
    return (1LL * a * b) % mod;
}
int cnk(int n, int k) {
    return mult(mult(fact[n], invfact[n - k]), invfact[k]);
}
int main() {
    srand(time(0));
    //freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    fact[0] = 1;
    fact[1] = 1;
    invfact[0] = 1;
    invfact[1] = 1;
    inv[1] = 1;
    cin >> n >> a >> b >> k;
    for (int i = 2; i <= n; i++) {
        fact[i] = mult(fact[i - 1], i);
        inv[i] = mult(mod - (mod / i), inv[mod % i]);
        invfact[i] = mult(invfact[i - 1], inv[i]);
    }
    int ans = 0;
    for (int t1 = 0; t1 <= n; t1++) {
        if (1LL * t1 * a > k) break;
        long long res = k - 1LL * t1 * a;
        if ((res % b) != 0) continue;
        if ((res / b) > n) continue;
        int t2 = (res / b);
        ans = sum(ans, mult(cnk(n, t1), cnk(n, t2)));
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3840
#include <iostream>

int main()
{
    while (1) {

        int m,f,r;

        std::cin >> m >> f >> r;
        
        if (m == -1 && f == -1 && r == -1) {
            break;
        }
        if (m == -1 || f == -1) {
            std::cout << "F" << std::endl;
        } else if (m + f < 30) {
            std::cout << "F" << std::endl;
        } else if (m + f < 50 && r >= 50) {
            std::cout << "C" << std::endl;
        } else if (m + f < 50) {
            std::cout << "D" << std::endl;
        } else if (m + f < 65) {
            std::cout << "C" << std::endl;
        } else if (m + f < 80) {
            std::cout << "B" << std::endl;
        } else {
            std::cout << "A" << std::endl;
        }

    }

    return 0;
}

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

using namespace std;

int main(){
  ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(0); cerr.tie(0);
	int a, b, c;
	cin >> a >> b >> c;
	int k;
	cin >> k;
	while (k--) {
		if (a >= b) {
			b *= 2;
		} else if (b >= c) {
			c *= 2;
		} else {
			c *= 2;
		}
	}
	if (a >= b || b >= c) {
		cout << "No\n";
	} else {
		cout << "Yes\n";
	}
  return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  double n,a,b,c,d;
  cin >> n >> a >> b >> c >> d;
  double x=(d+c)/2,y=(d-c)/2;
  double l=-y*(n-1),r=y*(n-1);
  for(ll i=-(n-1); i<=n-1; i+=2) {
    if(a+l+x*i<=b&&b<=a+r+x*i) {
      pr("YES");
      return;
    }
  }
  pr("NO");
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a,b) for(i=a;i<=b;i++)
using namespace std;
typedef long long ll;
const int mod=998244353;
const int lim=17,maxn=(1<<20)+5,N=110;
int F[lim+1][maxn],G[lim+1][maxn];
int dp[10][N];int g[N][N];
int a[N];char s[N];
ll p[N],c[N][N];
int n;

void work(int K){
	int i,j,k;int cur,x;
	rep(i,0,(1<<K)-1){
		rep(j,1,K/2)	if(K%j==0){
			x=i;cur=p[j];rep(k,1,K/j)	cur&=x,x>>=j;		
			G[K][i]=(G[K][i]+F[j][cur])%mod;
		}
		//F[K][i]=(F[K][i]+1ll*F[K-1][i>>1]*((i&1)+1))%mod;
		rep(j,1,K)	if(G[j][i&p[j]])	F[K][i]=(F[K][i]+1ll*G[j][i&p[j]]*F[K-j][i>>j])%mod;
	}
}	

void init(){
	int i;
	rep(i,1,50)	p[i]=(1ll<<i)-1;
	F[0][0]=1;
	G[1][0]=F[1][0]=1;F[1][1]=G[1][1]=2;
	rep(i,2,lim)	work(i);
}

int solve(int K,ll w,int d){
	if(K<=lim)	return F[K][w];
	int i,j,k;ll cur;int x;int opt;
	//memset(dp[d],0,(K+1)*sizeof(int));
	rep(i,0,K)	dp[d][i]=0;
	dp[d][0]=1;
	rep(i,0,K-1) if(dp[d][i]){
		if(K-i<=lim){dp[d][K]=(dp[d][K]+1ll*dp[d][i]*F[K-i][w>>i])%mod;continue;}
		opt=(w>>i)&1;
		dp[d][i+1]=(dp[d][i+1]+1ll*dp[d][i]*(opt+1))%mod;
		rep(j,1,(K-i)>>1){		
			for(cur=(w&p[i+j])>>i,x=i+j,k=2;k<=(K-i)/j;k++){
				cur&=(w&p[x+j])>>x;x+=j;
				dp[d][x]=(dp[d][x]+1ll*dp[d][i]*solve(j,cur,d+1))%mod;
			}
		}
	}
	return dp[d][K];
}

int getG(int l,int r){
	if(r-l+1<=lim)	return G[r-l+1][c[l][r]];
	int len=r-l+1;int ret=0;int i;
	ll cur;int x;
	rep(i,1,len/2)	if(len%i==0){
		for(cur=p[i],x=l;x<=r;x+=i)	cur&=c[x][x+i-1];
		ret=(ret+solve(i,cur,1))%mod;
	}
	return ret;
}		

int main(){
	//freopen("a.in","r",stdin);
	//freopen("a.out","w",stdout);
	int i,j;
	init();
	scanf("%s",s+1);n=strlen(s+1);
	rep(i,1,n)	a[i]=s[i]-'0';
	for(i=n;i;i--)	rep(j,i,n)	c[i][j]=(c[i+1][j]<<1)+(a[i]&1);
	rep(i,1,n)	rep(j,i,n)	g[i][j]=getG(i,j);
	dp[0][0]=1;
	rep(i,0,n-1) rep(j,i+1,n) dp[0][j]=(dp[0][j]+1ll*dp[0][i]*g[i+1][j])%mod;
	printf("%d\n",dp[0][n]);
}
			
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

Measured memory_bytes: 71936
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

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

    vector<int> a, b;

    int amax = -1;

    for (int i = 0; i < n; i++) {
        int a_, b_;
        cin >> a_;
        cin >> b_;

        a.push_back(a_);
        b.push_back(b_);

        amax = max(a_, amax);
    }

    int cnt = 0;

    sort(b.begin(), b.end());
    for (int i = b.size() - 1; 0 <= i; i--) {
        if (b[i] < amax)
            continue;

        cnt++;
        h -= b[i];
        if (h <= 0) {
            cout << cnt << endl;
            return 0;
        }
    }

    cnt += h / amax + !!(h % amax);
    cout << cnt << endl;
}

Measured memory_bytes: 1276
#include <iostream>
#define MAX 1000001
using namespace std;

bool dp[MAX];

int getAns(int n){

  int cnt = 0;
  for( int i = 1 ; i <= n ; i++ )
    if( !dp[i] ) cnt++;

  return cnt;
}


int main(void){

  int a,b,n;
  while( cin >> n >> a >> b , n + a + b ){

    fill(dp, dp + MAX, false);
    dp[0] = true;

    for( int i = 0 ; i <= n ; i++ ){
      if( dp[i] ){
	if( i + a <= n ) dp[i + a] = true;
	if( i + b <= n ) dp[i + b] = true;
      }
    }
    cout <<  getAns(n) << endl;
  }
  return 0;
}

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

typedef long long ll;
typedef long double ld;
const ld eps = 0;//1e-18;

long long k, num, power[17], add = 1;

int f(ll a) {
	int res = 0;
	while(a) {
		res += a % 10;
		a /= 10;
	}
	return res;
}

ld check(ll a) {
	if(!a)
		return 0;
	return ld(a * 1. / f(a));
}

bool suit(ll a) {cerr << "check: " << a << '\n';
	int l = ceil(log10(a));
	ll num = power[l];
	for (int j = 0; j < 16; j++) {
		if(check(num) + eps < check(a))
			return false;
		if(a == 109)
			cerr << num << ' ' << fixed << check(num) << ' ' << fixed << check(a) << " info\n";
		num += 9LL * power[j];
	}
	return (check(num) + eps > check(a));
}

int main() {
	power[0] = 1;
	for (int i = 1; i < 17; i++)
		power[i] = power[i - 1] * 10;
	cin >> k;
	for (int i = 0; i < k; i++) {
		/*while(!suit(num + add))
			add *= 10;*/
		while(check(num + add) > check(num + 10 * add))
			add *= 10;
		num += add;
		cout << num << '\n';
	}
	return 0;
}

Measured memory_bytes: 256
from math import gcd
import sys
input = sys.stdin.readline
n=int(input())
dic={}
z=0
mod=10**9+7
for i in range(n):
    a,b=map(int,input().split())
    if a==b==0:
        z+=1
        continue
    k=gcd(a,b)
    a//=k
    b//=k
    if b<0:
        a=-a
        b=-b
    if b==0 and a<0:
        a=-a
    if a<=0:
        a,b=b,-a
        if (a,b) in dic:
            dic[(a,b)][0]+=1
        else:
            dic[(a,b)]=[1,0]
    else:
        if (a,b) in dic:
            dic[(a,b)][1]+=1
        else:
            dic[(a,b)]=[0,1]
ans=1
for x in dic:
    v=dic[x]
    s = v[0]
    t = v[1]
    ans*=pow(2,s,mod)+pow(2,t,mod)-1
    ans%=mod
print((z-1+ans)%mod)

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

int main(){
  long long m, n;
  cin >> n >> m;
  long long ans = min(n, m / 2);
  n -= ans; m -= ans * 2;
  if (n != 0) cout << ans << endl;
  else {
    cout << ans + m / 4 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;
typedef pair<int,int> pr;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")



int H,W;
vector<string> v(30);

bool check(int x, int y){
    if(x < 0 || x >= H) return false;
    if(y < 0 || y >= W) return false;
    if(v[x][y] == '#')  return false;

    return true;
};


int main(){

    cin >> H >> W;

    //destination, -1 is yet visited
    vector<vector<int>> dist(H,vector<int>(W,-1));
    for(int i = 0; i < H; i++){
        cin >> v[i];
    }

    int max_val = 0;



    int dx[4] = {0,1,0,-1};
    int dy[4] = {1,0,-1,0};
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){

            int tmp_val = 0;
            // i,jをスタートとして、最も遠いところを探す
            if(v[i][j] == '#') continue;

            queue<pr> q;
            q.push(make_pair(i,j));
            dist.assign(H, vector<int>(W,-1));
            dist[i][j] = 0;

            while(!q.empty()){
                pr now = q.front();
                q.pop();
                int now_x = now.first;
                int now_y = now.second;
                for(int k = 0; k < 4; k++){
                    int next_x = now_x + dx[k];
                    int next_y = now_y + dy[k];
                    if(check(next_x, next_y)){
                        if(dist[next_x][next_y] == -1){
                            dist[next_x][next_y] = dist[now_x][now_y] + 1;
                            //save the max distance
                            tmp_val = max(tmp_val, dist[next_x][next_y]);
                            q.push(make_pair(next_x, next_y));
                        }
                    }
                }
            }
            max_val = max(max_val, tmp_val);
        }
    }
    cout << max_val << endl;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N = 1e5+7;
const ll mod = 1e9+7;
int a[N];
int n,k,ans,now;
int main()
{
    scanf("%d%d",&n,&k);
    printf("%d\n",n-k+1);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,N;
  int OK= 1;
  cin >> N >> A;
  for (int X=0; X<=N; X+=500){
    if(N-X<=A){
      OK=2;
    }
  }
  if(OK==2){
    cout << "Yes" <<endl;
  }
  else{
    cout << "No" <<endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define REP(i,b,e) for ( int i = b; i < e; i++)
#define rep(i,n) for (int i = 0; i < n; i++)
static const int MAX = 8;
static const int di[4] = {0, -1, 0, 1};
static const int dj[4] = {1, 0, -1, 0};

int H, W, C, G[MAX+2][MAX+2], V[MAX+2][MAX+2];
int cnt, ans;

void init(){ 
  REP(i, 1, H+1) REP(j, 1, W+1) V[i][j] = 0; 
  cnt = 0;
}

void fillc(int color, int i, int j, int prec){
  G[i][j] = color;
  V[i][j] = 1;
  cnt++;
  rep(r, 4){
    int ni = i + di[r];
    int nj = j + dj[r];
    if ( G[ni][nj] == prec && V[ni][nj] == 0) fillc(color, ni, nj, prec);
  }
}

void solve(int d){
  int T[MAX+2][MAX+2];

  if ( d == 4 ){
    init();
    fillc(C, 1, 1, G[1][1]);
    init();
    fillc(C, 1, 1, G[1][1]);
    ans = max(ans, cnt);
    return;
  }
  
  REP(a, 1, 7) {
    REP(i, 1, H+1) REP(j, 1, W+1) T[i][j] = G[i][j]; 
    init();
    fillc(a, 1, 1, G[1][1]);
    solve(d+1);
    REP(i, 1, H+1) REP(j, 1, W+1) G[i][j] = T[i][j];
  }
}

main(){
  while(1){
    cin >> H >> W >> C;
    if ( H == 0 ) break;
    rep(i, H+2) rep(j, W+2) G[i][j] = 0;
    rep(i, H) rep(j, W) cin >> G[i+1][j+1];
    ans = 0;
    solve(0);
    cout << ans << endl;
  }
}

Measured memory_bytes: 1164
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

int n;
int dp[1 << 18][55];
int a[18], b[18];
int main(){
    cin >> n;
    REP(i, n)cin >> a[i];
    REP(i, n)cin >> b[i];
    REP(i, (1 << 18))REP(j, 55)dp[i][j] = HINF<int>();
    dp[0][0] = 0;
    REP(bit, (1 << n)){
        REP(i, n){
            if(bit & (1 << i)){
                int lim = (i % 2 == (popcnt(bit) - 1) % 2 ? a[i] : b[i]);
                int cost = 0;
                for(int j = 0;j < i;j++)cost += ((bit & (1 << j)) == 0 ? 1 : 0);
                for(int j = 0;j <= lim;j++){
                    if(dp[bit - (1 << i)][j] == HINF<int>())continue;
                    dp[bit][lim] = min(dp[bit][lim], dp[bit - (1 << i)][j] + cost);
                }
            }
        }
    }
    int ans = HINF<int>();
    REP(i, 51)ans = min(ans, dp[(1 << n) - 1][i]);
    cout << (ans == HINF<int>() ? -1 : ans) << endl;

    /*REP(i, (1 << n)){
        for(int j = 0;j <= 50;j++){
            if(dp[i][j] == HINF<int>())continue;
            cout << i << " " << j << " " << dp[i][j] << endl;
        }
    }*/
}

Measured memory_bytes: 56576
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
const in mdl=1000000007;
VVI wy;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  in n,m,k;
  cin>>n>>m>>k;
  in ml=(n+m-1)/(k-1);
  wy.resize(ml+1,VI(m+1,0));
  wy[0][0]=1;
  in sm=0;
  for(in l=1;l<=ml;++l){
    for(in pu=0;pu<=m;++pu){
      for(in nu=1;nu<=k-1;++nu){
	if(nu+pu>m)
	  break;
	if((m-pu-nu)%(k-1)==0 && ((l-1)*(k-1)+k-(nu+pu)<=n))
	  sm+=wy[l-1][pu];
      }
    }
    for(in pu=0;pu<=m;++pu){
      for(in nu=0;nu<=k-1;++nu){
	if(nu+pu>m)
	  break;
	wy[l][nu+pu]+=wy[l-1][pu];
	wy[l][nu+pu]%=mdl;
      }
    }
  }
  sm%=mdl;
  cout<<sm<<endl;
  return 0;
}


Measured memory_bytes: 62976
n = int(input())
X = []
for _ in range(n):
    x, y = map(int, input().split())
    X += [(x, y)]

from itertools import permutations
import math

def calc_distance(z_list):
    dist = 0
    (_x, _y) = z_list[0]
    for _x2, _y2 in z_list[1:]:
        dist += math.sqrt(abs(_x-_x2)**2+abs(_y-_y2)**2)
        _x = _x2
        _y = _y2
    return dist

ans = 0
for z in permutations(X):
    ans += calc_distance(z)

print(ans/math.factorial(n))


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

typedef long long ll;

ll N;
vector<vector<ll>> Adj;
vector<vector<ll>> Dist;
const ll INF = 1ll << 60;
vector<ll> Color;

bool bipartite_check(ll v, ll c) {
  if (Color[v] != -1) return Color[v] == c;
  Color[v] = c;
  for (ll w : Adj[v])
    if (!bipartite_check(w, 1 - c)) return false;
  return true;
}
ll solve() {
  if (!bipartite_check(0, 0)) return -1;
  for (ll k = 0; k < N; ++k)
    for (ll i = 0; i < N; ++i)
      for (ll j = 0; j < N; ++j)
        Dist[i][j] = min(Dist[i][j], Dist[i][k] + Dist[k][j]);
  ll r = 0;
  for (ll i = 0; i < N; ++i)
    for (ll j = 0; j < N; ++j) {
      if (Dist[i][j] != INF) r = max(r, Dist[i][j]);
    }
  return r + 1;
}
int main() {
  cin >> N;
  Adj.resize(N);
  Dist.resize(N);
  for (auto &dist : Dist) dist.resize(N, INF);
  for (ll i = 0; i < N; ++i) Dist[i][i] = 0;
  for (ll i = 0; i < N; ++i)
    for (ll j = 0; j < N; ++j) {
      char c;
      cin >> c;
      if (c == '1') {
        Adj[i].push_back(j);
        Dist[i][j] = 1;
      }
    }
  Color.resize(N, -1);
  cout << solve() << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
typedef vector<int> V;
typedef V::iterator VI;

int main(void)
{
	int n;
	
	while (scanf("%d", &n), n != 0){
		bool card[256] = {false};
		V player[2];
		
		for (int i = 0; i < n; i++){
			int t;
			scanf("%d", &t);
			player[0].push_back(t);
			card[t] = true;
		}
		sort(player[0].begin(), player[0].end());
		for (int i = 1; i <= 2 * n; i++){
			if (!card[i]) player[1].push_back(i);
		}/*
		for (int i = 0; i < 2; i++){
			for (int j = 0; j < player[i].size(); j++){
				printf("%d ", player[i][j]);
			}
			puts("");
		}*/
		int field = -1;
		while (!player[0].empty() && !player[1].empty()){
			for (int i = 0; i < 2; i++){
				if (field == -1){
					field = player[i][0];
					player[i].erase(player[i].begin());
				}
				else {
					VI vi = upper_bound(player[i].begin(), player[i].end(), field);
					if (vi == player[i].end()){
						field = -1;
					}
					else {
						field = *vi;
						player[i].erase(vi);
					}
				}
				//printf(" %d\n", field);
			}
		}
		printf("%u\n%u\n", player[1].size(), player[0].size());
	}
}

Measured memory_bytes: 1064
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define M 1000000007

int main(){
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll n,k;
	cin >> n >> k;
	ll a,b;
	vector <ll> pos,neg;
	ll p=0, z=0;
	for(ll i=0; i<n; i++){
		cin >> a;
		if(a>0){
			p++;
			pos.pb(a);
		}
		else if(a==0)
			z++;
		else
			neg.pb(a);
	}

	sort(pos.begin(), pos.end(), greater<ll>());
	sort(neg.begin(), neg.end());
	if(k>(n-z)){
		cout << 0;
		return 0;
	}
	else if(k==(n-z) && (n-p)%2==1 && z>0){
		cout << 0;
		return 0;
	}
	else if(k==(n-z) && (n-p)%2==1){
		ll h=1;
		for(int i=0; i<p; i++){
			h = (h*pos[i])%M;
		}
		for(int i=0; i<n-p; i++){
			h = (h*neg[i])%M;
		}
		h = (h+M)%M;
		cout << h;
		return 0;
	}
	else if(k%2==1 && p==0 && z>0){
		cout << 0;
		return 0;
	}
	else if(k%2==1 && p==0){
		ll h=1;
		for(ll i=0; i<k; i++){
			h = (h*neg[n-i-1])%M;
		}
		h = (h+M)%M;
		cout << h;
		return 0;
	}

	ll h=1;
	a=0;
	b=0;
	if(k%2==1){
		k--;
		h = (h*pos[a])%M;
		a++;
	}

	pos.pb(-1);
	pos.pb(1);
	neg.pb(1);
	neg.pb(-1);
	for(ll i=0; i<k; i+=2){
		ll m;
		if(pos[a]*pos[a+1] > neg[b]*neg[b+1]){
			m = pos[a]*pos[a+1];
			a+=2;
		}
		else{
			m = neg[b]*neg[b+1];
			b+=2;
		}
		m%=M;
		h = (h*m)%M;
	}

	h = (h+M)%M;
	cout << h;









	
	

	return 0;
}

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

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

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const int T = 1e6+3;
const int N = 42;
bitset<T> bit[N];
bitset<T> my;
vector<ll> v;
int n,k;

int main() {
    ios_base::sync_with_stdio(false);
    cin >> n >> k;
    vector<ll> ve(n);
    for(int i = 0; i < n; i++) cin >> ve[i];

    for(int i = 0; i < n; i++) {
        ll sum = 0;
        for(int j = i; j < n; j++) {
            sum += ve[j];
            v.pb(sum);
        }
    }

    for(int i = 0; i < v.size(); i++) {
        ll x = v[i];
        for(ll j = 1, casa = 0; j <= x; j <<= 1, casa++)
            if(x&j) bit[casa][i] = 1;
    }

    ll ans = 0;
    my.set();

    for(int ok = N-1; ok >= 0; ok--) {
        if(bit[ok].count() >= k) {
            bitset<T> tmp = my&bit[ok];
            if(tmp.count() >= k) {
                ans += (1ll << ok);
                my &= bit[ok];
            }
        }
    }

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 8172
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
map<pair<int,int>,int>m;
int main(){
  int n,a,b,c,p=0;
  cin>>n;
  while(n--){
    cin>>a>>b>>c;
    r(i,2)r(j,2)
      p=max(p,m[make_pair(a+i,b+j)]+=c);
  }
  cout<<p<<" / 1"<<endl;      
}

Measured memory_bytes: 28084
#include <stdio.h>

int main(){
	int H1, M1, H2, M2, K;
	scanf("%d %d %d %d %d", &H1, &M1, &H2, &M2, &K);
	
	int A = H1 * 60 + M1;
	int B = H2 * 60 + M2 - K;
	
	printf("%d", (A-B)*-1);
	
	
	return 0;
}

Measured memory_bytes: 1704
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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; }

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//

int main() {
    init();
    ll N;
    cin>>N;
    string s1, s2;
    cin >> s1 >> s2;

    ll ans = (s1[0] == s2[0] ? 3 : 2);
    s1 = "#" + s1, s2 = "." + s2;
    vl stat(N + 1);
    stat[0] = 1;
    repe(i,1,N+1){
        if (s1[i] == s1[i - 1]){
            stat[i] = 1;
            continue;
        }

        if(s1[i]==s2[i]){
            if(stat[i-1]==0){
                ans *= 2;
                ans %= MOD;
            }
        }else{
            if(stat[i-1]==0)
                ans *= 2;
            else
                ans *= 3;
            ans %= MOD;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  string s,t;
  char u[2*n+1];
  int x=0,y=0,l=0;
  cin>>s>>t;
  while(y!=n)
  {
        u[l]=s[x];
        x++;
    l++;
    u[l]=t[y];
    y++;
    l++;
  }
  for(int i=0;i<2*n;i++)
  cout<<u[i];
  cout<<endl;

}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
 long long a ,b ,x;
 cin>>a >>b >>x;
 if(a%x==0)
 	cout<<((b/x)-(a/x))+1;
 	else
 	cout<<((b/x)-(a/x));
 	return 0;
 
}

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

using namespace std;

int dp[3100][3100];

int main(){
    string s, t;
    cin >> s >> t;

    for(int i=0; i<s.size(); ++i){
        dp[i][0] = 0;
    }

    for(int j=0; j<t.size(); ++j){
        dp[0][j] = 0;
    }

  //memset(dp, 0, sizeof(dp));    // kottinoga raku


    for(int i=0; i<s.size(); ++i){
        for(int j=0; j<t.size(); ++j){
            if(s[i] == t[j]){
                dp[i+1][j+1] = max(dp[i+1][j], dp[i][j] + 1);
                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j+1]);

            }else{
                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j]);
            }
        }
    }

    //fukugen
    string res = "";
    int i = (int)s.size(); 
    int j = (int)t.size();

    while(i >0 && j > 0){
        // (i-1, j) -> (i, j) と更新されていた場合
        if (dp[i][j] == dp[i-1][j]) {
            --i; // DP の遷移を遡る
        }

        // (i, j-1) -> (i, j) と更新されていた場合
        else if (dp[i][j] == dp[i][j-1]) {
            --j; // DP の遷移を遡る
        }

        // (i-1, j-1) -> (i, j) と更新されていた場合
        else {
            res = s[i-1] + res; // このとき s[i-1] == t[j-1] なので、t[j-1] + res でも OK
            --i, --j; // DP の遷移を遡る
        }
    }


    //cout << dp[s.size()][t.size()] << endl;
    cout << res << endl;
}

Measured memory_bytes: 37120
n = int(input())
ans = []
    
for i in range(1,int(n**0.5) + 1):
  if (n/i).is_integer():
    a = len(str(i))
    b = len(str(int(n/i)))
    x = max(a,b)
    ans.append(x)
    

print(min(ans))

Measured memory_bytes: 9324
#include<iostream>
using namespace std;
#define rep(i,x,n) for(int i=x;i<n;i++)
using ll=long long;

int N;
int A[15];
int x[15][15],y[15][15];

int main(){
    cin>>N;
    rep(i,0,N){
        cin>>A[i];
        rep(j,0,A[i]){
            cin>>x[i][j]>>y[i][j];
        }
    }
    
    int ans=0;
    rep(bits,0,(1<<N)){
        bool flag=true;
        rep(i,0,N){
            if(!((bits>>i)&1)) continue;
            rep(j,0,A[i]){
                if(((bits>>(x[i][j]-1))&1)^y[i][j]){
                    flag=false;
                    break;
                }
            }
            if(!flag) break;
        }
        if(flag){
            int count=0;
            rep(i,0,N){
                if((bits>>i)&1) count++;
            }
            ans=max(ans,count);
        }
    }
    cout<<ans<<endl;    
}

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

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

  int sum = 0, tmp = n;
  while (tmp > 0) {
    sum += tmp % 10;
    tmp /= 10;
  }

  if (n % sum == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef pair<int,int> pint;
typedef long long ll;
const int inf   = 1<<30;
const ll  longinf = 1LL<<60;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
int main(){
  int n,m;
  cin>>n>>m;
  int ok1[n],okn[n];
  rep(i,n)ok1[i+1]=okn[i+1]=0;
  int a[m],b[m];
  rep(i,m){
    cin>>a[i]>>b[i];
    if(a[i]==1)
      ok1[b[i]]=1;
    if(a[i]==n)
      okn[b[i]]=1;
    if(b[i]==1)
      ok1[a[i]]=1;
    if(b[i]==n)
      okn[a[i]]=1;
    }
  rep(i,n){
    if(ok1[i+1]==1&&okn[i+1]==1){
      cout<<"POSSIBLE"<<endl;
      return 0;
      }
    }
  cout<<"IMPOSSIBLE"<<endl;
  return 0;
  }

      


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,i;
	cin>>k>>n;
	int arr[n];
	for(i=0 ; i<n ; i++){
		cin>>arr[i];
	}
	sort(arr,arr+n);
	int minm=k+1,cur;
	for(i=0 ; i<n ; i++){
		if(i==0){
			cur=arr[n-1] - arr[i];
		}
		else{
			cur= k - (arr[i] - arr[i-1]);
		}
		minm=min(cur,minm);
	}
	cout<<minm<<endl;
	return 0;
}

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

vector<vector<vector<double>>> dp;
int N;

double calc(int n1, int n2, int n3){
    if(dp[n1][n2][n3] >= 0) return dp[n1][n2][n3];

    double ret = 1.0*N;
    if(n1 > 0) ret += n1*calc(n1-1,n2,n3);
    if(n2 > 0) ret += n2*calc(n1+1,n2-1,n3);
    if(n3 > 0) ret += n3*calc(n1,n2+1,n3-1);

    dp[n1][n2][n3] = ret/(n1+n2+n3);
    return dp[n1][n2][n3];
}

int main(){
    cin >> N;
    vector<int> a(3+1);
    for(int i=0; i<N; i++){
        int n;  cin >> n;
        a[n]++;
    }

    dp = vector<vector<vector<double>>>(N+1, vector<vector<double>>(N+1, vector<double>(N+1, -1)));
    dp[0][0][0] = 0.0;
    cout << setprecision(12) << calc(a[1],a[2],a[3]) << endl;
}


Measured memory_bytes: 216960
using System;
using System.Linq;
using System.Collections.Generic;
    
class Program
{
    static void Main(string[] args)
    {
        string[] ABHM = Console.ReadLine().Split(' ');
        int A = int.Parse(ABHM[0]);
        int B = int.Parse(ABHM[1]);
        double H = double.Parse(ABHM[2]);
        double M = double.Parse(ABHM[3]);

        double theta = Math.PI * (H + M / 60) / 6;
        double phi = Math.PI * M / 30;

        double answer = Math.Sqrt(A * A + B * B - 2*A*B * (Math.Cos(theta) * Math.Cos(phi) + Math.Sin(theta) * Math.Sin(phi)));

        Console.WriteLine(answer);
    }
}

Measured memory_bytes: 27940
//g++ -std=gnu++14 a.cpp

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
//#include <ostream>


using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

int main(){
  string S;
  cin >> S;
  if(S == "ABC"){
    cout << "ARC" << endl;
  }else{
   cout << "ABC" << endl;
}
 }


Measured memory_bytes: 3596
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoderC
{
    class Program
    {
        static void Main(string[] args)
        {
            string n = Console.ReadLine();

            string[] aList = Console.ReadLine().Split(' ');
            int[] numbers = new int[3001];
            int i = 0;
            foreach (string token in aList)
            {
                numbers[i] = int.Parse(token);
                i++;
            }


            int sum = 0;
            foreach (int num in numbers)
            {
                if (num == 0) { break; }
                sum += num - 1;
            }

            Console.WriteLine(sum);
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11188
#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
    int X, Y;
    cin >> X >> Y;
    for (int c = 0; c <= X; ++c) {
        if (2 * c + 4 * (X - c) == Y) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


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

int main(){
    int n;
    
    cin >>n;
    for (int i=1; i<=n; i++){
        int x=i/10,y=x/10,z=y/10;
        if(i%3==0) cout << " "<<i;
        else if(i%10==3 || x%10==3 || y%10==3 || z%10 == 3) cout << " " <<i;
    
    }cout << endl;
    return 0;
}


Measured memory_bytes: 3108
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>

using namespace std;
#define i64  long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807

void solve(void)
{


  std::vector<string> str_vec;

  while(true)
  {
    string str;
    cin>>str;

    if(str == "0") break;
    else
    {
      str_vec.push_back(str);
    }
  }

  for (int i = 0; i < str_vec.size(); i++)
  {
    int sum = 0;
    for (int j = 0; j < str_vec[i].size(); j++)
    {
      sum += int(str_vec[i][j] - '0');
    }
    cout<<sum<<endl;
  }
  
  return;
}

int main(int argc, const char *argv[])
{

  solve();

  return 0;
}



Measured memory_bytes: 3212
#include <stdio.h>
#include <math.h>
int main(void)
{
	int n, q, S[10000], T[500], count = 0, i, j;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &S[i]);
	}
	scanf("%d", &q);
	for (i = 0; i < q; i++) {
		scanf("%d", &T[i]);
	}
	for (i = 0; i < q; i++) {
		for (j = 0; j < n; j++) {
			if (S[j] == T[i]) {
				count++; break;
			}
		}
	}
	printf("%d\n", count);
}

Measured memory_bytes: 1068
#include <iostream>
#include <vector>
#define MAX 1e5 + 1

int main() {
    int n, q, temp;
    long long sum = 0;
    std::cin >> n;
    std::vector<int> a(MAX, 0);

    for (int i = 0; i < n; i++) {
        std::cin >> temp;
        a.at(temp)++;
        sum += temp;
    }
    std::cin >> q;
    std::vector<long long> b(q), c(q);
    for (int i = 0; i < q; i++) {
        std::cin >> b[i] >> c[i];
    }

    for (int j = 0; j < q; j++) {
        sum -= b[j] * a.at(b[j]);
        sum += c[j] * a.at(b[j]);
        a.at(c[j]) += a.at(b[j]);
        a.at(b[j]) = 0;

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

    return 0;
}

Measured memory_bytes: 5044
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
// using Graph = vector<vector<int>>;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  string s, t;
  cin >> s >> t;
  int dp[s.length() + 1][t.length() + 1];
  rep(i, s.length() + 1) rep(j, t.length() + 1) dp[i][j] = 0;
  rep(i, s.length()) rep(j, t.length()) {
    if (s[i] == t[j]) {
      dp[i + 1][j + 1] = dp[i][j] + 1;
    } else {
      dp[i + 1][j + 1] = max(dp[i][j + 1], dp[i + 1][j]);
    }
  }
  /* rep(i, s.length() + 1) {
    rep(j, t.length() + 1) { cout << dp[i][j]; }
    cout << endl;
  } */
  string ans = "";
  int i = s.length(), j = t.length();
  while (i > 0 && j > 0) {
    if (dp[i][j] == dp[i - 1][j])
      i--;
    else if (dp[i][j] == dp[i][j - 1])
      j--;
    else {
      i--;
      j--;
      ans = s[i] + ans;
    }
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
  int N, A;
  cin >> N >> A;
  int i = N / 500;
  if( N % 500 == 0){
    if( A - (N - 500*i - 500) > 0){
      cout << "Yes" << endl;
    }else {
      cout << "No" << endl;
    }
  }else if(A - (N - 500*i) >= 0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }

}

Measured memory_bytes: 256
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
# import math
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# sys.setrecursionlimit(int(pow(10, 2)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]





# @lru_cache(None)

n,k=l()
ans=0
for i in range(1,n+1):
    if(i<k):
        x=1
        while(i*(2**(x))<k):
            x+=1
        # print(i,x)
        ans+=Fraction(1,n)*(Fraction(1,2)**x)
    else:
        ans+=Fraction(1,n)
print(ans.numerator/ans.denominator)


Measured memory_bytes: 5116
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int sx = scanner.nextInt();
		int sy = scanner.nextInt();
		int tx = scanner.nextInt();
		int ty = scanner.nextInt();
		scanner.close();

		// 1
		for (int i = 0; i < tx - sx; i++) {
			System.out.print("R");
		}
		for (int i = 0; i < ty - sy; i++) {
			System.out.print("U");
		}

		// 2
		for (int i = 0; i < tx - sx; i++) {
			System.out.print("L");
		}
		for (int i = 0; i < ty - sy; i++) {
			System.out.print("D");
		}

		// 3
		System.out.print("D");
		for (int i = 0; i < tx - sx + 1; i++) {
			System.out.print("R");
		}
		for (int i = 0; i < ty - sy + 1; i++) {
			System.out.print("U");
		}
		System.out.print("L");

		// 4
		System.out.print("U");
		for (int i = 0; i < tx - sx + 1; i++) {
			System.out.print("L");
		}
		for (int i = 0; i < ty - sy + 1; i++) {
			System.out.print("D");
		}
		System.out.println("R");

	}

}


Measured memory_bytes: 40332
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define Rep(n) for (ll _ = 0; _ < (ll)(n); _++) 
#define fs first
#define sc second
#define _GLIBCXX_DEBUG

template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
ll min(int a,ll b){return min((ll)a,b);} ll min(ll a,int b){return min(a,(ll)b);}

template <class S>
void print(vector<S> &v){for(ll i=0; i<(ll)v.size(); i++){
		cerr << v[i] << ' ';
	}
	cerr << endl;
}
template <class S>
void print(vector<vector<S>> &v) {
  	for (ll i = 0; i < (ll)v.size(); i++) {
    	for (ll j = 0; j < (ll)v[i].size(); j++) {
      		cerr << v[i][j] << ' ';
    	}
    	cerr << endl;
  	}
}

const int mod = 998244353;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }

};
mint comb(int n, int r){
    mint si(1); mint bo(1);
    for(int i=0; i<r; i++){
        bo *= (i+1);
        si *= (n-i);
    }
    return si / bo;
}
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

int main(){
	int n,m,k;
	cin >> n >> m >> k;
	mint ans;
	mint color(m-1);
	color = color.pow(n-k-1) * m;
	mint kumi = comb(n-1,k);
	for(int p=k; p>=0; p--){
		ans += kumi * color;
		color *= (m-1);
		kumi = kumi * p / (n-p);
	}
	cout << ans << endl;
}


Measured memory_bytes: 3556
#include<bits/stdc++.h>
using namespace std;
string x,y;
int dp[3003][3003];
pair<int,int>path[3003][3003];
void gp(int i,int j)
{
    if(path[i][j].first!=0&&path[i][j].second!=0)gp(path[i][j].first,path[i][j].second);
    if(x[i-1]==y[j-1])cout<<x[i-1];
}
int main()
{
    cin>>x>>y;
    for(int i=1;i<=x.size();i++)
    {
        for(int j=1;j<=y.size();j++)
        {
            if(i==0||j==0)dp[i][j]=0;
            if(x[i-1]==y[j-1])
            {
                dp[i][j]=dp[i-1][j-1]+1;
                path[i][j]={i-1,j-1};
            }
            else
            {
                if(dp[i-1][j]>dp[i][j-1])
                {
                    dp[i][j]=dp[i-1][j];
                    path[i][j]={i-1,j};
                }
                else
                {
                    dp[i][j]=dp[i][j-1];
                    path[i][j]={i,j-1};
                }
            }
        }
    }
    gp(x.size(),y.size());
}


Measured memory_bytes: 106112