akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

/*
using PAIR = pair<string, int>;
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA() cerr << "AAAAA" << endl
#define debug_() cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    cout << #v << endl;                \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    cout << #v << endl;                       \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using P1 = pair<int, pair<int, int>>; // クラスカル法とかで、{cost, {from, to}}的に使う。
const ll INF = 1001001001001001001;
const double pi = acos(-1);

int main()
{
    int n;
    cin >> n;
    vector<vector<P>> G(n);
    for (int i = 0; i < n - 1; i++)
    {
        int x, y, w;
        cin >> x >> y >> w;
        x--;
        y--;
        G[x].push_back({y, w});
        G[y].push_back({x, w});
    }

    vector<ll> dist(n, -1);
    dist[0] = 0;
    queue<int> que;
    que.push(0);
    while (!que.empty())
    {
        int v = que.front();
        que.pop();
        for (auto nv : G[v])
        {
            int x = nv.fi;
            int w = nv.se;
            if (dist[x] == -1)
            {
                dist[x] = dist[v] + w;
                que.push(x);
            }
        }
    }
    for (int i = 0; i < n; i++)
    {
        cout << dist[i] % 2 << endl;
    }

    return 0;
}


Measured memory_bytes: 7168
N,M = map(int, input().split())
A=[-1 for i in range(N)]

ans=True
for i in range(M):
    s, c = map(int, input().split())
    if A[s-1]==-1:
        A[s-1]=c
    elif A[s-1]!=c:
        ans=False
        
if A[0]==0:
    ans=False        

head=True
for i in range(N):       
    if A[i]==-1:
        if head and N!=1:
            A[i]=1
            head=False
        else:
            A[i]=0 
    elif A[i]==0:
        pass
    else:
        head=False
            
if ans and not head:
    A=[str(a) for a in A]
    print("".join(A))
elif head and N==1:
    print(0)
else:     
    print(-1)


Measured memory_bytes: 3064
n = int(input())
zyunban = list(map(int, input().split()))
val = list(map(int, input().split()))
kougo = list(map(int, input().split()))

total = sum(val)
for i in range(n-1):
    if zyunban[i+1] == zyunban[i] + 1:
        total += kougo[zyunban[i] -1]
print(total)

Measured memory_bytes: 3064
from sys import stdin
high = [0] * 10000
par = [i for i in range(10000)]
def findSet(x):
    if par[x] == x: return x
    par[x] = findSet(par[x])
    return par[x]
def unite(x, y):
    x = findSet(x)
    y = findSet(y)
    if x == y: return
    if high[x] > high[y]: par[y] = x;
    else:
        par[x] = y
        if high[x] == high[y]: high[y] += 1
def same(x, y):
    return findSet(x) == findSet(y)
n, q = map(int, stdin.readline().split())
for i in range(q):
    t, a, b = map(int, stdin.readline().split())
    if t == 0: unite(a, b);
    elif t == 1: print(1 if same(a, b) else 0)

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

int main() {
  string s;
  cin >> s;
  if(s[s.size() - 1] == 's') {
  	cout << s << "es" << endl;
  } else {
  	cout << s << "s" << endl;
  }
  return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<int,int> P;
#define Mod 1000000007

ll cn(ll a){
    if(a==0) return 2;
    else return a%2;
}

ll cn2(ll a){
    return a%2;
}

int main(){

    ll l;
    ll i,j;
    ll n;
    cin>>n;
    ll a[n];
    for(i=0;i<n;i++) cin>>a[i];

    ll dp[n][5];
    
    dp[0][0]=a[0];
    dp[0][1]=cn(a[0]);
    dp[0][2]=(a[0]+1)%2;
    dp[0][3]=cn(a[0]);
    dp[0][4]=a[0];

    for(i=1;i<n;i++){
        dp[i][0]=dp[i-1][0]+a[i];
        dp[i][1]=min(dp[i-1][0],dp[i-1][1])+cn(a[i]);
        dp[i][2]=min(min(dp[i-1][0],dp[i-1][1]),dp[i-1][2])+(a[i]+1)%2;
        dp[i][3]=min(dp[i-1][0],min(dp[i-1][1],min(dp[i-1][2],dp[i-1][3])))+cn(a[i]);
        dp[i][4]=min(dp[i-1][4],min(dp[i-1][0],min(dp[i-1][1],min(dp[i-1][2],dp[i-1][3]))))+a[i];
    }

    ll ans=1e9;

    for(i=0;i<5;i++){
        ans=min(ans,dp[n-1][i]);

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

Measured memory_bytes: 9600
// Template
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;
typedef long long ll;

#define REP(i, n) for(int i = 0;i < n;i++)
#define INF 1 << 10


int main(){

    int A,B,C; cin >> A >> B >> C;

    if((max(A,max(B,C))*3-(A+B+C))%2==0){
        cout << (max(A,max(B,C))*3-(A+B+C))/2 << endl;
    } else {
        cout << (max(A,max(B,C))*3-(A+B+C))/2 + 2 << endl;
    }

    return 0;

}


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

int main() {
  int n; cin >> n;
  vector<string> bl(n);
  for(int i = 0; i < n; ++i) {
    cin >> bl[i];
  }

  int m; cin >> m;
  vector<string> rd(m);
  for(int i = 0; i < m; ++i) {
    cin >> rd[i];
  }

  int mx = 0;
  for(int i = 0; i < n; ++i) {
    int sum = 0;

    for(int j = 0; j < n; ++j) {
      if(bl[i] == bl[j]) ++sum;
    }

    for(int j = 0; j < m; ++j) {
      if(bl[i] == rd[j]) --sum;
    }

    mx = max(mx, sum);
  }
  cout << mx << "\n";
}

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

int main(void){
    long int n,l;
    cin>>n;
    long int m,M,s;
    M= (-1000000);
    m=1000000;
    s=0;
    for(int i=0;cin>>l;i++){
        s+=l;
        m=min(m,l);
        M=max(M,l);
    }

    cout<<m<<" "<<M<<" "<<s<<endl;
    return 0;
}



Measured memory_bytes: 3108
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;
char in[100];
int main(){
    int i,j;
    char rigi[100] = "AKIHABARA";
    while(~scanf("%s",in)){
        int len = strlen(in);
        int p = 0;
        bool flag = true;
        for(i=0;i<len;i++){
            while(rigi[p] =='A' && rigi[p]!=in[i]){
                p++;
            }
            //cout<<rigi[p]<<" "<<in[i]<<endl;
            if(rigi[p] != in[i]){
                flag = false;
                break;
            }
            p++;
        }
        //cout<<p<<endl;
        if(p!=8 && p!=9){
            flag = false;
        }
        if(flag){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}

Measured memory_bytes: 256
from collections import Counter
n=int(input())
arr=list(map(int,input().split()))
ans=Counter(arr)
sm=sum(arr)
q=int(input())
for i in range(q):
    x,y=(map(int,input().split()))
    sm=sm-(x*ans[x])
    sm=sm+(y*ans[x])
    ans[y]+=ans[x]
    ans[x]=0
    print(sm)


Measured memory_bytes: 24128
#include<iostream>
#include<set>

int main(){
        int n,a,b,c;
        std::cin >> n;
        for(int i=0;i<n;i++){
                std::cin >> a >> b >> c;
                std::multiset<int> st;
                st.insert(a);
                st.insert(b);
                st.insert(c);
                std::multiset<int>::iterator itr=st.begin();
                a = *itr; a = a*a;itr++;
                b = *itr; b = b*b;itr++;
                c = *itr; c = c*c;itr++;
                if(a+b == c) std::cout << "YES" << std::endl;
                else std::cout << "NO" << std::endl;
        }
        return 0;
}

Measured memory_bytes: 3108
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        s: chars,
        t: chars,
    }

    let ss: String = s.into_iter().collect();
    let mut tt: String = t.into_iter().collect();

    tt.pop();
    if ss==tt {
        println!("Yes");
    } else {
        println!("No");
    }

}

Measured memory_bytes: 2132
#include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e9+7;

int main() {
    ios::sync_with_stdio(false);
    Int x, a, b;
    cin >> x >> a >> b;
    if (a >= b) {
        dump("delicious");
    }
    else if (b - a <= x) {
        dump("safe");
    }
    else {
        dump("dangerous");
    }
    return 0;
} 


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    string s;
    cin >> s;
    int x, y;
    cin >> x >> y;
    int n;
    n = 0;
    int L = s.length();
    for (int i = 0; i < L; i++) {
        if(s[i] == 'F'){
            n++;
        }
        else{
            break;
        }
    }
    vector<int> even, odd;
    int tmp = 0;
    bool check = false; //falseのときoddに入れる
    for (int i = n+1; i < L; i++) {
        if(s[i] == 'T'){
            if(check){
                if(tmp != 0){
                    even.push_back(tmp);
                }
            }
            else{
                if(tmp != 0){
                    odd.push_back(tmp);
                }
            }
            tmp = 0;
            check = !check;
        }
        else{
            tmp++;
        }
    }
    if(check){
        if(tmp != 0){
            even.push_back(tmp);
        }
    }
    else{
        if(tmp != 0){
            odd.push_back(tmp);
        }
    }

    int E, O;
    int LE, LO;
    LE = even.size();
    LO = odd.size();
    E = 0; O = 0;
    for (int i = 0; i < LE; i++) {
        E += even[i];
        //printf("%d ", even[i]);
    }
    //printf("\n");
    for (int i = 0; i < LO; i++) {
        O += odd[i];
        //printf("%d ", odd[i]);
    }
    //printf("\n");

    if(((E - x + n) % 2 == 1) || (E - x + n < 0)){
        No();
        return 0;
    }
    if(((O - y) % 2 == 1) || (O - y < 0)){
        No();
        return 0;
    }

    vector<bool> dp((E - x + n) / 2 + 1, false);
    dp[0] = true;
    for (int i = 0; i < LE; i++) {
        for (int j = (E - x + n) / 2; j >= 0; j--) {
            if(j - even[i] >= 0 && dp[j - even[i]] == true){
                dp[j] = true; 
            }
        }
    }
    if(dp[(E - x + n) / 2] == false){
        No();
        return 0;
    }

    dp.resize((O - y) / 2 + 1);
    fill(ALL(dp), false);
    dp[0] = true;
    for (int i = 0; i < LO; i++) {
        for (int j = (O - y) / 2; j >= 0; j--) {
            if(j - odd[i] >= 0 && dp[j - odd[i]] == true){
                dp[j] = true; 
            }
        }
    }
    if(dp[(O-y) / 2] == false){
        No();
        return 0;
    }

    Yes();
    return 0;


}

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

int main() {
    string s1, s2, s3;
    cin >> s1 >> s2 >> s3;
    int convert = 'a' - 'A';

    cout << char(s1[0] - convert) << char(s2[0] - convert) << char(s3[0] - convert) << endl;

}


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

#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPL(i,a,n) for(ll i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define SORTVG(v) sort(v.begin(),v.end(),greater<>())
#define SORTV(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef vector<int> Vi;

template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}
template<class T> void YesNo(T& a) {if(a){cout << "Yes" << ENT;}else{cout << "No" << ENT;}}
template<class T> void YESNO(T& a) {if(a){cout << "YES" << ENT;}else{cout << "NO" << ENT;}}
template<class T> void AorB(T& a, string A,string B) {if(a){cout << A << ENT;}else{cout << B << ENT;}}

int atcoder(){
    int n,a,b;
  	cin>>n>>a>>b;
    cout<<min(a,b)<<" "<< max(a+b-n,0) <<ENT;
    return 0;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    atcoder();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main() {
    int NS = 0, EW = 0;
    string S;
    cin >> S;
    for (char c : S) {
        if (c == 'N') NS |= 2;
        if (c == 'S') NS |= 1;
        if (c == 'E') EW |= 2;
        if (c == 'W') EW |= 1;
    }
    cout << ((NS == 0 || NS == 3) && (EW == 0 || EW == 3) ? "Yes" : "No") << endl;
}


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

using namespace std;

int r[20000];

int main(){
	int n,s;
	while(cin>>n>>s&&n){
		int ans=0;
		for(int i=0;i<n;i++)cin>>r[i];
		sort(r,r+n);
		for(int i=0;i<n;i++){
			int *p=upper_bound(r,r+n,s-r[i]);
			ans+=r+n-p;
			if(p<=r+i)ans--;
		}
		cout<<ans/2<<endl;
	}
	return 0;
}

Measured memory_bytes: 1216
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include<stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
long nCr(int n, int r) {
	long ans = 1;
	for (int i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (int i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
struct union_find {
	int par[200010], size_[200010];
	void init(int x) {
		rep(i, x) { par[i] = i; size_[i] = 1; }
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (size_[x] < size_[y]) {
			par[x] = y;
			size_[y] += size_[x];
		}
		else {
			par[y] = x;
			size_[x] += size_[y];
		}
	}
};

signed main() {
	int a, b;
	cin >> a;
	b = (a + 1) / 2;
	double c = double(a);
	double d = double(b);
	cout << fixed << setprecision(10) << d/c << endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

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

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

const long long INF = 1LL << 60;

int main(void){
  int H, N;

  long long DP[100010];
  
  cin >> H >> N;
  
  long long power[N];
  long long mp[N];
  
  for(int i = 0; i < N; i++){
    cin >> power[i] >> mp[i];
  }
  
  for(int i = 0; i < H+1; i++){
    DP[i] = INF;
  }
  
  DP[0] = 0;
  
  for(int i = 0; i < H+1; i++){
    if(DP[i] == INF) continue;
    for(int j = 0; j < N; j++){
      if(i+power[j] > H){
        chmin(DP[H] , DP[i] + mp[j]);
      }else{
        chmin(DP[i+power[j] ] , DP[i] + mp[j]);
      }
    }
  }
  
  cout << DP[H] << endl;
  
  return 0;
}



Measured memory_bytes: 384
#include<iostream> 
#include<queue>
#include<string>
#include<vector>
using namespace std;
int g[60][60]; 
int done[60][60];
struct edge{
	int tox,toy,step;
	edge(int x=0,int y=0,int steps=0){
		tox=x,toy=y,step=steps;
	}
}; 
queue<edge> que;
using namespace std;
int hei=0;
int main(){
		int h,w;
	cin>>h>>w;
	string sx;
	getline(cin,sx);
	for(int a=1;a<=h;++a){
	
		string s;
		getline(cin,s);
		for(int b=1;b<=w;++b){
			
			if(s[b-1]=='.'){
				g[a][b]=1;
					hei++;
			}else {
		 g[a][b]=2;}
		}
		
	}
//	cout<<"hei="<<hei<<endl;
	que.push(edge(1,1,1));
	while(!que.empty()){
	edge x=que.front();
	que.pop();
	int xc=x.tox;
	int yc=x.toy;
//	cout<<"x="<<xc<<" y="<<yc<<endl;
	if(xc==w&&yc==h){
		cout<<hei-x.step;
		return 0;
	}
	int len=x.step;
	for(int a=-1;a<=1;++a){
		for(int b=-1;b<=1;++b){
			if(a==0&&b==0)continue;
			if(a*b!=0)continue;
			//cout<<"x="<<xc+a<<" y="<<yc+b<<endl;
			if(a+xc<1||a+xc>w||b+yc<1||b+yc>h)continue;
		if(g[yc+b][xc+a]==2)continue;
			if(done[yc+b][xc+a]!=0&&done[yc+b][xc+a]<=len+1)continue;
			//	cout<<"x="<<xc+a<<" y="<<yc+b<<endl;
			done[yc+b][xc+a]=len+1;
			que.push(edge(a+xc,yc+b,len+1));
		}
	} 
	
	
	
}
	cout<<-1<<endl;
	return 0;
}

Measured memory_bytes: 256
s = input()
st = 0
fi = 0
for i in range(len(s)):
  if s[i] == 'A':
    st = i
    break
for j in range(len(s)):
  if s[len(s)-1-j] == 'Z':
    fi = j
    break
print(len(s)-st-fi)

Measured memory_bytes: 3516
s = input()
s1 = s[:len(s)//2]
s2 = s[len(s)//2+1:]

s1_ = list(reversed(s1))
s2_ = list(reversed(s2))

if(s1==s2 and list(s1)==s1_ and list(s2)==s2_):
  	print('Yes')
else:
  	print('No')

Measured memory_bytes: 3060
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>

#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

const ll MOD = 1000000007;
const long double EPS = 1e-10;
const int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    int a, b, k;
    cin >> a >> b >> k;

    int cnt = 0;
    for(int i=100;i>=1;--i) {
        if(a % i == 0 && b % i == 0) {
            ++cnt;
            if(cnt == k) {
                cout << i << endl;
                return 0;
            }
        }
    }
    return 0;
}


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

#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end() 
#define sz(v) (int)((v).size())
#define fs first
#define sd second

typedef long long ll;

typedef pair < int, int > pi;
typedef pair < pi, int > ppi;

typedef vector < int > vi;
typedef vector < vector < int > > vvi;
typedef vector < pi > vpi;
typedef vector < vpi > vvpi;
typedef vector < ppi > vppi;

void fast() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}

void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}

#ifdef LOCAL
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

double get_time() {
	return 1.0 * clock() / CLOCKS_PER_SEC;
}

int main() {
	int n;
	cin >> n;
	cout << 1000 * ((n + 999)/1000) - n << '\n';
}


Measured memory_bytes: 3632
N, Y = map(int, input().split())

for i in range(Y//10000 + 1):
  for j in range((Y - i * 10000)//5000 + 1):
    if Y - i*10000 - j*5000 == (N - i - j)*1000:
      print(i,j,N-i-j)
      exit()
print(-1,-1,-1)

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

int main() {
	int n, m, r = 0; cin >> n;
	m = n + 1;
	for(int i = 0; i < n; i++) {
		int x; cin >> x;
		if(x < m) r++;
		m = min(m, x);
	}
	cout << r;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	x := make([]int, n)
	for i := range x {
		fmt.Scan(&x[i])
	}

	k--
	ans := 1000000000
	for i := 0; i+k < n; i++ {
		d := x[i+k] - x[i]
		if v := abs(x[i]) + d; v < ans {
			ans = v
		}
		if v := abs(x[i+k]) + d; v < ans {
			ans = v
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 5504
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<ll, int> mp;
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, d;
	cin >> n >> d;
	int tmp = d * 2 + 1;
	cout << (n + tmp - 1) / tmp << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ff first
#define ss second
#define vll vector<ll>
#define sz size()
#define pb emplace_back
#define mp make_pair
#define MOD 1000000007
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL))
const int N = 100005;

int main()
{
	ll n;
	cin>>n;
	ll a[n+1];
	for(ll i=0;i<n;i++)
	cin>>a[i];
	ll l=0,r=0;
	for(ll i=0;i<n;i++)
	l=l+a[i];
	ll ans=1e18,diff;
	for(ll i=n-1;i>=0;i--)
	{
		r=r+a[i];
		l=l-a[i];
		diff=abs(l-r);
		ans=min(ans,diff);
	}
	cout<<ans;
}

Measured memory_bytes: 1792
#include<iostream>
#include<stack>
#define DIM 200005
using namespace std;
int n, i, x, p, ok;
long long sol;
stack<int> s;
int v[DIM], w[DIM];
int main(){
    cin>> n;
    for(i = 1; i <= n; i++){
        cin>> w[i];
    }
    for(i = 1; i <= n; i++){
        cin>> v[i];
    }
    v[0] = v[n];
    v[n + 1] = v[1];
    for(i = 1; i <= n; i++){
        if(v[i] > w[i] && v[i] > v[i - 1] + v[i + 1]){
            s.push(i);
        }
    }
    while( !s.empty() ){
        i = s.top();
        s.pop();
        x = (v[i] - w[i]) / (v[i - 1] + v[i + 1]);
        sol += x;
        v[i] -= (v[i - 1] + v[i + 1]) * x;
        v[0] = v[n];
        v[n + 1] = v[1];
        p = i - 1;
        if(p == 0){
            p = n;
        }
        if(v[p] > w[p] && v[p] > v[p - 1] + v[p + 1]){
            s.push(p);
        }
        p = i + 1;
        if(p == n + 1){
            p = 1;
        }
        if(v[p] > w[p] && v[p] > v[p - 1] + v[p + 1]){
            s.push(p);
        }
    }
    ok = 1;
    for(i = 1; i <= n; i++){
        if(v[i] != w[i]){
            ok = 0;
            break;
        }
    }
    if(ok == 0){
        cout<< -1;
        return 0;
    }
    cout<< sol;
}


Measured memory_bytes: 2176
def main():
    n, k = map(int, input().split())
    f = [True]*n
    for _ in range(k):
        d = int(input())
        a = list(map(int, input().split()))
        for v in a:
            f[v-1] = False
    ans = 0
    for i in range(n):
        if f[i]:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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

int main() {
  int N;
  cin >> N;
  vector<int>a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  vector<bool>check(8);
  for (int i = 0; i < 8; i++) {
    check.at(i) = false;
  }
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (a.at(i) < 400) {
      check.at(0) = true;
    }
    else if (a.at(i) < 800) {
      check.at(1) = true;
    }
    else if (a.at(i) < 1200) {
      check.at(2) = true;
    }
    else if (a.at(i) < 1600) {
      check.at(3) = true;
    }
    else if (a.at(i) < 2000) {
      check.at(4) = true;
    }
    else if (a.at(i) < 2400) {
      check.at(5) = true;
    }
    else if (a.at(i) < 2800) {
      check.at(6) = true;
    }
    else if (a.at(i) < 3200) {
      check.at(7) = true;
    }
    else {
      count ++;
    }
  }
  int ans1 = 0, ans2;
  for (int i = 0; i < 8; i++) {
    if (check.at(i)) {
      ans1 ++;
    }
  }
  ans2 = ans1 + count;
  if (ans1 == 0 && N != 0) {
    ans1 = 1;
  }
  cout << ans1 << ' ' << ans2;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++) 
#define all(v) v.begin(), v.end()
//動画解説を写す
const int mod=1000000007;
struct mint{
  long long x;
  mint(long long x=0):x(x%mod){}
  mint& operator+=(const mint a){
    if((x+=a.x)>=mod)x-=mod;
    return *this;
  }
  mint& operator-=(const mint a){
    if((x+=mod-a.x)>=mod)x-=mod;
    return *this;
  }
  mint& operator*=(const mint a){
   (x*=a.x)%=mod;
    return *this;
  }
  mint operator+(const mint a)const{
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a)const{
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a)const{
    mint res(*this);
    return res*=a;
  }
};
mint c[4005][4005];
void init(){
  c[0][0]=1;
  for(int i=0;i<=4000;i++){
    for(int j=0;j<=i;j++){
      c[i+1][j]+=c[i][j];
      c[i+1][j+1]+=c[i][j];
    }
  }
}
mint comb(int n,int k){
  return c[n][k];
}
mint f2(int n,int k){
  return comb(n+k-1,k-1);
}
mint f(int n,int k){
  if(n<k)return 0;
  if(n==0&&k==0)return 1;
  if(k<1)return 0;
  return f2(n-k,k);
}
int main() {
  init();
  int n,k;
  cin>>n>>k;
  for(int i=1;i<=k;i++){
    mint blue =f(k,i);
    mint red=0;
    {
      red+=f(n-k,i-1);
      red+=f(n-k,i);
      red+=f(n-k,i);
      red+=f(n-k,i+1);
    }
    mint ans=blue*red;
    printf("%lld\n",ans.x);
  }   
  return 0;
}

Measured memory_bytes: 125568
N,K = map( int, input().split() )
p = list( map( int, input().split() ) )
q = [0]
total = 0
for i in range(N):
    total += p[i]
    q.append(total)

t = 0
for i in range(N-K+1):
    t = max( q[i+K] - q[i],t )

print( (K+t)/2 )


Measured memory_bytes: 76040
#include <iostream>
#include <math.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <stack>

using namespace std;
typedef long long ll;


int main(){
    int h,w;
    cin>>h>>w;
    string p[h];
    int i,j;
    for(i=0;i<h;i++){
        cin>>p[i];
    }
    string r[h][w],b[h][w];
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            if(j==0){
                r[i][j]='#';
                b[i][j]='.';
            }else if(j==w-1){
                r[i][j]='.';
                b[i][j]='#';
            }else{
                r[i][j]='.';
                b[i][j]='.';
            }
        }
    }
    for(i=1;i<h-1;i++){
        if(i%2==1){
            for(j=1;j<w-1;j++){
                r[i][j]='#';
                if(p[i][j]=='#'){
                    b[i][j]='#';
                }
            }
        }else{
            for(j=1;j<w-1;j++){
                b[i][j]='#';
                if(p[i][j]=='#'){
                    r[i][j]='#';
                }
            }
        }
    }
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            cout<<r[i][j];
        }
        cout<<endl;
    }
    cout<<endl;
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            cout<<b[i][j];
        }
        cout<<endl;
    }
    
    
}



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


int main(){
	int a;
	cin >> a;

	int ans = a + a*a + a*a*a;
	cout << ans << endl;
	return 0;
}

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

int main() {
  int N;
  int a = 0;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    
    if (s == "Y") {
      a += 1;
    }
    else {
      a += 0;
    }
  }
  
  if (a > 0) {
    cout << "Four" << endl;
  }
  else {
    cout << "Three" << endl;
  }
}

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

int main(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int sum = 0;
    for(int i = 0;i < n-1;i++){
        if(s[i] == s[i+1]){
          sum++;
        }
    }
    int ans = n - sum;
    cout << ans << endl;
}

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

void solve(){
    ll x, y, c, t;
    cin >> x >> y;
    if(y < 2*x){
        cout << "No" << endl;
        return;
    }
    t = (y-2*x)/2;
    c = x-t;
    if(c + t == x && 2*c + 4*t == y && c >= 0 && t >= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  //int t;cin>>t;while(t--)
  solve();
  return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>                          
using namespace std;    
int n,a[15],x,num; 
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		x=max(x,a[i]);
		num+=a[i]; 
	}
	if(num-x>x) cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
using ll = long long;
using ld = long double;
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
using pll = pair<long long,long long>;
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
const long double pi = (acos(-1));
#define pb push_back
#define vs vector<string>

//最大最小の入れ替え
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
//コンビネーション
ll nCr(ll n, ll r) {
    ll ans = 1;
    for (ll i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (ll i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}
//素因数分解
map< ll, ll > prime_factor(ll n) {
  map< ll, ll > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

//切り上げの割り算は(a + b - 1) / bでできる

//ここから
int main(){
    ll N,R;
    cin>>N>>R;
    if(N>=10){
        cout<<R<<endl;
    }else{
        cout<<R+100*(10-N)<<endl;
    }
}


Measured memory_bytes: 3616
#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 ll  long long
#define PI  acos(-1)
#define pb  push_back
#define ins insert
#define INF 5000000000000000007 //1e18+7
#define mk  make_pair
#define ff  first
#define ss  second
#define endl "\n"
#define max3(x,y,z)  max(x,max(y,z))
#define min3(x,y,z)  min(x,min(y,z))
#define sz(a) (ll)a.size()
#define double long double
#define coud(a,b) cout << fixed << setprecision((b)) << (a)
#define mset(x,y)  memset(x,y,sizeof(x))
#define all(x)   (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bp(n)  __builtin_popcountll(n)
#define mxt(a)  *(max_element(a.begin(),a.end()))
#define mnt(a)  *(min_element(a.begin(),a.end()))
#define unique_sort(c) (sort(all(c)), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define trav(a, x)    for(auto &a : x)

const double eps=1e-7;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int d8x[8]={+1, +1, +1, 0, 0, -1, -1, -1};
int d8y[8]={+1, 0, -1, +1, -1, +1, 0, -1};
int d4x[4]={1, 0, 0, -1};
int d4y[4]={0, -1, 1, 0};
ll power(ll x,ll y){ll ans=1;x=x;while(y>0){if(y&1)ans=(ans*x);y=y>>1;x=(x*x);}return ans;}
ll sqr(ll x) { return x * x;}

template <typename T> T gcd(T a,T b){ if(a==0) return b; return gcd(b%a,a); }
template <class T> inline void chmax(T &x,T y){ x = max((x), (y));}
template <class T> inline void chmin(T &x,T y){ x = min((x), (y));}
template <class T> T abs(T x) { return x>0 ? x : -x;}
template <typename T> T powm(T a,T b, ll m){T cnt=1; while(b>0) { if(b%2==1) cnt=(cnt*a)%m; b/=2; a=(a*a)%m; }return cnt%m;}
typedef pair<int,int>  pii;
typedef pair<ll,ll>  pll;
typedef vector<pll>  vpll;
typedef vector<pii>  vpii;
typedef vector<ll>   vll;
typedef vector<int>  vii;
#define minpq priority_queue<T,vector<T>,greater<T> >;
// #define T int
// #define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
//*X.find_by_order(k) returns the kth largest element (0-based).
//X.order_of_key(val) returns the no. of values less than val.
ll ncr(ll n,ll r) {ll ans=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){ans*=(n-i);ans/=(i+1);}return ans;}
const int MOD = 1000000007;   
const int N = 1000100;

// 🎲
int n ,x ,a[N], cnt[N], gc, vis[N];
int32_t main() {
  cin.sync_with_stdio(0);cin.tie(0);
  cin.exceptions(cin.failbit);
  
  cin >> n;
  int ok = 1;
  rep(i,1,n) cin >> x, cnt[x] ++, gc = gcd(gc,x);
  
  for (int i=2; i<N; ++i) {
    if(vis[i]) continue;
    int sum = 0;
    for(int j = i; j<N; j += i) {
      vis[j] = 1;
      sum += cnt[j]; 
    }
    ok &= (sum < 2);
  }
  if(ok) {
    cout << "pairwise coprime";
  } else if(gc == 1) {
    cout << "setwise coprime";
    return 0;
  }
   else cout << "not coprime";
  return 0; 
}

/* 
    stuff you shoulds look for
    * int overflow,array bounds.
    * special cases (n=1?).
    * N,MOD value.
*/

Measured memory_bytes: 11456
//vec[i]の範囲外エラー表示
#define _GLIBCXX_DEBUG
//includeとusing
#include <bits/stdc++.h>
using namespace std;
//型名省略
using ll = long long;
using st = string;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vc = vector<char>;
using vvc = vector<vector<char>>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using pcc = pair<char, char>;
//定数
const ll INF = 1e9;
const ll MOD = 1e9+7;
const vl dx = {1,0,-1,0,1,0,-1,0};
const vl dy = {0,1,0,-1,0,1,0,-1};
//マクロ
#define rep(i,n) for(ll i = 0; i < (ll) n; i++)
#define rrep(i,n) for(ll i = (ll) n - 1; i >= 0;i--)
#define REP(i,x,n) for(ll i = (ll) x; i < (ll) n; i++)
#define RREP(i,x,n) for(ll i = (ll) n - 1; i >= x; i--)
#define each(i,A) for(ll i: (vl) A)
#define all(A) A.begin(), A.end()
#define Size(A) ll(A.size())
//入力
template<typename T> T input() {T x; cin >> x; return x;}
//正誤判定
void Yes(bool ans){cout << (ans? "Yes" : "No") << endl;}
void YES(bool ans){cout << (ans? "YES" : "NO") << endl;}
//余り切り上げ
ll ceil(ll a,ll b) {return (a + b - 1) / b;}
//最大値・最小値
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;}
//最大公約数
ll gcd(ll a,ll b){if(a<b)swap(a,b); if(a%b==0)return b; return gcd(b,a%b);}
//最小公倍数
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
//n乗の余り
ll modpow(ll x,ll n,ll mod){ll res=1;for(ll i=0;i<n;i++){res=res*x%mod;}return res;}
ll MODpow(ll x,ll n){ll res=1;for(ll i=0;i<n;i++){res=res*x%MOD;}return res;}


/*--------------------------------------------------------------------------*/

int main() {
    ll n; cin >> n;
    ll ans = (MODpow(10,n) - 2 * MODpow(9,n) + MODpow(8,n)) % MOD;
    ans = (ans + MOD) % MOD;
    cout << ans << endl;
}


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

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

    int n;
    cin >> n;
    int a[n], b[n], c[n-1];
    rep (i, n) cin >> a[i];
    rep (i, n) cin >> b[i];
    rep (i, n-1) cin >> c[i];
    int res = 0;
    rep (i, n) {
        res += b[a[i]-1];
        if (i > 0) {
            if (a[i]-a[i-1] == 1) res += c[a[i]-2];
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 3552
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<queue>
#include <cmath>
#include<algorithm>
#define rep(i,n) for (int i=0;i<n;i++)
//#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    cin>>N;
    vector<long int> A(N),B(N);
    rep(i,N) cin>>A[i]>>B[i];
    long int ans=0;
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    if (N%2==1)  ans=B[N/2]-A[N/2]+1;
    else{
        ans=(B[N/2]+B[N/2-1])-(A[N/2]+A[N/2-1])+1;
    }
    cout<<ans<<endl;

    return 0;
}

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

using namespace std;


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    vector<int> freq(26, 0);
    bool beautiful = true;
    
    string s;
    cin >> s;
    
    for(int i = 0; i < (int)s.size(); i++){
        freq[s[i] - 'a']++;
    }
    
    for(int i = 0; i < 26; i++){
        if(freq[i] % 2 != 0) beautiful = false;
    }
    
    if(beautiful){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
    
    
    return 0;
}

Measured memory_bytes: 3588
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {
	
	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			
			int answer = 0;
			for(int x = 1; x <= N; x += 2) {
				int cnt = 0;
				
				for(int y = 1; y <= N; y++) {
					if(x % y == 0) { cnt++; }
				}
				
				if(cnt == 8) { answer++; }
			}
			
			System.out.println(answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 21332
package main

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

func main() {
	stdin := bufio.NewScanner(os.Stdin)

	stdin.Scan()
	text := stdin.Text()
	a, _ := strconv.Atoi(strings.Split(text, "")[0])
	b, _ := strconv.Atoi(strings.Split(text, "")[1])
	c, _ := strconv.Atoi(strings.Split(text, "")[2])

	fmt.Printf("%v\n", a+b+c)
}


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

#ifdef _DEBUG
#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#else
#define DUMP(x)
#endif

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(i, n) REP(i, 0, n)
#define ALL(r) (r).begin(), (r).end()
using ll = int64_t;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main() {
    string s; int abcd[4];
    cin >> s; rep(i, 4) abcd[i] = s[i] - '0';

    rep(bit, 1 << 3) {
        int r = abcd[0];
        string x; x.push_back(abcd[0]+'0');
        rep(i, 3) {
            if (bit & (1 << i)) {
                r += abcd[i+1];
                x.push_back('+');
            } else {
                r -= abcd[i+1];
                x.push_back('-');
            }
            x.push_back(abcd[i+1]+'0');
        }
        if (r == 7) {
            cout << x << "=7" << endl;
            return;
        }
    }
}

signed main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3616
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i < j < k:
        if l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
          if l[i] + l[j] > l[k] and l[j] + l[k] > l[i] and l[k] + l[i] > l[j]:
            cnt += 1
print(cnt)

Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
int inf = 1000000000; //10e9
 
int main() {
    
    int N, A, B;
    string S;

    cin >> N >> A >> B;
    cin >> S;

    int pass_A = 0, pass_B = 0;

    for(int i = 0; i < N; i++){
        if((pass_A + pass_B) < A+B){
            if(S[i]=='a'){
                cout << "Yes" << endl;
                pass_A++;
            } if(S[i]=='b') {
                if(pass_B<B){
                    cout << "Yes" << endl;
                    pass_B++;
                }else{
                    cout << "No" << endl;
                }
            } if(S[i]=='c') {
                cout << "No" << endl;
            }
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3740
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.append(10 ** 10)
B.append(10 ** 10)
C.append(10 ** 10)

A.sort()
B.sort()
C.sort()

i, j, k = 0, 0, 0
count = 0
total = 0
result = 0

while i < N:
    while C[i] > B[j] and j < N:
        while B[j] > A[k] and k < N:
            count += 1
            k += 1
        total += count
        j += 1
    result += total
    i += 1

print(result)

Measured memory_bytes: 105444
#include <bits/stdc++.h>
using namespace std;
int a[1000];
int main()
{
    char s[10];
    scanf("%s",s+1);
    for(int i=1;i<=4;i++)
        a[s[i]]++;
    int flag=0;
    for(int i=1;i<=4;i++)
    {
        if(a[s[i]]!=2)
            flag=1;
    }
    if(flag==1)
        printf("No\n");
    else printf("Yes\n");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrep(i,a,b) for(int i=(int)(a);i>=(int)(b);--i)
#define fore(i,a) for(auto &i:a)
#define all(a) (a).begin(),(a).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
using ll = long long; constexpr int inf = INT_MAX / 2; constexpr ll infl = 1LL << 60;
template<class T>void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T>void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T>void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T>void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
template<class T>T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }

void _main() {
  string S;
  cin >> S;
  int n = S.size();
  int cnt_b = 0;
  int cnt_w = 0;

  rep(i, 0, n) {
    if (i%2 == 0) {
      if (S[i] == '0') cnt_w++;
      else cnt_b++;
    } else {
      if (S[i] == '1') cnt_w++;
      else cnt_b++;
    }
  }

  int ans = min(cnt_b, cnt_w);
  cout << ans << endl;
}

Measured memory_bytes: 512
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int (i)=(a);(i)<(b);++(i))
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cout<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef vector<int> vi;
typedef vector<lint> vl;
typedef vector<char> vc;
typedef vector<vector<int>> vii;
typedef vector<vector<lint>> vll;
typedef vector<vector<char>> vcc;

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

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

class D756 {
public:
    int N;

    void input(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in>>N;
    }

    void solve(std::istream& in, std::ostream& out){
        input(in, out);
        map<int, int> mp;
        RREP(i, N){
            int x = i;
           for(int j=2;j*j<=x;j++){
               while(x%j==0){
                   mp[j]++;
                   x /= j;
               }
           }
            if(x>1) mp[x]++;
        }

        vll dp(LEN(mp)+1, vl(77, 0));
        dp[0][1] = 1;
        int idx = 0;
        for(auto p : mp){
            REP(i, 76){
                REP(j, p.second+1){
                    dp[idx+1][min(76, i*(j+1))] += dp[idx][i];
                }
            }
            idx++;
        }
        out<<dp[LEN(mp)][75]<<'\n';
    }
};


int main() {
	D756 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256