akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

vl v[2];

int main(){
	REP(i, 2){
		ll a, b; scanf("%lld%lld", &a, &b);
		v[i].EB(a);
		v[i].EB(b);
		FOR(j, -1, 2){
			if(a <= j && j <= b) v[i].EB(j);
		}
	}
	ll ans = LLONG_MIN;
	for(ll i : v[0]){
		for(ll j : v[1]){
			LAR(ans, i*j);
		}
	}
	printf("%lld\n", ans);
}


Measured memory_bytes: 3828
n,m=map(int,input().split())
lists=[]
listc=[]
ans1=10
ans2=10
ans3=10
ans=""
yn=0
count=0
for i in range(m):
    s,c=map(int,input().split())
    lists.append(s)
    listc.append(c)
if n==3:
    for i in range(m):
        if lists[i]==1:
            if ans1!=10 and listc[count]!=ans1:
                yn=1
                break
            else:
                ans1=listc[count]
        elif lists[count]==2:
            if ans2!=10 and listc[count]!=ans2:
                yn=1
                break
            else:
                ans2=listc[count]
        else:
            if ans3!=10 and listc[count]!=ans3:
                yn=1
                break
            else:
                ans3=listc[count]
        count+=1
    if ans1==0:
        yn=1
    if yn==1:
        print(-1)
    else:
        if ans1==10:
            ans=ans+str(1)
        else:
            ans=ans+str(ans1)
        if ans2==10:
            ans=ans+str(0)
        else:
            ans=ans+str(ans2)
        if ans3==10:
            ans=ans+str(0)
        else:
            ans=ans+str(ans3)
        print(ans)
elif n==2:
    for i in range(m):
        if lists[count]==1:
            if ans1!=10 and listc[count]!=ans1:
                yn=1
                break
            else:
                ans1=listc[count]
        else:
            if ans2!=10 and listc[count]!=ans2:
                yn=1
                break
            else:
                ans2=listc[count]
        count+=1
    if ans1==0:
        yn=1
    if yn==1:
        print(-1)
    else:
        if ans1==10:
            ans=ans+str(1)
        else:
            ans=ans+str(ans1)
        if ans2==10:
            ans=ans+str(0)
        else:
            ans=ans+str(ans2)
        print(ans)
else:
    for i in range(m):
        if ans1!=10 and listc[count]!=ans1:
            yn=1
            break
        else:
            ans1=listc[count]
        count+=1
    if yn==1:
        print(-1)
    else:
        if ans1==10:
            ans=ans+str(0)
        else:
            ans=ans+str(ans1)
        print(ans)


Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
    ios_base::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    cin >> n >> m;
    cout << (1 << m) * (100 * (n - m) + m * 1900);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int N;
    cin >> N;
    int fp = N%10;
    if(fp == 2 || fp == 4 || fp == 5 || fp == 7 || fp ==  9) {
        printf("hon\n");
        return 0;
    }
    if(fp == 0 || fp == 1 || fp == 6 || fp == 8) {
        printf("pon\n");
        return 0;
    }
    if(fp == 3) {
        printf("bon\n");
        return 0;
    }
}

Measured memory_bytes: 3636
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int n;
	cin>>n;
	ll sum=0;
	rep(i,n){
		ll a;cin>>a;sum+=a;
	}
	cout<<sum/n<<endl;
}

Measured memory_bytes: 1164
#!/usr/bin/env python3
#!/usr/bin/env pypy3

from math import *

def main():
    import sys
    sys.dont_write_bytecode = True
    sys.setrecursionlimit(10000000)

    input = sys.stdin.readline

    #import numpy as np
    #import scipy as sp

    # Python 3 modules: https://docs.python.org/3/library/

    import os
    import math, itertools, operator
    from math import factorial as fact
    from operator import itemgetter, attrgetter
    from itertools import permutations, combinations
    from functools import reduce, lru_cache
    # Use scipy for stats: https://docs.scipy.org/doc/scipy/reference/stats.html
    # Before Python 3.5.  Import from math after it.
    from fractions import gcd
    from fractions import Fraction as Frac

    inf = float('inf')

    def lcm(a, b):
        return a * b // gcd(a,b)

    def perm(a, b):
        import scipy.special
        return scipy.special.perm(a, b, exact = True)

    def comb(a, b):
        import scipy.special
        return scipy.special.comb(a, b, exact = True)

    def dfact(n):
        import scipy.special
        return scipy.special.factorial2(n, exact = True)

    def prod(l):
        return reduce(operator.mul, l)

    def input_ints(func = input, sep = None, conv = int):
        return list(map(conv, func().split(sep = sep)))

    if os.environ.get('GOROOT') is None:
        def dprint(*args, **kwargs):
            kwargs['file'] = sys.stderr
            import inspect
            frame = inspect.currentframe().f_back
            print('[' + os.path.basename(frame.f_code.co_filename)
                    + ':' + str(frame.f_lineno) + ']', *args, **kwargs)
    else:
        def dprint(*args, **kwargs):
            pass


    ############################################################################


    #= list(map(int, input().split()))
    S = list(input()[:4])
    S.sort()
    dprint(S)
    if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


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

#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define eb emplace_back
#define rep(i, a, b) for (long i = (a); i <= (b); ++i)
#define per(i, a, b) for (long i = (a); i >= (b); --i)
#define mmst(v) memset(v, 0, sizeof(v))

const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;

const long kMAX = 1000000000;

using namespace std;
using ll = long long;

inline int readInt() {
  char c = getchar();
  while(!isdigit(c) && c != '-') c = getchar();
  int sigma = 1;
  if (c == '-') {
    sigma = -1;
    c = getchar();
  }
  int x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * sigma;
}

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

  long a, b;
  cin >> a >> b;
  long x = a + b;
  if (x & 1) { cout << "IMPOSSIBLE\n"; }
  else { cout << x / 2 << endl; }

  return 0;
}


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

#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl

using namespace std;
using lli = long long int;

lli mod197 = 1000000007LL;

lli x[100000] = {};

int main(void) {

	lli N, K;
	cin >> N >> K;

	for (int i = 0; i < N; i++)
		cin >> x[i];

	lli ans = 1000000000;

	for (int i = 0; i <= N - K; i++) {
		lli l = x[i];
		lli r = x[i + K - 1];

		if (l * r > 0) {
			CHMIN(ans, max(abs(l), abs(r)));
		}
		else {
			CHMIN(ans, 2 * (abs(l) + abs(r)) - max(abs(l), abs(r)));
		}
	}

	COUT(ans);

	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
 
using namespace std;
 
int main() {
  long long a, b;
  cin >> a >> b;
  set<long long> s;
  for (long long i = 1; i <= sqrt(a); ++i) {
  	if (a % i == 0) {
    	s.insert(i);
      	s.insert(a/i);
    }
  }
  set<long long> d;
  for (long long i = 1; i <= sqrt(b); ++i) {
    if (b % i == 0) {
  		if (s.find(i) != s.end())
          d.insert(i);
        if (s.find(b/i) != s.end())
          d.insert(b/i);
    }
  }
  int ans = 0;
  long long lcm = 1;
  for (auto x : d) {
  	if (__gcd(lcm, x) == 1) {
  	    lcm *= x;
  	    ans++;
  	}
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 896
#include<set>
#include<bitset>
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
inline char nc() {
	return getchar();
	static char b[100000],*s=b,*t=b;
	return s==t&&(t=(s=b)+fread(b,1,100000,stdin),s==t)?-1:*s++;
}
inline void read(int &x) {
	char b = nc(); x = 0;
	for (; !isdigit(b); b = nc());
	for (; isdigit(b); b = nc()) x = x * 10 + b - '0';
}
int n, m, q;
ll ans[10];
struct P {
	int x, y;
	inline bool operator<(const P &p) const {
		return x < p.x || (x == p.x && y < p.y);
	}
	inline bool operator==(const P &p) const {
		return x == p.x && y == p.y;
	}
};
set < P > s;
inline void upd(int x, int y) {
	if (x < 1 || y < 1 || x > n - 2 || y > m - 2) return;
	int t = 0;
	for (int i = 0; i < 3; ++i)
		for (int j = 0; j < 3; ++j)
			if (s.count((P){x + i, y + j})) ++t;
	++ans[t]; --ans[t-1];
}
int main() {
	read(n); read(m); read(q);
	ans[0] = (n - 2ll) * (m - 2);
	for (int x, y, k = 0; k < q; ++k) {
		read(x); read(y); s.insert((P){x, y});
		for (int i = 0; i < 3; ++i)
			for (int j = 0; j < 3; ++j)
				upd(x - i, y - j);
	}
	for (int i = 0; i < 10; ++i) printf("%lld\n", ans[i]);
	return 0;
}

Measured memory_bytes: 4992
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(X))
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void calc(vl &ans, int start, int N, map<ll, vl> &edges) {
  vector<bool> checked(N + 1);
  ll pre = start;

  ans.push_back(pre);
  checked[pre] = true;

  while (true) {
    bool ok = false;
    for (ll v : edges[pre]) {
      if (!checked[v]) {
        pre = v;
        ans.push_back(pre);
        checked[pre] = true;
        ok = true;
        break;
      }
    }

    if (!ok) {
      break;
    }
  }

  reverse(all(ans));
  pre = start;
  while (true) {
    bool ok = false;
    for (ll v : edges[pre]) {
      if (!checked[v]) {
        pre = v;
        ans.push_back(pre);
        checked[pre] = true;
        ok = true;
        break;
      }
    }

    if (!ok) {
      break;
    }
  }
}

void solve(long long N, long long M, std::vector<long long> A,
           std::vector<long long> B) {
  map<ll, vl> edges;
  rep(i, M) {
    edges[A[i]].push_back(B[i]);
    edges[B[i]].push_back(A[i]);
  }

  vl ans;
  calc(ans, A[0], N, edges);

  print(ans.size());
  rep(v, ans.size()) {
    cout << ans[v];
    if (ans.size() - 1 != v) {
      cout << " ";
    }
  }
  cout << endl;
}

int main() {
  long long N;
  scanf("%lld", &N);
  long long M;
  scanf("%lld", &M);
  std::vector<long long> A(M);
  std::vector<long long> B(M);
  for (int i = 0; i < M; i++) {
    scanf("%lld", &A[i]);
    scanf("%lld", &B[i]);
  }
  solve(N, M, std::move(A), std::move(B));
  return 0;
}


Measured memory_bytes: 14196
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    int n;
    cin >> n;
    n++;
    vector<ll> v(n);
    rep(i, n) cin >> v[i];

    if (n == 1) {
        if (v[0] == 1) {
            cout << 1 << endl;
        } else {
            cout << -1 << endl;
        }
        ret();
    }

    vector<ll> u_min(n, 0), u_max(n, 0);

    for (int i = n - 2; i >= 0; i--) {
        u_min[i] = (u_min[i + 1] + v[i + 1] + 1) / 2;
        u_max[i] = u_max[i + 1] + v[i + 1];
    }


    vector<ll> d_min(n, 0), d_max(n, 0);
    d_min[0] = 1 - v[0];
    d_max[0] = 1 - v[0];
    for (int i = 1; i < n; i++) {
        ll mi = d_min[i - 1] - v[i];
        ll ma = d_max[i - 1] * 2 - v[i];
        d_min[i] = max(mi, u_min[i]);
        d_max[i] = min(ma, u_max[i]);

        if (d_max[i] - d_min[i] < 0) {
            cout << -1 << endl;
            ret();
        }
    }

    ll ans = accumulate(d_max.begin(), d_max.end(), 0ll) + accumulate(v.begin(), v.end(), 0ll);


    cout << ans << endl;


}


Measured memory_bytes: 7208
#include "bits/stdc++.h"
using namespace std;
int main() {
	string S;
	cin >> S;
	long N = S.size();
	bool A = false;
	int pos_A = 0, pos_Z = 0;
	for (int i = 0; i < N; i++) {
		if (S.at(i) == 'A' && !A) {
			pos_A = i;
			A = true;
		}
		if (S.at(i) == 'Z') {
			pos_Z = i;
		}
	}
	cout << pos_Z - pos_A + 1 << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
inline long long mod(long long n,long long m){return(n%m+m)%m;}
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

long long dp[100010];
int main(){
    rep(i,100010) dp[i]=LINF;
    int n,k=2; cin>>n;//>>k;
    int h[n]; rep(i,n) cin>>h[i];
    dp[1]=0;
    for(int i=2;i<=n;i++){
        for(int j=1;j<=k;j++){
            if(i-1-j>=0) dp[i]=min(dp[i],dp[i-j]+abs(h[i-1]-h[i-1-j]));
        }
    }
    cout<<dp[n]<<endl;
    return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 998244353
#define INF63 1061109567
#define INF127 9187201950435737471
#define UINF 18446744073709551615
#define F first
#define S second
#define ll long long
#define N 200010
using namespace std;
ll n,num[N][30];
string s[N],t[N],st;
vector<pair<string,ll> > vt;
int main(){
	ll i,j,l,ans=0;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>s[i];
		t[i]=s[i];
		reverse(t[i].begin(),t[i].end());
		t[i].erase(t[i].end()-1);
		vt.push_back(make_pair(t[i],i));
	}
	sort(vt.begin(),vt.end());
	for(i=0;i<(ll)vt.size();i++)
	{
		l=vt[i].S;
		for(j=0;j<(ll)s[l].size();j++)
		{
			num[i][s[l][j]-'a']++;
		}
	}
	for(i=0;i<(ll)vt.size();i++)
	{
		st=vt[i].F+'{';
		pair<string,ll> pp=make_pair(st,-LINF);
		l=upper_bound(vt.begin(),vt.end(),pp)-vt.begin()-1;
		for(j=i+1;j<=l;j++)
		{
			if(num[j][s[vt[i].S][0]-'a']>=num[i][s[vt[i].S][0]-'a'])
			{
				ans++;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

int main()
{
	int l, r, d;
	cin>>l >>r >>d;
  
  	if(l%d)
        cout<<(r/d)-(l/d);
    else  
        cout<<(r/d)-(l/d) + 1; 
}

Measured memory_bytes: 3588
N,K = map(int, input().split())
min_num = 0
max_num = 0
for i in range(K):
    min_num += i
    max_num += N - i
ans = max_num - min_num + 1
for i in range(K, N+1):
    min_num += i
    max_num += N - i
    ans += max_num - min_num + 1
print(ans%(10**9 + 7))

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

int main() {
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    double dis = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
    cout << fixed << setprecision(6) << dis << endl;
}


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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }

const int maxn = 1e9 + 11;
const int maxxer = 1e6;

bool seen[maxn];
int arr[maxxer];

int main() {

  ios_base::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  
  int n; cin >> n;

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

  for (int i = 0; i < n; i++) {
    if (seen[arr[i]]) out("NO");
    seen[arr[i]] = true;
  }

  out("YES");
  return 0;
}


Measured memory_bytes: 978816
#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;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

bool isSubSequence(string str1, string str2, int m, int n)
{
    // Base Cases
    if (m == 0) return true;
    if (n == 0) return false;
 
    // If last characters of two strings are matching
    if (str1[m-1] == str2[n-1])
        return isSubSequence(str1, str2, m-1, n-1);
 
    // If last characters are not matching
    return isSubSequence(str1, str2, m, n-1);
}

int cnt[27];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	string s; cin>>s;
	string y = "AKIHABARA";
	if(!isSubSequence(s,y,s.length(),y.length()))
	{
		cout<<"NO\n"; return 0;
	}
	
	for(int i=0;i<s.length();i++)
	{
		cnt[s[i]-'A']++;
	}
	if(cnt['K'-'A']&&cnt['I'-'A']&&cnt['B'-'A']&&cnt['R'-'A']&&cnt['H'-'A'])
	{
		cout<<"YES\n";
	}
	else
	{
		cout<<"NO\n";
	}
}	


Measured memory_bytes: 768
#k,n
k,n = (int(x) for x in input().split())

#a
a = list(map(int, input().split()))

ans1 = 0
ans2 = 0
max = 0

a.sort()
"""
if k - a[n-1] < a[0] - 0:
a.append(k)
"""

for i in range(n-1):
    ans1 += a[i+1] - a[i]
    if a[i+1] - a[i] > max:
        max = a[i+1] - a[i]

ans1 += k - a[n-1] + a[0]
if k - a[n-1] + a[0] > max:
    max = k - a[n-1] + a[0]

ans1 -= max
print(ans1)

Measured memory_bytes: 26444
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define nl "\n"
#define rep(i,n) for(ll i=0; i<(n); i++)
typedef vector<ll> vl;

#define bit(subset,Rsift)(((subset)>>(Rsift))&1)
ll llpow(ll e, ll x){
    ll r=1;
    rep(_, x) r *= e;
    return r;
}

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

    // solution comes here
    ll N, M, k, x;
    cin >> N >> M;

    vl p(M);
    vector<vl> s(M, vl(N));
    rep(i, M){
        cin >> k;
        rep(_, k) {
            cin >> x;
            s[i][--x]++;
        }
    }
    rep(i, M) cin >> p[i];

    ll B=llpow(2, N), ans=0;
    rep(sub, B) {
        bool all_on=true;
        rep(i, M) {
            ll onSWITCH=0;
            rep(j, N){
                if( bit(sub,j) and s[i][j] ) onSWITCH++; 
            }
            if(onSWITCH%2 != p[i]) all_on=false;
        }
        if(all_on) ans++;
    }

    cout << ans << nl;
}

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

int main() {

	string a, b, c; cin >> a >> b >> c;
	string ans = "";
	ans += 'A' + (a[0] - 'a');
	ans += 'A' + (b[0] - 'a');
	ans += 'A' + (c[0] - 'a');
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const ll INF = 1e15;
// const int MOD = 1e9 + 7;

int main() {
    ll A, B, Q;
    cin >> A >> B >> Q;
    vector<ll> s(A + 2), t(B + 2), x(Q);
    s[0] = -INF;
    for (int i = 0; i < A; i++) {
        cin >> s.at(i + 1);
    }
    s[A + 1] = INF;
    t[0] = -INF;
    for (int j = 0; j < B; j++) {
        cin >> t.at(j + 1);
    }
    t[B + 1] = INF;
    for (int i = 0; i < Q; i++) {
        cin >> x.at(i);
    }

    vector<ll> ans(Q, INF);
    for (int i = 0; i < Q; i++) {
        auto itsr = lower_bound(ALL(s), x[i]);
        auto itsl = itsr - 1;
        ll sr = *itsr - x[i];
        ll sl = x[i] - *itsl;
        auto ittr = lower_bound(ALL(t), x[i]);
        auto ittl = ittr - 1;
        ll tr = *ittr - x[i];
        ll tl = x[i] - *ittl;
        //cerr << sl << " " << sr << " " << tl << " " << tr << endl;
        chmin(ans[i], max(sl, tl));
        chmin(ans[i], max(sr, tr));
        chmin(ans[i], min(2 * sl + tr, 2 * tr + sl));
        chmin(ans[i], min(2 * sr + tl, 2 * tl + sr));
    }

    for (auto a : ans) {
        cout << a << "\n";
    }
}


Measured memory_bytes: 4480
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		double r = sc.nextDouble();//半径
		//final double p = 3.1412372;
		double a;//面積
		double b;//円周

		a = (double) r * r * Math.PI;
		b = (double) r * 2 * Math.PI;

		//System.out.printf("%.6f",a);
		
		System.out.println(String.format("%.8f", a) + " " +  String.format("%.8f", b));

	}

}



Measured memory_bytes: 28264
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P std::pair<int,int>
#define PiP std::pair<int,std::pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp std::make_pair
#define prique(T) std::priority_queue<T,vector<T>,greater<T>>
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = std::max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = std::min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
int get_rand(int MIN, int MAX) {
	std::random_device rnd;
	std::mt19937 mt32(rnd());
	std::uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt32);
}
/*--------Library Zone!--------*/


signed main() {
	int n; string s;
	cin >> n >> s;
	if (n % 2) {
		cout << "No" << endl; return 0;
	}
	rep(i, n / 2) {
		if (s[i] != s[n / 2 + i]) {
			cout << "No" << endl; return 0;
		}
	}
	cout << "Yes" << endl;
}


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

int main() {
    clock_t cTimeStart, cTimeEnd;
    cTimeStart = clock();           // 現在時刻
    for(int i=1;i<10;++i){
    	for(int j=1;j<10;++j){
    	    cout<<i<<"x"<<j<<"="<<i*j<<endl;
    	}
    }

    cTimeEnd = clock();           // 現在時刻
//    cout<< "処理時間:" <<(cTimeEnd - cTimeStart)/1000 << "[ms]" << endl;

	return 0;
}

Measured memory_bytes: 1124
import sys
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n = I()
    h = list(IL())
    l = [0]*n
    l[0] = 0
    l[1] = abs(h[1]-h[0])
    for i in range(2,n):
        a = l[i] = l[i-2]+abs(h[i-2]-h[i])
        b = l[i] = l[i-1]+abs(h[i-1]-h[i])
        l[i] = min(a,b)
    print(l[-1])
    return

if __name__=='__main__':
    Main()

Measured memory_bytes: 20492
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    ll a,v,b,w,t;
    cin >> a >> v >> b >> w >> t;
    cout << ((abs(a-b) <= t*(v-w)) ? "YES" : "NO") << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  
  int count = 0;
  while( N > 0 ){
    N = N / 2;
    count++;
  }
  
  N = 1;
  for( int i = 0; i < count-1; i++ ){
    N *= 2;
  }
  cout << N << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int n, tens, ones;

	scanf("%d", &n);

	tens = n % 100;
	ones = n % 10;

	if (699 < n && n < 800)
	{
		printf("Yes\n");
	}
	else if (69 < tens && tens < 80)
	{
		printf("Yes\n");
	}
	else if (ones == 7)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 1644
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int long long
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define mod 1000000007
// order_of_key and *find_by_order
int32_t main()
{
	fast;
	int n;
	cin >> n;
	map<string , int > m;
	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;
		m[s]++;
	}
	cout << m.size();



}

Measured memory_bytes: 19244
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	int n, k;
	cin >> n >> k;
	cout << ((n % k == 0) ? 0 : 1) << endl;
}

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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int A, B, C, X;
  cin >> A >> B >> C >> X;

  int ans = 0;
  REP(a,A+1) REP(b,B+1) REP(c,C+1)
	if(a*500+b*100+c*50 == X)
	  ++ans;
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>

using namespace std;
int main(void){
    
    string s;
    cin>>s;
    for(int i=0;i<s.size()-1;i++){
        for(int j=i+1;j<s.size();j++){
            if(s[i]==s[j]){
                cout<<"no"<<endl;
                return 0;
            }
        }
    }
    cout<<"yes"<<endl;
    return 0;
}


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

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

typedef long long ll;
const ll MOD = 1e9 + 7;

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

  int d = 0;
  rep(i, N + 1) {
    if(S[i] == '1') {
      ++d;
      if(d == M) {
        std::cout << "-1" << '\n';
        return 0;
      }
    }
    else {
      d = 0;
    }
  }

  std::vector<int> path;
  path.push_back(N);

  int pos = N;
  while(pos > M) {
    int next = pos;
    for(int i = 1; i <= M; ++i) {
      if(S[pos - i] == '0') {
        next = pos - i;
      }
    }
    path.push_back(next);
    pos = next;
  }

  pos = 0;
  for(int i = path.size() - 1; i >= 0; --i) {
    int next = path[i];
    std::cout << next - pos << ' ';
    pos = next;
  }
  std::cout << '\n';
}


Measured memory_bytes: 1144
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
#define MAXSIZE 102
#define MAXL 100
typedef long long int lli;

int get_less(int x, int y);

int main(){
    int n, a, b, i, p[MAXSIZE];
    //int n, i, p[MAXSIZE];
    cin >> n >> a >> b;
    //cin >> n;
    for(i = 0; i < n; i++){
        cin >> p[i];
    }
    //sort(p, p + n);

    int sho = 0, chu = 0, dai = 0;
    for(i = 0; i < n; i++){
        if(p[i] <= a){
            sho++;
            //cout << "sho = " << sho << endl;
        }else if(p[i] <= b){
            chu++;
            //cout << "chu = " << chu << endl;
        }else{
            dai++;
            //cout << "dai = " << dai << endl;
        }
    }
    cout << get_less(get_less(sho, chu), dai) << endl;
    return 0;
}

int get_less(int x, int y){
    return (x < y)? x : y;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<long long>;
using vvi = vector<vector<int>>;
using pii = pair<int,int>;
using pll = pair<long,long>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back

vll rem(1e5+5,0),vec(1e5+5,0);

int main() {
  ll n,x,m,first=0,period=0;
  cin>>n>>x>>m;
  ll sum=0,ans=0;

  for(ll i=1;i<=m-1;i++) {
    rem[i]=x;
    if(vec[x]!=0) {
      first=vec[x];
      period=i-first;
    }
    vec[x]=i;
    x*=x;
    x%=m;
  }
  if(first!=0) {
    for(ll i=first;i<=first+period-1;i++) sum+=rem[i];
  } else {
    if(m==1) {
      ans=0;
    } else {
      for(ll i=1;i<=m-1;i++) sum+=rem[i];
      ans+=sum*(n/(m-1));
      n%=(m-1);
      for(ll i=1;i<=n;i++) ans+=rem[i];
    }
    cout<<ans<<endl;
    return 0;
  }

  if(n<=first) {
    for(ll i=1;i<=n;i++) ans+=rem[i];
  } else {
    for(ll i=1;i<=first-1;i++) ans+=rem[i];
    n-=first-1;
    ans+=sum*(n/period);
    n%=period;
    for(ll i=first;i<=first+n-1;i++) ans+=rem[i];
  }

  cout<<ans<<endl;
}


Measured memory_bytes: 4692
import java.util.*;

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

        int[] arr = new int[5];
        for (int i = 0; i < 5; i++) {
            arr[i] = sc.nextInt();
        }
        int k = sc.nextInt();

        System.out.println(arr[4] - arr[0] > k ? ":(" : "Yay!");
    }
}


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

int main() {
    int A,B,K;
    cin  >> A >> B >> K;

    for(int i=0;i<K;i++){
        if(i%2==0 && A%2==1) A--;
        if(i%2==1 && B%2==1) B--;

        if(i%2==0) {
            B+=A/2;
            A/=2;

            
        }
        else if(i%2==1) {
            A+=B/2;
            B/=2;
            
        }
    }
    cout << A << " " << B << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
int tx[] = {+0,+1,+0,-1};
int ty[] = {-1,+0,+1,+0};

void print_stage(deque<int> deq[101],int W,int H){
  for(int y=H-1;y>=0;y--){
    for(int x=0;x<W;x++){
      if(deq[x][y] == -1){
	printf(" ");
      }
      else{
	printf("%s",deq[x][y] ? "1" : "0");
      }
    }
    printf("\n");
  }
  printf("\n");
}

int solve(deque<int> deq[101],int W,int H){
  
  int res = 0;
  for(int y=H-1;y>=0;y--){
    for(int round = 0; round < W; round++){
      int next_x = -1;
      for(int x=0;x<W;x++){
	if(deq[x][y+1] != -1) continue;

	int count = 0;
	if(x-1 < 0) count++;
	if(x+1 >= W) count++;
	if(x-1 >= 0 && (deq[x-1][y] == -1)) count++;
	if(x+1 < W && (deq[x+1][y] == -1)) count++;
	
	if(count >= 1 && deq[x][y] == 1){
	  next_x = x;
	  break;
	}
	if(count >= 1 && deq[x][y] == 0 && next_x == -1){
	  next_x = x;
	}
      }
      if(next_x == -1) break;

      for(int i=0;i<4;i++){
	if(i == 2) continue;

	int dx = next_x + tx[i];
	int dy = y + ty[i];
	if(dx < 0 || dx >= W || dy < 0 || dy >= H) continue;
	if(deq[dx][dy] == -1) continue;
	    
	deq[dx][dy] = (deq[dx][dy] == 0 ? 1 : 0);
      }

      if(deq[next_x][y] == 1) res++;
      deq[next_x][y] = -1;

    }
  }
  return res;
}

int main(){
  int H,W;
  while(~scanf("%d %d",&H,&W)){
    deque<int> deq[101];
    for(int y=0;y<=H;y++){
      for(int x=0;x<W;x++){
	deq[x][y] = -1;
      }
    }

    for(int y=H-1;y >= 0;y--){
      for(int x=0;x<W;x++){
	int is_sweet;
	scanf("%d",&is_sweet);
	deq[x][y] = is_sweet;
      }
    }

    printf("%d\n",solve(deq,W,H));
  }
}

Measured memory_bytes: 1260
#include <stdio.h>
int main(){
	int a,b;
	char c;
	scanf("%d %c %d",&a,&c,&b);
	if (c=='+')
	{
		printf("%d\n",a+b);
	}else if (c=='-')
	{
		printf("%d\n",a-b);
	}
}

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

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl

const ll mod = 1e9 + 7;
const ll inf = 1e18;

const int N_MAX = 100010;
ll Per[N_MAX] = {}; // n!
ll Per_inv[N_MAX] = {}; //(n!)^-1

ll nCr(ll n, ll r){
    if(n<r) return 0;
 
    if (n == r || r == 0)
        return 1;
    else
        return Per[n] * Per_inv[n-r] % mod * Per_inv[r] % mod;  
}
 
// a^b mod p
ll mod_pow(ll a, ll b){
    if(b==0) return 1;
 
    // 肩が奇数
    if(b%2==1){
        return a * mod_pow(a, b-1) % mod;
    }
    else{
        return mod_pow(a*a % mod, b/2) % mod;
    }
}

void prepare_nCr(){
    // nCr高速化準備
    Per[1] = 1;
    FOR(i, 2, N_MAX){
        Per[i] = i * Per[i-1] % mod;
    }
    Per_inv[1] = 1;
    FOR(i, 2, N_MAX){
        Per_inv[i] = mod_pow(Per[i], 1000000005);
    }
}

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

    prepare_nCr();

    // input
    ll N, K;
    cin >> N >> K;

    FOR(i, 1, K+1){
        // 青いボールの挿入位置
        ll a = nCr(N-K+1, i) % mod;

        // 分割の仕方
        ll b = nCr(K-1, i-1);
        ll c = a * b % mod;
        p(c);
    }

    return 0;
}

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

const int N = 2005;
int n, x, a[N], m[N][N]; ll ans;
int main () {
	cin >> n >> x, ans = 0;
	for (int i = 1; i <= n; ++i) cin >> a[i], ans += a[i];
	for (int i = 1; i <= n; ++i) {
		m[i][0] = a[i];
		for (int j = 1; j < n; ++j) {
			int p = i - j; if (p <= 0) p += n;
			m[i][j] = min(m[i][j - 1], a[p]);
		}
	}
	for (int j = 0; j < n; ++j) {
		ll tmp = 0;
		for (int i = 1; i <= n; ++i) tmp += m[i][j];
		ans = min(ans, tmp + 1ll * j * x);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 15872
// Author : MohamedSameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define IN(n) scanf("%d" , &n )
#define debug(x) cout<<#x<<" = { "<<x<<" }\n"
void fo (){fflush(stdout);}
using namespace std;
int n ;
int a[100000];
int main ()
{
  scanf ("%d" , &n );
  for (int i =0 ; i < n ;i++)scanf ("%d" ,a+i );
  sort(a,a+n);
  printf ("%d\n" , a[n/2] - a[n/2-1]);


  cerr << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

template<typename T>
T gcd(T a, T b) {
    if(b == 0){
        return a;
    }else if(a == 0){
        return b;
    }else{
        return gcd(b, a % b);
    }
}




int main(){

    int n,x;
    cin>>n>>x;
    vector<int> v(n);

    REP(i,n){
        cin>>v[i];
    }
    int result=abs(x-v[0]);

    FOR(i,1,n){
        result=gcd(result,abs(x-v[i]));
    }

    cout << result << endl;

    return 0;
}


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

H = list(map(int, input().split()))
H_paths = {n: set() for n in range(N)}

for m in range(M):
    a, b = map(lambda x: int(x)-1, input().split())
    H_paths[a].add(b)
    H_paths[b].add(a)

result = N

for n in range(N):
    # print(f'H_paths[{n}]: {H_paths[n]}')
    for i in H_paths[n]:
        # print(f'H[{n+1}]: {H[n]}, H[{i+1}]: {H[i]}')
        # print('result:', result)
        if H[n] <= H[i]:
            result -= 1
            break

print(result)



Measured memory_bytes: 53872
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin>>N;
  
  vector<long> a(3*N);
  for(int i=0;i<3*N;i++){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end(),greater<int>());
  long sum=0;
  for(int i=0;i<N;i++){
    sum+=a.at(2*i+1);
  }
  cout<<sum<<endl;
  
}



Measured memory_bytes: 2560
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <time.h>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) (min(a,b) <= (x) && (x) <= max(a,b)) //hei
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007LL
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589


#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
	std::fill((T*)array, (T*)(array + N), val);
}
pll Dir[4] = {
	{ -1 ,0 },{ 0 , 1 },{ 1 ,0 },{ 0 ,-1 }
};

//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define INF 10000000000000000LL
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)

struct Edge {
	int from, to;
	ll w;
	bool operator<(const Edge& rhs) const {
		return MP(w, MP(from, to)) < MP(rhs.w, MP(rhs.from, rhs.to));
	}

};

ll factorial(ll n) {//階乗
	if (n > 0) {
		return n * factorial(n - 1) % MODU;
	}
	else {
		return 1LL;
	}
}
ll mod_pow(ll x, ll n) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % MODU;
		x = x * x % MODU;
		n >>= 1;
	}
	return res;
}
ll divmod(ll a, ll b) { // a/b(mod m)
								  // a/b (mod m)
								  // a*b^-1
								  // b^-1 * b = 1
								  // b^(m-1) = 1 
								  // b^(m-2) * b = 1
								  // b^-1 = b^(m-2)

								  // a/b = a * b^(m-2)

	return (a * 1LL * mod_pow(b, MODU - 2)) % MODU;
}

ll ncr(ll n, ll r) {
	if (n < r) return 0;
	return divmod( factorial(n) , factorial(r) * factorial(n - r) % MODU);
}
signed main(void) {

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

	rep(i,1, k + 1) {
		printf("%lld\n",(MODU + ncr(k - 1, i - 1) * ncr(n - k + 1, i)) % MODU);
	}

	return 0;
}


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

int N;
vector<vector<int>> A(2, vector<int>(101, 0));
vector<int> top(101, 0);
vector<int> under(101, 0);

int main(void){
    
    cin >> N;
    for(int i = 0; i < 2; ++i){
        for(int j = 0; j < N; ++j) cin >> A[i][j];
    }
    
    int t = 0, u = 0;
    for(int i = 0; i < N; ++i){
        t += A[0][i], u += A[1][i];
        top[i] = t;
        under[i] = u;
    }
    
    int ans = 0;
    for(int i = 0; i < N; ++i){
        if(i) ans = max(ans, top[i] + under[N - 1] - under[i - 1]);
        else ans = max(ans, top[i] + under[N - 1]);
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
using namespace std;
int main(int argc, char const *argv[])
{
    int a, b;
    cin >> a >> b;
    if (a > 0 && b > 0)
    {
        cout << "Positive";
    }else if(a<=0&&b>=0){
        cout<<"Zero";
    }else{
        if(abs(a-b)%2==0){
            cout << "Negative";
        }else{
            cout<<"Positive";
        }
    }
    /* code */
    return 0;
}


Measured memory_bytes: 256
/*
    Author - Param Kothari
    Ah shit, here we go again
*/

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

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mk make_pair

typedef long long ll;
typedef long double ld;

vector<ll> all(1000006);

void fill(){
    all[0] = 0LL;
    for(ll i = 1; i <= 1000005; i++){
        all[i] = (i * (i + 1)) / 2LL;
    }
    return;
}

void solve(){
    fill();
    ll n;
    cin >> n;
    map<ll, ll> divi;
    for(ll i = 2; i * i <= n; i++){
        if(n % i == 0){
            ll curr = 0;
            while(n % i == 0){
                curr++;
                n = n / i;
            }
            divi[i] = curr;
        }
    }
    if(n > 1){
        divi[n] = 1LL;
    }
    ll res = 0;
    for(auto x : divi){
        auto it = upper_bound(all.begin(), all.end(), x.second) - all.begin();
        it--;
        // cout << all[it] << " " << x.second << " " << x.first << "\n";
        res += it;
    }
    cout << res << "\n";
    return;
}

int main(){
    IOS;
    int t = 1;
    // cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
    }
    return 0;
}

Measured memory_bytes: 10988
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto N = readln.chomp.to!int;
    auto S = readln.chomp;
    auto Q = readln.chomp.to!int;
    auto ks = readln.split.to!(int[]);

    auto ms = new long[](N);
    auto cs = new long[](N);
    size_t[] dis, cis;
    long m, c;
    foreach (i, s; S) {
        if (s == 'M') ++m;
        ms[i] = m;
        if (s == 'D') {
            dis ~= i;
        }
        if (s == 'C') {
            cis ~= i;
            c++;
        }
        cs[i] = c;
    }
    auto cms = new long[](N);
    long last;
    foreach (i, s; S) if (s == 'D' || s == 'C') {
        if (s == 'C') last += ms[i];
        cms[i] = last;
    }

    foreach (k; ks) {
        long res;
        size_t ci;
        foreach (i; dis) {
            while (ci < cis.length && cis[ci] < i) ++ci;
            if (ci == cis.length) break;
            if (cis[ci] - i >= k) continue;
            size_t l = ci, r = cis.length-1;
            if (cis[$-1] - i < k) {
                l = r;
            } else {
                while (l+1 < r) {
                    m = (l+r)/2;
                    if (cis[m] - i >= k) {
                        r = m;
                    } else {
                        l = m;
                    }
                }
            }
            auto j = cis[l];
            res += cms[j] - cms[i] - ms[i] * (cs[j] - cs[i]);
        }
        writeln(res);
    }
}

Measured memory_bytes: 40872
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int D;
  cin >> N >> D;
  int ans = 0;
  if (N % (2 * D + 1) == 0) {
    ans = N / (2 * D + 1);
  }
  else {
    ans = N / (2 * D + 1) + 1;
  }
  cout << ans << endl;
}
     

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
 
int main(){
	int n;
	string s;
	cin>>n;
	cin>>s;
	if(n%2==1){
		cout<<"No"<<endl;
		return 0;
	}
	for(int i=0; i<n/2; i++){
		if(s[i]!=s[i+n/2]){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lpair = pair<ll, ll>;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i=(m);i<(n);i++)
#define rrep(i,m,n) for(ll i=(m);i>=(n);i--)
#define printa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
void print() {}
template <class H,class... T>
void print(H&& h, T&&... t){cout<<h<<" \n"[sizeof...(t)==0];print(forward<T>(t)...);}
vector<ll> tree[100010];
ll v[100010], d[100010], c[100010];
ll a[100010], b[100010];
ll dp[100010][11] = {};

void dfs(ll cur, ll depth, ll color){
    if(dp[cur][depth] != 0) return;
    dp[cur][depth] = color;
    if(depth > 0){
        dfs(cur, depth-1, color);
        for(auto &e: tree[cur]){
            dfs(e, depth-1, color);
        }
    }

}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,M;
    cin >> N >> M;
    rep(i,0,M){
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
        tree[a[i]].push_back(b[i]);
        tree[b[i]].push_back(a[i]);
    }
    ll Q;
    cin >> Q;
    rep(i,0,Q){
        cin >> v[i] >> d[i] >> c[i];
        v[i]--;
    }

    rrep(q,Q-1,0){
        dfs(v[q], d[q], c[q]);
    }
    rep(i,0,N) print(dp[i][0]);

    

}

Measured memory_bytes: 19444
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cassert>
#include <functional>
#include <string>
using namespace std;

int main(){
  int R, G; cin >> R >> G;
  cout << 2 * G - R << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <numeric>
#include <fstream>
#include <queue>
#include <cstdio>
#include <deque>
#include <map>
#define fol(i,n) for(int i=0;i<n;i++)
#define db(a) cout << a<< endl;
using namespace std;

int main(){
    string s,core="CODEFESTIVAL2016";
    int count = 0;
    cin >>s;
    fol(i,s.size()){
        if(s[i]!=core[i]) count++;
    }
    cout << count <<endl;
    return 0;
}


Measured memory_bytes: 256