akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <cassert>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <type_traits>
#include <fstream>

typedef long long ll;
const ll INF = (ll)1e18 + 1;

template<typename Head> void print(Head head){ std::cout << head << std::endl; }
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail)
{
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...); // or print(tail...);
}
template<typename Iterator> void printVec(Iterator begin, Iterator end)
{
  for (Iterator it = begin; it != end; it++) {
    std::cout << "[" << it - begin << "] " << *it << " ";
    if ((it - begin) % 20 == 19 || it == end - 1) { std::cout << std::endl; }
  }
}

int main()
{
  ll N;
  std::cin >> N;

  std::vector<ll> vcnt(5, 0LL);

  std::vector<std::string> vs(N, "");
  for (ll i = 0; i < N; i++) {
    std::cin >> vs[i];
    if (vs[i][0] == 'M') { vcnt[0]++;}
    if (vs[i][0] == 'A') { vcnt[1]++;}
    if (vs[i][0] == 'R') { vcnt[2]++;}
    if (vs[i][0] == 'C') { vcnt[3]++;}
    if (vs[i][0] == 'H') { vcnt[4]++;}
  }

  //printVec(vcnt.begin(), vcnt.end());

  ll ans = 0;
  for (ll S = 0; S < std::pow(2, 5); S++) {
    ll calc = 1;
    ll cnt = 0;
    ll state = S;
    for (ll i = 0; i < 5; i++) {
      if (state % 2 == 1) {
	cnt++;
	calc *= vcnt[i];
      }
      state /= 2;
    }
    if (cnt == 3) {
      ans += calc;
    }
  }

  print(ans);
  return 0;
}


Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
long long n,k,ans=0,cnt=0;
string s,t;
int main(){
	cin >> n >> k;
	long long a[n];
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	ans++;
	n-=k;
	ans+=n/(k-1);
	if(n%(k-1)!=0){
		ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>
using namespace std;

int n;
string s;
string str;
int cnt;

bool check(){
	//何文字目から
	for(int i=0;i<str.size();i++){
		//何文字間隔か
		for(int j=1;j<=100;j++){
			//確認
			bool f=true;
			for(int k=0;k<s.size();k++){
				if(str.size()<=i+k*j)f=false;
				else{
					if(s[k]==str[i+k*j]);
					else f=false;
				}
			}
			if(f)return true;
		}
	}
	return false;
}

int main(void){
	scanf("%d",&n);
	cin >> s;
	for(int i=0;i<n;i++){
		cin >> str;
		if(check())cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}

Measured memory_bytes: 1228
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>
#include <iterator>
using namespace std;
// #include "prettyprint.hpp"

typedef long long ll;

int main()
{
    string S;
    cin >> S;
    int SIZE = S.size();

    string bw = "0", wb = "1";
    for (int i = 1; i <= SIZE; ++i)
    {
        if (i % 2 == 1)
        {
            bw += "1";
            wb += "0";
        }
        else
        {
            bw += "0";
            wb += "1";
        }
    }

    int bw_diff = 0, wb_diff = 0;

    for (int i = 0; i < SIZE; ++i)
    {
        if (S[i] != bw[i])
        {
            bw_diff++;
        }
        else if (S[i] != wb[i])
        {
            wb_diff++;
        }
    }

    cout << min(bw_diff, wb_diff) << endl;

    // cout << bw << endl;
    // cout << wb << endl;

    return 0;
}

Measured memory_bytes: 768
s = input()
n = len(s)
alph = "abcdefghijklmnopqrstuvwxyz"
to_int = {}
for i in range(n):
    to_int[alph[i]] = i

set_ = set([])
for i in range(n):
    set_.add(s[i])

for char in alph:
    if char not in set_:
        print(s + char)
        exit()

for i in range(n)[::-1]:
    ii = to_int[s[i]]
    for j in range(ii+1, 26):
        if alph[j] not in set_:
            print(s[0:i] + alph[j])
            exit()
    set_.remove(s[i])
print(-1)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define ll unsigned long long
#define TT 100000000
#define MAXN 100010
using namespace std;
int K;
int dist[MAXN];
deque <int> dq;
int main() {
	cin >> K;
	memset(dist, 0x3f, sizeof dist);
	dist[1] = 0;
	dq.push_back(1);
	while (!dq.empty()) {
		int cur = dq.front();
		dq.pop_front();
		int n1 = (cur + 1) % K, n2 = (cur * 10) % K;
		if (dist[cur] + 1 < dist[n1]) {
			dist[n1] = dist[cur]  + 1;
			dq.push_back(n1);
		}	
		if (dist[cur] < dist[n2]) {
			dist[n2] = dist[cur];
			dq.push_front(n2);
		}
	}
	cout << dist[0] + 1 << "\n";
} 

Measured memory_bytes: 896
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    p = list(map(int, input().split()))
    res = 0
    for i in range(n-2):
        a = [p[i], p[i+1],p[i+2]]
        a.sort()
        if p[i+1] == a[1]:
            res += 1
    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
import math
a, b, n = [int(a) for a in input().split()]

def calc(a, b, x):
    # print(a, b, x, math.floor(a*x/b), math.floor(x/b))
    return math.floor(a*x/b) - a * math.floor(x/b)
    
ans = 0
max_x = b
if b > n:
    max_x = n
for x in range(1, max_x+1)[::-1]:
    r = calc(a, b, x)
    if r > ans:
        ans = r
        break

print(ans)

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

int main() {
    int D; cin >> D;
    if (D == 25) cout << "Christmas" << endl;
    else if (D == 24) cout << "Christmas Eve" << endl;
    else if (D == 23) cout << "Christmas Eve Eve" << endl;
    else if (D == 22) cout << "Christmas Eve Eve Eve" << endl;
}

Measured memory_bytes: 256
#include <stdio.h> 
 #include <math.h> 
 #define MAX 1000 
 
 
 int main(){ 
     int n; 
     int i, j=0, sum; 
     int score[MAX]; 
     double ave, tmp; 
     double dev[MAX]; 
 
 
     while(1){ 
         scanf("%d", &n); 
         if(n==0)break; 
         sum=0; 
         for(i=0;i<n;i++){ 
             scanf("%d", &score[i]); 
             sum+=score[i]; 
         } 
         ave=(double)sum/(double)n; 
         tmp=0.0; 
         for(i=0;i<n;i++){ 
             tmp+=pow(score[i]-ave, 2); 
         } 
         dev[j++]=sqrt(tmp/(double)n); 
     } 
     for(i=0;i<j;i++){ 
         printf("%f\n", dev[i]); 
     } 
     return 0; 
 } 



Measured memory_bytes: 2044
#include <stdio.h>

#define NODEMAX 100000

struct Node {
  int parent;
  int lchild;
  int rsib;
};
  
int main()
{
  int i, j, n, id, nchildren, lchildID, depth;

  struct Node T[NODEMAX];

  scanf("%d",&n);

  for(i = 0; i < n; i++) {
    T[i].parent = -1;
  }
  
  for(i = 0; i < n; i++) {
    scanf("%d%d",&id,&nchildren);   
    if(nchildren > 0) {
      scanf("%d",&lchildID);
      T[id].lchild = lchildID;
      T[lchildID].parent = id;
      for(j = 0; j < nchildren-1; j++) {
        scanf("%d",&T[lchildID].rsib);
        lchildID = T[lchildID].rsib;
	T[lchildID].parent = id;
      }
      T[lchildID].rsib = -1;
    }
    else T[id].lchild = -1;     
  }


  for(i = 0; i < n; i++) {
    depth = 0;
    id = i;
    while(T[id].parent >= 0) {
      id = T[id].parent;
      depth++;
    }
    printf("node %d: parent = %d, depth = %d, ", i, T[i].parent, depth);
    if(T[i].parent < 0) printf("root, ");
    else if(T[i].lchild < 0) printf("leaf, ");
    else printf("internal node, ");

    printf("[");
    id = T[i].lchild;
    if(id >= 0)  {
      printf("%d",id);
      while(T[id].rsib >= 0) {
        id = T[id].rsib;
        printf(", %d",id);
      }
    }
    printf("]\n");
  }
  
  return 0;
}




Measured memory_bytes: 2900
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <tuple>

using ull = unsigned long long;
using ll = long long;
using namespace std;

int main(void) {
    int H, W;
    cin >> H >> W;
    // vector<vector<int>> S(H, vector<int>(W, 0));
    vector<string> S(H);

    vector<int> dx {1, 0, -1, 0};
    vector<int> dy {0, 1, 0, -1};

    for (int i = 0; i < H; ++i) {
        cin >> S[i];
    }

    ll ans = 0;
    for (int x = 0; x < H; ++x) {
        for (int y = 0; y < W; ++y) {
            // cout << x << "," << y << endl;

            if (S[x][y] == '#') {
                continue;
            }

            vector<vector<int>> found(H+1, vector<int>(W+1, 0));
            // found[x][y] = 1;

            queue<tuple<int, int, int>> q;
            tuple<int,int, int> sp = make_tuple(x, y, 0);
            q.push(sp);

            while (!q.empty()) {
                // cout << q.size() << endl;
                auto check = q.front();
                int xx = get<0>(check);
                int yy = get<1>(check);
                // cout << "inner:" << xx << "," << yy << endl;
                q.pop();

                if (found[xx][yy] != 0) {
                    continue;
                } else {
                    found[xx][yy] = 1;
                }
                int length = get<2>(check);
                // cout << length << endl;

                if (length > ans) {
                    ans = length;
                }


                for (int i = 0; i < 4; ++i) {
                    int nx = dx[i] + xx;
                    int ny = dy[i] + yy;

                    if (nx < 0 || nx >= H || ny < 0 || ny >= W || S[nx][ny] == '#') {
                        continue;
                    }
                    tuple<int,int,int> nn = make_tuple(nx, ny, length + 1);
                    // cout  << "gen a tuple: " << nx << ", " << ny << ", " << length + 1 << endl;
                    q.push(nn);
                }
            }
        }
    }
    

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

Measured memory_bytes: 3632
#require 'prime'
#require 'openssl'
MOD=10**9+7;  cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.chomp.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def ar2(s1,s2,de=nil) Array.new(s1){Array.new(s2,de)} end
def ar3(s1,s2,s3,de=nil) Array.new(s1){Array.new(s2){Array.new(s3,de)}} end

def desc(ar) ar.sort!{|x,y| y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+).to_i end
def ceil(a,b) (a.to_f/b).ceil end

def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end
def rui(ar) s=[0]; ar.size.times{|i| s<<s[-1]+ar[i]}; s end
def rev_rui(ar) s=[0]; ar.size.times.reverse_each{|i| s<<s[-1]+ar[i]}; s end

def puts_yesno(b) puts(b ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def pu(h) begin; require './../nemi_lib/debug.rb'; puts_val(h); rescue LoadError; end; end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n=gi
a=gsmi
a.each do |aa|
  h[aa]+=1
end

ar=desc h.to_a
ans=[]
ar.each do |num,cnt|
  if cnt>=4
    ans<<num
    ans<<num
  elsif cnt>=2
    ans<<num 
  end
  break if ans.size>=2
end
putsend 0 if ans.size<2
puts ans[0]*ans[1]

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

typedef long long ll;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back

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

const int MOD = 1000000007;

// int max = *std::max_element(vec.begin(), vec.end());
// int sum = accumulate(list, list + size, 0);

int main()
{
    ll sum = 0;
    ll cnt = 0;
    string s; cin >> s;
    ll len = s.length();
    rep (i, len) {
        if (s[i] == 'B') {
            cnt++;
        } else {
            sum += cnt;
        }
    }
    cout << sum << endl;
} 


Measured memory_bytes: 640
/// kAAzuki Hoshino
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

 

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  for(int i=0;i<n;i++){
    cout<<s[i]<<t[i];
  }
  cout<<endl;
  

return 0;
}
///....


Measured memory_bytes: 256
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define mem(a,b) memset(a,b,sizeof(a))
#define  For(i,a,b) for(int i=a,i##E=b;i<=i##E;++i)
#define rFor(i,a,b) for(int i=a,i##E=b;i>=i##E;--i)
using namespace std;
typedef long long LL;
template<typename T>inline bool chkmin(T &a,const T &b){return a>b?a=b,1:0;}
template<typename T>inline bool chkmax(T &a,const T &b){return a<b?a=b,1:0;}
template<typename T>inline void read(T &x)
{
	x=0;int _f(0);char ch=getchar();
	while(!isdigit(ch))_f|=(ch=='-'),ch=getchar();
	while( isdigit(ch))x=x*10+ch-'0',ch=getchar();
	x=_f?-x:x;
}
inline void file()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
#endif
}
char s[100];
int main()
{
	scanf("%s",s);
	if(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I')puts("Yes");
	else puts("No");
	return 0;
}


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

int main(){
	int D;
	long G;
	cin>>D>>G;
	vector<int> p(D);
	vector<long> c(D);
	for(int i=0;i<D;++i){
		cin>>p[i]>>c[i];
	}
	
	queue<vector<int> >q;
	vector<int> status(D+1,0);
	q.push(status);
	int ans=3000;
	while(!q.empty()){
		status=q.front();
		/*
		for(int i=0;i<status.size();++i){
			cout<<status[i]<<" ";
		}
		cout<<endl;
		*/
		q.pop();
		if(status[D]!=D){
			status[D]++;
			q.push(status);
			status[status[D]-1]=1;
			q.push(status);
			continue;
		}
		else{
			long score=0;
			int tmp=0;
			int maxindex=0;
			for(int i=0;i<D;++i){
				if(status[i]==1){
					tmp+=p[i];
					score+=100*(i+1)*p[i]+c[i];
				}
				else maxindex=i;
			}
			if(score>=G){
			}
			else if(score<G && score+100*(maxindex+1)*p[maxindex]>=G){
				if((G-score)%((maxindex+1)*100)==0)tmp+=(G-score)/((maxindex+1)*100);
				else tmp+=(G-score)/((maxindex+1)*100)+1;
			}
			else continue;
			if(ans>tmp)ans=tmp;
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <string.h>

int main() {
    int i, j, n, len, k;
    char s[201], c[201];

    while(1) {
        scanf("%s", s);
        if (s[0] == '-') break;
        scanf("%d", &n);

        len = strlen(s);

        for (i = 0; i < n; i++) {
            scanf("%d", &k);
            strcpy(c, &s[k]);
            for (j = 0; j < k; j++) {
                c[len - k + j] = s[j];
            }
            c[len] = '\0';
            strcpy(s, c);
        }
        printf("%s\n", c);
    }

    return 0;
}



Measured memory_bytes: 2120
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>

#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
//#define int long long
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int>> vii;
const int N = 2 * (1e5 + 1);
const int INF = 1e9 + 5;
const long long MOD = 1e9 + 7;

int32_t main() {
    FAST_IO;
    int n;
    cin >> n;
    int a[n];
    int s = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        s += a[i];
    }
    int m;
    cin >> m;
    while (m--) {
        int p, x;
        cin >> p >> x;
        p--;
        cout << s + x - a[p] << "\n";
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ALL(A) (A).begin(),(A).end()
#define ll long long
const ll mod = 1e9+7;
const ll INF = 2*1e18;
const int inf = 1e9+7;

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	string s;
	cin >> s;
	int ans = 1;
	for(int i=1;i<N;i++){
		if(s[i]==s[i-1])continue;
		ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define ll long long
#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;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }


using namespace std;

int main(){
    ll H;
    cin >> H;
    ll c = 0;
    while(H > 1) {
        H /= 2;
        c++;
    }
    ll ans = 1;
    rep(i, c+1) {
        ans *= 2;
    }
    cout << ans - 1 << endl;
}

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

using ll=long long;
const ll z=0;

int main() {
  ll D,N;
  cin >> D >> N;
  if(N!=100)
  	cout << N*pow(100,D) << endl;
  else if(D!=2)
    cout << 101*pow(100,D) << endl;
  else
    cout << 1010000 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;

P f(int x){
  int a=x%10;
  int b=0;
  while(x){
    b=x;
    x/=10;
  }
  return P(a,b);
}


int main(){
  int n;
  cin >> n;
  map<P,int> ab;
  for(int i=1;i<=n;++i){
    P p=f(i);
    ab[p]++;
  }
  long long ans=0;
  for(int i=1;i<=n;++i){
    P p=f(i);
    P q(p.second,p.first);
    ans+=ab[q];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_d
// TODO: try to AC
// DP使ってやればできそうなんだけど、相変わらず更新のイメージがうまくもてない
// 変数が多すぎて頭がこんがらがってる

fun main() {
    msolutions2020d()
}

fun msolutions2020d() {
    val n = readLine()!!.toInt()
    val kabuka = readLine()!!.split(" ").map { it.toInt() }
    val cash = IntArray(n + 1) { 0 }
    val kabu = IntArray(n + 1) { 0 }
    val total = IntArray(n + 1) { 0 }
    var current = 1000L
    for (i in 1 until n) {
        if (kabuka[i] > kabuka[i - 1]) {
            val buy = current / kabuka[i - 1]
            current += (kabuka[i] - kabuka[i - 1]) * buy
        }
    }
    println(current)
}


Measured memory_bytes: 36476
def resolve():
	x = 0
	n = input()
	s = input()
	m = 0
	for i in s:
		if i == 'I':
			x += 1
			m = max(m, x)
		elif i == 'D':
			x -= 1
			m = max(m, x)
	print(m)
resolve()

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long X,Y,Z;
    cin >> X >> Y >> Z;
    cout << ((X - Z)) / (Y+Z) << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

    int N = 0;
    cin >> N;

    std::vector<int> h(N + 1,0);

    for(int i = 0; i < N; i++){
        cin >> h[i];
    }

    int total = 0;
    int start = 0;
    //int end = 0;
    for(;;){
        if(h[start] == 0){
            start++;
            if(start == N){
                std::cout << total << std::endl;
                break;
            }
        }else{
            for(int i = start; i < N + 1; i++){
                if(h[i] == 0){
                    total ++;
                    break;
                }
                h[i]--;
            }         
        }
    }
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


    class Program
    {
        static void Main(string[] args)
        {
          string Input = Console.ReadLine();
          bool flag = false;
          for(int i = 0; i < Input.Length; i++)
          {
            if(Input[i] == '7')
            {
              flag = true;
            }
          }
          
          if(flag)
          {
            Console.WriteLine("Yes");
          }
          else
          {
            Console.WriteLine("No");
          }
        }
    }



Measured memory_bytes: 17340
N=int(input())
A=[]
m=0
for i in range(N):
        A.append(int(input()))
        m=max(A[i],m)
s=A
s = sorted(A)
for i in range(N):
        if m == A[i]:
                print(s[N-2])
        else:print(s[N-1])

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

const int N = 1e5+5;
const int M = 1e9+7;
int n,m;
int dp[N];
bitset<N> f;

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

    cin >> n >> m;
    for(int i=1;i<=m;i++){
        int x;cin>>x;f[x]=1;
    }

    for(int i=0;i<=n;i++){
        if(i == 0){
            dp[i] = (f[i] ? 0 : 1);
        }else if(i == 1){
            dp[i] = (f[i] ? 0 : dp[i-1]);
        }else{
            dp[i] = (f[i] ? 0 : dp[i-1] + dp[i-2]);
            dp[i] %= M;
        }
    }

    cout << (dp[n]%M+M)%M << "\n";



    return 0;
}


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

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long

typedef pair<ll, ll> P;

int main(){
    ll h, w;
    cin >> h >> w;
    ll ans = INF_LL;
    ll tmp_max = 0, tmp_min = INF_LL;

    /* h */
    REPN(i, 1, h) {
        ll a, b, c;
        int nokori_h = h - i;
        a = i * w;

        /* 縦に切る */
        if(w % 2 == 0) {
            b = c = nokori_h * w/2;
        } else {
            b = nokori_h * (w+1)/2;
            c = nokori_h * (w-1)/2;
        }

        tmp_max = max(a, b);
        tmp_min = min(a, c);
        ans = min(ans, tmp_max - tmp_min);

        /* 真横に切る */
        if(nokori_h == 1) continue;
        if(nokori_h % 2 == 0) {
            b = c = nokori_h * w / 2;
        } else {
            b = w * (nokori_h+1) / 2;
            c = w * (nokori_h-1) / 2;
        }

        tmp_max = 0, tmp_min = INF_LL;        
        tmp_max = max(a, b);
        tmp_min = min(a, c);
        ans = min(ans, tmp_max - tmp_min);
    }


    /* w */
    REPN(i, 1, w) {
        ll a, b, c;
        int nokori_w = w - i;
        a = i * h;

        /* 縦に切る */
        if(h % 2 == 0) {
            b = c = nokori_w * h/2;
        } else {
            b = nokori_w * (h+1)/2;
            c = nokori_w * (h-1)/2;
        }

        tmp_max = max(a, b);
        tmp_min = min(a, c);
        ans = min(ans, tmp_max - tmp_min);

        /* 真横に切る */
        if(nokori_w == 1) continue;
        if(nokori_w % 2 == 0) {
            b = c = nokori_w * h / 2;
        } else {
            b = h * (nokori_w+1) / 2;
            c = h * (nokori_w-1) / 2;
        }

        tmp_max = 0, tmp_min = INF_LL;        
        tmp_max = max(a, b);
        tmp_min = min(a, c);
        ans = min(ans, tmp_max - tmp_min);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/*  
    Talkin' to myself and feelin' old
    Sometimes I'd like to quit, nothin' ever seems to fit
    Hangin' around, nothin' to do but frown
    Rainy days and Mondays always get me down
    _________________________
    _________________________
    960 Hours of Solitude
    Quarantine_Day : 40
*/

#include<bits/stdc++.h>

using namespace std;

typedef long long int       ll;
typedef vector<int>         vi;
typedef vector<ll>          vl;
typedef pair<int, int>      pii;
typedef pair<ll, ll>		pll;

#define pb(n)           push_back(n)
#define GSORT(v)        sort(v.begin(), v.end(), greater<ll>())
#define SORT(v)         sort(v.begin(), v.end());
#define REV(v)          reverse(v.begin(), v.end());
#define db(a)           cout<<#a<<" = "<<a<<endl;
#define FIN             freopen("in.txt","r",stdin);
#define FOUT            freopen("out.txt","w",stdout);
#define REP(i,n)        for(int i = (int)(0); i < (int)(n); i++)
#define FOR(i, a, b)    for(int i = (int)a; i <= (int)b; i++)    

#define MAX 200005

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

    int n, d, x;
    cin>>n>>d>>x;
    int coc = 0;
    REP(i, n){
        int a; cin>>a;
        for(int k = 0; ; k++){
            if((a * k) + 1 <= d) coc++;
            else break;
        }
    }
    cout<<coc + x<<"\n";

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    int n = 0;
    int xk = 0;
    int ans = 0;
    int xi[100];
    cin >> n >> xk;
    for (int i = 0; i <n ; ++i) {
        cin >> xi[i];
    }

    for (int j = 0; j < n; ++j) {
        int akyori = xi[j]*2;
        int bkyori = (xk - xi[j])*2;
        if (akyori > bkyori){
            ans += bkyori;
        } else{
            ans += akyori;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

typedef pair<double,double> P;
const double PI = acos(-1);

P pos[1000];

int main() {
    int n;
    pos[0] = make_pair(1,0);
    FOR(i,1,1000) {
        P last = pos[i-1];
        double arg = atan(last.second / last.first);
        if (arg < 0) arg += PI;
        if (last.second < 0) arg += PI;
        pos[i] = make_pair(last.first - sin(arg), last.second + cos(arg));
    }
    
    while (cin >> n, n+1) {
        printf("%.3f\n%.3f\n", pos[n-1].first, pos[n-1].second);
    }
    return 0;
}

Measured memory_bytes: 1296
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <iomanip>
using ll = long long;
using uint = unsigned int;
using graph = std::vector<std::vector<ll>>;
using wGraph = std::vector<std::vector<std::pair<ll,ll>>>;
#define rep(i,n) for (int i=0; i < int(n); i++)

using namespace std;
ll MOD7 = 1000000007;
ll MOD9 = 1000000009;
vector<ll> InputVec(ll N){
    vector<ll> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    return A;
}
void OutputVec(vector<ll> A){
    for (int i = 0; i < A.size(); ++i) {
        cout << A[i] << ",";
    }
    cout << endl;
}
vector<vector<ll>> InputVec2d(ll H,ll W){
    vector<vector<ll>> A(H);
    for (int yi = 0; yi < H; ++yi) {
        A[yi] = vector<ll>(W);
    }
    for (int yi = 0; yi < H; ++yi) {
        for (int xi = 0; xi < W; ++xi) {
            cin >> A[yi][xi];
        }
    }
    return A;
}
vector<vector<char>> InputVec2dStr(ll H,ll W){
    vector<vector<char>> A(H);
    for (int yi = 0; yi < H; ++yi) {
        A[yi] = vector<char>(W);
    }
    for (int yi = 0; yi < H; ++yi) {
        string S;
        cin >> S;
        for (int xi = 0; xi < W; ++xi) {
            A[yi][xi] = S[xi];
        }
    }
    return A;
}
void OutputVec2d(vector<vector<ll>> A){
    for (int yi = 0; yi < A.size(); ++yi) {
        for (int xi = 0; xi < A[yi].size(); ++xi) {
            cout << A[yi][xi] << ",";
        }
        cout << endl;
    }
}
graph InputGraph(ll N,ll M){
    graph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    return G;
}
graph InputDGraph(ll N,ll M){
    graph G(N);
    for (int i = 0; i < M; ++i) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
    }
    return G;
}
void OutputGraph(graph G){
    for (int i = 0; i < G.size(); ++i) {
        cout << i << ":";
        for (int j = 0; j < G[i].size(); ++j) {
            cout << G[i][j]<< ",";
        }
        cout << endl;
    }
}
void OutputAnswerBool(bool b,bool isUpperCase = false){
    if(b){
        if(isUpperCase){
            cout << "YES" << endl;
        }else{
            cout << "Yes" << endl;
        }
    }else{
        if(isUpperCase){
            cout << "NO" << endl;
        }else{
            cout << "No" << endl;
        }
    }
}

int main() {
    ll N;
    cin >> N;
    vector<string> S(N);
    for (int i = 0; i < N; ++i) {
        cin >> S[i];
    }
    map<string,ll> m;
    for (int j = 0; j < N; ++j) {
        m[S[j]]++;
    }
    auto b = m.begin();
    auto e = m.end();
    ll count = 0;
    for (auto i = b; i != e; ++i) {
        count++;
    }
    cout << count << endl;
}


Measured memory_bytes: 25024
//              _      _                 
//             (_)    | |                
//    _ __ ___  _  ___| |__   __ _  ___  
//   | '_ ` _ \| |/ __| '_ \ / _` |/ _ \ 
//   | | | | | | | (__| | | | (_| | (_) |
//   |_| |_| |_|_|\___|_| |_|\__,_|\___/ 
//                                       
// 
#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define pb push_back
#define ld long double
#define pii pair<int,int>
#define sz(x) (int)x.size()
#define piii pair<pii,pii>
#define precise cout<<fixed<<setprecision(10)
#define st first
#define nd second
#define ins insert
#define vi vector<int>
#define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;

int32_t main()
{
  BOOST;
	int n;
	cin>>n;
	cout<<(1000-(n%1000))%1000;
  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>s;
			if(s=="snuke"){
				cout<<char(j-1+'A');
				cout<<i;
				cout<<endl;
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

void call(int n){
	for(int i = 1; i <= n; i++){
		int x = i;
		if( x % 3 == 0){
			cout << " " << i;
		}
		else{
			while(x){
				if(x % 10 == 3){
					cout << " " << i;
					break;
				}
				x /= 10;
			}
		}
	}
	cout << endl;
}

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

	return 0;
}

Measured memory_bytes: 1164
fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map(String::toInt)
    val x = readLine()!!.split(' ').map(String::toLong)
    val y = readLine()!!.split(' ').map(String::toLong)
    println(solve(x) * solve(y) % MOD)
}

val MOD = 1000000007L

fun solve(a: List<Long>): Long {
    var sum = 0L
    for (i in 0..a.size - 2) {
        sum = (sum + (a[i + 1] - a[i]) * (i + 1) % MOD * (a.size - i - 1)) % MOD
    }
    return sum
}

Measured memory_bytes: 76588
import sys
card = [[int(x) for x in input().split(' ') ] for _ in range(3)]

patterns = []

patterns += [[card[i][j] for i in range(3)] for j in range(3)]
patterns += [[card[j][i] for i in range(3)] for j in range(3)]
patterns.append([card[i][i] for i in range(3)])
patterns.append([card[i][2-i] for i in range(3)] )

ok = False
N = int(input())
for _ in range(N):
    b = int(input())
    for pat in patterns:
        while b in pat:
            pat.remove(b)
            
for pat in patterns:
    if len(pat) == 0:
        print('Yes')
        sys.exit()

print('No')

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

typedef ostringstream OSS;
typedef istringstream ISS;

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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef vector<VS> VVS;
typedef vector<bool> VB;
typedef vector<VB> VVB;
typedef vector<PII> VPII;

#define fst first
#define snd second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x) (x).begin(),(x).end()
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a) { OSS oss; oss << a; return oss.str(); };

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int solve(int N) {
	// input
	VVB fs(N, VB(30));
	for (int i = 0; i < N; i++) {
		int n;
		cin >> n;
		
		if (!n) {
			return -1;
		}

		for (int j = 0; j < n; j++) {
			int a;
			cin >> a;
			fs[i][a - 1] = true;
		}
	}

	// 
	VVB dones(N, VB(N));
	for (int i = 0; i < N; i++) {
		dones[i][i] = true;
	}
	
	for (int i = 0; i < 30; i++) {
		VB meet(N);
		for (int j = 0; j < N; j++) {
			if (!fs[j][i]) continue;

			for (int k = 0; k < N; k++) {
				meet[k] = meet[k] | dones[j][k];
			}
		}

		for (int j = 0; j < N; j++) {
			if (!fs[j][i]) continue;

			for (int k = 0; k < N; k++) {
				dones[j][k] = meet[k];
			}
		}

		if (all_of(ALL(meet), [](bool a){return a;})) {
			return i + 1;
		}
	}

	return -1;
}

int main(void) {
	int N;
	while (cin >> N, N) {
		cout << solve(N) << endl;
	}

	return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
#define L "\n"
#define S " "
#define ll long long
#define pb push_back
#define mp make_pair
#define vi std::vector<int>
#define si std::set<int>
#define vl std::vector<long long>
#define qi std::queue<int>
#define de(a) cout << #a << "  ------>  " << a << "\n"
#define SIZE 1003
#define MOD 1000000007
#define INF INT_MAX
#define FOR(i, n) for (i = 1; i <= n; i++)
#define FASTIO                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)

using namespace std;

string s[SIZE];
ll dp[SIZE][SIZE];
bool flag[SIZE][SIZE];
int row, col;

ll f(int i, int j)
{
    ll m1, m2;
    flag[i][j] = 1;
    if(i == row && j == col)
        return dp[i][j] = 1;
    if(s[i][j] != '.')
        return dp[i][j] = 0;
    if(i == row){
        if(flag[i][j + 1])
            return dp[i][j] = dp[i][j + 1];
        else 
            return dp[i][j] = f(i, j + 1);
    }
    else if(j == col){
        if(flag[i + 1][j])
            return dp[i][j] = dp[i + 1][j];
        else return dp[i][j] = f(i + 1, j);
    }
    if(flag[i + 1][j])
        m1 = dp[i + 1][j];
    else m1 = f(i + 1, j);

    if(flag[i][j + 1])
        m2 = dp[i][j + 1];
    else 
        m2 = f(i, j + 1);

    return dp[i][j] = (m1 + m2) % MOD;
}

void solve()
{
    int j, i;
    cin >> row >> col;
    FOR(i, row)
    {
        cin >> s[i];
        s[i] = '*' + s[i] + '*';
    }
    string str(SIZE, '*');
    s[i] = str;

    ;
    cout << f(1, 1) << L;
}
int main()
{
    FASTIO;

    int t;
    // cin >> t;
    // while (t--)
    solve();
    return 0;
}

Measured memory_bytes: 11136
#include <algorithm>
#include <iostream>
#include <string>
 
using ll = long long;
#define rep(inc, bgn, end) for (int inc = bgn; inc < end; ++inc)
#define repe(inc, bgn, end) for (int inc = bgn; inc <= end; ++inc)
 
using namespace std;
 
// 158 - c
int main(void) {
    int n;
    cin >> n;
 
    ll sum = 0;
    repe(val, 1, n) {
        if (val % 3 != 0 && val % 5 != 0) sum += val;
    }
 
    cout << sum << endl;
 
    return 0;
}

Measured memory_bytes: 3640
import Foundation

extension String {
    func split(separator: String) -> [Int] {
        return self.componentsSeparatedByString(separator).map { Int($0)! }
    }
}

let input = readLine()!.split(" ")
let N = input[0]
let M = input[1]
let C = input[2]
let B = readLine()!.split(" ")

var ans = 0
for _ in 0..<N {
    let A = readLine()!.split(" ")
    var sum = 0
    for i in 0..<M {
        sum += A[i] * B[i]
    }
    if sum + C > 0 {
        ans += 1
    }
}

print(ans)

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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int a[200000];

int main() {
  in(int, n);
  rep(i, n) cin >> a[i];
  int last = 0;
  rep(i, n) {
    if (a[i] == last + 1) {
      ++last;
    }
  }
  if (last == 0) {
    out(-1);
  } else {
    out(n - last);
  }
}


Measured memory_bytes: 1024
# coding: utf-8
N = int(input())
H = list(map(int, input().split()))

dp = [float('inf')]*N
dp[0] = 0
dp[1] = abs(H[1] - H[0])

for i in range(2, N):
    dp[i] = min(dp[i-1] + (abs(H[i] - H[i-1])), dp[i-2] + (abs(H[i] - H[i-2])))

print(dp[N-1])


Measured memory_bytes: 13980
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main() {
    ll d,g;
    ll p[10],c[10];
    ll tmp_p[10];
    
    std::cin >> d>>g;
    g /= 100;
    for (int i = 0; i < d; i++) {
        std::cin >> p[i]>>c[i];
        tmp_p[i] = p[i];
        c[i]/=100;
    }
    
    ll result = 1000000;
    
    for (int i = 0; i < (1<<d); i++) {
        for (int i = 0; i < d; i++) {
            p[i] = tmp_p[i];
        }
        ll value = 0;
        ll count = 0;
        for (int j = 0; j < d; j++) {
            if( i & (1<<j) ){
                count += p[j];
                
                value += p[j] * (1+j) + c[j];
                p[j] = 0;
            }
        }
        // std::cout << i<<" "<<count << std::endl;
        if(value>=g){
            if(count!=0){
                result = min(result,count);
            }
            continue;
        }
        ll now = d-1;
        bool ok = true;
        while(value<g){
            if(now == -1){
                ok = false;
                break;
            }
            if( p[now] > 1 ){
                count++;
                value += now+1;
                p[now]--;
            }else{
                now--;
            }
        }
        if(ok) result = min(result,count);
    }
    std::cout << result << std::endl;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	/*/TODO:!!!!!!!テスト用!!!!!!!!!
	sc = bufio.NewScanner(strings.NewReader(`



		`))
	//TODO:!!!!!!!テスト用!!!!!!!!!*/

	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */

	_, m, x := nextInt(), nextInt(), nextInt()
	a := nextInts(m)

	al := 0
	ar := 0

	ans := 0
	for i := 0; i < m; i++ {
		if a[i] < x {
			al++
		} else {
			ar++
		}
	}
	if al < ar {
		ans = al
	} else {
		ans = ar
	}

	//fmt.Fprintln(out, "[DEBUG]", d)
	fmt.Fprintln(out, ans)
}

//------------------------------------------------------------------------------

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextFloat64() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
using namespace std;
int main(){
	int x,K,N;
	int pre[200],rea[200];
	while(cin>>N>>K,K||N){
		for(int i=0;i<K;i++){
			rea[i]=0;
			cin>>x;
			pre[i]=x;
		}
		for(int i=0;i<N;i++)
		for(int j=0;j<K;j++){
			cin>>x;
			rea[j]+=x;
		}
		int i;
		for(i=0;i<K;i++){
			if(rea[i]>pre[i]){
				cout<<"No"<<endl;
				break;
			}
		}
		if(i==K)
		cout<<"Yes"<<endl;
	}
	return 0;
}

Measured memory_bytes: 852
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>

int N;
int a;

std::vector<int> cnt(8,0);
int hr = 0;

int main(void){
    std::cin >> N;
    for(int i=0; i<N; ++i){
        std::cin >> a;
        if(a >= 3200){
            ++hr;
        }else{
            ++cnt[a/400];
        }
    }

    int c = 0;
    for(int i=0; i<8; ++i){
        c += (cnt[i]>0 ? 1 : 0);
    }

    int min = std::max(1, c);
    int max = c+hr;

    std::cout << min << " " << max << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



signed main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    int n, m, c;
    cin >> n >> m >> c;
    int b[m];
    rep(i, m) cin >> b[i];
    int a[n][m];
    rep(i, n) rep(j, m) cin >> a[i][j];

    int ans = 0;
    rep(i, n) {
        int cur = 0;
        rep(j, m) {
            cur += a[i][j] * b[j];
        }
        if(cur + c > 0) ans++;
    }

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

Measured memory_bytes: 256
#include<stdlib.h>
#include<stdio.h>

int main(){
  long X,A,B;

  scanf("%ld %ld %ld",&X,&A,&B);

  if((B-A)<=0){
    printf("delicious\n");
  }else{if(B-A>X){
    printf("dangerous\n");
  }else{
    printf("safe");
  }
  }
  return 0;
}


Measured memory_bytes: 128
import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
fft = np.fft.rfft
ifft = np.fft.irfft
mod = 998244353

N, S = map(int, input().split())
A = list(map(int, input().split()))
U = 3003

dp = np.zeros(U+10, dtype=np.int64)
dp[0] = 1
for a in A:
    newDP = dp.copy() * 2
    newDP[a:] += dp[:-a]
    newDP %= mod
    dp = newDP

print(dp[S])

Measured memory_bytes: 27500
object Main extends App {
	var s = scala.io.StdIn.readLine.toList
	var t = scala.io.StdIn.readLine.toList
	var map = Map[Char, Char]()

	val size = s.size
	var flag = true

	var g2 = Set[Char]()

	for(i<-0 until 26){
		g2 = g2 + ('a'.toInt + i).toChar
	}

	for(i<-0 until size){
		val a = s.head
		val b = t.head
		s = s.tail
		t = t.tail

		map.get(a) match {
			case None 	 =>	{
				if(g2.contains(b)){
					map = map + (a->b)
					g2 = g2 - b
				}else{
					flag = false
				}
			}
			case Some(z) => if(z != b) flag = false 
		}
	}

	if(flag) println("Yes")
	else println("No")

} 

Measured memory_bytes: 42900
#include<stdio.h>
int main(void){
  int a;
  int str[32]={1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51};
  scanf("%d", &a);
  printf("%d", str[a-1]);
  return(0);
}

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

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

  if (n % 2 == 0)
  {
    ans = n / 2;
    cout << ans << endl;
  }
  else
  {
    ans = n / 2 + 1;
    cout << ans << endl;
  }
  return 0; 
}

Measured memory_bytes: 256
#include<stdio.h>

void ScanningUp(void);
void ScanningDown(void);

int x, y, count, data[9][9];

int main(){
  int i, j, n, updown, casecount=1;

  while(1){
    scanf("%d", &n);
    if(n == 0) break;

    x = 0;
    y = 0;
    count = 0;
    updown = 1;

    while(1){
      if(updown == 1){
        ScanningUp();
        updown = 0;
        if(count == n*n) break;
        else if(y == n-1) x++;
        else if(x == 0) y++;
      }else{
        ScanningDown();
        updown = 1;
        if(x == n-1) y++;
        else if(y == 0) x++;
      }
    }

    printf("Case %d:\n", casecount);
    for(i=0; i<n; i++){
      for(j=0; j<n; j++)
        printf("%3d", data[i][j]);
      printf("\n");
    }

    casecount++;
  }

  return 0;
}

void ScanningUp(void){
  int n, m;
  n = x;
  m = y;
  while(1){
    count++;
    data[x][y] = count;
    if(x == m && y == n) break;
    x--;
    y++;
  }
}

 

void ScanningDown(void){
  int n, m;
  n = x;
  m = y;
  while(1){
    count++;
    data[x][y] = count;
    if(x == m && y == n) break;
    x++;
    y--;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef pair<int,int> P;

int u[111][111],n,ans,k;
P a[111][111];

void dfs(int x,int y) {
  if(u[x][y]!=-1) {
    if(u[x][y]==k) ans++;
    return;
  }
  u[x][y]=k;
  dfs(a[x][y].F,a[x][y].S);
}

int main() {
  int n;
  while(cin >> n && n) {
    ans=k=0;
    memset(u,-1,sizeof(u));
    for(int i=0; i<n; i++) for(int j=0; j<n; j++) cin >> a[i][j].S >> a[i][j].F;
    for(int i=0; i<n; i++) {
      for(int j=0; j<n; j++) {
        if(u[i][j]==-1) {
          dfs(i,j);
          k++;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 3108