akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class M>
struct SegmentTree{
    using T = typename M::T;
    int sz;
    vector<T> seg;
    explicit SegmentTree(int n) {
        sz = 1;
        while(sz < n) sz <<= 1;
        seg.assign(2*sz, M::e());
    }

    void set(int k, const T &x){ seg[k + sz] = x; }

    void build(){
        for (int i = sz-1; i > 0; --i) seg[i] = M::f(seg[2*i], seg[2*i+1]);
    }

    void update(int k, const T &x){
        k += sz;
        seg[k] = x;
        while (k >>= 1) seg[k] = M::f(seg[2*k], seg[2*k+1]);
    }

    T query(int a, int b){
        T l = M::e(), r = M::e();
        for(a += sz, b += sz; a < b; a >>=1, b>>=1){
            if(a & 1) l = M::f(l, seg[a++]);
            if(b & 1) r = M::f(seg[--b], r);
        }
        return M::f(l, r);
    }

    template<typename C>
    int find(int t, C &c, T &val, int k, int l, int r){
        if(r-l == 1){
            val = f(val, seg[k]);
            return c(val) ? k-sz : -1;
        }
        int m = (l+r) >> 1;
        if(m <= t) return find(t, c, val, (k << 1) | 1, m, r);
        if(t <= l && !c(val = f(val, seg[k]))) return -1;
        int lv = find(t, c, val, (k << 1) | 0 , l, m);
        if(~lv) return lv;
        return find(t, c, val, (k << 1) | 1, m, r);
    }

    template<typename C>
    int find(int t, C &c){
        T val = M::e();
        return find(t, c, val, 1, 0, sz);
    }
    T operator[](const int &k) const { return seg[k + sz]; }
};


struct Monoid{
    using T = int;
    static T f(T a, T b) { return a+b; }
    static T e() { return 0; }
};

int main() {
    int n, k;
    cin >> n >> k;
    vector<ll> v(n);
    for (auto &&i : v) scanf("%lld", &i), i -= k;
    vector<ll> s(n+1);
    for (int i = 0; i < n; ++i) {
        s[i+1] = s[i] + v[i];
    }
    vector<ll> z(s);
    sort(z.begin(), z.end());
    z.erase(unique(z.begin(), z.end()), z.end());
    ll ans = 0;
    SegmentTree<Monoid> seg(z.size());
    vector<int> cnt(z.size());
    for (int i = 0; i <= n; ++i) {
        int val = lower_bound(z.begin(),z.end(), s[i]) - z.begin();
        ans += seg.query(0, val+1);
        cnt[val]++;
        seg.update(val, cnt[val]);
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 6564
#include <stdio.h>
 
int main(void){
    int w,h,n;
    scanf("%d %d %d",&w,&h,&n);
    char ans[w+1][h+1];
    int i,j;
    for(i=0;i<=w-1;i++){
        for(j=0;j<=h-1;j++){
            ans[i][j]=0;
        }
    }
    
    
    int i1;
    for(i1=1;i1<=n;i1++){
        int a1,a2,a3;
        scanf("%d %d %d",&a1,&a2,&a3);
        
        int c,d;
        switch(a3){
            case 1:
                for(c=0;c<a1;c++){
                    for(d=0;d<=h-1;d++){
                        ans[c][d]=1;
                    }
                }
                break;
            case 2:
                for(c=a1;c<=w-1;c++){
                    for(d=0;d<=h-1;d++){
                        ans[c][d]=1;
                    }
                }
                break;
            case 3:
                for(c=0;c<=w-1;c++){
                    for(d=0;d<a2;d++){
                        ans[c][d]=1;
                    }
                }
                break;
            case 4:
                for(c=0;c<=w-1;c++){
                    for(d=a2;d<=h-1;d++){
                        ans[c][d]=1;
                    }
                }
                break;
        }
        
    }
    int white=0;
    int s1,s2;
    for(s1=0;s1<=w-1;s1++){
        for(s2=0;s2<=h-1;s2++){
            if(ans[s1][s2]==0){
                white++;
            }
        }
    }
    printf("%d",white);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define mp make_pair
#define inf 1000000007
#define ll long long
using namespace std;
signed main(){
	vector< pair<ll,ll> > v;
	ll n;
	cin>>n;
	for(ll i=1;i<=n;i++){
		ll x;
		cin>>x;
		v.pb( mp(x,i) );
	}
	sort(v.begin(),v.end());
	reverse(v.begin(),v.end());
	v.pb(mp(0,0));
	vector<ll> a;
	for(ll i=0;i<=n;i++){
		a.pb(0);
	}
	priority_queue<ll> que;
	for(ll i=0;i<n;i++){
		que.push( -v[i].second );
		ll idx = -que.top();
		a[idx] += (v[i].first-v[i+1].first) * (i+1);
	}
	for(ll i=1;i<=n;i++){
		cout<<a[i]<<endl;
	}
	return 0;
}

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

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

int gcd3(int a, int b, int c){
    return gcd(gcd(a,b),c);
}

int main() {
    int k; cin >> k;
    ll ans = 0;
    rep(i, k)rep(j, k)rep(l, k){
        ans += gcd3(i+1, j+1, l+1);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3636
#include<iostream>
#include<queue>

using namespace std;


int main() {
	long long n,k;
	cin >> n >> k;
	int* a = new int[n];
	for (int i = 0;i < n;i++) {
		cin >> a[i];
	}
	int l = 1, r = 1e9;
	long long cnt = 0;
	for (int i = 0;i < n;i++) {
		cnt += a[i] - 1;
	}
	if (cnt <= k) {
		cout << 1 << endl;
		return 0;
	}
	while (r - l > 1) {
		int mid = (r + l) / 2;
		cnt = 0;
		for (int i = 0;i < n;i++) {
			if (a[i] % mid) {
				cnt += a[i] / mid;
			}
			else {
				cnt += a[i] / mid - 1;
			}
		}
		if (cnt <= k)r = mid;
		else l = mid;
	}
	cout << r << endl;
}

Measured memory_bytes: 3916
#include <bits/stdc++.h>
#define dbg() cerr <<
#define name(x) (#x) << ": " << (x) << ' ' <<

using namespace std;

const int MOD = (int)1e9 + 7;

int Add(int a, int b) {
  a += b;
  while (a >= MOD) a -= MOD;
  while (a < 0) a += MOD;
  return a;
}

int Mul(int a, int b) {
  return 1LL * a * b % MOD;
}

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

  int n; cin >> n;
  vector<int> p(n);
  vector<vector<int>> adj(n);
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    if (p[i] != -1) {
      --p[i];
      adj[i].emplace_back(p[i]);
      adj[p[i]].emplace_back(i);
    }
  }

  vector<bool> vis(n);
  function<void(int, int&, int&)> DFS = [&](int node, int &nodes, int &edges) {
    ++nodes;
    vis[node] = true;
    for (int &x : adj[node]) {
      ++edges;
      if (vis[x]) continue;
      DFS(x, nodes, edges);
    }
  };

  int cycles = 0;
  vector<int> comps;
  for (int i = 0; i < n; ++i) {
    if (vis[i]) continue;
    int nodes = 0, edges = 0;
    DFS(i, nodes, edges);
    edges /= 2;

    if (edges == nodes - 1) {
      comps.emplace_back(nodes);
    } else {
      assert(edges == nodes);
      ++cycles;
    }
  }

  vector<int> pw((int)comps.size() + 1);
  pw[0] = 1;
  for (int i = 1; i <= (int)comps.size(); ++i) {
    pw[i] = Mul(pw[i - 1], n - 1);
  }

  int ans = Mul(cycles, pw[(int)comps.size()]); // the ones we already have

  // make a cycle in the same comp
  for (int size : comps) {
    ans = Add(ans, Mul(size - 1, pw[(int)comps.size() - 1]));
  }

  // make cycles from more comps
  vector<vector<int>> dp(comps.size() + 1, vector<int>(comps.size() + 1));
  dp[0][0] = 1;
  for (int i = 1; i <= (int)comps.size(); ++i) {
    int size = comps[i - 1];
    for (int j = 0; j <= i; ++j) {
      dp[i][j] = dp[i - 1][j];
      if (j > 0) {
        dp[i][j] = Add(dp[i][j], Mul(dp[i - 1][j - 1], size));
      }
    }
  }

  int fact = 1;
  for (int i = 2; i <= (int)comps.size(); ++i) {
    int ways = Mul(dp.back()[i], pw[(int)comps.size() - i]);
    ways = Mul(ways, fact);

    ans = Add(ans, ways);
    fact = Mul(fact, i);
  }

  cout << Add(Mul(n, pw[(int)comps.size()]), -ans) << endl; 
}


Measured memory_bytes: 101252
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric> 
#define MAX_N 100
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int w, h, t, p, d, c;
	while(cin >> w >> h >> t >> p, w | h | t | p)
	{
		int table[2 * MAX_N][2 * MAX_N] = {};
		for(int i = 0; i < h; i++)
			for(int j = 0; j < w; j++) table[i][j] = 1;
		for(int i = 0; i < t; i++)
		{
			cin >> d >> c;
			if(d == 1)
			{
				for(int j = 0; j < h; j++)
				{
					for(int k = 0; k < c; k++)
					{
						int alpha = c - k - 1;
						table[j][c + alpha] += table[j][k];
						table[j][k] = 0;
					}
				}
				for(int j = 0; j < MAX_N; j++)
				{
					for(int k = 0; k < MAX_N; k++)
					{
						table[j][k] = table[j][k + c];
					}
				}
			}
			else if(d == 2)
			{
				for(int j = 0; j < c; j++)
				{
					for(int k = 0; k < w; k++)
					{
						int alpha = c - j - 1;
						table[c + alpha][k] += table[j][k];
						table[j][k] = 0;
					}
				}
				for(int j = 0; j < MAX_N; j++)
				{
					for(int k = 0; k < MAX_N; k++)
					{
						table[j][k] = table[j + c][k];
					}
				}
			}
		}
		int x, y;
		for(int i = 0; i < p; i++)
		{
			cin >> x >> y;
			cout << table[y][x] << endl;
		}
	}
	return 0;
}


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

long long int ans = 0;

typedef long long int ll;

int main()
{
	ll n,t, pre, curr;	
	cin>>n>>t;

	cin>>pre;
	
	for(int i = 2; i<=n; i++)
	{
		cin>>curr;
		ans+=min(t, curr-pre);
		pre = curr;
	}	
	ans+=t;
	cout<<ans;
		return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<unordered_map>
#include<cmath>
#include <bits/stdc++.h>
using namespace std;

int main(){
	long long int X;
	cin>>X;
	vector<long long int>num;
	for(long long int i = 1; i <= sqrt(X); i++){
		if(X%i==0){
			num.push_back(i);
		}
	}
	for(long long int i = 0; i < num.size(); i++){
		//cout<<num[i]<<endl;
		for(long long int j = -num[i]*1000; j <= num[i]*1000; j++){
		if(j*j*j*j*j-(j-num[i])*(j-num[i])*(j-num[i])*(j-num[i])*(j-num[i])==X){
			if(j < 0 && j-num[i] < 0)continue;
				cout<<j<<" "<<j-num[i]<<endl;
				return 0;
			}
		}
	}
}

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

int cnt=0;
const int MAX=500000;
int L[MAX/2+2], R[MAX/2+2];

inline void merge(int A[], int left, int mid, int right){
    int n1 = mid - left;
    int n2 = right - mid;
    for(int i=0; i<n1; i++){
        L[i] = A[left+i];
    }
    for(int i=0; i<n2; i++){
        R[i] = A[mid+i];
    }
    L[n1] = 2000000000;
    R[n2] = 2000000000;

    int i=0, j=0;
    for(int k=left; k<right; k++){
        cnt++;
        if(L[i] <= R[j]){
            A[k] = L[i];
            i++;
        } else {
            A[k] = R[j];
            j++;
        }
    }
}

inline void merge_sort(int A[], int left, int right){
    if (left+1 < right){
        int mid = (left+right)/2;
        merge_sort(A, left, mid);
        merge_sort(A, mid, right);
        merge(A, left, mid, right);
    }
}




int main() {

    int n;
    cin >> n;
    int A[n];
    for(int i=0; i<n; i++){
        scanf("%d",&A[i]);
    }

    merge_sort(A, 0, n);
    for(int i=0; i<n; i++){
        if(i==0) cout << A[i];
        else cout << " " << A[i];
    }
    cout << "\n" << cnt << "\n";

    return 0;
}

Measured memory_bytes: 7044
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  ll n;
  cin >> n;
  vector<ll> a(n);
  map<ll,ll> mp;
  rep(i,n){
    cin >> a.at(i);
    mp[a.at(i)]++;
  }
  ll ans=0;
  for(auto p: mp){
    ans+=(p.second)%2;
  }
  cout << ans;
}

Measured memory_bytes: 10128
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#include<bits/stdc++.h>
#define F first
#define S second
#define vec vector
#define ms multiset
#define pb push_back
#define pll pair<ll,ll>
#define pdd pair<ld, ld>
#define pq priority_queue
#define umap unordered_map
#define uset unordered_set
#define pii pair<int, int>
#define pnn pair<Node*, Node*>
#define uid uniform_int_distribution
#define FILE ifstream in("input.txt");ofstream out("output.txt");
#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
using namespace std;
typedef string str;
typedef long long ll;
typedef long double ld;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); //uid<int> u1(5, 10); u1(rnd);

int main(){
    fast;
    ll a; cin>>a;
    vec<ll> m(a), b(a), t(a-1);
    ll o = 0;
    for(int q=0; q<a; q++) cin>>m[q];
    for(int q=0; q<a; q++) cin>>b[q], o+=b[q];
    for(int q=0; q<a-1; q++) cin>>t[q];
    for(int q=1; q<a; q++) if(m[q]==m[q-1]+1) o+=t[m[q-1]-1];
    cout<<o;
}

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

int main(){
        int a,b,c;
        cin >> a >> b >> c;
        int five = 0, seven = 0;
        if( a == 5 ) {five++;} else if( a == 7 ) {seven++;}
        if( b == 5 ) {five++;} else if( b == 7 ) {seven++;}
        if( c == 5 ) {five++;} else if( c == 7 ) {seven++;}
        if(five == 2 && seven == 1) {cout << "YES" << endl;}
        else{cout << "NO" << endl;}
        return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  char line[100];
  int h, w;
  int i, j;
  while(1){
	fgets(line, sizeof(line), stdin);
	sscanf(line, "%d %d", &h, &w);
	if((h==0)&&(w==0))
	  break;
	for(i=0; i<h; ++i){
	  if((i==0)||(i==(h-1))){
		for(j=0; j<w; ++j){
		  printf("#");
		}
	  }else{
		for(j=0; j<w; ++j){
		  if((j==0)||(j==(w-1)))
			printf("#");
		  else
			printf(".");
		}
	  }
	  printf("\n");
	}
	printf("\n");
  }	
	return 0;
  }



Measured memory_bytes: 2032
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main implements Closeable {

  private InputReader in = new InputReader(System.in);
  private PrintWriter out = new PrintWriter(System.out);

  public void solve() {
    out.println(2 * Math.PI * in.ni());
  }

  @Override
  public void close() throws IOException {
    in.close();
    out.close();
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int ni() {
      return Integer.parseInt(next());
    }

    public long nl() {
      return Long.parseLong(next());
    }

    public void close() throws IOException {
      reader.close();
    }
  }

  public static void main(String[] args) throws IOException {
    try (Main instance = new Main()) {
      instance.solve();
    }
  }
}


Measured memory_bytes: 33384
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define PF push_front
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double
#define pii pair<int,int>
#define pll pair<LL,LL>
#define vi vector<int>
#define vl vector<LL>
#define vii vector<vi>
#define vll vector<vl>

const double pi = 3.14159265358979323846264;
const int mod=1000000007;

int main(){
	int n;
    string x;
    cin>>n;
    vector<string> s(n);
    vi t(n);
    FOR(i,0,n){
        cin>>s[i]>>t[i];
    }
    cin>>x;
    LL ans=0;
    int f=0;
    FOR(i,0,n){
        if(f)ans+=t[i];
        if(x==s[i])f=1;
    }
    cout<<ans;

}


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

#define REP(i, x) REPI(i, 0, x)
#define REPI(i, a, b) for (int i = int(a); i < int(b); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

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

  string S;
  cin >> S;
  int l = S.length();

  REP(i, l) {
    if (i % 2 == 0) {
      cout << S.at(i);
    }
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 592
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define repn(i,a,b) for (int i = a; i >=b ;i--)
#define MOD 1000000007


int main(){
ios::sync_with_stdio(0);
cin.tie(0);
    int x,n;cin>>x>>n;
    vector<bool> v(110,0);
    int tmp;
    rep(i,0,n){
        cin>>tmp;
        v[tmp]=1;
    }
    int ans=x,mi=INT_MAX;
    rep(i,0,104){
        if(v[i]==0){
            tmp= abs(i-x);
            if(tmp<mi){
                ans=i;
                mi=tmp;
            }
        }
    }
    cout<<ans;

 
return 0;
}

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

int array[50][26];

int ctoi(char ch){ //a → 0
  return ch-'a';
}
char itoc(int n){
  return n+'a';
}
int main(){
  int n;  cin>>n;
  for(int i=0;i<n;i++){
    string temp;
    cin>>temp;
    for(int j=0;j<temp.size();j++){
      array[i][ctoi(temp[j])]++;
    }
  }

  for(int i=0;i<26;i++){
    int mini=99999;
    for(int j=0;j<n;j++){
       mini = min(mini,array[j][i]);
    }
    for(int k=0;k<mini;k++){
      cout<<itoc(i);
    }
  }
  cout<<"\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    long long N;
    cin >> N;
    long long NN = N;
    bool f[1000010] = {};
    int ans = 0;
    for (int i = 2; i < 1000000; i++) {
        if (f[i] == 0) {
            for (int j = i+i; j < 1000000; j+=i) {
                f[j] = 1;
            }
            int c = 0;
            while (NN % i == 0) {
                NN /= i;
                c++;
            }
            for (int j = 1; c >= j; j++) {
                c -= j;
                ans++;
            }
        }
    }
    if (NN != 1) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 4620
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define fr(i,n) for(i=0;i<n;i++)
#define F first
#define S second
#define fast std::ios_base::sync_with_stdio(false)
#define mod 1000000007
#define pi 3.14159265
int main() {
	fast;
	lli n;
	cin>>n;
	lli a[n],i;
	fr(i,n)
	{
		cin>>a[i];
	}
	lli xor_ans=0;
	fr(i,n)
	{
		xor_ans=xor_ans^a[i];
	}
	fr(i,n)
	{
		lli temp=xor_ans^a[i];
		cout<<temp<<" ";
	}
	
	return 0;
}

Measured memory_bytes: 5172
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007
sys.setrecursionlimit(1000000)

#A
def A():
    s = S()
    a = s.count("a")
    b = s.count("b")
    c = 3-a-b
    if a&b&c:
        print("Yes")
    else:
        print("No")
#B
def B():
    a,b,k = LI()
    ans = []
    for i in range(a,min(a+k,b+1)):
        ans.append(i)
    for i in range(max(a,b-k+1),b+1):
        ans.append(i)
    ans = list(set(ans))
    ans.sort()
    for i in ans:
        print(i)

#C
def C():
    a,b,c = LI()
    ans = 0
    if a%2:
        if b%2:
            if not c%2:
                ans += 1
                a += 1
                b += 1
        else:
            ans += 1
            if not c%2:
                b += 1
                c += 1
            else:
                a += 1
                c += 1
    else:
        if b%2:
            ans += 1
            if not c%2:
                a += 1
                c += 1
            else:
                b += 1
                c += 1
        else:
            if c%2:
                ans += 1
                a += 1
                b += 1
    ans += (3*max(a,b,c)-a-b-c)//2
    print(ans)
#D
def D():
    q = I()
    for i in range(q):
        a,b = LI()
        x = int((a*b)**0.5)
        y = math.ceil((a*b)/x)-1
        ans = x+y-2
        if a==b:
            ans += 1
        print(ans)

#E
def E():
    s = S()
    f = {"N":0,"W":0,"S":0,"E":0}
    for i in s:
        f[i] = 1
    if f["N"]^f["S"]:
        print("No")
    elif f["W"]^f["E"]:
        print("No")
    else:
        print("Yes")
#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()


Measured memory_bytes: 39920
#include<iostream>
#include<vector>
#include<string>
#define REP(i, j) for(int i = 0; i < j; i++)
using namespace std;
const int N = 26;

vector<bool> visited(N, false);
void makeVisited(vector< vector<int> > &num, int now){
    REP(i, N){
        if(!visited[i] && num[now][i]){
            visited[i] = true;
            makeVisited(num, i);
        }
    }
}

bool checkVisited(vector<bool> &used, vector< vector<int> > &num){
    REP(i, N){
        if(used[i]){
            makeVisited(num, i);
            break;
        }
    }
    REP(i, N) if(used[i] && !visited[i]) return false;
    return true;
}

bool checkEuler(vector< vector<int> > &num, vector<bool> &used){
    REP(alpha, N){
        if(!used[alpha]) continue;
        int diff = 0;
        REP(i, N){
            diff += num[alpha][i];
            diff -= num[i][alpha];
        }
        if(diff) return false;
    }
    return true;
}

int main(){
    int n;
    while(cin >>n && n){
        visited = vector<bool>(N, false);
        vector< vector<int> > num(N, vector<int>(N, 0) );
        vector<bool> used(N, false);
        REP(i, n){
            string str;
            cin >>str;
            int top = str[0] - 'a', tail = str[str.size() - 1] - 'a';
            used[top] = true;
            used[tail] = true;
            num[top][tail]++;
        }

        if(!checkVisited(used, num)){
            cout <<"NG" <<endl;
            continue;
        }

        cout <<((checkEuler(num, used))? "OK" : "NG") <<endl;
    }
    return 0;
}

Measured memory_bytes: 1220
import Control.Monad
import Control.Applicative
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Foldable (foldMap)
import Data.List.Split
import Data.Char
import Data.Ratio
import Data.Ord
import Data.Array.IO
 
readInt = read :: String -> Int
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
-- end of templete

res = sum $ take 10 $ gen 1.0
  where
    gen a = (a:a*2:gen (a*2/3))


main = map ((*res) . read) . lines <$> getContents >>= mapM_ print

Measured memory_bytes: 4272
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 20)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね

//ここから編集する


int main() {
    int n;
    cin >> n;
    int v[100002] = {};
    REP(i,0,n){
        int tmp;
        cin >> tmp;
        v[++tmp]++;
    }
    int ans = 0;
    REP(i,1,100001){
        ans = max(ans,v[i-1] + v[i] + v[i+1]);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 640
h, m, c = map(int, input().split())
b = list(map(int, input().split()))

count = 0
for i in range(h):
  ans = 0
  a = list(map(int, input().split()))
  
  for j in range(m):
    ans = ans + a[j]*b[j]
  ans = ans + c
    
  if ans > 0:
    count += 1
print(count)

Measured memory_bytes: 9176
n, w_max = map(int,input().split( ))

v = []
w = []

for i in range(n):
    v1, w1 = map(int, input().split( ))
    v.append(v1)
    w.append(w1)

DP = [0]*(w_max + 1)

w_tmp = 0
while w_tmp <= w_max:
    v_tmp = DP[w_tmp]
    for i in range(n):
        if w[i] <= w_tmp:
            v_tmp = max(DP[w_tmp - w[i]] + v[i], v_tmp)
        DP[w_tmp] = v_tmp
    w_tmp += 1

print(DP[w_max])



Measured memory_bytes: 5916
import math
import sys
def main():
    a,b,c = list(map(int, input().strip().split()))
    if ((c - a - b)) > 0 and ((c - a - b)**2 > (4 * a * b)):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#define REP(i,a) for(int i = 0; i < (a); i++)
using namespace std;

int main(){
	int n;
	cin >> n;
	int h[n];
	REP(i,n)cin >> h[i];
	int res = 1,max = h[0];
	REP(i,n - 1){
		if(h[i + 1] >= max){
			max = h[i + 1];
			res++;
		}
	}
	cout << res << endl;
}

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#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 For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    int2(a, b);

    if (a <= 8 && b <= 8) {
        cout << "Yay!" << endl;
    } else {
        cout << ":(" << endl;
    }
    


    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    int n; cin >> n;

    int ans = 0;
    for (int i = 100; i > 0; i /= 10) {
      if (n/i == 1) {
	ans += 9*i;
      } else {
	ans += 1*i;
      }
      n %= i;
    }

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


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

long long llabs(long long n){
    if(n < 0)
        return n*(-1);
    else
        return n;
}

int main(){
    long long N, K;
    vector<long long> x;
    cin >> N >> K;
    for(int i=0;i<N;i++){
        long long temp;
        cin >> temp;
        x.push_back(temp);
    }

    long long min_idx = 0;
    long long min_dist = INT_MAX;
    for(int i=0;i<N-K+1;i++){
        long long dist = min(x[i+K-1]-x[i]+llabs(x[i+K-1]), x[i+K-1]-x[i]+llabs(x[i]));
        if(min_dist > dist){
            min_dist = dist;
        }
    }

    cout << min_dist << endl;

    return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main() {
	// your code goes here
	ll n, k;
	cin >> n >> k;
	if(k==n)
		cout << 0 << endl;
	else if(k>n)
		cout << min(n, abs(n-k)) << endl;
	else{
		if(n%k==0)
			cout << 0 << endl;
		else{
			n=n-((ll)(n/k)*k);
			n=min(n, abs(n-k));
			cout << n << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text as T
import qualified Data.Text.IO as T

isRectangle :: [Int] -> Bool
isRectangle (a : b : c : _) = if (a * a + b * b == c * c) then True else False

isRhombus :: [Int] -> Bool
isRhombus (a : b : _ : _) = if (a == b) then True else False

textToInt :: T.Text -> Int
textToInt t = (read . T.unpack) t :: Int

countRR :: [[Int]] -> [Int]
countRR abcs = [res, rhs]
    where
        res = length $ filter (== True) $ map isRectangle $ abcs
        rhs = length $ filter (== True) $ map isRhombus $ abcs

main :: IO ()
main = putStr . unlines . map show . countRR . map (map textToInt) . map (T.splitOn ",") . T.lines =<< T.getContents

Measured memory_bytes: 4248
import sys
import math
mod=10**9+7
inf=float("inf")
from math import sqrt
from collections import deque
from collections import Counter
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from functools import lru_cache
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#######ここから天ぷら########
n,k=map(int,input().split())
A=sorted(list(map(int,input().split()))+[k])
def gcd(a,b):
    if b==0: return a
    else:
        return gcd(b,a%b)
def lcm(a,b):
    return a*b//gcd(a,b)
SA=[]
for  i in range(n):
    SA.append(A[i+1]-A[i])
ans=SA[0]
for i in range(n-1):
    ans=gcd(ans,SA[i+1])
print(ans)

Measured memory_bytes: 14744
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a.at(i);
  ll ans, a1 = 0, a2 = 0;
  ll sum = 0;
  rep(i, n){
    if(i % 2 == 0){
      if(sum + a.at(i) > 0) sum += a.at(i);
      else{
        a1 += abs(sum+a.at(i))+1;
        sum = 1;
      }
    }else{
      if(sum + a.at(i) < 0) sum += a.at(i);
      else{
        a1 += abs(sum+a.at(i))+1;
        sum = -1;
      }
    }
  }

  sum = 0;
  rep(i, n){
    if(i % 2 == 1){
      if(sum + a.at(i) > 0) sum += a.at(i);
      else{
        a2 += abs(sum+a.at(i))+1;
        sum = 1;
      }
    }else{
      if(sum + a.at(i) < 0) sum += a.at(i);
      else{
        a2 += abs(sum+a.at(i))+1;
        sum = -1;
      }
    }
  }

  ans = min(a1, a2);
  cout << ans << endl;
  return 0;
}

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

ll f(ll H) {
    if (H == 1) return 1;
    return f(H / 2) * 2 + 1;
}

int main() {
    ll H;
    cin >> H;
    cout << f(H) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define inf 999999999999
#define F first
#define S second
#define read(x)  freopen("input.txt","r",stdin);
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi 2*acos(0.0)
#define ee exp(1)
#define mx 200009
using namespace std;
int main(){//read(x);
//fast;
ll a,b,c,d,e,f,g,h,i,j,k,l=0,n,t;

cin>>a>>b>>c>>d;
if(b>=a){
    cout<<a*c<<endl;
}
else{
    e=a-b;
    e=b*c+e*d;
    cout<<e<<endl;
}
}














Measured memory_bytes: 3512
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <functional>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
int main(){
  int N;
  cin >> N;
  vector<ll> A(N);
  for(int i = 0;i < N;i++)cin >> A[i];

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

  vector<ll> s(N);
  s[0] = A[0];
  for(int i = 1;i < N;i++)s[i] = A[i] + s[i-1];



  int ans = 1;
  for(int i = N - 2;i >= 0;i--){
    if(2 * s[i] >= A[i+1])ans++;
    else break;
  }

  cout << ans << endl;
}


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

int main(){
    long long int L,R;
    cin>>L>>R;
    int k = L/2019;
    int p = L%2019;

    if(2019*(k+1)<R){
        cout<<0<<endl;
    }else{
        long long int foo;
        long long int minnn = 2019;
        for(int i=L;i<R;i++){
            for(int j=i+1;j<=R;j++){
                foo = ((i%2019)*(j%2019))%2019;
                if(minnn>foo)minnn = foo;
            }
        }
        cout<<minnn<<endl;
    } 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
    int h,w;
    cin >> h>>w;
    int ans=h*w;
    int block=0;
    vector<string>path(h);
    vector<vector<int>>map(h,vector<int>(w,INF));
    map[0][0]=1;
    rep(i,h){
        cin>>path[i];
        rep(j,w){
            if(path[i][j]=='#'){
                block++;
            }
        }
    }    
    queue<pair<int,int>>q;
    q.emplace(0,0);
    pair<int,int>at;
    while(!(q.empty())){
        at=q.front();
     //   clog<<at.F<<" "<<at.S<<endl;
        q.pop();
        if(at.F >0){
            if(path[at.F-1][at.S]=='.'){
                if(chmin(map[at.F-1][at.S],map[at.F][at.S]+1)){
                    q.emplace(at.F-1,at.S);
                }
                chmin(map[at.F - 1][at.S], map[at.F][at.S] + 1);
            }
        }
        if (at.S > 0){
            if (path[at.F ][at.S-1] == '.'){
                if (chmin(map[at.F][at.S-1], map[at.F][at.S] + 1)){
                    q.emplace(at.F, at.S - 1);
                }
                chmin(map[at.F ][at.S-1], map[at.F][at.S] + 1);
            }
        }

        if (at.F < h-1)
        {
            if (path[at.F + 1][at.S] == '.')
            {
                if (chmin(map[at.F + 1][at.S], map[at.F][at.S] + 1))
                {
                    q.emplace(at.F + 1, at.S);
                }
                chmin(map[at.F + 1][at.S], map[at.F][at.S] + 1);
            }
        }
        if (at.S < w-1)
        {
            if (path[at.F][at.S + 1] == '.')
            {
                if (chmin(map[at.F][at.S + 1], map[at.F][at.S] + 1))
                {
                    q.emplace(at.F, at.S + 1);
                }
                chmin(map[at.F][at.S + 1], map[at.F][at.S] + 1);
            }
        }
    }
    if(map[h-1][w-1]==INF){
        cout<<-1<<endl;
    }else{
        cout<<ans-block-map[h-1][w-1]<<endl;
    }
//cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define x first
#define y second
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define all(x) x.begin(),x.end()
#define endl '\n'


int main()
{
	set<string> s;
	int t;
	cin>>t;
	while(t--){
		string ss;
		cin>>ss;
		s.insert(ss);
	}
	cout<<s.size()<<endl;
	return 0;
}

Measured memory_bytes: 19244
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <typename Arg1>
	void __f(const char* name, Arg1&& arg1){
		cerr << name << " : " << arg1 << std::endl;
	}
	template <typename Arg1, typename... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args){
		const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
	}
#else
#define debug(...)
#endif
#define FOR(i,a,b) 	for(int i=a;i<b;++i)
#define RFOR(i,a,b) 	for(int i=a;i>=b;--i)
#define ln 		"\n"
#define mp make_pair
#define pb push_back
#define sz(a)	ll(a.size())
#define F first
#define S second
#define all(c)	c.begin(),c.end()
#define rall(c) c.rbegin(), c.rend()
#define trace(c,x) for(auto &x:c)
#define pii pair<ll,ll>
#define init(a, x) memset(a,x,sizeof(a))
typedef long long ll;
typedef long double ld;
typedef	priority_queue<pii,std::vector<pii>,greater<pii> > revpr;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pbds;
// ordered_set X
//K-th smallest
//*X.find_by_order(k-1)
//NO OF ELEMENTS < A
//X.order_of_key(A)
const int L=1e6+7;
map<ll,ll> counter;
ll fastexpo(ll x,ll y,ll m)
{
	ll temp=1;
	while(y>0)
	{
		if(y&1)temp = ((temp%m)*(x%m))%m;
		x = ((x%m)*(x%m))%m;
		y>>=1;
	}return temp;
}
void fff()
{
	int k;
	cin >> k;
	set<ll>SET;
	FOR(i,1,10)SET.insert(i);
	if(k <= 9)
	{
		cout<<k<<ln;
		return;
	}	
	int co = 9;
	while(co <= k)
	{
		set<ll>aux;
		trace(SET,x)
		{
			if(x%10 >= 1)
			{
				aux.insert(x*10 + (x%10)-1);
			}
			aux.insert(x*10 + (x%10));
			if(x%10 < 9)
			{
				aux.insert(x*10 + (x%10)+1);
			}
		}
		SET.clear();
		trace(aux, x)
		{
			co++;
			SET.insert(x);
			if(co == k)
			{
				cout<<x<<ln;
				return;
			}
		}
	}

}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	//int t;cin >> t;while(t--)
	fff();
	return 0;
}

Measured memory_bytes: 8448
#if 0

#endif

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void p(A a){cout << (a) << endl;}
template<class A,class B>void p(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void p(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void p(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for copy
// for(int i=0;i<N;++i) {

int main(void) {
  int n;cin>>n;
  double r;
  if(n%2==0) r=n/(2.0*n);
  else r=(n+1)/(2.0*n);
  printf("%.8f\n",r);
  return 0;
}



Measured memory_bytes: 256
n, Y = list(map(int, input().split()))
Y = int(Y/1000)
max_x = Y // 10

def calc(money, N):
    max_y = money // 5
    for i in range(max_y, -1, -1):
        if i * 5 + (N - i) == money:
            return [i, N-i]
    return [-1, -1]

flag = 0
for i in range(max_x, -1, -1):
    result = calc(Y - i * 10, n - i)
    if result != [-1, -1]:
        result.insert(0, i)
        flag = 1
        break
else:
    result.append(-1)
print (result[0], result[1], result[2])


Measured memory_bytes: 3064
a=int(input())
b=list(map(int,input().split()))
c=[0,abs(b[0]-b[1])]
for i in range(2,a):
  if abs(b[i-1]-b[i])+c[i-1] < abs(b[i-2]-b[i])+c[i-2]:
    c.append(abs(b[i-1]-b[i])+c[i-1])
  else:
    c.append(abs(b[i-2]-b[i])+c[i-2])
    
print(c[a-1])

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

int		main()
{
	int a, b, c, d; cin >> a >> b >> c >> d;
	while (a > 0 && c > 0)
	{
		c -= b;
		if (c <= 0)
		{
			cout << "Yes" << endl;
			return 0;
		}
		a -= d;
		if (a <= 0)
		{
			cout << "No" << endl;
			return 0;
		}
	}
}



Measured memory_bytes: 3632
import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}
import scala.collection.mutable.{Map, Stack, Queue, PriorityQueue, Set}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val v, M, L = in.next().toInt
  val d = Array.ofDim[Long](v+1, v+1)

  // 初期化
  val MAX = Int.MaxValue
  for(i <- 1 to v; j <- 1 to v){
    if(i == j) d(i)(j) = 0
    else d(i)(j) = MAX
  }

  for (_ <- 1 to M) {
    val a, b, c = in.next().toInt
    d(a)(b) = c
    d(b)(a) = c
  }

  //
  // warshall_floyd
  for(k <- 1 to v; i <- 1 to v; j <- 1 to v){
    d(i)(j) = Math.min(d(i)(j), d(i)(k) + d(k)(j))
  }

  val d2 = Array.ofDim[Long](v+1, v+1)

  // 初期化
  for(i <- 1 to v; j <- 1 to v){
    if(i == j) d2(i)(j) = 0
    else d2(i)(j) = MAX
  }

  for(i <- 1 to v; j <- 1 to v){
    if (d(i)(j) <= L) d2(i)(j) = 1
  }

  // warshall_floyd
  for(k <- 1 to v; i <- 1 to v; j <- 1 to v){
    d2(i)(j) = Math.min(d2(i)(j), d2(i)(k) + d2(k)(j))
  }

  val Q = in.next().toInt
  for(_ <- 1 to Q) {
    val s, t = in.next().toInt
    val ans = d2(s)(t)
    if (ans >= MAX)
      pw.println(-1)
    else
      pw.println(ans-1)
  }
  pw.flush()
}

class InputReader(stream: InputStream) {
  private[this] val reader = new BufferedReader(new InputStreamReader(stream))
  private[this] var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}


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

vector<pair<long long, long long>> lr[2];
long long n, now, ans = 0;

bool asc0(pair<long long, long long> l,
          pair<long long, long long> r) {
  return l.second < r.second;
}
bool asc1(pair<long long, long long> l,
          pair<long long, long long> r) {
  return l.first > r.first;
}

int main() {
  long long i, l, r;
  cin >> n;
  for(i = 0; i < n; ++i) {
    cin >> l >> r;
    lr[0].push_back(make_pair(l, r));
    lr[1].push_back(make_pair(l, r));
  }
  sort(lr[0].begin(), lr[0].end(), asc0);
  sort(lr[1].begin(), lr[1].end(), asc1);
  for(i = 0; i < (n + 1) / 2; ++i) {
    if(i < lr[0].size()) now -= lr[0][i].second;
    if(now * 2 > ans) ans = now * 2;
    if(n % 2 == 1 && i == (n + 1) / 2 - 1) break;
    if(i < lr[1].size()) now += lr[1][i].first;
    if(now * 2 > ans) ans = now * 2;
  }
  now = 0;
  for(i = 0; i < (n + 1) / 2; ++i) {
    if(i < lr[1].size()) now += lr[1][i].first;
    if(now * 2 > ans) ans = now * 2;
    if(n % 2 == 1 && i == (n + 1) / 2 - 1) break;
    if(i < lr[0].size()) now -= lr[0][i].second;
    if(now * 2 > ans) ans = now * 2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3564
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iomanip>
#include <vector>
#include <cstdio>
#include <float.h>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <stack>
#include <functional>
 
using namespace std;
 
#define endl '\n'
#define MOD 1000000007
#define INF 1ll<<30
#define MAX 100010
#define eps 1e-11
#define bit_max 1ll<<32
#define _USE_MATH_DEFINES


int func(int b[], int n)
{
	int s = 0;
	for(int i=0;i<n-1;i++)
	{
		s = s+abs(b[i]-b[i+1]);
	}
	return s;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  //  freopen("input.txt","r",stdin);
  //  freopen("output.txt","w",stdout);
    string s;
    cin>>s;
    int ans = 0;
    int mn = INF;
    for(int i=0;i<s.size()-2;i++)
    {
    	int val = (s[i]-'0')*100 + (s[i+1]-'0')*10 + (s[i+2]-'0');
    	// cout<<val<<endl;
    	if(abs(val-753) < mn)
    	{
    		mn = abs(val-753);
    		ans = val;
    	}
    }
    cout<<mn;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define pai 3.1415926535


int main(void) {
	int N;
	scanf("%d", &N);
	int A[100000];
	int count = 0;
	for (int i = 0; i < N; i++) {
		scanf("%d",&A[i]);
		if (A[i] % 2 != 0) {
			count++;
		}
	}
	
	if (count % 2 == 0) {
		printf("YES");
	}
	else {
		printf("NO");
	}




	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <map>

using namespace std;

int main(void) {
    int X, N;
    cin >> X >> N;
    vector<int> p(N);
    for(int i=0; i<N; i++) {
        cin >> p[i];
    }

    int ans = 101;
    for(int i=101; i>=0; i--) {
        if(find(p.begin(), p.end(), i) == p.end() && abs(X-i) <= abs(X-ans)) {
            ans = i;
        } 
    }

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


Measured memory_bytes: 3632
n=int(input())
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])
ans=0
for t in arr:
    s=t[1]
    for k in range(1,10**12):
        ans+=1
        s-=k
        if s<=k:
            break
print(ans if n!=1 else 0)

Measured memory_bytes: 9480
import java.util.Scanner;

public class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int result = 0;

		if(A>0) {
			if(A>=K) {
				result=K;
			}else {
				result=A;
			}
			K = K - A;
		}
		if(K>0 && B>0) {
			K = K - B;
		}
		if(K>0 && C>0) {
			if(C>=K) {
				result =result + K*-1;
			}else {
				result = result + A*-1;
			}
		}
		System.out.println(result);

	}
}

Measured memory_bytes: 35744
n, m = [ int(x) for x in input().split() ]
hs   = [ int(x) for x in input().split() ] # len(hs) == n

vs = [ [] for _ in range(n) ]

for i in range(m):
    s, g = input().split()

    s = int(s) - 1
    g = int(g) - 1

    vs[s].append(g)
    vs[g].append(s)

goods = []

for i, v in enumerate(vs):
    if len(v) == 0:
        goods.append(i + 1)

    if all(hs[i] > hs[d] for d in v):
        goods.append(i + 1)

print(len(set(goods)))

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

int main() {
  int N;
  cin >> N;
  string str = to_string(N);

  for (int i = 0; i < 3; i++) {
    if (str.at(i) == '7') {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 3692
n = int(input())
l = [tuple(map(int, input().split())) for _ in range(n)]

for i in range(101):
    for j in range(101):
        ch = []
        z = []
        for x, y, h in l:
            if h == 0: z.append((x, y))
            else: ch.append(abs(x - j) + abs(y - i) + h)
        if len(set(ch)) == 1:
            for x, y in z:
                if ch[0] - abs(j - x) - abs(i - y) > 0: break
            else:
                print(j, i, ch[0])
                exit()


Measured memory_bytes: 3064