akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<math.h>
#include<iomanip>

using namespace std;


class Hoge{
		
		public:
		long int n;		
		int k,p[1000],icount;
		double danswer;
		const double PI=3.14159265358979323846;
		string s0,s1;	
			
		//Hoge(int k,int n ,int p);
		Hoge(long int);		
		void angle();
		void printp();	
		void makeletter();	
};

//Hoge::Hoge(int k0,int n0,int p0){k=k0;n=n0;p[]=p0;}
Hoge::Hoge(long int n0){n=n0;}



void Hoge::angle(){
			long int itemp=n;
			 icount=0;
			int icheck=1;
			n+=-1;
			while(icheck==1){
					
					
					itemp=n/26;
					p[icount]=n%26;					
					
					//cout<<"itemp="<<itemp<<endl;
					//cout<<icount<<endl;
					//cout<<"n/26="<<n/26<<endl;					
					//cout<<"n%26="<<n%26<<endl;
					//cout<<"p[]="<<p[icount]<<endl;

			if(itemp==0){icheck=0;}			
			else if(itemp<26){
					icheck=0;
					icount++;
					p[icount]=itemp-1;
					}

			
			else{icount+=1;}
			n=itemp-1;
}	
			
		}

void Hoge::printp(){

			

for(int i=0;i<icount+1;i++){
			cout<<"p["<<i<<"]="<<p[i]<<endl;
			
			}

		
		}

void Hoge::makeletter(){
			string sname;
			//cout<<"icount="<<icount<<endl;			
			string s10="abcdefghijklmnopqrstuvwxyz";
			//cout<<s10[3]<<endl;
			sname=s10[p[icount]];
			for (int i=icount-1;i>-1;i--){
			//cout<<"icountnow="<<icount<<endl;
			//cout<<"i="<<i<<endl;
			//co 1000000000000001ut<<p[i]<<endl;
			//cout<<s10[p[i]-1]<<endl;
			sname=sname+s10[p[i]];


			}
			cout<<sname<<endl;
			}



int main(){
		long int k,n;
		cin>>n;
		Hoge hoge(n);
		hoge.angle();
		//hoge.printp();
		hoge.makeletter();

		}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  LL k,a,b;
  cin >> k >> a >> b;
  if(b>=a+2){
    if(a-1<k){
      k-=a-1;
      cout << max(k+1,a+k/2*(b-a)+k%2) << endl;
    }else{
      cout << k+1 << endl;
    }
  }else{
    cout << k+1 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#Input
l_A =  [[0 for i in range(3)] for j in range(3)]
l_A[0] = list(map(int, input().split()))
l_A[1] = list(map(int, input().split()))
l_A[2] = list(map(int, input().split()))

def detect_BINGO(l_Atf):
    #print(l_Atf)
    #横
    for i in range(3):
        f_detect = True
        for j in range(3):
            #print(f_detect, l_Atf[i][j])
            f_detect = f_detect and l_Atf[i][j]
        if(f_detect):
            #print("横" + str(i))
            return True
    #縦
    for i in range(3):
        f_detect = True
        for j in range(3):
            f_detect = f_detect and l_Atf[j][i]
        if(f_detect):
            #print("縦" + str(i))
            return True
    #斜
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][i]
    if(f_detect):
        #print("斜＼")
        return True
    f_detect = True
    for i in range(3):
        f_detect = f_detect and l_Atf[i][3-1-i]
    if(f_detect):
        #print("斜／")
        return True
    
    #BINGOなし
    return False

#Process
l_Atf = [[False for i in range(3)] for j in range(3)]
for i in range(int(input())):
    b = int(input())
    for j in range(3):
        for k in range(3):
            if(l_A[j][k] == b):
                l_Atf[j][k] = True
    #print(l_Atf)

f_bingo = detect_BINGO(l_Atf)

#Output
if(f_bingo):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
from heapq import heappop, heappush, heapify
def main():
    n, m = list(map(int, input().split()))
    A = list(map(int, input().split()))
    B = [list(map(int, input().split())) for _ in range(m)]
    heapify(A)
    B.sort(key = lambda x: x[1], reverse = True)
    for (b, c) in B:
        if c > A[0]:
            for i in range(b):
                a = heappop(A)
                heappush(A, max(a, c))
    print(sum(A))


if __name__ == '__main__':
    main()


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

struct S {
    int w, s , v;
    bool operator <(const S &he) const
    {
        return w + s < he.w + he.s;
    }
};
int max_W = 2e4;
int main()
{
    int n;  scanf("%d",&n);
    vector < S > a(n);
    for(int i = 0 ; i < n; i++)
        scanf("%d%d%d",&a[i].w,&a[i].s,&a[i].v);
    sort(a.begin(),a.end());

    vector < ll > dp(20005,0);
    for(int i = n-1 ; i >= 0 ; i--)
        for(int w = 0 ; w <= min(a[i].s,max_W - a[i].w); w++)
            dp[w] = max(dp[w] , dp[w+a[i].w] + a[i].v);

    printf("%lld\n",dp[0]);
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

class UnionFind {
private:
  vector<ll> data;

public:
  UnionFind(ll n): data(n, -1) {}

  ll size(ll i) { return -data[find(i)]; }
  bool root(ll i) { return data[i] < 0; }
  bool same(ll i, ll j) { return find(i) == find(j); }

  ll find(ll i) { return root(i) ? i : (data[i] = find(data[i])); }

  bool unite(ll i, ll j) {
    if(same(i, j)) return false;
    data[find(i)] += data[find(j)];
    data[find(j)] = find(i);
    return true;
  }
};

int main(void) {
  ll N, M;
  cin >> N >> M;
  vector<ll> X(N), Y(N);
  REP(i, 0, N) cin >> X[i] >> Y[i];
  vector<pair<double, pair<ll, ll>>> E(M);
  REP(i, 0, M) {
    ll P, Q; cin >> P >> Q; P--; Q--;
    ll dx = X[Q] - X[P];
    ll dy = Y[Q] - Y[P];
    E[i] = make_pair(sqrt(dx * dx + dy * dy), make_pair(P, Q));
  }

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

  double ans = 0;
  UnionFind uf(N);
  REP(i, 0, M) {
    if(!uf.unite(E[i].second.first, E[i].second.second)) {
      ans += E[i].first;
    }
  }
  printf("%.15lf\n", ans);
}


Measured memory_bytes: 3532
#include<iostream>

using namespace std;

int main(){

  int m,n,ans = 0;
  cin >> m >> n;
  for(int i = 0; i < m; i++){
    int sum = 0;
    for(int j = 0; j < n; j++){
      int num;
      cin >> num;
      sum += num;
    }
    ans = max(ans,sum);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 0
import collections
N = int(input())
D = list(map(int,input().split()))
if D[0] == 0:
    if D.count(0) == 1:
        A = collections.Counter(D)
        result = 1
        for i in range(max(D)):
            result *= A[i] ** A[i + 1]
        print(result % 998244353)
    else:
        print(0)
else:
    print(0)



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

int	main( void )
{
    int A, i;
    char S[100];
    
    scanf("%s", &S);
    
    A=strlen(S);
    for(i=0; i<A; i++){
        printf("x");
    }
    
	return 0;
}


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

// Check Examples


//Compiler version g++ 6.3.0

int main()
{
    ull n,x,ans=1,temp=0;
    cin>>n>>x;
    vector<int> l(n,0);
    for(int i=0;i<n;i++)
    {
    	cin>>l[i];
    	temp+=l[i];
    	if(temp<=x)
    	  ans++;
    	  else break;
    } 
    cout<<ans;
}

Measured memory_bytes: 256
#include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<set>
#include<vector>
#define INF 100000000

#define MAX_N 10000
#define MAX_M 100

typedef long long int ll;
using namespace std;



int main(){

	int a,b;

	char op;

	while(true){
	
		scanf("%d %c %d", &a, &op, &b);

		if(op == '+')
			printf("%d\n", a+b);
		else if(op == '-')
			printf("%d\n", a-b);
		else if(op == '*')
			printf("%d\n", a*b);
		else if(op == '/')
			printf("%d\n", a/b);
		else break;
	
	}

	return 0;

}

Measured memory_bytes: 1188
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <sstream>
#include <istream>

using namespace std;

typedef long long ll;
typedef pair<ll, int> P;


int main(){
	int n,m;
	cin >> n >> m;

	int a[100000];
	ll ans[100001];
	for(int i=0;i<m;i++) cin >> a[i];

	int t = 0;
	ans[0] = 1;
	ans[1] = 1;
	if(a[t]==1){
		ans[1] = 0;
		t++;
	}
	for(int i=2;i<=n;i++){
		if(i==a[t]){
			ans[a[t]]=0;
			t++;
		}else{
			ans[i] = ans[i-1] + ans[i-2];
			ans[i] %= 1000000007;
		}
	}
	cout << ans[n] << endl;


	return 0;
}

Measured memory_bytes: 1408
n, k = map(int, input().split())
s, p, r = map(int, input().split())
t = list(input())

for i in range(k):
    for j in range(i, n, k):
        if j + k < n:
            if t[j] == t[j + k]:
                t[j + k] = "0"

ans = t.count("r")*r + t.count("p")*p + t.count("s")*s
print(ans)

Measured memory_bytes: 4084
using System;

namespace C___Unification
{
    class Program
    {
        static void Main (string[] args)
        {
            var s = Console.ReadLine ();
            var countR = 0;
            var countB = 0;
            for (var i = 0; i < s.Length; i++)
            {
                if (s[i] == '0')
                    countR++;

                else
                    countB++;
            }
            Console.WriteLine (Math.Min (countR, countB) * 2);
        }
    }
}

Measured memory_bytes: 13280
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

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

	// 入力受け取り
	int N;
	vector<int> ABC(3);
	cin >> N >> ABC[0] >> ABC[1] >> ABC[2];

	vector<int> len(N);
	for (int i = 0; i < N; i++) cin >> len[i];

	// bit全探索、ABCを作るコストが最小になるように順に決めていくが、使った竹はそれ以降使えないのでABCの最小コストを決める順番も全通り探索する必要がある
	int cnt, tmp, notused, bitmp, out = INF;
	vector<int> idx({ 0, 1, 2 });

	// ABCの順番を全て試すためのnext_permutation
	do {

		// ans初期化、竹を使用したかを管理するためのnotusedの初期化
		vector<int> ans(3, INF);
		notused = (1 << N) - 1;

		for (int k = 0; k < 3; k++) {
			
			// bit全探索jビット目が1ならその竹を使用する
			for (int i = 1; i < (1 << N); i++) {

				cnt = -1, tmp = 0;
				for (int j = 0; j < N; j++) {
					if (i & (1 << j) & notused) {
						cnt++;
						tmp += len[j];
					}
				}

				// tmp == 0のときはすでに使用した竹なのでcontinue
				if (!tmp) continue;

				// mpコストの最小値がansより小さいならansを更新しその時に使用した竹をbittmpで保存
				if (ans[idx[k]] > abs(tmp - ABC[idx[k]]) + cnt * 10) {
					ans[idx[k]] = abs(tmp - ABC[idx[k]]) + cnt * 10;
					bitmp = ~i;
				}

			}
			// 使った竹のbitを0にする
			notused &= bitmp;
		}

		// 全探索を行い総コストが最小のときが答え
		out = min(out, ans[0] + ans[1] + ans[2]);

	} while (next_permutation(idx.begin(), idx.end()));

	cout << out << "\n";

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    int a[] = {-1,0,2,0,1,0,1,0,0,1,0,1,0};
    int x,y;
    cin>>x>>y;
    if(a[x] == a[y])
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3568
// see https://gist.github.com/LumaKernel/ff55d49ee1af69b7388f15b707e75c15
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<P> VP;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

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

#define LFOR(i,a,b) for(ll i=(a);i<(b);++i)
#define RLFOR(i,b,a) for(ll i=(b)-1;i>=(a);--i)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define PB push_back
#define EACH(i,c) REP(i,(int)(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define dump(x) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";
#define dump2(x,y) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x)\
			<< " , " << #y << " = " << (y) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

int n,m;
ll k;
string s;

int main() {
	cin >> n;
	ll c=1;
	REP(i,n){
		int a=0;
		cin >>a;
		c*= a%2==0 ? 2 : 1;
	}

	cout << pow(3, n) - c << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
// #include <string>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;

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

	int n, q;
	string s;
  cin >> n >> q >> s;
	vector<int> dp(n);

	rep(i, n-1) {
		dp[i+1] = dp[i];
		if (s[i]=='A' && s[i+1]=='C') ++dp[i+1];
	}
	rep(i, q) {
		int l, r; cin >> l >> r;
		l--, r--;
		cout << dp[r] - dp[l] << endl;
	}

	return 0;
}


Measured memory_bytes: 1488
#include <iostream>
using namespace std;
typedef long long int ll;
 
int main(){
   ll n;
   ll a;
   ll b;
   ll c;
   cin>>n;
   cin>>a;
   cin>>b;
   c=n%(a+b);
   if(c<=a){
      cout<<a*(n/(a+b))+c<<endl;
   }else{
      cout<<a*(n/(a+b))+a<<endl;
  
   }
   return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

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

  int x;
  double ans = 0;
  rep(i, n) {
    cin >> x;
    ans += (double)1 / x;
  }
  printf("%.9f\n", 1 / ans);
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 1005;
const ll mod = 1e9+7;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie(0);
    string s;
    cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) cout << "Yes";
    else cout << "No";
    return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] sticks = new int[n];
    for (int i = 0; i < n; i++)
      sticks[i] = sc.nextInt();
    Arrays.sort(sticks);
    int count = 0;
    int k;
    for (int i = 0; i < n - 2; i++)
      for (int j = i + 1; j < n - 1; j++) {
        k = j + 1;
        while (k < n && sticks[i] + sticks[j] > sticks[k])
          k++;
        count += k - 1 - j;
      }
    System.out.println(count);
  }
}

Measured memory_bytes: 26608
/*
* Note: This template uses some c++11 functions , so you have to compile it with c++11 flag.
*       Example:-   $ g++ -std=c++11 c++Template.cpp
*
* Author : Akshay Pratap Singh
* Handle: code_crack_01
*
*/
 
/********   All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#define MEM(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for(int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for(int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert( B <= A && A <= C)
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define read(type) readInt<type>()
typedef long long int ll;
typedef unsigned long long int  ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<ll> vll;
typedef vector<vi> vvi;

#define MAX 100005
#define NIL -1

struct Node{ int p, l, r; };
Node T[MAX];
int n, H[MAX], D[MAX];

int order(int u, int t){
  if( t == 1 ) cout << " " << u;
  if( T[u].l != NIL )  order(T[u].l, t);
  if( t == 2 ) cout << " " << u;
  if( T[u].r != NIL ) order(T[u].r, t);
  if( t == 3 ) cout << " " << u;
  return 0;
}


int main(){
  int id, l, r;

  int N; SCD(N);
  REP(i, N) T[i].p = T[i].l = T[i].r = NIL;

  REP(i, N){
    SCD(id); SCD(T[id].l); SCD(T[id].r);
    T[T[id].l].p = id;
    T[T[id].r].p = id;
  }

  REP(i, N){
    if ( T[i].p == NIL ) r = i;
  }

  cout << "Preorder" << endl;
  order(r, 1);
  cout << endl;

  cout << "Inorder" << endl;
  order(r, 2);
  cout << endl;

  cout << "Postorder" << endl;
  order(r, 3);
  cout << endl;

  return 0;
}



Measured memory_bytes: 3156
numeros = input()
numeros = numeros.split()
numeros = [int(i) for i in numeros]
nVezes = int(input())
for x in range(nVezes):
    for y in range(len(numeros)):
        if(numeros[y] == max(numeros)):
            numeros[y] = numeros[y] * 2

print(sum(numeros))


Measured memory_bytes: 2940
#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>;

void Main()
{
  ll N,K;
  cin >> N >> K;
  vector<ll> a(N);
  unordered_map<int,int> umap;
  vector<int> cnt;
  int kind = 0;
  rep(i,N) {
    cin >> a[i];
    if (umap.find(a[i]) == umap.end()) {
      umap[a[i]] = 1;
      kind++;
    }
    else umap[a[i]]++;
  }
  std::unordered_map<int,int>::iterator it = umap.begin();
  for (it = umap.begin(); it != umap.end(); it++) {
    cnt.push_back(it->second);
  }
  sort(cnt.begin(), cnt.end());
  if (kind <= K) {cout << 0 << endl; return;}
  int ans = 0;
  rep(i,kind-K) ans += cnt[i];
  cout << ans << endl;
}

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


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

using namespace std;

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

    string s; cin>>s;
    auto p = s[0];
    bool good = true;
    for (int i = 1; i < 4; i++) {
        if (s[i] == p) {
            good = false;
            break;
        }
        p = s[i];
    }
    cout << (good ? "Good" : "Bad") << endl;

    return 0;
}


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

using ll = long long;

vector<ll> sieve() {
    const int max_v = 100001;
    vector<ll> res;
    vector<bool> is_prime(max_v, true);
    for(int i = 2; i < max_v; ++i) {
        if(!is_prime[i]) continue;
        res.push_back(i);
        for(int j = i + i; j < max_v; j += i) {
            is_prime[j] = false;
        }
    }
    return res;
}

pair<ll, ll> calc(vector<ll> const& primes, map<ll, ll>& p2, const ll x) {
    ll res1 = x, tmp = x, res2 = 1;
    for(auto const p : primes) {
        const ll p3 = p * p * p;
        if(p3 > x) break;
        while(res1 % p3 == 0) {
            res1 /= p3;
        }
        while(tmp % p == 0) {
            tmp /= p;
        }
        if(res1 % (p * p) == 0) {
            res2 *= p;
        } else if(res1 % p == 0) {
            res2 *= p * p;
        }
    }

    if(p2.count(tmp)) {
        res2 *= p2[tmp];
    } else {
        res2 *= tmp * tmp;
    }

    return make_pair(res1, res2);
}

int main() {
    const auto primes = sieve();
    map<ll, ll> p2;
    for(auto const p : primes) {
        p2[p * p] = p;
    }

    int n; cin >> n;
    vector<pair<ll, ll>> s(n);
    map<ll, int> cnt;
    for(int i = 0; i < n; ++i) {
        ll x; cin >> x;
        s[i] = calc(primes, p2, x);
        cnt[s[i].first] += 1;
    }

    int ans = 0;
    map<ll, int> maxi;
    for(auto const& p : s) {
        const ll x = p.first, y = p.second;
        if(x == 1) {
            ans = 1;
        } else {
            maxi[min(x, y)] = max(maxi[min(x, y)], cnt[x]);
        }
    }
    for(auto const& p : maxi) {
        ans += p.second;
    }

    cout << ans << endl;
}


Measured memory_bytes: 14976
#include <iostream>
using namespace std;
int main()
{
  int g[13] = {0, 0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0};
  int x, y;
  cin >> x >> y;
  string ans = "No";
  if (g[x] == g[y])
    ans = "Yes";
  cout << ans << endl;
  return 0;
}

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

int main(){   
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    ll A[55];
    cin >> N;
    rep(i,0,N) cin >> A[i];
    ll ans = 0;
    while(1){
        bool ok = true;
        rep(i,0,N){
            if(A[i] >= N) ok = false;
        }
        if(ok) break;
        ll sum = 0;
        rep(i,0,N){
            sum += A[i] / N;
        }
        ans += sum;
        rep(i,0,N){
            ll v = A[i] / N;
            A[i] += (sum - v) - v * N;
        }
    }
    print(ans);
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  char s[4];
  scanf("%s",s);
  if(s[0]=='M'){
    printf("6\n");
    return 0;
  }else if(s[0]=='W'){
    printf("4\n");
    return 0;
  }else if(s[0]=='F'){
    printf("2\n");
    return 0;
  }else if(s[0]=='S'){
    if(s[1]=='U'){
      printf("7\n");
      return 0;
    }else if(s[1]=='A'){
      printf("1\n");
      return 0;
    }
    return 0;
  }else if(s[0]=='T'){
    if(s[1]=='U'){
      printf("5\n");
      return 0;
    }else if(s[1]=='H'){
      printf("3\n");
      return 0;
    }
    return 0;
  }
}


Measured memory_bytes: 128
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  string sa = "keyence";
  string s;
  cin>>s;
  if(s==sa){
    cout << "YES" << endl;
    return 0;
  }
  rep(i,0,s.sz){
    rep(j,i,s.sz){
      string ss;
      rep(k,0,s.sz){
        if(i<=k&&k<=j){

        }
        else{
          ss+=s[k];
        }
      }
      if(ss==sa){
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}

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

int n,a[maxn],fr[maxn],bk[maxn],ans=1;

int gcd(int x,int y)
{
	if(!y) return x;
	return gcd(y,x%y);
}

int main()
{
	cin>>n;
	for(int i=1;i<=n;++i) scanf("%d",&a[i]);
	fr[1]=a[1],bk[n]=a[n];
	for(int i=2;i<=n;++i) fr[i]=gcd(fr[i-1],a[i]);
	for(int i=n-1;i>=1;--i) bk[i]=gcd(bk[i+1],a[i]);
	ans=max(fr[n-1],bk[2]);
	for(int i=2;i<n;++i)
	{
		ans=max(ans,gcd(fr[i-1],bk[i+1]));
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1408
#include <cstdio>
#include <algorithm>

using namespace std;

int h, w, c;

void copy_panel(int s[10][10], int d[10][10]) {
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            d[i][j] = s[i][j];
        }
    }
}

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

void change_color(int p[10][10], int x, int y, int c) {
    int color = p[x][y];
    p[x][y] = c;
    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (p[nx][ny] == color) {
            change_color(p, nx, ny, c);
        }
    }
}

int count_color(int p[10][10], int x, int y, int c) {
    p[x][y] = -1;
    int ans = 1;
    for (int i = 0; i < 4; i++) {
        int nx = x + dx[i];
        int ny = y + dy[i];
        if (p[nx][ny] == c) {
            ans += count_color(p, nx, ny, c);
        }
    }
    return ans;
}

int dfs(int p[10][10], int n) {
    int ans;
    int b[10][10];

    if (n == 1) {
        copy_panel(p, b);
        if (b[1][1] != c) {
            change_color(b, 1, 1, c);
        }
        ans = count_color(b, 1, 1, c);
    } else {
        ans = 0;
        for (int i = 1; i <= 6; i++) {
            copy_panel(p, b);
            if (b[1][1] != i) {
                change_color(b, 1, 1, i);
            }
            ans = max(ans, dfs(b, n - 1));
        }
    }

    return ans;
}

int main() {
    int P[10][10];

    for (;;) {
        scanf("%d%d%d", &h, &w, &c);
        if (!h && !w && !c) { break; }

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                P[i][j] = 0;
            }
        }
        for (int i = 1; i <= h; i++) {
            for (int j = 1; j <= w; j++) {
                scanf("%d", &P[i][j]);
            }
        }

        printf("%d\n", dfs(P, 5));
    }
    return 0;
}

Measured memory_bytes: 1032
#include<stdio.h>
int main(void)
{
	int N,digitsum=0,tmp=0;
	scanf("%d", &N);
	tmp = N;
	while (tmp > 0) {
		digitsum += tmp % 10;
		tmp /= 10;
	}
	if (N % digitsum == 0) {
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <cmath>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define vii vector<int,int>

using namespace std;


int main(){
    string s;
    int n;
    
    cin >> s >>n;
    
    string ans;
    for(int i=0 ; i < s.size(); i += n){
        cout << s[i];
    }
    
    cout << endl;
    
   
}

Measured memory_bytes: 256
from bisect import bisect_left

n=int(raw_input())
a=map(int,raw_input().split())
sa=sorted(a)
s=[0]*n
s[0]=sa[0]
for i in xrange(n-1):
    s[i+1]+=s[i]+sa[i+1]
idx=bisect_left(sa,(sa[n-1]+1)/2)
ans=n-idx
f=0
for i in xrange(idx-1,-1,-1):
    if f==0 and s[i]*2>=sa[i+1]:
        f=1
        ans+=1
    else:
        if f==1 and s[i]*2>=sa[i+1]:
            ans+=1
        else:
            break
print ans


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

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(){
  int n;
  int v[53];
  int i;
  double suti = 0;
  
  
  scanf("%d", &n);
  for(i = 0; i < n; i++)
    scanf("%d", &v[i]);
  
  qsort(v, n, sizeof(int), compare_int);
    
    for(i = 0; i < n - 1; i++){
        if(i == 0){
            suti = (v[i] + v[i + 1]) / (double)2;
        }
        else{
            suti = (suti + v[i + 1]) / (double)2;
        }
    }
    
    printf("%f\n", suti);
  
  return 0;
}

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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

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

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int f(int n)
{
	if(n % 2 == 0)	return n / 2;
	else			return 3 * n + 1;
}

int main()
{
	int s;
	cin >> s;
	vector<int> a;
	a.pb(0);	//i=0
	a.pb(s);	//i=1
	int m = 2;
	while(1){
		int am = f(a[m-1]);
		auto found = find(ALL(a), am);
		if(found == a.end()){
			a.pb(am);
			m++;
			continue;
		}else{
			cout << m;
			return 0;
		}
	}
	return 0;
}


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

#define ll    long long
#define endl  "\n"
#define fast  ios_base :: sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

vector<int> vec;
int main(){

    fast;
    ll n;
    cin>>n;
    for(int i=0;i<n;i++){
        ll temp;
        cin>>temp;
        vec.push_back(temp);
    }

    ll sum = 0;
    for(int i=0;i<n-1;i++){
        if(vec[i]>vec[i+1]){
            sum = sum + (vec[i] - vec[i+1]);
            vec[i+1] = vec[i+1] + (vec[i] - vec[i+1]);
        }
    }
    cout<<sum<<endl;

}

Measured memory_bytes: 4264
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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

		//int a = sc.nextInt();
		//List<Integer> check=new ArrayList<Integer>();
		//array = new int[h+1][w+1];
		List<Integer> list=new ArrayList<Integer>();
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//Collections.reverse(list);

		int n = sc.nextInt();
		int d = sc.nextInt();

		int count=0;
		int human=0;

		while(true) {
			count=count+d*2+1;
			human++;
			if(count>=n) {
				break;
			}
		}

		System.out.println(human);
	}

}


Measured memory_bytes: 21844
h,w,k = map(int,input().split())

a=[[0]*w for i in range(h+1)]

fib_memo = {}
def fib(n):
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2)
    return fib_memo[n]
  

for j in range(w):
  a[0][j]=0
a[0][0]=1

for i in range(1,h+1):
  for j in range(w):
    if w==1:
      a[i][j]=a[i-1][j]
    elif j==0:
      a[i][j]=a[i-1][j]*fib(w)+a[i-1][j+1]*fib(w-1)
    elif 1<=j<w-1:
      a[i][j]=a[i-1][j-1]*fib(w-j)*fib(j)+a[i-1][j]*fib(w-j)*fib(j+1)+a[i-1][j+1]*fib(w-j-1)*fib(j+1)
    elif j==w-1:
      a[i][j]=a[i-1][j]*fib(w)+a[i-1][j-1]*fib(w-1)
print(a[h][k-1]%1000000007)

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

using namespace std;

using ll = long long;

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

    n %= 10;
    if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
        cout << "hon" << endl;
    }
    else if (n == 0 ||n == 1 || n == 6 || n  == 8) {
        cout << "pon" << endl;
    }
    else {
        cout << "bon" << endl;
    }
    return 0;
}

Measured memory_bytes: 3624
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
constexpr int DIGIT = 55;
ll N, K;
string s;
vector<vector<ll>> bitcount(DIGIT, vector<ll>(2, 0)), dp(DIGIT + 1, vector<ll>(2, -1));

ll rec(ll e, bool tight, ll sum) {
	if (e == s.size())return sum;
	if (dp[e][tight] != -1)return dp[e][tight];
	//sum <<= 1;

	bool bit = s[e] == '1';
	ll res = 0;
	if (tight) {
		if (s[e] == '1') {
			res = max(res, rec(e + 1, false, sum * 2 + bitcount[e][1]));
		}
		res = max(res, rec(e + 1, true, sum * 2 + bitcount[e][s[e] == '0']));
	}
	else {
		res = rec(e + 1, false, sum * 2 + max(bitcount[e][0], bitcount[e][1]));
	}
	return dp[e][tight] = res;
}

ll solve_dp() {
	dp[0][0] = 0;
	rep(e, DIGIT) {
		if (dp[e][1] != -1)
			dp[e + 1][1] = max(dp[e + 1][1], dp[e][1] * 2 + max(bitcount[e][0], bitcount[e][1]));
		if (dp[e][0] != -1 && s[e] == '1')
			dp[e + 1][1] = max(dp[e + 1][1], dp[e][0] * 2 + bitcount[e][1]);
		if (dp[e][0] != -1)
			dp[e + 1][0] = max(dp[e + 1][0], dp[e][0] * 2 + bitcount[e][s[e] == '0']);
	}
	return max(dp[DIGIT][0], dp[DIGIT][1]);
}

string binary(ll K) {
	string s = "";
	rep(i, DIGIT) {
		s += (K & 1 ? "1" : "0");
		K >>= 1;
	}
	reverse(s.begin(), s.end());
	return s;
}

int main()
{
	cin >> N >> K;
	s = binary(K);
	vector<ll> A(N);
	rep(i, N)cin >> A[i];

	for (auto a : A)rep(i, DIGIT) {
		bitcount[i][a & 1ll]++;
		a >>= 1ll;
	}
	reverse(bitcount.begin(), bitcount.end());

	cout << solve_dp() << endl;
	//rec(0, true, 0);
	//cout << max(dp.back()[0], dp.back()[1]) << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define all(v) v.begin(), v.end()
#define lint long long
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, auto b){if (a < b) {a = b; return true;} return false;};
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail){
  std::cerr << " " << head;
  debug_impl(tail...);
}
#define debug(...)\
  std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
  debug_impl(__VA_ARGS__);\
  std::cerr << std::noboolalpha;

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int n; std::cin >> n;
  std::cout << n * n * n << std::endl;
  return 0;
}

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

int gcd(int x, int y) {
    if (y == 0) return x;
    return gcd(y, x % y);
}

int main() {
    int n,x; cin >> n >> x;
    vector<int> X(n), Y(n);
    for (int i = 0; i < n; i++) {
        cin >> X[i];
    }
    sort(X.begin(), X.end());
    for (int i = 0; i < n - 1; i++) {
        Y[i] =  X[i + 1] - X[i];
    }
    
    int ans = abs(x - X[0]);
    for (int i = 0; i < n; i++) {
        ans = gcd(ans, Y[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
using System;
class Program
{
	static void Main(string[] args)
	{

		string s = Console.ReadLine();
		string t = Console.ReadLine();

		int counter = 0;

		for(int count=0;count<s.Length;count++)
		{
			if(s[count]!=t[count])
			{
				counter++;
				
			}
		}

		//出力
		Console.WriteLine(counter);
	}
}

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


int main(){
     long long n, k; cin >> n >> k;
     long long mod1 = n % k;
     long long mod2 = k-mod1;
     if(mod2 < 0) mod2 = -mod2;
     if(mod1 < mod2) cout << mod1 << endl;
     else cout << mod2 << endl;
     return 0;
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

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

ll fact[100010], ifact[100010], a[100010];

//二分累乗法 xのe乗
ll binpow(ll x, ll e) {
  ll a = 1, p = x;
  while(e > 0) {
    if(e%2 == 0) {p = (p*p) % MOD; e /= 2;}
    else {a = (a*p) % MOD; e--;}
  }
  return a % MOD;
}

ll C(ll n, ll k) {
  return fact[n]*ifact[k]%MOD*ifact[n-k]%MOD;
}

int used[100010];
signed main(void)
{
  int n;
  cin >> n;
  REP(i, n+1) cin >> a[i];

  ll idx1 = -1, idx2 = -1;
  REP(i, n+1) {
    //cout << i << " " << a[i] << " " << used[a[i]] << endl;
    if(used[a[i]]) {
      idx1 = used[a[i]]-1;
      idx2 = i;
    }
    used[a[i]] = i+1;
  }
  ll l = idx1, r = n-idx2;
  //cout << idx1 << " " << idx2 << endl;
  //cout << "l:" << l << " " << r << endl;

  fact[0] = 1, ifact[0] = 1;
  FOR(i, 1, n+2) {
    fact[i] = (fact[i-1] * i) % MOD, ifact[i] = binpow(fact[i], MOD-2);
    //cout << fact[i] << " " << ifact[i] << endl;
  }

  FOR(i, 1, n+2) {
    ll a = 0;
    if(l+r >= i-1) a = C(l+r, i-1);
    cout << (C(n+1, i) - a + 10LL*MOD) % MOD << endl;
  }

  return 0;
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define mp(a,b) make_pair(a,b)
#define ff first
#define setp(x) setprecision(x)<<fixed
#define ss second
#define fori(v) for(lli i=0; i<v; i++)
#define forj(v) for(lli j=0; j<v; j++)
#define fork(v) for(lli k=0; k<v; k++)
#define forl(v) for(lli l=0; l<v; l++)
#define fort(v) for(lli t=0; t<v; t++)
#define forz(v) for(lli z=0; z<v; z++)
#define lli long long int
#define MAX 100004
#define double long double
#define ch 51
#define max_bit 20
#define pb push_back
#define magic 3
lli inf = pow(10,16);
lli modulo = pow(10,9)+7;
double eps = 1e-11;
ifstream in;
ofstream out;
//#define cin in
//#define cout out
	vector<pair<lli,lli> > g[MAX];
	lli road[MAX][2]; //  a, b
void dist_(lli* dis, lli kd, lli s, lli n){
	fori(n)	dis[i] = inf;
	multimap<lli,lli> dij;
	dij.insert(mp(0,s));
	dis[s] = 0;
	while(dij.size()){
		lli hd = (*dij.begin()).ss;
		dij.erase(dij.begin());
		forj(g[hd].size()){
			lli hr = g[hd][j].ff;
			lli rd = g[hd][j].ss;
			if(dis[hd] + road[rd][kd] < dis[hr]){
				dis[hr] = dis[hd] + road[rd][kd];
				dij.insert(mp(dis[hr],hr));
			}
		}
	}
}
void deal(){
	lli n,m,s,t;
	cin>>n>>m>>s>>t; --s,--t;
	fori(m){
		lli u,v,a,b;
		cin>>u>>v>>road[i][0]>>road[i][1]; --u,--v;
		g[u].push_back(mp(v,i));
		g[v].push_back(mp(u,i));	
	}
	lli dis1[n];
	lli dis2[n];
	lli ans[n];
	dist_(dis1,0,s,n);
	dist_(dis2,1,t,n);
	lli money = pow(10,15);
	ans[n-1] = money - dis1[n-1] - dis2[n-1];
	for(lli i=n-2; i>-1; i--)
		ans[i] = max(money-dis1[i]-dis2[i], ans[i+1]);
	fori(n)
		cout<<ans[i]<<'\n';
}
int main() {
//	cin.open("i.txt");
//	cout.open("o.txt");
//	while(1)
	
	deal();
}

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

using namespace std;
typedef long long ll;

#define pf printf
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define REPSZ(i,v) REP(i,SZ(v))
#define pll pair <ll, ll>

ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }

ll n,m;
vector<ll> arr;

void print(vector <ll> &v){cout << v.size() << endl;for(int i = 0; i < v.size(); i++){pf("%lld ", v[i]);}pf("\n");}
void print(vector <pll> &v){ cout << v.size() << endl; for(int i = 0; i < v.size(); i++){pf("%lld %lld\n", v[i].first, v[i].second);}}
void print(set<ll> s){set <ll> :: iterator itr;for (itr = s.begin(); itr != s.end(); ++itr){cout << *itr << " ";}cout << endl;}
void print(double d){cout << fixed << setprecision(10) << d << endl;}

void from_file(void){ freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);}

/* ------------------main section-------------! */

void solve() {
    
}


void run() {
    fastio;
    string s;
    cin >> s;
    s[0] = '2';
    s[1] = '0';
    s[2] = '1';
    s[3] = '8';
    cout << s << endl;

}


int main() {
    #ifndef ONLINE_JUDGE
        from_file();
    #endif
    run();
    return 0;
}


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

using ll = long long;

template<typename T>
T gcd(T a, T b)
{
	if (a < b)	return gcd(b, a);
	T r;
	while ((r = a % b))
	{
		a = b;
		b = r;
	}
	return b;
}

template<typename T>
T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}

template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
	x = 1;
	y = 0;
	T x0 = 0, y0 = 1;
	while (b != 0)
	{
		T q = a / b;
		a -= q * b;
		swap(a, b);
		x -= q * x0;
		swap(x, x0);
		y -= q * y0;
		swap(y, y0);
	}
	return a;
}

template<typename T>
T inv_mod(T a, T mod)
{
	T t1, t2;
	ext_gcd(a, mod, t1, t2);
	t1 %= mod;
	if (t1 < 0)		t1 += mod;
	return t1;
}

template<typename T>
T combination_large(T n, T k, T mod)
{
	if (n < k || n < 0 || k < 0)	return 0;
	vector<T> inv(n + 1, 1), fact(n + 1, 1), fact_inv(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		fact[i] = (fact[i - 1] * i) % mod;
		fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
	}
	return fact[n] * (fact_inv[k] * fact_inv[n - k] % mod) % mod;
}

template<typename T>
T combination(T n, T k, T mod = 1)
{
	vector<vector<T>> table(n + 1, vector<T>(k + 1, 1));
	for (T i = 1; i <= n; ++i)
	{
		table[i][0] = 1;
		for (T j = 1; j <= n; ++j)
		{
			table[i][j] = (table[i - 1][j - 1] + table[i - 1][j]) % mod;
		}
	}
}


int main(int, char**)
{
	double R;
	cin >> R;
	cout << R * 2.0 * M_PI << endl;

	return 0;
}


Measured memory_bytes: 3804
while True:
    try:
        a,b,c,d,e,f = map(float,raw_input().split())
        delta =a*e-b*d
        x = (e*c-b*f)/delta
        y = (a*f-d*c)/delta
        if abs(x)<1e-3:
            x=0
        if abs(y)<1e-3:
            y=0
        #print str('%.3f' % x) + " " + str('%.3f' % y)
        print "%.3f %.3f" % (x,y)
    except EOFError:
        break

Measured memory_bytes: 4244
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod = 1000000007;
int f[200005];
int g[200005];
int exp(int a, int x){
    if (x == 0) return 1;
    int p = exp(a,x/2);
    p *= p;
    p %= mod;
    if (x % 2 == 1) {
        p *= a;
        p %= mod;
    }
    return p;
}
int m(int n, int k){
    //printf("%lld %lld\n",n,k);
    return ((f[n+k] * g[n])%mod * g[k]) % mod;
}
main(){
    int h,w,a,b;
    scanf("%lld%lld%lld%lld",&h,&w,&a,&b);
    f[0] = g[0] = 1;
    for (int i = 1; i <= h+w; i++){
        f[i] = (f[i-1]*i)%mod;
        g[i] = exp(f[i],mod-2);
        //printf("%lld %lld %lld\n",i,f[i],g[i]);
    }
    int ans = m(h-1,w-1);
    //printf("%lld\n",ans);
    for (int i = h-a; i < h; i++){
        //printf("-%lld * %lld\n",m(i,b-1),m(h-i-1,w-b-1));
        ans -= (m(i,b-1)*m(h-i-1,w-b-1));
        ans %= mod;
    }
    ans = (ans+mod)%mod;
    printf("%lld",ans);
}


Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> all;
  for(int i = 1; i < 10; ++i){
    for(int j = 1; j < 10; ++j){
      all.push_back(i * j);
    }
  }
  sort(all.begin(), all.end());
  int left = 0;
  int right = all.size() - 1; 
  int mid;
  while(left <= right){
    mid = (left + right) / 2;
    if(all[mid] == n){
      cout << "Yes" << endl;
      return 0;
    }
    else if(all[mid] > n){
      right = mid - 1;
    }
    else left = mid + 1;
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
#define vaibhavv06               \
	ios::sync_with_stdio(false); \
	cin.tie(NULL);               \
	cout.tie(0);
#define int long long
#define MM(a,b) memset(a,b,sizeof(a))
const ll MOD = 1000000007;
using namespace std;

bool check(int n){
	for(int i=2;i*i<=n;i++){
		if(n%i==0) return false;
	}
	return true;
}

int32_t main(){
    vaibhavv06;
	int n; cin>>n;
	n--;
	while(!check(++n));
	cout<<n<<endl;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
a = list(map(int, input().split()))
max_kyori = a[0] - 0 + (n - a[-1])
cnt = a[0] - 0 + (n - a[-1])
for i in range(k - 1):
    max_kyori = max(max_kyori, a[i + 1] - a[i])
    cnt += a[i + 1] - a[i]
print(cnt - max_kyori)


Measured memory_bytes: 26444
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long

int main(){
    string s, t; cin >> s >> t;
    int n = s.size();
    s = s + s; t = t + t;
    rep(i, n){
        bool f = true;
        rep(j, n){
            if(s[j] != t[i + j]) f = false;
        }
        if(f){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


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

int main(void)
{
    string s;
    cin>>s;
    int len=s.length();
    if(s[0]==s[len-1])
    {
        if(s.length()%2==1)
        {
            cout<<"Second"<<endl;
        }
        else
        {
            cout <<"First"<<endl;
        }
    }
    else
    {
         if(s.length()%2==1)
        {
            cout<<"First"<<endl;
        }
        else
        {
            cout <<"Second"<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <complex>
#include <stack>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
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;}
using ll = long long;
constexpr long long INF = 1LL << 62;
constexpr int MOD = 1e9 + 7;

struct LazySegmentTree {
    vector<long long> data, lazy;
    int n;

    LazySegmentTree(int n_) {
        for(n = 1; n < n_; n *= 2);
        data.assign(n*2 - 1, 0);
        lazy.assign(n*2 - 1, 0);
    }

    void propagate(int i, int l, int r) {

        if(lazy[i] != 0) {
            data[i] += lazy[i];

            if(r - l > 1) {
                lazy[i*2+1] += lazy[i] / 2;
                lazy[i*2+2] += lazy[i] / 2;
            }
        }

        lazy[i] = 0;
    }

    void update(int a, int b, long long x, int i = 0, int l = 0, int r = -1) {
        if(r < 0) r = n;

        propagate(i, l, r);

        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[i] += (r - l) * x;
            propagate(i, l, r);
        } else {
            update(a, b, x, i*2+1, l, (l+r)/2);
            update(a, b, x, i*2+2, (l+r)/2, r);
            data[i] = data[i*2+1] + data[i*2+2];
        }
    }

    long long query(int a,int b,int i = 0,int l = 0, int r = -1) {
        if(r < 0) r = n;
        if(b <= l || r <= a) return 0;

        propagate(i, l, r);
        if(a <= l && r <= b) return data[i];
        long long vl = query(a, b, i*2+1, l, (l+r)/2);
        long long vr = query(a, b, i*2+2, (l+r)/2, r);
        return vl + vr;
    }
};

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int n,q; cin >> n >> q;
    LazySegmentTree st(n);
    REP(i,q) {
        int y, s, t, x;
        cin >> y;
        if(y==0) {
            cin >> s >> t >> x;
            st.update(s-1, t, x);
        } else {
            cin >> s;
            cout << st.query(s-1, s) << '\n';
        }
    }

    return 0;
}



Measured memory_bytes: 6940
#include<bits/stdc++.h>
using namespace std;
int readin()
{
	int s=0;
	int neg=1;
	char c=getchar();
	if(c==' ')
		return s;
	while(c>='0'||c<='9')
	{
		if(c=='-')
			neg=-1;
		else
			s=10*s+c-'0';
		c=getchar();
		if(c=='\n'||c==' ')
			break;
	}
	s*=neg;
	return s;
}
void writen(int re)
{
     if(re>9)
	 	writen(re/10);
     putchar(re%10+'0');
}
int n,m;
bool vis[55];
vector<pair<int,int> > g[55];
void dfs(int a,int b)
{
	if(vis[a])
		return;
	vis[a]=1;
	for(int i=0;i<g[a].size();i++)
	{
		pair<int,int>p=g[a][i];
		if(p.second==b)
			continue;
		dfs(p.first,b);
	}
}
int main()
{
	n=readin();
	m=readin();
	for(int i=0;i<m;i++)
	{
		int x,y;
		x=readin();
		y=readin();
		g[x].push_back({y,i});
		g[y].push_back({x,i});
	}
	int ans=0;
	for(int i=0;i<m;i++)
	{
		memset(vis,0,sizeof(vis));
		dfs(1,i);
		for(int j=1;j<=n;j++)
			if(!vis[j])
			{
				ans++;
				break;
			}
	}
	writen(ans);
	return 0;
}

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

using namespace std;

//int dirs[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
//int dirs[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};

long long g(long long a, long long b)
{
    if(b==0) return a;
    return g(b,a%b);
}

void no()
{
    printf("No\n");
}
void yes()
{
    printf("Yes\n");
}

int main()
{
    //freopen("inp.in", "r", stdin);
    //freopen("outp.out", "w", stdout);
    //ios::sync_with_stdio(false);
    int tc;
    scanf("%d", &tc);
    for(int case_no=1; case_no<=tc; case_no++)
    {
        long long A, B, C, D;
        scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
        if(A<B)
        {
            no();
            continue;
        }
        if(D<B)
        {
            no();
            continue;
        }
        if(C>=B)
        {
            yes();
            continue;
        }
        long long now=A-B;
        if(now<=C) now += D;
        now=(now-C-1)%B;
        long long least=-1;
        if(D%B==0) least=now;
        else
        {
            long long gc=g(D%B,B);
            least=now%gc;
        }
        long long amount=C+least+1;
        if(amount<B)
        {
            no();
            continue;
        }
        else
        {
            yes();
            continue;
        }
    }
    return 0;
}


Measured memory_bytes: 256