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

int main(){
    string a,b,c;
    cin >> a >> b >> c;

    int i=0,j=-1,k=-1;

    char tmp = a[0],t=0;

    int A=a.length(),B=b.length(),C=c.length();

    while(i<A && j<B && k<C){
        t = tmp;
        if(tmp=='a'){
            i++;
            tmp=a[i];
            //cout << "i:" << i << " tmp=" << tmp << endl;
          //  continue;
        }
        else if(tmp=='b'){
            j++;
            tmp = b[j];
            //cout << "j:" << j << " tmp=" << tmp << endl;
           // continue;
        }
        else if(tmp=='c'){
            k++;
            tmp=c[k];
           // cout << "k:" << k << " tmp=" << tmp << endl;
          //  continue;
        }
        else if(tmp==0){
            break;
        }
    }
    cout << char(t-32) << endl;
}



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

int main()
{
  int a[5];
  int k;
  rep(i, 5){
    cin >> a[i];
  }
  cin >> k;
  rep(i, 5){
    rep(j, 5){
      if(abs(a[i] - a[j]) > k){
        cout << ":(" << endl;
        return 0;
      }
    }
  }
  cout << "Yay!" << endl;
  return 0;
}


Measured memory_bytes: 3572
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using D = double;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_num(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n, x, y, z;
bool isa[101010], isb[101010], isc[101010];

int main(){
	cin >> n;
	cin >> x;
	REP(i, x) {
		int a;
		cin >> a;
		isa[a] = true;
	}
	cin >> y;
	REP(i, y) {
		int a;
		cin >> a;
		isb[a] = true;
	}
	cin >> z;
	REP(i, z) {
		int a;
		cin >> a;
		isc[a] = true;
	}
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		if ((!isa[i] && isc[i]) || (isb[i] && isc[i]))cnt++;
	}
	cout << cnt << endl;
}


Measured memory_bytes: 3128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define dl double long
const int INF=0x3fffffff;
const ll MOD=1000000007;
const ll MODD=998244353;
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
ll gcd(ll a, ll b) { return (b > 0) ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a*b/gcd(a, b); }
using ipair = pair<ll, ll>;

int main()
{
  ll X, A;
  cin >> X >> A;
  (X < A) ? cout << "0" << "\n" : cout << "10" << "\n";
}


Measured memory_bytes: 256
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans,right=0,0

A,B=[0],[0]
for i in range(n):
  A.append(a[i]+A[i])
for i in range(m):
  B.append(b[i]+B[i])
for i in range(m+1):
  if k<B[i] or i==m:
    right=i-1
    if i==m:
      right=i
    ans=right
    break

for j in range(0,n):
  if k<a[j]:
    break
  k-=a[j]
  while k<B[right]:
    right-=1
  ans=max(ans,right+j+1)
print(ans)

Measured memory_bytes: 132668
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <vector>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define in insert
#define er erase
#define fi first
#define se second
#define mp make_pair
#define all(x) x.begin(),x.end()
#define sz(x) (int) x.size()
using namespace std;
typedef vector <int> vi;
typedef vector <vector<int>> vii;
typedef pair<int,int> pii;
typedef double db;
typedef long long ll;
typedef long double ld;

const long double PI=3.141592653589793238462643383279502884;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
int main(){
    fast;
    ll n;
    cin>>n;
    string s0;
    cin>>s0;
    ll i;
    for (i=0;i<n&&i<s0.length();i++){
        cout<<s0[i];
    }
    if (n<s0.length()){
        cout<<"...";
    }
    return 0;
}





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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<string>s(n);
  rep(i,0,n)cin>>s[i];
  rep(i,0,n){
    vector<string>tmp(n);
    rep(j,0,n)tmp[(j+i)%n]=s[j];
    bool sw=true;
    //debug(tmp,n,n);
    rep(p,0,n)rep(q,0,n){
      if(tmp[p][q]!=tmp[q][p])sw=false;
    }
    if(sw)res+=n;
  }
  cout<<res<<endl;
  return 0;
}

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

int main(void){
    int A, B;

    cin >> A >> B;

    int wa = A+B;
    int sa  = A - B;
    int seki = A * B;

    cout << max(max(wa, sa), seki) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int N;
    cin >> N;
    vector<int> A(N);
    int o = 0;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        if(A[i]&1)o++;
    }
    YES((o&1)==0);
}

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

int main(){
  int N;
  cin>>N;
  vector<int> H(N);
  for(int i=0;i<N;++i){cin>>H.at(i);}

  int max=0;
  int count=0;
  for(int i=0;i<N;++i){
    if(max<=H.at(i)){
      ++count;
      max=H.at(i);
    }
  }

  cout<<count<<endl;
}


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

int gcd(int a, int b){
  if (a < b){
    int tmp = a;
    a = b;
    b = tmp;
  }
  
  int r;
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
};

int main() {
  int K;
  cin >> K;
  
  int ans1, ans2;
  int count = 0;
  for(int i=1; i<= K; i++){
	for(int j=1; j<= K; j++){
		for(int n=1; n<= K; n++){
    		ans1 = gcd(n, j);
            ans2 = gcd(ans1, i);
            //cout << "i=" << i << "j=" << j << "n=" << n << ": ans1 =" << ans1 << " ans2 = " << ans2 << endl; 
            count = count + ans2;
		}
  	}
  }
  cout << count << endl;
}



Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N,D,A; cin>>N>>D>>A;
  vector<pii> X(N);
  rep(i,0,N) cin>>X[i].first>>X[i].second;
  sort(ALL(X));
  queue<pii> Q;
  int ans=0,sum=0;
  rep(i,0,N){
    while(Q.size()>0){
      int K=Q.front().first;
      if(K>=X[i].first) break;
      sum-=Q.front().second;
      Q.pop();
    }
    if(sum<X[i].second){
      int P=X[i].second-sum;
      P=(P+A-1)/A;
      ans+=P;
      sum+=P*A;
      Q.push(mp(X[i].first+2*D,P*A));
    }
  }
  cout<<ans<<endl;
  }



Measured memory_bytes: 4992
#include<cstdio>
#include<algorithm>
#include<vector>
#include<deque>
#include<string>
#include<iostream>
#include<tuple>
#include<utility>
#include<set>
using namespace std;
typedef long long int llint;
const llint big=((llint)1<<(llint)60);
#define mt make_tuple
#define mp make_pair
#define fi first
#define se second
#define pub push_back
#define res resize
//JOI 2016 oranges
//K+s*(maxore-minore)
//dp????????????
//dp[i]=i???????????§??°??????
//TLE?????????
//0 1 2
int main(void){
	llint N,M,K,i,j,maxore,minore;
	llint ore[20001]={0};
	llint dp[20001]={0};
	cin>>N>>M>>K;
	for(i=0;i<N;i++){
		dp[i+1]=big;
		cin>>ore[i];
		maxore=0;
		minore=big;
		for(j=i;j>max((llint)-1,i-M);j--){
			maxore=max(maxore,ore[j]);
			minore=min(minore,ore[j]);
			dp[i+1]=min(dp[i+1],K+(i-j+1)*(maxore-minore)+dp[j]);
		}
		//cout<<"de"<<dp[i+1]<<endl;
	}
	cout<<dp[N]<<endl;
}

Measured memory_bytes: 3396
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int x, y;
	cin >> x >> y;
	int rsl = x + y / 2;
	cout << rsl << endl;
}


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

// repetition
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

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

// const value
// const ll MOD = 1e9 + 7;
// const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
// const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline ll toLL(string s) {
  ll v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, w, d;
  cin >> h >> w >> d;
  ll b[h][w];
  map<int, PII> mp;
  rep(i, h) rep(j, w) {
    cin >> b[i][j];
    mp[b[i][j]] = PII(i, j);
  }
  ll sum[2 * h * w + 1];
  memset(sum, 0, sizeof(sum));
  rep(i, h * w) {
    auto now = mp[i];
    auto next = mp[i + d];
    sum[i + d] =
        sum[i] + abs(now.first - next.first) + abs(now.second - next.second);
  }
  int q;
  cin >> q;
  rep(_, q) {
    int l, r;
    cin >> l >> r;
    cout << sum[r] - sum[l] << endl;
  }
  return 0;
}


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

ll dp[3105][3105][5];
ll ara[3105][3105];

ll n,m,k;

ll call(ll i,ll j,ll tot)
{
    if(i>n || j>m )
        return 0;

    ll &sum=dp[i][j][tot];


    if(~sum)
        return sum;

    sum=0;

    if(tot==3)
    {
        sum=(call(i+1,j,0));
    }
    else
    {
        if(ara[i][j]!=0)
        {
            sum=max(call(i,j+1,tot),max(ara[i][j]+call(i,j+1,tot+1),ara[i][j]+call(i+1,j,0)));
        }
        else
        {

            sum=max(call(i+1,j,0),call(i,j+1,tot));
        }
    }

    return sum;

}
int main()
{
    memset(dp,-1,sizeof(dp));
    cin>>n>>m>>k;
    ll a,b,c;
    while(k--)
    {
        cin>>a>>b>>c;
        ara[a][b]=c;
    }
    cout<<call(0,0,0)<<endl;
    return 0;
}


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

const int mod = 1e9 + 7;
const int mnx = 3e5 + 9;

ll n, x;

int main() {

cin >> n >> x;

if (x == 1 || x == 2 * n - 1) {
    cout << "No\n";
    return 0;
}

cout << "Yes\n";

vector<int> ans(2 * n - 1);

x--;

for(int i = 0; i < 2 * n - 1; i++) {
    ans[(n + i-1) % (2 * n - 1)] = x + 1;
    x++;
    x %= (2 * n - 1);
}

for(int i = 0; i < 2 * n - 1; i++){
    cout << ans[i] << '\n';
}

return 0;

}







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

int counter[200010];
int input[200010];
vector<vector<int>> edge;

void dfs(int i, int p, int sum) {
	counter[i] = sum + input[i];
	for (int u: edge[i]) {
		if (u != p) {
			dfs(u, i, counter[i]);
		}
	}
}

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

	int n, q;
	cin >> n >> q;

	edge.resize(n);
	int a, b;
	for (int i = 1; i < n; ++i) {
		cin >> a >> b;
		a--; b--;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}

	while (q--) {
		cin >> a >> b;
		a--;
		input[a] += b;
	}

	dfs(0, -1, 0);

	for (int i = 0; i < n; ++i) {
		cout << counter[i] << ' ';
	}
}

Measured memory_bytes: 24064
#include<iostream>
#include<string>
#include<string.h>
#include<math.h>
using namespace std;
#define ll long long int
#define yes cout<<"YES"<<endl
#define NO cout<<"NO"<<endl

#define p(a) cout<<a<<endl

int main()
{
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        if(s.at(i)=='1')
            cout<<9;
        else
            cout<<1;
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    if (a < b && b < c && a < c){
        System.out.println("Yes");
    }else{
        System.out.println("No");
    }
}
}


Measured memory_bytes: 26128
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<math.h>
#include<string.h>

typedef long long ll;

int max(int a,int b){
	if(a<b)
		a=b;
	return a;	
}
int min(int a,int b){
	if(a>b)
		a=b;
	return a;	
}
void sorte(int n,int a[]){
	int i,j;
	
	for(i=0 ;i<n ; i++){
		for(j=0 ; j<n-1 ; j++){
			if(a[j]>a[j+1]){
				int tmp=a[j];
				a[j]=a[j+1];
				a[j+1]=tmp;
			}
		}
	}
}

void solve(){
 	double d,t,s;
 	scanf("%lf%lf%lf",&d,&t,&s);
 
 	if((d/t)<=s)
 		printf("Yes\n");
 	else
	 	printf("No\n");	
}

int main(){
	 /*int t;
	 scanf("%d",&t);
	while(t--)*/
		solve();
	return 0;
}

Measured memory_bytes: 1724
N=int(input())
d=list(map(int, input().split()))
d.sort()
arc_start_index = N // 2

ABC_max = d[arc_start_index-1]
ARC_min = d[arc_start_index]

if ABC_max == ARC_min:
    print(0)
else:
    print(ARC_min - ABC_max)


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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<double> x(n), y(n);
	double div = 1;
	rep(i,n){
		cin >> x[i] >> y[i];
		div *= (i+1);
	}
	double ans = 0;
	vector<int> v(n);
	rep(i,n) v[i] = i;
	do{
		rep(i,n-1){
			ans += sqrt((x[v[i]]-x[v[i+1]])*(x[v[i]]-x[v[i+1]]) + (y[v[i]]-y[v[i+1]])*(y[v[i]]-y[v[i+1]]));
		}
	} while(next_permutation(v.begin(), v.end()));
	ans /= div;
	cout << fixed << setprecision(12) << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include "iostream"
#include "math.h"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
using namespace std;

int main() {
	int num[100005];
	int ans[100005];
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> num[i];
		ans[num[i]] = i;
	}
	for (int i = 1; i <= n; i++) {
		if(i!=1)cout << " ";
		cout << ans[i];
	}
	cout << endl;
}

Measured memory_bytes: 1536
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define LL long long
#define res register int
string str;
int a[2];

inline int read(){
	int s=0,f=0;char c=getchar();
	while(!isdigit(c))f=(c=='-'),c=getchar();
	while(isdigit(c))s=(s<<3)+(s<<1)+(c^'0'),c=getchar();
	return f?-s:s;
}

int main(){
	cin>>str;
	for(res i=0;i<(int)str.length();++i){
		if(str[i]=='C') a[0]=1;
		if(a[0]&&str[i]=='F') a[1]=1;
	}
	printf("%s\n",a[1]?"Yes":"No");
	return 0;
}


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

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

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

  cout << dp[n - 1] << endl;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
#define repu(i,x,y) for (int i=x; i<=y; ++i)
using namespace std;

typedef long long LL;
const int p=1000000007;
int n,f[1000100],ans;

int main()
{
    scanf("%d",&n);
    f[0]=1,f[1]=p-1;
    repu(i,0,n-1)
    {
        (f[i+1]+=f[i])%=p;
        (f[i+2]+=p-f[i])%=p;
        (f[i+3]+=f[i])%=p;
        int t=n-i-1;
        if (i<n-1)
        {
            ans=(ans+LL(n-1)*(n-1)%p*f[i])%p;
            ans=(ans+LL(n-t)*f[i])%p;
        }
        else
            ans=(ans+LL(n-1)*f[i])%p;
        (f[i+1]+=f[i])%=p;
    }
    (ans+=f[n])%=p;
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define SIS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define endl '\n'
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define PER(I, A, B) for (int I = (A); I >= (B); --I)
#define lson k*2
#define rson k*2+1
#define fi first
#define se second
#define DB(A) cout<<(A)<<endl
#define DB1(A,B,C) cout<<(A)<<" "<<(B)<<" "<<(C)<<"!"<<endl
#define PB push_back
#define Pair pair<int,int>
#define MP make_pair
#define LL long long
#define int LL
using namespace std;
const int maxn=100+10;
const int MAX=100;
const int inf=0x3f3f3f3f;   
const int mod=1e9+7;
//head
int n,m;
int dp[maxn][MAX];
int digit[maxn];
//dfs:第k位（从高位到低位），limit==1表示第k+1位达到上限（若k为最高位，limit也为0（因为第tot位已达到上限0））， lead==0表示有前导0 
int dfs(int k,bool limit,bool lead,int num) //num表示已经有多少个non-zero digits 
{
	if (k==0&&num==n) return 1;
	else if (k==0) return 0;
	if (!limit&&lead&&(dp[k][num]!=-1)) return dp[k][num];
	//limit为0，表示没有达到上限， lead为1，前面那个不是前导0，dp！=-1，说明已经遍历过。返回这个枚举到第k位，且上一位是last的状态 
	int upbound=(limit?digit[k]:9);//limit为1，有限制，返回这个限制，否则返回9 
	int ans=0;
	FOR(i,0,upbound)
	{		
		if (i==0)
		{
			ans+=dfs(k-1,limit&&(i==upbound),(!((lead==0)&&(i==0))),num);	
		} 
		else
		{
			ans+=dfs(k-1,limit&&(i==upbound),(!((lead==0)&&(i==0))),num+1);
		}		
		//limit&&(i==upbound)，若前面封顶了且这个i也封顶了，那么从最高位到这一位都封顶了，limit保持1		
		//(!lead)&&(i==0)仅当上一位是前导0且这一位还是0时lead才继续保持0 
		//前导0影响0的统计
	}
	if (!limit&&lead) dp[k][num]=ans;
	return ans;
}
int solve(string s)
{
	memset(dp,-1,sizeof(dp));
    int len=s.size();
    int tot=0;
    PER(i,len,1)
    {
    	digit[++tot]=(int)s[i-1]-48;
	}
    return dfs(tot,1,0,0);    
}
signed main()
{
    string s;
    getline(cin,s);
    scanf("%lld",&n);
    {
		printf("%lld\n",solve(s));	        
    }
}

Measured memory_bytes: 384
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
//max_element


int V[100];
int C[100];

signed main()
{
	int N;
	cin >> N;
	REP(i, N) cin >> V[i];
	REP(i, N) cin >> C[i];

	int ans = 0;
	REP(i, N)
	{
		if (V[i] - C[i] > 0)
			ans += V[i] - C[i];
	}

	cout << ans << endl;
}



Measured memory_bytes: 3148
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i=0; i < n; i++)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define tmax(x, y, z) max((x), max((y), (z)))
#define tmin(x, y, z) min((x), min((y), (z)))
ll MM = 1000000000; ll mod = MM + 7; ll MMM=9223372036854775807;//2^63 -1
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
const ll INF = 1LL << 60;
//cout << fixed << setprecision(10);
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main(){
    ll n, max_cnt = -1, ans = -1;
    cin>>n;
    FOR(i,1,n+1){
        ll cnt = 0;
        ll num = i;
        while(1){
            if(num%2 == 0) cnt++, num /= 2;
            else break;
        }
        if(chmax(max_cnt, cnt)) ans = i;
    }
    cout<<ans<<endl;
}


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

using namespace std;

int main(){
	int n;
	cin>>n;
	int a[100001]={};
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	int count=0,m=1;
	for(int i=0;i<n-1;i++){
		if(a[i]!=a[i+1]){
			if(m%2==1) count++;
			m=1;
		}
		if(a[i]==a[i+1]){
			m++;
		}
	}
	if(m%2==1) count++;
	cout<<count;
	
	return 0;
}

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

double M[21][2] = { 0 };

double Face(int n) {
	double sum=0;
	double a, b, c, z;
	int i=0;
	int tmp_2 = 1, tmp_3 = 2;
	while (i < n) {
		a = sqrt((M[tmp_2][1] - M[0][1]) * (M[tmp_2][1] - M[0][1]) + (M[tmp_2][0] - M[0][0]) * (M[tmp_2][0] - M[0][0]));
		b = sqrt((M[tmp_3][1] - M[0][1]) * (M[tmp_3][1] - M[0][1]) + (M[tmp_3][0] - M[0][0]) * (M[tmp_3][0] - M[0][0]));
		c = sqrt((M[tmp_3][0] - M[tmp_2][0]) * (M[tmp_3][0] - M[tmp_2][0]) + (M[tmp_3][1] - M[tmp_2][1]) * (M[tmp_3][1] - M[tmp_2][1]));
		z = (a + b + c) / 2;
		sum += sqrt(z * (z - a) * (z - b) * (z - c));
		tmp_2 += 1;
		tmp_3 += 1;
		i += 1;
	}
	return sum;
}

int main() {
	double x, y;
	char d;
	int i = 0;
	//n-2の三角形
	while (cin >> x >> d >> y) {
		M[i][0] = x;
		M[i][1] = y;
		i += 1;
	}
	printf("%.6lf\n", Face(i - 2));
	return 0;
}


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

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define pb push_back
#define pf push_front

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;

ll gcd(ll x, ll y) {
	ll r;
	while ((r = x % y) != 0) {
		x = y;
		y = r;
	}
	return y;
}
ll lcm(ll x, ll y) {
	x /= gcd(x, y);
	y /= gcd(x, y);
	return (x*y);
}

int main()
{
	int n, cnt = 0, ans = 0;
	cin >> n;
	char s[n];
	rep(i, n) {
		cin >> s[i];
	}
	rep(i, n) {
		if (s[i] == 'P'&&cnt == 0) {
			ans++;
			cnt++;
		}
	}
	cnt = 0;
	rep(i, n) {
		if (s[i] == 'W'&&cnt == 0) {
			ans++;
			cnt++;
		}
	}
	cnt = 0;
	rep(i, n) {
		if (s[i] == 'G'&&cnt == 0) {
			ans++;
			cnt++;
		}
	}
	cnt = 0;
	rep(i, n) {
		if (s[i] == 'Y'&&cnt == 0) {
			ans++;
			cnt++;
		}
	}
	cout << (ans == 3 ? "Three" : "Four") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <sstream>
#include <string>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <limits>
#include <unordered_map>
#include <unordered_set>
#include <math.h>
#include <fstream>
#include <iterator>
#include <random>
#include <chrono>
 
 
#define forr(i,start,count) for (int i = (start); i < (start)+(count); ++i)
#define set_map_includes(set, elt) (set.find((elt)) != set.end())
#define readint(i) int i; cin >> i
#define readll(i) ll i; cin >> i
#define readdouble(i) double i; cin >> i
#define readstring(s) string s; cin >> s

typedef long long ll;
 
using namespace std;

template<class T>
T fastpower(T a, long long n) {  // n must be >= 1
  if (n % 2 == 0) {  
      T halfpower = fastpower<T>(a, n/2);
      return halfpower*halfpower;
  } else {
      if (n == 1) {  return a; } else {  
          T halfpower = fastpower<T>(a, n/2);
          return (halfpower*halfpower)*a;
      }
  }
};


int main()   {
    cout.precision(17);
    ll modd = 1000 * 1000 * 1000 + 7;
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    uniform_int_distribution<int> rand_gen(0, modd);   // rand_gen(rng) gets the rand no
    ll infinit = 10000000000000000;

//    auto start = chrono::steady_clock::now();

//    readint(test_cases);
    int test_cases = 1;
    forr(t, 1, test_cases) {
        readll(a); readll(v);
        readll(b); readll(w);
        readll(tim);

        if (v<=w) {
            cout << "NO" << endl; continue;
        }
        if (abs(a-b)<=tim*abs(v-w)) {
            cout << "YES" << endl;
        }  else {
            cout << "NO" << endl;
        }

    }

//    auto end = chrono::steady_clock::now();
//    cout << chrono::duration_cast<chrono::milliseconds>(end - start).count() << endl;

    return 0;
}

Measured memory_bytes: 3620
N = int(input())
S = []
count = 0
countA = 0
countB = 0
countAB = 0
for i in range(N):
	S_in = str(input())
	for j in range(len(S_in)-1):
		if S_in[j:j+2] == 'AB':
			count += 1
	if (S_in[0] == 'B') & (S_in[-1] == 'A'):
		countAB	+= 1
	elif S_in[0] == 'B':
		countB += 1
	elif S_in[-1] == 'A':
		countA += 1
	S.append(S_in)
if (countA == 0) & (countB == 0) & (countAB > 0):
	print(max(0, count + countAB - 1))
else:
	print(count + countAB + min(countA, countB))

Measured memory_bytes: 3700
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

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

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

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);

    int N; cin >> N;
    VI X(N);
    REP(i,N) X[i] = i+1;
    VI P(N),Q(N);
    REP(i,N) cin >> P[i];
    REP(i,N) cin >> Q[i];
    int cnt = 1;
    int a,b;

    do{
        if(X == P){
            a = cnt;
        }
        if(X == Q){
            b = cnt;
        }
        cnt++;
    }while(next_permutation(X.begin(),X.end()));
    cout << abs(a-b) << endl;

}


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

public class Main {

	static final int UP = 1;
	static final int RIGHT = 2;
	static final int DOWN = 4;
	static final int LEFT = 8;
	
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int numInput = Integer.parseInt(br.readLine());
		int width = 0;
		for(int i = 0; i < numInput; i++){
			width = Integer.parseInt(br.readLine());
			printSpiral(width);
			if(i != numInput - 1)System.out.println();
		}
	}
	
	public static void printSpiral(int n){
		if(n == 1){
			System.out.println("#");
			return;
		}
		boolean[][] spiral = createSpiral(n);
		for(int i = 0; i < spiral.length; i++){
			for(boolean row : spiral[i]){
				if(row == true)		System.out.print("#");
				else				System.out.print(" ");
			}
			System.out.println();
		}
	}
	
	private static boolean[][] createSpiral(int n){
		boolean[][] spiral = new boolean[n][n];
		//一番左
		for(int i = 0; i < n; i++){
			spiral[i][0] = true;
		}
		//それ以降
		int[] length = new int[2];
		length[0] = n - 1;
		length[1] = n - 1;
		int direction = RIGHT;
		int c = 0;
		int x = 0, y = 0;
		while(true){
			for(int i = 0; i < length[c % 2]; i++){
				switch(direction){
				case UP:	y--;	break;
				case RIGHT:	x++;	break;
				case DOWN:	y++;	break;
				case LEFT:	x--;	break;
				}
				spiral[y][x] = true;
			}
			length[c++ % 2] -= 2;
			if(length[0] + length[1] < 2)	break;
			direction = direction * 2 % 15;
		}
		return spiral;
	}
}

Measured memory_bytes: 24592
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i,s,n) for(int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
   string s;
   cin >> s;
   rep(i, s.size()) {
       if(i == 0 && s[i] == '?') {
           if(s[i+1]=='D')
               s[i] = 'P';
            else
                s[i] = 'D';
       } else if(i == s.size() - 1 && s[i] == '?') {
           s[i] = 'D';
       } else if(s[i] == '?') {
           if(s[i - 1] == 'D' && s[i + 1] == 'D')
               s[i] = 'P';
            else
                s[i] = 'D';
       }
   }
   cout << s << endl;
   return 0;
}

Measured memory_bytes: 3732
#include <iostream>
#include <vector>

struct Node{
  Node () :   //constracter
    parent (-1),
    id(-1),
    depth(0)
  {}

  int id;
  int depth;
  int parent;
  std::vector<Node*>children; //stack,pointa
};

int FindRoot(Node* nodes, int n){
  for(int i=0; i<n; i++){
    if(nodes[i].parent == -1){
      return i;
    }
  }
  return n-1;
}

void ComputeDepth(Node*nodes, int idx, int depth){
  nodes[idx].depth = depth;
  for(int i=0; i<nodes[idx].children.size(); i++){
    ComputeDepth(nodes, nodes[idx].children[i]->id, depth+1);
  }
}

int main(){
  //input
  int n;
  std::cin >> n;
  Node nodes[n];
  for(int i=0; i<n; ++i){
    int id, num_children;
    std::cin >> id >> num_children;
    nodes[id].id = id;
    for(int j=0; j<num_children; ++j){
      int c;
      std::cin >> c;
      nodes[id].children.push_back(&nodes[c]);//pointa
      nodes[c].parent = id;
    }
  }

  //compute depth
  int root = FindRoot(nodes, n);
  ComputeDepth(nodes, root, 0);

  for(int i=0; i<n; i++){
    std::cout << "node " << nodes[i].id;
    std::cout << ": parent = " << nodes[i].parent;
    std::cout << ", depth = " << nodes[i].depth << ", ";

    if(nodes[i]. parent == -1){ std::cout << "root, ["; }
    else if(nodes[i].children.size() != 0){ std::cout << "internal node, ["; }
    else { std::cout <<"leaf, ["; }

    for(int j=0; j<nodes[i].children.size(); j++){
      std::cout <<nodes[i].children[j]->id;
      if(j != nodes[i].children.size() -1 ){
        std::cout << ", ";
      }
    }
    std::cout << "]" <<std::endl;
  }
  return 0;
}



Measured memory_bytes: 8332
def calc_score(sch):
    d=[0]*26
    score=0
    for i in range(dur):
        j=sch[i]-1
        s=S[i]
        score+=s[j]+c[j]*(i+1-d[j])+sum([-c[k]*(i+1-d[k]) for k in range(26)])
        d[j]=i+1
    return score

def greedy(dur,c,S,r):
    sch=[]
    d=[0]*26
    for i in range(dur):
        t=0
        s=S[i]
        m=-1<<64
        for j in range(26):
            alt=s[j]+r*c[j]*(i+1-d[j])+sum([-r*c[k]*(i+1-d[k]) for k in range(26)])
            #alt=s[j]-(-c[j]*(i+1-d[j])+sum([c[k]*(i+1-d[k]) for k in range(26)]))**r
            if alt>m:
                m=alt
                t=j
        sch.append(t+1)
        d[t]=i+1
    return sch

dur=int(input())
c=list(map(int,input().split()))
S=[list(map(int,input().split())) for i in range(dur)]

T=50
a,b=1,8
R=1
tmp=-float('inf')

for r in [a+i*(b-a)/T for i in range(T)]:
    alt_sch=greedy(dur,c,S,r)
    alt=calc_score(alt_sch)
    if tmp<alt:
        tmp=alt
        sch=alt_sch
        R=r

for i in sch:
    print(i)



Measured memory_bytes: 75848
#include <vector>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <utility>
#include <stack>
#include <numeric>
#include <random>
#include <algorithm>
#include <queue>
#include <functional>
#include <iterator>
#include <list>
#include <unordered_map>
#include <deque>
#include <math.h>
#include <tgmath.h>
using namespace std;

#define rep(i, b, e) for(i = b; i < e; ++i)
#define repr(i, b, e) for (i = b; i >= e; --i)
#define ull unsigned long long int
#define ll long long int
#define pint pair<int, int>

#define M_DEBUG 1
#define PI 3.141592653589793

#define E '\n'

#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << "\n";}
#define INF (1e18)

const ll MAX = 1000000000;
const ll MOD = 1e9 + 7;

ll a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

ll aabs(ll a) {
    if (a < 0) return -a;
    return a;
}

//fast power
ll calc(ll a, ll b) {
    if (b == 0) return 1;
    else if (b % 2 == 0) {
        ll d = calc(a, b / 2);
        return (d * d) % MOD;
    }
    else return (a * calc(a, b - 1)) % MOD;
}

//fast combination
ll comb(ll n, ll a) {
    ll b = 1, c = 1;
    for (ll i = 1; i <= a; ++i) {
        b = b * i % MOD;
        c = c * (n - i + 1) % MOD;
    }

    return c * calc(b, MOD - 2) % MOD;
}

ll comb2(ll a) {
    ll b = a / 2;
    if (a % 2) {
        b = (a - 1) / 2;
        return (b * a);
    }
    return (b * (a - 1));
}

int kyotsu(string ss, int st, int ed, string ss2) {
    int ans = 0;
    for ( int i = st; i < ed; ++i ) {
        if (i - st >= ss2.size()) return ans;
        if (ss[i] == ss2[i - st] || ss[i] == '?') {
            ans++;
        } else {
            return -1;
        }
    }
    return ans;
}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> w;
    vector<vector<ll>> aa(n, vector<ll>(2, 0));
    vector<vector<ll>> dp(n + 1, vector<ll>(w + 1, 0));
    rep (i, 0, n) cin >> aa[i][0] >> aa[i][1];

    rep (i, 0, n) {
        rep (j, 0, w + 1) {
            if (j - aa[i][0] >= 0)
                chmax(dp[i + 1][j], dp[i][j - aa[i][0]] + aa[i][1]);
            chmax(dp[i + 1][j], dp[i][j]);
        }
    }

    /*rep (i, 0, n + 1) {
        rep (j, 0, w + 1) cout << dp[i][j] << ' ';
        cout << endl;
    }*/
    cout << dp[n][w] << endl;
    return 0;
}


Measured memory_bytes: 80256
class Combination:
    def __init__(self, n_max, mod=10**9+7):
        # O(n_max + log(mod))
        self.mod = mod
        f = 1
        self.fac = fac = [f]
        for i in range(1, n_max+1):
            f = f * i % mod
            fac.append(f)
        f = pow(f, mod-2, mod)
        self.facinv = facinv = [f]
        for i in range(n_max, 0, -1):
            f = f * i % mod
            facinv.append(f)
        facinv.reverse()

    # "n 要素を" は区別できる n 要素
    # "k グループ" はちょうど k グループ

    def __call__(self, n, r):  # self.C と同じ
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def C(self, n, r):
        if not 0 <= r <= n: return 0
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def P(self, n, r):
        if not 0 <= r <= n: return 0
        return self.fac[n] * self.facinv[n-r] % self.mod

    def H(self, n, r):
        if (n == 0 and r > 0) or r < 0: return 0
        return self.fac[n+r-1] * self.facinv[r] % self.mod * self.facinv[n-1] % self.mod

    def rising_factorial(self, n, r):  # 上昇階乗冪 n * (n+1) * ... * (n+r-1)
        return self.fac[n+r-1] * self.facinv[n-1] % self.mod

    def stirling_first(self, n, k):  # 第 1 種スターリング数  lru_cache を使うと O(nk)  # n 要素を k 個の巡回列に分割する場合の数
        if n == k: return 1
        if k == 0: return 0
        return (self.stirling_first(n-1, k-1) + (n-1)*self.stirling_first(n-1, k)) % self.mod

    def stirling_second(self, n, k):  # 第 2 種スターリング数 O(k + log(n))  # n 要素を区別のない k グループに分割する場合の数
        if n == k: return 1  # n==k==0 のときのため
        return self.facinv[k] * sum((-1)**(k-m) * self.C(k, m) * pow(m, n, self.mod) for m in range(1, k+1)) % self.mod

    def balls_and_boxes_3(self, n, k):  # n 要素を区別のある k グループに分割する場合の数  O(k + log(n))
        return sum((-1)**(k-m) * self.C(k, m) * pow(m, n, self.mod) for m in range(1, k+1)) % self.mod

    def bernoulli(self, n):  # ベルヌーイ数  lru_cache を使うと O(n**2 * log(mod))
        if n == 0: return 1
        if n % 2 and n >= 3: return 0  # 高速化
        return (- pow(n+1, self.mod-2, self.mod) * sum(self.C(n+1, k) * self.bernoulli(k) % self.mod for k in range(n))) % self.mod

    def faulhaber(self, k, n):  # べき乗和 0^k + 1^k + ... + (n-1)^k
        # bernoulli に lru_cache を使うと O(k**2 * log(mod))  bernoulli が計算済みなら O(k * log(mod))
        return pow(k+1, self.mod-2, self.mod) * sum(self.C(k+1, j) * self.bernoulli(j) % self.mod * pow(n, k-j+1, self.mod) % self.mod for j in range(k+1)) % self.mod

    def lah(self, n, k):  # n 要素を k 個の空でない順序付き集合に分割する場合の数  O(1)
        return self.C(n-1, k-1) * self.fac[n] % self.mod * self.facinv[k] % self.mod

    def bell(self, n, k):  # n 要素を k グループ以下に分割する場合の数  O(k**2 + k*log(mod))
        return sum(self.stirling_second(n, j) for j in range(1, k+1)) % self.mod

mod = 10**9+7
comb = Combination(2000)
n, k = map(int, input().split())
print(comb.stirling_second(n, k))



Measured memory_bytes: 5776
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <numeric>
#include <algorithm>
#include <stdio.h>

int main(void){
  int l,r,d,s=0;
  std::cin >> l >> r >> d;
  for(int i=0;;i++){
    if(r<l){
      break;
    }
    if(l%d==0){
      s++;
    }
    l++;
  }
  std::cout << s;
  return 0;
}

Measured memory_bytes: 3616
def main(listseq):
    x = y = 0
    for strings in listseq:
        a, b = strings.split(" ")
        if a < b: y += 3
        elif a > b: x += 3
        elif a == b: x += 1; y += 1
    return x, y


times = int(input())
words = [input() for _ in range(times)]
a, b = main(words)
print(f"{a} {b}")


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

typedef long long ll;

int main() {
    ll N;
    ll X = 0;
    cin >> N;
    vector<ll>v(N);
    for (int i = 0; i < N; i++) {
        ll A, B;
        cin >> A >> B;
        X += B;
        v[i] = A+B;
    }
    sort(v.begin(), v.end(), greater<ll>());
    X *= -1;
    for (int i = 0; i < N; i++) {
        if (i % 2 == 0) {
            X += v[i];
        }
    }
    cout << X << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <set>

using namespace std;
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)

int main(){
  string s;
  cin>>s;
  set<int> data;
  ff(i,0,s.size()){
    data.insert(s[i]-'a');
  }
  ff(i,0,26){
    char t='a';
    if(!data.count(i)){
      t+=i;
      cout<<t<<endl;
      return 0;
    }
  }
  cout<<"None"<<endl;
  return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define MAX 128
#define fst first
#define sec second
#define pb push_back
#define mp make_pair
#define ALL(x) (x).begin(), (x).end()
#define bit(n) (1LL << (n))
#define int long long
const double PI = 3.141593;
const ll MOD = 1e9 + 7;
const int INF = 100100100;
const double EPS = 1e-9;
template <class T>
bool chmax(T &a, const T &b){if (a < b){a = b;return 1;}return 0;}
template <class T>bool chmin(T &a, const T &b){if (b < a){a = b;return 1;}return 0;}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } //最大公約数
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }     //最小公倍数
ll combination(ll n, ll r){if (r * 2 > n)r = n - r;ll dividend = 1;ll divisor = 1;for (ll i = 1; i <= r; ++i){dividend *= (n - i + 1);divisor *= i;}return dividend / divisor;}


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

    int n, k;
    cin >> n >> k;
    int tmp = 1;
    rep(i, n)
    {
        if(tmp+k>=tmp*2)
            tmp *= 2;
        else
            tmp += k;
    }
    cout << tmp << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
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; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }

int main(void){
    // Your code here!
    int n;cin >> n;
    vector<int> a(n+1);
    FOR(i,1,n) cin >> a[i];
    vector<int> ans;
    vector<int> b(n+1,0);
    for (int i = n;i >= 1;i--) {
        int sum = 0;
        for (int j = i;j <= n;j += i){
            sum += b[j];
        }
        if ((sum + 1) % 2 == a[i] % 2){
            b[i]++;
            ans.push_back(i);
        }
    
    }

    reverse(ans.begin(),ans.end());
    cout << ans.size() << endl;
    for (auto x:ans) cout << x << " ";
    
}


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

int main(){
    ll n; cin >> n;
    vl p(n);
    rep(i,n-1){
        ll a; cin >> a;
        p[a-1]++;
    }
    rep(i,n)cout << p[i] << endl;
}

Measured memory_bytes: 4792