akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;

int H, W, D, Q;

int main()
{
    scanf("%d%d%d", &H, &W, &D);
    map<int, pair<int, int>> mp;
    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            int a;
            scanf("%d", &a);
            a--;
            mp[a] = make_pair(i + 1, j + 1);
        }
    }

    vector<vector<int>> calc(D);

    for (int i = 0; i < D; i++)
    {
        int L = i;
        auto p = mp[L];
        pair<int, int> q;
        for (int j = i; j <= H * W; j += D)
        {
            q = mp[j];
            calc[i].push_back(abs(p.first - q.first) + abs(p.second - q.second));
            p = q;
        }
        for (int j = 0; j + 1 < calc[i].size(); j++)
            calc[i][j + 1] += calc[i][j];
    }

    scanf("%d", &Q);
    for (int i = 0; i < Q; i++)
    {
        int L, R, sum = 0;
        scanf("%d%d", &L, &R);
        L--, R--;
        sum = calc[L % D][R / D] - calc[L % D][L / D];
        printf("%d\n", sum);
    }
}

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

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

Measured memory_bytes: 3116
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;

template <class T>
struct BIT {
    vector<T> dat;
    BIT(int n) : dat(n+1) { }
    // initialize by a constant
    BIT(int n, T a) : dat(n+1, a) {
        dat[0] = 0;
        for (int k = 1; k+(k&-k) <= n; ++k) dat[k+(k&-k)] += dat[k];
    }
    // initialize by a vector
    BIT(vector<T> y) : dat(y.size()+1) {
        for (int k = 0; k < y.size(); ++k) dat[k+1] = y[k];
        for (int k = 1; k+(k&-k) < dat.size(); ++k) dat[k+(k&-k)] += dat[k];
    }
    void add(int k, T a) {
        for (++k; k < dat.size(); k += k&-k) dat[k] += a;
    }
    T sum(int k) {
        T s = 0;
        for (; k > 0; k &= k-1) s += dat[k];
        return s;
    }
    int lower_bound(T a) {
        if (a <= 0) return 0;
        int k = dat.size()-1;
        for (int s: {1,2,4,8,16}) k |= (k >> s);
        for (int p = ++k; p > 0; p >>= 1, k |= p)
            if (k < dat.size() && dat[k] < a) a -= dat[k]; else k ^= p;
        return k+1;
    }
};

int main() {
  int N,K;
  cin >> N >> K;
  vll a(N);
  repeat(i,N){
    cin >> a[i];
    a[i] -= K;
  }
  debugArray(a,a.size());
  vll sum(N+1,0);
  repeat(i,N){
    sum[i+1] += sum[i]+a[i];
  }
  debugArray(sum,sum.size());
  vll comp(sum);
  sort(comp.begin(),comp.end());
  debugArray(comp,comp.size());
  vll c(N+1);
  repeat(i,comp.size()){
    c[i] = lower_bound(comp.begin(),comp.end(),sum[i])-comp.begin();
  }
  debugArray(c,c.size());
  BIT<ll> bit(c.size());
  ll ans = 0;
  repeat(i,c.size()){
    ans += bit.sum(c[i]+1);
    bit.add(c[i],1);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 8576
#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<algorithm>
using namespace std;

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

	vector<vector<int>> table(26, vector<int>(n, 0));
	for(int i=0; i<n; i++)
	{
		string S;
		cin >> S;

		for(auto it=S.begin(); it!=S.end(); it++)
			table[*it-'a'][i]++;
	}

	vector<int> cnt(26, 0);
	for(int i=0; i<26; i++)
		cnt[i] = *min_element(table[i].begin(), table[i].end());

	for(int i=0; i<26; i++)
	{
		char ch = 'a' + i;
		cout << string(cnt[i], ch);
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
map<int, int> mp;
map<int, int>mm;
#define ll long long

int main(void) {
    int n;
    int a, b;
    cin >> n >> a >> b;
    int p[100];
    int ac = 0, bc = 0, cc = 0;
    rep(i, n) {
        cin >> p[i];
        if (p[i] > b)cc++;
        else if (p[i] > a)bc++;
        else ac++;
    }
    cout << min(min(ac, bc), cc) << endl;


}

Measured memory_bytes: 256
import itertools
H,W,K=map(int,input().split())
c=[input() for _ in range(H)]
ans=0
for i in list(itertools.product([0,1], repeat=H+W)):
  a=0
  for j in range(H):
    if i[j]==1:
      continue
    for k in range(W):
      if i[H+k]==1:
        continue
      if c[j][k]=='#':
        a+=1
  if a==K:
    ans+=1
print(ans)

Measured memory_bytes: 9516
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 50; i++){
            int m = sc.nextInt();
            int f = sc.nextInt();
            int r = sc.nextInt();

            if(m == -1 && f == -1 && r == -1) {
                break;
            }
            if (m == -1 || f == -1){
                System.out.println("F");
            }else if(m + f >= 80) {
                System.out.println("A");
            }else if(m + f >= 65) {
                System.out.println("B");
            }else if(m + f >= 50) {
                System.out.println("C");
            }else if(m + f >= 30) {
                if(r >= 50) {
                    System.out.println("C");
                }else {
                    System.out.println("D");
                }
            }else{
                System.out.println("F");
            }
        }

    }
}



Measured memory_bytes: 26480
n = int(input())
lis = []
for i in range(n):
  lis.append(list(map(int,input().split())))
lis.sort(key = lambda tup:tup[1])
t = 0
for item in lis:
  t += item[0]
  if t >item[1]:
    print("No")
    break
else:
  print("Yes")

Measured memory_bytes: 88152
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n, a;
    cin >> n;
    map<int, int> mp;
    for (int i = 0; i < n; i++){
        cin >> a;
        mp[-a]++;
    }
    int cnt = 0;
    int ans[2];
    for (map<int, int>::iterator it = mp.begin(); it != mp.end() && cnt != 2; it++){
        while (cnt != 2 && it -> second > 1){
            mp[it -> first] -= 2;
            ans[cnt++] = it -> first;
        }
    }
    if (cnt == 2)
        cout << ans[0] * (long long) ans[1];
    else
        cout << 0;
    return 0;
}


Measured memory_bytes: 4992
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn main() {
    let v = read_vec::<usize>();
    let (n, k) = (v[0], v[1]);
    let mut sushi = Vec::new();
    for i in 0..n {
        let v = read_vec::<u64>();
        sushi.push((v[1], v[0]));
    }
    sushi.sort();

    let mut eated_count = vec![0u64; n + 1];
    let mut init_ans = 0u64;
    let mut init_kinds = 0;

    let mut poppable = Vec::new();

    for i in 0..k {
        let (d, t) = sushi.pop().unwrap();
        let t = t as usize;
        eated_count[t] += 1;
        if eated_count[t] == 1 {
            init_kinds += 1;
        } else {
            poppable.push(d);
        }
        init_ans += d;
    }
    init_ans += init_kinds * init_kinds;

    let mut cur_kinds = init_kinds;
    let mut temp_ans = init_ans;
    while let Some((d, t)) = sushi.pop() {
        let t = t as usize;
        if eated_count[t] != 0 {
            continue;
        }
        eated_count[t] += 1;
        if let Some(no_use_d) = poppable.pop() {
            temp_ans -= no_use_d;
            temp_ans += d;
            temp_ans -= cur_kinds * cur_kinds;
            cur_kinds += 1;
            temp_ans += cur_kinds * cur_kinds;
            init_ans = std::cmp::max(init_ans, temp_ans);
        } else {
            break;
        }
    }

    println!("{0}", init_ans);
}


Measured memory_bytes: 6524
import collections
n = int(input())
A = list(map(int, input().split()))
C = collections.Counter(A)
B = sorted(C.items())
t = max(C.values())
if len(B) < 3:
    for i in range(len(B)-1):
        m = B[i][1]
        if B[i+1][0] - B[i][0] < 3:
            m += B[i+1][1]
        if t < m:
            t = m
else:
    for i in range(len(B)-2):
        m = B[i][1]
        if B[i+1][0] - B[i][0] < 3:
            m += B[i+1][1]
        if B[i+2][0] - B[i][0] == 2:
            m += B[i+2][1]
        if t < m:
            t = m
print(t)

Measured memory_bytes: 16088
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Text.RegularExpressions;
using static MyIO;


public class B
{
	public static void Main()
	{
		int N = GetInt();
		int H = GetInt();
		int W = GetInt();
		int ans = 0;
		for(int i = 0; i < N; i++)
			if((GetInt() >= H) & (GetInt() >= W))
				ans++;
		Console.WriteLine(ans);
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
const int N = 55;
int a[N],b[N],c[N];
int main(){
	int n;
  	while(cin >> n){
      	int ans=0;
     	 for(int i=1;i<=n;i++)
           	cin >> a[i];
         for(int i=1;i<=n;i++)
           	cin >> b[i];
         for(int i=1;i<=n-1;i++)
           	cin >> c[i];
      	ans=b[a[1]];
      	 for(int i=2;i<=n;i++){
         	if(a[i]-a[i-1]==1)
              ans+=c[a[i-1]];
           	ans+=b[a[i]];
         }
      cout << ans << endl;
    }
   	return 0; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
vector < vector < int > > dp(105, vector < int > (2, 0));
int d;
string s;
int add(int a, int b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
  return a;
}
int sub(int a, int b) {
  a -= b;
  if (a < 0) {
    a += MOD;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  int ans = 0;
  cin >> s >> d;
  // DP[sum][f] --> numarul de moduri in care putem obtine DP[nr % d] (f == 0 daca suntem pe margine, f == 1 daca nu)
  dp[0][0] = 1;
  for (int pos = 0; pos < s.size(); pos++) {
    vector < vector < int > > new_dp(105, vector < int > (2, 0));
    for (int sum = 0; sum <= d - 1; sum++) {
        for (bool f : {0, 1}) {
          for (int cur_digit = 0; cur_digit <= 9; cur_digit++) {
            if (cur_digit > s[pos] - '0' && !f) {
              break;
            }
            new_dp[(sum + cur_digit) % d][f || (cur_digit < s[pos] - '0')] = add(new_dp[(sum + cur_digit) % d][f || (cur_digit < s[pos] - '0')], dp[sum][f]);
          }
        }
     }
     dp = new_dp;
  }
  cout << sub(add(dp[0][0], dp[0][1]) , 1) << "\n";
  return 0;
}


Measured memory_bytes: 384
#include <cstdio>

using namespace std;

template <size_t N>
struct Solver
{
    bool is_prime[N + 1];
    int ans[N + 1];
    constexpr Solver() : is_prime(), ans()
    {
        is_prime[0] = false;
        is_prime[1] = false;
        for (size_t i = 2; i <= N; i++)
        {
            is_prime[i] = true;
        }
        for (size_t prime = 2; prime <= N; prime++)
        {
            if (is_prime[prime])
            {
                for (size_t q = prime * 2; q <= N; q += prime)
                {
                    is_prime[q] = false;
                }
            }
        }
        for (size_t i = 1; i <= N; i++)
        {
            ans[i] += ans[i - 1];
            if (is_prime[i] && is_prime[(i + 1) / 2])
            {
                ans[i] += 1;
            }
        }
    }
};

int main()
{
    constexpr auto M = 100000;
    constexpr auto solver = Solver<M>();
    int Q;
    scanf("%d", &Q);
    for (size_t i = 0; i < Q; i++)
    {
        int l, r;
        scanf("%d %d", &l, &r);
        auto ans = solver.ans[r] - solver.ans[l - 1];
        printf("%d\n", ans);
    }
}


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

int main() {
  int n;
  cin>>n;
  ll a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  bool can=false;
  for(int i=0;i<n-1;i++){
    if(a[i]==a[i+1]){
      can=true;
    }
  }
  if(can) cout<<"NO"<<endl;
  else cout<<"YES"<<endl;

  return 0;
}

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

int main(){
   char a[4]={};
   int count=0,i=0;
   for(i=0;i<4;i++){
       cin>>a[i];     
 if(a[i]=='+'){
         count++;
       }else{
         count--;
      }
    }
   cout<<count<<endl;
   return 0;
}

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

using namespace std;
int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
int main()
 {
	int t, n, k;
	cin>>k;
  ll sum=0;
  for(int i=1;i<=k;i++)
    for(int j=1;j<=k;j++)
      for(int m=1;m<=k;m++)
        sum=sum+gcd(gcd(i,j),m);
  cout<<sum<<endl;
}

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

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

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  int N; cin >> N;
  
  map<int,int> cnt;
  REP(i,N){
	int x;
	cin >> x;
	cnt[x]++;
  }
  
  auto b = begin(cnt), e = end(cnt);
  --e;

  int ans = 0;
  while(true){
	while(b != e && b->SS == 1) ++b;
	while(b != e && e->SS == 1) --e;
	if(b == e){
	  if(b->SS > 1)
		ans += b->SS / 2;
	  break;
	}
	else{
	  ++ans;
	  b->SS--;
	  e->SS--;
	}
  }

  cout << N - ans*2 << endl;

  return 0;
}


Measured memory_bytes: 4992
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int N = sc.nextInt();
    String S = sc.next();
    String T = sc.next();
    StringBuilder a = new StringBuilder();
    for(int i = 0; i < N;i++){
        a.append(S.charAt(i));
        a.append(T.charAt(i));
    }
    System.out.println(a);
  }
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) 
{
    os << "{ ";
    for(auto& y : x) 
    {
        os << y << " ";
    }
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) 
{
    return os << "[" << p.ff << ", " << p.ss << "]";
}

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

    return gcd(b, a%b);
}

ll modexp(ll a, ll b, ll c)
{   
    a%=c;

    ll ans = 1;

    while(b)
    {
        if(b&1)
        {
            ans = (ans*a)%c;
        }

        a = (a*a)%c;
        b >>= 1;
    }

    return ans;
}

ll nxt()
{
    ll x;
    cin >> x;
    return x;
}

const ll L = 1e5+5;

void solve()
{
    ll n = nxt(), k = nxt();

    ll a = n%k;

    cout << min(a, k - a) << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    ll T = 1;
    // T = nxt();

    while(T--)
    {
        solve();
    }

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void) {
  int n[100], x[100], i = 0, j, k, l, m, c;
  while(1) {
    scanf("%d %d",&n[i], &x[i]);
    if(n[i] == 0 && x[i] == 0) {
      break;
    }
    if(n[i] >= 3 && x[i] >= 0 && n[i] <=100 && x[i] <= 300) {
      i++;
    }
  }
  for(j = 0; j < i; j++) {
    c = 0;
    for(k = n[j]; k > 2; k--) {
      for(l = k-1; l > 1; l--) {
        for(m = l-1; m > 0; m--){
          if((k+l+m) == x[j]) c++;
        }
      }
    }
    printf("%d\n",c);
  }
  return 0;
}


Measured memory_bytes: 2140
n = input()
t = n[len(n)-1]
if t == '2' or t == '4' or t == '5' or t == '7' or t == '9':
    print('hon')
elif t == '0' or t == '1' or t == '6' or t == '8':
    print('pon')
else:
    print('bon')

Measured memory_bytes: 9112
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define printp(x,n) for(ll i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
const ll MOD = 1e9 + 7;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll H,W;
    ll h,w;
    cin >> H >> W;
    cin >> h >> w;
    print((H-h) * (W-w));
 }

Measured memory_bytes: 256
#include<iostream>
#include"bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
    std::cout << std::fixed << std::setprecision(15);
    int N;
    cin >> N;
    vector<vector<double>> point(N, vector<double>(2));
    rep(i, N) {
        double x, y;
        cin >> x >> y;
        point.at(i).at(0) = x;
        point.at(i).at(1) = y;
    }

    vector<int> v(N);
    iota(v.begin(), v.end(), 0);

    double sum = 0;
    double Nloop = 0;
    do {
        double curx = point.at(v.at(0)).at(0);
        double cury = point.at(v.at(0)).at(1);
        double sm = 0;
        for (auto idx : v){
            sm += sqrt(pow(curx - point.at(idx).at(0), 2) + pow(cury - point.at(idx).at(1), 2));
            curx = point.at(idx).at(0);
            cury = point.at(idx).at(1);
        }
        sum += sm;
        Nloop++;
    } while (next_permutation(v.begin(), v.end()));

    cout << sum / Nloop << endl;

    return 0;
}


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

int INF=0x3f3f3f3f;


int main(){
	ios_base::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	if(n>m) cout<<n-m<<endl;
	else cout<<"0"<<endl;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]

for i in range(N):
    if A[i] % 2 == 0:
        if (A[i] % 3 == 0) or (A[i] % 5 == 0):
            pass
        else:
            print('DENIED')
            exit()
print('APPROVED')

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

using namespace std;

typedef long long ll;

int main () {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	int ans = 0;
	for (int i = 0; i < n; ++i) {
		if (a[i] >= k) {
			++ans;
		}
	}
	cout << ans;
}


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

using namespace std;

const int N = 1e5 + 2;
const int mod = 1e9 + 7;

int n;
long long dp[2][N];
vector <int> g[N];

void dfs(int v, int pr = 0){
      dp[0][v] = dp[1][v] = 1;
      for(int to : g[v]){
            if(to == pr)
                  continue;
            dfs(to, v);
            dp[0][v] = (dp[0][v] * (dp[0][to] + dp[1][to])) % mod;
            dp[1][v] = (dp[1][v] * dp[0][to]) % mod;
      }
}

int main(){
      cin >> n;

      for(int i = 1; i < n; i ++){
            int u, v;
            cin >> u >> v;
            g[u].push_back(v);
            g[v].push_back(u);
      }

      dfs(1);

      cout << (dp[0][1] + dp[1][1]) % mod;
}


Measured memory_bytes: 14208
#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <bitset>
#include <set>
#include <iomanip>
#include <functional>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'a' = 97

int main()
{
    int n, x;
    cin >> n >> x;
    int a[n];
    rep(i, 0, n) scanf("%d", &a[i]);

    ll ans = 0;
    if (x < a[0]) {
        ans += a[0] - x;
        a[0] = x;
    }
    rep(i, 1, n) {
        if (x < a[i - 1] + a[i]) {
            ans += a[i - 1] + a[i] - x;
            a[i] = a[i] - (a[i - 1] + a[i] - x);
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 640
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct node{
  int key;
  struct node *next;
  struct node *prev;
};
typedef struct node *Node;
Node head;
void delete(Node);
int main(){
  int n,i,flag,key;
  char inst[12];
  Node index;
  scanf("%d",&n);
  head = (Node *)malloc(sizeof(Node));
  head->next = head;
  head->prev = head;
  for(i=0;i<n;i++){
    scanf("%s",inst);
    if( strcmp(inst,"deleteFirst") == 0 ){
      delete(head->next);
    }
    else if( strcmp(inst,"deleteLast") == 0){
      delete(head->prev);
    }
    else{
      scanf("%d",&key);
      if( strcmp(inst,"insert") == 0){
	Node tmp;
	tmp = (Node *)malloc(sizeof(Node));
	tmp->key = key;
	tmp->next = head->next;
	head->next->prev = tmp;
	head->next = tmp;
	tmp->prev = head;
      }
      else{
	index = (Node *)malloc(sizeof(Node));
	index = head->next;
	while( index != head && index->key != key){
	  index = index->next;
	}
	if( index == head ){
	  continue;
	}
	delete(index);
      }
    }
  }
  index = head->next;
  flag = 0;
  while(index != head){
    if( flag > 0){
      printf(" ");
    }
    flag++;
    printf("%d",index->key);
    index = index->next;
  }
  printf("\n"); 
  return 0;
}
void delete(Node tmp){
  tmp->next->prev = tmp->prev;
  tmp->prev->next = tmp->next;
  free(tmp);
}

Measured memory_bytes: 31788
#include<iostream>
#include<map>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#include<algorithm>
#include<array>
#include<cmath>
#include<vector>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;

using namespace std;

typedef double Real;
const Real EPS = 1e-8;
int sign(Real d) { return d > EPS ? 1 : d < EPS ? -1 : 0; }

//define class ...

struct Point {
	Real x, y;
	Point(Real x_ = 0, Real y_ = 0):x(x_), y(y_) {}

	Point operator+(const Point &p) const {
		return Point(x + p.x, y + p.y);
	}

	Point operator-(const Point &p) const {
		return Point(x - p.x, y - p.y);
	}

	Point operator*(Real s) const {
		return Point(x * s, y * s);
	}

	Point operator/(Real s) const {
		return Point(x / s, y / s);
	}

	bool operator<(const Point &p) const {
		return sign(x - p.x) == -1 || (sign(x - p.x) == 0 && sign(y - p.y) == -1);
	}

	bool operator==(const Point &p) const {
		return sign(x - p.x) == 0 && sign(y - p.y) == 0;
	}
};

istream &operator>>(istream &is, Point &p) {
	return is >> p.x >> p.y;
}

ostream &operator<<(ostream &os, Point &p) {
	return os << '(' << p.x << ", " << p.y << ')';
}

struct Line : public array<Point, 2> { //??????
	Line(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

struct Segment : public array<Point, 2> { //??´???
	Segment(const Point &a, const Point &b) { at(0) = a; at(1) = b; }
};

struct Circle {
	Point c;
	Point r;
	Circle(const Point &c_, Real r_): c(c_), r(r_) {}
};

typedef vector<Point> Polygon;

// define function
Point rotate90(const Point &p) { // ???????¨???¨???
	return Point(-p.y, p.x);
}

Point rotate(const Point &p, Real theta) {
	const Real s = sin(theta), c = cos(theta);
	return Point(c * p.x - s * p.y, s * p.x + c * p.y);
}

Real angle(const Point &p) {
	return atan2(p.y, p.x);
}

Real norm(const Point &p) {
	return p.x * p.x + p.y * p.y;
}

Real abs(const Point &p) {
	return sqrt(norm(p));
}

Real dot(const Point &a, const Point &b) { // ??????
	return a.x * b.x + a.y * b.y;
}

Real cross(const Point &a, const Point &b) { // ??????
	return a.x * b.y - a.y * b.x;
}

bool is_parallel(const Line &a, const Line &b) {
	return sign( cross(a[1] - a[0], b[1] - b[0]) ) == 0;
} 

// define app function
Point project(const Line &l, const Point &p) {
	const Point a = p - l[0];
	const Point b = l[1] - l[0];
	return l[0] + b * (dot(a, b) / norm(b));
}


bool intersect(const Line &a, const Line &b) {
	return sign(cross(a[1] - a[0], b[1] - b[0])) != 0
			|| sign(cross(a[1] - a[0], b[1] - a[0])) == 0;
}


int main() {
	cout.setf(ios::fixed);
	cout.precision(10);
	Point p0, p1, p2;
	int q;	
	cin >> p0 >> p1;		
	cin >> q;	
	Line line = Line(p1, p0);
	rep(i, q) {
		cin >> p2;			
		Point ans = project(line, p2);
		cout << ans.x << " " << ans.y << endl;
	}

	return 0;
}

Measured memory_bytes: 1300
#include<iostream>
#include<algorithm>
#include<map>

using namespace std;
typedef long long ll;
const int N = 2e5+5; 
map<string,int>ma,mb;
string s1,s2;
int a,b;

int main(){
	cin>>s1>>s2;
	cin>>a>>b;
	ma[s1]=a;
	ma[s2]=b;
	string s;
	cin>>s;
	ma[s]--;
	cout<<ma[s1]<<' '<<ma[s2]<<endl;
	
	return 0;
}

Measured memory_bytes: 256
<?php
  
  class Scanner {
    private $arr = [];
    private $count = 0;
    private $pointer = 0;
    public function next() {
        if($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }
    public function hasNext() {
        return $this->pointer < $this->count;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
}

class out {
    public static function println($str = "") {
        echo $str . PHP_EOL;
    }
}

$sc = new Scanner();

$a1 = $sc->nextInt();
$a2 = $sc->nextInt();
$a3 = $sc->nextInt();

if($a1+$a2+$a3 >= 22){
    out::println("bust");
}
else{
    out::println("win");
}
?>

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

int main() {
	string S, T;
	cin >> S >> T;

	for (int i = 0; i < S.length(); i++) {
		if (S[i] != T[i]) {
			cout << "No" << endl;
			return 0;
		}
	}
	if (S.length() + 1 != T.length()) {
		cout << "No" << endl;
		return 0;
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 3568
import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

void main(){

    while(true){
	auto a = readln();
	if(stdin.eof()) break;
	if(a.chomp() == "0") break;
	int n =a.chomp().to!int;
	bool flg = true;
	long[4001] map;
	for(int i=0;i<n;i++){
	    auto s = readln().split().to!(long[]);
	    map[s[0]] += s[1] * s[2];
	    if(map[s[0]] - s[1]*s[2] < 1e6 && map[s[0]] >= 1e6){
		flg = false;
		writeln(s[0]);
	    }
	}
	if(flg) writeln("NA");
    }
}

Measured memory_bytes: 2672
// #define _GLIBCXX_DEBUG
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using vb = vector<bool>; using vvb = vector<vb>;
#define rep0(TMS) for (int CNT = 0; CNT < (int)(TMS); CNT++)
#define rep(CNT, GOAL) for (int CNT = 0; CNT < (int)(GOAL); CNT++)
#define rep2(CNT, START, GOAL) for (int CNT = (int)(START); CNT < (int)(GOAL); CNT++)
#define rep3(CNT, START, GOAL) for (int CNT = (int)(START); CNT > (int)(GOAL); CNT--)
#define all(CONT) begin(CONT), end(CONT)
template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
void prec(const int &DIG) { cout << fixed << setprecision(DIG); cerr << fixed << setprecision(DIG); }
template <typename T> void CERR(const T &ELEM) { cerr << ELEM; }
#define dbl(OBJ) cerr << #OBJ << ": "; CERR(OBJ); cerr << "\n"
template <typename T, typename ...Ts> void CERR(const T &FIRST, const Ts &...REST) { CERR(FIRST); cerr << ", "; CERR(REST...); }
#define dbs(...) cerr << "(" << #__VA_ARGS__ << "): ("; CERR(__VA_ARGS__); cerr << ")\n"
#define itrep(ITR, CONT) for (auto ITR = begin(CONT); ITR != end(CONT); ITR++)
template <typename T> void CERR(const vector<T> &VEC) { cerr << "{ "; itrep(ITR, VEC) { CERR(*ITR); cerr << ", "; } cerr << "}"; }
#define YN(FLG) cout << (FLG ? "YES" : "NO") << "\n"
#define Yn(FLG) cout << (FLG ? "Yes" : "No") << "\n"
#define yn(FLG) cout << (FLG ? "yes" : "no") << "\n"
const ll INF = LONG_LONG_MAX;
// const int INF = INT_MAX;
const ll MOD = 1000000007; // 998244353;


int main() {
	ll a, b, c, d; cin >> a >> b >> c >> d;
	ll ans = -INF;
	chmax(ans, a * c);
	chmax(ans, a * d);
	chmax(ans, b * c);
	chmax(ans, b * d);

	cout << ans << endl;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define N 300050
#define ll long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(),v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
using namespace std;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int a,b,c;
    cin>>a>>b>>c;
    cout<<c<<" "<<a<<" "<<b;
        return 0;
}


Measured memory_bytes: 256
n = int(input())
A = list(map(int,input().split()))
x = [0]*n
S = sum(A)
A2 = A[1::2]
x[0] = S - 2*sum(A2)
for i in range(n-1):
    x[i+1] = 2*A[i]-x[i]
print(*x)

Measured memory_bytes: 14152
#include <iostream>
#include <cstdio>
#include <cstring>
#define re register int
using namespace std;

int n,s,k=1,ans[1001];

int main()
{
	std::cin>>n;
	
	while(k*(k+1)/2<=n)
	{	
		k++;
		if(k*(k+1)/2==n)
		{
			for(re i=1;i<=k;i++)
				std::cout<<i<<endl;
			return 0;
		}
	}
	
	s=k*(k+1)/2;
	
	for(re i=1;i<=k;i++)
		if(s-i==n)
		{
			for(re j=1;j<=k;j++)
				if(j!=i)
					std::cout<<j<<endl;
			return 0;
		}
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int l=n/100;
    int r=n%100;
    if(l>=1 && l<=12)
    {
        if(r>=1 && r<=12)
        cout<<"AMBIGUOUS";
        else
        cout<<"MMYY";
    }
    else
    {
        if(r>=1 && r<=12)
        cout<<"YYMM";
        else
        cout<<"NA";
    }
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define fi first
#define se second
#define endl "\n"
#define all(v) v.begin(),v.end()
#define fastio ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0)
#define go_t int t;cin>>t;for(int tt=1;tt<=t;tt++)
#define set_ar(arr,v) memset(arr,v,sizeof(arr))
#define trace2(x, y)         cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)      cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)   cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const ll inf = 0x3f3f3f3f3f3f3f3fll;//4x10e18
const int N = 300000 , mod = 1000000007;
int main()
{
    fastio;
    string s;
    cin>>s;
    for(int i=0;i<3;i++)cout<<s[i];
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
using namespace std;
typedef vector<string> vs;

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

vs dfs(vs map, int nx, int ny) {
	map[nx][ny] = '0';
	for (int i=0; i<12; i++) {
		if (nx+dx[i]>=0&&nx+dx[i]<8&&
				ny+dy[i]>=0&&ny+dy[i]<8&&
				map[nx+dx[i]][ny+dy[i]]=='1') {
			map = dfs(map, nx+dx[i], ny+dy[i]);
		}
	}
	return map;
}

int main() {
	int n; cin >> n;
	for (int i=0; i<n; i++) {
		vs map(8);
		for (int j=0; j<8; j++) cin >> map[j];
		int x, y;
		cin >> x >> y;
		map = dfs(map, y-1, x-1);
		cout << "Data " << i+1 << ":" << endl;
		for (int j=0; j<8; j++) cout << map[j] << endl;
	}
}

Measured memory_bytes: 0
//In the Name of God
//Let Our Voices Echo
#include<bits/stdc++.h>
using namespace std;
#define X real()
#define Y imag()
typedef long long ll;
typedef double ld; 
typedef complex<ld> point;
const ld eps=1e-9;
const int MAX=1e5+9,MOD=1e9+7;
pair<int,int> sr[MAX];
vector<int> g[MAX];
int n,be[MAX],a[MAX];
int main()
{
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n;
	for (int i=0;i<n;i++) be[i]=1;
	for (int i=0;i<n;i++) cin>>a[i],sr[i]={a[i],i};
	for (int i=1,v,u;i<n;i++) cin>>v>>u,v--,u--,g[v].push_back(u),g[u].push_back(v);
	sort(sr,sr+n);
	for (int _=0;_<n;_++)
	{
		int j=sr[_].second;
		be[j]=0;
		for (auto u:g[j])
		{
			if (a[u]>=a[j]) continue;
			if (!be[u])	
				be[j]=1;
		}
	}
	for (int i=0;i<n;i++) if (be[i]) cout<<i+1<<' ';
	return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int A,B,H,M;
	cin >> A >> B >> H >> M;
	auto th1 = 2*M_PI/60/12*(H*60+M);
	auto th2 = 2*M_PI/60*M;
	auto p1 = complex<double>(A*cos(th1), A*sin(th1));
	auto p2 = complex<double>(B*cos(th2), B*sin(th2));
	printf("%.15f\n", abs(p1-p2));
}


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

class Main{

	public static void main(String[] args) throws Exception{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] line = br.readLine().split(" ");
		int a = Integer.parseInt(line[0]);
		int b = Integer.parseInt(line[1]);

		if(a > b){
			System.out.println("a > b");
		}else if(a < b){
			System.out.println("a < b");
		}else if(a == b){
			System.out.println("a == b");
		}

	}
}

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

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

	int x,y;
	cin>>x>>y;

	// a + b = x;
	// 2 * (x-b) + 4 * b = y
	// 2 * x - 2 b + 4 b = y
	// 2 * b = y - 2 *x

	int val = y - 2 * x;
	if( val >= 0 and val % 2 == 0 ){
		int b = val/2;
		int a = x - b;
		if( a >= 0 and b >= 0 ){
			cout<<"Yes\n";
		}else{
			cout<<"No\n";
		}
	}else{
		cout<<"No\n";
	}

	return 0;
}


Measured memory_bytes: 3652
/*"Success isn't permanent, failure isn't fatal,
                                      it's the courage to continue that counts"*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back     
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN
const int mod=1e9+7;         
const int N=2e5+4;

int main()
{
	int x,y,a,b,c;

	scn(x); scn(y); scn(a); scn(b); scn(c);

	vector<pair<int,int>> v;

	rep(i,0,a)
	{
		int val; scn(val);

		v.emplace_back(val,3);
	}

	rep(i,0,b)
	{
		int val; scn(val);

		v.emplace_back(val,2);
	}

	rep(i,0,c)
	{
		int val; scn(val);

		v.emplace_back(val,1);
	}

	sort(v.rbegin(),v.rend());

	ll ans=0; int cnt=0,xx=0,yy=0;

	rep(i,0,(int)v.size())
	{
		if(xx+cnt+yy==x+y)
		break;

		if(v[i].S==1)
		cnt++,ans+=v[i].F;
		else if(v[i].S==3 and xx<x)
		xx++,ans+=v[i].F;
		else if(v[i].S==2 and yy<y)
		yy++,ans+=v[i].F;
	}

	lpri(ans);

    return 0;
}

Measured memory_bytes: 6512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using p = pair<int,int>;
const long long inf = 1000000001; // const 書き換え禁止
const double PI = 3.14159265358979323846; //M_PI はライブラリ


int main(void){
    int bingo[3][3];
    rep(i,3){
        rep(j,3){
            cin >> bingo[i][j];
        }
    }
    int n;
    cin >> n;
    int b[n];
    rep(i,n){
        cin >> b[i];
    }

    bool appear[3][3];
    rep(i,n){
        rep(j,n){
            appear[i][j] = false;
            rep(k,n){
                if(bingo[i][j] == b[k]){
                    appear[i][j] = true;
                }
            }
        }
    }

    string ans = "No";
    //行でのビンゴになっているかどうか
    rep(i,3){
        if(appear[0][i] && appear[1][i] && appear[2][i]){
            ans = "Yes";
        }
    }
    //列でのビンゴになっているかどうか
    rep(i,3){
        if(appear[i][0] && appear[i][1] && appear[i][2]){
            ans = "Yes";
        }
    }
    //斜めでのビンゴの判定
    if(appear[0][0] && appear[1][1] && appear[2][2]){
        ans = "Yes";
    }
    if(appear[0][2] && appear[1][1] && appear[2][0]){
        ans = "Yes";
    }
    cout << ans << endl;
}

Measured memory_bytes: 3600
// Tarun IIITA
//Тарун Асудани 
//Не читайте этот код
 
#include<bits/stdc++.h>
using namespace std;
#define ll   long long
#define pb push_back
#define pf push_front
#define MP make_pair
#define all(v) v.begin(),v.end()
#define F first
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define S second
#define P pair<ll,ll>
#define vect vector<ll>
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL)
#define mod  1000000007
#define int  long long


void solve(){
   int a,b,c;
   cin>>a>>b>>c;
   int k;
   cin>>k;
   int flag=0;
   while(k--){
      if(c>b && b>a){
         flag=1;
         break;
      }
      if(b<=a){
         b = b*2;
      }
      else if(c<=b){
         c = c*2;
      }
   }
   if(c>b && b>a){
         flag=1;
      }
   if(flag)
   cout<<"Yes";
   else
   {
      cout<<"No";
   }
   
}



signed main(){
   boost;
   int t=1;
   //cin>>t;
   while(t--){
      solve();
   }
}


Measured memory_bytes: 3644
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    D = [int(input()) for i in range(n)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    Dsort = sorted(D)
    cnt = 1
    for i in range(1, n):
        if Dsort[i] > Dsort[i-1]:
            cnt += 1

    print(cnt)
resolve()

Measured memory_bytes: 38256
def pff(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1: pf[m] = 1
    return pf
def examC():
    N, P = LI()
    d = pff(P)
#    print(d)
    ans = 1
    for key,i in d.items():
        ans *= key**(i//N)
    print(ans)
    return

def examD():
    N = I()
    A = [I() for _ in range(N)]
    ans = "second"
    for i in A:
        if i%2==1:
            ans = "first"
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examD()


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

int main()
{
    int C_X,C_Y,H,k;
    int N,x[101],y[101],h[101],flat=0;
    cin>>N;
    for(int i=0; i<N; i++)
    {
        cin>>x[i]>>y[i]>>h[i];
        if(h[i]!=0)
            k=i;
    }
    for(C_X=0; C_X<=100; C_X++)
    {
        for(C_Y=0; C_Y<=100; C_Y++)
        {
            H=h[k]+abs(x[k]-C_X)+abs(y[k]-C_Y);
            if(h[0]==max(H-abs(x[0]-C_X)-abs(y[0]-C_Y),0))
            {
                int j;
                for(j=1; j<N; j++)
                {
                    if(h[j]!=max(H-abs(x[j]-C_X)-abs(y[j]-C_Y),0))
                        break;
                }
                if(j==N)
                {
                    flat=1;
                    printf("%d %d %d\n",C_X,C_Y,H);
                    break;
                }
            }
        }
        if(flat==1)
            break;
    }
}


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

int main(){
  int a,b,x;
  cin >> a >> b;
  if(b < 10){
    a *= 10;
  }
  else if(b < 100){
    a *= 100;
  }
  else if(b == 100){
    a *= 1000;
  }
  x = a + b;
  rep(i,340){
    if(x == i*i){
      cout << "Yes";
      return 0;
    }
    if(x < i*i){
      cout << "No";
      return 0;
    }
  }
}

Measured memory_bytes: 256
using System;

namespace ConsoleApp108
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            n = n % 10;
            switch (n )
            {
                case 2:
                case 4:
                case 5:
                case 7:
                case 9:
                    Console.WriteLine("hon");
                    break;
                case 0:
                case 1:
                case 6:
                case 8:
                    Console.WriteLine("pon");
                    break;
                default:
                    Console.WriteLine("bon");
                    break;

            }
        }
    }
}

Measured memory_bytes: 27212
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e18+7;

int M,K;
int a[300000];

int main(){ 

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

cin>>M>>K;

if(M==0){
	if(K==0){
		cout<<0<<" "<<0<<endl;
	}
	else{
		cout<<-1<<endl;
	}
	return 0;
}
if(M==1){
	if(K==0){
		cout<<0<<" "<<0<<" "<<1<<" "<<1<<endl;
	}else{
		cout<<-1<<endl;
	}
	return 0;
}

int mm=pow(2,M)-1;

if(K<=mm){
	for(int i=0; i<=mm; i++){
		if(i==K) continue;
		cout<<i<<" ";
	}
	cout<<K<<" ";
	for(int i=mm; i>=0; i--){
		if(i==K) continue;
		cout<<i<<" ";
	}
	cout<<K<<endl;
}else{
	cout<<-1<<endl;
}


}


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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

double power(double x, ll n) {
    double res = 1;
    for (; n > 0; n >>= 1) {
        if (n & 1) res *= x;
        x *= x;
    }
    return res;
}

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif

    ll N, K;
    cin >> N >> K;

    double ans = 0;
    for (ll a = 1; a <= N; a++) {
        ll t = a;
        ll cnt = 0;
        while (t < K) {
            t *= 2;
            ++cnt;
        }
        ans += power(0.5, cnt);
    }

    ans /= (double)N;
    cout << setprecision(20) << ans << endl;

    return 0;
}

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

/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
int dp[120][10200] = {};
int main() {
	int N;
	cin >> N;
	double T, A;
	cin >> T >> A;
	double abss = 10000000;
	int k = 0;
	for (int i = 0; i < N; i++) {
		double a;
		cin >> a;
		if (A > T - a * 0.006) {
			if (abss >= (A - T + a * 0.006)) {
				abss = (A - T + a * 0.006);
				k = i + 1;
			}
		}
		else {
			if (abss >= (T - a * 0.006 - A)) {
				abss = (T - a * 0.006 - A);
				k = i + 1;
			}
		}
	}
	cout << k;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int inf = 1e9;
double pi = 3.14159265359;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, b, a) for (int i = a - 1; i >= b; i--)
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

const int mod = 1e9 + 7;
int h, w;
int dp[1005][1005];
char a[1005][1005];

int main() {
    cin >> h >> w;
    rep (i, 0, h) rep (j, 0, w) cin >> a[i][j];
    rep (i, 0, h) rep (j, 0, w) dp[i][j] = 0;
    dp[0][0] = 1;
    rep (i, 0, h) {
        rep (j, 0, w) {
            if (a[i][j] == '#') {
                dp[i][j] = 0;
                continue;
            }
            if (i > 0 && j > 0) dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
            else if (j > 0 && i == 0)
                dp[i][j] = dp[i][j - 1];
            else if (i > 0 && j == 0)
                dp[i][j] = dp[i - 1][j];
        }
    } /*
     rep (i, 0, h) {
         rep (j, 0, w) { cout << dp[i][j] << " "; }
         cout << "\n";
     }*/
    cout << dp[h - 1][w - 1] << "\n";
}

Measured memory_bytes: 5120