akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long inf=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111


	void solve(){

		

		ini(n);
		deque<int> morty;
		deque<int> morty1;
		FOR(i,0,n){
			ini(x);
			if(x>=0){
				morty.push_back(x);
			}
			else {
				morty1.push_back(x);
			}
		}
		sort(all(morty));
		sort(all(morty1),greater<int>());
		if(morty.size() == 0){
			if(morty1.size() == 1){
				out(morty1.back());
			}
			if(morty1.size() == 2){
				out(morty1[0]-morty1[0]);
				out(morty1[0],morty1[1]);
			}
			else{
				vpii rick;
				int tmp  =morty1[0]-morty1[morty1.size()-1];
				rick.push_back({morty1[0],morty1[morty1.size()-1]});
				FOR(i,1,morty1.size()-1){
					rick.push_back({tmp,morty1[i]});
					tmp-=morty1[i];
				}
				out(tmp);
				FORR(x,rick)out(x.first,x.second);
			}
		}
		else if(morty1.size() == 0){
			if(morty.size() == 1){
				out(morty.back());
			}
			if(morty.size() == 2){
				out(morty[1]-morty[0]);
				out(morty[1],morty[0]);
			}
			else{
				vpii rick;
				int tmp  =morty[0]-morty[1];
				rick.push_back({morty[0],morty[1]});
				FOR(i,2,morty.size()-1){
					rick.push_back({tmp,morty[i]});
					tmp-=morty[i];
				}
				rick.push_back({morty.back(),tmp});
				tmp = morty.back()-tmp;
				out(tmp);
				FORR(x,rick)out(x.first,x.second);
			}
		}
		else{
			vpii rick;
			int tmp = morty1[0];
			FOR(i,1,morty.size()){
				rick.push_back({tmp,morty[i]});
				tmp-=morty[i];
			}	
			morty1[0] = tmp;
			tmp  = morty[0];
			FOR(i,0,morty1.size()){
				rick.push_back({tmp,morty1[i]});
				tmp-=morty1[i];
			}
			out(tmp);
			FORR(x,rick)out(x.first,x.second);
		}








	}	























int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}


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

const ll INF = 1e18;

signed main() {
  int n,k;
  int a[15];
  cin >> n >> k;
  rep(i,n) cin >> a[i];

  ll ans = INF;
  rep(b, 1<<n) {
    if(__builtin_popcountll(b) != k) continue;
    ll s = 0;
    int maxh = 0;
    rep(i, n) {
      if ((b & 1<<i) && (maxh >= a[i])) {
        s += maxh - a[i] + 1;
        maxh++;
      }
      maxh = max(maxh, a[i]);
    }
    ans = min(ans, s);
  }
  cout << ans << endl;

}


Measured memory_bytes: 256
function main(input){
  const lines = input.split('\n');
  const NW = lines.shift().split(' ').map(x => parseInt(x));
  const N = NW[0]
  const W = NW[1]
  const items = lines.map(line => line.split(' ').map(x => parseInt(x)));

  const first = items.shift();
  const first_weight = first[0];
  const first_value = first[1];
  var value_sum = first_value;
  dp = [0]

  for(var i=1;i<=value_sum;i++){
    dp[i]=first_weight;
  }

  for(var i=0;i<items.length;i++){
    var current_weight = items[i][0];
    var current_value = items[i][1];
    value_sum += current_value;

  //console.log(dp);

    for(var value=value_sum;value>0;value--){

      if(value >= current_value){
        var prev_weight = dp[value - current_value];
        if(dp[value]==undefined){
          dp[value] = current_weight + prev_weight;
        }else{
          dp[value] = Math.min(prev_weight+current_weight, dp[value]);
        }
      }else{
        if(dp[value]==undefined){
          dp[value]=current_weight;
        }else{
          dp[value]=Math.min(current_weight, dp[value]);
        }
     }
    }
  }


  var result = 0;

//  for(var i=value_sum;i>=0;i--){
//    if(dp[i]<=W){
//      result = i;
//      break;
//    }
//  }

  for(var i=dp.length-1;i>=0;i--){
    if(dp[i]<=W){
      result = i;
      break;
    }
  }

  //console.log(dp);

//  console.log(result==90);
  console.log(result);

}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 48076
#include <bits/stdc++.h>
using namespace std;
bool prime[10000001];
int main() {
    for(int i=2;i<3162;i++)if(!prime[i])for(long long int j=i*2;j<=10000000;j+=i)prime[j]=1;
    int n;
    while(cin>>n,n){
        for(;;n--){
            if(!prime[n]&&!prime[n-2]&&!prime[n-6]&&!prime[n-8]){
                cout<<n<<endl;
                break;
            }
        }
    }
}

Measured memory_bytes: 10924
"use strict";

function main(input){
  const RANK = [2,3,4,5,6,7,8,9,10,11,12,13,1];
  const args = input.trim().split(' ').map(_=>parseInt(_,10));
  if(args[0] === args[1]) 
    console.log("Draw");
  else
    console.log(RANK.indexOf(args[0]) < RANK.indexOf(args[1]) ? "Bob" : "Alice");
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));  

Measured memory_bytes: 21064
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main(){
int n,m,k;
cin>>n>>m>>k;
bool ok=false;
for(int i=0;i<=n;i++){
for(int j=0;j<=m;j++){
if(i*(m-j)+j*(n-i)==k){
cout<<"Yes"<<endl;
return 0;
}
}
}
cout<<"No"<<endl;
return 0;
}

Measured memory_bytes: 256
#import<cstdio>
int N,d[8<<15],p[8<<15],x,i;main(){scanf("%d",&N);for(;i<N;d[x]=++i)scanf("%d",&x);x=N;for(;--i;p[i]+=p[i+1])if(p[i+1]){if((d[i]<d[i+1])^(d[i+1]<d[x])^(d[x]<d[i])){++p[i];x=i+1;}}else if(d[i]<d[i+1])--x;else++p[i];printf("%d",p[1]);}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
 
using namespace std;
 
typedef long long ll;
 
int main(){
  int n;
  while(cin >> n && n){
    vector<ll> P,J;
    ll sum = 0,ans;
 
    for(int i = 0; i < n; i++){
      ll in;
      cin >> in;
      sum += in;
      P.push_back(in);
    }
 
    ans = sum*n;
 
    for(int i = 0; i < n-1; i++){
      ll in;
      cin >> in;
      J.push_back(in);
    }
 
    sort(J.begin(),J.end());
    reverse(J.begin(),J.end());
 
    for(int i = 0; i < n-1; i++){
      sum += J[i];
      ans = max(ans,(n-i-1)*sum);
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 2660
N, K = map(int, input().split())
mod = 10 ** 9 + 7
def mod_cmb(n, r, mod=10 ** 9 + 7):
	assert n >= r >= 0

	def ex_euclid(x, y):
		a, b = 1, 0
		while y != 0:
			a, b = b, (a - x // y * b)
			x, y = y, x % y
		return a

	p = q = 1
	for i in range(n - r + 1, n + 1):
		p *= i
		p %= mod
	for i in range(2, r + 1):
		q *= i
		q %= mod
	p *= ex_euclid(q, mod)
	p %= mod
	return p
if K<N:
	print(0)
	exit()
print(mod_cmb(K,N))


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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> v(n);
  rep(i,n) cin >> v[i];
  int ans=0;
  rep(i,n+1){
    rep(j,n+1){
      if(i+j>k) continue;
      if(i+j>n) continue;
      int tmp=0;
      priority_queue<int,vector<int>,function<bool(int,int)>>
        heap([](const int &a, const int &b){return a>b;});
      rep(kk,i){
        tmp+=v[kk];
        heap.push(v[kk]);
      }
      rep(kk,j){
        tmp+=v[n-kk-1];
        heap.push(v[n-kk-1]);
      }
      int c=i+j;
      while(!heap.empty()){
        if(c>=k) break;
        if(heap.top()>=0) break;
        tmp-=heap.top();
        heap.pop();
        c++;
      }
      ans=max(ans,tmp);
    }
  }
  cout << ans << endl;
  return 0;
}


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

// Type alias
using ll=long long;
using ld=double;

using pi=pair<int,int>;
using pll=pair<ll,ll>;
using pld=pair<ld,ld>;
using ti3=tuple<int, int, int>;

using vi=vector<int>;
using vll=vector<ll>;
using vld=vector<ld>;
using vpi=vector<pi>;
using vpll=vector<ll>;
using vpld=vector<ld>;
using vti3=vector<ti3>;

// Constants
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max() / 2;
const ll mod = 1e9+7;

// Macro
#define rep(i,n) for(int i=0;i<int(n);++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;--i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(i,a,b) for(int i=int(b-1);i>=int(a);--i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

#define ALL(a) a.begin(),a.end()

// Funtcions
ll pow(ll base, ll i, ll mod){
  ll a = 1;
  while(i){
    if (i & 1) {
      a *= base;
      a %= mod;
    }
    base *= base;
    base %= mod;
    i >>= 1;
  }
  return a;
}
ll gcd(ll a, ll b){
  while(b){
    ll c = a % b;
    a = b;
    b = c;
  }
  return a;
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}
template<typename T> bool chmin(T& a, const T& b) {
  if (a > b) return a = b, true; else return false;
}

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

int a[100000+5], b[100000+5], c[100000+5];
ll h[3][100000+5];
void solve(){
  int N; cin >> N;
  REP(i, 0, N) cin >> a[i] >> b[i] >> c[i];

  h[0][0] = a[0];
  h[1][0] = b[0];
  h[2][0] = c[0];
  REP(i, 1, N){
    h[0][i] = max(h[1][i-1] + a[i], h[2][i-1] + a[i]);
    h[1][i] = max(h[2][i-1] + b[i], h[0][i-1] + b[i]);
    h[2][i] = max(h[0][i-1] + c[i], h[1][i-1] + c[i]);
  }
  cout << max(h[0][N-1], max(h[1][N-1], h[2][N-1])) << endl;
}

int main(){
// FastIO
//ios_base::sync_with_stdio(false);
cin.tie(NULL);
  solve();
  return 0;
}

Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long ll;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

//container util
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define UNIQUE(a)  (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,b,a) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,n,0)

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";

const int INF = 1e9;
const int _N = 200000;
const int _M = 270000;

struct SEG{ // min
	int d[_M * 2];
	int m;
	void init(int m){
		this->m = m;
		REP(i, m * 2 - 1)d[i] = INF;
	}
	void update(int i, int x){
		i += m - 1;
		d[i] = x;
		while(i>0){
			i = (i -1) / 2;
			d[i] = min(d[i * 2 + 1], d[i * 2 + 2]);
		}
	}
	int query(int a, int b){
		return _query(a, b, 0, 0, m);
	}
	private:int _query(int a, int b, int k, int l, int r){
		if(r <= a || b <= l) return INF;
		if(a <= l && r <=b) return d[k];
		int vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);
		int vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);
		return min(vl, vr);
	}
};

int n, d;
int sizes[_N]; // sizes exist
//map<int, int> sizeRef; // [size] = index

SEG xms, xMs, yms, yMs;
typedef pair<int, PII> Star;
Star stars[_N];
bool comp(const Star& a, const Star& b){
	return a.first < b.first;
}
int last = -1, si = -1;
int xm = INF, xM, ym = INF, yM;
void calc(){
	sizes[si] = last;
//	sizeRef[last] = si;
	xms.update(si, xm);
	xMs.update(si, -xM);
	yms.update(si, ym);
	yMs.update(si, -yM);
	xm = INF, xM = 0, ym = INF, yM = 0;
}
// O(N log N)
int main() {
	omajinai;
	cin >> n >> d;

	// segment tree initial
	int m=1;
	while(m<n)m*=2;
	xms.init(m);
	xMs.init(m);
	yms.init(m);
	yMs.init(m);
	//

	REP(i, n){
		int x, y, b;
		cin >> x >> y >> b;
		stars[i] = MP(b, MP(x, y));
	}
	sort(stars, stars + n, comp);
	REP(i, n){
		int b = stars[i].first, x = stars[i].second.first, y = stars[i].second.second;
		if(b!=last){
			if(si > -1)calc();
			si++;
			last = b;
		}
		xm = min(xm, x);
		xM = max(xM, x);
		ym = min(ym, y);
		yM = max(yM, y);
	}
	calc();

	si++; // to use as sizes' size
	ll ans = 0; // max = 2e6 ^ 2 = 4e12
	REP(i, si){
		int ed = upper_bound(sizes, sizes + si, sizes[i] + d) - sizes;
		xm = xms.query(i, ed);
		xM = -xMs.query(i, ed);
		ym = yms.query(i, ed);
		yM = -yMs.query(i, ed);
		ans = max(ans, (ll)(xM - xm) * (yM - ym));
		if(ed == si)break;
	}
	cout << ans << endl;
}

Measured memory_bytes: 14540
from collections import deque
S = [list(input()) for _ in range(3)]

SA = deque(S[0])
SB = deque(S[1])
SC = deque(S[2])

i = 'a'
ans = 'now playing'

while ans == 'now playing':
  if i == 'a':
    if SA == deque([]):
      ans = 'A'
    else:
      i = SA.popleft()
  elif i == 'b':
    if SB == deque([]):
      ans = 'B'
    else:
      i = SB.popleft()
  else:
    if SC == deque([]):
      ans = 'C'
    else:
      i = SC.popleft()

print(ans)

Measured memory_bytes: 3316
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #
    n=int(readline())
    arr=list(map(int, readline().rstrip().split()))
    ans=0
    for i in range(n):
        x=i+1
        if arr[i]%2==1 and x%2==1:
            ans+=1
    print(ans)
    #ss=readline().rstrip()
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Measured memory_bytes: 16256
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int n;
  string s,t;
  int ans;
  cin>>n>>s>>t;
  ans=n*2;
  rep(i,n){
    if(s.substr(n-i-1,i+1)==t.substr(0,i+1)){
      ans=min(ans,n*2-i-1);
    }
    //cout<<s.substr(n-i-1,i+1)<<" "<<t.substr(0,i+1)<<endl;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 256
def ch2int(ch):
    if ch == 'A':
        return 0
    elif ch == 'C':
        return 1
    elif ch == 'G':
        return 2
    else:
        return 3


def acgt2int(agct):
    ret = 0
    for ch in agct:
        ret = (ret << 2) + ch2int(ch)
    return ret


def int2acgt(val):
    ret = []
    tmp = val
    for i in range(3):
        amari = tmp % 4
        if amari == 0:
            ret.append('A')
        elif amari == 1:
            ret.append('C')
        elif amari == 2:
            ret.append('G')
        else:
            ret.append('T')
        tmp //= 4
    ret.reverse()
    return ret


n = int(input())
dp = [[0] * 64 for _ in range(n)]

dp[0][acgt2int('TTA')] = 1
dp[0][acgt2int('TTC')] = 1
dp[0][acgt2int('TTG')] = 1
dp[0][acgt2int('TTT')] = 1


def is_valid(chs):
    tmp = ''.join(chs)
    ng = ['AGC', 'GAC', 'ACG', 'AAGC', 'ACGC', 'AGGC',
          'ATGC', 'AGAC', 'AGCT', 'AGGC', 'AGTC']
    for item in ng:
        if item in tmp:
            return False
    return True


for i in range(1, n):
    for j in range(64):
        chs = int2acgt(j)
        tmp = 0
        for ch in ['A', 'C', 'G', 'T']:
            my_chs1 = [ch] + chs
            if is_valid(my_chs1):
                tmp += dp[i-1][acgt2int(my_chs1[:-1])] % (10 ** 9 + 7)
        dp[i][j] = tmp

print(sum(dp[-1]) % (10 ** 9 + 7))


Measured memory_bytes: 3316
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <unordered_map> 
#include <unordered_set>
#include <functional>
#include <bitset>

using namespace std;

typedef pair<long long int, long long int> P;
typedef tuple<int, int, int> T;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

bool used[110000];
int isOdd[110000];
vector<int> E[110000];

bool func(int pos, bool flag){
	if(isOdd[pos] != 0){
		return (isOdd[pos] == 1) ^ flag;
	}
	if(flag){
		isOdd[pos] = 1;
	}else{
		isOdd[pos] = -1;
	}
	bool ret = false;
	for(int to : E[pos]){
        bool res = func(to, !flag);
		ret = (ret || res);
	}
	return ret;
}

int main(){
	int N, M;
	cin >> N >> M;
	for(int i = 0; i < M; i++){
		int u, v;
		cin >> u >> v;
		E[u].push_back(v);
		E[v].push_back(u);
		used[u] = true;
		used[v] = true;
	}
	long long int ans = 0;
	long long int cnt1 = 0, cnt2 = 0, cnt3 = 0;
	for(int i = 1; i <= N; i++){
		if(!used[i]){
			cnt1 += 1;
		}else if(isOdd[i] == 0){
			bool ret = func(i, true);
			if(ret){
				cnt2 += 1;
			}else{
				cnt3 += 1;
			}
		}
	}
	//cout << cnt1 << " " << cnt2 << " " << cnt3 << endl;
	ans += cnt1 * N * 2 - cnt1 * cnt1;
	ans += (cnt2 + cnt3) * (cnt2 + cnt3);
	ans += cnt3 * cnt3;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 10240
#include <cstdio>

int main()
{
  int n, d, x;
  scanf("%d%d%d", &n, &d, &x);
  d--;
  int eaten = 0;
  for (int i = 0; i < n; ++i)
  {
    int a;
    scanf("%d", &a);
    eaten += 1 + d / a;
  }
  printf("%d\n", x + eaten);
  return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<bitset>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=(ll)1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	scan(N);
	ll ans=0;
	int n=N;
	int keta=0;
	int Ntop;
	while(n){
		Ntop=n%10;
		keta++;
		n/=10;
	}
	ll plus[7]={0,0,1,11,111,1111,11111};
	ll cnt1=plus[keta-1];
	ll c[10][10]={};//c[i][j]:N以下で先頭がiで末尾がjの個数
	rep1(i,9){
		rep1(j,9){
			if(i==j&&i<=N) c[i][j]++;
			c[i][j]+=cnt1;
			if(i==Ntop){
				if(N-j-Ntop*(int)(pow(10,keta-1)+eps)>=0) c[i][j]++;
				c[i][j]+=(N-j-Ntop*(int)(pow(10,keta-1)+eps))/10;
			}
			else if(i<Ntop){
				c[i][j]+=(int)(pow(10,keta-2)+eps);
			}
		}
	}
	rep1(i,9){
		rep1(j,9){
			ans+=c[i][j]*c[j][i];
		}
	}
	prin(ans);
	return 0;
}


Measured memory_bytes: 384
n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
t = sum(a)

c = 0
for i in range(n):
    if a[i] >= t/(4*m):
        c += 1

if c >= m:
    print ('Yes')
else:
    print ('No')

Measured memory_bytes: 3060
from collections import deque

N = int(input())

int1 = lambda x: int(x) - 1
edges = [[] for _ in range(N)]
nodes = [None] * N
for i in range(1, N):
    a, b = map(int1, input().split())
    edges[a].append(i)
    edges[b].append(i)
    nodes[i] = (a, b)

# dfs
C = max(len(x) for x in edges)
colors = [None] * N
d = deque([(0, 0)])
while d:
    v, parent_color = d.pop()
    i = 1
    for x in edges[v]:
        if colors[x] is None:
            if i == parent_color:
                i += 1
            colors[x] = i
            a, b = nodes[x]
            d.append((b if a == v else a, i))
            i += 1


print(C)
for i in range(1, N):
    print(colors[i])


Measured memory_bytes: 33612
#include<iostream>
#include<algorithm>
#include<cstdint>

int main() {
  int64_t N, A, B;
  std::cin >> N >> A >> B;
  int64_t q = N/(A+B), r = N%(A+B);

  std::cout << q*A + std::min(A, r) << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>

using namespace std;

int main(void)
{
	int ans = 0;

	string S;

	cin >> S;

	for (int i = 0; i < 4; i++)
	{
		if (S[i]=='+') 
		{
			ans++;
		}
		else 
		{
			ans--;
		}
	}

	cout << ans << endl;

    return 0;
}



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

using namespace std;


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

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;
#include <cmath>

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

	cin >> n>>k;

	vector<int> h(n);

	for (int i=0;i<n;i++)
	{
		cin>>h[i];
	}
	sort(h.begin(),h.end());

	ll ret=0;
	for (int i=0;i<n-k;i++)
	{
		ret+=h[i];
	}

	cout<<ret<<endl;
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)

int main(){

	ios::sync_with_stdio(0);
	cin.tie(0);


	int n;cin>>n;
	vi v;
	rep(i,1,n){
		int a;cin >> a;
		v.pb(a);
	}
	int* dp = new int[n];
	dp[0] = 0; dp[1] = abs(v[1]-v[0]);
	for(int i=2;i<n;i++){
		dp[i] = min(dp[i-1]+abs(v[i]-v[i-1]),dp[i-2]+abs(v[i]-v[i-2]));
	}
	cout << dp[n-1];
}


Measured memory_bytes: 1144
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 62;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

void cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
//-----------------------ここから----------- 
int main(void){
    ll n;
    cin >> n;
    string s;
    cin >> s;

    ll l = 0;
    ll ans = 1;    
    rep(i, s.size()){
        if(s[i] == 'B'){
            if(l % 2 == 0){
                l++;
            } else {
                ans *= l;
                l--;
            }
        } else {
            if(l % 2 != 0){
                l++;
            } else {
                ans *= l;
                l--;
            }
        }
        ans %= MOD;
    }

    if(l != 0){
        cout << 0 << endl;
        return 0;
    }

    ll fact = 1;
    for(ll i = 1; i <= n; i++){
        fact *= i;
        fact %= MOD;
    }

    cout << (ans * fact) % MOD << endl;


}


Measured memory_bytes: 640
#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 <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 MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

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

//mod演算ライブラリ
//mod=1000000007

LL add(LL a,LL b){
  return (a+b)%mod;
}

LL sub(LL a,LL b){
  return (a+mod-b)%mod;
}

LL mul(LL a,LL b){
  return ((a % mod) * (b % mod)) % mod;
}

LL power(LL x,LL y){//繰り返し二乗法 単品利用可
  if(y==0)return 1;
  else if(y==1)return x%mod;
  else if(y%2==0){
    LL tmp=power(x, y/2) % mod;
    return tmp*tmp%mod;
  }else {
    LL tmp=power(x, y/2) % mod;
    return ((tmp*tmp)%mod)*x%mod;
  }
}

LL dvs(LL a,LL b){
  return mul(a,power(b,mod-2));
}

const int SIZE_mod=200005;
int invfact[SIZE_mod];
int fact[SIZE_mod];

LL factset(int a){//aまでの階乗%mod表を作成
  fact[0]=1;
  FORQ(i,1,a){
    fact[i]=mul(fact[i-1],i);
  }
}

LL cmbset(int a){//1~aまでの階乗と階乗数の逆元のmod(mod)を用意 O(a)
  factset(a);
  invfact[a]=power(fact[a],mod-2);
  invfact[0]=1;
  FORD(i,a,1){
    invfact[i]=mul(invfact[i+1],i+1);
  }

}

LL cmb(int n,int r){//nCr%mod  (cmbset後に使用)
  if(n<r||r<0||n<0)return 0;
  return mul(fact[n],mul(invfact[r],invfact[n-r]));
}

LL prm(int n,int r){//nPr%mod
    return mul(cmb(n,r),fact[n]);
}

LL homo(int n,int r){//nHr%mod
  return cmb(n+r-1,r);
}


int main(){
	using pii=pair<int,int>;
	int n;
	cin>>n;
	int a[33][33]={};
	FOR(i,0,n){
		FOR(j,0,n)cin>>a[i][j];
	}
	vector<LL> dp(1<<(n+1),0);
	vector<int> used(1<<(n+1),0);
	queue<pii> q;
	q.push(MP(0,0));
	dp[0]=1;
	used[0]=1;
	while(q.size()){
		pii pr=q.front();
		q.pop();
		int s=pr.ST;
		int nxt=pr.ND;
		if(nxt>=n)break;
		used[s]=1;
		FOR(i,0,n){
			if(s&(1<<i)){

			}else{
				if(a[nxt][i]){
					int sx=s|(1<<i);
					dp[sx]=add(dp[sx],dp[s]);
					if(used[sx]||nxt+1>=n)continue;
					used[sx]=1;
					q.push(MP(sx,nxt+1));
				}
			}
		}
	}
	cout<<dp[(1<<n)-1];
    return 0;
}


Measured memory_bytes: 52608
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> V;
typedef vector<vector<int>> Graph;

int main() {
    map<pair<int,int>,int> p;
    int n;
    cin >> n;
    rep(i,min(n,9)){
        p[make_pair(i+1,i+1)]++;
    }
    for(int i = 11 ;i<=n;i++){
        string s = to_string(i);
        p[make_pair(s[0]-'0',s[s.size()-1]-'0')]++;
    }
    ll ans = 0;
    for(int i =1;i<10;i++){
        for(int j =1;j<10;j++){
            ans += p[make_pair(i,j)]*p[make_pair(j,i)];
        }
    }
    cout << ans << endl;
}

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

int main()
{
  string s;
  cin >> s;
  int c[26] {0};
  int n = s.size();
  for(int i = 0; i < n; i++){
    c[s[i] - 'a'] = (c[s[i] - 'a'] + 1) % 2;
  }
  for(int i = 0; i < 26; i++){
    if(c[i] == 1){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 768
import sys

x = []

for line in sys.stdin.readlines():
    x.append(int(line.strip()))

length = int(x[0])

del x[0]

max = -(10 ** 9)
min =  x[0]

for i in range(1, length):
    sa = x[i] - min

    if sa > max:
        max = sa

    if x[i] < min:
        min = x[i]
   
print max

Measured memory_bytes: 23740
n = int(input())
List=list(map(int,input().split()))

L=[]
for i in range(n):
  L.append(0)
  
i=0
for i in range(n-1):
  cnt=List[i]
  L[cnt-1]=L[cnt-1]+1
  
for List in L:
  print(List)


Measured memory_bytes: 32304
n, k = map(int, input().split())
H = [int(input()) for _ in range(n)]

sorted_H = sorted(H, reverse=True)
diff = sorted_H[0] - sorted_H[-1]

for i in range(n):
    try:
        diff_in = sorted_H[i] - sorted_H[i+k-1]
    except IndexError:
        break
    if diff_in < diff:
        diff = diff_in

print(diff)


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

using namespace std;

int main() {
    int n, s[13], h[13], c[13], d[13], rank;
    char suit;

    for (int i = 0; i < 13; ++i) {
        s[i] = 0;
        h[i] = 0;
        c[i] = 0;
        d[i] = 0;
    }

    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> suit >> rank;
        switch (suit) {
            case 'S':
                s[rank-1] = 1;
                break;
            case 'H':
                h[rank-1] = 1;
                break;
            case 'C':
                c[rank-1] = 1;
                break;
            case 'D':
                d[rank-1] = 1;
                break;
            default:
                break;
        }
    }

    for (int i = 0; i < 13; ++i) {
        if (s[i] == 0) cout << "S " << i + 1 << endl;
    }
    for (int i = 0; i < 13; ++i) {
        if (h[i] == 0) cout << "H " << i + 1 << endl;
    }
    for (int i = 0; i < 13; ++i) {
        if (c[i] == 0) cout << "C " << i + 1 << endl;
    }
    for (int i = 0; i < 13; ++i) {
        if (d[i] == 0) cout << "D " << i + 1 << endl;
    }

    return 0;
}


Measured memory_bytes: 3092
import java.util.*;

public class Main {
  public static void main(String[] args) {
    int i, count_a = 0, count_b = 0, count_c = 0, count_d = 0;
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    for(i = 0; i < 4; i++) {
      if(str.charAt(0) == str.charAt(i)) count_a++;
      if(str.charAt(1) == str.charAt(i)) count_b++;
      if(str.charAt(2) == str.charAt(i)) count_c++;
      if(str.charAt(3) == str.charAt(i)) count_d++;
    }
    if(count_a == 2 && count_b == 2 && count_c == 2 && count_d == 2) System.out.println("Yes");
    else System.out.println("No");
  }
}


Measured memory_bytes: 23124
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

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

#define INF 1000000000

int dp[2][11000][2]={0};

int main(){
	int n;
	cin>>n;
	
	int cut[11111]={0};
	reps(i,n-1){
		cin>>cut[i+1];
	}
	
	
	int dp1=0;
	int dp2=1;
	
	for(int i=1;i<=n;i++){
		
		dp[dp2][0][0]=0;
		dp[dp2][0][1]=INF;
		
		dp[dp2][i][0]=INF;
		dp[dp2][i][1]=0;
		
		int end = min(5002,i);
		for(int j=1;j<end;j++){
			dp[dp2][j][0] = min(dp[dp1][j][0], dp[dp1][j][1]+cut[i]);
			dp[dp2][j][1] = min(dp[dp1][j-1][0]+cut[i], dp[dp1][j-1][1]);
		}
		
		swap(dp1,dp2);
	}
	
	printf("%d\n",dp[dp1][n/2][1]);
}

Measured memory_bytes: 1032
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf INT_MAX
#define llinf LONG_LONG_MAX

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    // std::cout << std::setprecision(10) << std::fixed;
    ll int n,i,j;
    cin>>n;
    ll int a[n+1];
    ll dp[n+1][n+1];
    for(i=1;i<=n;i++)
        cin>>a[i];
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=(n-i+1);j++)
        {
            ll int l=j,r=j+i-1;
            if(l==r)
                dp[l][r]=a[l];
            else
                dp[l][r]=max((a[l]-dp[l+1][r]),(a[r]-dp[l][r-1]));
        }
    }
    cout<<dp[1][n];
}

Measured memory_bytes: 70528
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

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

#define MOD 1000000007

void solve(int test_case) {//228
	double t,x;
	cin>>t>>x;
	t/=x;
	printf("%.4lf",t);
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


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

/***********************************************/
/* Dear online judge:
 * I've read the problem, and tried to solve it.
 * Even if you don't accept my solution, you should respect my effort.
 * I hope my code compiles and gets accepted.
 *  ___  __     _______    _______      
 * |\  \|\  \  |\  ___ \  |\  ___ \     
 * \ \  \/  /|_\ \   __/| \ \   __/|    
 *  \ \   ___  \\ \  \_|/__\ \  \_|/__  
 *   \ \  \\ \  \\ \  \_|\ \\ \  \_|\ \ 
 *    \ \__\\ \__\\ \_______\\ \_______\
 *     \|__| \|__| \|_______| \|_______|
 */
const long long mod = 1000000007;

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

	int N,P;
	cin>>N>>P;
	int od = 0,ev = 0;
	vector<int> a(N);
	for(int i = 0;i < N;i++) cin>>a[i],od += a[i]%2 == 1,ev += a[i]%2 == 0;
	long long res = (1ll<<ev);
	if(P) {
		if(!od) res = 0;
		else res *= (1ll<<(od-1));
	} else if(od) {
		res *= (1ll<<(od-1));
	}
	cout<<res<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
typedef long long ll;
using namespace std;

int main()
{
  char a,b,c,d,e,f;
  cin >> a >> b >> c >> d >> e >> f;
  if (a == f && b == e && c == d) {
    cout << "YES" << endl;
  }
  else
  {
    cout << "NO" << endl;
  }

}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
    long long int a , b , k , x , y;
    cin >> a >> b >> k;
    x = a - k;
    if(x<=0){
        cout << "0 " ;
        y = b + x;
        if(y<=0)
            cout << "0 " ;
        else
            cout << y;
    }
    else
        cout << x << " " << b << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;	cin>>n;
	vector<int> u,v;
	for(int i=0;i<n;i++){
		int x,y;	cin>>x>>y;
		u.push_back(x+y);
		v.push_back(x-y);
	}
	int vmi=min_element(v.begin(),v.end())-v.begin();
	int umi=min_element(u.begin(),u.end())-u.begin();
	int vma=max_element(v.begin(),v.end())-v.begin();
	int uma=max_element(u.begin(),u.end())-u.begin();
	int val1=0,val2=0;
	for(int i=0;i<n;i++){
		val1=max(val1,min(
			max(max(abs(v[i]-v[vmi]),abs(v[i]-v[umi])),
				max(abs(u[i]-u[vmi]),abs(u[i]-u[umi]))),
			max(max(abs(v[i]-v[vma]),abs(v[i]-v[uma])),
				max(abs(u[i]-u[vma]),abs(u[i]-u[uma])))));
		val2=max(val2,min(
			max(max(abs(v[i]-v[vma]),abs(v[i]-v[umi])),
				max(abs(u[i]-u[vma]),abs(u[i]-u[umi]))),
			max(max(abs(v[i]-v[vmi]),abs(v[i]-v[uma])),
				max(abs(u[i]-u[vmi]),abs(u[i]-u[uma])))));
	}
	cout<<min(val1,val2)<<endl;
	return 0;
}

Measured memory_bytes: 2148
#!/usr/bin/env python3
import sys
import numpy as np
import math


def solve(N: int):
    x = np.arange(1, np.sqrt(N)+1, dtype=np.int)
    div = x[N % x == 0]
    print((N/div + div - 2).min().astype(np.int))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()


Measured memory_bytes: 28984
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,M,A,B;
  cin >> N >> M;
  vector<int> vec(N,0);
  for(int i=0;i<M;i++){
    cin >> A >> B;
    --A; --B;
    ++vec.at(A); ++vec.at(B);
  }
  
  for(int i=0;i<N;i++){
    cout << vec.at(i) << endl;
  }
}

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

/*てんぷれぞーん！*/
static const int INF = 2147483647;
static const long long llINF = 9223372000000000000;
static const int NIL = -1;
static const int MOD = 1000000007;
typedef long long ll;
typedef pair<int,int> P;
struct edge {int to,cost;};
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define np next_permutation
#define pq priority_queue
/* t y p o っ て 知 っ て る ゥ ！ ？ */
#define itn int
#define scnaf scanf
#define reutnr return
/*必要に応じて使ってね*/
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
#define int ll
//#define INF llINF
/*てんぷれぞーんしゅーりょー！*/

static const int MAXN = 300;

int n;
int field[MAXN+1][MAXN+1];
bool road[MAXN+1][MAXN+1];
bool rullonz=false;

void warshall_floyd(){
    for(int k=0;k<n;k++){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(field[i][j] > field[i][k] + field[k][j]){
                    printf("-1\n");
                    rullonz = true;
                    return;
                } else if(field[i][j] == field[i][k] + field[k][j] && k!=j && k!=i){
                    //他の点を通って[i][j]と同じ最短距離が達成できるならi to jの道いらなくないですか？いらないですね
                    road[i][j] = false;
                }
            }
        }
    }
}

signed main(){
    scanf("%lld",&n);
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++) scanf("%lld",&field[i][j]);
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++) road[i][j] = true;
    }
    warshall_floyd();
    if(rullonz) return 0;

    int ans = 0;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(road[i][j]) ans += field[i][j];
        }
    }

    printf("%lld\n",ans/2);
    return 0;
}

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

using namespace std;

int main(){
    
    int r, D, x2000;
    cin >> r >> D >> x2000;

    for (int i = 0; i < 10; i++){
        x2000 = r * x2000 - D;
        cout << x2000 << endl;
    }
    

    return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, m, c, a, sum, ans int
	fmt.Scan(&n, &m, &c)
	b := make([]int, m)
	for i := range b {
		fmt.Scan(&b[i])
	}
	for i := 0; i < n; i++ {
		sum = 0
		for j := 0; j < m; j++ {
			fmt.Scan(&a)
			sum += a * b[j]
		}
		if sum+c > 0 {
			ans++
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        int num[]=new int[n];

        for(int i=0;i<n;i++){
            num[i] = sc.nextInt();
        }

        for(int i=n-1;i>0;i--){
            System.out.print(num[i]+" ");
        }
        System.out.println(num[0]);


        sc.close();
    }
}



Measured memory_bytes: 26332
package main

import (
  "fmt"
)

func main() {
  var s, t string
  var hits int
  fmt.Scan(&s)
  fmt.Scan(&t)
  if s[0:1] == t[0:1] {
    hits += 1
  }
  if s[1:2] == t[1:2] {
    hits += 1
  }
  if s[2:3] == t[2:3] {
    hits += 1
  }	
  fmt.Println(hits)
}
  
  

Measured memory_bytes: 1768
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 30;
int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};

int main() {
  int a,b;
  cin >> a >> b;
  if(b % a == 0){
    cout << a + b << endl;
  }else{
    cout << b - a << endl;
  }
}


Measured memory_bytes: 256
abs, N = map(int,input().split())
if N:
    s = list(map(int,input().split()))
    flag = 1
else:
    flag = 0
cnt = 0
while flag:
    if not(abs - cnt) in s:
        result = abs - cnt
        break
    if not(abs + cnt) in s:
        result = abs + cnt
        break
    cnt += 1
if flag:
    print(result)
else:
    print(abs)

Measured memory_bytes: 9192
#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main() {
    int n, k, a;
    cin >> n >> k;
    map<int, int> numBalls;
    for (int i=0; i<n; ++i) {
        cin >> a;
        ++numBalls[a];
    }
    map<int, int> numOfNum;
    for (auto& e : numBalls) {
        ++numOfNum[e.second];
    }
    int count = 0;
    int numRemain = numBalls.size();
    int numTarget = k;
    for (auto& e : numOfNum) {
        for (int i=0; i<e.second; ++i) {
            if (numRemain <= numTarget) break;
            --numRemain;
            count += e.first;
        }
    }
    cout << count << endl;
}


Measured memory_bytes: 9600
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n=I()
k=I()
A=LI()
ans=0
for a in A:
    ans+=2*min(abs(a-0),abs(k-a))
print(ans)

Measured memory_bytes: 3316
<?php
fscanf(STDIN, "%s", $s);
// echo strlen($s);
$check = true;
for ($i=0; $i<strlen($s); $i++) {
  if($i%2 == 0 && $s[$i] == "L") {
    $check = false;
  break;
  } else if($i%2 == 1 && $s[$i] == "R") {
    $check = false;
  break;
  }
}
if($check == false) echo "No";
else echo "Yes";

Measured memory_bytes: 3828
/*
tarun360
IIT Indore
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ll_s long
#define mod 1000000007
#define forn(i,start,lim) for(ll i=start;i<lim;i++)
#define forn_d(i,start,lim) for(ll i=start;i>=lim;i--)
#define forn_s(i,start,lim) for(ll_s i=start;i<lim;i++)
#define forn_d_s(i,start,lim) for(ll_s i=start;i>=lim;i--)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define debug1(a) cout<<a<<endl
#define debug2(a,b) cout<<a<<" "<<b<<endl
#define debug3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define debug4(a) cout<<"chu "<<a<<endl

vector <ll> adj_list[100005];
bool indegree[100005];
ll memo[100010];

ll dfs(ll s){
  if(adj_list[s].size()==0)
    return 0;
  if(memo[s]!=-1)
    return memo[s];
  ll ans=0;
  forn(i,0,adj_list[s].size()){
    ans=max(ans,dfs(adj_list[s][i]));
  }
  memo[s]=1+ans;
  return memo[s];
}

int main()
{
  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  ll n,m,t1,t2;
  cin>>n>>m;
  forn(i,0,n+5){
    memo[i]=-1;
  }
  forn(i,0,m){
    cin>>t1>>t2;
    adj_list[t1].pb(t2);
    indegree[t2]=true;
  }
  ll ans=0,currans;
  forn(i,1,n+1){
    if(indegree[i]==false){
      currans=dfs(i);
      ans=max(ans,currans);
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 11264
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  int x;
  cin >>x;
  int ans=1;
  int a[41]={1,4,8,9,16,25,27,32,36,49,64,81,100,121,125,128,144,169,196,216,225,243,256,289,324,343,361,400,441,484,512,529,576,625,676,729,784,841,900,961,1000};
  for(int i=0; i<41; i++){
  	if(a[i]<=x) ans=max(ans,a[i]);
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
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

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

#############
# Main Code #
#############

N,A,B = inputIL()

print(min(N*A,B))


Measured memory_bytes: 65388
package main

import "fmt"

type Price struct {
	Val  int
	Rest int
}

func max(x, y int) int {
	if x > y {
		return x
	} else {
		return y
	}
}

func main() {
	var n, w int
	fmt.Scanf("%d %d", &n, &w)

	ws := make([]int, n+1)
	vs := make([]int, n+1)
	dp := make([][]int, n+1)

	for i := 1; i <= n; i++ {
		fmt.Scanf("%d %d", &ws[i], &vs[i])
	}
	for i := 0; i <= n; i++ {
		dp[i] = make([]int, w+1)
	}

	for i := 1; i <= n; i++ {
		for j := 1; j <= w; j++ {
			if j-ws[i] >= 0 {
				dp[i][j] = max(dp[i-1][j], dp[i-1][j-ws[i]]+vs[i])
			} else {
				dp[i][j] = dp[i-1][j]
			}
		}
	}
	fmt.Println(dp[n][w])
}


Measured memory_bytes: 83068
#include <iostream> 
#include <vector>
#include <stdio.h>
#include <cmath>
#include <map> 
#include <climits>
#include <unordered_map> 
#include <string> 
#include <algorithm>
#include <stack>
#include <queue>
#include <list> 

using namespace std;

int main() {
	int n;
	cin >> n;
	int counter = 0;
	while (n > 0) {
		if (n % 10 == 2) {
			counter++;
		}
		n /= 10;
	}    
	cout << counter << endl;
    return 0;
}

Measured memory_bytes: 888
#include <stdio.h>
int a, b, c, x, ans;
int main()
{
    scanf("%d %d %d", &a, &b, &c);
    for (x = a; x <= b; x++)
    {
        if (c % x == 0)
        {
            ans = ans + 1;
        }
    }
    printf("%d\n", ans);
}



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

int main() {
	int n, tmp;
	cin >> n;
	
	vector<long long> v(1005, 0);
	for (int i = 0; i < n; ++i) {
		cin >> tmp;
		++v[tmp];
	}
	
	long long ans = 0;
	for (long long i = 1; i <= 1000; ++i) {
		ans += v[i] * (v[i] - 1) * (v[i] - 2) / 6;
		for (long long j = i+1; j <= 1000; ++j) {
			if (i + i > j) ans += v[i] * (v[i] - 1) * v[j] / 2;
			ans += v[i] * v[j] * (v[j] - 1) / 2;
			for (long long k = j+1; k < j+i and k <= 1000; ++k) {
				ans += v[i] * v[j] * v[k];
			}
		}
	}
	
	cout << ans << "\n";
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main() {
  	int n,ans=0,d=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
	   int 	a,b;
	   cin>>a>>b;
	   if(a==b)
	   {
	   	ans+=1;
	   }else{
	   	ans=0;
	   }
	   if(ans==3)
	   {
	   	d=1;
	   }

	}
	if(d!=1)
	{
		cout<<"No";
	}else{
		cout<<"Yes";
	}
	return 0;
}

Measured memory_bytes: 3604