akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int):

    L = [A,B,C]
    L.sort(reverse=True)
    L[0] *= 10
    print(sum(L))

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    solve(A, B, C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<cstdio>
#include<algorithm>
#include<vector>
#define ll long long
using namespace std;
ll a[100100];
int main()
{
	ll n, m;
	scanf("%lld %lld", &n,&m);
	ll ch = -1;
	for (int i = 0; i < n; i++)
	{
		scanf("%lld", &a[i]);
	}
	if (ch == -1)
		ch = n;
	ll dap = 1e18;
	for (int i = 0; i < n; i++)
	{
		ll sum = 0;
		ll sum1 = 0;
		if (i + m - 1 >= n)break;
		if (a[i] < 0)
			sum1 = a[i];
		if (a[i + m - 1] >= 0)
			sum = a[i+m-1];
		dap = min(dap, sum * 2 -sum1);
		dap = min(dap, (-sum1) * 2 + sum);
	}
	printf("%lld", dap);
}

Measured memory_bytes: 896
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#define debug(x) cout << #x << "==" << x << endl;

const int INF = 1e+8;

using namespace std;

template<typename T>
vector<vector<T>> make_2d_vector(size_t rows, size_t cols, T init)
{ return vector< vector<T> >(rows, vector<T>(cols, init)); }

//??\???
#define MAX_N 100
#define MAX_W 10000
int N, W;
int w[MAX_N], v[MAX_N];

// memo
int memo[MAX_N + 1][MAX_W + 1];
bool checked[MAX_N + 1][MAX_W + 1];

// int opt(int i, int cw) {

//   if( i == -1 ) { return 0; }

//   if(checked[i][cw] == true) { return memo[i][cw]; }
//   checked[i][cw] = true;

//   int ret;
//   if (  cw < w[i] ) {
//     ret = opt(i - 1, cw);
//   } else {
//     ret = max( opt(i - 1, cw), opt(i, cw - w[i]) + v[i] );
//   }

//   return memo[i][cw] = ret;

// }

int main() {
  ios::sync_with_stdio(false);

  cin >> N >> W;
  for(int i = 0; i < N; i++) { cin >> v[i] >> w[i]; }

  // cout << opt(N - 1, W) << endl;
  
  // dp[i][j] := i???????????§?????????????????£?????¨??????j ??\??????????????§????????§?????????
  vector< vector<int> > dp = make_2d_vector(N+1, W+1, 0);
  for(int i = 1; i <= N; i++) {
    for(int j = 1; j <= W; j++) {
      if(  j < w[i-1] ) { dp[i][j] = dp[i-1][j]; }
      else               { dp[i][j] = max(v[i-1] + dp[i][j-w[i-1]], dp[i-1][j]);  }
    }
  }
  
  // for(int i = 0; i <= N; i++) {
  //   for(int j = 0; j <= W; j++) {
  //     cout << dp[i][j] << " ";
  //   }
  //   cout << "\n";
  // } 

  cout << dp[N][W] << "\n";



  return 0;
}

Measured memory_bytes: 6764
N=int(input())
A=list(map(int,input().split()))
A = [0]+A+[0]
cum = [0]*(N+2)
for i in range(1, N+2):
    cum[i] = cum[i-1] + abs(A[i]-A[i-1])
for i in range(1, N+1):
    print(cum[N+1]-abs(A[i]-A[i-1])-abs(A[i]-A[i+1])+abs(A[i-1]-A[i+1]))

Measured memory_bytes: 88868
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int INF=1<<29,MOD=1e9+7;

int main(){
	int n,m;
	while(cin>>n>>m&&n){
		int t[m][1270]; rep(i,m)rep(j,1270) t[i][j]=0;
		int r; cin>>r;
		rep(i,r){
			int time,pc,mem,log;
			cin>>time>>pc>>mem>>log;
			mem--;
			if(log) t[mem][time]++;
			else t[mem][time]--;
		}
		int q; cin>>q;
		rep(i,m)rep(j,1269) t[i][j+1]+=t[i][j];
		rep(i,q){
			int ans=0;
			int in,out,mem;
			cin>>in>>out>>mem;
			mem--;
			for(int j=in;j<out;j++){
				if(t[mem][j]) ans++;
			}
			cout<<ans<<endl;
		}
	}
	return 0;
}

// 600=1
// 700=-1



Measured memory_bytes: 51024
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main() {
    int n, d, a; cin >> n >> d >> a;
    vector<pair<int, int>> b(n);
    vector<int> c(n), e(n);
    for (int i = 0; i < n; i++) {
        cin >> b[i].first >> b[i].second;
        b[i].second = (b[i].second + a - 1) / a;
    }
    sort(b.begin(), b.end());
    for (int i = 0; i < n; i++) {
        c[i] = b[i].first;
        e[i] = b[i].second;
    }
    vector<ll> s(n + 1, 0);
    ll ans = 0;
    constexpr int INF = 1e9 + 6;
    for (int i = 0; i < n; i++) {
        s[i + 1] += s[i];//
        if (e[i] <= s[i + 1]) continue;
        e[i] -= s[i + 1];
        s[i + 1] += e[i];
        ans += e[i];
        int k = upper_bound(c.begin(), c.end(), 2 * d + c[i]) - c.begin();
        if (k + 1 <= n) s[k + 1] -= e[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4992
N = int(input())
S = [input() for _ in range(N)]

Dic = [1]*N
prime = {"a":2,"b": 3, "c":5, "d":7,"e": 11,"f": 13,"g": 17,"h": 19,"i": 23,"j": 29,"k": 31,"l": 37,"m": 41, "n":43,"o": 47,"p": 53,"q": 59,"r": 61,"s": 67,"t": 71,"u": 73,"v": 79,"w": 83,"x": 89,"y": 97,"z":101}

from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


for i in range(N):
    for s in S[i]:
        Dic[i]*= prime[s]

Dic.sort()
pre = Dic[0]
ans = 0
temp = 1
for d in Dic[1:]:
    if pre == d:
        temp += 1
    else:
        if temp >= 2:
            ans += comb(temp,2)
        pre = d
        temp = 1

ans += comb(temp,2) if temp >= 2 else 0
print(int(ans))

Measured memory_bytes: 16296
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include<queue>
#include<math.h>
#include <iomanip>
#define rep(i,n) for (int i=0; i<(n);++i)
using namespace std;
using ll=long long;
using P =pair<double, double>;
const ll INF = 1LL << 60;
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 double PI = 3.14159265358979323846;
const ll d =1000000007;
ll A[200000], B[200000];
using Graph=vector<vector<int>>;



int main() {
	int h, m, H, M, k;
	cin >> h >> m >> H >> M >> k;
	int t = (H - h) * 60 + (M - m) - k;

	if (t != 0) cout << t << endl;
	else cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,i,ans=0,cnt=0;
  string s;
  for(cin>>n>>s; i<n; i++){
    if(s[i]=='I'){
      cnt++;
      ans=max(ans,cnt);
    }
    else{
      cnt--;
      ans=max(ans,cnt);
    }
  }
  cout<<ans;
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

ll n, a, b;
ll x[100000];

int main(int argc, char **argv) {
	cin >> n >> a >> b;
	REP(i, n) cin >> x[i];
	ll res = 0;
	REP(i, n - 1) {
		if (a * (x[i + 1] - x[i]) < b) res += a * (x[i + 1] - x[i]);
		else res += b;
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;



int main(){FIN

    ll n;cin>>n;
    vll a(n); REP(i,n) cin>>a[i];
    map<ll,ll> m1,m2;
    REP(i,n){

        if(i%2==0) m1[a[i]]++;
        else m2[a[i]]++;
    }
    vector<P> v1,v2;
    for(auto p: m1) v1.push_back(make_pair(p.second, p.first));
    for(auto p: m2) v2.push_back(make_pair(p.second, p.first));
    VSORTR(v1); VSORTR(v2);
    if(v1[0].second != v2[0].second){
        ll ans = n - v1[0].first - v2[0].first;
        cout<<ans<<endl;
        return 0;
    }
    ll ans1 = inf, ans2 = inf;

    if(v1.size()>1) ans1 = n - v1[1].first - v2[0].first;
    if(v2.size()>1) ans2 = n - v1[0].first - v2[1].first;
    if (ans1==inf && ans2 == inf) {cout<<n/2<<endl; return 0;}
    cout<<min(ans1,ans2)<<endl;

    return 0;
}

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

struct UnionFind{
    vector<int> parent;
    vector<int> size;
    vector<int> rank;

    /* constructor (initialize) */
    UnionFind(int n){
        parent.resize(n);
        size.resize(n);
        rank.resize(n);
        for(int i=0; i<n; i++){
            parent[i] = i;// completely-disjoint
            size[i] = 1;
            rank[i] = 0;// union by rank
        }
    }

    int root(int x){
        // terminal case
        if(parent[x] == x){
            return x;// by definition
        }

        // recursion
        parent[x] = root(parent[x]);// path compression : keep tree as shallow as possible
        return parent[x];
    }

    void merge(int x, int y){
        int rx = root(x);
        int ry = root(y);

        // if (root(x) == root(y)) do nothing;
        if (rx != ry){
            if(rank[rx] < rank[ry]){
                parent[rx] = ry;// root of merged tree = ry
                size[ry] += size[rx];
            }
            else if(rank[rx] == rank[ry]){
                parent[rx] = ry;
                size[ry] += size[rx];
                rank[ry] += 1;
            }
            else if(rank[rx] > rank[ry]){
                parent[ry] = rx;// root of merged tree = rx
                size[rx] += size[ry];
            }
        }
        return;
    }

    bool same(int x, int y){
        return root(x) == root(y);
    }

    int nodes(int x){
        return size[root(x)];
    }
};

int main(){
    long long int n, k, l;
    cin >> n >> k >> l;

    vector<int> p(k), q(k);
    for(int i=0; i<k; i++){
        cin >> p[i] >> q[i];
        p[i] -= 1;
        q[i] -= 1;
    }

    vector<int> r(l), s(l);
    for(int i=0; i<l; i++){
        cin >> r[i] >> s[i];
        r[i] -= 1;
        s[i] -= 1;
    }
    
    UnionFind uf_road(n), uf_rail(n);
    for(int i=0; i<k; i++){// for each edge  
        if(uf_road.same(p[i],q[i]) == false){
            uf_road.merge(p[i], q[i]);
        }
    }
    for(int i=0; i<l; i++){// for each edge
        if(uf_rail.same(r[i],s[i]) == false){
            uf_rail.merge(r[i], s[i]);
        }
    }
    
    vector<pair<int, int>> a(n), b(n);
    for(int i=0; i<n; i++){
        a[i].first  = uf_road.root(i);
        a[i].second = uf_rail.root(i);
    }
    b = a;
    sort(b.begin(), b.end());
    for(int i=0; i<n; i++){
        cout << upper_bound(b.begin(), b.end(), a[i]) - lower_bound(b.begin(), b.end(), a[i]);
        if(i == n-1) break;
        cout << " ";
    }
    cout << endl;
    return 0;
}

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

template<uint32_t N = 10'000'000>
struct Sieve_of_Eratosthenes{
  using u32 = uint32_t;
  std::vector<u32> factor;
  Sieve_of_Eratosthenes(){
    factor.resize(N+1);
    for(u32 p=2;p<=N;++p){
      if(factor[p])continue;
      factor[p] = p;
      for(u32 x=p+p;x<=N;x+=p){
        if(factor[x])continue;
        factor[x] = p;
      }
    }
  }
  std::vector<u32> prime_factor(u32 x){
    std::vector<u32> pf;
    while(factor[x]){
      pf.push_back(factor[x]);
      while(factor[x]==pf.back())x/=factor[x];
    }
    return pf;
  }
};

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

  int n;
  cin>>n;
  vector<int> a(n);
  for(auto& ai:a)cin>>ai;

  constexpr int a_max = 1e6;
  Sieve_of_Eratosthenes ushi;

  map<int,int> mp;
  bool pairwise_coprime = true;
  for(auto const& ai:a){
    for(auto const& p:ushi.prime_factor(ai)){
      if(mp.count(p)){
        pairwise_coprime = false;
        break;
      }
      mp[p]++;
    }
  }
  
  if(pairwise_coprime){
    cout<<"pairwise coprime"<<endl;
    return 0;
  }

  bool setwise_coprime = accumulate(begin(a),end(a),0,[](auto a,auto b){return gcd(a,b);}) == 1;
  if(setwise_coprime){
    cout<<"setwise coprime"<<endl;
    return 0;
  }

  cout<<"not coprime"<<endl;


}

Measured memory_bytes: 49888
import java. util.Scanner;
public class Main {

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

		int n = scan.nextInt();
		int m = scan.nextInt();
		int c = scan.nextInt();

		int[] b = new int[m];
		int[][] a = new int[n][m];
		int[] t = new int[m];
		int[] t1 = new int[n];

		int count = 0;
		int total = 0;

		for(int i=0;i<m;i++) {
			b[i] = scan.nextInt();
		}

		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				a[i][j] = scan.nextInt();
				t[j]=a[i][j]*b[j];
				t1[i]+=t[j];
			}
		}

		for(int i=0;i<n;i++) {
			if(t1[i]+c>0) {
				count++;
			}
		}

		System.out.println(count);
	}

}


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

int main() {
  int N, X;
  cin >> N >> X;
  vector<int> m(N);
  int s = 0;
  int min = 10000;
  for (int i = 0; i < N; i++) {
    cin >> m.at(i);
    s += m.at(i);
    if (min > m.at(i))  min = m.at(i);
  }
  int ans = N + (X - s) / min;
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int p = in.nextInt();
            int r;
            if (p % 2 == 0) {
                r = p / 2;
            } else {
                r = (p + 1) / 2;
            }
            out.append(String.valueOf(r));
        }

    }
}



Measured memory_bytes: 22228
#include <bits/stdc++.h>
 
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define si set<int>
#define stk stack<int>
#define que queue<int>
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
 
using namespace std; 

int main(){
	int n,ans=0;
	string s;
	cin>>n>>s;

	for(int i=0;i<n;i++){
		if(s[i]=='A'){
			if(s[i+1]=='B'){
				if(s[i+2]=='C'){
					ans++;
					i=i+2;
				}
			}
		}
	}
	cout<<ans;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long ans = 0;
        for (int i = 2; i < Math.sqrt(n) + 1; i++) {
            int e = 0;
            while(n % i == 0){
                e++;
                n /= i;
            }
            for (int j = 1; j <= e; j++) {
                ans++;
                e -= j;
            }
        }
        if(1 < n) ans += 1;
        System.out.println(ans);
        sc.close();

    }

}


Measured memory_bytes: 35788
H, N = map(int, input().split())
A,B = [],[]
for _ in range(N):
	ta,tb = map(int, input().split())
	A.append(ta)
	B.append(tb)

ini_A,ini_B = A[0], B[0]
dp = [-(-j//ini_A)*ini_B for j in range(H+1)]

for i in range(1,N):
	obj_A,obj_B = A[i], B[i]
	for j in range(H+1):
		if j < A[i]:
			dp[j] = min(dp[j], -(-j//obj_A)*obj_B)
		else:
			dp[j] = min(dp[j], -(-j//obj_A)*obj_B, dp[j-obj_A]+obj_B)

print(dp[-1])


Measured memory_bytes: 44268
#include <bits/stdc++.h>
using namespace std;
int val(int x){
	if(x > 3) return 0;
	return (4 - x) * 100000;
}
int main(){
	int x, y; cin >> x >> y;
	cout << val(x) + val(y) + (x == 1 && y == 1) * 400000<< endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    string s,i;
    cin>>s>>i;
    int d=0;
    for(int j=0;j<s.size();++j){
        if(s[j]!=i[j]){
        ++d;
        }
    }
    d==0?cout<<"Yes":cout<<"No";
}

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

int main() {
	int n;
	cin >> n;
	string a, b, c;
	cin >> a;
	cin >> b;
	cin >> c;
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		if (a.at(i) == b.at(i) && b.at(i) == c.at(i))continue;
		else if (a.at(i) != b.at(i) && b.at(i) != c.at(i)&&a.at(i)!=c.at(i))ans += 2;
		else ans += 1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=1e5+1,MOD=998244353;
int n,x,have[N];
vector<pair<int,int> > v;
LL sol=1;
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>x;
        v.push_back({x,i});
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++){
        if(v[i].first == 0){
            if(v[i].second!=1){
                cout<<0;
                return 0;
            }
        }
        else{
            sol=(sol*(LL)have[v[i].first-1])%MOD;
        }
        have[v[i].first]++;
    }
    cout<<sol;
}


Measured memory_bytes: 1524
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

char str[2005][2005];
vector<int> a[2005];
vector<int> b[2005];

int main(int argc, char* argv[])
{
    int h,w;
    scanf("%d%d", &h, &w);

    int i,j;
    for(i=0; i<h; i++) {
        scanf("%s", str[i]);
        for(j=0; j<w; j++) {
            if(str[i][j]=='#') {
                a[i].push_back(j);
                b[j].push_back(i);
            }
        }
    }

    int max=0;
    for(i=0; i<h; i++) {
        for(j=0; j<w; j++) {
            if(str[i][j]=='.') {
                int num = (int)a[i].size();
                int k = lower_bound(a[i].begin(), a[i].end(), j) - a[i].begin();
                int tmp1 = (k>=num? w-1: a[i][k]-1);
                int tmp0 = (k==0? 0: a[i][k-1]+1);

                num = (int)b[j].size();
                k = lower_bound(b[j].begin(), b[j].end(), i) - b[j].begin();
                int tmp3 = (k>=num? h-1: b[j][k]-1);
                int tmp2 = (k==0? 0: b[j][k-1]+1);

                int tmp = (tmp1-tmp0+1)+(tmp3-tmp2+1)-1;
                max = MAX(max,tmp);
            }
        }
    }
    printf("%d\n", max);


    return 0;
}


Measured memory_bytes: 38272
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(x)     (x).begin() , (x).end()
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
typedef long long int ll;
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}


const ll mod = 1e9+7;
const double eps = 1e-9;



void solve() {
    int a,b,c,k;
    cin >> a >> b >> c >> k;
    bool ans=0;
    for(int i=0;i<=k;++i) {
        if(c * (1<<i) > b * (1 << (k-i)) && (b * (1 << (k-i)) > a))
            ans=1;
        if(ans)break;
    }
    if(ans) {
        cout << "Yes\n";
    }
    else cout << "No\n";
}





int main(){
    fastio 
    int test=1;
    while(test--)
        solve();
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

int n;
vector <int> a;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    a.resize(n);
    for(auto &i : a) cin >> i;
    int turn = 0;
    vector <string> p = {"First", "Second"};
    while(1){
        vector <int> cnt(2);
        for(auto &i : a) cnt[i % 2]++;
        if(cnt[1] == n) finish(p[turn ^ 1]);
        if(cnt[0] % 2) finish(p[turn]);
        if(cnt[1] >= 2) finish(p[turn ^ 1]);
        int g = 0;
        ll sum = 0;
        bool one = 0;
        for(auto &i : a){
            if(i % 2){
                if(i == 1) one = 1;
                else i--;
            }
            g = __gcd(g, i);
            sum += i;
        }
        if(one) finish(p[turn ^ 1 ^ ((sum - n) % 2)]);
        for(auto &i : a) i /= g;
        turn ^= 1;
    }
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


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

    int n, m, k;
    cin >> n >> m >> k;
    set<int> flip;

    reps(i, 0, n){
        reps(j, 0, m){
            int num = (m-j)*i + (n-i)*j;
            flip.insert(num);
        }
    }

    if(flip.find(k) != flip.end()) ans(true);
    else ans(false);

    //vdeb(flip);

    return 0;
}


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

using namespace std;
const int maxn =  1e6 + 10;
#define ll long long
#define ios std::ios::sync_with_stdio(false)
const ll INF(0x3f3f3f3f3f3f3f3fll);
const int inf(0x3f3f3f3f);
/*


ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}//xµÄn´Î·½mod


ll mult(ll a,ll b,ll p){a%=p;b%=p;ll r=0,v=a;while(b){if(b&1){r+=v;if(r>p)r-=p;}v<<=1;if(v>p)v-=p;b>>=1;}return r;}
ll quick_pow(ll a,ll b,ll p){ll r=1,v=a%p;while(b){if(b&1)r=mult(r,v,p);v=mult(v,v,p);b>>=1;}return r;}
bool CH(ll a,ll n,ll x,ll t)
{ll r=quick_pow(a,x,n);ll z=r;for(ll i=1;i<=t;i++){r=mult(r,r,n);if(r==1&&z!=1&&z!=n-1)return true;z=r;}return r!=1;}
bool Miller_Rabin(ll n)
{if(n<2)return false;if(n==2)return true;if(!(n&1))return false;ll x=n-1,t=0;while(!(x&1)){x>>=1;t++;}srand(time(NULL));
ll o=8;for(ll i=0;i<o;i++){ll a=rand()%(n-1)+1;if(CH(a,n,x,t))return false;}return true;}


*/

#define int long long
#define sc(t) scanf("%lld",&t)
#define pr(ans) printf("%lld\n",ans)
ll pow_mod(ll x,ll n,ll mod){ll res=1;while(n){if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}//xµÄn´Î·½mod
template<typename T>void read(T &res){bool flag=false;char ch;while(!isdigit(ch=getchar()))(ch=='-')&&(flag=true);
for(res=ch-48;isdigit(ch=getchar());res=(res<<1)+(res<<3)+ch - 48);flag&&(res=-res);}
typedef unsigned long long ULL;
const double pi = 3.1415926535897932384626;
int gcd(int a,int b){return !b?a:gcd(b,a%b);}
int lcm(int a,int b){return a/gcd(a,b)*b;}
#define debug(x) cout << #x << " : " << x << '\n';
#define sb cout << "sb\n";
#define fi first
#define se second
#define pb(a) push_back(a)
#define cn cout << '\n'
#define mp(a , b) make_pair(a , b)
const double ep = 1e-6;

int a[maxn];
signed main()
{
    ios;///60 10 50
    cin.tie(0);
    int n;
    cin >> n;
    int ans = 0;
    for(int i = 1 ; i <= n ; i ++) cin >> a[i];
    for(int i = 1 ; i <= n ; i += 2){
        if(a[i] & 1){
            ans ++;
        }
    }
    cout << ans << '\n';
	return 0;
}
/*
18
2 3 3
*/


Measured memory_bytes: 3644
a = int(input())


if a <= 104:
    print(0)
elif a >= 105 and a< 135:
    print(1)

elif a>= 135 and a< 165:
    print(2)
elif a>= 165 and a< 189:
    print(3)
elif a>= 189 and a < 195:
    print(4)
elif a<= 200:
    print(5)

Measured memory_bytes: 3060
#include <numeric>
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
    int n; cin >> n;
    int x[n], y[n];
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
        if (x[i] > y[i]) swap(x[i], y[i]);
    }
    long long ans = (long long)(*max_element(x, x+n) - *min_element(x, x+n)) *
        (*max_element(y, y+n) - *min_element(y, y+n));
    int idx[n];
    iota(idx, idx+n, 0);
    sort(idx, idx+n, [&x](int i, int j) { return x[i] < x[j]; });

    const long long B = *max_element(y, y+n) - x[idx[0]];
    int mn = y[idx[0]], mx = x[idx[n-1]];
    for (int i = 1; i < n; i++) {
        int j = idx[i-1], k = idx[i];
        mn = min(mn, y[j]);
        mx = max(mx, y[j]);
        long long A = mx - min(mn, x[k]);
        ans = min(ans, A * B);
    }
    cout << ans << endl;
}


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

int	main() {
	int N;
	cin >>N;
	vector<long> A(N);
	for (int i=0; i<N; i++)
		cin >>A.at(i);
	long B;
	long S=0;
	int j=0;
	for (int i=0; i<N; i++) {
		cin >>B;
		A.at(i) -=B;
		if (0>A.at(i)) {
			S+=A.at(i);
			j++;
		}
	}
	sort(A.begin(), A.end());
	reverse(A.begin(), A.end());
	for (int i=0; i<N; i++){
		if (S>=0)
			break;
		if (A.at(i)<=0)
			break;
		S +=A.at(i);
		j++;
	}
	if (S>=0)
		cout <<j <<endl;
	else
		cout <<-1 <<endl;
	return 0;
};


Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int beki[6] = {0, 2, 4, 8, 16, 32};
int main() {
	int N, M;
	cin >> N >> M;
	cout << (M * 1900 + (N - M) * 100)*beki[M] << endl;
	return 0;
}


Measured memory_bytes: 256
# include <cstdio>
int N , C ;
int s [100000] , t [100000] , c [100000];
int sm [200002];
int tt [200002];
int main ()
{
scanf ("%d %d " ,&N ,& C );
for ( int i =0; i < N ; i ++)
scanf ("%d %d %d " ,&s[i] ,&t[i] ,&c [ i ]);
for ( int i =1; i <= C ; i ++)
{
for ( int j =0; j <200002; j ++) {tt [ j ]=0;}
for ( int j =0; j < N ; j ++) {if ( c [ j ]== i ) {tt [ s [ j ]*2 -1]++ ; tt [ t [ j ]*2] --;}}
for ( int j =1; j <200002; j ++) tt [ j ]+= tt [j -1];
for ( int j =0; j <200002; j ++) if ( tt [ j ] >0) sm [ j ]++;
}
int mx =0;
for ( int j =0; j <200002; j ++) if ( mx < sm [ j ]) mx = sm [ j ];
printf ("%d \n" , mx );
}

Measured memory_bytes: 2944
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return ~n & 1; }
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> istream &operator>>(istream &is, pair<A, B> &p) { return is >> p.first >> p.second; }
template<typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : "\n"); return os; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : " "); return os; }
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << ' ' << p.second; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
// clang-format on

/* Find the maximum x∈[low, up) such that f(x) is true
    ---*     (true)
        ---- (false)
*/
template<int precision = 100, typename F> double binarySearchD(double low, const double up, const F &f) {
  double d = up - low;
  rep(i, precision) {
    d /= 2.0;
    if (f(low + d)) low += d;
  }
  return low;
}

main {
  while (true) {
    int r, n;
    cin >> r >> n;
    if (r == 0 && n == 0) break;
    vector<double> h(100);
    while (n--) {
      int a, b, q;
      cin >> a >> b >> q;
      a += 30, b += 30;
      loop(i, a, b) cmax(h[i], q);
    }
    cout << prec(32) << binarySearchD(0.0, 20.0, [&](double t) {
      for (int x = 31 - r; x < 30 + r; x++) {
        double y = sqrt(r * r - (x - 30) * (x - 30));
        if (min(h[x - 1], h[x]) < y + t - r) return false;
      }
      return true;
    }) << endl;
  }
}



Measured memory_bytes: 3264
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<pair<int, int>> tasks;

int main(void){
    int N;
    int i;
    cin >> N;
    for(i = 0; i < N; i++){
        int A, B;
        cin >> A >> B;
        tasks.emplace_back(B, A);
    }
    sort(tasks.begin(), tasks.end());
    int sum = 0;
    bool isyes = true;
    for(auto v : tasks){
        sum += v.second;
        if(sum > v.first){
            isyes = false;
            break;
        }
    }
    cout << (isyes ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 2420
#include <stdio.h>

int     main(void)
{
    int h, w;
    int i, j;
    
    while(scanf("%d%d", &h, &w) == 2 && (h|w) != 0)
    {
        i = 0;
        while (i < h)
        {
            j = 0;
            while (j < w)
            {
                if (j == 0 || j == w - 1 || i == 0 || i == h - 1)
                    printf("#");
                else
                    printf(".");
                j++;
            }
            i++;
            printf("\n");
        }
        printf("\n");
    }
}


Measured memory_bytes: 2100
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N, A, B = [int(i) for i in input().split()]
cnt = 0
for i in range(1, N + 1):
    chk_val = 0
    n = i
    while n != 0:
        chk_val += n % 10
        n = n // 10
    if (chk_val >= A ) and (chk_val <= B):
        #print(i, chk_val)
        cnt += i

print(cnt)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m) for(auto it=m.begin();it!=m.end();it++)
// #define find(m,i) (m.find(i)!=m.end())
// #define find(m,i) (m.find(i)==m.end())
#define cYES cout<<"YES\n";
#define cNO cout<<"NO\n";
#define ins insert
#define imax 1000000000000000000
#define imin -1000000000000000000
// #define NP 50000
//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
 
//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 
// scanning numbers extremely fast/////////
void fs(int &number)
{
    bool negative = false;
    register int c;
    number = 0;
    c = getchar();
    if (c=='-')
    {
        negative = true;
        c = getchar();
    }
    for (; (c>47 && c<58); c=getchar())
        number = number *10 + c - 48;
    if (negative)
        number *= -1;
}
// ========================================
int power(int a,int x)
{
        a%=mod;
    int res=1;
    while(x>0)
    {
        if(x&1)
        res=res*a%mod;
        a=a*a%mod;
        x>>=1;
    }
    return res;
}
int max(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int min(int a,int b)
{
    if(a>b)
    {
        return b;
    }
    else
    {
        return a;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
 
void nhi_degi()
{
    int n;cin>>n;
    int W;cin>>W;
    int weight[n+3],val[n+4];
    for(int i=1;i<=n;i++)
    {
        cin>>weight[i]>>val[i];
    }
    int dp[W+2],dp1[W+2];
    for(int i=0;i<=W+1;i++)
    {
        dp[i]=0;
        dp1[i]=0;
    }
    for(int j=1;j<=n;j++)
    {
        for(int i=0;i<=W;i++)
        {
            dp1[i]=dp[i];
        }

        for(int i=1;i<=W;i++)
        {
            if(weight[j]<=i)
            {
                dp[i]=max(val[j]+dp1[i-weight[j]],dp1[i]);
            }
            dp[i]=max(dp[i-1],dp[i]);
            // cout<<i<<"-->"<<dp[i];el
        }
        
    }
    int bsdk=-1;
    cout<<dp[W];el
}
signed main()
{
    nhi_degi();
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
const int VMAX=2600,EMAX=5010;
const ll INF = 1e+9;
const ll INFLL = 1e+17;
int V,E;
ll p;
int a[5010],b[5010];
ll c[5010];
struct edge{
  int from,to;
  ll cost;
};
edge e[EMAX];
ll d[VMAX];
bool update;
bool bellmanford(int s){
  for(int i=0;i<V;i++) d[i]=INFLL;
  d[s]=0;
  for(int j=0;j<2*V;j++){
    update=false;
    for(int i=0;i<E;i++){
      int f=e[i].from,t=e[i].to;
      ll c=e[i].cost;
      if(d[f]!=INFLL&&d[t]>d[f]+c){
	d[t]=d[f]+c;
	if(j==V-1) d[t]=-INF;
	update=true;
	if(j>=V-1&&t==V-1) return false;
      }
    }
    if(!update) break;
  }
  return true;
}

int main()
{
  cin >> V >> E >> p;
  rep(i,E){
    cin >> a[i] >> b[i] >> c[i];
    e[i].from = --a[i];
    e[i].to = --b[i];
    e[i].cost = -c[i]+p;
  }
  

  
  if(!bellmanford(0)) cout << -1 << "\n";
  else{
    cout << max((ll)0,-d[V-1]) << "\n";
  }
  
  return 0;
}



Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll A,B,C,D;
    cin >>A>>B>>C>>D;
    
    cout << max(0LL,min(B,D)-max(A,C)) << endl;


    return 0;
    

}

Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <map>
 
using namespace std;
typedef long long ll;


ll ans,mx,sum,mn=1e8;
int main(){
	ll n,m;
	cin>>n>>m;
	ll a[n];
	for(ll i=0; i<n; i++){
		cin>>a[i];
	}
	for(ll i=0; i<n; i++){
		if(i>0){
			if(a[i]-a[i-1] < m){
				ans += a[i]-a[i-1];
			}
			else ans += m;
		}
	}
	cout<<ans+m;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repe(i, n) for(i = 0; i <= (n); i++)
#define repr(i, n) for(int (i) = (n); (i) > 0; --(i))
#define repre(i, n) for(int (i) = (n); (i) >= 0; --(i))
typedef long long ll;
typedef unsigned long long ull;

int dp[5005][5005];

int main()
{
    ull N;
    string S;
    cin >> N >> S;
    repre(i, N-1){
        repre(j, N-1){
            if(S[i] != S[j])dp[i][j] = 0;
            else dp[i][j] = dp[i+1][j+1] + 1;
        }
    }
    int ans = 0;
    rep(i, N)rep(j, N){
        if(i >= j)continue;
        int now = min(dp[i][j], j - i);
        ans = max(now, ans);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 98048
//
//  main.cpp
//  CoderTest
//
//  Created by yuya on 2019/05/20.
//  Copyright © 2019 yuya. All rights reserved.
//

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




int main(){
    
    int N;
    cin >> N;
    vector<int> W(N);
    cin >> W[0];
    int w;
    for(int i=1;i<N;i++){
        cin >> w;
        W[i] = W[i-1]+w;
    }
    int mind=100;
    for(int i=0;i<N;i++){
        mind = min(mind,abs(W[N-1]-2*W[i]));
    }
    
    cout << mind << endl;
    
    return 0;
}


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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  string s; cin >> s;
  string ans="";
  for(int i = 0; i < s.length(); i++) {
    ans.push_back(s[i]);
    if(i==3) {
      ans.push_back(' ');
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
 
ll power(ll x, ll y); 
#define repp(I, A, B) for(int I = A; I <= B; I++)
#define rep(I, A, B) for(int I = A; I < B; I++)
#define rrep(I, B, A) for(int I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define mem(A, B) memset(A, B, sizeof(A));
#define mem0(A) memset(A, 0, sizeof(A));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define bitcount(n) __builtin_popcountll(n)
#define in_edges(M) repp(I, 1, M){ll A, B; cin >> A >> B; v[A].pb(B), v[B].pb(A);}
#define in_edges2(M) repp(I, 1, M){ll A, B; cin >> A >> B; v[A].pb(B);}
#define endl "\n"

const ll MOD = 1000000007;
 
 int c;
int main() //PointBlank's code ¯\_(ツ)_/¯
{
    string s, t;
    cin >> s >> t;
    rep(i, 0, s.size()) if(s[i] != t[i]) c++;
    cout << c;
}

ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Measured memory_bytes: 3916
using System;

class Program
{
  static void Main(string[] args)
  {
    string N = Console.ReadLine();

    int sum = 0;
    foreach (var s in N.ToCharArray())
    {
      sum += (int)char.GetNumericValue(s);
    }

    Console.WriteLine(sum % 9 == 0 ? "Yes" : "No");
    return;
  }
}


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

int main()
{
    int N, K;
    std::cin >> N >> K;
    std::string S;
    std::cin >> S;

    //std::cout << "N:" << N << " K:" << K << " S:[" << S << "]" << std::endl;

    int happy = 0;
    if (N == 1) {
        std::cout << 0 << std::endl;
        return 0;
    }

    if (N == 2) {
        if (S[0] == S[1]) {
            std::cout << 1 << std::endl;
            return 0;
        }
        if (S[0] != S[1] && K >= 1) {
            std::cout << 1 << std::endl;
            return 0;
        }
    }
    // N>1

    if (S[0] == 'R' && S[1] == 'R') happy += 1;
    if (S[N-1] == 'L' && S[N-2] == 'L') happy += 1;
    for (int i=1; i<N-1; ++i) {
        if (S[i] == 'L' && S[i-1] == 'L') happy += 1;
        if (S[i] == 'R' && S[i+1] == 'R') happy += 1;
    }

    int LR = 0;
    int RL = 0;
    for (int i=0; i<N-1; ++i) {
        if (S[i]=='L' && S[i+1] == 'R') LR += 1;
        if (S[i]=='R' && S[i+1] == 'L') RL += 1;
    }
    int OUT = 0;
    if (S[0] == 'L') OUT += 1;
    if (S[N-1] == 'R') OUT += 1;


    int action = std::min(K,std::min(LR,RL));
    int oa = 0;
    if (action < K) {
        oa += std::min(OUT, LR - action);
        oa += std::min(2-OUT, RL - action);
    }

    happy += action*2 + oa;
    std::cout << happy << std::endl;

    return 0;
}

Measured memory_bytes: 512
N,A,B = map(int, input().split())

if A == 0:
    print(0)
    exit()

if N <= A:
    print(N)
    exit()

set_count = N // (A+B)
extra = N % (A+B)

if extra <= A:
    print(set_count*A + extra)
    exit()
else:
    print(set_count*A + A)
    exit()

Measured memory_bytes: 38384
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int n;
	static int[] prime;
	public static void main(String[] args) {
		makePrime();
		while(read()){
			solve();
		}
	}
	static boolean read(){
		if(!sc.hasNext())return false;
		n = sc.nextInt();
		return true;
	}
	static void solve(){
		int resMin = 2;
		int resMax = Integer.MIN_VALUE;
		for(int i = 2; i < prime.length; i++){
			if(prime[i] == 1 && n < i){
				resMax = i;
				break;
			}
		}
		for(int i = prime.length-1; i > 2 ; i--){
			if(prime[i] == 1 && n > i){
				resMin = i;
				break;
			}
		}
		System.out.println(resMin + " " + resMax);
	}
	static void makePrime(){
		prime = new int[50101];
		for(int i = 1; i < prime.length; i++){
			prime[i] = 1;
		}
			for(int j = 2; j < prime.length; j++){
				if(prime[j] == 1){
					for(int k = 2; j*k <= prime.length-1; k++ ){
						prime[j*k] = 0;
					}
				}
			}
	}
}

Measured memory_bytes: 12000
using System;

namespace ABC045B{
    public class Program{
        public static void Main(string[] args){
            var sr = new StreamReader();
            //---------------------------------
            var str = "abc";
            var S = sr.Next<string>(3);

            var t = 0;
            while(true){
                if(S[t].Length == 0) break;

                var nt = str.IndexOf(S[t][0]);
                S[t] = S[t].Remove(0, 1);
                t = nt;
            }

            Console.WriteLine(char.ToUpper(str[t]));
            //---------------------------------
        }
    }

    public class StreamReader{
        private readonly char[] _c = {' '};
        private int _index = -1;
        private string[] _input = new string[0];
        private readonly System.IO.StreamReader _sr = new System.IO.StreamReader(Console.OpenStandardInput());

        public T Next<T>(){
            if(_index == _input.Length - 1){
                _index = -1;
                while(true){
                    string rl = _sr.ReadLine();
                    if(rl == null){
                        if(typeof(T).IsClass) return default(T);
                        return (T)typeof(T).GetField("MinValue").GetValue(null);
                    }
                    if(rl != ""){
                        _input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
                        break;
                    }
                }
            }
            return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
        }

        public T[] Next<T>(int x){
            var ret = new T[x];
            for(var i = 0; i < x; ++i) ret[i] = Next<T>();
            return ret;
        }

        public T[][] Next<T>(int y, int x){
            var ret = new T[y][];
            for(var i = 0; i < y; ++i) ret[i] = Next<T>(x);
            return ret;
        }
    }
}

Measured memory_bytes: 3032
#include<bits/stdc++.h>
using namespace std;
int main(){
  for (;;){
    int h, w; cin >> h >> w;
    if (h == 0) return 0;
    for (int i = 0; i < h; i++){
      if (i % 2 == 0){
        for (int j = 0; j < w; j++){
          if (j % 2 == 0) cout << "#";
          else cout << ".";
        }
        cout << endl;
      }
      else{
        for (int j = 0; j < w; j++){
          if (j % 2 == 0) cout << ".";
          else cout << "#";
        }
        cout << endl;
      }
    }
    cout << endl;
  }
}


Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
#define rep(_,a,b) for(int _=a;_<b;_++)
#define per(_,a,b) for(int _=b-1;_>=a;_--)
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
typedef long long ll;

int main(){
    int test,AC=0,WA=0,TLE=0,RE=0;
    ios::sync_with_stdio(false);
    cin>>test;
    while(test--){
        string tmp;
        cin>>tmp;
        if(tmp=="AC") AC++;
        if(tmp=="WA") WA++;
        if(tmp=="TLE") TLE++;
        if(tmp=="RE") RE++;
    }
    cout<<"AC x "<<AC<<endl<<"WA x "<<WA<<endl<<"TLE x "<<TLE<<endl<<"RE x "<<RE;
}


Measured memory_bytes: 3660
(defun is-prime (n)
  (dotimes (i (isqrt n))
    (if (and (not (eql i 0)) (zerop (rem n (1+ i))))
        (return-from is-prime nil)))
  T)

(defun next-prime (n)
  (loop (if (is-prime n)
            (return n)
            (setq n (1+ n)))))

(format t "~A~%" (next-prime (read)))

Measured memory_bytes: 11876