akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define int ll
#define MOD (ll)(1e9+7)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

inline bool check(const string &s,int n){
	For(i,0,n/2-1) if(s[i]!=s[i+n/2]) return false;
	return true;
}

int32_t main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int a,b,x; cin>>a>>b>>x;
	if(a==0){
		cout<<b/x+1<<"\n";
		return 0;
	}
	if(a%x==0) a--;
	a/=x; b/=x;
	cout<<b-a<<"\n";
	return 0;
}












Measured memory_bytes: 256
#include<cstdio> 
#include<algorithm>
#include<map>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
const int maxn=100000+10;
map<int,int> f;
int a[maxn],b[maxn],c[maxn],d[maxn],fa[maxn*2];
int i,j,k,l,t,n,m,tot,ans;
int getfa(int x){
	return fa[x]==x?x:fa[x]=getfa(fa[x]);
}
int main(){
	scanf("%d",&n);
	fo(i,1,n) scanf("%d",&a[i]);
	fo(i,1,n) scanf("%d",&b[i]);
	t=0;
	fo(i,1,n) t^=a[i];
	a[n+1]=t;
	t=0;
	fo(i,1,n) t^=b[i];
	b[++n]=t;
	fo(i,1,n) c[i]=a[i],d[i]=b[i];
	sort(c+1,c+n+1);
	sort(d+1,d+n+1);
	fo(i,1,n+1)
		if (i>n||c[i]!=d[i]) break;
	if (i<=n){
		printf("-1\n");
		return 0;
	}
	fo(i,1,n)
		if (a[i]!=b[i]||i==n){
			if (i<n) ans++;
			if (!f[a[i]]) f[a[i]]=++tot;
			if (!f[b[i]]) f[b[i]]=++tot;
		}
	if (!ans){
		printf("0\n");
		return 0;
	}
	fo(i,1,tot) fa[i]=i;
	fo(i,1,n)
		if (a[i]!=b[i]) fa[getfa(f[a[i]])]=getfa(f[b[i]]);
	fo(i,1,tot)
		if (fa[i]==i) ans++;
	printf("%d\n",ans-1);
}

Measured memory_bytes: 8448
#include<bits/stdc++.h>
typedef long long LL;
using namespace std;
auto no = [](){cout << "NO"; exit(0);};
auto read = [](){int x; cin >> x; return x;};
int main(){
	ios::sync_with_stdio(false);
	LL K, A, B;
	cin >> K >> A >> B;
	K += 1;
	if(K < A){
		cout << K;
		return 0;
	}
	if(B <= A + 2){
		cout << K;
		return 0;
	}
	cout << A + (K - A) / 2 * (B - A) + (K - A) % 2;
}

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

#define ll long long
#define ar array

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
  	int n;
  	cin >> n;
  	ll ans = 0;
  	for(int i = 1; i <= n; i++)
    {
      if(i%3 != 0 && i%5 != 0)
      {
        ans+=i;
      }
    }
  	cout << ans;
}


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

void solver(){
  long long x;
  cin >> x;

  vector<bool> isPrime(1000000, true);
  isPrime[0] = false;
  isPrime[1] = false;
  long long ans = 0;
  bool next = false;
  for (int i = 0; i < isPrime.size(); i++) {
    if (i >= x){
      next = true;
    }
    if (isPrime[i]) {
      if (next) {
        ans = i;
        break;
      }
      for (int j = i; j < isPrime.size(); j=j+i) {
        isPrime[j] = false;
      }
    }
  }

  cout << ans << "\n";
}

int main() {
  solver();
  return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<vector<int>>a(2, vector<int>(n));
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < n; j++)cin >> a.at(i).at(j);
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int res = 0;
		for (int j = 0; j <= i; j++)res += a.at(0).at(j);
		for (int j = i; j < n; j++)res += a.at(1).at(j);
		ans = max(ans, res);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    //--<for debugging>
    #define whatis(x) cout << #x << " is " << x<<" ";
    #define whatisl(x) cout << #x << " is " << x<<"\n";
    #define parr(array,end)for(ll loop=0;loop<end;loop++)cout<<array[loop]<<" ";cout<<"\n";
    #define lline cout<<"\n";
    #define errorl(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout<<"\n";}
    #define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout<<"___";}
        
    void err(istream_iterator<string> it) {}
    template<typename T, typename... Args>
    void err(istream_iterator<string> it, T a, Args... args) {
        cout << *it << " = " << a <<" , ";
        err(++it, args...);
    }
    //--</for debugging> 
    #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
    #define testcase ll tt; cin >> tt; while(tt--)
    #define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
    #define pb push_back 
    #define vars ll h,i,j,k,d,l,p,q,r,x,y,a,b,c,v,var,n,m,z,s,ans,ind1,ind2,flag,limit1,limit2,limit3,mod;
    #define vll vector<ll>
    #define pll pair<ll,ll>
    #define sll set<ll>
    #define pint pair<int,int>
    const ll INF=1e9+7;
    const ll MOD=1e9+7;
    int main()
    {
        boost vars
        cin>>n>>m;
        string str;
        for(i=0;i<n;i++)
        {
            cin>>str;
            cout<<str<<"\n";
            cout<<str<<"\n";
        }
    }

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<stdio.h>
#include<vector>
#include<cctype>
using namespace std;
int total(int a, int b) {
	int c = 0;
	for (int i = 0; i < (b + 1) - a; i++) {
		c = c + a + i;
	}
	return c;
}
int gcd(int a, int b) {
	int c, x;
	x = a * b;
	c = b % a;
	while (c != 0) {
		b = a;
		a = c;
		c = b % a;
	}
	return x / a;
}
void InitRand() {
	srand((unsigned int)time(NULL));
}
int random(int n) {
	return rand() % n + 1;
}
int pri(int a) {
	int ans = 0;
	for (int i = 2; i < a; i++) {
		if (a % i != 0)ans++;
	}
	if (ans == 0) {
		return 0;
	}
	else {
		return 1;
	}
}
#define rep( i, n) for(int i=0;i<n;i++)
#define vint(abc, n) vector<int> abc(n);
#define vinta(abc, n, x) vector<vector<int> > abc(n,vector<int>(x);
#define vche(abc, n) vector<cher> abc(n);
#define printl(a) printf("%d \n",a);
#define printb(a)printf("%s \n",a);
#define scanl(a) scanf("%d",&a);
#define scanb(a) scanf("%s",&a);
#define in(a) cin>>a;
#define out(a) cout<<a<<endl;
#define pi 3.1415926535897932384626;
int main() {
	int n, a = 0, b = 0;
	cin >> n;
	vector<string> tar(n);
	vector<string> han(n);
	for (int i = 0; i < n; i++) {
		cin >> tar[i] >> han[i];
		if (tar[i] < han[i]) {
			b += 3;
		}
		if (tar[i] > han[i]) {
			a += 3;
		}
		if(tar[i]==han[i]) {
			a++;
			b++;
		}
    }
	cout << a << " " << b << endl;
	return 0;
}


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

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

using namespace std;

/* function */
//  - none - 


/* code */
int main (void) 
{

  /* Variable_Proclamation */
  int N;    // input
  int A, B;    // input
  string ans;  // output

  int left_end, right_end;


  /* Input, Array_Proclamation */
  cin >> N;
  cin >> A >> B;


  /* Initialize */
  left_end  = 1;
  right_end = N;


  /* Calculation */
  while(true)
  {

    if(A+1 == B && A == left_end)
    {
      ans = "Borys";
      break;
    }
    else if(A+1 == B)
    {
      A--;
    }
    else
    {
      A++;
    }
    
    if(A == B-1 && B == right_end)
    {
      ans = "Alice";
      break;
    }
    else if(A == B-1)
    {
      B++;
    }
    else
    {
      B--;
    }

  }


  /* Output */
  cout << ans << endl;


  return 0;

}


/* entity */
//  - none -




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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

void SMTB2019F()
{
	int T1, T2;
	cin >> T1 >> T2;
	ll A1, A2;
	cin >> A1 >> A2;
	ll B1, B2;
	cin >> B1 >> B2;

	ll C1 = A1 - B1;
	ll C2 = A2 - B2;

	if ((C1 / abs(C1)) * (C2 / abs(C2)) > 0.0)
	{
		cout << 0 << endl;
		return;
	}
	ll D1 = C1 * T1;
	ll D2 = C1 * T1 + C2 * T2;
	if (D2 == 0)
	{
		cout << "infinity" << endl;
		return;
	}
	if ((D1 / abs(D1)) * (D2 / abs(D2)) > 0)
	{
		cout << 0 << endl;
		return;
	}

	ll N = -D1 / D2;
	if (D1 % D2 == 0)
	{
		cout << 2 * N << endl;
	}
	else
	{
		cout << 2 * N + 1 << endl;
	}
}
int main()
{
	SMTB2019F();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll n,l[2005];
ll ans;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>l[i];
    }
    sort(l,l+n);
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            int K=lower_bound(l+j+1,l+n,l[j]-l[i]+1)-l;
            int L=lower_bound(l+j+1,l+n,l[i]+l[j])-l;
            ans+=(L-K);
            //cout<<L<<" "<<K<<" "<<ans<<endl;
        }
    }
    cout<<ans<<endl;
    
}


Measured memory_bytes: 256
import java.util.*;

 
class Main {
 
    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

    int a = Integer.parseInt(sc.next());
    int b = Integer.parseInt(sc.next());
    int ans=0;
    for(int i=0;i<2;i++){
        if(a>b){
            ans+=a;
            a=a-1;
        }else{
            ans+=b;
            b=b-1;
        } 
    }
    System.out.println(ans);

}
}

Measured memory_bytes: 22740
#include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <limits>
#include <map>
#include <set>
#include <iomanip>
#include <cmath>

using namespace std;

typedef long long int ll;
typedef std::numeric_limits<double> dbl;
const long long int LL_INF=1LL<<60;

vector<string> split(const string& input, char delimiter)
{
    stringstream stream(input);
    
    string field;
    vector<string> result;
    while (getline(stream, field, delimiter)) {
        result.push_back(field);
    }
    return result;
}

//#define DEBUG

ll A, B, M, N, D, K, L, Q, W, H, T, X, Y, S;

int main()
{
    cin >> N >> K;
    ll sum = 0;
    for (int i = 0; i < N; ++i) {
        int x; cin >> x;
        ll get = min((int)K-x, x);
        sum += get*2;
    }   
    cout << sum << endl;

    return 0;
}

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

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	int a, b; cin >> a >> b;
	if (0 < a)cout << "Positive" << endl;
	else if (a <= 0 && 0 <= b)cout << "Zero" << endl;
	else if ((b - a + 1) % 2)cout << "Negative" << endl;
	else cout << "Positive" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;

class value {
public:
	long long x; 
	long long y;
	long long z;
};

int main(){
	int N, M;
	cin >> N >> M;
	value v[N];
	long long total[8][N];
	long long sum[8];
	long long ret = 0LL;
	for(int i = 0; i < N; i++){
		cin >> v[i].x >> v[i].y >> v[i].z;
		total[0][i] = v[i].x + v[i].y + v[i].z;
		total[1][i] = v[i].x + v[i].y - v[i].z;
		total[2][i] = v[i].x - v[i].y + v[i].z;
		total[3][i] = v[i].x - v[i].y - v[i].z;
		total[4][i] = -v[i].x + v[i].y + v[i].z;
		total[5][i] = -v[i].x + v[i].y - v[i].z;
		total[6][i] = -v[i].x - v[i].y + v[i].z;
		total[7][i] = -v[i].x - v[i].y - v[i].z;
	}
	for(int k = 0; k < 8; k++){
		sort(total[k],total[k]+N,greater<long long>());
		sum[k] = 0LL;
		for(int i = 0; i < M; i++){
			sum[k] += total[k][i];
		}
		if(sum[k] > ret){
			ret = sum[k];
			//cout << k << " is win" << endl << endl;
		}else{
			//cout << k << " is lose" << endl << endl;
		}
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int A,B,C;
    cin >> A >> B >> C;
    if ((A == B && B != C) || (A != B && B == C) || (A == C && A != B)) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
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; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;cin >> n >> m;
    char a[n][n],b[m][m];
    REP(i,n) REP(j,n) cin >> a[i][j];
    REP(i,m) REP(j,m) cin >> b[i][j];
    for(int i=0;i+m-1<n;i++){
        for(int j=0;j+m-1<n;j++){
            bool f=true;
            REP(k,m){
                REP(l,m){
                    if(a[i+k][j+l]!=b[k][l]) f=false;
                }
            }
            if(f){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 3508
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#include <cctype>
#define ll long long
#define INF 1e+7
#define MOD 1000000007
using namespace std;


int main(){
    int n;
    cin >> n;
    int v[n];
    for(int i=0; i<n; i++){
        cin >> v[i];
    }
    
    int even[n/2], odd[n/2];
    for(int i=0; i<n/2; i++){
        even[i]=v[2*i];
        odd[i]=v[2*i+1];
    }
    
    sort(even,even+n/2);
    sort(odd,odd+n/2);
    
    int num1[n/2];
    int num2[n/2];
    
    num1[0]=1;
    for(int i=1; i<n/2; i++){
        if(even[i]==even[i-1]){
            num1[i]=num1[i-1]+1;
        }else{
            num1[i]=1;
        }
    }
    
    num2[0]=1;
    for(int i=1; i<n/2; i++){
        if(odd[i]==odd[i-1]){
            num2[i]=num2[i-1]+1;
        }else{
            num2[i]=1;
        }
    }
    
    int max1=0, max2=0, max3=0, max4=0;
    int v1,v2;
    for(int i=0; i<n/2; i++){
        if(i==n/2-1 || num1[i+1]==1){
            if(max1<=num1[i]){
                max2=max1;
                max1=num1[i];
                v1=even[i];
            }else if(max2<=num1[i]){
                max2=num1[i];
            }
        }
        
        if(i==n/2-1 || num2[i+1]==1){
            if(max3<=num2[i]){
                max4=max3;
                max3=num2[i];
                v2=odd[i];
            }else if(max4<=num2[i]){
                max4=num2[i];
            }
        }
    }
    
    if(v1!=v2){
        cout<<n-max1-max3<<endl;
    }else{
        cout<<n-max(max1+max4, max2+max3)<<endl;
    }
    

    return 0;
}


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

using namespace std;

//#define int long long



signed main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //------<<<<>>>>-----//
    int h,w,a,b;
    cin>> h>> w>> a>> b;
    for(int i = 0;i<h;i++){
        for(int j = 0;j < w;j++){
            cout << ((j < a) ^ (i < b));
        }
        cout << '\n';
    }
    return 0;
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    int k;
    cin >> s >> k;
    rep (i, s.size()) {
        if (i != s.size() - 1) {
            if (k < 26 - (s[i] - 'a') || s[i] == 'a') continue;
            k -= (26 - (s[i] - 'a'));
            s[i] = 'a';
        } else {
            s[i] = 'a' + (s[i] - 'a' + k) % 26;
        }
    }
    cout << s << endl;
    
    return 0;
}



Measured memory_bytes: 592
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
#include<unordered_map>
#include <queue>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()
 
int main(){
    ll n;
    cin >> n;
    string s;
    cin >> s;

    ll res = 0;
    string l = "";
    string sc = s;
    rep(i, n){
        l = l + s[i];
        sc.erase(sc.begin());
        while(sc.find(l) == string::npos && l.size() > 0){
            l.erase(l.begin());
        }
        res = max(res, (ll)l.size());
    }
    cout << res << endl;
}

Measured memory_bytes: 256
import java.io.*;

class Main{
    public static void main(String[] args) throws NumberFormatException,IOException{
        BufferedReader r =
         new BufferedReader(new InputStreamReader(System.in), 1);
          
        String line = r.readLine();    
        String[] w = line.split(" ",0);
        int ret[]={0,0,0};
        ret[0]=Integer.parseInt(w[0]);
        ret[1]=Integer.parseInt(w[1]);
        ret[2]=Integer.parseInt(w[2]);
        
        int buf = 0;
        for (int j=0;j<=2-1 ;j++){
            for (int i =2;i>j;i--){
                if(ret[i] < ret[i-1]) {
                    buf = ret[i-1];
                    ret[i-1]=ret[i];
                    ret[i]=buf;
                }
            }
        }      
        System.out.println(ret[0]+" "+ret[1]+" "+ret[2]);
        r.close();
    }
}

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

int main(void) {
	vector<int> V(101, 0);
	int A, B, C, D;

	cin >> A >> B >> C >> D;
	for (int i = A; i < B; ++i)
		++V[i];
	for (int i = C; i < D; ++i)
		++V[i];

	int ans = 0;
	for (int i = 0; i <= 100; ++i) {
		if (V[i] == 2)
			++ans;
	}

	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            new Main().solve(sc);
        }
    }

    void solve(Scanner sc) {
        int d = sc.nextInt();
        int g = sc.nextInt();
        int[] p = new int[d];
        int[] c = new int[d];
        for (int i = 0; i < d; i++) {
            p[i] = sc.nextInt();
            c[i] = sc.nextInt();
        }

        int ans = Integer.MAX_VALUE;
        for (int i = 0; i < (1 << d); i++) {
            int point = 0;
            int count = 0;
            for (int j = 0; j < d; j++) {
                if (((i >> j) & 1) == 1) {
                    point += c[j] + (j + 1) * 100 * p[j];
                    count += p[j];
                }
            }

            if (point < g) {
                count = plus(p, c, i, d, count, point, g);
            }
            ans = Math.min(ans, count);
        }
        System.out.println(ans);
    }

    int plus(int[] p, int[] c, int i, int d, int count, int point, int g) {
        for (int j = d - 1; j >= 0; j--) {
            if (((i >> j) & 1) == 0) {
                for (int k = 0; k < p[j]; k++) {
                    point += (j + 1) * 100;
                    count++;

                    if (point >= g) {
                        return count;
                    }
                }
            }
        }
        return count;
    }
}

Measured memory_bytes: 21716
from fractions import gcd
from collections import Counter
a, b = map(int, input().split())

gcdv = gcd(a, b)

prime_cnt = Counter()
n = gcdv
for i in range(2, int(gcdv ** 0.5) + 2):
    while n % i == 0:
        n //= i
        prime_cnt[i] += 1

prime_cnt[n] += 1
prime_cnt[1] += 1

print(len(prime_cnt.keys()))


Measured memory_bytes: 5048
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(200000000)


# my functions here!

#入力

def pin(type=int):
    return map(type,input().rstrip().split())

def resolve():
    N=input()
    temp=""
    for i in range(5):
        temp+="hi"
        #print(N,temp)
        if N==temp:
            print("Yes")
            return
    print("No")
    #print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
#if __name__=="__main__":resolve()

"""
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """hihi"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """hi"""
        output = """Yes"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """ha"""
        output = """No"""
        self.assertIO(input, output)

if __name__=="__main__":resolve()

Measured memory_bytes: 6256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+10;
ll a[maxn*2];
vector<int>ans;
ll b[maxn*2];
int main()
{
     int n;
     cin>>n;
     for(int i=1;i<=n;i++)
        cin>>a[i];
        //b[i]=a[i];
    for(int i=n;i>=1;i--)
    {
        ll re=0;
        for(int j=2;j*i<=n;j++)
        {
            re+=b[j*i];
        }
        re%=2;
        if(re!=a[i])
        {
            b[i]=1;
            ans.push_back(i);

        }
        else
        {
            b[i]=0;
        }
    }
    cout<<ans.size()<<endl;
    for(int i=0;i<ans.size();i++)
        cout<<ans[i]<<endl;
    return 0;
}


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

using namespace std;

typedef long long ll;

int main() {
		int x, y, z, k;
		cin >> x >> y >> z >> k;
		
		vector<ll> a(x), b(y), c(z);
		for (int i = 0; i < x; i++) cin >> a[i];
		for (int i = 0; i < y; i++) cin >> b[i];
		for (int i = 0; i < z; i++) cin >> c[i];

		sort(a.begin(), a.end());
		reverse(a.begin(), a.end());
		sort(b.begin(), b.end());
		reverse(b.begin(), b.end());
		sort(c.begin(), c.end());
		reverse(c.begin(), c.end());

		vector<ll> abc;
		for (int i1 = 0; i1 < x; i1++) {
				for (int i2 = 0; i2 < y; i2++) {
						if ((i1+1) * (i2+1) > k) break;
						for (int i3 = 0; i3 < z; i3++) {
								if ((i1+1) * (i2+1) * (i3+1) > k) break;
								abc.push_back(a[i1] + b[i2] + c[i3]);
						}
				}
		}

		sort(abc.begin(), abc.end());
		reverse(abc.begin(), abc.end());

		for (int i = 0; i < k; i++) cout << abc[i] << endl;
		return 0;
}


Measured memory_bytes: 1404
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <cstring>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59
using ld = long double;

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

    ll N;
    ll A, B, C, D, E;
    cin >> N >> A >> B >> C >> D >> E;

    if (N % min({A, B, C, D, E}) == 0)
    {
        cout << 4 + N / min({A, B, C, D, E}) << endl;
    }
    else
    {
        cout << 5 + N / min({A, B, C, D, E}) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
l=[]
for i in range(3):
    l.append(list(map(int, input().split())))
n = int(input())
for i in range(n):
    m = int(input())

    for j in range(3):
        for k in range(3):
            if l[j][k] == m:
                l[j][k] = -1
o=0
p=0
for j in range(3):
    for k in range(3):
        o+=l[j][k]
        p+=l[k][j]
    if o==-3 or p==-3:
        print('Yes')
        exit()
    o=0
    p=0
if l[0][0]+l[1][1]+l[2][2]==-3 or l[0][2]+l[1][1]+l[2][0]==-3:
    print('Yes')
else:
    print('No')

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

using namespace std;

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

	a = s[0] - '0';
	b = s[1] - '0';
	c = s[2] - '0';
	d = s[3] - '0';

	for(unsigned int i = 0; i < 8; ++i) {
		unsigned int x;
		if (i & 0x4) {
			x = a + b;
		} else {
			x = a - b;
		}
		if (i & 0x2) {
			x += c;
		} else { 
			x -= c;
		}
		if (i & 0x1) {
			x += d;
		} else { 
			x -= d;
		}

		if (x == 7) {
			string s("-");
			string y("-");
			string z("-");
			if (i & 0x4) {
				s = '+';
			}
			if (i & 0x2) {
				y = '+';
			}
			if (i & 0x1) {
				z = '+';
			}
			cout << a << s << b << y << c << z << d << "=7" << endl;
			return 0;
		}
	}

	cout << "-1 -1 -1" << endl;
	return 0;
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n, m;
  cin >> n >> m;
  m = 2 * m + 1;
  cout << (n + m - 1) / m << endl;
  return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
p=list(map(lambda x:int(x)-1,input().split()))
xy=[list(map(int,input().split())) for _ in range(m)]
g=[[]for _ in range(n)]
for x,y in xy:
  g[x-1].append(y-1)
  g[y-1].append(x-1)
# 連結成分を探索
renktsu=[]
seen=[-1]*n
todo={i for i in range(n)}
while todo:
  t0=todo.pop()
  todo1=[t0]
  while todo1:
    t=todo1.pop()
    seen[t]=t0
    todo.discard(t)
    l=g[t]
    for li in l:
      if seen[li]==-1:
        todo1.append(li)
ans=0
for i in range(n):
  if seen[i]==seen[p[i]]:
    ans+=1
print(ans)


Measured memory_bytes: 123036
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

n = int(input()) 
a = list(map(int,input().split()))

l = lcm(*a)

MOD = 10**9+7
ans = 0
for i in range(n):
    ans += l // a[i]
print(ans % MOD)


Measured memory_bytes: 76300
mod = 2019
l, r = map(int, input().split())

if r//mod - l//mod > 0:
  print(0)
else:
  l %= mod
  r %= mod
  ans = mod
  for i in range(l+1, r+1):
    for j in range(l, i):
      ans = min(i*j%mod, ans)
    if ans == 0:
      break
  print(ans)

Measured memory_bytes: 3060
def gcd(a, b)
  return a if b == 0
  return gcd(b, a % b)
end

def lcm(a, b)
  return a / gcd(a, b) * b
end

n = gets.to_i
a = gets.split.map(&:to_i)
mod = 10**9 + 7

l = 1
a.each do |ai|
  l = lcm(l, ai)
end
ans = 0
a.each do |ai|
  ans += l / ai
end

p ans % mod


Measured memory_bytes: 63432
#include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ll long long int
using namespace std;
int main(){
	io;
	char s[15];
	char t[15];
	int a,b;
	char u[15];
	cin >> s >> t >> a >> b >> u;
	if(strcmp(s,u) == 0){
		a -= 1;
	}
	if(strcmp(t,u) == 0){
		b -= 1;
	}
	cout << a << " " << b;
	return 0; 
}

Measured memory_bytes: 256
import numpy as np

n,k,q = map(int, input().split())
a = np.zeros(n)
for i in range(0,q):
  b = int(input())
  a[b-1] += 1

for i in range(0,n):
  a[i] = q - a[i]
  if a[i] >= k:
    print("No")
  else:
    print("Yes")

Measured memory_bytes: 13976
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

# define big_int (int)(1e+9 + 7)

using namespace std;

int main(int argc, const char * argv[]) {
    
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int64_t n, m; cin >> n >> m;
    vector<int64_t> s(n), t(m);
    for (int i = 0; i < n; i++) cin >> s.at(i);
    for (int i = 0; i < m; i++) cin >> t.at(i);
    
    vector<vector<int64_t>> dp(n + 1, vector<int64_t>(m + 1, 0));
    for (int i = 0; i <= n; i++) dp.at(i).at(0) = 1;
    for (int j = 0; j <= m; j++) dp.at(0).at(j) = 1;
    
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (s.at(i) == t.at(j)) {
                dp.at(i + 1).at(j + 1) = (dp.at(i + 1).at(j) + dp.at(i).at(j + 1)) % big_int;
            } else {
                dp.at(i + 1).at(j + 1) = (dp.at(i + 1).at(j) + dp.at(i).at(j + 1) - dp.at(i).at(j)) % big_int;
                while (dp.at(i + 1).at(j + 1) < 0) {
                    dp.at(i + 1).at(j + 1) += big_int;
                }
            }
        }
    }
    
    cout << dp.at(n).at(m) % big_int << endl;
    
    return 0;
}


Measured memory_bytes: 31616
def gcd(a, b):
    if a > b:
        a, b = b, a
    while a:
        a, b = b%a, a
    return b
N,x1 = map(int, input().split())
xs = list(map(int, input().split()))
xs.append(x1)
xs.sort()
margin = [y-x for y,x in zip(xs[1:],xs[:-1])]
m = margin[0]
for x in margin[1:]:
    m = gcd(m,x)
print(m)

Measured memory_bytes: 14252
/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;

ll fact[500004];
ll inv[500004];

ll calc(ll a , ll b) {
	if(b==0) return 1;

	if(b%2==0) {
		return calc((a*a)%M , b/2);
	}
	else {
		return (a*calc((a*a)%M , b/2))%M;
	}
}

void init() {

	fact[0]=1;

	for(ll i=1 ; i<500001 ; i++) fact[i] = (i*fact[i-1])%M;

	inv[500000] = calc(fact[500000] ,  M-2);
    //cout << inv[3] << endl;
    
    for(ll i=499999 ; i>=0 ; i--) {
    	inv[i] = ((i+1)*(inv[i+1]))%M;
    	// if(i <= 20) {
    	 	//cout << inv[i] << endl;
    	// }
    }
}

ll ncr(ll x , ll y) {
	ll t = (fact[x]*inv[x-y])%M;
	t = (t*inv[y])%M;

	return t;
}

int main()
{   
    //#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    //freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    //freopen("output.txt", "w", stdout);
    //#endif

    ll n , k;
    cin >> n >> k;

    init();

    ll ans=0;

    k = min(n-1 , k);

    for(ll i=0 ; i<=k ; i++) {
    	ans = (ans + (ncr(n , i)*ncr(n - i + i-1 , i))%M )%M;
    	//cout << ans << " ";
    }

    cout << ans ;

    // (n+k-1)! / (n-1)!*k!
}

Measured memory_bytes: 8192
moji = list(input())
x = len(moji) -1
for i in range(2**x):
    ope = ['-'] * 3
    formula = ''
    for j in range(x):
        if (i>>j)&1:
            ope[j] = '+'
    for mo,op in zip(moji, ope+['']):
        formula += (mo+op)
    if eval(formula) == 7:
        print(formula, '=7', sep='')
        break


Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>

using namespace std;

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

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

int main(){
    int N;
    cin>>N;
    int a;
    if (N < 105) a = 0;
    else if (N < 135) a = 1;
    else if (N < 165) a = 2;
    else if (N < 189) a = 3;
    else if (N < 195) a = 4;
    else a = 5;
    cout<<a<<endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"

using namespace std;

int main() {
	int n, d, x;
	cin >> n >> d >> x;
	int ans = x;
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		ans++;
		for (int j = 2; j <= d; j++)
		{
			if ((j - 1) % a == 0)ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
import numpy as np


def read():
    N = int(input().strip())
    X = np.fromstring(input().strip(), dtype=np.int32, sep=" ")
    return N, X


def solve(N, X):
    A = np.argsort(X)
    l, r = X[A[N//2-1]], X[A[N//2]]
    mid = (l + r) / 2
    for x in X:
        if x <= mid:
            print(r)
        else:
            print(l)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


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

int main(){
  int A, B, C, D;
  cin >> A >> B >> C >> D; 
  if(A+B>C+D) cout << "Left" << endl;
  else if(A+B<C+D) cout << "Right" << endl;
  else cout << "Balanced" << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>

using namespace std;

// read to vector
// for example M_RTV(as, int, n) expands to the below:
// ```
// vector<int> as(n);
// for(int lcnt = 0; lcnt < n; lcnt++) cin >> as[lcnt];
// ```
#define M_RTV(ident, type, cnt) \
    vector<type> ident(cnt);\
    do {\
        for(int lcnt = 0; lcnt < cnt; lcnt++) cin >> ident[lcnt];\
    } while(false)

// shorthand for range
#define M_RG(ident) ident.begin(), ident.end()

// https://qiita.com/EqualL2/items/b4683db7ab4e90545bb2
int ctoi(const char c){
    return (c-'0');
}

int main() {
    string s;
    cin >> s;
    cout << ((s[2] == s[3] && s[4] == s[5]) ? "Yes" : "No") << endl;
}


Measured memory_bytes: 256
//package Round613;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

/**
 * @author sguar <shugangcao@gmail.com>
 * welcome to kuaishou
 * Created on 2020-01-12
 */
public class Main {
    boolean maze[][];
    int xi[] = {-1, 1, 0, 0};
    int yi[] = {0, 0, -1, 1};
    int n, m;
    public void run() {
        Scanner cin = new Scanner(System.in);
        n =  cin.nextInt();
        m = cin.nextInt();
        cin.nextLine();
        maze = new boolean[n][m];
        for (int i = 0; i < n; i++) {
            String s = cin.nextLine();
            for (int j = 0; j < m; j++) {
                if (s.charAt(j) == '.') {
                    maze[i][j] = true;
                }
                //System.out.print(maze[i][j]);
            }
            //System.out.println("");
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                if (maze[i][j]) {
                    ans = Math.max(ans, solve(i, j));
                }
            }
        }
        System.out.println(ans);
    }

    public int solve(int x, int y) {

        Queue<Point> queue = new LinkedList<>();
        queue.add(new Point(x, y, 0));
        int ans = 0;
        boolean[][] vis = new boolean[n][m];
        vis[x][y] = true;
        while (!queue.isEmpty()) {
            Point p = queue.remove();
            ans = Math.max(ans, p.num);
            for (int i = 0; i <= 3; i++) {
                int nx = xi[i] + p.x;
                int ny = yi[i] + p.y;
                if (nx >= 0 && nx < n && ny >= 0 && ny < m && maze[nx][ny] && !vis[nx][ny]) {
                    vis[nx][ny] = true;
                    queue.add(new Point(nx, ny, p.num + 1));
                }
            }
        }
        return ans;
    }
    class Point {
        int x;
        int y;
        int num;
        public String toString() {
            return x + "," + y + "=" + num;
        }
        Point(int x, int y, int num) {
            this.x = x;
            this.y = y;
            this.num = num;
        }
    }

    public static void main(String[] args) {
       new Main().run();
    }
}



Measured memory_bytes: 29652
/**
 * File              : B.cpp
 * Author            : JCHRYS <jchrys@me.com>
 * Date              : 26.01.2020
 * Last Modified Date: 26.01.2020
 * Last Modified By  : JCHRYS <jchrys@me.com>
 */

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

int main() {
    int h;
    int n;
    cin >> h >> n;
    vector<int> a(n);
    int total = 0;
    for (int i = 0; i < n; i++) {
        int tmp;
        cin >> tmp;
        total += tmp;
    }
    if (h <= total) {
        cout << "Yes";
    } else {
        cout << "No";
    }
    

    return 0;
}


Measured memory_bytes: 640
#include<stdio.h>

int main(){
  int box[55555]={},a[55],i,j,n,cnt=0;
  scanf("%d",&n);
  for(i=2;i<55555;i++)box[i]=1;
  for(i=2;i<55555;i++){
    if(box[i]){
      if(i%10==1) a[cnt++]=i;
      for(j=i;j<55555;j+=i) box[j]=0;
    }
    if(cnt==n) break;
  }
  for(i=0;i<n;i++){
    printf("%d ",a[i]);
  }
  printf("\n");
}

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

int main(){
    string s,t;
    cin >> s >> t;
    int a,b;
    a = s.size();
    b = t.size();
    int ans = b;
    for(int i=0; i<=a-b; i++){
        int cnt=0;
        for(int j=0; j<b; j++){
            if(s.at(i+j) != t.at(j)){
                cnt++;
            }
        }
        //cout << cnt << endl;
        ans = min(ans,cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S, T;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

int main(){
    cin>>N;
    ll ans = 1;
    reps(i,1,N+1){
        (ans *= i)%=MOD;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

#define INF 1000000001
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

int a[1000];

int main(void)
{
	int n, q, i, b, c, k, ans;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", a + i);
	}
	scanf("%d", &q);
	while (q--) {
		scanf("%d%d%d", &b, &c, &k);
		ans = 0;
		for (i = b; i < c; i++) {
			if (a[i] == k) ++ans;
		}
		printf("%d\n", ans);
	}
	return 0;
}



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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

// 約数列挙
vector<ll> divisor(ll N) {
    vector<ll> res;
    for (ll i = 1L; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            ll j = N / i;
            if (j != i)  {
                res.push_back(j);
            }
        }
    }
    sort(res.begin(), res.end());
    return res;
}

void Main() {
    ll N, K;
    cin >> N >> K;
    int ans = 1;
    while (N / K > 0){N = N / K; ans += 1;}
    cout << ans << endl;
}

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


Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  }
}


Measured memory_bytes: 36688
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
mx = max(a)

c = Counter(a)
nu = {k for k, v in c.items() if v > 1}

s = set()
u = set()
for aa in a:
    m = 2
    if aa in s or aa in u:
        continue
    u.add(aa)
    while aa*m <= mx:
        s.add(aa*m)
        m += 1

o = 0
for aa in a:
    if aa in s or aa in nu:
        continue
    o += 1

print(o)


Measured memory_bytes: 93740
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 10L^^15;
enum mod = 10L ^^ 9 + 7;

void main() {
    int n;
    scan(n);
    auto p = readln.split.to!(double[]);

    auto dp = new double[][](n + 1, n + 1);
    fillAll(dp, 0);
    dp[0][0] = 1;

    foreach (i ; 0 .. n) {
        foreach (j ; 0 .. n) {
            dp[i+1][j+1] += dp[i][j] * p[i];
            dp[i+1][j] += dp[i][j] * (1 - p[i]);
        }
    }

    debug {
        writefln("%(%s\n%)", dp);
    }

    double ans = 0;
    foreach (i ; (n + 1) / 2 .. n + 1) {
        ans += dp[n][i];
    }

    writefln("%.12f", ans);
}







void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

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

using namespace std;
typedef long long ll;

int main() {
  ll A; cin >> A;
  ll B; cin >> B;
  ll K; cin >> K;
  vector<ll> set;
  for (ll j=A; j <= min(A+K-1, B); ++j) {
    set.push_back(j);
  }
  for (ll j=max(B-K+1, A); j <= B; ++j) {
    set.push_back(j);
  }
  sort(set.begin(), set.end());
  set.erase(unique(set.begin(), set.end()), set.end());
  for (ll j: set) {
    cout << j << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int i = 0; i < (n); ++i)
typedef long long ll;


int main(void) {
  ll h;
  cin >> h;
  ll h_copy = h;
  ll kazu = 1;
  ll ans = 0;
  queue<ll> Q;
  Q.push(kazu);
  while(h_copy != 1) {
    h_copy /= 2;
    kazu *= 2;
    Q.push(kazu);
  }

  while(Q.empty() != 1) {
    ans += Q.front();
    Q.pop();
  }

  cout << ans << endl;


  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#define int long long
using namespace std;

signed main() {
    int n;
    int d[100000];
    int l,r,ans;

    cin >> n;

    for(int i = 0; i < n; i ++){
        cin >> d[i];
    }
    sort(d,d+n);
    r = n/2;
    l = r-1;
    ans = d[r]-d[l];
    cout << ans;
    return 0;
}

Measured memory_bytes: 4424
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    for (auto &e : a) std::cin >> e;
    int ret = 0;
    for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) ret += a[i] * a[j];
    std::cout << ret << std::endl;

    return 0;
}


Measured memory_bytes: 256
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A, B = map(int, input().split())
    P = list(map(int, input().split()))

    C = [0] * 3
    for p in P:
        if p <= A:
            C[0] += 1
        elif p <= B:
            C[1] += 1
        else:
            C[2] += 1
    
    ans = min(C)
    print(ans)


if __name__ == "__main__":
    main()


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

//Function Macros:
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)

//Type Definitions:
typedef long long ll;
typedef unsigned long long ull;

//Constants:
const int INF = 2e9;
const int MOD = 1e9 + 7;

//Global Variables:

//Prototype Declarations:
int gcd(int, int);
bool isPrime(int);

//================ Main Loop ================
int main() {
    int x;
    cin >> x;
    if(x != 2 && x % 2 == 0) x++;
    while(!isPrime(x)) {
        x += 2;
    }
    cout << x << endl;
    return 0;
}
//===========================================

//Functions:
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

bool isPrime(int num) {
    if(num < 2)
        return false;
    else if(num == 2)
        return true;
    else if(num % 2 == 0)
        return false;

    double sqrtNum = sqrt(num);
    for(int i = 3; i <= sqrtNum; i += 2) {
        if(num % i == 0) {
            return false;
        }
    }
    return true;
}

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

int main(){
    int N,K;
    cin>>N>>K;
    int h[N],cost[N];
    for (int i=0;i<N;i++){
        cin>>h[i];
    }
    cost[0]=0;
    cost[1]=abs(h[1]-h[0]);
    for (int j=2;j<N;j++){
        cost[j]=cost[j-1]+abs(h[j]-h[j-1]);
        for (int k=2;k<=min(j,K);k++){
            if (cost[j]>cost[j-k]+abs(h[j]-h[j-k])) cost[j]=cost[j-k]+abs(h[j]-h[j-k]);
        }
    }
    cout<<cost[N-1]<<endl;
    return 0;
}

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

int main(){
  int N,M;
  cin>>N>>M;
  
  int sum=0;
  int A[M];
  rep(i,M){
    cin>>A[i];
    sum+=A[i];
  }
  
  int ans=N-sum;
  if(ans<0)ans=-1;
  cout<<ans<<endl;



}

Measured memory_bytes: 3624
#include<bits/stdc++.h>          
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
#define mk_p(a,b)	make_pair((a),(b))
#define fixed(n) fixed<<setprecision((n))
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr long long MOD = 1000000007;

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

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int x = n;
	rep(i,3-1){
		x *= n;
	}
	cout << x << '\n';
	return 0;
}


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

using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;

int s(ll n){
    int x = 0;
    while(n != 0){
        x += (n % 10);
        n /= 10;
        
    }
    return x;
}
int main(){
    ll n; cin >> n;
    cout << (n % s(n) == 0 ? "Yes": "No") << endl;
}

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

int main(){
  int n,a;
  cin >> n >> a;
  for(int i=0;i<21;i++){
    if(0<=n-500*i && n-500*i<=a){
      cout << "Yes" << endl;
      break;
    }
   else{
      if(i==20){
        cout << "No" << endl;
      }
      else{
        continue;
      }
    }
  }
}
      



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

using namespace std;

typedef long long ll;

int main(){
	int n;
	cin >> n;
	int l[n];
	for(int i = 0; i < n; i++)cin >> l[i];
	sort(l, l+n);
	int ad = 0;
	for(int i = 0; i < n-1; i++)ad += l[i];
	if(ad > l[n-1])cout << "Yes" << endl;
	else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/variant.hpp>
using namespace std;
typedef long long ll;
typedef vector<boost::variant<bool, ll, int, string, double, char*, const char*>> anys;
template<typename T> inline void pr(const vector<T> &xs){
	for(int i=0; i<xs.size()-1; i++) cout<<xs[i]<<" ";
	(xs.empty()?cout:(cout<<xs[xs.size()-1]))<<endl;
}
#ifdef DEBUG
#define debug(...) pr(anys{__VA_ARGS__})
#define debugv(x) pr((x))
#else
#define debug(...)
#define debugv(x)
#endif

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

	vector<string> ans{"a"};

	for(int i=1; i<N; i++){
		vector<string> next;
		for(auto s: ans){
			set<char> cs;
			for(char c: s){
				cs.insert(c);
			}
			for(char c='a'; c<='a'+cs.size(); c++){
				next.push_back(s + c);
			}
		}
		ans = next;
	}

	for(auto s: ans){
		cout << s << endl;
	}

	return 0;
}


Measured memory_bytes: 10908