akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long int llint;
typedef unsigned long long int ullint;
#define loop(i,N) for(int i=0; i<(N); i++)
template<typename T>
auto sort_all(T& v) { return std::sort(v.begin(),v.end()); }
template<typename T>
auto sum_all(const T& v) { auto z = v[0]; z = 0;
    return std::accumulate(v.begin(),v.end(),z); }
template<typename T>
auto input(int N) {
    std::vector<T> v(N);
    loop(i,N) std::cin >> v[i];
    return std::move(v);
}

int main(void)
{
    int N;
    cin >> N;
    auto L = input<int>(N);
    sort_all(L);

    int ans = 0;
    for(int i=0;   i<N-2; i++)
    for(int j=i+1; j<N-1; j++)
    for(int k=j+1; k<N;   k++) {
        if(L[k] < L[i]+L[j]) {
            ans ++;
        } else {
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
/**
*
* Author: MARS
* Lang: GNU C++14
*
**/

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define ii pair < int , int >
#define LS pair < ll , string >

typedef unsigned long long ull;
typedef long double ldbl;
typedef long long ll;
typedef double dbl;

const ldbl E = 2.71828182845904523536;
const ldbl pi = acos(-1);
const dbl eps = 1e-9;
const ll mod = 1e9+7;
const ll inf = 1LL<<30;

/** /////////// ** Code ** /////////// **/

const int N=100100;
int a[N];

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

    int ans=1;
    n-=k;

    ans+=(n+k-2)/(k-1);
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    string S;
    cin >> S;
    VEC(int) last(26, -1);
    int start = -1, end = -1;
    FOR(i, 0, S.size()) {
        int x = S[i] - 'a';
        if (last[x] >= 0) {
            int total = i + 1 - last[x];
            if (total <= 3) {
                start = last[x] + 1;
                end = i + 1;
                goto done;
            }
        }

        last[x] = i;
    }
done:
    cout << start << " " << end << endl;
    return 0;
};


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

const int INF = 1000000000;

int dp[1005][(1 << 12)];

int main(){
  int N, M;
  cin >> N >> M;
  int a[M], b[M];
  vector<int> c[M];
  for(int i = 0; i < M; i++){
    cin >> a[i] >> b[i];
    for(int j = 0; j < b[i]; j++){
      int d;
      cin >> d;
      d--;
      c[i].push_back(d);
    }
  }

  fill(dp[0], dp[1005], INF);
  dp[0][0] = 0;
  for(int i = 0; i < M; i++){
    int msk = 0;
    for(int j = 0; j < b[i]; j++){
      msk += (1 << c[i][j]);
    }

    for(int j = 0; j < (1 << N); j++){
      dp[i + 1][j] = dp[i][j];
    }

    for(int j = 0; j < (1 << N); j++){
      dp[i + 1][j | msk] = min(dp[i + 1][j | msk], dp[i][j] + a[i]);
    }
  }

  /*for(int i = 0; i <= M; i++){
    for(int j = 0; j < (1 << N); j++){
      cout << dp[i][j] << " ";
    }
    cout << endl;
  }*/

  if(dp[M][(1 << N) - 1] == INF){
    cout << -1 << endl;
  } else {
    cout << dp[M][(1 << N) - 1] << endl;
  }
  return 0;
}


Measured memory_bytes: 16384
#include<iostream>
#include<algorithm>
#include<string>
#include<fstream>

#define SIZE 9

using namespace std;

int main(){
	int n;
	int map[16][16];
	int matatabi[16][16];
	int m;
	int mx1,my1,mx2,my2;
	int gx,gy;
	cin>>n;
	while(n--){
		cin>>gx>>gy;
		cin>>m;
		int map[16][16] = {};
		int matatabi[16][16] = {0};
		map[0][0] = 1;
		while(m--){
			cin>>mx1>>my1>>mx2>>my2;
			if(mx1 == mx2){
				my1 = min(my1,my2);
				matatabi[mx1][my1] +=1;
			}else{
				mx1 = min(mx1,mx2);
				matatabi[mx1][my1] +=2;
			}
		}
		for(int x=0; x<=gx ;x++){
			for(int y=0; y<=gy; y++){
				if(matatabi[x][y] == 0){
					if(x+1 <= gx) map[x+1][y] += map[x][y];
					if(y+1 <= gy) map[x][y+1] += map[x][y];
				}else{
					switch(matatabi[x][y]){
					case 1:
						if(x+1 <= gx) map[x+1][y] += map[x][y];
						break;
					case 2:
						if(y+1 <= gy) map[x][y+1] += map[x][y];
						break;
					case 3:
						break;
					}
				}
			}
		}
		if(map[gx][gy] != 0)cout<<map[gx][gy]<<endl;
		else cout<<"Miserable Hokusai!"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>

#define BUILD 4
#define FLOOR 3
#define ROOM 10

int main(void)
{
	int house[BUILD][FLOOR][ROOM];
	int n, b, f, r, v, i, j, k, line;

	for(i = 0;i < BUILD;i++)
		for(j = 0;j < FLOOR;j++)
			for(k = 0;k < ROOM;k++)
				house[i][j][k] = 0;
	scanf("%d", &n);
	for(i = 0;i < n;i++)
	{
		scanf("%d %d %d %d", &b, &f, &r, &v);
		house[b - 1][f - 1][r - 1] += v;
	}
	for(i = 0;i < BUILD;i++)
	{
		for(j = 0;j < FLOOR;j++)
		{
			for(k = 0;k < ROOM;k++)
				printf(" %d", house[i][j][k]);
			printf("\n");
		}
		if(i != 3)
		{
			for(line = 0;line < 20;line++)
				printf("#");
				printf("\n");
		}
	}

	return 0;
}

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

string s;
int k;

int main() {
  cin >> k >> s;
  if (s.size() > k) {
    rep (i, k) {
      cout << s[i];
    }
    cout << "..." << endl;
  }else{
    cout << s << endl;
  }
  return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

struct edge{
	int to;
	int id;
};

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<vector<edge>> g(N);
	rep(i,N-1){
		int a,b;
		cin >> a >> b;
		a--;b--;
		edge x,y;
		x.to = a;
		x.id = i;
		y.to = b;
		y.id = i;
		g[a].push_back(y);
		g[b].push_back(x);
	}
	queue<int> q;
	vector<bool> used(N);
	used[0] = 1;
	vector<int> ans(N-1);
	q.push(0);
	while(!q.empty()){
		int v = q.front();q.pop();
		int color = 1;
		int prev = -1;
		for(int i=0;i<g[v].size();i++){
			edge e = g[v][i];
			if(ans[e.id]){
				prev = ans[e.id];
				break;
			}
		}
		for(int i=0;i<g[v].size();i++){
			edge e = g[v][i];
			if(used[e.to])continue;
			if(ans[e.id])continue;
			if(color == prev)color++;
			ans[e.id] = color;
			color++;			
			q.push(e.to);
			used[e.to] = 1;
		}
	}
	int mx=0;
	rep(i,N-1) mx = max(mx,ans[i]);
	cout << mx << endl;
	rep(i,N-1)cout << ans[i] << endl;
}

Measured memory_bytes: 7040
#include<stdio.h>
#define MAX 100000
int main(void) { 
	int n, k;

	char a[MAX];


	scanf("%d", &n);
	scanf("%d", &k);
	//scanf("%s", &a);
	int i=0;
	int temp;

	/*for (i = 0; i < k; i++) {
		temp=(a[n+i] - '0');
	}*/

	printf("%d", (n - 2) / (k - 1) + 1);
	



	return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<string,int>;

const int MOD = 1e9 + 7;

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

    int a, b, c, x;
    cin >> a >> b >> c >> x;

    int ans = 0;
    rep(i, a+1){
        rep(j, b+1){
            rep(k, c+1){
                int tmp = x - (500 * i) - (100 * j) - (50 * k);
                if(tmp == 0) ans++;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string a,b;
    cin>>a>>b;
    string tmp = a+b;
    int num = atoi(tmp.c_str());
    for(int i=1;i*i<=num;i++){
        if(i*i==num){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cctype>
#include<string>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <utility> 

#define rep(i,m,n) for(int i = m;i < n;i++)
using namespace std;
using ll = long long;
using R = double;
const ll inf = 1LL << 50;





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

	int cnt=0;
	rep(i, 0,s.size()) {
		if (s[i] == 'g') {
			cnt++;
		}
		else {
			cnt--;
		}
	}

	int ans;
	if (cnt % 2 == 1) {
		ans = (cnt - 1) / 2;
		cout << ans << endl;
	}
	else {
		ans = cnt / 2;
		cout << ans << endl;
	}

	
	return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  
  if (a >= 13)
    cout << b;
  else if (a >= 6)
    cout << b / 2;
  else
    cout << 0;
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
import Control.Applicative
import Control.Monad
import Control.Monad.ST
-- import qualified Data.ByteString as BS
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
--import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
import GHC.ST
-- import System.IO.Unsafe
 
-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
getDoubles = map readDouble . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
tjoin :: (Show a, Show b) => (a, b) -> String
tjoin (x, y) = show x ++ (' ' : show y)
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
coverC :: Ord a => (a, a) -> a -> Bool
coverC (l,r) x = l<=x && x<=r
coverH :: Ord a => (a, a) -> a -> Bool
coverH (l,r) x = l<=x && x<r
ibsearch :: (Int -> Bool) -> (Int,Int) -> Int
ibsearch f (ok,ng) = if abs (ok-ng) <= 1 then ok else let mid = (ok + ng) `div` 2 in ibsearch f (if f mid then (mid,ng) else (ok,mid))
-- templete

f n ps = maximum $ map (uncurry min) $ zip [1..n] $ sortBy (flip compare) ps

main = do
    n <- getInt
    ps <- getInts
    print $ f n ps



Measured memory_bytes: 4088
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using P = pair<int, int>;

// modint: mod 計算を int を扱うように扱える構造体
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};


const int MOD = 1000000007;
using mint = Fp<MOD>;

////////

int main(){
    int ni, ki;
    cin >> ni >> ki;
    mint n=(mint)ni, k=(mint)ki;

    mint fact[ni+1], finv[ni+1];
    fact[0] = 1; finv[0] = 1;
    rep2(i,1,ni+1){
        mint j = i;
        fact[i] = fact[i-1]*j;
        finv[i] = finv[i-1]/j;
    }

    mint out[ni];
    out[0] = 1;
    rep2(i,1,ni){
        // out[i] = out[i-1] + comb(ni, i)*comb(ni-1, ni-i-1)
        mint c1 = fact[ni]*finv[i]*finv[ni-i];
        mint c2 = fact[ni-1]*finv[ni-i-1]*finv[i];
        out[i] = out[i-1] + c1*c2;
    }

    if(ki >= ni){
        cout << out[ni-1] << endl;
    }else{
        cout << out[ki] << endl;
    }

    return 0;
}

Measured memory_bytes: 4992
Height, Width = map(int, input().split())

minse=[]

for i in range(Height):
    mine = list(input())
    minse.append(mine)

ans_list = [[0 for j in range(Width)] for i in range(Height)]


for h in range(Height):
    for w in range(Width):
        me = minse[h][w]
        if (me == '#'):

            for i in range(3):
                for j in range(3):
                    if (i != 1 or j != 1):
                        index_h = h - 1 + j
                        index_w = w - 1 + i
                        if (index_h < Height and index_h >=0 and index_w>=0 and index_w < Width):
                            ans_list[index_h][index_w] += 1
                            

for i in range(Height):
    for j in range(Width):
        value = minse[i][j]
        if (value == '#'):
            ans_list[i][j]='#'

for i in range(Height):
    tmp = ans_list[i]
    print(''.join(map(str,tmp)))

Measured memory_bytes: 9256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define answer cout << ans << endl;
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;

signed _main(){
  int N,A,B; cin >> N >> A >> B;
  v<int> X(N);
  rep(i,N) cin >> X[i];
  int ans=0;
  rep(i,N-1){
    ans+=min((X[i+1]-X[i])*A,B);
  }
  cout << ans << endl;
  return 0;
}


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

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define ull unsigned long long
#define ld long double

template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) rep2(i, 0, n)
#define rep1(i, n) rep1(i, 1, n + 1)

// #define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
// #define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()  //

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

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

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::fixed << std::setprecision(15);
    //    cout << std::setfill('0') << std::setw(2);

    long long K;
    std::cin >> K;
    long long S;
    std::cin >> S;

    ll ans = 0;
    rep(i, K + 1) rep(j, K + 1) {
        ll z = S - i - j;
        if (0 <= z && z <= K) ans++;
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

//提出時には消す
#include <fstream>

int N, Q;
int a[20];
int m;
int flag = 0;

int check(int m, int i, int num){
    if(m == num){
        flag = 1;
        return 0;
    }

    if(i == 20){
        return 0;
    }

    int use = a[i];
    
    check(m, i + 1, num + use);
    check(m, i + 1, num);
}

int main()
{
    //提出時には消す
    // std::ifstream in("/home/frog/procon_cpp/input.txt");
    // cin.rdbuf(in.rdbuf());

    cin.tie(0);

    cin >> N;
    for (int i = 0; i < N; ++i)
    {
        cin >> a[i];
    }

    cin >> Q;
    for (int i = 0; i < Q; ++i)
    {
        flag = 0;
        cin >> m;
        check(m, 0, 0);
        if(flag == 1){
            cout << "yes" << '\n';
        }else{
            cout << "no" << '\n';
        }
    }

    return 0;
}


Measured memory_bytes: 3088
// Created by Nandu Vinodan
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define pi pair<int, int>
#define INF INT_MAX
#define _INF INT_MIN
#define TC 0 

using namespace std;
using ll = long long;

void testcase() {
    double r ; cin >> r;
    double ans = 2.0 * r * (22.0/7.0);
    printf("%3f", ans);
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    if (TC)
        cin>>t;
    while(t--) {
        testcase();
    }
    return 0;
}

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

int main()
{
    string oper;
    cin>>oper;
    int l = oper.length();
    stack<char> text, tmp;
    for(int i=0;i<l;i++)
    {
        if(oper[i] != 'B') text.push(oper[i]);
        else
        {
            if(!text.empty()) text.pop();
        }
    }
    while(!text.empty())
    {
        tmp.push(text.top());
        text.pop();
    }
    while(!tmp.empty())
    {
        cout<<tmp.top();
        tmp.pop();
    }
    return 0;
}

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

int main(){
  int h,w;
  char a[111][111];
  
  scanf(" %d %d",&h,&w);
  for(int i=1;i<=h;i++){
    scanf(" %s",a[i]);
  }
  
  for(int i=0;i<=h+1;i++){
    if(i == 0 || i == h+1){
      for(int j=0;j<=w+1;j++){
        printf("#");
      }
    } else {
      printf("#");
      printf("%s",a[i]);
      printf("#");
    }
    printf("\n");
  }
  
  return 0;
}

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

int main(){
    long long   N, A, B,result,res;
    cin >> N >> A >> B;
    result = N / (A + B) * A;
    res    = min( N % ( A + B ) , A);
    result = result + res;
    cout<< result <<endl;
   
}


Measured memory_bytes: 256
//In the Name of God
#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n;
	cin>>n;
	vector <int> h(n);
	for(int i=0;i<n;i++)
		cin>>h[i];
	vector <int> dp(n);
	dp[0] = 0;
	dp[1] = abs(h[0]-h[1]);
	for(int i=2;i<n;i++)
		dp[i] = min((dp[i-1]+abs(h[i]-h[i-1])),(dp[i-2]+abs(h[i]-h[i-2])));
	cout<<dp[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a*b/gcd(a,b);
}

#define MAX 200005

signed main(void) {
    int i,j;
    int n;
    cin >> n;
    vi a(n);
    rep(i,n) cin >> a[i];
    bool b = true;
    rep(i,n-1)if(a[i] >= a[i+1])b = false;
    if(b){
        cout << 1 << endl;
        return 0;
    }
    int ok = MAX, ng = 1;
    while(ok-ng > 1){

        int mid = (ok+ng)/2;
        bool c = true;
        vector<pii> ans;
        ans.push_back(pii(a[0],0));
        rep(i,n-1){
            if(ans.empty()){
                c = false;
                break;
            }
            if(a[i] < a[i+1]){
                if(ans.back().second){
                    ans.push_back(pii(a[i+1]-a[i],0));
                }else{
                    ans.back().first += a[i+1]-a[i];
                }
            }else{

                int num = a[i] - a[i+1];//超過数
                while(num > 0 && ans.back().first <= num){
                    num -= ans.back().first;
                    ans.pop_back();
                }
                if(num)ans.back().first -= num;
                int t = ans.back().second;
                int add = 0;
                if(t+1 == mid){
                    //繰り上げ発生時
                    if(ans.size() == 1){
                        c = false;
                        break;
                    }
                    add += ans.back().first;
                    ans.pop_back();
                }

                //if(mid == 2)rep(j,ans.size())cout << " " << ans[j].first << " " << ans[j].second << endl;
                //一番最後の文字をインクリメントする
                if(ans.back().first == 1){
                    ans.back().second++;
                    t = ans.size()-1;
                    if(ans.size() >= 2 && ans[t].second == ans[t-1].second){
                        ans[t-1].first += ans[t].first;
                        ans.pop_back();
                    }
                }else{
                    t = ans.back().second;
                    ans.back().first--;
                    ans.push_back(pii(1,t+1));
                }
                if(add)ans.push_back(pii(add, 0));
            }
        }

        if(c)ok = mid;
        else ng = mid;
    }

    cout << ok << endl;
}


Measured memory_bytes: 1792
H, W = map(int, input().split())
s = [[i for i in input()] for _ in range(H)]
dir = [[1, 0], [-1, 0], [0, 1], [0, -1]]

def check(y, x):
    if s[y][x] == "#":
        for i, j in dir:
            try:
                if s[y+i][x+j] == "#":
                    return True
            except:
                pass
        else:
            return False
    return True
def solve():
    for y in range(H):
        for x in range(W):
            if not check(y, x):
                return False
    return True

def main():
    if solve():
        print("Yes")
    else:
        print("No")

main()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
 
typedef long long ll;
typedef char str255[256];

#define BIG_PRIME 1'000'000'007
#define BP_remainder(x) ((x) % BIG_PRIME)

const int INF = 1 << 30;
const int INF_NEG = INF * -1;
const ll INF_LONG = 1LL << 62;
const ll INF_LONG_NEG = INF_LONG * -1;

int main()
{
    int N, K; cin >> N >> K;
    vector<int> h(N); rep(i, N) cin >> h[i];

    sort(h.begin(), h.end(), greater<int>());

    int diffMin = INF;
    rep(i, N - K + 1){
        int diff = h[i] - h[i + K - 1];
        diffMin = min(diffMin, diff);
    }

    cout << diffMin << endl;

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;
// ceil() 切り上げ, floor() 切り捨て
// next_permutation(all(x))

int		main(void)
{
	int A, B;
	cin >> A >> B;
	for (int i = 0; i <= 1100; i++)
	{
		int a = floor(i * 0.08);
		int b = floor(i * 0.1);
		if (a == A && b == B)
		{
			cout << i << endl;
			return (0);
		}
	}
	cout << -1 << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

#define rep(i,n) for(int i=0;i< (n);++i)
#define REP(i,n) for(int i=1;i<=(n);++i)
#define ALL(a) (a).begin(),(a).end()
using LLI = long long int;
LLI GCD(LLI a,LLI b){ if(a<b) return GCD(b,a); else if(a%b==0) return b; else return GCD(b,a%b); }
LLI LCM(LLI a,LLI b){ return (a/GCD(a,b))*b; }
using VI  = std::vector<LLI>;
using PI  = std::pair<LLI,LLI>;
using VVI = std::vector<VI>;
using VPI = std::vector<PI>;

int main() {
    std::ios::sync_with_stdio(false);

    LLI N,M,K;
    std::cin >> N >> M >> K;

    bool flag = false;
    rep(i,N+1)
        rep(j,M+1)
            if(i*M+j*N-2*i*j == K)
                flag = true;

    std::cout << (flag?"Yes":"No") << std::endl;
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
constexpr double EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max()/2;
constexpr int MOD = 1e9+7;

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

    string a,b;cin>>a>>b;
    if(a==b) cout<<"H"<<endl;
    else cout<<"D"<<endl;
}


Measured memory_bytes: 256
import java.util.*;

class Main {
    static int x,y,z;
  
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      while(true) {
        x = sc.nextInt();
        y = sc.nextInt();
        if (x == 0 && y == 0) {
          break;
        } 
        if (x>y) {
        System.out.println(y + " " + x);
        } else {
        System.out.println(x + " " + y);
        }
      }
    }
}


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

int main() {
  int a; cin >> a;
  if(a > 29){
    cout << "Yes";
  }
  else{
    cout << "No";
  }
}

Measured memory_bytes: 3568
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <functional>
using namespace std;
typedef long long ll;




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

Measured memory_bytes: 3596
/*  
    Talkin' to myself and feelin' old
    Sometimes I'd like to quit, nothin' ever seems to fit
    Hangin' around, nothin' to do but frown
    Rainy days and Mondays always get me down
    _________________________
    _________________________
    912 Hours of Solitude
    Quarantine_Day : 38
*/

#include<bits/stdc++.h>

using namespace std;

typedef long long int       ll;
typedef vector<int>         vi;
typedef vector<ll>          vl;
typedef pair<int, int>      pii;
typedef pair<ll, ll>		pll;

#define pb(n)           push_back(n)
#define GSORT(v)        sort(v.begin(), v.end(), greater<int>())
#define SORT(v)         sort(v.begin(), v.end());
#define REV(v)          reverse(v.begin(), v.end());
#define db(a)           cout<<#a<<" = "<<a<<endl;
#define FIN             freopen("in.txt","r",stdin);
#define FOUT            freopen("out.txt","w",stdout);
#define REP(i,n)        for(int i = (int)(0); i < (int)(n); i++)
#define FOR(i, a, b)    for(int i = (int)a; i <= (int)b; i++)    

#define MAX 50005


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

    int n, k; cin>>n>>k;

    int ans = 0;
    REP(i, n){
        int x; cin>>x;
        ans += min(x * 2, (k - x) * 2);
    }
    cout<<ans<<"\n";

    return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    m[b]++;
    a[i] = b;
  }

  sort(a.begin(), a.end());

  // エラトステネスのイメージで前から数えていく
  int cnt = 0;
  int chk[1000001];  // 0/1 ... NoChk/NG
  for (int i = 0; i < 1000001LL; i++) {
    chk[i] = 0;
  }

  for (int i = 0; i < n; i++) {
    int ai = a[i];
    if (chk[ai] == 1) continue;  // NG

    if (m[ai] > 1) {
      if (chk[ai] != 1) {
        chk[ai] = 1;
        for (int j = 2; ai * j < 1000001LL; j++) {
          int idx = ai * j;
          chk[idx] = 1;
        }
      }
    } else {
      cnt++;
      for (int j = 2; ai * j < 1000001LL; j++) {
        int idx = ai * j;
        chk[idx] = 1;
      }
    }
  }

  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 17068
N = int(2e5+3)
heap_arr, heap_size = [0] * N, 0

def heap_push(x):
    global heap_size
    heap_arr[heap_size] = x
    i = heap_size
    while i > 0 and heap_arr[i] > heap_arr[(i-1)//2]:
        heap_arr[i], heap_arr[(i-1)//2] = heap_arr[(i-1)//2], heap_arr[i]
        i = (i-1)//2
    heap_size += 1

def get_max():
    global heap_size
    if heap_size == 0:
        return -2e9
    return heap_arr[0]

def heap_pop():
    global heap_size
    if heap_size == 0:
        return
    heap_size -= 1
    heap_arr[0], heap_arr[heap_size] = heap_arr[heap_size], heap_arr[0]
    i, j = 0, -1
    while i != j:
      j = i
      l = 2*i+1
      r = 2*i+2
      if l < heap_size and heap_arr[l] > heap_arr[i]:
          i = l
      if r < heap_size and heap_arr[r] > heap_arr[i]:
          i = r
      heap_arr[i], heap_arr[j] = heap_arr[j], heap_arr[i]

n, m = map(int, input().split())
arr = list(map(int, input().split()))
for i in arr:
    heap_push(i)
while m >= 1:
    x = get_max() // 2
    heap_pop()
    heap_push(x)
    m -= 1    
print(sum(heap_arr))


Measured memory_bytes: 65520
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=2e5+10;
int nxt[N];
int suf[N];
struct p{
	int x,d;
	p(){
	}
	p(int _x,int _d):x(_x),d(_d){
	
	};
	bool operator<(const p a)const{
		return x<a.x;
	}
}a[N];
namespace Segment {
	typedef int LL;
	const int maxn = 200005;
	const LL inf = -1; //为lazy不用修改的值
	LL tree[maxn << 2], lazy[maxn << 2],tmp[maxn];
	void build(int root, int left, int right) {
		lazy[root] = inf;
		if (left == right) {
			tree[root] = tmp[left];
			return;
		}
		int mid = (left + right) >> 1;
		build(root << 1, left, mid);
		build(root << 1 | 1, mid + 1, right);
		tree[root] = max(tree[root << 1], tree[root << 1 | 1]);
		//operation，可更改
	}
	void pushdown(int root, int left, int right) {
		//operation，均要修改！！！！！！！！！！
		if (lazy[root] == inf)
			return;
		int mid = (left + right) >> 1;
		tree[root << 1] = max(tree[root << 1], lazy[root]);
		tree[root << 1 | 1] = max(tree[root < 1 | 1], lazy[root]);
		lazy[root << 1] = max(lazy[root << 1], lazy[root]);
		lazy[root << 1 | 1] = max(lazy[root << 1 | 1], lazy[root]);
		lazy[root] = inf;
	}
	void add(int root, int left, int right, int stdl, int stdr, LL val) {
		if (left >= stdl && right <= stdr) {
			tree[root] = max(tree[root], val);
			lazy[root] = max(lazy[root], val); //operation，可更改
			return;
		}
		pushdown(root, left, right);
		int mid = (left + right) >> 1;
		if (stdl <= mid)
			add(root << 1, left, mid, stdl, stdr, val);
		if (stdr > mid)
			add(root << 1 | 1, mid + 1, right, stdl, stdr, val);
		tree[root] = max(tree[root << 1], tree[root << 1 | 1]);
		//operation，可更改
	}
	LL query(int root, int left, int right, int stdl, int stdr) {
		if (left >= stdl && right <= stdr)
			return tree[root];
		pushdown(root, left, right);
		int mid = (left + right) >> 1;
		LL res = inf;
		if (stdl <= mid)
			res = max(res, query(root << 1, left, mid, stdl, stdr));
		if (stdr > mid)
			res = max(res, query(root << 1 | 1, mid + 1, right, stdl, stdr));
		//operation，可更改
		return res;
	}
};
using namespace Segment;
int dp[N][2];
const int P=998244353;
signed main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i].x>>a[i].d;
		nxt[i]=suf[i]=i;
	}
	sort(a+1,a+1+n);
	build(1,1,n);
	for(int i=n-1;i>=1;i--){	
		nxt[i] = lower_bound(a + 1, a + 1 + n, p(a[i].x + a[i].d, 0)) - a - 1;
		nxt[i] = max(query(1, 1, n, i, nxt[i]), nxt[i]);
		add(1, 1, n, i, i, nxt[i]);
	}
	dp[n][0]=dp[n][1]=1;
	for(int i=n-1;i>=1;i--){
		dp[i][0]=(dp[i+1][0]+dp[i+1][1])%P;
		if(nxt[i]!=i)dp[i][1]=dp[nxt[i]][1];
		else dp[i][1]=dp[i][0];
		//cout<<a[i].x<<' '<<a[i].x+a[i].d<<' '<<nxt[i]<<' '<<dp[i][0]<<' '<<dp[i][1]<<endl;
	}
	int ans=dp[1][0]+dp[1][1];
	ans%=P;
	cout<<ans;
}

Measured memory_bytes: 23680
#include <stdio.h>

static int heap[250+1];

int main(int argc, char* argv[]) {
    int H;
    int i;

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

    for ( i = 1; i <= H; i++ ) {
        printf("node %d: key = %d, ", i, heap[i]);
        if ( i / 2 >= 1 ) {
            printf("parent key = %d, ", heap[i / 2]);
        }
        if ( i * 2 <= H ) {
            printf("left key = %d, ", heap[i*2]);
        }
        if ( i * 2 + 1 <= H ) {
            printf("right key = %d, ", heap[i*2 + 1]);
        }
        printf("\n");
    }

    return 0;
}




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

int main()
{
    int N ;
    string x ;
    cin>>N;
    cin>>x;
    int i =0,z = x.length();

    while (i < z){
      cout<< (char)('A' + ((x[i] - 'A' + N) % 26));
        i++;

    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=200010;
char s[N];
int ch[N][26],len;
int mind[N][3];
int main(){
	scanf("%s",s+1);
	len=strlen(s+1);
//	cout<<len<<endl;
	for(int i=len; i>=0; i--){
		//cout<<"hehe"<<endl;
		int c=s[i]-'a';
		int tempmin=N,tempj;
		for(int j=0; j<26; j++){
			ch[i][j]=ch[0][j];
			if(mind[ch[i][j]][0]<tempmin){
				tempmin=mind[ch[i][j]][0];
				tempj=ch[i][j];
				mind[i][2]=j;
			}
		}
		mind[i][0]=tempmin+1;
		mind[i][1]=tempj;
		//cout<<i<<": "<<tempmin<<" "<<tempj<<" "<<mind[i][2]<<endl;
		if(i)
			ch[0][c]=i;
	}
	int i=mind[0][0],j=0;
//	cout<<mind[0][0]<<" "<<j<<" "<<mind[0][2]<<endl;
	while(i--){
		//cout<<"hehe"<<endl;
		printf("%c",(char)'a'+mind[j][2]);
		j=mind[j][1];
	}
	printf("\n");
}


Measured memory_bytes: 23168
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
  int N, A, B;
  cin >> N;
  vector<int> vec(N);
  REP(i, N) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end(), greater<int>());
  A = 0;
  B = 0;
  REP(i, N) {
    if (i % 2 == 0) {
      A += vec[i];
    } else {
      B += vec[i];
    }
  }
  cout << A - B;
  return 0;
}

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

const long long MOD = 1000000007;

void solve(long long n, long long m, std::vector<long long> x,
           std::vector<long long> y) {
  ll resx = 0;
  for (int k = 0; k < n; k++) {
      resx += x[k]*(2*k - (n - 1));
      resx %= MOD;
  }
  ll resy = 0;
  for (int k = 0; k < m; k++) {
      resy += y[k]*(2*k - (m - 1));
      resy %= MOD;
  }

  cout << (resx*resy)%MOD << endl;
}

int main() {

  long long n;
  scanf("%lld", &n);
  long long m;
  scanf("%lld", &m);
  std::vector<long long> x(n);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &x[i]);
  }
  std::vector<long long> y(m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &y[i]);
  }
  solve(n, m, std::move(x), std::move(y));
  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
#include<utility>
#include<array>
#include<set>
#define EPS (1e-7)
using namespace std;






int main() {


	vector<vector<int>> grid(3);
	vector<int> inner(3);
	int a1, a2, a3, b1, b2, b3;
	string ans = "No";

	for (auto i = 0; i < 3; i++) {
		for (auto j = 0; j < 3; j++)
		{
			cin >> inner[j];
		}
		grid[i] = inner;
	}

	for (auto i = 0; i <= 100; i++)
	{
		a1 = i;
		b1 = grid[0][0] - a1;
		b2 = grid[0][1] - a1;
		b3 = grid[0][2] - a1;

		a2 = grid[1][1] - b2;
		a3 = grid[2][2] - b3;

		for (auto i = 0; i < 3; i++) {
			for (auto j = 0; j < 3; j++)
			{
				if (a1 + b1 == grid[0][0]
					&& a1 + b2 == grid[0][1]
					&& a1 + b3 == grid[0][2]
					&& a2 + b1 == grid[1][0]
					&& a2 + b2 == grid[1][1]
					&& a2 + b3 == grid[1][2]
					&& a3 + b1 == grid[2][0]
					&& a3 + b2 == grid[2][1]
					&& a3 + b3 == grid[2][2]) {
					ans = "Yes";
					break;
				}
			}
			if (ans == "Yes")break;
		}




	}



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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define rep2(i,a,n) for(int i=(a); i<(n); i++)
#define all(vec) vec.begin(),vec.end()
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;

int main(){
  int N, A, B; cin >> N >> A >> B;
  string S; cin >> S;
  int counta = A+B;
  int countb = B;
  rep(i,S.size()){
    if(S[i]=='c' || counta == 0) cout << "No" << endl;
    else if(S[i]=='a') {cout << "Yes" << endl; counta--;}
    else if(S[i]=='b' && countb != 0){cout << "Yes" << endl;counta--; countb--;}
    else cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3704
#include <iostream>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)

int main() {
	int n, m;
	long long sum = 0;
	cin >> n;

	rep(i,n) {
		cin >> m;
		sum += m;
	}
	cout << sum / n << endl;
	return 0;
}

Measured memory_bytes: 1156
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn string() -> String {
    read()
}

fn main() {
    match string().as_str() {
        "ABC" => println!("ARC"),
        "ARC" => println!("ABC"),
        _ => ()
    }
}


Measured memory_bytes: 2112
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using vec=vector<ll>;
using mat=vector<vec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define mod 1000000007
using datas=pair<ll,ll>;
using tdata=pair<datas,ll>;

long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

ll modncrlistp[200000],modncrlistm[200000];

ll modncrs(ll n,ll r){
  ll i,j;
  if(modncrlistp[n]==0){
    for(i=n;i>=0;i--){
      if(modncrlistp[i])break;
    }
    if(i<0){
      modncrlistp[0]=1;
      rep1(i,n+1){
        modncrlistp[i]=(modncrlistp[i-1]*i)%mod;
      }
    }else{
      For(j,i+1,n+1){
        modncrlistp[j]=(modncrlistp[j-1]*j)%mod;
      }
    }
  }
  if(modncrlistm[n]==0){
    for(i=n;i>=0;i--){
      if(modncrlistm[i])break;
    }
    if(i<0){
      modncrlistm[0]=1;
      rep1(i,n+1){
        modncrlistm[i]=(modncrlistm[i-1]*modinv(i))%mod;
      }
    }else{
      For(j,i+1,n+1)modncrlistm[j]=(modncrlistm[j-1]*modinv(j))%mod;
    }
  }
  return (((modncrlistp[n]*modncrlistm[r])%mod)*modncrlistm[n-r])%mod;
}

ll modncr(ll n,ll r){
  if(r*2>n)return modncr(n,n-r);
  ll i,plus=1;
  rep(i,r){
    plus=(plus*(n-i))%mod;
    plus=moddevide(plus,i+1);
  }
  return plus;
}

ll euclidean_gcd(ll a, ll b) {
  if(a<b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)){a=b;b=r;}
  return b;
}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

void printmap(vector<ll>& a,ll H,ll W){
  ll i,j;
  For(i,0,H+2){
    For(j,0,W+2){cout<<a[i*(W+2)+j];}
    cout<<endl;
  }
}
void inputmap(vector<ll>& a,ll H,ll W){
  ll i,j;
  string ss;
  For(i,1,H+1){
    cin>>ss;
    For(j,1,W+1){
      if(ss[j-1]=='#'){
        a[i*(W+2)+j]=1;
      }else{
        a[i*(W+2)+j]=0;
      }
    }
  }
}

int main(){
  ll i,j,H,W,N,a,b,cnt=0;
  cin>>H>>W>>N;
  vec ans(10,0),dx(9),dy(9);
  ans[0]=(H-2)*(W-2);
  rep(i,3){
    rep(j,3){
      dx[cnt]=i-1;
      dy[cnt]=j-1;
      cnt++;
    }
  }
  map<datas,ll> mp;
  datas x;
  rep(i,N){
    cin>>a>>b;
    a--;b--;
    rep(j,9){
      if(a+dx[j]>0&&a+dx[j]<H-1&&b+dy[j]>0&&b+dy[j]<W-1){
        x=datas(a+dx[j],b+dy[j]);
        mp[x]++;
        ans[mp[x]]++;
      }
    }
  }
  rep(i,9){
    ans[i]=ans[i]-ans[i+1];
  }
  rep(i,10)cout<<ans[i]<<endl;
  return 0;
}

Measured memory_bytes: 56448
def merge(targ,first,mid,last):
    left = targ[first:mid] + [10 ** 9 + 1]
    right = targ[mid:last] + [10 ** 9 + 1]

    leftcnt = rightcnt = 0
    global ans
    for i in range(first,last):
        #print(left,right,left[leftcnt],right[rightcnt],targ,ans)
        if left[leftcnt] <= right[rightcnt]:
            targ[i] = left[leftcnt]
            leftcnt += 1
        else:
            ans += len(left)-1-leftcnt
            targ[i] = right[rightcnt]
            rightcnt += 1

def mergesort(targ,first,last):
    if first + 1 == last:
        if targ[first] > targ[last]:
            #print(targ[first] , targ[last])
            global ans
            temp = targ[first]
            targ[first] = targ[last]
            targ[last] = temp
            ans += 1

    elif first == last:
        pass
    else:
        mid = (first + last) // 2
        mergesort(targ,first,mid)
        mergesort(targ,mid,last)
        merge(targ,first,mid,last)


ans = 0
num = int(input())
targ = [int(n) for n in input().split(' ')]
mergesort(targ,0,num-1)
print(ans)

Measured memory_bytes: 30436
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pc __builtin_popcountll

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    int n, d;
    cin >> n >> d;
    int count = 0;
    ll x, y;
    for(int i = 0; i < n; ++i){
        cin >> x >> y;
        ll sq_dist = (ll)(x * x) + (ll)(y * y);
        double dist = sqrt(sq_dist);
        if(dist <= d){
            ++count;
        }
    }
    cout << count << "\n";
    return 0;
}

Measured memory_bytes: 3556
// 6/23 解き直し
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;

vector<int> f;  // iマス目以降で一番小さい0のマス。

int main() {
    int N, M;
    string S;
    cin >> N >> M >> S;

    f.resize(N + 1);
    int last = N + 1;  // Nマス目は必ずゴール。
    for (int i = N; i >= 0; i--) {
        if (S[i] == '0') {
            f[i] = i;
            last = i;
        } else {
            // ゲームオーバーのマス
            f[i] = last;
        }
    }

    // for (auto x : f) {
    //     cout << x;  //  << endl;
    // }
    // cout << endl;

    vector<int> res;

    int pos = N;
    while (pos > 0) {
        // cout << "pos: " << pos << endl;
        int next_pos = pos - M;
        if (next_pos <= 0) {
            // ゴールにつける。
            res.push_back(pos);
            pos = next_pos;
        }
        else if (f[next_pos] == next_pos) {
            // M手先は行けるので、そのまま進む。
            res.push_back(M);
            pos -= M;
        } else if (f[next_pos] < pos) {
            // M手先はゲームオーバーマスだが、1以上の手で進めることは進める。
            // cout << "here?" << endl;
            res.push_back(pos - f[next_pos]);
            pos = f[next_pos];
        } else {
            // それ以外の時はもう進めない。
            cout << -1 << endl;
            return 0;
        }
    }

    reverse(res.begin(), res.end());
    // for (auto r : res) {
    //     cout << r << 
    // }
    for (int i = 0; i < res.size(); i++) {
        if (i > 0) cout << " ";
        cout << res[i];
    }
    cout << endl;
}

Measured memory_bytes: 4292
#include <bits/stdc++.h>
int N,M,a,b,d[64]={},v[8]={1};
int dfs(int x) {
int r=0,l=1;
for(int i=0;i<N;i++)if(!v[i])l=0;
if(l)return 1;
for(int i=0;i<N;i++)if(d[x*N+i]&!v[i])v[i]=1,r+=dfs(i),v[i]=0;
return r;
}
int main(){
std::cin>>N>>M;
for(int i=0;i<M;i++)std::cin>>a>>b,d[--a*N+--b]=d[b*N+a]=1;
std::cout<<dfs(0);
}

Measured memory_bytes: 256
N,Ma,Mb = map(int,input().split())
 
INF = float('inf')
 
dp = [[INF for b in range(401)] for a in range(401)]
 
dp[0][0] = 0
 
for i in range(1,N+1):
    ai,bi,ci = map(int,input().split())
    for a in range(400,-1,-1):
        for b in range(400,-1,-1):
            if a-ai >= 0 and b-bi >= 0:
                dp[a][b] = min(dp[a][b],dp[a-ai][b-bi]+ci)
 
 
ans = INF
for j in range(1,401):
    if Ma*j > 400 or Mb*j > 400:
        break
    ans = min(ans,dp[Ma*j][Mb*j])
print(ans if ans != INF else -1)

Measured memory_bytes: 59356
#include <bits/stdc++.h>
using namespace std;
int a[2000];
int n,k;
int main(){
	cin>>n>>k;
	for (int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	int s=0;
	for (int i=1;i<=k;i++) s+=a[i];
	cout<<s<<endl;
	return 0;
}



Measured memory_bytes: 3572
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4") // wonderful

#include <bits/stdc++.h>
using namespace std;

#define forn(i, a, n) for (int i = (a); i < (int)n; i++)
#define trav(x, arr) for (auto &x : arr)
#define sz(x) (int)x.size()
#define Matrix(m, h, w) = std::vector<vector<int>> m(h, vector<int> (w)); 
using ll = long long;

#define vi vector<int>
#define vl vector<long>
#define vll vector<ll>

// benq
const int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 100001;


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


    string s, t;
    cin >> s >> t;
    int res = 0;
    forn(i, 0, sz(s)) {

    	if (s[i] != t[i])
    		res++;
    }
    cout << res;

    return 0;
}

Measured memory_bytes: 3820