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

#define INF (2e9)
#define FOR(i, a, b) for (ll (i) = (a); (i) < (b); ++(i))
#define REP(i, n) FOR(i, 0, n)

using namespace std;

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

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

using ll = long long;
using ld = long double;

#define ALL(x) (x).begin(), (x).end()
template<class T>
using vc = vector<T>;
using vi = vc<ll>;
using vvi = vc<vi>;

template<class T>
using va = valarray<T>;
using vad = va<ld>;
using vai = va<ll>;

using pii = pair<ll, ll>;

vi Read(ll n) {
    auto      v = vi(n);
    for (auto i = std::size_t(0); i < n; ++i) {
        cin >> v[i];
    }
    return v;
}

template<class T>
void DumpRow(const T& A) {
    for (const auto& value : A)
        cout << value << "\n";
}

template<class T>
void DumpColumn(const T& A) {
    auto isFirst = true;
    for (const auto& value : A) {
        if (isFirst) {
            cout << value;
            isFirst = false;
        } else {
            cout << " " << value;
        }

    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20) << fixed;

    bitset<64> bit(0);

    int q;
    cin >> q;

    REP(i, q) {
        int query;
        cin >> query;
        switch (query) {
            unsigned int j;
            case 0:
                cin >> j;
                cout << bit.test(j) << endl;
                break;
            case 1:
                cin >> j;
                bit.set(j);
                break;
            case 2:
                cin >> j;
                bit.reset(j);
                break;
            case 3:
                cin >> j;
                bit.flip(j);
                break;
            case 4:
                cout << bit.all() << endl;
                break;
            case 5:
                cout << bit.any() << endl;
                break;
            case 6:
                cout << bit.none() << endl;
                break;
            case 7:
                cout << bit.count() << endl;
                break;
            case 8:
                cout << bit.to_ullong() << endl;
                break;
        }
    }
    return 0;
}



Measured memory_bytes: 3152
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define lb lower_bound
#define ub upper_bound
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

const ll MAX = 200020;//設定して

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;//＊１
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll n,m,k,ans=0;cin>>n>>m>>k;
  COMinit();
  rep(i,1,n){
    ll res=i*(n-i)*m*m;
    res%=mod;
    res*=COM(n*m-2,k-2);
    res%=mod;
    ans+=res;
    ans%=mod;
  }
  rep(i,1,m){
    ll res=i*(m-i)*n*n;
    res%=mod;
    res*=COM(n*m-2,k-2);
    res%=mod;
    ans+=res;
    ans%=mod;
  }
  cout<<ans<<ENDL;
}
//( ・ __ ・ ) KEEP BEING ORGANIZED
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 4992
#include <iostream>

#include <vector>

#include <cassert>

#include <algorithm>

#include <functional>

#include <cmath>

#include <iomanip>

#include <limits>
#include <bits/stdc++.h>
#include<queue>
#include<type_traits>
#include<cstdint>
using namespace std;
int main(){
   int n;
   cin >> n;
   vector<int> A(n+1);
   vector<int> B(n);
   for(int i=0;i<n+1;i++){
       int x;
       cin >> x;
       A[i]=x;
   }
  // cout<<A[2]<<endl;
   for(int i=0;i<n;i++){
       int x;
       cin >> x;
       B[i]=x;
   }
   long long Count1=0;
   for(int i=0;i<n;i++){
       if(B[i]>A[i]){
           Count1 += A[i];
        //   cout<<"ここまで普通"<<A[i]<<endl;
          
           B[i]=B[i]-A[i];
            A[i]=0;
           if(A[i+1]<B[i]){
               
               Count1 += A[i+1];
        //       cout<<"最強"<<A[i+1]<<endl;
               A[i+1]=0;
           }else{
               A[i+1]=A[i+1]-B[i];
               Count1 += B[i];
        //       cout<<"普通"<<B[i]<<endl;
           }
       }else{
           Count1 += B[i];
       //    cout<<"役立たず"<<endl;
       }
   }
   cout<<Count1<<endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i,a,n) for(ll i=a;i<n;i++)
#define w(_t) ll _t;cin>>_t;while(_t--)
ll max(ll a,ll b) {
    return a>b?a:b;
}
int main() {
    ios::sync_with_stdio(false);cin.tie(0);
    ll n,x,t;cin>>n>>x>>t;
    ll ans=0;
    while(n>0){
        ans+=t;
        n-=x;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 3604
/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

const bool ready = [](){
    ios_base::sync_with_stdio(false); cin.tie(0);
    cout << fixed << setprecision(12);
    return true;
}();

const double PI = acos(-1);
using ll= long long;
#define int ll
#define all(v) (v).begin(), (v).end()
#define fori(n) for(int i=0; i<int(n); i++)

#define cini(i) int i; cin>>i;
#define cins(s) string s; cin>>s;
#define cind(d) double d; cin>>d;
#define cinai(a,n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s,n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a,n) vd a(n); fori(n) { cin>>a[i]; }

using pii= pair<int, int>;
using pdd= pair<double, double>;
using vd= vector<double>;
using vb= vector<bool>;
using vi= vector<int>;
using vvi= vector<vi>;
using vs= vector<string>;

#define endl "\n"

void solve() {
    cini(d);
    cini(t);
    cini(s);

    int need=(d+s-1)/s;
    if(need>t)
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;
}

signed main() {
    solve();
}

// FIRST THINK, THEN CODE
// DO NOT JUMP BETWEEN PROBLEMS


Measured memory_bytes: 3648
#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
    double r;
    cin >> r;
    double pi = 3.141592653589;
    double S = pi*r*r;
    double C = 2*pi*r;
    printf("%f %f",S,C);
    
    return 0;
}


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

typedef long long LL;
typedef pair < int, int > PII;
typedef pair < LL, LL > PLL;

const int INF = 1000000007;
const LL INFLL = 1000000000000000007;

#define st first
#define nd second
#define pb push_back
#define _boost ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

// ***************************** CODE ***************************** //

const int MAX = 107;
const int MAX2 = 1e5 + 7;

LL waga[MAX], c[MAX];
LL dp[MAX][MAX2];

int main() {
    _boost;

    int n, w;
    cin >> n >> w;
    for(int i = 1; i <= n; i++)
        cin >> waga[i] >> c[i];

    for(int i = 1; i <= n; i++)
        for(int j = 1; j <=  w; j++)
        {
            if(waga[i] > j)
                dp[i][j] = dp[i-1][j];
            else
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-waga[i]]+c[i]);
        }

    cout << dp[n][w];
    return 0;
}


Measured memory_bytes: 79360
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef long long ll;
#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define repm(i,a,b) for(int i=(a);i>(b);i--)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
const double PI = 3.1415926535897932;
const int i_INF = 2147483647;
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() {
	ll n;
	cin >> n;
	tuple<ll, ll, ll> q[111111];
	rep(i, 0, n) {
		int a, b;
		cin >> a >> b;
		q[i] = make_tuple(-(a + b), a, b);
	}
	sort(q, q + n);
	ll sum_a = 0;
	ll sum_b = 0;
	rep(i, 0, n) {
		if (i % 2 == 0)sum_a += get<1>(q[i]);
		else sum_b += get<2>(q[i]);
		//cout << sum_a << " " << sum_b << endl;
	}
	cout << sum_a - sum_b << endl;
	return 0;
}

Measured memory_bytes: 2816
#include<unordered_map>
#include<iostream>
#include<algorithm>
#include<utility>
#include<climits>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<list>
#include<map>
#include<set>
#define inf 0x7f7f7f
#define p(x) (x)*(x)
#define PI 3.14159265358979
using namespace std;

typedef vector<vector<int> > vtype;
typedef long long ll;

int main()
{
	//ios::sync_with_stdio(false);
	int a = 0, b = 0, c = 0, d = 0;
	cin >> a >> b >> c >> d;
	int mid1 = 0, mid2 = 0;
	if(c % b)
		mid1 = c / b + 1;
	else
		mid1 = c / b;
	if(a % d)
		mid2 = a / d + 1;
	else
		mid2 = a / d;
	if(mid1 <= mid2)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
    return 0;
}















Measured memory_bytes: 3636
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = input()
    k = int(input())

    # 桁DP
    def digit_DP(S, K):
        L = len(S)
        # dp[決定した桁数][未満フラグ][０以外の数字を使った個数]
        dp = [[[0 for _ in range(4)] for _ in range(2)] for _ in range(101)]
        dp[0][0][0] = 1
        for i in range(L):  # 今見ている桁
            D = int(S[i])
            for j in range(2):  # 未満フラグ(0 or 1)
                for k in range(4):  # ０以外の数字を使った個数が0~3
                    for d in range(10 if j else D + 1):
                        cnt = k
                        if d != 0:
                            cnt += 1
                        if cnt > K:
                            continue
                        dp[i + 1][j or (d < D)][cnt] += dp[i][j][k]

        return dp[L][0][K] + dp[L][1][K]

    print(digit_DP(n, k))


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 3064
#include <iostream>
#include <numeric>
#include <vector>

int main(){
    long long n;
    std::cin >> n;

    long long before = 0;
    std::vector<long long> a(n + 1);
    for(long long i = 0; i < n + 1; ++i){
        std::cin >> a.at(i);
        before += a.at(i);
    }

    long long b, after = 0;
    for(long long i = 0; i < n; ++i){
        std::cin >> b;
        long long min = std::min(a.at(i), b);
        b -= min;
        a.at(i) -= min;
        a.at(i + 1) -= std::min(a.at(i + 1), b);
        after += a.at(i);
    }
    
    after += a.at(n);

    std::cout << before - after << std::endl;
    
    return 0;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

void check(P p);
LL ch(LL x, LL y);

map<P, bool> mp;
set<LP> st[10];
LL H, W, N;

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

    cin >> H >> W >> N;
    vector<P> v(N);
    for(int i = 0; i < N; ++i) {
        cin >> v[i].F >> v[i].S;
        mp[MP(v[i].F, v[i].S)] = true;
    }

    for(int i = 0; i < N; ++i) {
        check(v[i]);
    }

    LL z = (H - 2) * (W - 2);
    for(int i = 1; i <= 9; ++i) {
        z -= st[i].size();
    }

    cout << z << endl;
    for(int i = 1; i <= 9; ++i) {
        cout << st[i].size() << endl;
    }

    return 0;
}

void check(P p) {
    LL x, y;
    x = p.S, y = p.F;
    for(int i = max(x - 2, 1ll); i <= min(x, W); ++i) {
        for(int j = max(y - 2, 1ll); j <= min(y, H); ++j) {
            int cnt = 0;
            bool f = true;
            for(int k = i; k <= i + 2; ++k) {
                for(int l = j; l <= j + 2; ++l) {
                    if(k > W || l > H) {
                        cnt = 0;
                        f = false;
                        break;
                    }
                    if(!f) break;
                    if(mp[MP(l, k)]) ++cnt;
                }
            }
            if(cnt != 0)
                st[cnt].insert(MP(ch(i, j), ch(i + 2, j + 2)));
        }
    }

    return;
}

LL ch(LL x, LL y) {
    return W * (y - 1) + (x - 1);
}


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

using namespace std;

int main()
{
    ll n, K;
    cin >> n >> K;
    ll ans = 0;
    if(K % 2 == 0 && n >= K / 2){
        ll res = (n - K / 2) / K + 1;
        ans += res * res * res;
    }
    ll res = n / K;
    ans += res * res * res;
    cout << ans << "\n";
}

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

/**** Integer ****/
typedef long long ll;
#define int long long
/**** Integer ****/

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, r, n) for (int i = (r); i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--) // from n to 0
#define REPRS(i, r, n) for(int i = (n); i >= (r); i--) // from n to r
#define COUTB(x) cout << (x) << "\n"
#define COUTS(x) cout << (x) << " "
#define PB push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define MOD 1000000007
#define PI (acos(-1))

bool IsPrime(int);

/***** MAIN *****/
signed main() {
  string s;
  cin >> s;
  int stringLength = s.size();
  int numerical_sequence[stringLength+1];
  numerical_sequence[0] = 0;
  
  int count = 0;
  int ans = 0;
  REP(i, stringLength) {
    if(s[i] == '>') count = 0;
    else count++;
    numerical_sequence[i+1] = count;
  }
  count = 0;
 
  ans += numerical_sequence[stringLength];
  REPR(i, stringLength-1) {
    if(s[i] == '<') count = 0;
    else count++;
    ans += max(numerical_sequence[i], count);
  }
 
  cout << ans;
 
  cout << "\n";
  return 0;
}
/***** MAIN *****/

bool IsPrime(int a) {
  if(a <= 1) return false;
  if(a == 2) return true;
  if(a%2 == 0) return false;
  for(int i = 3; i*i <= a; i+=2) {
    if(a%i==0) return false;
  }
  return true;
}

Measured memory_bytes: 4740
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1e16;
const ld EPS = 1e-11;
const ld PI = acos(-1.0L);
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repe(i, l, r) for (ll i = (l); i < (r); i++)
#define reper(i, l, r) for (ll i = (r)-1; i >= (l); i--)

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

#ifdef DEBUG
template <class T, class N> void verr(const T& a, const N& n) { rep(i, n) cout << a[i] << " "; cout << "\n"; }
template<class T> void verr(const vector<T>& v){ for(auto& a : v) cout << a << " "; cout << "\n"; }
ll dbgt = 1; void err() { cout << "passed " << dbgt++ << "\n"; }
template<class H, class... T> void err(H&& h,T&&... t){ cout<< h << (sizeof...(t)?" ":"\n"); if(sizeof...(t)>0) err(forward<T>(t)...); }
#endif

void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
//--------------------------------------------------------------------------------//

int main() {
    init();
    string s;
    ll w;
    cin >> s >> w;
    ll si = 0;
    string ans;
    while(si<s.size()){
        ans += s[si];
        si += w;
    }
    cout << ans << endl;
}

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

#define pii              pair <int,int>
#define pll              pair <long long,long long>
#define sc               scanf
#define pf               printf
#define Pi               2*acos(0.0)
#define ms(a,b)          memset(a, b, sizeof(a))
#define pb(a)            push_back(a)
#define MP               make_pair
#define db               double
#define ll               long long
#define EPS              10E-10
#define ff               first
#define ss               second
#define sqr(x)           (x)*(x)
#define D(x)             cerr<<#x " = "<<(x)<<endl
#define VI               vector <int>
#define DBG              pf("Hi\n")
#define MOD              1000000007
#define CIN              ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define SZ(a)            (int)a.size()
#define sf(a)            scanf("%d",&a)
#define sfl(a)           scanf("%lld",&a)
#define sff(a,b)         scanf("%d %d",&a,&b)
#define sffl(a,b)        scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)
#define stlloop(v)       for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define loop(i,n)        for(int i=0;i<n;i++)
#define loop1(i,n)       for(int i=1;i<=n;i++)
#define REP(i,a,b)       for(int i=a;i<b;i++)
#define RREP(i,a,b)      for(int i=a;i>=b;i--)
#define TEST_CASE(t)     for(int z=1;z<=t;z++)
#define PRINT_CASE       printf("Case %d: ",z)
#define LINE_PRINT_CASE  printf("Case %d:\n",z)
#define CASE_PRINT       cout<<"Case "<<z<<": "
#define all(a)           a.begin(),a.end()
#define intlim           2147483648
#define infinity         (1<<28)
#define ull              unsigned long long
#define gcd(a, b)        __gcd(a, b)
#define lcm(a, b)        ((a)*((b)/gcd(a,b)))

using namespace std;

//using namespace __gnu_pbds;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;


/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

int ara[3000];

int main()
{

//    freopen("in.txt","r",stdin);
//	  freopen("out.txt","w",stdout);

    int ans=0;

    int n,x,w;
    cin>>n>>x>>w;
    for(int i=0;i<n;i++) cin>>ara[i];
    if(n==1)
        ans=abs(w-ara[0]);
    else
        ans=max(abs(w-ara[n-1]),abs(ara[n-1]-ara[n-2]));
    cout<<ans<<endl;

    return 0;
}


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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

const int mod = 1000000007;
constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 1000000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  while(cin >> n && n){
    vary(ll,v,n+1,0);
    rep(i,n+1){
      cin >> v[i];
    }
    rep(i,n+1){
      ll dif = imax,pre = -1;
      set<ll> s;
      rep(j,n+1){
        if(i != j){
          if(pre == -1){
            pre = v[j];
          }
          else{
            dif = v[j] - pre;
            s.insert(dif);
            pre = v[j];
          }
        }
      }
      if(s.size() == 1){
        cout << v[i]<<endl;
        break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3224
using System;

namespace ITP1_11_A
{
    class Dice
    {
        private int[,] adj = new int[6, 4] { { 2, 3, 5, 4 }, { 1, 4, 6, 3 }, { 1, 2, 6, 5 }, { 1, 5, 6, 2 }, { 1, 3, 6, 4 }, { 2, 4, 5, 3 } };
        public int Top { get; private set; }
        public int North { get; private set; }
        public Dice(int top = 1, int north = 5) { Top = top; North = north; }

        public void N()
        {
            int index = GetIndex(Top, North);
            North = Top;
            Top = adj[Top-1, (index + 2) % 4];
        }

        public void W()
        {
            int index = GetIndex(Top, North);
            Top = adj[Top-1, (index + 3) % 4];
        }
        public void S()
        {
            int index = GetIndex(North, Top);
            Top = North;
            North = adj[North-1, (index + 2) % 4];
        }
        public void E()
        {
            int index = GetIndex(Top, North);
            Top = adj[Top-1, (index + 1) % 4];
        }

        private int GetIndex(int top, int val)
        {
            for (int i = 0; i < 4; i++) if (adj[top - 1, i] == val) return i;
            throw new Exception();
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            string[] strs = Console.ReadLine().Split(' ');
            int[] a = Array.ConvertAll(strs, int.Parse);
            string cmd = Console.ReadLine();
            Dice dice = new Dice();
            foreach (var c in cmd)
            {
                switch (c)
                {
                    case 'N':dice.N(); break;
                    case 'W':dice.W(); break;
                    case 'S':dice.S(); break;
                    case 'E':dice.E(); break;
                    default: break;
                }
            }
            Console.WriteLine(a[dice.Top-1]);
        }
    }
}

Measured memory_bytes: 9152
using System;

class Compare{
      static void Main(string[] args){
      	     string[] str = Console.ReadLine().Split(' ');
	     int a = int.Parse(str[0]);
	     int b = int.Parse(str[1]);
	     if(a > b) {
               Console.WriteLine("a > b");
	     }
	     else if(a < b){
	       Console.WriteLine("a < b");
	     }
	     else {
               Console.WriteLine("a == b");
	     }
      }
}

Measured memory_bytes: 8908
import java.util.Scanner;

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

		 int[] m = new int[10];
		 int[] max = new int[3];
		 for(int i = 0; i < 10; i++){
			 m[i] = scan.nextInt();
			 if(m[i] >= max[0]){
				 max[2] = max[1];
				 max[1] = max[0];
				 max[0] = m[i];
			 }
			 else if(m[i] >= max[1]){
				 max[2] = max[1];
				 max[1] = m[i];
			 }
			 else if(m[i] >= max[2]){
				 max[2] = m[i];
			 }
		 }

		 for(int i = 0; i <= 2; i++){
			 System.out.println(max[i]);
		 }
	}
}

Measured memory_bytes: 26212
A,B,Q=map(int, input().split())
from bisect import bisect_left

S=[]
for i in range(A):
    s=int(input())
    S.append(s)
T=[]
for i in range(B):
    t=int(input())
    T.append(t)

for i in range(Q):
    x=int(input())
    sidx=bisect_left(S, x)
    tidx=bisect_left(T, x)
    if 0<=sidx<A and 0<=tidx<B:
        a1=max(S[sidx], T[tidx])-x
    else:
        a1=float("INF")
    if 0<=sidx-1<A and 0<=tidx-1<B:
        a2=max(x-S[sidx-1], x-T[tidx-1])
    else:
        a2=float("INF")
    if 0<=sidx<A and 0<=tidx-1<B:
        a3=S[sidx]-T[tidx-1]+min(S[sidx]-x, x-T[tidx-1])
    else:
        a3=float("INF")
    if 0<=sidx-1<A and 0<=tidx<B:
        a4=T[tidx]-S[sidx-1]+min(T[tidx]-x, x-S[sidx-1])
    else:
        a4=float("INF")
    #print(a1,a2,a3,a4)
    ans=min(a1,a2,a3,a4)
    print(ans)


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

long long int solve(const int k)
{
    std::vector<long long int> v[12];
    long long int cnt = 0;
    for(int i=1; i<10; i++){
        v[1].push_back(i);
        cnt++;
    }
    
    for(int i=2; i<12; i++){
        std::vector<long long int>::iterator itr = v[i-1].begin();
        while(itr != v[i-1].end()){
            int digits10 = (*itr)%10;
            long long int tmp = *itr * 10;
            long long int ans = 0;
            //cout << "tmp:" << tmp << endl;
            
            // 10の桁より-1
            if(digits10 != 0){
                cnt++;
                ans = tmp+(digits10-1);
                v[i].push_back(ans);
                //cout << cnt << ":" << ans << endl;
                if(cnt == k) return ans;
            }
            // 10の桁と等しい
            cnt++;
            ans = tmp+(digits10);
            v[i].push_back(ans);
            //cout << cnt << ":" << ans << endl;
            if(cnt == k) return ans;
            // 10の桁より+1
            if(digits10 != 9){
                cnt++;
                ans = tmp+(digits10+1);
                v[i].push_back(ans);
                //cout << cnt << ":" << ans << endl;
                if(cnt == k) return ans;
            }
            ++itr;
        }
    }
}

int main(void){
    // Your code here!
    int k;
    cin >> k;
    
    if(k < 10){
        cout << k << endl;
        return 0;
    }
    
    cout << solve(k) << endl;
    return 0;
}

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

int main(){
	string s;
	int rcnt, bcnt;
	cin >> s;
	rcnt = 0;
	bcnt = 0;
	for(int i=0; i<s.length(); i++){
		if(s[i] == '0'){
			rcnt++;
		}else{
			bcnt++;
		}
	}
	cout << min(rcnt, bcnt)*2 << endl;
	return 0;
}

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

int main()
{
    int n;
    double t, a;
    cin >> n >> t >> a;
    vector<int> h(n);
    for (int i = 0; i < n; i++)
    {
        cin >> h[i];
    }
    double min = 100000;
    int min_index = 0;
    for (int i = 0; i < n; i++)
    {
        double ans = abs((t - h[i] * 0.006) - a);
        if (min > ans)
        {
            min = ans;
            min_index = i + 1;
        }
    }
    cout << min_index << endl;
    return 0;
}

Measured memory_bytes: 3732
#include <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 2147483647
#define LLINF 9223372036854775807
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
ll gcd(ll a,ll b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll modfact(ll a){ll b=1;FOR(i,2,a)b=b*i%MOD;return b;}
ll modpow(ll a, ll n){ll b=1;while (n>0){if(n&1)b=b*a%MOD;a=a*a%MOD;n>>=1;}return b;}
ll modcomb(ll n, ll k){ll b=1;k=min(n-k,k);DOWN(i,n,n-k+1)b=b*i%MOD;return b*modpow(modfact(k),MOD-2)%MOD;}


int main() {
    vector<vector<ll>> dp(2, vector<ll>(4, 0));
    string S;cin>>S;
    dp[0][0]=S[0]=='?'?3:1;
    dp[0][1]=S[0]=='?'||S[0]=='A';
    int i=1,n,p;
    for(;i<S.size();i++) {
        n = i%2;
        p = n^1;
        FOR(j, 0, 4) {
            dp[n][j] = dp[p][j]*(S[i]=='?'?3:1);
            if(j > 0) dp[n][j]+=dp[p][j-1]*(S[i]-'A'==j-1||S[i]=='?');
            dp[n][j] %= MOD;
        }
    }
    cout<<dp[--i%2][3]<<endl;
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    int ans=n,mi=a[1];
    for(int i=2;i<=n;i++){
        if(a[i]>mi) ans--;
        mi=min(a[i],mi);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <cstdio>

int main(void)
{
	int ch;
	int chCounts[26] = {};
	while ((ch = getchar()) != EOF) {
		if ('a' <= ch && ch <= 'z') {
			chCounts[ch - 'a']++;
		}
		else if ('A' <= ch && ch <= 'Z') {
			chCounts[ch - 'A']++;
		}
	}
	for (int i = 0; i < 26; i++) {
		printf("%c : %d\n", 'a' + i, chCounts[i]);
	}
	return 0;
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

void solve() {
  int n, k; cin >> n >> k;
  string s; cin >> s;
  int ans = 0, count = 1, seps = 0;
  for (int i = 1; i < n; ++i) {
    if (s[i] == s[i-1]) ++count;
    else {
      ans += count-1;
      ++seps;
      count = 1;
    }
  }
  ans += count-1;
  ++seps;
  if ((seps-2)/2 >= k) {
    ans += k*2;
  } else {
    ans = n-1;
  }
  cout << ans;
}

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


Measured memory_bytes: 3780
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <chrono>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

template <class T1, class T2>
ostream& operator << (ostream& out, const pair <T1, T2> p)
{
    out << '(' << p.first << ',' << p.second << ')';
    return out;
}

template <class T1, class T2>
istream& operator >> (istream& in, pair<T1, T2> &p)
{
    in >> p.first >> p.second;
    return in;
}

template <class T>
istream& operator >> (istream& in, vector<T> &v)
{
    for (T &x : v)
        in >> x;
    return in;
}

template <class T>
ostream& operator << (ostream& out, const vector<vector<T>> &v)
{
    for (const vector<T> &x : v)
        out << x << '\n';
    return out;
}

template <class T>
ostream& operator << (ostream& out, const vector<T> &v)
{
    for (const T &x : v)
        out << x << ' ';
    return out;
}

long long gcd (long long a, long long b)
{
    if (b > a)
        swap(a, b);
    return (b ? gcd(b, a % b) : a);
}

using ll   = long long;
using pii  = pair<int, int>;
using pll  = pair<long long, long long>;
using tiii = pair<pair<int, int>, int>;
using vi   = vector<int>;
using vl   = vector<long long>;
using vvi  = vector<vector<int>>;
using vvl  = vector<vector<long long>>;

#define F          first
#define S          second
#define First      first.first
#define Second     first.second
#define Third      second
#define mp         make_pair
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define per(i,b,a) for (int i = (b); i > (a); i--)
#define all(x)     x.begin(), x.end()
#define ret(x)     return cout << x, 0;
#define throwex    throw runtime_error ("Found the error.");

const int h = 1000000007;

signed main()
{
    ios::sync_with_stdio(false);
    #ifdef ONLINE_JUDGE
    cin.tie(nullptr);
    cout.tie(nullptr);
    cerr.setstate(ios::failbit);
    #endif

    int n;
    cin >> n;
    vl a(n);
    cin >> a;
    ll c = 1000;
    rep(i,1,n)
    {
        if(a[i] > a[i-1])
        {
            ll y = c / a[i-1];
            c -= y * a[i-1];
            c += y * a[i];
            cerr << c << ' ';
        }
    }
    cout << c;
}


Measured memory_bytes: 3676
#include <iostream>
using namespace std;
 
#include <stdio.h>
#include <algorithm>
#include <string>

int main(void)
{
    string str;
    string command;
    string print   ="print";        //strstr ??? a??????????????? b???????????????§??????????????????
    string replace ="replace";      //strstr ??? a??????????????? b???????????????§??? p?????????????????????
    string reverse ="reverse";      //strstr ??? a??????????????? b???????????????§?????????????????????
    string p ;
    int a , b;
    int q ;
    string rrr;
    string sss;
    int s,r;
     
     
    cin >> str;
    cin >> q;
 
    s = str.length();
     
    for(int i =0; i < q ; i++){
         
        cin >> command >> a >> b;
         
        if(command == print ){
            cout << str.substr(a, (b-a+1)) << endl;
        }
        else if(command == replace){
            cin >> p ;
            str  = str.replace(a, (b-a+1), p);
        }
        else if(command == reverse ){
            rrr = str.substr(a, (b-a+1));
            sss  = rrr;
            r = rrr.length();
//          cout << rrr << endl;
            for (int j = 0 ;  j < (r/2) ; j++){
                rrr[j] = rrr[r-j-1];
                rrr[r-j-1] = sss[j];
//              cout <<rrr<< " keisango"<<endl;
            }
//          cout << str.substr(0,a) << rrr<< endl<< str.substr(b+1,s) << endl<<"fin.";
            str = str.substr(0,a)+ rrr +  str.substr(b+1,s);
        }
        else {
            //??????????????\??????
        }
//      cout << str << endl;
    }
    return 0;
}

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    long long int n; cin>>n;
    n=(n-1LL)*(n);
    n/=2LL;
    cout<<n;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum+=i+1;
		}
		System.out.println(sum);
	}

}


Measured memory_bytes: 21204
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <math.h>
using namespace std;

int main() {
    int r, g, b;
    cin >> r >> g >> b;

    cout << ((r * 100 + g * 10 + b) % 4 == 0 ? "YES" : "NO") << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
#include <cstring>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

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

    int x;
    cin >> x;
    if(x)   cout << 0 << endl;
    else    cout << 1 << endl;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
const int N=1e5+10;
const int mod=1e9+7;
typedef pair<int,int> pii;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
int n,m,x[N],y[N],l[N],r[N],st[N],top=0,c[N],id[N];
map<pii,bool> vis;
bool cmp(int a,int b) {
    return l[a]!=l[b]?l[a]<l[b]:r[a]>r[b];
}
void add(int p,int v) { while(p<=top) c[p]=(c[p]+v)%mod,p+=p&-p; }
int qry(int p) { int ret=0;while(p) ret=(ret+c[p])%mod,p-=p&-p; return ret; }
int main() {
    cin>>n>>m;
    for(int i=1;i<=n;i++) x[i]=gi();
    for(int i=1;i<=m;i++) y[i]=gi();
    int t=n;n=0;
    for(int i=1;i<=t;i++) if(x[i]>y[1]&&x[i]<y[m]) x[++n]=x[i];
    for(int i=1;i<=n;i++) {
        int p=lower_bound(y+1,y+m+1,x[i])-y;r[i]=y[p]-x[i];
        --p;l[i]=x[i]-y[p];
    }
    t=n,n=0;
    for(int i=1;i<=t;i++) if(!vis[mp(l[i],r[i])]) vis[mp(l[i],r[i])]=1,x[++n]=x[i],l[n]=l[i],r[n]=r[i];
    for(int i=1;i<=n;i++) id[i]=i;
    sort(id+1,id+n+1,cmp);
    for(int i=1;i<=n;i++) st[++top]=r[i];
    sort(st+1,st+top+1);top=unique(st+1,st+top+1)-st-1;
    for(int i=1;i<=n;i++) r[i]=lower_bound(st+1,st+top+1,r[i])-st;
    int ans=1;
    for(int i=1,x=id[i];i<=n;i++,x=id[i]) t=(qry(r[x]-1)+1)%mod,ans=(ans+t)%mod,add(r[x],t);
    printf("%d\n",ans);
    return 0;
}
//orzgzy
//鸡贼明年进队超稳


Measured memory_bytes: 8960
n = int(input())
a = list(map(int, input().split()))

ans = 1

tp = a[0]
flag = 0  # 1:inc 2:dec
for i in range(1, n):
    t = a[i]
    if (flag == 0):
        if (t > tp):
            flag = 1
        elif (t < tp):
            flag = 2
        else:
            flag = 0
    elif(flag == 1):
        if (t < tp):
            ans += 1
            flag = 0
    elif(flag == 2):
        if (t > tp):
            ans += 1
            flag = 0
    tp = t

print(ans)


Measured memory_bytes: 14252
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n) - 1; (i) >= 0; --i)
#define SZ(n) (int)(n).size()
#define ALL(n) (n).begin(), (n).end()
#define MOD LL(1e9 + 7)
#define INF 1000000
using namespace std;
using LL = long long;


int main() {
	string s;
	getline(cin, s);
	for (auto & e : s) {
		if (e >= 'a' && e <= 'z') e -= 32;
		else if (e >= 'A' && e <= 'Z') e += 32;
	}
	cout << s << endl;
	return 0;
}



Measured memory_bytes: 3160
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	vector<int> to1(n,0), toN(n,0);

	int a,b;
	for(int i=0; i<m; i++){
		cin >> a >> b;
		if(a==1){
			to1.at(b-1)=1;
		}else if(b==1){
			to1.at(a-1)=1;
		}else if(a==n){
			toN.at(b-1)=1;
		}else if(b==n){
			toN.at(a-1)=1;
		}
	}

	for(int i=0; i<n; i++){
		if(to1.at(i)==1 && toN.at(i)==1){
			cout << "POSSIBLE" << endl;
			return 0;
		}
	}
	cout << "IMPOSSIBLE" << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <deque>
#include <numeric> // accumulate(v.begin(), v.end(), 0)                                                         

using namespace std;
#define ll long long

int main(){
  int n;
  cin >> n;
  deque<int> ret;
  bool tmp;
  if(n % 2 == 0)
    tmp = false;
  else
    tmp = true;
  for(int i=0; i<n; i++){
    int in;
    cin >> in;
    if(tmp){
      ret.push_front(in);
      tmp = false;
    } else {
      ret.push_back(in);
      tmp = true;
    }
  }
  for(int i=0; i<n; i++)
    cout << ret[i] << " ";
  cout << endl;
  return 0;
}


Measured memory_bytes: 2944
// https://atcoder.jp/contests/caddi2018/tasks/caddi2018_b

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ll N;
  cin >> N;

  VL as(N);
  rep(i, N) cin >> as[i];

  bool all_even = all_of(all(as), [](ll a) { return a % 2 == 0; });

  if (all_even) {
    drop("second");
  } else {
    drop("first");
  }
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

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

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

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


Measured memory_bytes: 1024
//------------------------------------------
// C++ templete 
//------------------------------------------
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//grobal variable
//------------------------------------------
VI Vec;

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int N, M;
    cin >> N >> M;

    VS A(N), B(M);
    REP(n, N) cin >> A.at(n);
    REP(m, M) cin >> B.at(m);
    
    bool can;
    REP(i, N-M+1)
    {
        REP(j, N-M+1)
        {
            can=true;
            REP(k, M)
            {
                REP(l, M)
                {
                    if (A.at(l+k).at(j+l)!=B.at(k).at(l))
                        can=false;break;
                }
                if (can==false) break;
            }
            if (can==true) break;
        }
        if (can==true) break;
    }
    if (can) cout << "Yes" << endl;
    else cout<< "No" << endl;
  
    return 0;
}



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

int main(){
    char t[3];
    cin>>t;
    int sum=700;
    int topping=0;
    for(int i=0;i<3;i++){
        if(t[i]=='o') topping++;
    }
    sum+=topping*100;
    cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1LL<<60;
const int inf = 1e5;
//typedef long double ld;
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 dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
map<ll,ll> ma;
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int A,B,C,n;
int l[8];
int m=inf;
int rec(int i,int a, int b, int c){
  if(i==n){
    if(a==0 || b==0 || c==0) return inf;
    else return abs(A-a)+abs(B-b)+abs(C-c);
  }
  int res = rec(i+1, a,b,c);
  chmin(res, rec(i+1, a+l[i], b, c)+(a ? 10 : 0));
  chmin(res, rec(i+1, a, b+l[i], c)+(b ? 10 : 0));
  chmin(res, rec(i+1, a, b, c+l[i])+(c ? 10 : 0));
  return res;
}
int main(){
  cin >> n >> A >> B >> C;
  rep(i,0,n){
    cin >> l[i];
  }
  cout << rec(0,0,0,0) << endl;
  return 0;
}


Measured memory_bytes: 256
from math import sqrt
A, B = map(int, input().split())
def func(N):
    S = set()
    for i in range(1, int(sqrt(N))):
        if N % i == 0:
            S.add(i)
            S.add(N//i)
    if N % int(sqrt(N)) == 0:
        S.add(int(sqrt(N)))
    return S

D = sorted(list(func(A) & func(B)))
N = len(D)
check = [0]*N
for i in range(N):
    if i == 0 or check[i] == 1:
        continue
    for j in range(i+1, N):
        if D[j] % D[i] == 0:
            check[j] = 1

ans = check.count(0)
print(ans)


Measured memory_bytes: 40432