akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>

int main(){
	int h,w;
	scanf("%d %d",&h,&w);
	char array[h][w+1];
	int i;
	for(i=0;i<h;i++){
		scanf("%s",array[i]);
	}
	for(i=0;i<w+2;i++){
		printf("#");
	}
	printf("\n");
	for(i=0;i<h;i++){
		printf("#");
		printf("%s",array[i]);
		printf("#\n");
	}
		for(i=0;i<w+2;i++){
		printf("#");
	}

	return 0;
}

Measured memory_bytes: 128
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    a, b, c, x = [int(input()) for i in range(4)]
    
    res = 0
    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if i * 500 + j * 100 + k * 50 == x:
                    res += 1
    
    print(res)


Measured memory_bytes: 2940
import sys
ls = []
N = int(input())
for l in sys.stdin:
    ls.append(l.split())

c = 0
p = 0
ans = 'No'
while len(ls) > c:
    if ls[c][0] != ls[c][1]:
        c += 1
        p = 0
        continue
    else:
        c += 1
        p += 1
        if p == 3:
            ans = 'Yes'
            break

print(ans)

Measured memory_bytes: 9188
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>


using namespace std;
typedef long long ll;

#define mod 1000000007
#define INF 2000000000
#define LLINF 4000000000000000000
#define SIZE 10000

int mo[5] = {0,1,0,-1,0};

ll keta(ll x){
    if(x < 10)
        return 10;
    if(x < 100)
        return 100;
    if(x < 1000)
        return 1000;
    if(x < 10000)
        return 10000;
    
    return 100000;
}

int main(){
    int n,A,a[SIZE+1]={0};
    ll ans[4]={LLINF,LLINF,LLINF,LLINF};
    
    scanf("%d",&n);
    
    for(int i=0;i<n;i++){
        scanf("%d",&A);
        
        a[A]++;
    }
    
    for(ll i=1;i<SIZE;i++){
        if(a[i]==0) continue;
        
        for(ll j=1;j<SIZE;j++){
            if((a[j] == 0) || (i==j && a[j] <= 1)) continue;
            
            ans[3] = i*keta(j)+j;
            
            for(int k=2;k>=0;k--){
                if(ans[k] > ans[k+1]){
                    swap(ans[k], ans[k+1]);
                }
            }
            
        }
    }
    
    printf("%lld\n",ans[2]);
    
    return 0;
}

Measured memory_bytes: 1232
#include<bits/stdc++.h>
using namespace std;
using Graph=vector<vector<int>>;
int main(){
int N,M;
  cin>>N>>M;
  vector<pair<int,int>>A(M);
  for(int i=0;i<M;i++){
  int a,b;
    cin>>a>>b;
    pair<int,int>p(a,b);
    A.at(i)=p;
  }int ans=0;
  for(int i=0;i<M;i++){
  Graph G(N);
    for(int j=0;j<M;j++){
    if(j!=i){
      int a=A.at(j).first-1;
      int b=A.at(j).second-1;
      G[a].push_back(b);
      G[b].push_back(a);
    }
    }
    queue<int>que;
    que.push(0);
    vector<bool>J(N,false);
    J.at(0)=true;
    while(!que.empty()){
      int u=que.front();
      que.pop();
      for(auto v:G[u]){
      if(J[v])
        continue;
        else{
        J.at(v)=true;
          que.push(v);
        }
      
      }
    
    } bool x=true;
    for(int i=0;i<N;i++)
      if(!J.at(i)){x=false; break;}
    
    if(!x)
      ans++;
  }cout<<ans<<endl;
   return 0;
}

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

#define ll long long
const int mod = 1e9 + 7;
ll int INF = 1e17;


int n;
int arr[105];
int dp[100005][2];

int kil(int k, int player)
{
  if(k <= 0)
  {
    // which ever players turn he looses
    return 1 - player;
  }

  if(dp[k][player] != -1)
    return dp[k][player];

  int res = 1-player;
  for(int i=0;i<n;i++)
  {
    if(arr[i] <= k)
    {
      res = kil(k-arr[i], 1-player);
      if(res == player)
        break;
    }
  }
  dp[k][player] = res;
  return dp[k][player];
}

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

  memset(dp, -1, sizeof dp);

  int k, res;
  cin>>n>>k;
  for(int i=0;i<n;i++)
    cin>>arr[i];

  res = kil(k, 1);

  cout<<((res == 1) ? "First" : "Second")<<endl;

  return 0;
}


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

using namespace std;

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

  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  for (int i = 0; i < h; ++i) {
    cin >> s[i];
  }
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      int cnt = 0;
      if (s[i][j] == '#') continue;
      for (int k = -1; k < 2; ++k) {
        for (int l = -1; l < 2; ++l) {
          if (k == 0 && l == 0)
            continue;
          int px = j + k;
          int py = i + l;
          if (px < 0 || py < 0 || w <= px || h <= py) {
            continue;
          }
          cnt += s[py][px] == '#';
        }
      }
      s[i][j] = cnt + '0';
    }
  }
  for (auto& row : s) {
    cout << row << "\n";
  }
}


Measured memory_bytes: 256
import math
n, d = list(map(int, input().split()))
a = [[0]*d]*n
ans = []
temp = 0
count = 0
for i in range(n):
    a[i] = list(map(int, input().split()))

for i in range(n):
    for j in range(i+1, n):
        for k in range(d):
            temp += (a[i][k]-a[j][k])*(a[i][k]-a[j][k])
        ans.append(math.sqrt(temp))
        temp = 0
for i in range(len(ans)):
    if ans[i]%1 == 0:
        count+=1
print(count)

Measured memory_bytes: 3064
N, K, Q = map(int, input().split())
 
P = [0] * N
for i in range(Q):
    tmp = int(input()) - 1
    P[tmp] += 1
 
sumP = sum(P)
for n in range(N):
    ans = 'No'
    total = sumP - P[n]
    if  K - total > 0:
        ans = 'Yes'
    print(ans)

Measured memory_bytes: 4680
#include <iostream>
#include <unordered_map>

using namespace std;
int n;
unordered_map<string,int> mymap;

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


Measured memory_bytes: 17160
#include<iostream>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<vector>
#include<array>
#include<string>
#include<stack>
#include<queue>
#include<algorithm>
#include<cassert>
#include<functional>
#include<random>
#include<complex>
#include<bitset>
#include<chrono>
//#include<boost/multiprecision/cpp_int.hpp>
#define int int64_t
#define uint uint64_t
#define REP(i, a, b) for (int64_t i = (int64_t)(a); i < (int64_t)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define SZ(X) ((int64_t)((X).size()))
#define ITR(x, a) for (auto x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define Min(x) *min_element(ALL(x))
#define Max(x) *max_element(ALL(x))
#define Unique(L) (L.erase(unique(ALL(L)), L.end()))
#define intmax (std::numeric_limits<int64_t>::max() / 4)
#define doublemax (std::numeric_limits<double>::max() / 4)
using namespace std;
//typedef boost::multiprecision::cpp_int bigint;
const double EPS = 1e-9;
const double PI = acos(-1.0);




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

	int N, M;
	cin >> N >> M;
	vector<array<int, 2>>s(N), c(M);
	rep(i, N)cin >> s[i][0] >> s[i][1];
	rep(i, M)cin >> c[i][0] >> c[i][1];
	rep(i, N) {
		int dist = intmax, ans = 0;
		rep(j, M) {
			int d = abs(s[i][0] - c[j][0]) + abs(s[i][1] - c[j][1]);
			if (d < dist) {
				dist = d;
				ans = j;
			}
		}
		cout << ans+1 << endl;
	}




	return 0;
}

Measured memory_bytes: 256
/*
      author  : nishi5451
      created : 12.08.2020 22:27:22
*/

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


int main(){
    int n,m; 
    cin >> n >> m;
    vector<string> s,t;
    rep(i,n){
        string tmp;
        cin >> tmp;
        s.push_back(tmp);
    }
    rep(i,m){
        string tmp;
        cin >> tmp;
        t.push_back(tmp);
    }

    rep(i,n-m+1){
        rep(j,n-m+1){
            bool check = true;
            rep(k,m){
                if(s[i+k].substr(j,m)!=t[k]){
                    check = false;
                    break;
                }
            }
            if(check==true){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,m,n) for(int i=m;i<n;i++)
#define ALL(N) (N.begin(),N.end())

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  if(S=="Sunny") cout << "Cloudy" << endl;
  else if (S=="Cloudy") cout << "Rainy" << endl;
  else cout << "Sunny" << endl;
}

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

int main( void )
{
    int a, b;
    std::cin >> a >> b;
    const int d = a / b;
    const int r = a % b;
    const double f = static_cast<double>( a ) / static_cast<double>( b );
    printf( "%d %d %.5f\n", d, r, f );
    return 0;
}

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

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << endl; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << std::endl;
}

int main() {
    Int n, k;
    cin >> n >> k;
    vector<Int> a(n, 0);
    for (Int i = 0; i < (Int)n; i++) {
        cin >> a[i];
    }
    for (Int i = 0; i < (Int)k; i++) {
        vector<Int> b(n + 1, 0);
        for (Int j = 0; j < (Int)n; j++) {
            b[max((Int)0, j - a[j])]++;
            b[min(n, j + a[j] + 1)]--;
        }
        for (Int j = 0; j < (Int)n; j++) {
            b[j + 1] += b[j];
        }
        bool check = true;
        for (Int j = 0; j < (Int)n; j++) {
            if (a[j] != b[j]) {
                check = false;
                break;
            }
        }
        if (check) break;
        for (Int j = 0; j < (Int)n; j++) {
            a[j] = b[j];
        }
    }
    print(a);
    return 0;
}

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

int main(){
    int a;
    cin >> a;
    int b,c;
    b=(a/1000)*10+(a/100)%10,c=((a/10)%10)*10+a%10;

    if(b==0&&c==0||b==0&&c>=13||c==0&&b>=13){
        cout << "NA" << endl;
        return 0;
    }
    else if(b==0){
        cout << "YYMM" << endl;
        return 0;
    }
    else if(c==0){
        cout << "MMYY" << endl;
        return 0;
    }
    else if(b>=13&&c>=13){
        cout << "NA" << endl;
        return 0;
    }
    else if(b>=13){
        cout << "YYMM" << endl;
        return 0;
    }
    else if(c>=13){
        cout << "MMYY" << endl;
        return 0;
    }
    else {
        cout << "AMBIGUOUS" << endl;
        return 0;
    }
}

Measured memory_bytes: 256
MOD = 10**9 + 7
MAX = 5*10**5 + 1

fact = [0 for _ in range(MAX)]
factinv = [0 for _ in range(MAX)]

fact[0] = 1
for k in range(1, MAX):
    fact[k] = fact[k - 1]*k
    fact[k] %= MOD

factinv[MAX - 1] = pow(fact[MAX - 1], MOD - 2, MOD)
for k in range(MAX - 1, 0, -1):
    factinv[k - 1] = factinv[k]*k
    factinv[k - 1] %= MOD

def nCk(n, k):
    return fact[n]*factinv[k]*factinv[n - k] % MOD

def nPk(n, k):
    return fact[n]*factinv[n - k] % MOD

n, m = map(int, input().split(' '))

ans = 0
for k in range(n + 1):
    tmp = nCk(n, k)*nPk(m, k)*nPk(m - k, n - k)*nPk(m - k, n - k) % MOD
    if not k % 2: ans += tmp
    else: ans -= tmp
    ans %= MOD

print(ans)

Measured memory_bytes: 48532
#include <iostream>


#include <string>


#include <algorithm>


#include <utility>


#include <iomanip>


#include <functional>


#include <queue>


#include <stack>


#include <map>


#include <set>


#include <vector>


#include <cmath>


#include <cctype>


#include <cstdio>


#include <bitset>


#define ll long long


#define INF 1000000000000000001


#define MOD 1000000007


using namespace std;





int main(){


    int A,B;


    cin >> A >> B;


    int ans=0;


    int num=1;


    while(num<B){


        ans++;


        num+=A-1;


    }


    cout<<ans<<endl;


    return 0;


}

Measured memory_bytes: 256
$N=<>;
$p=0x55555555;
for(reverse 0..31){
	$p>>=1;
	if($_%2){
		if($%-$p>$N){
			$%-=1<<$_;
			$s.=1
		}else{
			$s.=0
		}
	}else{
		if($%+$p<$N){
			$%+=1<<$_;
			$s.=1
		}else{
			$s.=0
		}
	}
}
print$s=~s/^0*\B//r


Measured memory_bytes: 640
#include <cstdio>
#include <cstring>
 
const int p=1000000007;
 
int c[300][300],g[100],h[100];
char b[100];
int i,j,k,l,m,n,r,s,t;
 
inline void pre()
{
	scanf("%d%d",&n,&m);
	scanf("%s",b+1);
	for (i=0;i<=250;i++)
		for (j=0;j<=i;j++)
			if ((j==0) || (j==i))
				c[i][j]=1;
			else
				c[i][j]=(c[i-1][j]+c[i-1][j-1])%p;
	return;
}
 
inline void calc()
{
	for (i=1;i<=n;i++)
		h[i]=g[i];
	t=0;
	for (i=1,k=1,l=1;i<=m;i++)
		if ((b[i]=='r') && (h[k]>0))
			h[k]--,k++;
		else
		if ((b[i]=='b') && (h[l]>0) && (l<k))
			h[l]--,t=t+h[l],l++;
		else
		if (t>0)
			t--;
	if ((h[k]) || (h[l]) || (t))
		return;
	r=1;
	for (i=1;g[i];i=j)
	{
		for (j=i;g[i]==g[j];j++);
		r=1LL*r*c[j-1][i-1]%p;
		if (g[i]==1)
			t=t+j-i;
		else
			t=t+(j-i)*(2*g[i]-3);
	}
	t=t+k-2;
	if (n-t<0)
		return;
	s=(s+1LL*r*c[n+2*l-1][t+2*l-1])%p;
	return;
}
 
inline void dfs(int w,int x,int y,int z)
{
	if (w<0)
		return;
	if (z)
		calc();
	if (x)
	{
		g[z+1]=1,dfs(w-2,x-1,1,z+1);
		for (int i=2;(i<=x) && (i<=y);i++)
			g[z+1]=i,dfs(w-2*i+2,x-i,i,z+1);
		g[z+1]=0;
	}
	return;
}
 
int main()
{
	pre();
	dfs(n+1,m,m,0);
	printf("%d",(s+1)%p);
	return 0;
}

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

int keta(int a) {
  int rec = 0;
  
  do {
    rec ++;
    a /= 10;
  } while (a != 0);
  return rec;
}

main()
{
  int a, b;

  while( scanf("%d %d", &a, &b) != EOF ) {
    cout << keta(a + b) << endl;
  }
  
  return (0);
}



Measured memory_bytes: 3152
/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#pragma comment("-Wl,--stack=1024000000")
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#define eprintf(...) 0
#else
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#endif
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){int ret=1;do{if(y&1)ret=(ll)ret*x%md;x=(ll)x*x%md;}while(y>>=1);return ret;}
inline int Rand(){return rand()*32768+rand();}
//11-40 A
//41-70 B
//71-130 C
//131-200 pw2
#define less nfoafnloe
void less(int x,int y,int z){
	//a[x]=a[y]<a[z]
	printf("< %d %d %d\n",y,z,x);
}
void add(int x,int y,int z){
	//a[x]=a[y]+a[z]
	printf("+ %d %d %d\n",y,z,x);
}
void init(int l,int r){
	less(l,2,0);
	for(int i=l+1;i<=r;i++){
		add(i,i-1,i-1);
	}
}
int pw(int x){
	return 131+x;
}
int tot=301;
#define FOR for(int _=0;_<2;_++)
void add_mul(int x,int y,int z){
	//x+=y*z (0<=z<=1)
	int a=++tot,b=++tot,c=++tot,d=++tot,e=++tot;
	FOR{
		printf("+ %d %d %d\n",a,z,a);
	}
	FOR{
		printf("+ %d %d %d\n",a,c,b);
		printf("< %d %d %d\n",b,y,d);
		printf("+ %d %d %d\n",d,c,c);
	}
	//e+c=y
	FOR{
		printf("+ %d %d %d\n",c,e,a);
		printf("< %d %d %d\n",a,y,d);
		printf("+ %d %d %d\n",e,d,e);
	}
	printf("+ %d %d %d\n",x,e,x);
}
void binary(int x,int l,int r){
	const int tmp=201,use=202;
	less(tmp,2e5-1,x);add(x,x,tmp);
	for(int i=r;i>=l;i--){
		add(tmp,2e5-1,2e5-1);
		for(int j=i+1;j<=r;j++){
			add(tmp,tmp,j);
		}
		int pos=i-l;
		add(tmp,tmp,pw(i-l));
		less(use,tmp,x);
		add(i,i,use);
		for(int j=0;j<i-l;j++){
			add(i,i,i);
		}
	}
	for(int i=l;i<=r;i++)less(i,2e5-1,i);
}
const int reg=300;
int main(){
//	freopen("input.txt","w",stdout);
	puts("15724");
	init(131,190);
	binary(0,11,40);
	binary(1,41,70);
	for(int i=11;i<=40;i++){
		for(int j=41;j<=70;j++){
			int a=i-11,b=j-41;
			add_mul(a+b+71,i,j);
		}
	}
	int f1=299,f2=298,f3=297;
	for(int i=130;i>=71;i--){
		add(2,2,2);
		add(2,2,i);
	}
	return 0;
}

Measured memory_bytes: 3692
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;
 
#define  GODSPEED       ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define  f              first                 
#define  s              second
#define  newl           cout<<"\n";
#define  pb             push_back  
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" ";newl;
#define  deb1(a)        cout<<a<<"\n";
#define  deb2(a,b)      cout<<a<<" "<<b<<"\n";
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<"\n";
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n";
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());
#define  all(a)         a.begin(),a.end()           
 
typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   N     =  5e5+5;
const ll   mod   =  1e9;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;

ll test = 1, a, b;

ll calc(ll n){
	ll res = 0;
	if(n%4 == 1 or n %4 == 2) res = 1;
	for(ll i = 2; i <= n; i *= 2){
		if(n%(i*2) < i) continue;
		if((n%(i*2)-i+1)&1) res += i;
	}
	return res;
}

void solve(){
	cin >> a >> b; a = max(a-1,0ll);
	deb1((calc(a)^calc(b)))
}

int main(){
	GODSPEED;
	//cin>>test;
	for(int i = 1; i <= test; i++){
		solve();
	}
	#ifndef ONLINE_JUDGE
	cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	#endif
}

Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX 10

int n, m;
int edge[MAX][MAX];
int countnum = 0;
bool visited[MAX];

void dfs(int v, int res) {
  if (res == n) {
    countnum++;
    return;
  }
  for (int i = 1; i <= n; i++) {
    if (edge[v][i] && !visited[i]) {
      visited[i] = true;
      dfs(i, res + 1);
      visited[i] = false;
    }
  }
}

int main() {
  for (int i = 0; i < MAX; i++) {
    for (int j = 0; j < MAX; j++) {
      edge[i][j] = 0;
    }
  }
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    edge[a][b] = 1;
    edge[b][a] = 1;
  }
  for (int i = 0; i < MAX; i++) {
    visited[i] = false;
  }
  visited[1] = true;
  dfs(1, 1);
  cout << countnum << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
const ll mod = 1e9+7;
const int N = 2e5+6;
void solve(){
	int x,y,z; 
	cin>>x>>y>>z; 
	cout<<z<<" " <<x<<" "<<y<<endl;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1; 
//	cin>>t; 
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 3624
#include <iostream>

using namespace std;

#define rep(i, n) REP(i, 0, n)
#define REP(i,k,n) for(int i = k; i < n; i++)
#define mmax(start, end) *max_element(start, end)
#define mmin(start, end) *min_element(start, end)
#define argmax max_element
#define argmin min_element
#define push push_back
#define pop pop_back
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef string str;

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

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

    int n,p;

    while(cin >> n >> p,n){
        int a[55] = {};
        rep(i,n){
            a[i] = p/n + ((p%n>i)? 1 : 0);
        }
        // rep(i,n) cout << a[i] << " ";
        // cout << endl;
        int t = p%n;
        int owan = 0;
        int ans = -1;
        while(true){
            if(owan>0) {
                owan -=1;
                a[t]+=1;
                if(a[t]>=p){
                    ans = t;
                    break;
                }
            }
            else if(a[t]>0){
                owan = a[t];
                a[t] = 0;
            }
            t = (t+1)%n;
        }
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 3024
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include<sstream>
#include<cctype>
using namespace std;

int main() {
	string S;
	cin >> S;

	int check[3]; // check == 1ならOK
	check[0] = 0;
	check[1] = 0;
	check[2] = 1;
	int pos_c; // 大文字Cの位置

	if (S[0] == 'A') check[0] = 1;

	for (int i = 2; i < S.length()-1; i++) {
		if (S[i] == 'C') {
			check[1] += 1;
			pos_c = i;
		}
	}

	if (check[1] == 1) {
		for (int i = 1; i < pos_c && check[2] == 1; i++) {
			if (islower(S[i]) == 0) check[2] = 0;
		}
		for (int i = pos_c +1; i < S.length(); i++) {
			if (islower(S[i]) == 0) check[2] = 0;
		}
	}

	if (check[0] * check[1] * check[2] == 1)cout << "AC" << endl;
	else cout << "WA" << endl;

	return 0;
}

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

using namespace std;

int main(){
    int n,x,i,d=0,cnt=1;
    cin >> n >> x;

    for(i=0; i<n; i++){
        int l;
        cin >> l;
        d += l;
        if(d <= x)
            cnt++;
        else
            break;
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
 
using namespace std;
typedef long long ll;
 
int main(){
  int N,M;
  cin >> N >> M;

  vector<int> x(M);
  for(int i=0;i<M;i++){
    cin >> x[i];
    //cout << x[i];
  }
  sort(x.begin(), x.end());
  
  vector<int> r(M-1);
  for(int i=0;i<M-1;i++){
    r[i]=x[i+1]-x[i];
    //cout << r[i];
  }
  sort(r.begin(), r.end());

  //for(auto ri:r) cout << ri << " ";
  
  int ans=0;
  if(N>=M) ans=0;
  else{
    for(int i=0;i<M-N;i++){
      ans+=r[i];
    }
  }
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 1024
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    void solve(Scanner sc, PrintWriter pw) {
        int N = sc.nextInt();
        int[] result = new int[N + 1];
        for (int i = 1; i * i <= N; i++) {
            for (int j = 1; j * j <= N; j++) {
                for (int l = 1; l * l <= N; l++) {
                    int total = i * i + j * j + l * l + i* j + j* l + i * l;
                    if (total <=N) {
                        result[total]++;
                    }
                }
            }
        }
        for (int i =1; i <=N; i++) {
            pw.println(result[i]);
        }
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        new Main().solve(sc, pw);
        pw.flush();
        pw.close();
        sc.close();
    }
}


Measured memory_bytes: 37708
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<bitset>
#include<string>
#include<cstdio>
#include<cctype>
#include<cassert>
#include<cstdlib>
#include<cstring>
#include<sstream>
#include<iostream>
#include<algorithm>

#define For(i,x,y) for (int i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second

#define dprintf(...) fprintf(stderr,__VA_ARGS__)
using namespace std;

int IN(){
	int c,f,x;
	while (!isdigit(c=getchar())&&c!='-');c=='-'?(f=1,x=0):(f=0,x=c-'0');
	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-'0';return !f?x:-x;
}

typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> Vi;

const int N=100000+19;
const int p=1e9+7;

int Pow(int a,int b){
	int res=1;
	for (;b;b>>=1,a=1ll*a*a%p) if (b&1) res=1ll*res*a%p;
	return res;
}

int d[N],f[N];
int n,k,res;

int main(){
	n=IN(),k=IN();
	for (int i=1;i*i<=n;i++)
		if (n%i==0){
			d[++*d]=i;
			if (i*i!=n) d[++*d]=n/i;
		}
	sort(d+1,d+*d+1);
	For(i,1,*d+1){
		f[i]=Pow(k,(d[i]+1)/2);
		For(j,1,i)
			if (d[i]%d[j]==0){
				f[i]=(f[i]-f[j]+p)%p;
			}
		if (d[i]&1){
			res=(res+1ll*d[i]*f[i])%p;
		} else{
			res=(res+1ll*d[i]*f[i]%p*Pow(2,p-2))%p;
		}
	}
	printf("%d\n",res);
}

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

#define all(x) x.begin(),x.end()

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const long long MOD=1e9+7;
const long long LINF=1e18;
const int INF=0x3f3f3f3f;
const int MAXN=200050;

void solve(int T){
	int n;
	int max1,min1,max2,min2;
	max1=max2=-INF;
	min1=min2=INF;
	scanf("%d",&n);
	int x,y;
	for(int i=1;i<=n;i++){
		scanf("%d %d",&x,&y);
		max1=max(max1,x+y);
		min1=min(min1,x+y);
		max2=max(max2,x-y);
		min2=min(min2,x-y);
	}
	printf("%d\n",max(max1-min1,max2-min2));
}
signed main(){
	int t=1;
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	//scanf("%d",&t); 
	for(int i=1;i<=t;i++){
		solve(i);
	}
}

Measured memory_bytes: 3812
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <queue>
#include <iostream>
#include <cmath>

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
typedef long long ll;
using namespace std;

const string YES = "Yes";
const string NO = "No";

void solve(double D, double T, double S){
    double  res = double(D / S);
    if(res <= (double)T) { 
        cout << YES << endl;
    } else { 
        cout << NO << endl;
    }
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    double D;
    scanf("%lf",&D);
    double T;
    scanf("%lf",&T);
    double S;
    scanf("%lf",&S);
    solve(D, T, S);
    return 0;
}


Measured memory_bytes: 3812
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N;
  cin >> N;
  int sum = 0;
  
  for (int i = 0; i < N; i++) {
    
    int a, b;
    cin >> a >> b;
    
    sum += (b - a + 1);
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-12;

template <typename T> void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}

inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}

// ll dx[4] = {1, 0, -1, 0};
// ll dy[4] = {0, 1, 0, -1};

signed main() {
	IOS();
	ll n;
	string s;
	cin >> n >> s;
	ll cnt[26] = {};
	for (int i = 0; i < n; i++) {
		cnt[s[i] - 'a']++;
	}
	ll ans = 1;
	for (int i = 0; i < 26; i++) {
		if (cnt[i]) ans *= cnt[i] + 1;
		ans %= MOD;
	}
	dump(ans - 1);
	return 0;
}

Measured memory_bytes: 512
#define  _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-10L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define seg_size 262144LL
#define MOD 998244353LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

typedef complex<long double> Point;
typedef pair<complex<long double>, complex<long double>> Line;

long double dot(Point a, Point b) {
    return (a.real() * b.real() + a.imag() * b.imag());
}
long double cross(Point a, Point b) {
    return (a.real() * b.imag() - a.imag() * b.real());
}

long double Dist_Line_Point(Line a, Point b) {
    if (dot(a.second - a.first, b - a.first) < eps) return abs(b - a.first);
    if (dot(a.first - a.second, b - a.second) < eps) return abs(b - a.second);
    return abs(cross(a.second - a.first, b - a.first)) / abs(a.second - a.first);
}

int is_intersected_ls(Line a, Line b) {
    return (cross(a.second - a.first, b.first - a.first) * cross(a.second - a.first, b.second - a.first) < 0) &&
        (cross(b.second - b.first, a.first - b.first) * cross(b.second - b.first, a.second - b.first) < 0);
}

Point intersection_l(Line a, Line b) {
    Point da = a.second - a.first;
    Point db = b.second - b.first;
    return a.first + da * cross(db, b.first - a.first) / cross(db, da);
}

long double Dist_Line_Line(Line a, Line b) {
    if (is_intersected_ls(a, b) == 1) {
        return 0;
    }
    return min({ Dist_Line_Point(a,b.first), Dist_Line_Point(a,b.second),Dist_Line_Point(b,a.first),Dist_Line_Point(b,a.second) });
}



void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}

unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

#define int ll
void solve(){
    while (true) {
        int n;
        cin >> n;
        if (n == 0) return;
        vector<Line> inputs;
        int ans = 1;
        REP(i, n) {
            long double c, d, e, f;
            cin >> c >> d >> e >> f;
            Line a{ Point{c,d},Point{e,f} };
            vector<Point> geko;
            REP(q, i) {
                if (is_intersected_ls(inputs[q], a) == 0) continue;
                geko.push_back(intersection_l(inputs[q], a));
            }
            inputs.push_back(a);
            sort(ALL(geko), [](auto& l, auto& r) {
                if (abs(l.real() - r.real()) > eps) return l.real() - r.real() < 0;
                return l.imag() - r.imag() < 0;
                });
            int cnt = geko.size() + 1;
            
            for (int i = 1; i < geko.size(); ++i) {
                if (abs(geko[i - 1] - geko[i]) < eps) {
                    cnt--;
                }
            }
            
            ans += cnt;
            
        }
        cout << ans << endl;
    }
}

#undef int
int main() {
    init();
    solve();
}


Measured memory_bytes: 3336
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;

typedef pair<int, int> P;
typedef pair<P, int> P2;

int main(){
  int n, h, a, b;
  string op;
  
  while(cin >> n >> h){
    map<P2, bool> cube; // x y z
    if(n == 0 && h == 0) break;
    for(int i = 0 ; i < h ; i++){
      cin >> op >> a >> b;
      
      if(op == "xy"){
	for(int i = 1 ; i < n+1 ; i++){
	  if(!cube[P2(P(a, b),i)]){
	    cube[P2(P(a, b), i)] = true;
	  }
	}
      }
      if(op == "yz"){
	for(int i = 1 ; i < n+1 ; i++){
	  if(!cube[P2(P(i, a), b)]){
	    cube[P2(P(i, a), b)] = true;
	  }
	}
      }
      if(op == "xz"){
	for(int i = 1 ; i < n+1 ; i++){
	  if(!cube[P2(P(a, i), b)]){
	    cube[P2(P(a, i), b)] = true;
	  }
	}
      }
    }
    cout << n*n*n - cube.size() << endl;
  }
  return 0;
}

Measured memory_bytes: 4332
#include <bits/stdc++.h>
using namespace std;
int main(){
	string a, b;
	cin >> a >> b;
	int cnt = 0;
	for(int i = 0; i < a.size(); i++){
		if(a[i] != b[i]) cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3916
# X

x = gets.chomp.to_i

def eratosthenes_sieve(n)
  check = Array.new(n, false)
  primes = []

  (2..n).each do |i|
    if !check[i]
      primes << i

      (i..n).step(i).each do |j|
        check[j] = true
      end
    end
  end

  primes
end

y = x * 2

while true
  primes = eratosthenes_sieve(y)
  
  if primes.last >= x
    break
  end

  y = y * 2
end

puts primes.detect {|i| i >= x}


Measured memory_bytes: 3708
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	ar := make([]int, n+1)
	ar[0] = 1
	br := make([]bool, n+1)
	for i := 0; i < m; i++ {
		var v int
		fmt.Scan(&v)
		br[v] = true
	}
	for i := 1; i <= n; i++ {
		if br[i] {
			ar[i] = -1
			continue
		}
		if ar[i-1] != -1 {
			ar[i] += ar[i-1]
			ar[i] %= 1000000007
		}
		if 2 <= i {
			if ar[i-2] != -1 {
				ar[i] += ar[i-2]
				ar[i] %= 1000000007
			}
		}
	}
	fmt.Println(ar[n])
}


Measured memory_bytes: 5504
//Zory-2019
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pr pair<int,int>
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
namespace mine
{
    ll qread()
    {
        ll ans=0,f=1;char c=getchar();
        while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
        while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
        return ans*f;
    }
    void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
    void write1(ll num){write(num);putchar(' ');}
    void write2(ll num){write(num);putchar('\n');}
    template<typename T> void chmax(T &x,const T y) {x=(x>y?x:y);}
    template<typename T> void chmin(T &x,const T y) {x=(x<y?x:y);}
    ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

    const int INF=0x3f3f3f3f;
    const int MOD=1e9+7;
    int mm(const int x){return x>=MOD?x-MOD:x;}
    template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
    ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
    ll invm(ll x){return qpower(x,MOD-2);}
    const int N=1e7+10;


    void main()
	{
        ll h=qread(),w=qread(),T=qread();
        ll e=gcd(h,T)*gcd(w,T);h/=gcd(h,T),w/=gcd(w,T);
        ll ans=qpower(2,h)+qpower(2,w)+qpower(2,gcd(h,w))-3;ans%=MOD;
        ans=qpower(ans,e);write((ans+MOD)%MOD);
	}
};//(ans+MOD)%MOD
signed main()
{
    srand(time(0));
    mine::main();
}


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

int main(){
    int N;
    int max;
    int c=1;
    vector<int> Hi(21);
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> Hi.at(i);
    }
    max=Hi.at(0);
    for(int i=1;i<N;i++){
        if(max<=Hi.at(i)){
            //t=max;
            max=Hi.at(i);
           // Hi.at(i)=t;
            c++;
        }
    }
    cout << c << endl;
    return 0;
}

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

int main() {
	string s1, s2;
	cin >> s1 >> s2;
	
	string st;
	for(int i=0; i<s1.size();i++){
		st += s1.substr(i, 1)+s2.substr(i,1);
	}
	
	cout << st;
	cout << endl;
	
	return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (A, B) = listOfInt()
    for (n in 1 until 1010) {
        val t1 = n *  8 / 100
        val t2 = n * 10 / 100
        if (t1 == A && t2 == B) {
            println(n)
            return
        }
    }
    println(-1)
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)


Measured memory_bytes: 38064
#include<bits/stdc++.h>
using namespace std;
typedef complex<double> point;

point cal(point a,point b,double c){
  double w=abs(b-a);
  double h=sqrt(c*c-w*w/4);
  point cen=point(w/2,h);
  return cen*(b-a)/w+a;
}

int main(){
  int n;
  while(cin>>n,n){
    int ans=1;
    double x,y;
    point p[300];
    for(int i=0;i<n;i++)cin>>x>>y,p[i]=point(x,y);

    for(int i=0;i<n;i++)
      for(int j=i+1;j<n;j++){
	if(abs(p[i]-p[j])>2)continue;
	point center=cal(p[i],p[j],1);
	int can=0;
	for(int k=0;k<n;k++)
	  if(abs(p[k]-center)<=1+1e-8)can++;
	ans=max(ans,can);
      }
    
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 3156
import java.util.*
import kotlin.random.Random

fun main() {
    val (n, m) = readInts()

    val graph = Array(n + 1) { Vertex(it) }

    repeat(m) {
        val (a, b) = readInts()

        graph[a].adj.add(graph[b])
        graph[b].adj.add(graph[a])
    }


    println(solve(graph))

    //val maxN = (1e5 + 1).toInt()

/*
    val maxN = (100000).toInt()

    var n: Int = 0
    var m: Int = 0
    var con: MutableList<Pair<Int, Int>> = mutableListOf()

    try {
        repeat(10000) { i ->
            println("$i: ======")

            */
/*n = Random.nextInt(2, maxN)
            m = Random.nextInt(2, maxN)*//*


            n = maxN
            m = maxN - 1

            //println("$n $m")
            val graph = Array(n + 1) { Vertex(it) }

            con = mutableListOf<Pair<Int, Int>>()

            repeat(m) { i ->
                */
/*val a = Random.nextInt(1, n + 1)
                val b = Random.nextInt(1, n + 1)*//*

                val a = i + 1
                val b = i + 2
                con.add(a to b)
                //  println("$a $b")

                graph[a].adj.add(graph[b])
                graph[b].adj.add(graph[a])
            }


            val ans = solve(graph)
            println(ans)

        }
    } catch (e: StackOverflowError) {
        println("overflow")
        println("$n $m")
        println(con)
    }
*/
}

private fun solve(graph: Array<Vertex>): Int {
    var connected = 0
    for (t in graph.drop(1)) {
        if (t.used) continue
        connected++
        t.dfs()
    }
    return connected - 1
}


private data class Vertex(val n: Int) {
    fun dfs() {
        val x = LinkedList<Vertex>()
        x.push(this)

        while(x.size > 0) {
            val u = x.pop()
            u.used = true
            for(v in u.adj) {
                if(!v.used) x.push(v)
            }
        }
    }

    val adj = mutableListOf<Vertex>()
    var used = false
}

private fun readInts() = readLine()!!.split(" ").map { it.toInt() }
private fun readLongs() = readLine()!!.split(" ").map { it.toLong() }

Measured memory_bytes: 72464
#include <bits/stdc++.h>
#define pb push_back
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define mem(a,k) memset(a,k,sizeof(a))
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
#define fore(i,v) for(int i=g[v],d=es[i].d;i;i=es[i].nxt,d=es[i].d)
using namespace std;

#define Pr(f,...) //fprintf(stderr,f,##__VA_ARGS__),fflush(stderr)

typedef long long ll;

template<typename T>
void read(T &x){
	x=0; 
	char c;
	for(c=getchar();!isdigit(c);c=getchar()); 
	for(;isdigit(c);c=getchar())x=x*10+c-'0'; 
}

long long S,A,B,C; 

int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
#endif
	cin>>A>>B>>C; 
	lop(i,0,(int)(1e7)){
		if(A%2||B%2||C%2){
			cout<<i<<endl;
			return 0; 
		}
		S=A+B+C; 
		A=(S-A)/2;
		B=(S-B)/2;
		C=(S-C)/2;
	}
	cout<<-1<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(a,b,c) for((a)=(int)(b);(a)<=(int)(c);(a)++)
#define per(a,b,c) for((a)=(int)(c);(a)>=(int)(b);(a)--)
#define mem(a) memset(a,0,sizeof(a))
#define mem1(a) memset(a,(-1),sizeof(a))
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
#define pb push_back
#define MP make_pair
#define fi first
#define se second
#define foreach(it,a) for(__typeof((a).begin()) it=(a).begin();it!=(a).end();it++)
#define sz(x) ((int)((x).size()))
#define all(x) ((x).begin()), ((x).end())
#define rall(x) ((x).rbegin()), ((x).rend())

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair< ll,ll > pi;
typedef pair< ll,pi > pii;
typedef vector< ll > vi;
typedef vector< pi > vii;
const ll mod=1000000007;
const ll inf=1e9+21;
ll powmod(ll a,ll b){ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
template<typename N>N gcd(N a,N b){return b?gcd(b,a%b):a;}
void precision(ll pr){ cout.precision(pr); cout<<fixed; }

const int N=1e6+21;

int main()
{
    ll i,j,k,n;
    string s="";
    cin>>s;
    if(sz(s)<4){
        cout<<"No\n";
        return 0;
    }
    if(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I') cout<<"Yes\n";
    else cout<<"No\n";
    return 0;
}


Measured memory_bytes: 256
s = list(input())
s.sort()
cnt = 1
ans = 1
# print(s)
for i in range(1, 4):
  # print(cnt)
  if s[i - 1] != s[i]:
    if cnt < 2:
      ans = 0
      break
    cnt = -1
  if not ans:
    break
  cnt += 1
if cnt > 3:
  ans = 0
if not ans:
  print("No")
else:
  print("Yes")


Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,k;
	cin>>n>>k;
	vector<int> arr;
	for(int i=0;i<n;i++)
	{
		int a;
		cin>>a;
		arr.push_back(a);
	}
	int dp[n+5];
	for(int i = 0; i <n+5;i++)
		dp[i] = INT_MAX;
		
	dp[0] = 0;
	for(int i = 0;i<n;i++)
	{
		for(int j = 1; j<=k && (j+i) < n; j++)
		{
			dp[i+j] = min(dp[i+j],dp[i] + abs(arr[i] - arr[i+j]));
		} 
	}
	cout<<dp[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 1144
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll; const ll MM = 1000000000;ll mod = MM + 7;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(int i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;

int main() {
  long double a, b, c, x, y; cin >> a >> b >> x;
  if (x > b*a*a/2){y = (b-x/a/a) * 2;
  c = (long double)atan2l(y, a);}
  else {y = 2 * x/a/b; c = atan2l(b, y);}

  c *= (long double)180;
  c /= 3.141592653589793238;
  cout << setprecision(10) << c << endl;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
mod = 10 ** 9 + 7

count = 0
lower = (k - 1) * (k - 2) // 2
upper = (k - 1) * (2 * n - k + 2) // 2
for i in range(k, n + 2):
  lower += i - 1
  upper += n - i + 1
  count = (count + upper - lower + 1) % mod
print(count)

Measured memory_bytes: 9196
#include <stdio.h>

    int main(void){
    char str[100];
    int i;
    int count=0;
    
    scanf("%s",str);
    
    for(i=0;str[i]!='\0';i++){
        count++;
    }
    for(i=count-1;i>=0;i--){
        printf("%c",str[i]);
    }
    printf("\n");

    return 0;
}




Measured memory_bytes: 2580
from collections import deque
n, d, a = map(int, input().split())

mons = []

for i in range(n):
    x, h = map(int, input().split())
    mons.append((x, h))

mons = sorted(mons)

q = deque()

dm_sum = 0

ans = 0

for i in range(n):
    while dm_sum > 0:
        if q[0][0] < mons[i][0]:
            cur = q.popleft()
            dm_sum -= cur[1]
        else:
            break
    if mons[i][1] <= dm_sum:
        continue
    rem = mons[i][1] - dm_sum
    at_num = rem // a
    if rem % a != 0:
        at_num += 1
    ans += at_num

    q.append((mons[i][0] + 2 * d, at_num*a))
    dm_sum += at_num*a

print(ans)


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

#define     fast()              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define     ll                  long long int
#define     test()              ll t; cin>>t; while(t--) 
#define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
#define     lp1(i,begin,end)    for(ll i=begin;i<=end;i++)
#define     rlp(i,begin,end)    for(ll i=end;i>=begin;i--)
#define     prec(n)             fixed<<setprecision(n)
#define     initial(a,i)        memset(a,i,sizeof(a))
#define     pb                  push_back
#define     PI                  3.1415926535897932384626433832795
#define     MOD                 1000000007
#define     F                   first
#define     S                   second
#define     all(a)              (a).begin(),(a).end()
#define     BPC(x)              __builtin_popcountll(x)
#define     gcd(a,b)            __gcd(a,b)

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

ll power(ll x,ll n)
{
    ll result = 1;
    while (n)
    {
        if (n & 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}


// Solution Function
void solution(ll compte)
{
    // cout<<compte<<"\n";
    string s;
    cin>>s;
    if(s=="ABC")    puts("ARC");
    else puts("ABC"); 
}
// Driver Function
int main()
{
    ll compte = 1;
    //test()
    //{
        solution(compte);
        compte++;
    //}
    return 0;
}


Measured memory_bytes: 3572
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <algorithm>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int dp[3010][3010];
int main() {
    string s,t;
    cin >> s >> t;

    rep(i,s.size())rep(j,t.size()){
        if ( s[i] == t[j] ){
            dp[i+1][j+1] = dp[i][j] + 1;
        }
        else {
            dp[i+1][j+1] = max( dp[i][j+1], dp[i+1][j] );
        }
    }

    int len = dp[s.size()][t.size()];
    string ans(len, ' ');
    int i = s.size(), j = t.size();
    while(len>0){
        if(s[i-1]==t[j-1]){
            ans[--len] = s[i-1];
            i--;
            j--;
        }else if(dp[i][j]==dp[i-1][j]){
            i--;
        }else{
            j--;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 35584
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0)
#define scl(n) scanf("%lld", &n)
#define pcl(n) printf("%lld\n", n)
#define pcl1(n) printf("%lld ", n)
#define nln printf("\n")
#define dev(x) cout << #x << " " << x << " ";
#define PTT pair<ll, ll>

map<ll, ll> mp, mp1;
map<ll, ll>::iterator itr;

int main()
{
    ll t, n, x, k, s;
    scl(k);
    scl(s);
    ll cnt = 0;
    for (int i = 0; i <= k; i++)
    {
        n = s - i;
        for (int j = 0; j <= k; j++)
        {
            if (n >= j)
            {
                if (n - j <= k)
                {
                    cnt++;
                }
            }
        }
    }
    pcl(cnt);
    return 0;
}

Measured memory_bytes: 3800
import java.util.*;
	
		public class Main {
			
			public static void main(String[] args) {		
			
				Scanner sc=new Scanner(System.in);			
				long a=sc.nextInt();
				long b=sc.nextInt();				
				long ebob=1;				
				for(int i=1; i<=b; i++) {
					if((a*i)%b==0) {
						System.out.println(a*i);
						break;

					}					
				}
									
			}
		
	}

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

using namespace std;

int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    long long r=0,b=0,g=0;
    int i;
    for(i=0;i<s.size();i++){
        if(s[i]=='R')   r++;
        else if(s[i]=='B')  g++;
        else if(s[i]=='G')  b++;
    } 
    long  long sum=r*g*b;
    int k;
    for(i=1;i<=(n-1)/2;i++)
    for(k=0;k<n-2*i;k++){
        if(s[k]!=s[k+i]&&s[k+i]!=s[k+i+i]&&s[k]!=s[k+i+i])
            sum-- ;
    }
    cout<<sum<<endl;
    }


Measured memory_bytes: 3628
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  int N, M, A, B;

  std::cin >> N >> M;

  std::vector<std::pair<int, int>> a;

  for (int i = 0; i < N; i ++) {
    std::cin >> A >> B;

    a.emplace_back(A, B);
  }

  std::sort(ALL(a));

  long long S = 0;

  for (const auto& pair : a) {
    S += 1LL * std::min(pair.second, M) * pair.first;

    M -= pair.second;

    if (M < 0)
      break;
  }

  std::cout << S << std::endl;

  return 0;
}


Measured memory_bytes: 1400