akhauriyash/Code-Regression huggingface dataset:
// template version 1.12
using namespace std;
#include <bits/stdc++.h>

// varibable settings
#define infile "../test/sample-1.in"
#define int long long //{{{
const int INF=1e18;
const int MOD=1e9+7; //}}}

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define ceil(a,b) ((a)+(b)-1)/(b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

int solve(){
  int n;cin>>n;
  vector<int> x(n);
  rep(i, n) {
    cin>>x[i];
  }
  dump(x);

  vi y = x;
  vi ans;
  rep(cnt, n){
    rrep(i, n){
      if (y[i]==1){
        ans.pb(x[i]);
        rep(j, i, n) y[j]--;
        break;
      }
    }
  }
  if (sz(ans)==n){
    rep(i,n){
      cout << ans[i] << endl;
    }
  }
  else{
    cout << -1 << endl;
  }
  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

int main(){
    ll N; cin >> N;
    vll a(N);
    for(int i=0; i<N; i++){
        cin >> a[i];
    }
    map<ll, ll> m;
    vll lis(0);
    for(int i=0; i<N; i++){
        if(m.find(a[i]) == m.end()){
            m[a[i]] = 1;
            lis.emplace_back(a[i]);
        }else{
            m[a[i]]++;
        }
    }
    ll c = 0;
    for(auto x: lis){
        if(m[x] < x){
            c += m[x];
        }else{
            c += m[x] - x;
        }
    }
    cout << c;
}

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

int main() {
  int N;
  cin>>N;
  
  if(N==1){
    cout<<"Hello World"<<endl;
  }
  
  else if(N==2){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
  }
  
}


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

r = s.count('R')
g = s.count('G')
b = s.count('B')
counter = 0

for i in range(n-2):
  for j in range(i+1, n-1):
    k = 2*j - i
    if k > n-1:
      break
    if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
      counter += 1
      
print(r*g*b - counter)


Measured memory_bytes: 9216
n = int(input())

three = (3+(n//3)*3) * (n//3)/2
five = (5+(n//5)*5) * (n//5)/2
cup = (15+(n//15)*15) * (n//15)/2
total = (1+n) * n/2

ans = total - three - five + cup

print(int(ans))


Measured memory_bytes: 9180
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>
#include <bitset>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;


int main(){
  int N; cin >> N;
  vector<ll> a(N + 1);
  ll S = 0;
  rep(i, N + 1) {
    cin >> a[i];
    S += a[i];
  }

  ll ans = 0;
  ll f = 1;
  for (int i = 0; i <= N; ++i){
    ans += f;
    if (f < a[i]){
      cout << -1 << endl;
      return 0;
    }
    f -= a[i];
    S -= a[i];
    f *= 2;
    f = min(f, S);
  }
  cout << ans << endl;
  return 0;
}


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

#include<stdlib.h>
#include<iostream>
#include<math.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long
#define INF 2000000000
#define Min(a,b) (a<b?a:b)
#define Max(a,b) (a>b?a:b)
#define PI 3.1415926535897932
using namespace std;

int main()
{
IOS;
int N;
  cin >> N;
  
  int ans = N;
  while(ans % 360 != 0){
    ans += N;
  }
  
  cout << ans / N << endl;





return 0;
}

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

long long pow(long long m,long long n,long long N)
{
  if(n==0)return 1;
  long long res=pow(m*m%N,n/2,N);
  if(n%2==1) res=(res*m)%N;
  return res;
}

int main()
{
  int m,n;
  cin>>m>>n;
  cout<<pow(m,n,1000000007)<<endl;
  return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int         long long   
#define double      long double
#define endl        "\n"
#define pb          push_back
#define PI          3.1415926535897932384626433832795l
#define F           first
#define S           second
#define mp          make_pair
#define f(i,n)      for(int i=0;i<n;i++)
#define fastio      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v)      (v).begin(),(v).end()
#define sort(v)     sort((v).begin(),(v).end())
#define rall(v)     (v).rbegin(),(v).rend()
#define rsort(v)     sort((v).rbegin(),(v).rend())
#define gcd(a,b)    __gcd((a),(b))
#define minn(v)     *min_element(v.begin(), v.end());
#define maxx(v)     *max_element(v.begin(), v.end());
#define print(x)    cout<<(x)<<endl;
typedef pair<int,int> pii;  
typedef vector<int> vi;
//x.substr(start, length);

bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
}
struct type{
    int k, i, j;
};
signed main() 
{
    cout<<fixed<<setprecision(12);
    fastio;
    int n,m;
    cin>>n>>m;
    if(n==m)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    
    
    
}


Measured memory_bytes: 256
N = int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

list=factorization(N)
#print(list)

a=len(list)
A=[0]*a
def fun(n):
    qw=0
    qe=1
    while not n-qe<0:
        n=n-qe
        qe=qe+1
        qw+=1
    return qw
qwe=0

for i in list:
    qwe+=fun(i[1])
if N==1:
    print(0)
else:
    print(qwe)

Measured memory_bytes: 9508
#include<stdio.h>
#include<algorithm>
using namespace std;
int a,b,c;
int main(){
  scanf("%d%d%d",&a,&b,&c);
  if(min(a,b)<c && c<max(a,b)){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  
}

Measured memory_bytes: 128
#!/usr/bin/env ruby
# require 'pry'

# dpテンプレ
# 最小化
# dp = Hash.new{ Float::INFINITY }
# dp[i] = [dp[i], dp[i-1] + hoge].min
# dp[0] = 0
# 最大化
dp = Hash.new{Float::INFINITY}
dp[0] = 0
n = gets.to_i
ary=[]
1.upto(10) do |num|
  ary << 6**num
  ary << 9**num
  dp[num] = num
end
ary.sort!
dp[6]=1
dp[7]=2
dp[8]=3
dp[9]=1
10.upto(n) do |i|
  ary.each do |ele|
    break if ele > i
    dp[i] = [(dp[i-ele] + 1), (dp[i-1] + 1), dp[i]].min
  end
end

# p dp
puts dp[n]


Measured memory_bytes: 8316
#include<iostream>
#include<vector>
#include<queue>
#include<unordered_set>
using namespace std;

	bool is_connected(vector<vector<int>>const &graph, pair<int, int>const &e_rm)
	{
		queue<int> q;
		unordered_set<int> visited;
		q.push(0);
		while (!q.empty())
		{
			int from = q.front();
			q.pop();
			if (visited.count(from))
			{
				continue;
			}
			visited.insert(from);
			for (auto const &to : graph[from])
			{
				bool ng = ((from == e_rm.first&&to == e_rm.second) || (from == e_rm.second&&to == e_rm.first));
				if (!ng)
				{
					q.push(to);
				}
			}

		}
		return graph.size() == visited.size();
    }


	int main()
	{
		int n, m;
		cin >> n >> m;
		vector<pair<int, int>>edges;
		vector<vector<int>>graph(n);
		for (int i = 0; i < m; i++)
		{
			int a, b;
			
			cin >> a >> b;
			a--;
			b--;
			graph[a].push_back(b);
			graph[b].push_back(a);
			edges.push_back(make_pair(a,b));

		}
		int count = 0;
		for (int i = 0; i < m; i++)
		{
			bool conn = is_connected(graph, edges[i]);
			if (!conn )
			{
				count += 1;
			}
		
		}
		cout << count << endl;



	}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>

using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
int W[100];
void Calc(){
	int N = rei();
	for(int i=0;i<N;i++){
		W[i] = rei();
	}
	int sum = 0;
	for(int i=0;i<N;i++){
		sum += W[i];
	}
	int s = 0;
	int ans = 10000000;
	for(int i=0;i<N;i++){
		s += W[i];
		ans = min(ans,abs(sum-s-s));
	}
	cout << ans << endl;
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

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

int main(){
	int i=0,n,sum,a[110],m=1000000000;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=1;i<=100;i++){
		sum=0;
		for(int j=0;j<n;j++){
			sum+=(a[j]-i)*(a[j]-i);
		}
		m=min(m,sum);
	}
	cout<<m<<endl;
	return 0;
}

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

using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)

int main() {
	ll n; cin >> n;
	string s[50];
	ll c[26] = {};
	rep(i, 0, 26)c[i] = 1 << 29;
	rep(i, 0, n) {
		cin >> s[i];
		ll b[26] = {};
		rep(j, 0, s[i].size()) {
			b[s[i][j] - 'a']++;
		}
		rep(j, 0, 26) {
			c[j] = min(c[j], b[j]);
		}
	}
	rep(i, 0, 26) {
		rep(k, 0, c[i])cout << (char)(i + 'a');
	}
	cout << endl;
	return 0;
}

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

int main(){
  int W, H, x, y, r;

  cin>>W>>H>>x>>y>>r;

  if(x+r<=W && y+r<=H && x-r>=0 && y-r>=0){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }

  return 0;
}

Measured memory_bytes: 3084
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int i, j;
    int n;
    int card[4][14]={};
    char mark;
    int num;
    scanf("%d", &n);
    
    for (int i=0; i<n; i++) {
        scanf("%c", &mark);//改行読み込み
        scanf("%c %d", &mark, &num);
        if (mark == 'S') {
            card[0][num-1] = num;
        }else if(mark == 'H'){
            card[1][num-1] = num;
        }else if(mark == 'C'){
            card[2][num-1] = num;
        }else if(mark == 'D'){
            card[3][num-1] = num;
        }
    }
    
    /*
    for (j=0; j<4; j++) {
        for (i=0; i<13; i++) {
            if (card[j][i] == -1) {
                printf("%d\n", card[j][i]);
            }
        }
    }
     */
    //確認用
    
    for (j=0; j<4; j++) {
        for (i=0; i<13; i++) {
            if (card[j][i] == 0) {
                switch (j) {
                    case 0:
                        printf("S %d\n", i+1);
                        break;
                    case 1:
                        printf("H %d\n", i+1);
                        break;
                    case 2:
                        printf("C %d\n", i+1);
                        break;
                    case 3:
                        printf("D %d\n", i+1);
                        break;
                    default:
                        break;
                }
            }
        }
    }
    
    return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define int long long int
vector<int> v;
int32_t main(){
	int n,tmp;
	cin>>n; n++;
	while(n--){
		cin>>tmp;v.push_back(tmp);
	}
	sort(v.begin(),v.end());
	int ans = v[1]-v[0];
	for(int i=2;i<v.size();i++){
		ans = __gcd(ans,v[i]-v[i-1]);
	}
	cout<<ans;
}


Measured memory_bytes: 1400
#include <stdio.h>
#include <math.h>

#define MAX 200000

int main(void) {
	int R[MAX];
	int i;
	int n;
	int min;
	int max = -2000000000;
		
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++) {
		scanf("%d", &R[i]);
	}
	
	min = R[0];
	
	for (i = 1; i < n; i++) {
		max = fmax(max, R[i] - min);
		min = fmin(min, R[i]);
	}

	printf("%d\n", max);

	return 0;
}

Measured memory_bytes: 1380
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(long long i=0; i<(n); i++)
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; }


int main(){
    ll n; cin>>n;
    vector<pair<ll,ll>> a(n);
    rep(i,n) {
        cin >> a[i].first;
        a[i].second = i + 1;
    }
    // dp[x][y] =　A が大きい方から (x + y) 人選び，うち x 人を n, n - 1, ... の位置に動かした時の最大値
    // dp[x+1][y] = dp[x][y] + a[x+y].first * (x - a[x+y].second)
    // dp[x][y+1] = dp[x][y] + a[x+y].first * (a[x+y].second - y)
    sort(a.begin(), a.end(), greater<pair<ll,ll>>());
    vector<vector<ll>> dp(n+1, vector<ll>(n+1, -1));
    dp[0][0] = 0;
    for(ll s=1; s<=n; s++){
        for(ll x=0; x<=s; x++){
            if(s-x-1>=0) chmax(dp[x][s-x], dp[x][s-x-1] + a[s-1].first * (a[s-1].second - (s - x)));
            if(x-1>=0)  chmax(dp[x][s-x], dp[x-1][s-x] + a[s-1].first * ((n - x + 1) - a[s-1].second));
        }
    }
    ll res=-1;
    for(ll i=0; i<=n; i++) {
        chmax(res, dp[i][n-i]);
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 34652
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

struct Point{
    long long x, y;
};

struct Dis_num{
    long long dis;
    int p;
    bool operator < ( const Dis_num &right ) const {
        return dis < right.dis;
    }
};

Point xy[100005];
vector<int> xt[100005], yt[100005];

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

    rep(i,n) cin >> xy[i].x >> xy[i].y;

    Dis_num xn[100005], yn[100005];
    rep(i,n){
        xn[i] = {xy[i].x, i};
        yn[i] = {xy[i].y, i};
    }

    sort(xn, xn + n);
    sort(yn, yn + n);
    rep(i,n){
        if(i == 0){
            xt[ xn[i].p ].emplace_back(xn[i + 1].p);
            yt[ yn[i].p ].emplace_back(yn[i + 1].p);
        }else if(i == n - 1){
            xt[ xn[i].p ].emplace_back(xn[i - 1].p);
            yt[ yn[i].p ].emplace_back(yn[i - 1].p);
        }else{
            xt[ xn[i].p ].emplace_back(xn[i + 1].p);
            xt[ xn[i].p ].emplace_back(xn[i - 1].p);
            yt[ yn[i].p ].emplace_back(yn[i + 1].p);
            yt[ yn[i].p ].emplace_back(yn[i - 1].p);
        }
    }

    typedef pair<long long,long long> pl;
    priority_queue<long long, vector<pl>, greater<pl>> q;
    //priority_queue<pair<long long, int>> q;
    q.push(make_pair(0,0));

    vector<bool> used(n,0);
    long long ans = 0;
    while(not q.empty()){
        pair<long long, int> u = q.top(); q.pop();
        if(used[u.second]) continue;
        used[u.second] = true;
        ans += u.first;

        for(auto i : xt[u.second]){
            q.push(make_pair(abs(xy[u.second].x - xy[i].x), i));
        }
        for(auto i : yt[u.second]){
            q.push(make_pair(abs(xy[u.second].y - xy[i].y), i));
        }

    }
    cout << ans << endl;
}


Measured memory_bytes: 22004
#include<bits/stdc++.h>
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
#define pb push_back

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;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;

signed main(){
	int N;scanf("%lld",&N);
	int ans=0;
	REP(i,N+1){
		int j=N/i;
		ans+=(i+j*i)*j>>1;
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 3768
def tax_increase():
    """
    消費税率 8% → 消費税 A円
    消費税率 10% → 消費税 B円
    商品価格 X = A / 0.08  → 25A / 2
        　　 X = B / 0.1   → 10B
    消費税は切り捨てなので、消費税の範囲は
    A <= X < A+1
    """
    # 入力
    A, B = map(int, input().split())
    # 初期処理
    tax_excluded_price_list1 = list()
    tax_excluded_price_list2 = list()
    # 消費税率 8%
    tax_excluded_price_low1 = 25 * A / 2 # 税抜き価格1
    tax_excluded_price_low2 = int(tax_excluded_price_low1) # 小数点以下切り捨て1
    tax_excluded_price_high1 = 25 * (A+1) / 2 # 税抜き価格2
    tax_excluded_price_high2 = int(tax_excluded_price_high1) # 小数点以下切り捨て2
    # 税抜き価格の取り得る範囲 
    for i in range(tax_excluded_price_low2, tax_excluded_price_high2+1):
        if tax_excluded_price_low1 <= i and i < tax_excluded_price_high1:
            tax_excluded_price_list1.append(i)
    # 消費税率 10%
    tax_excluded_price_low1 = 10 * B # 税抜き価格1
    tax_excluded_price_low2 = int(tax_excluded_price_low1) # 小数点以下切り捨て1
    tax_excluded_price_high1 = 10 * (B+1) # 税抜き価格2
    tax_excluded_price_high2 = int(tax_excluded_price_high1) # 小数点以下切り捨て2
    # 税抜き価格の取り得る範囲 
    for i in range(tax_excluded_price_low2, tax_excluded_price_high2+1):
        if tax_excluded_price_low1 <= i and i < tax_excluded_price_high1:
            tax_excluded_price_list2.append(i)
    # 最も小さい金額で条件を満たすもの
    for i in tax_excluded_price_list1:
        if i in tax_excluded_price_list2:
            return i
    # 条件を満たす税抜き価格がない場合
    return '-1'
    
result = tax_increase()
print(result)

Measured memory_bytes: 9184
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <climits>

using namespace std;

int main() {
    int M = 0, c = 0;
    char s[11];
    for(int i=0; i<11; i++) {
        s[i] = 'a';
    }
    scanf("%s", s);
    for(int i=0; i<11; i++) {
        if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
            c++;
        } else {
            M = max(M, c);
            c = 0;
        }
        if(s[i] == 'a') break;
    }
    cout << M << endl;
}


Measured memory_bytes: 384
# C - Snuke Festival

import numpy as np
N = int(input())
A = np.array(list(int(x) for x in input().split()))
B = np.array(list(int(x) for x in input().split()))
C = np.array(list(int(x) for x in input().split()))
A.sort()
C.sort()

ans = np.sum(np.searchsorted(A, B,'left') * (N - np.searchsorted(C, B,'right')))
print(ans)

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

vector<long> ans;

void dfs(long n) {
  if (n > 3234566667) return;
  ans.push_back(n);
  int end = n % 10;
  int mi = max(0, end - 1);
  int mx = min(9, end + 1);
  for (int i = mi; i <= mx; i++) dfs(n * 10 + i);
}

int main() {
  int K;
  cin >> K;
  for (int i = 1; i <= 9; i++) dfs(i);
  sort(ans.begin(), ans.end());
  cout << ans.at(K - 1) << "\n";
}

Measured memory_bytes: 1400
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

int mcxiin(string x)
{
    int sum=0;
    REP(k,x.size())
    {
        if(x[k]=='m'){if(k==1)sum+=1000*(int)(x[0]-'0');else sum+=1000;}
        else if(x[k]=='c'){if(x[k-1]<='9'&&x[k-1]>'1')sum+=100*(int)(x[k-1]-'0');else sum+=100;}
        else if(x[k]=='x'){if(x[k-1]<='9'&&x[k-1]>'1')sum+=10*(int)(x[k-1]-'0');else sum+=10;}
        else if(x[k]=='i'){if(x[k-1]<='9'&&x[k-1]>'1')sum+=(int)(x[k-1]-'0');else sum+=1;}
    }
    return sum;
}

string mcxiout(int x)
{
    string xx=to_string(x);
    string sum;
    if(x/1000){if(xx[xx.size()-4]!='1')sum.push_back(xx[xx.size()-4]);sum.push_back('m');}
    if(x/100%10){if(xx[xx.size()-3]!='1')sum.push_back(xx[xx.size()-3]);sum.push_back('c');}
    if(x/10%10){if(xx[xx.size()-2]!='1')sum.push_back(xx[xx.size()-2]);sum.push_back('x');}
    if(x%10){if(xx[xx.size()-1]!='1')sum.push_back(xx[xx.size()-1]);sum.push_back('i');}
    return sum;
}

int main()
{
    int n;cin>>n;
    REP(lkafl,n)
    {
        string a,b;cin>>a>>b;
        int av=mcxiin(a);int bv=mcxiin(b);
        //cout<<av<<" "<<bv<<endl;
        int ab=av+bv;
        cout<<mcxiout(ab)<<endl;
    }
}


Measured memory_bytes: 3184
s = input()
left = int(s[:2])
right = int(s[2:])

if left == 0:
    if right == 0:
        print("NA")
    elif right < 13:
        print("YYMM")
    else:
        print("NA")
    exit()
if right == 0:
    if left < 13:
        print("MMYY")
    else:
        print("NA")
    exit()

if left < 13 and right < 13:
    print("AMBIGUOUS")
elif left < 13 and right > 12:
    print("MMYY")
elif left > 12 and right < 13:
    print("YYMM")
else:
    print("NA")

Measured memory_bytes: 38384
import fractions
from functools import reduce
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
N,X=map(int,input().split())
x=list(map(int,input().split()))
for i in range(N):
  if x[i]>X:
    x[i]=x[i]-X
  elif x[i]<X:
    x[i]=X-x[i]
  else:
    del x[i]
n=gcd_list(x)
print(n)

    

Measured memory_bytes: 16304
INF = 10000000000

def merge(A,left,mid,right):

	n1 = mid - left
	n2 = right - mid

	L = A[left:mid] + [INF]
	R = A[mid:right] + [INF]
	for i in range(n1):
		L[i] = A[left + i]

	for i in range(n2):
		R[i] = A[mid + i]

	i = 0
	j = 0
	cnt = 0
	for k in range(left,right):
		cnt += 1
		if L[i] <= R[j]:
			A[k] = L[i]
			i += 1
		else:
			A[k] = R[j]
			j += 1

	return cnt

def mergeSort(A,left,right):

	if left+1 < right:
		mid = ( left + right ) // 2
		cnt_l = mergeSort(A,left,mid)
		cnt_r = mergeSort(A,mid,right)

		return merge(A,left,mid,right)+cnt_l+cnt_r

	return 0

if __name__ == '__main__':

	num = int(input())
	A = [int(i) for i in input().split()]

	left = 0
	right = len(A)

	count = mergeSort(A,left,right)

	print(" ".join(map(str,A)))
	print(count)



Measured memory_bytes: 66588
def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    C = list(map(int, input().split(' ')))
    C.sort()
    pow_2 = 1  # 2 ** (2 * N - 2)
    for _ in range(2 * N - 2):
        pow_2 *= 2
        pow_2 %= MOD
    ans = 0
    for k, c in enumerate(C):
        ans += c * ((N - k + 1) * pow_2)
        ans %= MOD
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 31584
#include <stdio.h>

int main(void)
{
    int s, col_arr[35000] = {}, count = 1;

    scanf("%d", &s);
    col_arr[s] = 1;
    while (1) {
        count++;
        if (s%2){
            s = 3*s + 1;
        }
        else {
            s = s/2;
        }
        if (col_arr[s]){
            printf("%d\n", count);
            break;
        }
        else {
            col_arr[s] = 1;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
using namespace std;
int main() {
  string a,b; cin>>a>>b;
  int n= a.size();
  int m= b.size();
  int dp[n+1][m+1];
  string res="";
  for(int i=0;i<=n;i++){
    for(int j=0;j<=m;j++){
      if(i==0|| j==0) dp[i][j]=0;
      else if(a[i-1]==b[j-1]){
        dp[i][j]=dp[i-1][j-1]+1;
      }
      else dp[i][j]= max(dp[i-1][j],dp[i][j-1]);
    }
  }
  int i=n,j=m;
  while(i>0 && j>0){
    if(a[i-1]==b[j-1]){
      res+=a[i-1];
      i--;
      j--;
    }
    else if(dp[i-1][j]>dp[i][j-1]){
      i--;
    }
    else j--;
  }
  reverse(res.begin(),res.end());
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 38316
#include<bits/stdc++.h>
using namespace std;
string K;
long long P = 1e9+7;
long long D;

long long dp[100010][110][2];

long long f(int pos, long long sum , bool sw){
    if(pos == (int)K.size()){
        if(sum == 0) return 1;
        else return 0;
    }
    long long &re = dp[pos][sum][sw];
    if(re!=-1) return re;
    re = 0;
    if(sw == 0){
        for(int i = 0 ; i < 10 ; i++){
            re += f(pos+1,(sum%D+i%D)%D,0)  ;
            re %=P;
        }
    }else{
        for( int i = 0; i <= int(K[pos]-'0') ; i++){
            if(i == int(K[pos]-'0')){
                re+=f(pos+1,(sum%D+i)%D,1);
                re %=P;
            } 
            else{
                re += f(pos+1,(sum%D+i)%D,0);
                re %=P;
            } 
        }
    }

    return re;
}
int main(){
    while(cin>>K>>D){
        memset(dp,-1,sizeof dp);
        cout<<(f(0,0,1)-1+P)%P<<"\n";
    }
    return 0;
}

Measured memory_bytes: 176296
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstdlib>
#define INF 100000000
#define _INF -100000000
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> P;

int n;
vi A(10);
string ret;

void dfs(int k, int b, int c) {
	if (k > 9) {
		ret = "YES";
		return;
	}
	int a = A[k];
	if (a > b) dfs(k + 1, a, c);
	if (a > c) dfs(k + 1, b, a);
}

void solve() {
	ret = "NO";
	dfs(1, A[0], 0);
	cout << ret << endl;
}

int main() {
	cin >> n;
	Loop(i, n) {
		Loop(j, 10) {
			cin >> A[j];
		}
		solve();
	}
	return 0;
}

Measured memory_bytes: 3152
n = int(input())
A = []
for i in range(n):
    a,l = map(int,input().split())
    A.append([a-l,a+l])
A = sorted(A,key = lambda x:x[1])

#print(A)
#now = A[0][0] + A[0][1]
cnt = 0
now = -(1<<60)
for i in range(n):
    f,s = A[i]
    if now > f:
        continue
    cnt += 1
    now = s
print(cnt)


Measured memory_bytes: 22104
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <math.h>
#include <deque>
using ll = long long;
using namespace std;

int main(){
    string s;
    cin >> s;
    int cnt = 0, ans = 0;
    for (int i = 0; i < s.size(); i++) {
        if(s[i]=='A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C'){
            cnt++;
            ans = max(ans, cnt);
        }
        else cnt = 0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
L=input()
N=len(L)
mod = 10**9+7

def mod_pow(x,n):
    if n==0:return 1
    if n%2:return (x*mod_pow(x,n-1))%mod
    return (mod_pow(x,n//2)**2)%mod

ans = 0
C=0
for i in range(N):
    if L[i]=="0":continue
    ans += mod_pow(2,C)*mod_pow(3,N-1-i)
    ans %= mod
    C+=1
ans += mod_pow(2,C)
ans %= mod
print(ans)

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

    using namespace std;
    using namespace std;
    typedef long long ll;
    #define endl "\n";
    #define MAX 10000001+9   //Maximum array size;
    #define loop(n) for(ll i=0;i<n;i++)
    #define loop2(n) for(ll i=0;i<n;i+=2)
    #define all(v) v.begin(),v.end()
    #define sz(v)  v.size()
    typedef vector<ll> vi;
    typedef set<ll> si;

    void fast() {

        cin.tie(0);
        cin.sync_with_stdio(0);
    }

    int pow(int a, int b) {
        int pow = 1;
        loop(b)pow *= a;
        return pow;
        //thanks m7md :)
    }

    int c[10] = {0};

    void doit(ll num) {


        switch (num) {
            case 2:
                c[2]++;
                break;
            case 3:
                c[3]++;
                break;
            case 4:
                c[2] += 2;
                c[3]++;
                break;
            case 5:
                c[5]++;
                break;
            case 6:
                c[3]++;
                c[5]++;
                break;
            case 7:
                c[7]++;
                break;
            case 8:
                c[2] += 3;
                c[7]++;
                break;
            case 9:
                c[3] += 2;
                c[2]++;
                c[7]++;
                break;
        }

    }

    int main() {
        fast();
        //freopen("input.txt","r",stdin);
        string s;cin>>s;
        int counter=0;
        int n=s.size();
        for (int i = 0; i <s.size()/2 ; ++i) {
            if(s[i]!=s[n-i-1])counter++;
        }
        cout<<counter;
    }

Measured memory_bytes: 256
public class Main {
    public static void main(String[] args) {
        var sc = new java.util.Scanner(System.in);
        var pw = new java.io.PrintWriter(System.out);
        int t = Integer.parseInt(sc.next());
        while (t --> 0) {
            long n = Long.parseLong(sc.next());
            long m = Long.parseLong(sc.next());
            long a = Long.parseLong(sc.next());
            long b = Long.parseLong(sc.next());
            pw.println(floorSum(n, m, a, b));
        }
        sc.close();
        pw.flush();
        pw.close();
    }

    public static long floorSum(long n, long m, long a, long b) {
        /**
         * T = floor((A*(N-1)+B)/m);
         * 
         * Goal: Sum[k=1,T]#{0<=i<N|A*i+B>=k*M}
         * 
         * #{i|A*i+B>=kM}=#{i|i>=ceil((kM-B)/A)}=#{i|i>=floor((kM-B+A-1)/A)}=N-floor((kM-B+A-1)/A)
         * 
         * = T*N - Sum[k=1,T]floor((kM-B+A-1)/A))
         * 
         *   M = p*A + q, -B-1 = -r*A + s
         * 
         * = T*N + floor((-B+A-1)/A) - Sum[k=0,T]floor((k*(p*A+q)+A-r*A+s)/A))
         * = T*N + floor((-B+A-1)/A) - Sum[k=0,T](floor((k*q+s)/A))+k*p+1-r)
         * = T*N + floor((-B+A-1)/A) - floorSum(T+1,A,q,s) - p*T*(T+1)/2 + (T+1)*(r-1)
         * = T*N - floorSum(T+1,A,q,s) - p*T*(T+1)/2 + T*(r-1)
         */
        long t = (a * (n - 1) + b) / m;
        if (t == 0) return 0;
        long p = m / a;
        long q = m % a;
        long s = (a - (b % a)) - 1;
        long r = (b + 1 + s) / a;
        // System.out.printf("(n, m, a, b) = (%d, %d, %d, %d) -> ", n, m, a, b);
        // System.out.printf("(p, q, r, s) = (%d, %d, %d, %d)\n", p, q, r, s);
        return t * n - p * t * (t + 1) / 2 + t * (r - 1) - floorSum(t + 1, a, q, s);
    }

    public static long gcd(long a, long b) {
        if (a < b) return gcd(b, a);
        if (b == 0) return a;
        if (a == 0) return b;
        for (long r = a % b; r != 0; r = a % b) {
            a = b; b = r;
        }
        return b;
    }
}


Measured memory_bytes: 58152
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define forn(l, r) for (int i = l; i < (r); ++i)
#define F first
#define S second
#define MAXN 212345
#define INF 0x3f3f3f3f3f3f3f3fLL

typedef long long int ll;


using namespace std;


int32_t main() {

    ios::sync_with_stdio(0);

    int n, l;
    string arr[101];

    cin >> n >> l;

    forn(0, n){
        cin >> arr[i];
    }

    sort(arr, arr + n);

    forn(0, n){
        cout << arr[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.mc", "r", stdin);
	string str = "";
	int n;

	while (getline (cin, str ) ){
		stringstream ssn(str);
		ssn >> n;
		if (n == 0){
			break;
		} // end if

		vector <vector <int> > sum (n+1, vector <int> (n+1, 0 ) );
		int i,j;

		for (i = 0; i < n; ++i){
			getline (cin, str );
			stringstream ss (str );
			for (j = 0; j < n; ++j){
				ss >> sum[i][j];
			} // end for
		} // end for

		for (i = 0; i < n; ++i){
			for (j = 0; j < n; ++j){
				sum[i][n] += sum[i][j];
			} // end for
		} // end for

		for (i = 0; i < n; ++i){
			for (j = 0; j < n; ++j){
				sum[n][j] += sum[i][j];
			} // end for
		} // end for
		for (i = 0; i < n; ++i){
			sum[n][n] += sum[i][n];
		} // end for

		for (i = 0; i <= n; ++i){
			for (j = 0; j <= n; ++j){
				cout << setw(5) << sum[i][j];
			} // end for
			cout << endl;
		} // end for
	} // end loop
		
	return 0;
}

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

using namespace std;

inline long long read(){
   long long w=1,s=0;
   char ch=getchar();
   while(ch<'0'||ch>'9') {if (ch=='-') w=-1;ch=getchar();} 
   while(ch>='0'&&ch<='9')  s=s*10+ch-'0',ch=getchar();
   return s*w;
}


int main(){
    long long  n=read(),m=read();
    if (m%2!=0){
        long long k=n/m;
        cout<<k*k*k;
    }
    else {
        long long  k=(n/(m/2)+1)/2;
        long long  ans=k*k*k;
        k=n/m;
        ans+=k*k*k;
        cout<<ans;
    }
        return 0;
}

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

int main() {
  int h,a;
  cin>>h>>a;
  int count=0;
  while(h>0){
   count++;
    h-=a;
  }
  cout<<count<<endl;
}




 







Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long int n,i,p,a,m;
    cin>>n;
    m=10000000000000;
    for(i=1;i*i<=n;i++)
    {
        if(n%i==0)
        {
            p=n/i;
            a=(p-1)+(i-1);
            if(a<m)
            {
                m=a;
            }
        }
    }
    cout<<m<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		while ((line = br.readLine()) != null) {
			String[] arr = line.split(" ");
			int n = Integer.parseInt(arr[0]);
			int x = Integer.parseInt(arr[1]);
			if (n == 0 && x == 0)
				break;

			int cnt = 0;
			for (int i = 1; i <= n; i++) {
				for (int j = i + 1; j <= n; j++) {
					for (int k = j + 1; k <= n; k++) {
						if (i + j + k == x)
							cnt++;
					}
				}
			}
			System.out.println(cnt);
		}
	}
}

Measured memory_bytes: 18852
n,k=map(int,input().split())

r,s,p=map(int,input().split())

t=input()

ans=0
l=[0 for _ in range(n)]

for i in range(k):
  if t[i]=="r":
    ans+=p
  elif t[i]=="s":
    ans+=r
  else:
    ans+=s

for i in range(k,n):
    if t[i]!=t[i-k] or l[i-k]==1:
        if t[i]=="r":
            ans+=p
        elif t[i]=="s":
            ans+=r
        else:
            ans+=s
    else:
        l[i]=1

print(ans)

Measured memory_bytes: 10300
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
#define inf 200000000000000
#define MAXN 1000001
#define eps 0.0000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();

//////////////

#define S second
#define F first
#define int long long  

//////////

int a[100001];
int dsu[100001];
int size[100001];
int med[100001];
int suw[100001];
int e[100001];
int vis[100001];
vector<pair<int,pair<int,int>>> gr[100001];
int root(int i)
{
    if(dsu[i]==i)
        return i;
    dsu[i]=root(dsu[i]);
    return dsu[i];
}
void dfs(int i,int w)
{
    if(vis[i]==1)
        return;
    vis[i]=1;
    for(auto r:gr[i])
    {
        if(r.S.F<=w)
        {
            e[r.S.S]=1;
            dfs(r.F,w);
        }
    }
}
signed main()
{
    fastio;
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;++i)
        cin>>a[i];
    pair<int,pair<int,int>> ed[m];
    for(int i=0;i<m;++i)
    {
        int x,y,w;
        cin>>x>>y>>w;
        ed[i].S.F=x;
        ed[i].S.S=y;
        ed[i].F=w;
    }
    sort(ed,ed+m);
    int valid[m+1];
    for(int i=1;i<=n;++i)
    {
        dsu[i]=i;
        size[i]=1;
        valid[i]=1;
        med[i]=0;
        suw[i]=a[i];
    }
    int inv=0;
    for(int i=0;i<m;++i)
    {
        int x,y,w;
        x=ed[i].S.F;
        y=ed[i].S.S;
        w=ed[i].F;
        gr[x].push_back({y,{w,i}});
        gr[y].push_back({x,{w,i}});
        int rx=root(x);
        int ry=root(y);
        if(rx==ry)
        {
            med[rx]=max(med[rx],w);
            if(med[rx]<=suw[rx])
            {
                valid[i]=1;
            }
            else
                valid[i]=0;
        }
        else
        {
            if(size[rx]<size[ry])
                swap(rx,ry);
            dsu[ry]=rx;
            suw[rx]+=suw[ry];
            med[rx]=max(med[rx],med[ry]);
            size[rx]+=size[ry];
            med[rx]=max(med[rx],w);
            if(med[rx]<=suw[rx]){
                valid[i]=1;
            }
            else
                valid[i]=0;
        }
    }
    for(int i=m-1;i>=0;--i)
    {
        if(valid[i]==0)
            continue;
        int x,y,w;
        x=ed[i].S.F;
        y=ed[i].S.S;
        w=ed[i].F;
        if(vis[x]==1||vis[y]==1)
            continue;
        dfs(x,w);
    }
    int ans=0;
    for(int i=0;i<m;++i)
        ans+=!e[i];
    cout<<ans;
}

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

int main(){
  int N;
  cin >> N;
  vector<long long> A(N);
  for (int i=0 ; i<N ; i++)
    cin >> A.at(i);
  
  vector<long long> S(N);
  S.at(N-1) = 0;
  for (int i=0 ; i<N-1 ; i++)
    S.at(N-2-i) = (S.at(N-1-i)+A.at(N-1-i))%1000000007;
  
  long long ans = 0, plus;
  for (int i=0 ; i<N-1 ; i++){
    plus = (A.at(i)*S.at(i))%1000000007;
    ans = (ans+plus)%1000000007;
  }
  cout << ans << endl;
}

Measured memory_bytes: 6356
#include<bits/stdc++.h>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iostream>
#define ios   ios_base::sync_with_stdio(false);  cin.tie(0);    cout.tie(0);
typedef  int ll;
using namespace std;
int main() {
    ios;
    ll t=1;
    //cin>>t;
    while(t--)
    {
      string s1,s2;
      cin>>s1>>s2;
      if(s1.size()+1==s2.size())
      {
           for(ll i=0;i<s1.size();++i)
           {
               if(s1[i]!=s2[i])
               {
                   cout<<"No";
                   return 0;
               }
           }
           cout<<"Yes";
      }
      else
      cout<<"No";
    }
}

Measured memory_bytes: 3636
a, b, c = map(int, input().split())
# iff a + b + 2sqrt(ab) < c
# iff 4ab < (c-a-b)^2
if 4 * a * b < (c - a - b) * (c - a - b) and c - a - b >= 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 2940
#pragma region header
#include <bits/stdc++.h>
using namespace std;

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;
#pragma endregion

#pragma region const
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#pragma endregion

#pragma region util
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}
#pragma endregion

#pragma region init
struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

int main()
{
	double N,T,A;
	cin >> N >> T >> A;
	i64 ans = 0;
	double min_diff = 99999.9;
	FOR(i, 1, N + 1)
	{
		double H;
		cin >> H;
		double diff = abs(A - (T - H * 0.006));
		if (diff < min_diff)
		{
			ans = i;
			min_diff = diff;
		}
		if (min_diff == 0)
			break;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
/*
*/

//#pragma GCC optimize("O3")
#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds
#define ends asdgahhfdsfshdshfd

#define eps 1e-8
#define M_PI 3.141592653589793
#define bsize 512

#define ldouble long double
using namespace std;

#define bs 1000000007

const int N = 600031;

int n;
int solved_flag;

int query(int ps){
	if (solved_flag)
		return -1;
	cout<<ps<<endl;
	string temp;
	cin>>temp;
	if (temp[0]=='V'){
		solved_flag=1;
		return -1;
	}
	if (temp[0]=='M')
		return 0;
	return 1;
}

int do_count(int old,int nw,int for_old){
	int cng=(old%2);
	cng^=(nw%2);
	return for_old^cng;
}

int main(){
//	freopen("apache.in","r",stdin);
//	freopen("apache.out","w",stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//ios_base::sync_with_stdio(0);
//	cin.tie(0);

	cin>>n;

	int hereL=query(0);
	int hereR=query(n-1);

	int l=0;
	int r=n-1;

	while (true){
		if (solved_flag)
			break;
		int mid=l+r;
		mid/=2;
		int hereM=query(mid);
		int should_be_L=do_count(l,mid,hereL);
		int should_be_R=do_count(r,mid,hereR);
		if (should_be_L==hereM){ // r part with break
			hereL=hereM;
			l=mid;
		}
		else
		{
			hereR=hereM;
			r=mid;
		}
	}

//	cin.get(); cin.get();
	return 0;
}


Measured memory_bytes: 852
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		int[] V = new int[N];
		int[] C = new int[N];
		
		for(int i = 0; i < N; i++) {
			V[i] = sc.nextInt();
		}
		
		for(int i = 0; i < N; i++) {
			C[i] = sc.nextInt();
		}
		
		int value = 0;
		
		for(int i = 0; i < N; i++) {
			if(V[i] - C[i] > 0) {
				value += V[i] - C[i];
			}
		}
		System.out.println(value);
	}
}

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

char an[500][501];

inline char id(int x){
	if (x == 0)return 'R';
	if (x == 1)return 'G';
	if (x == 2)return 'B';
	return 'Y';
}

int main(){
	int n, m, d;
	scanf("%d%d%d", &n, &m, &d);
	int c = 0;
	f(z, -(m - 1), n){
		if (z % d == 0)c ^= 2;
		f(i, 0, n){
			int j = i - z;
			if (j < 0 || j >= m)continue;
			int cc = c | ((i + j) / d & 1);
			an[i][j] = id(cc);
		}
	}
	f(i, 0, n)printf("%s\n", an[i]);
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
int n,h,ans,mx;
int a[100005],b[100005];
bool cmp(int a,int b){
	return a>b;
}
int main(){
	cin>>n>>h;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		mx=max(mx,a[i]);
	}
	sort(b,b+n,cmp);
	for(int i=0;i<n;i++)
		if(h>0&&b[i]>mx){
			h-=b[i];
			ans++;
		}
	if(h>0)
		ans+=(h+mx-1)/mx;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1024
// ------------------------------------
// Date:2018/ 3/15
// Problem:APC 001 TwoArrays re_b.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

typedef long long ll;

static const int MOD = 1000000007;

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int N;
  cin >> N;
  vector< int > a(N);
  vector< int > b(N);
  REP(i, N) {
    cin >> a[i];
  }
  REP(i, N) {
    cin >> b[i];
  }
  
  ll cost = 0ll;
  REP(i, N) {
    // debug(a[i]);
    // debug(b[i]);
    ll tmp = b[i] - a[i];
    if (tmp < 0) cost += tmp;
    else {
      if (tmp <= 1) continue;
      cost += tmp / 2;
    }
    // debug(i);
    // debug(cost);
  }

  bool ok = true;
  if (cost < 0) ok = false;

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



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


int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N,length = 0; cin >> N;
  ll max_n = 200000;
  vector<ll> vec(N);
  for (ll i = 0; i < N; ++i) cin >> vec[i];
  if (*min_element(vec.begin(),vec.end()) != 1) cout << -1 << endl;
  else {
    auto itr = vec.begin();
    for (ll i = 1; i <= N; ++i) {
      itr = find(itr,vec.end(),i);
      if (itr != vec.end()) length += 1;
      else break;
    }
    cout << N - length << endl;
  }
  return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>

int main(void) {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a % 2 == 0 || b % 2 == 0) {
    printf("Even\n");
  } else {
    printf("Odd\n");
  }

  return 0;
}


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

int N;
string s;
long long res;
void calc(int p, long long q){
  long long ret = 0;
  if(p == N){
     res += q;
     return;
  }
  for(int i=p; i<N; ++i){
    ret = 10*ret + (s[i] - '0');
    calc(i+1, q+ret);
  }
  return;
}

int main(){
  ios_base::sync_with_stdio(false); 
  cin >> s;
  N = s.length();
  calc(0, 0);
  cout << res << "\n";
  return 0;
}


Measured memory_bytes: 384