akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

///*********************************** C o n s t ***********************************///

const int       N=1e6+3;
const double    PI = acos(-1);
const ll        MOD=1000000007;                 ///1e9+7
ll dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
ll dy[] = {0, +1, 0, -1, +1, -1, +1, -1};



#define pb push_back
#define F first
#define S second
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define gap ' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ll p=MOD;a%=p;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=p;--b;}a*=a;a%=p;b/=2;}return pr;}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<=N;jj+=2*ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///

 int main()
 { ll a,b,c,d,mul1,mul2,mul3,mul4;
 cin>>a>>b>>c>>d;
 mul1=a*c;
 mul2=a*d;
 mul1=max(mul1,mul2);
 mul3=b*c;
 mul4=b*d;
 mul4=max(mul3,mul4);
 mul1=max(mul1,mul4);
cout<<mul1<<endl;
 return 0;


}


///Thanking you by Roxy





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

int main() {
	long A, B, C, K;
	cin >> A >> B >> C >> K;
	
	long sum = 0;
	if (K < A || K == A) {
		sum = K;
	}
	else {
		sum = A;
		if ((K - A) > B) {
			sum -= (K - A - B);
		}
	}
	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 3640
import java.util.*;
import java.awt.geom.*;
import java.awt.geom.Line2D.Double;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int n = sc.nextInt();
			if(n==0) break;
			
			double sx = sc.nextDouble();
			double sy = sc.nextDouble();
			double ex = sc.nextDouble();
			double ey = sc.nextDouble();
			
			Line2D.Double se = new Line2D.Double(sx,sy,ex,ey);
			Line2D.Double[] q = new Line2D.Double[4];
			Point2D.Double[] p = new Point2D.Double[4];
			double ans = Integer.MAX_VALUE;
			boolean flag = false;
			for(int i=0;i<n;i++){
				double minx = sc.nextDouble();
				double miny = sc.nextDouble();
				double maxx = sc.nextDouble();
				double maxy = sc.nextDouble();
				double h = sc.nextDouble();
				if(flag==false){
					p[0] = new Point2D.Double(minx,miny);
					p[1] = new Point2D.Double(maxx,miny);
					p[2] = new Point2D.Double(maxx,maxy);
					p[3] = new Point2D.Double(minx,maxy);
					q[0] = new Line2D.Double(p[0],p[1]);
					q[1] = new Line2D.Double(p[1],p[2]);
					q[2] = new Line2D.Double(p[2],p[3]);
					q[3] = new Line2D.Double(p[3],p[0]);
					
					if(minx<=sx && sx<=maxx && miny<=sy && sy<=maxy && minx<=ex && ex<=maxx && miny<=ey && ey<=maxy) flag = true;
					double min = Integer.MAX_VALUE;
					for(int j=0;j<4;j++){
						if(se.intersectsLine(q[j])==true) flag = true;
						min = Math.min(min, se.ptSegDist(p[j]));
						min = Math.min(min, q[j].ptSegDist(sx,sy));
						min = Math.min(min, q[j].ptSegDist(ex,ey));
					}
					if(h>min) ans = Math.min(ans, min);
					else ans = Math.min(ans, (min*min+h*h)/(2*h));
				}
			}
			
			if(flag==true) System.out.println(0);
			else System.out.println(ans);
		}	
	}	
}

Measured memory_bytes: 67316
#include <iostream>
#include <vector>

using namespace std;

void solve()
{
	int N, M;
	cin >> N >> M;
	vector<int> A(M);
	for (int i = 0; i < M; ++i)
	{
		cin >> A[i];
		--A[i];
	}
	vector<int> point(N);
	for (int i = 0; i < M; ++i)
	{
		vector<int> B(N);
		for (int j = 0; j < N; ++j)
		{
			cin >> B[j];
			--B[j];
		}
		int count = 1;
		for (int j = 0; j < N; ++j)
		{
			if (j == A[i])
			{
				continue;
			}
			if (A[i] != B[j])
			{
				++count;
			}
			else
			{
				++point[j];
			}
		}
		point[A[i]] += count;
	}
	for (int i = 0; i < N; ++i)
	{
		cout << point[i] << endl;
	}
}

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

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

int main() {
  int n, W;
  cin >> n >> W;
  vector<int> w(n), v(n);
  for (int i = 0; i < n; ++i) cin >> w[i] >> v[i];

  vector< vector<ll> > dp(n + 1, vector<ll>(W + 5, 0));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= W; ++j) {
      if (j - w[i] >= 0) {
	dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - w[i]] + v[i]);
      }
      dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
    }
  }
  cout << dp[n][W] << '\n';
  return 0;
}


Measured memory_bytes: 83084
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long INF = 1LL << 60; 

int main()
{
  string s; cin >> s;
  int res = 0;
  rep(i, s.size())
  {
    if(s[i] == '1') res++;
  }
  cout << res << endl;
}

Measured memory_bytes: 256
//minamoto
#include<bits/stdc++.h>
#define R register
#define ll long long
#define inf 0x3f3f3f3f3f3f3f3f
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
char buf[1<<21],*p1=buf,*p2=buf;
inline char getc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}
ll read(){
    R ll res,f=1;R char ch;
    while((ch=getc())>'9'||ch<'0')(ch=='-')&&(f=-1);
    for(res=ch-'0';(ch=getc())>='0'&&ch<='9';res=res*10+ch-'0');
    return res*f;
}
inline char getop(){R char ch;while((ch=getc())>'Z'||ch<'A');return ch;}
const int N=505;
struct eg{int v,nx,w;ll c;}e[N*N];int head[N],tot;
inline void add(R int u,R int v,R ll c){
	e[++tot]={v,head[u],1,c},head[u]=tot,
	e[++tot]={u,head[v],0,-c},head[v]=tot;
}
int x[N],y[N],a[N],b[N],t[N],LL[N],RR[N],DD[N],UU[N],vis[N],pe[N],n,m,S,T;
ll v[N],dis[N],res,ans;queue<int>q;
bool spfa(){
	memset(dis,0x3f,sizeof(dis));
	dis[S]=0,q.push(S);
	while(!q.empty()){
		int u=q.front();q.pop(),vis[u]=0;
		go(u)if(e[i].w&&(cmin(dis[v],dis[u]+e[i].c)?pe[v]=i,1:0)&&!vis[v])q.push(v),vis[v]=1;
	}
	if(dis[T]==inf)return false;
	res+=dis[T];
	for(R int i=T;i!=S;i=e[pe[i]^1].v)--e[pe[i]].w,++e[pe[i]^1].w;
	return true;
}
ll calc(int k){
	fp(i,1,k)LL[i]=DD[i]=0,RR[i]=UU[i]=19260817;
	fp(i,1,m)if(b[i]<k){
		switch(t[i]){
			case 'L':LL[b[i]+1]=a[i]+1;break;
			case 'R':RR[k-b[i]]=a[i]-1;break;
			case 'D':DD[b[i]+1]=a[i]+1;break;
			case 'U':UU[k-b[i]]=a[i]-1;break;
		}
	}
	fp(i,2,k)cmax(LL[i],LL[i-1]),cmax(DD[i],DD[i-1]);
	fd(i,k-1,1)cmin(RR[i],RR[i+1]),cmin(UU[i],UU[i+1]);
	memset(head,0,sizeof(head)),tot=1;
	S=0,T=(n+k)<<1|1;
	fp(i,1,n)add(i,n+i,-v[i]);
	fp(i,1,k){
		add(S,n+n+i,0),add(n+n+k+i,T,0);
		fp(j,1,n){
			if(x[j]>=LL[i]&&x[j]<=RR[i])add(n+n+i,j,0);
			if(y[j]>=DD[i]&&y[j]<=UU[i])add(n+j,n+n+k+i,0);
		}
	}
	res=0;while(spfa());
	return -res;
}
int main(){
//	freopen("testdata.in","r",stdin);
	n=read();
	fp(i,1,n)x[i]=read(),y[i]=read(),v[i]=read();
	m=read();
	fp(i,1,m)t[i]=getop(),a[i]=read(),b[i]=read();
	fp(i,1,n)cmax(ans,calc(i));
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 2816
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 100005
#define mod 1000000007
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define sd(n) scanf("%lld",&n)
 int main()
 {
  ll n,x,o,f;
  cin>>n;
  o=0,f=0;
  ll e=0;
  while(n--)
  {
    cin>>x;
    if(x%4==0)
      f++;
    else if(x&1)
      o++;
    else e++;
    
  }
  if(e==1)
  o++;
  if(o>f+1||(o==f+1&&e>1))
    cout<<"No";
  else cout<<"Yes";
 }

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast_io ios_base::sync_with_stdio(NULL); cin.tie(NULL);
#define endl '\n'
using namespace std;


int main(){
        fast_io
        int a ; cin>>a;
        string s ; cin>>s;
        if(a<3200) cout<<"red"<<endl;
        else cout<<s<<endl;

    return 0;
}



Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

a.sort()
ans = a[-1]
j = -2
flag = 0
for i in range(n-2):
    ans += a[j]
    if flag:
        j -= 1
        flag = 0
    else:
        flag = 1

print(ans)

Measured memory_bytes: 105276
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <map>
#include <iomanip>
#include <stdio.h>
#include <bitset>

typedef long long ll;

constexpr long long INFLL = 1e18;

using namespace std;

int main()
{
    int n;
    cin >> n;
    int a;
    int ans = 0;

    for (int i = 1; i <= n; i++)
    {
        cin >> a;
        if (i % 2 == 1 && a % 2 == 1)
        {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

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

int main(){
    int pre_meiji_e = 18680907;
    int meiji_e = 19120729;
    int meiji_s = 1868;
    int taisho_e = 19261224;
    int taisho_s = 1912;
    int showa_e = 19890107;
    int showa_s = 1926;
    int heisei_s = 1989;

    int y, m, d, n;
    while(cin >> y >> m >> d){
        n = y*10000 + m*100 + d;

        if(n <= pre_meiji_e) cout << "pre-meiji" << endl;
        else if(n <= meiji_e) cout << "meiji " << y-meiji_s+1 << " " << m << " " << d << endl;
        else if(n <= taisho_e) cout << "taisho " << y-taisho_s+1 << " " << m << " " << d << endl;
        else if(n <= showa_e) cout << "showa " << y-showa_s+1 << " " << m << " " << d << endl;
        else  cout << "heisei " << y-heisei_s+1 << " " << m << " " << d << endl;
    }
}

Measured memory_bytes: 1164
#include<stdio.h>

int main(void){
    int a,b,c;
    int temp;
    scanf("%d %d %d",&a,&b,&c);

    if(a>b){
        temp = a;
        a = b;
        b = temp;
    }
    if(b>c){
        temp = b;
        b = c;
        c = temp;
    }
    if(a>b){
        temp = a;
        a = b;
        b = temp;
    }

    printf("%d %d %d\n",a,b,c);

    return 0;
}


Measured memory_bytes: 2040
import sys
#h,w=map(int,input().split())
#S=[list(map(int,input().split())) for _ in range(h)]
a,b=map(int,input().split())
for i in range(2000):
    if int(i*8/100)==a and int(i*10/100)==b:
        print(i)
        exit()
print(-1)


Measured memory_bytes: 9160
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};

const int MAX=510000;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  string s;
  cin >> s;
  bool ok = false;
  rep(i,2)if(s[i]!=s[i+1])ok=true;
  if(ok)cout<<"Yes"<<endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<n;++i)
#define FOR(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
static const LL INF = 1LL<<61LL;
static const int mod = 10007;
typedef pair<int,int> PII;
LL N,K;
LL V[11][2020];
LL Q[11][2020],T[11][2020];
LL mem[2020][11];
LL temp;

LL cal(int n,int kind){
    LL res=0;
    if(mem[n][kind]!=INF){
        return mem[n][kind];
    }
    if(n==K||kind>temp) return 0;
    REP(i,K-n){
        if(n+i<=K){
            if(Q[kind][i]){
                res=max(cal(n+i+1,kind+1)+Q[kind][i],max(cal(n,kind+1),res));
            }
        }
    }
    return mem[n][kind]=res;
}

signed main(){
    REP(i,2001)REP(j,11)mem[i][j]=INF;
    cin>>N>>K;
    REP(i,N){
        LL C,G;
        cin>>C>>G;
        V[G][i]=C;
        temp=max(temp,G);
    }
    FOR(i,1,temp){
        sort(V[i],V[i]+N,greater<LL>());
        REP(j,K){
            if(!V[i][j])break;
            T[i][j]=j*(j+1);
            Q[i][j]=Q[i][j-1]+V[i][j]+T[i][j]-T[i][j-1];
        }
    }
    cout<<cal(0,1)<<endl;
}

Measured memory_bytes: 1624
#define _USE_MATH_DEFINES
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <tuple>
#include <climits>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<double> VD;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<bool>> VVB;
typedef vector<vector<double>> VVD;

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

const int MOD = 1000000007;

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

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

int digit(int n){
	int res=0;
	while(n>0){
		n/=10;
		res++;
	}
	return res;
}

int main(){
	int n;cin>>n;
	int d = digit(n);
	int ans=0;
	for(int i=1;i<d;i+=2){
		ans+=9*pow(10,i-1);
	}
	if(d%2){
		ans+=n-pow(10,d-1)+1;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 512
#include<stdio.h>
#include<math.h>

int main(void){

  double x1,x2,y1,y2;

  scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);

  printf("%f\n",sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)));

  return 0;
}

Measured memory_bytes: 1836
#include<bits/stdc++.h>
using namespace std;
using LL = long long;

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


int main(){
    int N;cin >> N;
    string s;cin >> s;
    vector<vector<int>> dp(N, vector<int>(2, 0));
    if(s.at(0) == '.'){
        dp[0][1] = 1;
    }else{
        dp[0][0] = 1;
    }
    for(int a = 1;a < N;a++){
        if(s.at(a) == '.'){
            dp[a][0] = dp[a-1][0];
            dp[a][1] = min(dp[a-1][0], dp[a-1][1])+1;
        }else{
            dp[a][0] = dp[a-1][0]+1;
            dp[a][1] = min(dp[a-1][0],dp[a-1][1]);
        }
    }
    cout<<min(dp[N-1][0], dp[N-1][1])<<endl;
}


Measured memory_bytes: 11396
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, n)       for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t)   for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#ifndef DBG
#define trace(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> make_v(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto make_v(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...));
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &out, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) out << e << delim[&e == &vec.back()];
    return out;
}
// }}} End Header

constexpr double PI = M_PI;

#define rad2deg(a) ((a) / PI * 180.0)
#define deg2rad(a) ((a) / 180.0 * PI)
using Double = long double;

double V(double a, double b, double theta) {
    const double btan = b * tan(PI / 2 - theta);
    if (btan <= a) {
        return b * a * btan / 2;
    } else {
        const double h = a * tan(theta);
        return a * a * b - (a * a * h) / 2;
    }
}

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    int a, b;
    double x;
    read(a, b, x);

    double ok = deg2rad(0);
    double ng = deg2rad(90);
    rep(i, 100) {
        const double mid = (ok + ng) / 2;
        if (V(a, b, mid) > x) ok = mid;
        else ng = mid;
    }

    cout << fixed << setprecision(12);
    print(rad2deg(ok));

    return 0;
}


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

int main(int argc, char const* argv[])
{
    long long N, M;
    cin >> N >> M;
    vector<int> AC(N+1, 0);
    vector<int> WA(N+1, 0);
    int ac = 0;
    for (long long i = 0; i < M; i++) {
        int n;
        string s;
        cin >> n >> s;
        if (s == "AC") {
            if (AC[n] == 0) {
                ac++;
            }
            AC[n] = 1;
        } else {
            if (AC[n] == 0) {
                WA[n]++;
            }
        }
    }
    int wa = 0;
    for (long long i = 0; i < N+1; i++) {
        if (AC[i] == 1) {
            wa += WA[i];
        }
    }
    cout << ac << " " << wa << endl;
    return 0;
}


Measured memory_bytes: 1024
<?php
$N = trim(fgets(STDIN));
// echo $input, PHP_EOL;

// echo $N, PHP_EOL;
$A = explode(" ",trim(fgets(STDIN)));
// print_r($A);
// $B = [];
$count = 0;
$count1 = 0;
while($count == 0){
  for($i = 0; $i < count($A) ;$i++) {
    if($A[$i]%2==0){ 
    } else {
    $count++;
    }
  }
  if($count == 0){ 
    for($i = 0; $i < count($A) ;$i++) {
      $A[$i] = $A[$i]/2;  
    }
    $count1++;
  }
}

echo $count1;


?>


Measured memory_bytes: 4856
void solve();

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

//////////////////////////////////////////////////
//////////////////////////////////////////////////
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <functional>
using namespace std;

//最大公約数
//O(log max(a,b))
template<class T>
T GCD(T a, T b) {
	if (b == 0)return a;
	return GCD(b, (T)(a % b));
}

template<class T>
class segTree {
public:
	int N;   //中身のある要素数
	int RN;   //2の累乗数にするために合わせた、ゴミデータ含めた要素数
	T* array;
	pair<int, int>* range;
	std::function<T(T,T)> f;
	//コンストラクタ:要素数、計算用ラムダ、初期化用の数
	segTree(int n, function<T(T,T)> F,T z) {
		N = n;
		RN = 1;
		while (RN < N)RN *= 2;
		array = new T[2 * RN];
		for (int i = 0; i < 2 * RN; i++)array[i] = z;
		range = new pair<int, int>[2 * RN];
		range[1] = pair<int, int>(0,RN);
		for (int i = 1; i < RN; i++) {
			range[2 * i] = pair<int, int>(range[i].first,(range[i].first+range[i].second)/2);
			range[2 * i + 1] = pair<int, int>((range[i].first + range[i].second) / 2,range[i].second);
		}
		f = F;
	}
	~segTree() {
		delete array;
		delete range;
	}
	void set(int n, T t) {   //n番目の要素にtを設定
		n = RN + n;
		array[n] = t;
		while (n != 1) {
			n = n / 2;
			array[n] = f(array[2*n],array[2*n+1]);
		}
	}
	T call(int l, int r, int id) {
		if (l == range[id].first && r == range[id].second)return array[id];
		int m = (range[id].first + range[id].second) / 2;
		if (r <= m)return call(l,r,2*id);
		if (m <= l)return call(l, r, 2 * id + 1);
		else if (l < m && m < r) {
			return f(call(l,m,2*id),call(m,r,2*id+1));
		}
	}
	T get(int l, int r) {   //[a_l,a_r)
		return call(l,r,1);
	}
	T operator[](int a) {
		return get(a,a+1);
	}
};

int N;

void solve() {
	cin >> N;
	segTree<long int> t(N, [](int a, int b) {if (min(a, b) == -1)return max(a, b); return GCD(a, b); }, -1);
	for (int i = 0; i < N; i++) {
		int a;
		cin >> a;
		t.set(i, a);
	}
	long int m = t.get(1,N);
	for (int i = 0; i < N-1; i++) {
		m = max(m,GCD(t.get(0,i),t.get(i+1,N)));
	}
	m = max(m,t.get(0,N-1));
	cout << m << endl;
}

Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <bitset>
#include <tuple>
#include <set>
#include <map>
#define range(i, r) for(int i=0;i<r;i++)
#define ranges(i, l, r) for(int i=l;i<r;i++)
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
#define MODn 1000000009;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  int N;
  std::cin >> N;
  multiset<int> pre;
  set<int> data;
  std::vector<int> a(N);
  for(int i=0;i<N;i++) {
    std::cin >> a[i];
    if(pre.find(a[i])==pre.end()) data.insert(a[i]);
    pre.insert(a[i]);
  }
  //std::cout << pre.size() << '\n';
  if(data.size()==1){
    if(*(data.begin())==0)std::cout << "Yes" << '\n';
    else std::cout << "No" << '\n';
  }else if(data.size()==2){
    auto ite = data.begin();
    int a=*ite;
    ite++;
    int b=*ite;
    if(a==0&&pre.count(b)==(N*2)/3 &&pre.count(0)==N/3) std::cout << "Yes" << '\n';
    else std::cout << "No" << '\n';
  }else if(data.size()==3){
    auto ite = data.begin();
    int a=*ite;
    ite++;
    int b=*ite;
    ite++;
    int c=*ite;
    if(a!=0&& ((a^b)^c)==0 && pre.count(a)==pre.count(b) && pre.count(a)==pre.count(c)) std::cout << "Yes" << '\n';
    else std::cout << "No" << '\n';
  }else std::cout << "No" << '\n';
  return 0;
}


Measured memory_bytes: 7808
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const int vx[]={1,0,-1,0}, vy[]={0,1,0,-1};
const ll LINF=1e18;
const ld PI=abs(acos(-1));

int main(){
	string s; cin >> s;
	
	if((s.size() % 2) ^ (s[0] == s.back())) cout << "First" << endl;
	else cout << "Second" << endl;
	return 0;
}


Measured memory_bytes: 512
#include <stdio.h>

int main(){
  int N,K;
  int x[200000];
  int org=0,min=1000000000;
  int time,n;
  
  scanf("%d %d",&N,&K);
  for(int i=0;i<N;i++)
    scanf("%d",&x[i]);

  while(x[org]<0) org++;
  // right -> left
  if(org>=K){
    n=1;
    min = -x[org-K];
  }else
    n=K-org;
  for(n=n;n<=N-org;n++){
    time = x[org+n-1]*2 - x[org-(K-n)];
    if(time<min) min=time;
  }
  // left -> right
  time=1000000000;
  if(N-org>=K){
    n=1;
    time = x[org+K-1];
  }else
    n=K-(N-org);
  if(time<min)
    min = time;
  for(n=n;n<=org;n++){
    time = -x[org-n]*2 + x[org+K-n-1];
    if(time<min) min=time;
  }
  
  printf("%d\n",min);
  
  return 0;
}


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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,K;
    cin >> N >>K;
    cout <<N-K+1<< "\n";
}

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

int main() {
	string s, t;
	cin >> s >> t;
	int ns = s.length();
	int nt = t.length();
	vector<vector<int>> dp(ns + 1, vector<int>(nt + 1, 0));
	for (int i = 1; i <= ns; i++) {
		for (int j = 1; j <= nt; j++) {
			if (s[i - 1] == t[j - 1]) {
				dp[i][j] = 1 + dp[i - 1][j - 1];
			}
			else {
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
			}
		}
	}
	string ans = "";
	int i = ns, j = nt;
	while (i != 0 && j != 0) {
		if (dp[i - 1][j] == dp[i][j]) {
			i--;
		}
		else if (dp[i][j - 1] == dp[i][j]) {
			j--;
		}
		else {
			ans = s[i - 1] + ans;
			i--;
			j--;
		}
	}
	//reverse(ans.begin(), ans.end());
	cout << ans;
	return 0;
}

Measured memory_bytes: 35584
#include <iostream>
#include <cstring>
#include <queue>

using namespace std;

int main(){
	priority_queue<int> priorityqueue;//優先順位キュー
	char loader[8];//ローダー(char*)
	int loadnum;//ローダー(int)

	while (1){
		cin >> loader;
		if (strcmp(loader, "insert") == 0){
			cin >> loadnum;
			priorityqueue.push(loadnum);
		}
		if (strcmp(loader, "extract") == 0){
			cout << priorityqueue.top() << endl;
			priorityqueue.pop();
		}
		if (strcmp(loader, "end") == 0){
			break;
		}
	}

}

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

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

  string s;
  cin >> s;
  while (!s.empty()) {
    if (s.substr(s.size()-5, 5) == "erase") {
      s = s.substr(0, s.size() - 5);
    } else if (s.substr(s.size()-5, 5) == "dream") {
      s = s.substr(0, s.size() - 5);
    } else if (s.substr(s.size()-6, 6) == "eraser") {
      s = s.substr(0, s.size() - 6);
    } else if (s.substr(s.size()-7, 7) == "dreamer") {
      s = s.substr(0, s.size() - 7);
    } else {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <tuple>

using namespace std;

typedef long long ll;

struct range {
    ll start;
    ll end;
};

int main(void){
    ll n,m;
    cin >> n >> m;
    ll lmax = -1145141919810;
    ll rmin = 1145141919810;
    for(ll i = 0;i < m; i++){
        ll l,r;
        cin >> l >> r;
        lmax = lmax < l ? l : lmax;
        rmin = rmin > r ? r : rmin;
    }
    ll ans = 0;
    for(ll i = 1;i <= n; i++){
        if(i >= lmax && i <= rmin){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
#from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [LI()for i in range(n)]
inf = 10**17
mod = 10**9 + 7

a,b,c,d=MI()
L=a+b
R=c+d
if L>R:
    print("Left")
elif L==R:
    print("Balanced")
else:
    print("Right")

Measured memory_bytes: 38256
#include <bits/stdc++.h> 
#include <string.h>
using namespace std;  
int main()
{
	string s,s1,x;
	cin>>s;
	cin>>s1;
	x=s1.erase(s1.length()-1);
	if(x==s){
		cout<<"Yes";
	}
	else
	cout<<"No";
    return 0;  
}  

Measured memory_bytes: 3628
//### In The Name Of GOD ###

//%% Remember; (((He))) is The (((Accepter))) %%

// GOD IS GREATER ...

#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;

#define sz(a) (int)(a.size())
#define X first
#define Y second
#define int ll

const int N = 8e2 + 10;
int n, m, dis[N][N], k;
int dx[4] = {0, 0, -1, 1};
int dy[4] = {-1, 1, 0, 0};
char mat[N][N];
bool mark[N][N];

bool isval(int i, int j) {
	return !mark[i][j] && i < n &&  j < m && i >= 0 &&  j >= 0 && mat[i][j] == '.';
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin >> n >> m >> k;
	pair <int, int> st;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++) {
			cin >> mat[i][j];
			if(mat[i][j] == 'S')
				st = {i, j};
		}
	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++)
			dis[i][j] = 1e18;
	queue <pair<int, int>> q;
	q.push(st);
	dis[st.X][st.Y] = 0;
	mark[st.X][st.Y] = true;
	while(sz(q)) {
		pair<int, int> p = q.front();
		for(int i = 0; i < 4; i++)
			if(isval(p.X + dx[i], p.Y + dy[i])) {
				dis[p.X + dx[i]][p.Y + dy[i]] = dis[p.X][p.Y] + 1;
				mark[p.X + dx[i]][p.Y + dy[i]] = true;
				q.push({p.X + dx[i], p.Y + dy[i]});
			}
		q.pop();
	}
	int ans = 1e18;
	for(int i = 0; i < n; i++)
		for(int j = 0; j < m; j++) {
//			cout << dis[i][j] << ' ';
			if(dis[i][j] <= k) {
				int x = min({i, j, n - i - 1, m - j - 1});
//				cout << x << endl;
				ans = min(ans, (x + k - 1) / k + 1);
			}
		}
	cout << ans;
}


Measured memory_bytes: 6656
n,m,l=map(int,input().split())
a=[]
b=[]
c=0
ans=[]

for i in range(n):
  a.append(list(map(int,input().split())))

for i in range(m):
  b.append(list(map(int,input().split())))

for i in range(n):
  for j in range(l):
    for k in range(m):
      c+=a[i][k]*b[k][j]
    ans.append(c)
    c=0
  print(" ".join(map(str,ans)))
  ans.clear()




Measured memory_bytes: 6312
a=int(input())
b=int(input())
c=int(input())
x=int(input())
counter=0
for i in range(min(a+1,(x//500)+1)):
	for j in range(min(b+1,(x//100)+1)):
		if c*50>=(x-(500*i+100*j))>=0:
			counter+=1
print(counter)

Measured memory_bytes: 3064
from collections import defaultdict 
import sys,heapq,bisect,math,itertools,string

a,b = map(int,input().split())

if a == 0 or b == 0:
	print('Zero')
elif 0 < b:
	if a < 0 :
		print('Zero')
	else:
		print('Positive')
elif b < 0:
	if (b-a+1)%2 == 0:
		print('Positive')
	else:
		print('Negative')

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const int mod = 1000000007;
const int inf = 1000000000;

int n;
vector<int> c, s, f, r;

int main() {
    cin >> n;
    c.resize(n);
    s.resize(n);
    f.resize(n);
    for (int i = 0; i < n - 1; i++) {
        cin >> c[i] >> s[i] >> f[i];
    }
    for (int i = 0; i < n; i++) {
        int ans = 0;
        for (int j = i; j < n - 1; j++) {
            ans = max(s[j], ans + (f[j] - (ans % f[j])) % f[j]) + c[j];
        }
        r.push_back(ans);
    }
    for (int a : r) {
        cout << a << "\n";
    }
    return 0;
}

Measured memory_bytes: 256
N = gets.to_i
a = gets.chomp.split.map(&:to_i).sort
max_count = 1

i = j = 0

while i < a.size
  if a[i] - a[j] <= 2
    max_count = [max_count, i - j + 1].max
    i += 1
  else
    j += 1
  end
end

puts max_count

Measured memory_bytes: 12084
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	n, t, a := nextInt(), nextInt(), nextInt()

	var ans int
	x := a - t
	diff := 1000000000

	for i := 0; i < n; i++ {
		h := nextInt()

		if y := abs(x*500 + h*3); y < diff {
			diff = y
			ans = i
		}
	}

	fmt.Println(ans + 1)
}

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


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

int str_length(string);

typedef struct {
  int up;
  int back;
  int right;
  int left;
  int front;
  int down;
}dicetype;

int main(void){

  dicetype dice;
  string order;

  cin >> dice.up >> dice.back >> dice.right >> dice.left >> dice.front >> dice.down;

  cin >> order;

  for ( int i = 0 ; i < str_length(order) ; i++){
    switch(order[i]){

      int temp;

      case 'N':
      temp = dice.up;
      dice.up = dice.back;
      dice.back = dice.down;
      dice.down = dice.front;
      dice.front = temp;
      break;

      case 'S':
      temp = dice.up;
      dice.up = dice.front;
      dice.front = dice.down;
      dice.down = dice.back;
      dice.back = temp;
      break;

      case 'E':
      temp = dice.up;
      dice.up = dice.left;
      dice.left = dice.down;
      dice.down = dice.right;
      dice.right = temp;
      break;

      case 'W':
      temp = dice.up;
      dice.up = dice.right;
      dice.right = dice.down;
      dice.down = dice.left;
      dice.left = temp;
      break;

      default:
      break;
    }
  }

  cout << dice.up << endl;

  return 0;
}



int str_length(string str){
  int strlen;

  strlen = 0;

  while(str[strlen] != '\0'){
    strlen++;
  }

  return strlen;
}

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

main()
{
    long long int n,a,b,c;
    cin>>n>>a>>b>>c;
    if(n<=a)
    {
        cout<<n*b<<endl;
    }
    else{
        cout<<a*b+(n-a)*c<<endl;
    }
}


Measured memory_bytes: 3584
import re
import doctest


class IO_for_Contest(object):
    @staticmethod
    def my_input():
        # return raw_input()
        return input()

    @staticmethod
    def read_from_input():
        # TODO: impl this for each problem
        pass

    @staticmethod
    def read_line():
        return IO_for_Contest.my_input().strip()

    @staticmethod
    def read_int():
        return int(IO_for_Contest.my_input().strip())

    @staticmethod
    def read_n_int(n):
        return list(map(
                    int,
                    re.split('\s+', IO_for_Contest.my_input().strip())))[ : n]

def solve():
    ceil = 100
    string = IO_for_Contest.read_line()[: ceil]
    s = set(string)
    for xx in string:
        s.add(xx)
    for e in s:
        if string.count(e) % 2 != 0:
            print('No')
            return
    print('Yes')


if __name__ == '__main__':
    # doctest.testmod()
    solve()

Measured memory_bytes: 8172
N = int(input())

S, T = map(str, input().split())

#print(S)
#print(len(S))
#print(len(T))

moji = ""

if(len(S) == len(T) == N):
  for i in range(0, N):
    str = (S + T)[i::N]
    moji += str
print(moji)

Measured memory_bytes: 3064
#include <iostream>

int main() {
  int x, y;
  std::cin >> x >> y;
  if (x % y == 0) {
    std::cout << -1 << std::endl;
    return 0;
  }
  else {
    for (int i = 0; i < INT32_MAX; ++i) {
      if (x * i % y != 0) {
        std::cout << x * i << std::endl;
        return 0;
      }
    }
  }
  std::cout << -1 << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

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

	Int N, M;
	cin >> N >> M;

	map<Int, Int> cnt;

	Int a;
	Int temp = 0;
	for (Int i = 0; i < N; i++) {
		cin >> a;
		temp += a;
		temp %= M;
		cnt[temp]++;
	}

	Int ans = 0;
	Int s;
	for (auto itr = cnt.begin(); itr != cnt.end(); itr++) {
		s = itr->second;

		if (itr->first == 0) {
			ans += s;
		}
		if (s >= 2) {
			ans += s * (s - 1) / 2;
		}

	}

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


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}
vector<int>g[100005];
int main() {
  int N,M;
  cin>>N>>M;
  for(int i=0;i<M;i++){
    int a,b;
    cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  queue<int>q;
  vector<int>dist(N,-1);
  vector<int>pre(N,-1);
  dist[0]=0;
  q.push(0);
  while(!q.empty()){
    int v=q.front();
    q.pop();
    for(auto u:g[v]){
      if(dist[u]==-1){
        dist[u]=dist[v]+1;
        pre[u]=v;
        q.push(u);
      }
    }
  }
  cout<<"Yes"<<endl;
  for(int i=1;i<N;i++){
    cout<<pre[i]+1<<endl;
  }
  return 0;
}

Measured memory_bytes: 10576
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
//long long int countt[200003];
#include<ext/pb_ds/assoc_container.hpp> // include the associative containers or group of templates such as set, multimap, map etc.
#include<ext/pb_ds/tree_policy.hpp> // include the tree_order_statistics_node update
using namespace __gnu_pbds; //necessary for the GNU based Policy based data structures.
typedef tree<pair<int,int> ,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define int long long


signed main()
{
    FAST;
    
    int i=0,j=0,k=0,n=0,m=0,count=0,temp=0;
    int temp1=0,temp2=0,temp3=0,temp4=0,x=0,l=0,y=0,sum=0;
    int left=0,up=0,anss=0,start=0,end=0,r=0,q=0,total=0;
    int maxx=-1,minn=1e10,curr=0,ans=0,places=0,zeroes=0,low=0,high=0;
    int prev=0,mid=0,z=0,d=0,val=0;
    
    cin>>k;
    set<int> st;
    ans=1;
    //k--;
    for(i=2;i<=sqrt(k);i++)
    {
        if(k%i==0)
        {
            st.insert(i);
            st.insert(k/i);
        }
    }
    
    for(auto it:st)
    {
        temp=k;
        while(temp%it==0)
        {
            temp=temp/it;
        }
        
        if(temp%it==1)
        {
            
            ans++;
        }
    }
    
    
    if(k>2)
    ans++;
    st.insert(1);
    st.insert(k);
    st.insert(k-1);
    k--;
    
    
    
    for(i=2;i<=sqrt(k);i++)
    {
        if(k%i==0)
        {
            if(st.count(i)==0)
            {
                if(i!=k/i)
                ans=ans+2;
                
                else
                ans++;
            }
        }
    }
   
    
    
    
    cout<<ans<<endl;
    
    
    
    
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();


		if(N%10 == 3) {
			System.out.println("bon");
		}else if(N%10 == 0 || N%10 == 1 || N%10 == 6 || N%10 == 8){
			System.out.println("pon");
		}else {
			System.out.println("hon");
		}
	}

}


Measured memory_bytes: 35804
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
#define fast                                                                   \
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define fo(i,a,n) for (i = a; i <= n; i++)
#define F first
#define S second
#define pii pair<int,int>
#define sz size()
#define all(v) v.begin(),v.end()
#define pb push_back
#define pf push_front    
#define PB pop_back
#define pll pair<long long, long long>
#define vi vector<int>
#define vl vector<int>
#define mp make_pair
#define mod 1000000007
typedef unsigned long long ull;
const int N = 200005;
const int MOD = 998244353 ;



void solve(){
    string s, t;
    cin>>s>>t;
    t += s;
    cout<<t;
}


int32_t main() {
    fast
    int t;
    t = 1;
    //cin >> t;
    while(t--)solve();
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#define MAX_NM 200000
using namespace std;
int d[MAX_NM];
int main(void){
    int n;
    int d;
    map<int, int> mp;
    int m;
    int t;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> d;
        mp[d]++;
    }
    cin >> m;
    for(int i = 0; i < m; i++){
        cin >> t;
        mp[t]--;
        if(mp[t] < 0){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 9600
#include<stdio.h>

int main(){
	int input;
	scanf("%d", &input);
	char kata[input+1];
	scanf("%s", &kata);
	if(input%2==1){
		puts("No");
	}
	else {
		int flag = 1;
		for (int i=0;i<input/2;i++){
			if (kata[i] != kata[i+input/2]){
				flag=0;
			}
		}
		if (flag){
			puts("Yes");
		}
		else {
			puts("No");
		}
	}
	
	return 0;
}

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

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if((a==5&&b==5&&c&&7)||(a==5&&b==7&&c==5)||(a==7&&b==5&&c==5)){cout<<"YES";}
    else{cout<<"NO";}
    
}

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

#pragma GCC optimize("O2,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("Os")

/*				Bitch, where you when I was walkin'?
				Now I run the game, got the whole world talkin'				*/

/*				You never likes us anyway, fuck your friendship, I meant it */

/*				The Chanel or Balenciaga, Louis and Vuitton
				She know I got Fendi, Prada when I hit Milan				*/

/*				Niggas been counting me out
				I'm counting my bullets, I'm loading my clips
				I'm writing down names, I'm making a list					*/

/*				I ran away, I don't think I'm coming back home				*/

#define F first
#define S second
#define pb push_back
#define SZ(x) (ll)(x.size())
#define all(x) x.begin(),x.end()

typedef int ll;
typedef pair<ll,ll> pll;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn=5e2+10, maxm=1e5+10, lg=23, mod=1e9+7, inf=1e18;

const ll dx[]={+1,-1,0,0};
const ll dy[]={0,0,+1,-1};

ll n;
deque<pll> q;
ll dis[maxn][maxn];
bool kk[maxn][maxn];

bool val(ll x,ll y){ return (x>=1 && y>=1 && x<=n && y<=n); }
void dfs(ll x,ll y){
	ll dd=dis[x][y]+kk[x][y];
	for(auto k:{0,1,2,3}){
		ll xx=x+dx[k], yy=y+dy[k];
		if(val(xx,yy))if(dis[xx][yy]>dd) dis[xx][yy]=dd, dfs(xx,yy);
	}
}

int main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	
	cin>>n;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++){
		dis[i][j]=min({i-1,n-i,j-1,n-j});
		kk[i][j]=1;
	}
	ll ans=0;
	for(int i=1;i<=n*n;i++){
		ll x,y; cin>>x; x--;
		y=(x%n)+1; x=(x/n)+1;
		ans+=dis[x][y];
		kk[x][y]=0;
		dfs(x,y);
	}
	cout<<ans;
	
	return 0;
}



















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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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;
}

int main() {
  string S; cin >> S;
  if(S ==  "ABC") {
    cout << "ARC" << endl;
  } else {
    cout << "ABC" << endl;
  }
}

Measured memory_bytes: 3644
#include<stdio.h>
int main(void){

  int i;
  for(i=1;i<10;i++){
    printf("%dx1=%d\n",i,i*1);
    printf("%dx2=%d\n",i,i*2);
    printf("%dx3=%d\n",i,i*3);
    printf("%dx4=%d\n",i,i*4);
    printf("%dx5=%d\n",i,i*5);
    printf("%dx6=%d\n",i,i*6);
    printf("%dx7=%d\n",i,i*7);
    printf("%dx8=%d\n",i,i*8);
    printf("%dx9=%d\n",i,i*9);

  }


  return 0;
}

Measured memory_bytes: 2584
#include <bits/stdc++.h>
using namespace std;
#define  ft   ios_base::sync_with_stdio(false);cin.tie(NULL);
#define  ll   long long
#define  pb   push_back
#define  ll   long long
#define  mk   make_pair
#define  msi  map<string,int>
#define  mii  map<int,int>
#define  pii  pair<int,int>
const int N=2e5+3;
string s,p;

int main()
{
    ft
    ll t,i,j,n,m;
    cin>>n>>m;
    while(n!=0)
    {
        j=n%m;
        n/=m;
        s.pb(j);
    }
    cout<<s.size()<<"\n";
    return 0;
}


Measured memory_bytes: 256
import copy

N = int(input())
p_list = list(map(int, input().split()))

flag = 0


# 操作不要の場合
if p_list == sorted(p_list):
  print("YES")
  flag = 1
  
# 1回だけ操作
if flag == 0:
  for i in range(N):
    for j in range(i, N):
      # print(i, j)
      new_p_list = copy.deepcopy(p_list)
      tmp = new_p_list[j]
      new_p_list[j] = new_p_list[i]
      new_p_list[i] = tmp
      # print(new_p_list)
      # print(sorted(p_list))
      if new_p_list == sorted(p_list):
        print("YES")
        flag = 1
        break
      
if flag == 0:
  print("NO")

Measured memory_bytes: 3700
#include <iostream>
#include <stdio.h>

using namespace std;

int n, k;

int main(void)
{
	cin >> n >> k;
	
	double ans = 0;
	for(int i = 1; i <= n; i++){
		double tmp = 1.0/n;
		for(int x = i; x < k; x *= 2) tmp *= 0.5;
		ans += tmp;
	}
	printf("%.11f\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	string S;
	cin >> S;
	int N = S.size();
	bool ans = true;
	for(int i = 0; i < N; i += 2){
		if(S[i] == 'L') ans = false;
	}
	for(int i = 1; i < N; i += 2){
		if(S[i] == 'R') ans = false;
	}

	if(ans) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main()
{
	ll N,A,B;
	cin >> N>>A>>B;
	vecl(H);
	fx(N) {
		vecpl(H);
	}
	A -= B;
	ll left = 0, right = 2000000000;
	ll mid;
	while(right-left>1) {
		mid = (left + right ) / 2;
		ll k = 0;
		fy(N) {
			if (H[y] >mid*B) {
				//ll tmp = (H[y] - mid * B);
				//k -= (tmp + A - 1) / A;
				if ((H[y]-mid*B)%A==0) {
					k += (H[y] - mid * B) / A;
				}
				else {
					k += (H[y] - mid * B) / A + 1;
				}
			}
		}

		if (k <= mid) {
			right = mid;
		}
		else {
			left = mid;
		}
	}
	//doublece(left,right)
	ce(right)
	
    return 0;
}



Measured memory_bytes: 1400