akhauriyash/Code-Regression huggingface dataset:
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>

using namespace std;
long long MOD = 1000000007LL;
template<class T>
T gcd(T x, T y) {
	return y ? gcd(y, x % y) : x;
}

template<class T>
vector<T> enum_div(T n) {
	vector<T> ret;
	for (T i = 1; i * i < n; ++i) {

		if (n % i == 0) {
			ret.push_back(i);

			if (i != 1 && i * i != n) {
				ret.push_back(n / i);
			}
		}
	}
	return ret;
}

template<class T>
map<T, int> prime_factorization(T n) {
	map<T, int> ret;

	for (long long i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}

	if (n != 1)ret[n] = 1;
	return ret;
}

template<class T>
long long C(T n, T r) {
	static map<pair<T, T>, long long> _map;
	if (n < r) return 0;

	if (n == r || r == 0) {
		_map[make_pair(n, r)] = 1ll;
	}
	else if (_map[make_pair(n, r)] == 0) {
		_map[make_pair(n, r)] = (C(n - 1, r) + C(n - 1, r - 1));
	}

	_map[make_pair(n, r)] %= MOD;
	return _map[make_pair(n, r)];
}

int main() {
	string S;
	cin >> S;
	vector<long long> A(S.length() + 1, 0);
	for (int i = 0; i <= S.length(); ++i) {
		for (int j = i + 1; j <= S.length(); ++j) {
			if (S[i] != S[j]) {
				if (S[i] == '>') {
					for (int k = 0; i != j - k; ++k) {
						A[j - k - 1] = A[j - k] + 1;
					}
					if (0 < i) {
						A[i] = max(A[i], A[i - 1] + 1);
					}
				}
				else {
					for (int k = 0; i + k != j; ++k) {
						A[i + k + 1] = A[i + k] + 1;
					}
				}
				i = j - 1;

				break;
			}
		}
	}

	long long ans = 0;
	for (int i = 0; i < A.size(); ++i) {
		ans += A[i];
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4740
#include<iostream>
using namespace std;
 
int main(){
    int a,b,c;
	int temp;

	cin >> a >> b >> c;
	
	if(a>b){
		temp=a;
		a=b;
		b=temp;
	}

	if(b>c){
		temp=b;
		b=c;
		c=temp;
	}

	if(a>b){
		temp=a;
		a=b;
		b=temp;
	}

	cout << a << " "<< b << " "<< c << endl;

	return 0;
}

Measured memory_bytes: 1164
#include <stdio.h>
int main(void) {
	int d,m1,m2,m3,i;
	m1=0;
	m2=0;
	m3=0;
	for(i=0;i<10;i++){
	scanf("%d",&d);
	if(d>m1){
		m3=m2;
		m2=m1;
		m1=d;
	}else if(d>m2){
		m3=m2;
		m2=d;
	}else if(d>m3){
		m3=d;
	}
}
	printf("%d\n",m1);
	printf("%d\n",m2);
	printf("%d\n",m3);
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define int long long
#define range(i, a, b) for(auto i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
#define all(a) (a).begin(),(a).end()
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const long double EPS = 1e-8;
using vi = vector <int>;
using vvi = vector <vi>;

signed main() {
	int h, w, d;
	cin >> h >> w >> d;
	pair <int, int> a[h * w];
	int cost[h * w] = {};
	rep (i, h) rep (j, w) {
		int in;
		cin >> in;
		in--;
		a[in] = {i, j};
	}
	rep (i, h * w) {
		if (i < d) continue;
		cost[i] += cost[i - d]
						 + abs(a[i].first - a[i - d].first)
						 + abs(a[i].second - a[i - d].second);
	}

	int q;
	cin >> q;
	rep (i, q) {
		int l, r;
		cin >> l >> r;
		l--; r--;
		cout << cost[r] - cost[l] << endl;
	}
	return 0;
}

Measured memory_bytes: 3200
#include <iostream>
using namespace std;
int main(){
  int a;
  cin >> a;
  a = a % 10;
  if(a==3)
    cout << "bon" << endl;
  else if((a==0 || a==1 )|| (a==6 || a==8))
    cout << "pon" << endl;
  else 
    cout << "hon" << endl;
  return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int64_t def (int64_t i) {
  if (i>=0)return i;
  else return -i;
}
int main() {
  int64_t X,K,D;
  cin >> X;
  X=def(X);
  cin >> K;
  cin >> D;
  int64_t Y=X/D;
  if (Y>K) cout << X-K*D << endl;
  else {
    if (Y%2==K%2) {
      int64_t A=X-D*Y;
      int64_t B= def (X-D*(Y+2));
      int64_t Z=min(A,B);
      cout << Z << endl;
    }
    else {
      int64_t A=X-D*(Y-1);
      int64_t B= def (X-D*(Y+1));
      int64_t Z=min(A,B);
      cout << Z << endl;
    }
  }
}


Measured memory_bytes: 3568
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

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

    ll ans=1e18;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            ans=min(ans,(n/i)+i-2);
        }
    }
    cout<<ans;
}

Measured memory_bytes: 256
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <stack>
#include <random>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;

void manu(vector<int> &da) {
    int n = da.size();
    vector<int> ret(n);
    rip(i,n,0) {
        int now = i + da[i] + 1;
        if(now < n) ret[now] --;
        now = i - da[i];
        if(0 <= now) ret[now]++;
        else ret[0] ++;
    }
    rip(i,n,1) ret[i] += ret[i-1];
    da = ret;
    return;
}

bool alln(vector<int> &da) {
    int n = da.size();
    rip(i,n,0) if(da[i] != n) return false;
    return true;
}

int main() {
    int n,k; cin >> n >> k;
    vector<int> da(n);
    rip(i,n,0) cin >> da[i];
    while(!alln(da) && k > 0) {
        --k;
        manu(da);
    }
    vdeb(da);
}

Measured memory_bytes: 4792
#include<iostream>
#include<string>
using namespace std; 
typedef pair<int,int> P; 
int dy[4]={0,0,1,-1}; 
int dx[4]={1,-1,0,0}; 
int main(){ 
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    cout<<s1[0]<<s2[1]<<s3[2]<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#define ll long long; int
using namespace std;


int main(void) {
    int n;
    string s;
    cin >> n;
    cin >> s;
    int count = 0;
    for(int i = 0; i < n; i++) {
        if(s[i] == s[i + 1]) {
            count++;
        }
    }
    int ans = n - count;
    cout << ans << endl;
    return 0;
}

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

#define Art Code
#define Artist Shivam Gupta
#define MoT This Art belongs to Artist
#define FASTIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vl(p) vector<p>
#define W while
#define For(i,s,x) for(i=s;i<x;i++)
#define Fore(i,s,x) for(i=s;i<=x;i++)
#define FoR(i,s,x) for(i=s-1;i>=x;i--)
#define ForE(i,s,x) for(i=s;i>=x;i--)
#define all(v) v.begin(),v.end()
#define pb push_back
#define in insert
#define sz size()
#define F first
#define S second
#define nl cout<<"\n"
#define pr(a) cout<<a<<" "
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define pr3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define trace2(x, y)             cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)          cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)       cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)    cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
#define mod 1000000007
#define MAX 200005

int main() {
    FASTIO;
    ll t=1, i, j, k, l;
    // cin>>t;
    W(t--) {
        ll n, m;
        cin>>n>>k;
        ll a[n+1];
        Fore(i,1,n) cin>>a[i];
        ll dp[k+1]={};
        // Fore(i,a[1],a[n]) dp[i]=1;
        Fore(i,0,k)
            Fore(j,1,n)
                if(i-a[j]>=0&&dp[i-a[j]]==0) dp[i]=1;
        if(dp[k]) pr("First");
        else pr("Second");  
    }
    return 0;
}

Measured memory_bytes: 4336
/* 
	Author: ankrypt
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int
#define ff first
#define ss second
#define all(x) x.begin(), x.end() 
#define ub upper_bound
#define lb lower_bound
#define MAX_INT 15
#define PI 3.141592653589793
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fi(a, b, c, d) for(int a = b; a < c; a += d)
#define fl(a, b, c, d) for(ll a = b; a < c; a += d)
#define fei(a, b, c, d) for(int a = b; a <= c; a += d)
#define fel(a, b, c, d) for(ll a = b; a <= c; a += d)
#define quit exit(0)
#define mem(x, a) memset(x, a, sizeof x)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pcl pair<char, ll>
#define psl pair<string, ll>


ll N, M, A, B, C;
ll arr[MAX_INT], arr1[MAX_INT], data[MAX_INT];
vector<ll> V;
unordered_map<ll, ll> mp;
set<ll> s;
string S = "";
ll cases;

int main() {
	go;
	char X;
    fi(i, 0, 3, 1) {
    	cin >> S;
    	if(i == 1) {
    		stringstream ss(S);
    		string word = "";
    		while(ss >> word) {
    			X = word[0];
    		}

    	}
    }
    cout << "A" << X << "C\n";
    
	return 0;
}
/*
	Powered by Buggy Plugin
*/




Measured memory_bytes: 3604
import itertools
import math

N = int(input())
pn = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
ans = []
cnt = 0


for ar in itertools.permutations(pn,3):
    if math.factorial(N) > (ar[0]**2*ar[1]**4*ar[2]**4) and\
    math.factorial(N) % (ar[0]**2*ar[1]**4*ar[2]**4) == 0:
        ans.append(ar[0]**2*ar[1]**4*ar[2]**4)

for ar in itertools.permutations(pn,2):
    if math.factorial(N) > (ar[0]**4*ar[1]**14) and\
    math.factorial(N) % (ar[0]**4*ar[1]**14) == 0:
        ans.append(ar[0]**4*ar[1]**14)

for ar in itertools.permutations(pn,2):
    if math.factorial(N) > (ar[0]**2*ar[1]**24) and\
    math.factorial(N) % (ar[0]**2*ar[1]**24) == 0:
        ans.append(ar[0]**2*ar[1]**24)

for ar in pn:
    if math.factorial(N) > ar**74 and\
    math.factorial(N) % ar**74 == 0:
        ans.append(ar**74)

ans = set(ans)
print(len(ans))

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define fr(i,j,n)   for(int i=j;i<(n);++i)
#define bk(i,j,n)   for(int i=j;i>n;--i)
#define mset(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define pop pop_back
#define mod 1000000007
#define all(x) x.begin(),x.end()
#define inf 1e18
#define iosbase ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F first
#define S second
#define bye return

int main()
{
    ll n,i;
    cin>>n;

    set<string>S;
    fr(i,0,n)
    {   string s;
        cin>>s;
        S.insert(s);
    }

    cout<<S.size()<<endl;
}

Measured memory_bytes: 19052
#include<iostream>
#include<vector>

using namespace std;

int main() {
    vector<int> a(5);
    int k;
    for (int i = 0; i < 5; i++){
        cin >> a[i];
    }
    cin >> k;

    if (a[4] - a[0] <= k){
        cout << "Yay!" << endl;
    } else{
        cout << ":(" << endl;
    }
    return 0;
}

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

signed main(){
	int N,K; cin>>N>>K;
	priority_queue<int,vector<int>,greater<int>> que;
	map<int,int> dic;
	for(int i=0;i<N;i++){
		int a; cin>>a; dic[a]++;
	}
	for(auto p : dic){
		que.push(p.second);
	}
	int ans=0;
	while(que.size()>K){
		ans+=que.top();
		que.pop();
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 14964
import itertools
import math
import sys
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(4100000)
from functools import lru_cache
INF = 1 << 60

#ここから書き始める
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)


Measured memory_bytes: 64748
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)

using namespace std;

const int N=3005;
int n,a[N],x,y,cnt,head[N];
struct edge{int to,nxt;}e[N<<1];

void adde(int x,int y){
	e[++cnt].to=y; e[cnt].nxt=head[x]; head[x]=cnt;
}

int dfs(int u,int par){
	int flag=0;
	for (int i=head[u],v;i;i=e[i].nxt){
		v=e[i].to;
		if (a[v]<a[u])
			if (!dfs(v,u)) flag=1;
	}
	return flag;
}

int main(){
	scanf("%d",&n);
	rep (i,1,n) scanf("%d",&a[i]);
	rep (i,1,n-1) scanf("%d%d",&x,&y),adde(x,y),adde(y,x);
	rep (i,1,n) if (dfs(i,0)) printf("%d ",i);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<cstring>
#include<algorithm>
#include<stack>
#include<set>
#include<map>
#include<vector>
#include<cmath>
using namespace std;
char a[1000];
int main(){
	int n,ans=0,s1=0,s2=0,s3=0;
	cin>>n;
	int t=n;
	while(t--){
		cin>>a;
		int m=strlen(a);
		for(int i=0;i<m-1;i++){
			if(a[i]=='A'&&a[i+1]=='B') ans++;
		}
		if(a[0]=='B'&&a[m-1]=='A') s1++;
		else if(a[0]=='B') s2++;
		else if(a[m-1]=='A') s3++;
	}
	if(s2==0&&s3==0){
		if(s1) s1--;
		ans+=s1;
	}
	else if(s2==0){
		ans+=s1;
	}
	else if(s3==0){
		ans+=s1;
	}
	else{
		ans+=min(s2,s3)+s1;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
int n;
bool a[101];

int main() {
	scanf("%d", &n);
	for(int i = 1; i <= 9; i++)
		for(int j = 1; j <= 9; j++)
			a[i*j] = true;
	if(a[n])
		puts("Yes");
	else
		puts("No");
	return 0;
}


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

int main() {
  
  int H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;
  
  int M3 = (H2*60 + M2) - (H1*60 + M1);
  cout << M3 - K;
}
  

Measured memory_bytes: 3572
#include<bits/stdc++.h>
#define mx 100005
using namespace std;

long long n, a[mx], b, dif[mx], mns, sm, u;


int main(){
	scanf("%d", &n);
	for(int i = 0; i < n; i++) scanf("%d", &a[i]);
	for(int i = 0; i < n; i++){
		scanf("%d", &b);
		dif[i] = a[i] - b;
	}
	sort(dif, dif+n);

	for(mns = 0; mns < n && dif[mns] < 0; mns++){

		sm += dif[mns];
	}
	for(; u < n && sm < 0; u++){
		sm += dif[n-1-u];
	}
	printf("%d", sm < 0 ? -1 : u + mns);
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair < ll, ll > PLL;
#define rep(i,n) for (int i = 0; i < (n); ++i)
ll MOD = 1e4+7;
ll gcd ( ll a, ll b) {
    if ( b > a ) swap(a, b);
    if ( a % b == 0 ) return b;
    return gcd(b, a % b);
};
int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) {
//        int tmp_a;
//        cin >> tmp_a;
//        if ( tmp_a == k ) {
//            cout << "POSSIBLE" << endl;
//            return 0;
//        }
//        a[i] = tmp_a;
        cin >> a[i];
    }
//    if ( n == 1 ) {
//        if ( a[0] != k ) {
//            cout << "IMPOSSIBLE" << endl;
//        }
//        else {
//            cout << "POSSIBLE" << endl;
//        }
//        return 0;
//    }
    sort(a.begin(), a.end());
    ll gcd_num = a[0];
    rep(i, n-1) gcd_num = gcd(gcd_num, a[i+1]);
    if ( k % gcd_num == 0 && k <= a[n-1] ) {
        cout << "POSSIBLE" << endl;
    }
    else {
        cout << "IMPOSSIBLE" << endl;
    }
    return 0;
}


Measured memory_bytes: 1024
sx, sy, tx, ty = list(map(int, input().split()))

ans = ""
first = "R"*(tx-sx) + "U"*(ty-sy)
second = "L"*(tx-sx) + "D"*(ty-sy)
third = "DR" + first + "UL"
fourth = "UL" + second + "DR"

ans = first + second + third + fourth
print(ans)

Measured memory_bytes: 3060
# -*- coding: utf-8 -*-
import heapq

n, m = map(int, input().split())
ab = []
for _ in range(n):
    heapq.heappush(ab, tuple(map(int, input().split())))

ab = [heapq.heappop(ab) for i in range(len(ab))]
cost = 0
for a, b in ab:
    if b < m:
        cost += a * b
        m -= b
    else:
        cost += a * m
        break

print(cost)


Measured memory_bytes: 17052
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(double x){
  printf("%.15f",x);
}
int N;
int A[100];
int main(){
  double res=0;
  int i;
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<(N);Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
    }
  }
  for(i=0;i<(N);i++){
    res += 1.0 / A[i];
  }
  res = 1.0 / res;
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190820-1

// --- original code ---
// int N, A[100];
// {
//   double res = 0;
//   rd(N,A(N));
//   rep(i,N) res += 1.0 / A[i];
//   res = 1.0 / res;
//   wt(res);
// }


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;
#define pb push_back
#define fi first
#define se second
#define in insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int mod = 1e9 + 7;
void solve(){
    string s;
    cin >> s;
    cout << s[0] << s.size() - 2 << s[s.size() - 1];
}
int main(){
    speed;
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; ++i) {
        solve();
    }
}

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

void show(int nums[], int n) {
    for (int k = 0; k < n; ++k) {
        if( k == n - 1) {
            cout << nums[k];
        } else {
            cout << nums[k] << " ";
        }
    }
    cout << endl;
}

void bubble_sort(int nums[], int n) {
    int flag = 1;
    int count = 0;
    for(int i = 0; flag; i++) {
        flag = 0;
        for (int j = n - 1; j >= i + 1 ; --j) {
           if(nums[j] < nums[j - 1]) {
               int temp = nums[j];
               nums[j] = nums[j - 1];
               nums[j - 1] = temp;
               flag = 1;
               count++;
           }
        }
    }

    show(nums, n);
    cout << count << endl;
}

int main()
{
    int n;
    cin >> n;
    int nums[n];
    for (int i = 0; i < n; ++i) {
        cin >> nums[i];
    }
    bubble_sort(nums, n);
    return 0;
}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
int n,m,dis[100005],ans[100005];
vector<int> v[100005];
bool vis[1000005];
queue<int> q;
void bfs(int a){
    dis[a]=0;
    vis[a]=1;
    q.push(a);
    while(!q.empty()){
        int top=q.front();
        q.pop();
        for(int i =0;i<v[top].size();i++){
            if(!vis[v[top][i]]){
                ans[v[top][i]]=top;
                dis[v[top][i]]=dis[top]+1;
                vis[v[top][i]]=1;
                q.push(v[top][i]);
            }
        }
    }
}
void dfs(int u , int bef){
    if(vis[u])return;
    if(u>1&&dis[u]!=dis[bef]+1)return;
    ans[u]=bef;
    vis[u]=1;
    for(int i =0;i<v[u].size();i++){
        dfs(v[u][i],u);
    }
}
int main(){
    cin>>n>>m;
    while(m--){
        int a,b;
        cin>>a>>b;
        v[a].pb(b);
        v[b].pb(a);
    }
    bool sabi=1;
    bfs(1);
    for(int i =1;i<=n;i++){
        if(!vis[i])sabi=0;
    }
    if(!sabi){
        cout<<"No"<<endl;
        return 0;
    }
    // cout<<'l'<<endl;
    // memset(vis,0,sizeof(vis));
    // dfs(1,0);
    cout<<"Yes"<<endl;
    for(int i =2;i<=n;i++){
        cout<<ans[i]<<endl;
    }
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

ll M,N;
vector<int> g[100000];

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

  cin>>M;
  N=-1;
  repl(i,1,100000){
    if(i*(i-1)/2==M){
      N=i;
      break;
    }
  }
  if(N==-1){
    cout<<"No"<<endl;
    return 0;
  }
  ll idx=0;
  rep(i,N)rep(j,i){
    g[i].push_back(idx);
    g[j].push_back(idx++);
  }
  cout<<"Yes"<<endl;
  cout<<N<<endl;
  rep(i,N){
    cout<<g[i].size();
    rep(j,g[i].size())cout<<" "<<g[i][j]+1;
    cout<<endl;
  }

  return 0;
}


Measured memory_bytes: 4608
#include<bits/stdc++.h>
#include<boost/variant.hpp>
using namespace std;
typedef long long ll;
typedef vector<boost::variant<bool, ll, int, string, double, char*, const char*>> any;
template<typename T> inline void pr(const vector<T> &xs){
	for(int i=0; i<xs.size()-1; i++) cout<<xs[i]<<" ";
	(xs.empty()?cout:(cout<<xs[xs.size()-1]))<<endl;
}
#ifdef DEBUG
#define debug(...) pr(any{__VA_ARGS__})
#define debugv(x) pr((x))
#else
#define debug(...)
#define debugv(x)
#endif

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

	vector<bool> dp(X+1, 0);
	dp[0] = true;
	for(int i=1; i<=X; i++){
		for(int x=100; x<=105; x++){
			if(i-x>=0 && dp[i-x]){
				dp[i] = true;
				break;
			}
		}
	}

	cout << (dp[X]?1:0) << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
//typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){int i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}






int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin>>N;
  vector<ll> prt(N,0),cnt(N,0),dp(N,0);
  vector<vector<ll>> cld(N);
  for(int i=1;i<N;i++){cin>>prt[i]; prt[i]--; cnt[prt[i]]++; cld[prt[i]].push_back(i);}
  queue<ll> Q;
  for(int i=0;i<N;i++){
    if(cnt[i]==0){Q.push(i);}
  }
  while(!Q.empty()){
    ll u=Q.front(); Q.pop();
    sort(cld[u].begin(),cld[u].end(),[&](ll a,ll b){return dp[a]>dp[b];});
    for(int i=0;i<(int)cld[u].size();i++){
      dp[u]=max(dp[u],dp[cld[u][i]]+i+1);
    }
    cnt[prt[u]]--;
    if(cnt[prt[u]]==0){Q.push(prt[u]);}
  }
  cout<<dp[0]<<endl;
  


  return 0;
}


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

struct Circle
{
    double x , y , r;
};

auto distance (double x , double y) -> double
{
    return std::sqrt (x * x + y * y);
}

auto solve (const Circle & A , const Circle & B) -> int
{
    auto d = distance (A.x - B.x , A.y - B.y);
    if (d > A.r + B.r)
    {
        return 0;
    }
    else if (std::abs (A.r - B.r) > d)
    {
        return A.r > B.r ? 2 : - 2;
    }
    else
    {
        return 1;
    }
}

auto main () -> int
{
    Circle A , B;
    int n;
    std::cin >> n;
    for (auto i = 0; i < n; ++ i)
    {
        std::cin >> A.x >> A.y >> A.r >> B.x >> B.y >> B.r;
        std::cout << solve (A , B) << std::endl;
    }
}

Measured memory_bytes: 3168
import bisect
s=input()
t=input()
alp=[[] for _ in range(26)]
flag=1
for i in range(len(s)):
    alp[ord(s[i])-97].append(i)
#print(alp)

idx=0
sets=0
i=0
while i<len(t):
    al=ord(t[i])-97
    if len(alp[al])==0:
        flag=0
        break
    else:
        if idx>alp[al][len(alp[al])-1]:
            sets=sets+1
            idx=-1
        else:
            idx=bisect.bisect_left(alp[al],idx)
            idx=alp[al][idx]+1
            i=i+1
    #print(sets,idx)
    #input()
if flag==1:
    print(sets*len(s)+idx)
else:
    print("-1")
"""
l=[0,1,2,3,4,5,6,7,8,9]
for i in range(10):
    idx=bisect.bisect_left(l,i)
    idx2=bisect.bisect_right(l,i)
    print(l[idx],l[idx2])
"""

Measured memory_bytes: 74384
antenas = []
k = 0
for i in range(6):
    if i == 5:
        k = int(input())
    else:
        antenas.append(int(input()))
antenas.sort()
dist = antenas[-1] - antenas[0]
if dist > k:
    print(":(")
else:
    print("Yay!")


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	Integer steps[];
	Long results[];

	public Main(int n, Integer a[]) {
		steps = new Integer[n];
		results = new Long[n];
		for (int i = 0; i < steps.length; i++) {
			steps[i] = 1;
			results[i] = -1L;
		}
		for (int e : a) {
			steps[e] = 0;
		}

	}

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int m = s.nextInt();
		Integer a[] = new Integer[m];
		for (int i = 0; i < m; i++) {
			a[i] = s.nextInt();
		}
		System.out.println(
				new Main(n, a).calc(0));
	}

	public long calc(int prefix) {
		Long shortcut = results[prefix];
		long result;
		if (shortcut != -1L) {
			return shortcut;
		}
		if (prefix >= steps.length) {
			result = 0;
		} else if (prefix == steps.length - 1) {
			result = 1;
		} else if (prefix == steps.length - 2) {
			result = 1 + (((steps[prefix + 1] == 1) ? 1 : 0));
		} else {
			result = (((steps[prefix + 1] == 1) ? calc(prefix + 1) : 0) +
					((steps[prefix + 2] == 1) ? calc(prefix + 2)
							: 0));
			result %=  1_000_000_007L;
		}
		results[prefix] = result;
		return result;
	}
}

Measured memory_bytes: 64364
#include<stdio.h>
#define MAX 100

int main(){

  int n,A[MAX+1],B[MAX+1][MAX+1];
  int i,j,k,u,sum;
  scanf("%d",&n);


  for(i=1;i<=n;i++){
    scanf("%d%d",&A[i-1],&A[i]);
  }

  for(i=1;i<=n;i++)B[i][i]=0;
  
    for(u=2;u<=n;u++){
      for(i=0;i<=n-u+1;i++){
	j = i+u-1;
	B[i][j] = (1<<30);
	for(k=i;k<=j-1;k++){
	  sum = B[i][k] + B[k+1][j] + A[i-1] * A[k] * A[j];
	  if(B[i][j] > sum)  B[i][j] = sum;
	  } 
	}
      }
    
  

  printf("%d\n",B[1][n]);

  return 0;

}

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

int N;

int max_move(vector<int> &H, int i){
  int a = 0;
  int j = i;
  while(j<=N-1){
    if(H[j]>=H[j+1]){
      j++;
      a++;
    }
    else{
      break;
    }
  }
  return a;
}

int main() {
  cin >> N;
  vector<int> H(N+1);
  for(int i=1;i<=N;i++){
    cin >> H[i];
  }
  
  int ans=0;
  int i=1;
  while(i<=N){
    int mov = max_move(H, i);
    ans = max(ans, mov);
    i = i + mov + 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#pragma region Macros
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define all(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
#define CEIL(a,b) ((a+b-1)/b)
#define MOD 1000000007
int GCD(int a, int b) // assuming a,b >= 1
{
	if (a < b)
		swap(a, b);
	if (b == 0)
		return a;
	if (a % b == 0)
		return b;
	return GCD(b, a % b);
}
int LCM(int a, int b) // assuming a,b >= 1
{
	return  a * b / GCD(a, b);
}
inline bool BETWEEN(int x, int min,int max) {
	if (min <= x && x <= max)
		return true;
	else
		return false;
}
int cnt;
int combination(int n, int m) {
	cnt++;
	if (m > n - m)
		m = n - m;
	if (m == 0 || n == m)
		return 1;
	return combination(n - 1, m) + combination(n - 1, m - 1);
}



using namespace std;
#pragma endregion
signed main() {
		int n,k;
        cin >>n >>k;
		cout << (n-1)*(k-1);
}


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

if a == 0 and b == 0:
  c, d = 0, 0
elif a == 0:
  c = 0
  d = max(b-k, 0)
elif b == 0:
  c = max(a-k, 0)
  d = 0
elif a + b <= k:
  c = 0
  d = 0
elif k >= a:
  c = 0
  d = b - (k - a)
else:
  c = a - k
  d = b
print("{0} {1}".format(c,d))

Measured memory_bytes: 3064
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <cfloat>
#include <cmath>
#include <functional>

using namespace std;

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

#define EPSILON 1e-5
#define INF (INFINITY/3)
#define MOD 1000000007L

typedef pair<int, int> iiPair;
typedef pair<double, int> diPair;


class Main {
public:
	int getAns(vector<int>& arr,int c, int k) {
		sort(arr.begin(), arr.end());

		int n = arr.size();
		int count = 0;
		int num = INF;
		int last = INF;
		for (int i = n-1;i >= 0;i--) {
			if (num < c&&last <= arr[i] + k) {
				num++;
			}
			else {
				count++;
				num = 1;
				last = arr[i];
			}
		}
		return count;
	}
};


int main()
{
	int n,c,k;
	Main main;
	vector<int> arr;

	cin >> n >> c >> k;

	rep(i, n) {
		int inp;
		cin >> inp;
		arr.push_back(inp);
	}

	cout << main.getAns(arr, c, k) << endl;

	return 0;
}




Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)


void solve(long long N, long long A, long long B){
    if((B - A) % 2 == 0){
        cout << (B - A) / 2 << endl;
    }else{
        cout << min(N - B, A - 1) + (B - A + 1) / 2 << endl;
    }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long N;
    scanf("%lld",&N);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(N, A, B);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <algorithm>

using namespace std;
const int maxn = 110;
const double INF = 1e20;

int m , n;
int x1[maxn] , y1[maxn];
int x2[maxn] , z2[maxn];

double width(int* X , int* Y , int n , double x)
{
	double lb = INF , ub = -INF;
	for(int i=0;i<n;i++) 
	{
		double x1 = X[i] , y1 = Y[i] , x2 = X[(i+1)%n] , y2 = Y[(i+1)%n];
		if((x1-x)*(x2-x)<=0 && x1!=x2)
		{
			double y = y1+(y2-y1)*(x-x1)/(x2-x1);
			lb = min(lb , y);
			ub = max(ub , y);
		}
	}
	return max(0.0 , ub-lb); 
}

void solve()
{
	int min1 = *min_element(x1, x1+m) , max1 = *max_element(x1, x1+m);
	int min2 = *min_element(x2, x2+n) , max2 = *max_element(x2, x2+n);

	vector<int> xs;
	for(int i=0;i<m;i++) xs.push_back(x1[i]);
	for(int i=0;i<n;i++) xs.push_back(x2[i]);
	sort(xs.begin(), xs.end());
	
	double res = 0;
	for(int i=0;i+1<xs.size();i++) 
	{
		double a = xs[i] , b = xs[i+1] , c = (a+b)/2;
		if(min1<=c && c<=max1 && min2<=c && c<=max2)
		{
			double fa = width(x1, y1, m, a)*width(x2, z2, n, a);
			double fb = width(x1, y1, m, b)*width(x2, z2, n, b);
			double fc = width(x1, y1, m, c)*width(x2, z2, n, c);
			res+= (b-a)/6.0*(fa+4*fc+fb);
		}
	}
	printf("%.10lf\n",res);
}

int main(int argc, char *argv[]) {
	
	while(cin>>m>>n && n+m)
	{
		for(int i=0;i<m;i++) cin>>x1[i]>>y1[i];
		for(int i=0;i<n;i++) cin>>x2[i]>>z2[i];
		solve(); 
	}
	
	return 0;
}

Measured memory_bytes: 1248
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  bool f;
  auto s = readln.chomp;
  auto prev = 'a';
  foreach (e; s) {
    if (prev == e) {
      f = true;
    }
    prev = e;
  }

  if (f) {
    writeln("Bad");
  } else {
    writeln("Good");
  }
}


Measured memory_bytes: 256
/// إِنَّ مَعَ الْعُسْرِ يُسْرًا
/// لَا أَبْرَحُ حَتَّىٰ أَبْلُغَ

#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_cxx;
using namespace __gnu_pbds;
using namespace std;
template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define LL unsigned long long
#define ll long long
#define LD double
#define HabdModeActive ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define S second
#define F first
#define PI acos(-1)
#define MAX 5000005
#define file freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);


int main() {
    HabdModeActive
    LL n;
    cin>>n;
    LL arr[n];
    for(int i=0 ; i<n; i++)
        cin>>arr[i];

    LL lcm = arr[0];
    for(int i=1 ; i<n; i++)
    {
        lcm = (lcm*arr[i])/(__gcd(arr[i],lcm));
    }
    LL sum = 0;
    for(int i=0 ; i<n; i++)
        sum+=(lcm/arr[i]);

    double lc = lcm, su = sum;


    cout<<fixed<<setprecision(6)<<lc/su;


    return 0;
}


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


int main(){
  int N;
  cin >> N;
  
  vector<pair<int,int>>D(N);
  
  rep(i,N){
    cin >> D[i].first >> D[i].second;
  }
  
  int count = 0;
  
  rep(i,N){
    
    if(count >= 1){
      if(D[i].first == D[i].second){
        count++;
        if(count == 3){
          cout << "Yes" << endl;
          return 0;
        }
        continue;
      }
      else count = 0;
    }
    
    
    if(D[i].first == D[i].second){
      count++;
    }
    
  }
  cout << "No" << endl;
  return 0;
}

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

int main(){
    int n,i;
    char s;
    cin>>n;
    while(true){
        i++;
        cin>>s;
        if(s=='Y'){
            cout<<"Four"<<endl;
            break;
        }
        if(i==n){
            cout<<"Three"<<endl;
            break;
        }
        
    }
    
    return 0;
    

    
}


Measured memory_bytes: 3596
from math import pi, sin, cos, sqrt

a, b, h, m = [int(x) for x in input().split()]

t = 60*h + m
w_a = 2*pi/12/60
w_b = 2*pi/60
fi_a = pi/2+w_a*t
fi_b = pi/2+w_b*t

xa = a * cos(fi_a)
ya = a * sin(fi_a)

xb = b * cos(fi_b)
yb = b * sin(fi_b)

dist = sqrt((xa - xb)**2 + (ya - yb)**2)

print(dist)

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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << "\n";
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define endl "\n"
// gcj print用
#define Case(x) printf("Case #%d: ", x);

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<int>>> vvvl;
typedef vector<PI> vpi;
typedef vector<vector<PI>> vvpi;
typedef vector<vector<vector<PI>>> vvvpi;
typedef vector<PLL> vpl;
typedef vector<vector<PLL>> vvpl;
typedef vector<vector<vector<PLL>>> vvvpl;

int POWINT(int x, int n) {
  int ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

ll POWLL(ll x, int n) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

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

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

void print() {
  cout << endl;
}

template <class T>
void print(vector<T> &vec) {
  for (auto& a : vec) {
    cout << a;
    if (&a != &vec.back()) cout << " ";
  }
  cout << endl;
}

template <class T>
void print(vector<T> &vec, ll k){
   ll n = vec.size();
   k = min(k, n);
   rep(i, 0, k-1) cout << vec[i] << " ";
   cout << vec[k-1] << endl;
}

template <class T>
void print(vector<vector<T>> &df) {
  for (auto& vec : df) {
    print(vec);
  }
}

template<class T, class U>
void print(pair<T,U> &p){
  cout << p.first << " " << p.second << "\n";
}

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

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

  return 0;
};


Measured memory_bytes: 3644
using System;

class Print_a_Rectangle
{
  public static void Main()
  {
    while(true)
    {
      string number_str = Console.ReadLine();
      string[] number_tmp = number_str.Split();
      int H = int.Parse(number_tmp[0]);
      int W = int.Parse(number_tmp[1]);
      
      if(H==0&&W==0) break;
      
      for(int j=1;j<=W;j++)
      {
          Console.Write("#");
      }
      
      Console.WriteLine();
     
      for(int i=1;i<=H-2;i++)
      {
        for(int j=1;j<=W;j++)
        {
          if(j==1||j==W)
          {
            Console.Write("#");
          }else{
            Console.Write(".");
          }
        }
        Console.WriteLine();
      }
       
      for(int j=1;j<=W;j++)
        {
          Console.Write("#");
        }
      Console.WriteLine();
      Console.WriteLine();
      }
   }
}

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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
 
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
 
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
 
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

void solve(long long H, long long W, std::vector<std::vector<long long>> a){
    VI A,B,C,D;
    REP(i, H) {
        if(i%2==0) {
            REP(j, W-1) {
                if(a[i][j] % 2 == 1) {
                    a[i][j+1]++;
                    A.PB(j+1);
                    B.PB(i+1);
                    C.PB(j+2);
                    D.PB(i+1);
                }
            }
            if(i+1 != H && a[i][W-1] % 2 == 1) {
                a[i+1][W-1]++;
                A.PB(W);
                B.PB(i+1);
                C.PB(W);
                D.PB(i+2);
            }
        }else{
            for(int j=W-1; j>=1; j--) {
                if(a[i][j] % 2 == 1) {
                    a[i][j-1]++;
                    A.PB(j+1);
                    B.PB(i+1);
                    C.PB(j);
                    D.PB(i+1);
                }
            }
            if(i+1 != H && a[i][0] % 2 == 1) {
                a[i+1][0]++;
                A.PB(1);
                B.PB(i+1);
                C.PB(1);
                D.PB(i+2);
            }
        }
    }

    cout << A.size() << endl;
    REP(i, A.size()){
        cout << B[i] << " " << A[i] << " " << D[i] << " " << C[i] << endl;
    }
}

int main(){
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    std::vector<std::vector<long long>> a(H, std::vector<long long>(W));
    for(int i = 0 ; i < H ; i++){
        for(int j = 0 ; j < W ; j++){
            scanf("%lld",&a[i][j]);
        }
    }
    solve(H, W, std::move(a));
    return 0;
}


Measured memory_bytes: 6120
#include<iostream>
#include<stdio.h>
#include <stdlib.h>
using namespace std;

int main(){

    int n;
    int nihon=0, fore=0, non=0;
    int nihoncut, forecut;
    cin >> n >> nihoncut >> forecut;
    string s;
    cin >> s;
    int len = s.length();

    for(int i = 0; i < len; i++){
        switch(s[i]){
            case 'a' :
                if(nihon + fore < nihoncut + forecut){
                    cout << "Yes" << endl;
                    nihon++;
                }
                else cout << "No" << endl;
                break;
            case 'b' :
                if(nihon + fore < nihoncut + forecut && fore < forecut){
                    cout << "Yes" << endl;
                    fore++;
                }
                else cout << "No" << endl;
                break;
            case 'c' :
                cout << "No" << endl;
                break;

        }
    }


}


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

typedef long long ll;

int N;
vector<int> A;
vector<int> X;

void input_init(void) {
	cin >> N;
	A.resize(N);
	X.resize(N);
	for (int i = 0; i < N; ++i)
		cin >> A[i];
}

void solve(void) {
	ll s_all = (ll)0;
	ll s_even = (ll)0;
	for (int i = 0; i < N; ++i) {
		s_all += (ll)A[i];
		if (i % 2 == 0)
			s_even += (ll)A[i];
	}
	X[0] = (int)(s_even - (s_all / 2));
	for (int i = 1; i < N; ++i)
		X[i] = A[i - 1] - X[i - 1];
}

int main(void) {
	input_init();
	solve();
	for (int i = 0; i < N; ++i)
		cout << 2 * X[i] << ((i == N - 1)? '\n': ' ');
	return 0;
}


Measured memory_bytes: 2048
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	vector<string> v(9);
	v[0] = ".,!? ";
	v[1] = "abc";
	v[2] = "def";
	v[3] = "ghi";
	v[4] = "jkl";
	v[5] = "mno";
	v[6] = "pqrs";
	v[7] = "tuv";
	v[8] = "wxyz";
	int T; cin >> T;
	while (T--) {
		string s; cin >> s;
		int _i = -1, _j = -1;
		for (int k = 0; k < s.length(); k++) {
			int i = s[k] - '0';
			if (i == 0) {
				if (_i != -1) {
					cout << v[_i][_j];
					_i = -1; _j = -1;
				}
			}
			else {
				_i = i - 1;
				_j = (_j + 1) % v[_i].length();
			}
		}
		cout << endl;
	}
}

Measured memory_bytes: 1212
/*java 1.8*/
import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner scan=new Scanner(System.in);
    while(scan.hasNext()){
      int money=scan.nextInt();
      if(money==0)
        break;
      money=1000-money;

      /*500,100,50,10,5,1*/
      int a=money/500;
      money%=500;

      a+=money/100;
      money%=100;

      a+=money/50;
      money%=50;

      a+=money/10;
      money%=10;

      a+=money/5;
      money%=5;

      a+=money;

      System.out.println(a);
    }
  }
}


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

int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    //-----------------------------------------
    int N;
    cin >> N;

    unordered_map<ll, int> m;
    rep(i, N)
    {
        ll a;
        cin >> a;
        if(m[a]!=0)
        {
            cout << "NO" << endl;
            return 0;
        }
        else
        {
            m[a]=1;
        }
    }

    cout << "YES" << endl;
    return 0;
}


Measured memory_bytes: 8520
def main():
    N, M, *A = map(int, open(0).read().split())

    C = [0, 1, 4, 4, 3, 4, 5, 2, 6, 5]

    dp = [0] * (N + 1)
    for i in range(N):
        dp[i + 1] = max(dp[i - C[a]] * 10 + a if i - C[a] >= 0 else -1 for a in A)

    print(dp[N])

if __name__ == '__main__':
    main()


Measured memory_bytes: 14388
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        // w,h,x,y,r
        int w, h, x, y, r;

        w = scan.nextInt();
        h = scan.nextInt();
        x = scan.nextInt();
        y = scan.nextInt();
        r = scan.nextInt();

        if (x - r < 0 || y - r < 0)
            System.out.print("No\n");
        else if (x + r > w || y + r > h)
            System.out.print("No\n");
        else
            System.out.print("Yes\n");
    }
}


Measured memory_bytes: 26416
#include<iostream>
using namespace std;
int main()
{
int x;

cin>>x;
int arr[x];
bool ar[x][x];

for(int i=0;i<x;i++)
{
    for(int t=0;t<x;t++)
    {

        ar[i][t]=0;

    }
    }



for(int i=0;i<x;i++)
{
    cin>>arr[i];
}
int sam=0;
for(int i=0;i<x;i++)
{
    for(int t=0;t<x;t++)
    {if(t!=i &&  ar[i][t]!=1 && ar[t][i]!=1){
    ar[i][t]=1;
    ar[t][i]=1;
        sam=sam+(arr[i]*arr[t]);}
    }
}
cout<<sam;
    return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

class Main {
	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n=scanner.nextInt();
		int h=scanner.nextInt();
		int[] a=new int[n];
		int[] b=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=scanner.nextInt();
			b[i]=scanner.nextInt();
		}
		Arrays.sort(a);
		Arrays.sort(b);
		int l=-1;
		int r=b.length;
		while(r-l>1) {
			int mid=(l+r)/2;
			if(a[n-1]<b[mid]) {
				r=mid;
			}else {
				l=mid;
			}
		}
		int d=0;
		int cnt=0;
		for(int i=r;i<n;i++) {
			d+=b[n-1-i+r];
			cnt++;
			if(d>=h) {
				System.out.println(cnt);
				return;
			}
		}
		h-=d;
		System.out.println(cnt+(int)Math.ceil((double)h/a[n-1]));
	}
}

Measured memory_bytes: 89600
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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

int main(){
    ll n, k; cin >> n >> k;
    ll ans = 0;
    ll mid = (n - k) / k;
    ans += (mid+1) * (mid+1) * (mid+1);
    if(k > n){
        ans = 0;
    }
    if(k%2 == 0){
        mid = (n-k/2) / k;
        if(!((k/2) >n)){
            ans += (mid+1) * (mid+1) * (mid+1);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
s = input()

l = 0
r = 0
for si in s:
  if si == "(":
    r += 1
  else:
    if r == 0:
      l += 1
    else:
      r -= 1
ans = ""
for _ in range(l):
  ans += "("
ans += s
for _ in range(r):
  ans += ")"
print(ans)



Measured memory_bytes: 80908