akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;

typedef long long ll;
#define READ(a) int a; cin >> a;
#define READARR(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define READMAT(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
#define print(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll f = 1e6;

int power (int a, int b = mod - 2)
{
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}

int spf[f + 1]= {};
void precalc()
{
	for (int i = 2; i < f; i++)
		for (int j = i*i; j <= f; j += i)
			if (!spf[j]) spf[j] = i;
	
	for (int i = 1; i <= f; i++)
		if (!spf[i]) spf[i] = i;
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	READ(n);
	READARR(a, n);
	precalc();
	int p = 0, po[f + 1] = {};
	FOR (i, 1, n)
	{
	    p = (p + power(a[i])) % mod;
	    map <int, int> mp;
	    while (a[i] > 1)
	    {
	        mp[spf[a[i]]]++;
	        a[i] /= spf[a[i]];
	    }
	    
	    for (pi i: mp)
	        po[i.fi] = max(po[i.fi], i.se);
	}
	
	FOR (i, 1, f)
	    p = p * power(i, po[i]) % mod;
	    
	cout << p;
}

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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = ll(1e9) + 7;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend())
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   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; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (a == 0) return 0; else if (b % 2 == 0) return (pow((a * a) % m, b / 2, m) % m); else return (pow((a * a) % m, b / 2, m) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

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

int main(){
  ll m, k; cin >> m >> k;
  if((1ll << m) <= k){cout << -1 << endl; return 0;}
  if(m == 1){
    if(k == 0) cout << "0 0 1 1" << endl;
    if(k == 1) cout << -1 << endl;
    return 0;
  }
  Vi a;
  REP(i, 1ll << m){
    if(i == k) continue;
    a.pb(i);
  }
  a.pb(k);
  for(ll i = (1ll << m) - 1; i >= 0; i--){
    if(i == k) continue;
    a.pb(i);
  }
  a.pb(k);
  REP(i, a.size()){
    if(i) cout << ' ';
    cout << a[i];
  }
  cout << endl;
}


Measured memory_bytes: 4080
#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
#include <cmath>
#include <iomanip>
#include <math.h>
#include <numeric>
#include <utility>
using namespace std;

int main() {
	int p, q, r;
	cin >> p >> q >> r;
	cout << p + q + r - max({ p,q,r }) << endl;
	return 0;
}

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

using ll = int64_t;

int main() {
    ll S;
    std::cin >> S;

    const ll v = 1000000000;

    const ll Y2 = (v - S % v) % v;
    const ll Y3 = (S + Y2) / v;

    std::printf("%d %d %ld %ld %d %ld\n", 0, 0, v, Y2, 1, Y3); 

    return 0;
}


Measured memory_bytes: 256
<?php
$stdin = trim(fgets(STDIN));
$moji = explode(' ', $stdin);
if((int)$moji[0] >= 1 && (int)$moji[0] <= 9 && (int)$moji[1] >= 1 && (int)$moji[1] <= 9){
	print (int)$moji[0] * (int)$moji[1];
} else {
	print -1;
}

Measured memory_bytes: 3576
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define maxn 100
#define mod 998244353
using namespace std;




int main() {
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    if(s[0] == 'A' && s[1] == 'A' && s[2] == 'B') cout << "Yes" << endl;
    else if(s[0] == 'A' && s[1] == 'B' && s[2] == 'B') cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn=(1e5+10);
int n,k,q,cnt[maxn];
int main()
{
	cin>>n>>k>>q;
	for(int i=0;i<q;i++)
	{
		int x;
		cin>>x;
		++cnt[x];
	}
	for(int i=1;i<=n;i++)
		if(k-(q-cnt[i])<=0)
			cout<<"No\n";
		else
			cout<<"Yes\n";
	return 0;
}

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

#define rep(i,l,r) for(int i=(l);i<(r);i++)
#define pb push_back
#define fi first
#define se second

using ll = long long;
using G = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll MOD = 1000000007;

ll GCD(ll x, ll y){
	return y ? GCD(y, x%y) : x;	
}
ll LCM(ll x, ll y){
	return x/GCD(x, y)*y;
}

int main() {
	string s,t; cin >> s >> t;
	int n = int(s.size());
	int ans = 0;
	rep(i, 0, n){
		if(s[i]!=t[i]) ans++;
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
    int i, n, q, idx, T, ans = 0;
    int *pos;
    cin >> n;
    int S[n];
    for(i = 0; i < n; i++){
        scanf("%d", &S[i]);
    }
    cin >> q;
    for(i = 0; i < q; i++){
        scanf("%d", &T);
        pos = lower_bound(S, S + n, T);
        idx = distance(S, pos);
        if(S[idx] == T) ans++;
    }
    cout << ans << endl;
    return 0;
}


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

#define ran 5055

int n;
char s[ran];
int f[ran][ran];

int main() {
	scanf("%d%s", &n, s);
	
	int ans = 0;
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++)
			if (s[i]!=s[j]) f[i][j] = 0;
			else {
				f[i][j]=1;
				if(i>0 && f[i-1][j-1] < j-i) f[i][j]+=f[i-1][j-1];
				ans = max(ans, f[i][j]);
			}
	printf("%d\n", ans);
	
	return 0;
}

Measured memory_bytes: 98688
#include <iostream>

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

    int m = N % 10;

    if (m == 3) {
        std::cout << "bon\n";
    } else if (m == 0 || m == 1 || m == 6 || m == 8) {
        std::cout << "pon\n";
    } else {
        std::cout << "hon\n";
    }
}

Measured memory_bytes: 3632
#include <stdio.h>
int main(void){
  int n,i,s,a=0;
  scanf("%d",&n);
  int h[n];
  for(i=0;i<n;i++)scanf("%d",&h[i]);
  for(i=0;i<n;i++){
    while(h[i]){
      s=0;
      do h[i+s++]--; while(h[i+s]);
      a++;
    }
  }
  printf("%d",a);
}

Measured memory_bytes: 128
#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 1000000000
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


template<class T>
class segment_tree_t {
public:
  segment_tree_t(int size) : size_(1) {
    while (size_ < size)
      size_ *= 2;

    a_ = new T[size_ * 2];

    memset(a_, 0, sizeof(T) * size_ * 2);
  };

  ~segment_tree_t() {
    delete[] a_;
  };

public:
  void update(int i, T x) {	// 0-index
    i += size_ - 1;

    a_[i] = x;

    while (i > 0) {
      i = (i - 1) / 2;

      a_[i] = a_[i * 2 + 1] + a_[i * 2 + 2];
    }
  };

  T query(int a, int b, int i = -1, int l = -1, int r = -1) const {	// [a, b)
    if (i < 0) {
      return query(a, b, 0, 0, size_);
    }
    else {
      if (r <= a || b <= l)
        return 0;

      if (a <= l && r <= b) {
        return a_[i];
      }
      else {
        return
          query(a, b, i * 2 + 1, l, (l + r) / 2) +
          query(a, b, i * 2 + 2, (l + r) / 2, r);
      }
    }
  };

public:
  T operator[](int i) const {
    return a_[size_ + i - 1];
  };

private:
  int size_;

  T* a_;
};


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;

  std::string S;

  std::cin >> N >> S;

  segment_tree_t<int> tree(N);

  for (int i = 0; i < N; i ++)
    if (S[i] == '#')
      tree.update(i, 1);

  int c = tree.query(0, N), Cm = INF;

  for (int i = 0; i <= N; i ++) {
    int x = tree.query(0, i), y = c - x, C = x + (N - i - y);

    if (C < Cm)
      Cm = C;
  }

  std::cout << Cm << std::endl;

  return 0;
}


Measured memory_bytes: 3316
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>
#include <math.h>

using namespace std;

int main (void)
{
	long m,min,max,p[10000],g[10000],kkk,rrr;

	for (long o = 0; o < 10000; o++)
	{
	cin >> m >> min >> max;

	if (m == 0 && min == 0)
	{
		if (max == 0)
		{
			break;
		}
	}

	kkk = 0;

	for (long i = 1; i < m + 1; i++)
	{
		cin >> p[i];
	}

	for (long j = min; j < max + 1; j++)
	{
		g[j] = p[j] - p[j + 1];

		if (kkk <= g[j])
		{
			kkk = 0;
			kkk = g[j];
			rrr = 0;
			rrr = j;
		}
	}

		cout << rrr << endl;
	}
}

Measured memory_bytes: 3092
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
typedef long long ll;
using namespace std;

ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }



int main()
{
    int N,M;
    cin >> N >> M;
    vector<pair<int, int> > AB(N);
    for(int i = 0; i < N; i++)
    {
        int A,B;
        cin >> A >> B;
        AB[i].first = A;
        AB[i].second = B;
    }
    sort(AB.begin(),AB.end());
    ll money = 0;
    ll juice = 0;
    int i = 0;
    for(int i = 0; i < N && M > 0; i++)
    {
        money += AB[i].first * min(M,AB[i].second);
        M -= min(M,AB[i].second);

    }
    cout << money << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cmath>
#include<vector>
#include<map>
#include<unordered_map>
#include<algorithm>
using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<int> num;
  map<int, int> nums;
  for (int i=0;i<n;i++) {
    int t;
    cin >> t;
    num.push_back(t);
    if (nums.find(t) != nums.end()) {
      nums[t]++;
    } else {
      nums[t] = 1;
    }
  }
  int a = 0;
  for (int i=0;i<n;i++) {
    a ^= num[i];
  }
  if (a!=0) {
    cout << "No" << endl;
    return 0;
  }
  sort(num.begin(), num.end());
  num.erase(unique(num.begin(), num.end()), num.end());
  for (int i=0;i<n;i++) {
    for (int j=i+1;j<n;j++) {
      if (i==j) continue;
      int a = num[i];
      int b = num[j];
      map<int, int> nums2 = nums;
      nums2[a]--;
      nums2[b]--;
      int first = a;
      int prev = a;
      int cur = b;
      for (int k=2;k<n+1;k++) {
        int next = prev ^ cur;
        if (k != n) {
          if (nums2.find(next) == nums2.end() || nums2[next] == 0) {
            break;
          }
          prev = cur;
          cur = next;
          nums2[next]--;
        } else {
          if (next == first) {
            cout << "Yes" << endl;
            return 0;
          }
        }
      }
    }
  }
  cout << "No" << endl;
  return 0;
}




Measured memory_bytes: 4216
import math as mt
store = []
def binarysearch(min, max):
    mid = int((max + min)/2)
    if (min == max):
        return mid
    elif count(mid) > mid:
        return binarysearch(mid+1, max)
    else:
        return binarysearch(min, mid)

def count(x):
    store = [mt.ceil((n - x*b)/a) for n in hp]
    store = [x for x in store if x > 0]
    return sum(store)

st = 0
min = 10 ** 18
max = 0
n, a, b = [int(x) for x in input().split(' ')]
hp = []
for i in range(n):
    st = int(input())
    if st < min:
        min = st
    if st > max:
        max = st
    hp.append(st)
min, max = mt.ceil(min/a), mt.ceil(max/b)
a = a - b
print(binarysearch(min,max))


Measured memory_bytes: 11844
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44

using namespace std;

const int MAXN = (int) 1e5 + 5;

ll x[MAXN + 1];
int v[MAXN + 1];

ll val[MAXN + 1];
ll mxl[MAXN + 1], mxr[MAXN + 1];

int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int n, i;
    ll c;
    ios::sync_with_stdio(false);
    cin >> n >> c;
    for(i = 1; i <= n; i++) {
        cin >> x[i] >> v[i];
    }
    x[n + 1] = c;
    for(i = n; i >= 1; i--) {
        val[i] = val[i + 1] + (c - x[i + 1]) + v[i] - (c - x[i]);
        mxr[i] = max(val[i], mxr[i + 1]);
    }
    for(i = 1; i <= n; i++) {
        val[i] = val[i - 1] + x[i - 1] + v[i] - x[i];
        mxl[i] = max(val[i], mxl[i - 1]);
    }
    ll ans = 0;
    ll cur = 0;
    for(i = n; i >= 1; i--) {
        cur += v[i];
        ans = max(ans, cur - (c - x[i]));
    }
    cur = 0;
    for(i = 1; i <= n; i++) {
        cur += v[i];
        ans = max(ans, cur - x[i]);
        ans = max(ans, cur - 2 * x[i] + mxr[i + 1]);
    }
    cur = 0;
    for(i = n; i >= 1; i--) {
        cur += v[i];
        ans = max(ans, cur - 2LL * (c - x[i]) + mxl[i - 1]);
    }
    cout << ans;
    //cin.close();
    //cout.close();
    return 0;
}


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

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

    string s = to_string(N);

    if (((s[0] == s[1]) && (s[1] == s[2])) || ((s[1] == s[2]) && (s[2] == s[3])))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <list>
#include <ctime>
#include <complex>
#include <bitset>
#include <tuple>
#include <random>

#define ff first
#define ss second

using namespace std;

using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

#define MOD 998244353LL

pii operator+(pii a, pii b)
{
    return {a.ff+b.ff,a.ss+b.ss};
}

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

    int n,k;
    cin>>n>>k;
    vector<pii> v(k+1);
    for(int i=1; i<=k; i++) cin>>v[i].ff>>v[i].ss;
    vector<ll> dp(n+2);
    dp[1]=1;
    dp[2]=-1;
    ll sum=0;
    for(int i=1; i<=n; i++){
        sum=(sum+dp[i])%MOD;
        for(int j=1; j<=k; j++){
            int s=i+v[j].ff;
            int e=min(i+v[j].ss,n)+1;
            if(s>n) continue;
            dp[s]=(dp[s]+sum)%MOD;
            dp[e]=(dp[e]-sum+MOD)%MOD;
        }
    }
    cout<<sum;

    return 0;
}


Measured memory_bytes: 4760
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define LOOP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define MP make_pair
#define FIR first
#define SEC second
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;
const int MAX=101;
int n,m;
int M[MAX][MAX];
int L[MAX][MAX];


signed main(){
  cin>>n>>m;
  REP(i,n)REP(j,n){
    M[i][j]=(i==j?0:INF);
    L[i][j]=(i==j?0:INF);
  }
  REP(i,m){
    int a,b,c;
    cin>>a>>b>>c;
    a--;b--;
    M[a][b]=c;
    M[b][a]=c;
    L[a][b]=c;
    L[b][a]=c;
  }
  REP(k,n)REP(i,n)REP(j,n)M[i][j]=min(M[i][j],M[i][k]+M[k][j]);

  int ans=0;
  REP(i,n)REP(j,n){
    if(L[i][j]!=INF&&(L[i][j]>M[i][j]))ans++;
  }
  cout<<ans/2<<endl;
  return 0;
}


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

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

	int count = 0;
	while (N > 1)
	{
		if (N % 3 == 1 || N % 3 == 2)
		{
			N = N / 3 + 1;
		}
		else
		{
			N /= 3;
		}

		count++;
	}

	cout << count << endl;
	return 0;
}

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

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


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    ll n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll ans = 0;
    vector<ll> sum(n+1, 0); // sum[i]: a[i-1]までの和
    rep(i, n) {
        sum[i+1] = sum[i]+a[i];
        sum[i+1] %= MOD;
    }
    rep(i, n-1) {
        ans += (a[i]*(sum[n]-sum[i+1]+MOD)%MOD)%MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

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

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


Measured memory_bytes: 6360
#include<iostream>
#include<queue>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
/****************************/
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define qi queue<int>
#define mii map<int,int>
#define msi map<string,int>
#define vs vector<string>
#define vc vector<char>
/****************************/
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rep3(i,a,n) for(ll i=(a);i<(n);i++)
#define rep4(i,a,n) for(ll i=(a)-1;i>=n;i--)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define pi 3.1415926535897932384626433832795
#define zero(n) memset(n,0,sizeof(n));
#define SZ(n) n.size()
#define sn st.nd 
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
/****************************/
ll m,n;
int a[100010];
string s; 
int main()
{
	char c;
	cin>>c;
	if('a'<=c&&c<='z') cout<<'a';
	if('A'<=c&&c<='Z') cout<<'A';
	return 0;
}

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

#define sp <<" "
#define el <<"\n"
#define S second
#define F first
#define mp make_pair
#define pb push_back
#define pf push_front
#define pob pop_back
#define obit __builtin_popcount
#define pof pop_front
#define mod (int)1e9 + 7
#define For(i,a,n) for(i=a;i<n;i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned short int us;
typedef short int ss;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
/*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif */
    int i,n;
    cin>>n;
    int ar[n];
    For(i,0,n) cin>>ar[i];
    int mn = ar[0], cnt = 0;
    For(i,0,n){
    	if(ar[i] <= mn) cnt++;
    	if(ar[i]<mn) mn = ar[i];
    }
    cout<<cnt;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const ll ZERO = 0;
const ll INF = 1e14;
const ll MOD = 1000000007;
const double PI = 3.1415926535897;

int main() {
    ll A, B, K;
    cin >> A >> B >> K;
    if(A >= K) {
        cout << A - K << " " << B << endl;
    }
    else {
        ll Z = 0;
        cout << 0 << " " << max(Z,B - (K - A)) << endl;
    }
}

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

struct UnionFind {
    vector<int> data;

    UnionFind(int sz) { data.assign(sz, -1); }

    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y) return (false);
        if (data[x] > data[y]) swap(x, y);
        data[x] += data[y];
        data[y] = x;
        return (true);
    }

    int find(int k) {
        if (data[k] < 0) return (k);
        return (data[k] = find(data[k]));
    }

    int size(int k) { return (-data[find(k)]); }
};

int main() {
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    for (int i = 0; i < m; i++) {
        int x, y, z;
        cin >> x >> y >> z;
        uf.unite(x-1, y-1);
    }
    map<int, bool> appeared;
    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (!appeared[uf.find(i)]) {
            appeared[uf.find(i)] = true;
            ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
int main(){
	int N,M;cin>>N>>M;
	int edge[N][N]={0};
	int a,b;
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            edge[i][j]=0;
        }
    }for(int i=0;i<M;i++){
		cin>>a>>b;
		edge[a-1][b-1]=1;
		edge[b-1][a-1]=1;
	}vector<int> v(N);
	iota(v.begin(),v.end(),0);
    int calculate=0;bool possible;
	do{
		possible=true;
		for(int j=1;j<N;j++){
			if(edge[v[j-1]][v[j]]==0){
				possible=false;
			}
		}if(possible==true){
			calculate++;
		}
	}while(next_permutation(v.begin()+1,v.end()));
	cout<<calculate<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end())
#define vecmin(A) *min_element(A.begin(),A.end())
#define vecmax(A) *max_element(A.begin(),A.end())
typedef long long ll;

int main(){
  string s;
  cin >> s;
  reverse(s);
  int n = s.size();
  vector<string> t = {"dream","dreamer","erase","eraser"};
  rep(i,4) reverse(t[i]);
  int now = 0;
  while(now<n){
    bool suc = 0;
    rep(i,4){
      int m = t[i].size();
      string tmp = s.substr(now,m);
      if(tmp == t[i]){
        if(suc) continue;
        now += m;
        suc = 1;
      }//if_tmp
    }//rep_i
    if(!suc){
      cout << "NO" << endl;
      return 0;
    }
    if(now == n){
      cout << "YES" << endl;
      return 0;
    }
  }//while_now
}

Measured memory_bytes: 512
import java.util.Scanner;
class Main {
    int n,m,l;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        sc.useDelimiter("\\s");
        n = sc.nextInt();
        m = sc.nextInt();
        l = sc.nextInt();
        int [][] a = new int [n+1][m+1];
        int [][] b = new int [m+1][l+1];
        long [][] c = new long [n+1][l+1];
        for(int x = 0; x < n; x++){
            for(int y = 0; y < m; y++){
                a[x][y] = sc.nextInt();
            }
        }
        for(int x = 0; x < m; x++){
            for(int y = 0; y < l; y++){
                b[x][y] = sc.nextInt();
            }
        }
        for(int x = 0; x < n; x++){
            for(int y = 0; y < l; y++){
                c[x][y] = 0;
            }
        }
        for(int x = 0; x < n; x++){
            for(int y = 0; y < l; y++){
                for(int r = 0; r < m; r++){
                    c[x][y] = c[x][y] + a[x][r] * b[r][y];
                }
                if(y==l-1){
                    System.out.printf("%d",c[x][y]);
                    System.out.println();
                }else{
                    System.out.printf("%d ",c[x][y]);
                }
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

int main()
{
    cout << fixed << setprecision(15);

    ll N, K;
    cin >> N >> K;

    vector<ll> H(N);
    REP(i, N){
        cin >> H[i];
    }

    sort(H.begin(), H.end());

    ll ans = INF;
    for(ll i=0; i<N-K+1; i++){
        ans = min(ans,H[i+K-1] - H[i]);
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
  int N,M;
  cin>>N;
  vector<string> A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  cin>>M;
  vector<string> B(M);
  for(int i=0;i<M;i++){
    cin>>B.at(i);
  }
  int sum =0;
  
  for(int i=0;i<N;i++){
    int sumz = 0;
    for(int j =0;j<N;j++){
      if(A.at(i)==A.at(j)){
        sumz++;
      }
    }
      for(int j =0;j<M;j++){
        if(A.at(i)==B.at(j)){
          sumz--;
        }
           }
           if(sumz>sum){
             sum=sumz;
           }
           }
           cout<<sum<<endl;
           }

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

const int N = 2005;

int a[N], b[N], c[N];

int main(){
	int n, k, q, last, cnt, ans;
	scanf("%d %d %d",&n,&k,&q);
	for (int i = 1; i <= n; i++) scanf("%d",&a[i]);
	ans = 2e9;
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n; j++) b[j] = a[j];
		cnt = 0; last = 0;
		for (int j = 1; j <= n; j++){
			if (b[j] < a[i]){
				if (j - last - 1 >= k){
					sort(b + last + 1, b + j);
					for (int p = last + 1; p <= j - k; p++) c[++cnt] = b[p];
				}
				last = j;
			}
		}
		if (n - last >= k){
			sort(b + last + 1, b + n + 1);
			for (int p = last + 1; p <= n + 1 - k; p++) c[++cnt] = b[p];
		}
		if (cnt >= q){
			sort(c + 1, c + cnt + 1);
			ans = min(ans, c[q] - a[i]);
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <string>

using namespace std;

int main(void){
   int a=0,b=0;
  int c=0,d=0,e=0;
   cin >> a >> b;
  c=a+b;
  d=a-b;
  e=a*b;
  
  if(c>=d&&c>=e){
   cout << c << endl;
  }
  else if(d>=c&&d>=e){
   cout << d << endl;
  }  
  else if(e>=c&&e>=d){
   cout << e << endl;
  }
  
   return 0;
}


Measured memory_bytes: 256
import math
import copy
import sys

inputa = input().split()
inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

x = int(inputb[0])
y = int(inputb[1])

inputb = input().split()
inputbList = [int(n) for n in inputb]
#
# inputList=[]
# for i in range(a):
#     inputNum = input().split()
#     inputList = [int(n) for n in inputNum]
#     # inputList.append(int(inputNum))

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

min = sys.maxsize
idx = -1
for i in range(a):
    tmp = abs(y - (x - 0.006*inputbList[i]))
    if min > tmp:
        min = tmp
        idx = i+1

print(idx)






Measured memory_bytes: 3700
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
#define in(a) scanf("%lld", &(a))
#define in2(a,b) scanf("%lld %lld",&(a),&(b))
#define in3(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c))
#define ind(a) scanf("%lf", &(a))
#define ins(a) scanf("%s", (a))
#define inc(a) scanf("%c", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a))
//      puts(a) printf("%s\n", a) 文字はこっち
//your code here!
int cmp(const void *a, const void *b){
    ll A=*(ll *)a, B=*(ll *)b;
    if(A==B)return 0;
    else return A>B ? 1:-1;//昇順ソート 1,2,....9
}

int main(void){
    ll N, x, a[105], ans=0;
    in2(N, x);
    rep(i, N) in(a[i]);
    qsort(a, N, sizeof(ll), cmp);
    for(ll i=0; i<N-1; i++){
        if(x>=a[i]){
            ans++;
            x -= a[i];
        }
        else break;
    }
    if(x==a[N-1]) ans++;
    put(ans);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	
	bool yes = (min(a, c) + d >= max(a, c)) || (min(a, b) + d >= max(a, b) && min(b, c) + d >= max(b, c));
	cout << (yes ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#define debug(x) cout << #x " => " << (x) << endl
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
#endif
using lint = long long;
constexpr int MOD = (int)1e9 + 7;
constexpr double EPS = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

int main(void) {
  int n;
  cin >> n;
  int x = n / 1.08;
  if (x * 1.08 == n) {
    cout << x << endl;
  } else {
    ++x;
    if ((int)(x * 1.08) == n) {
      cout << x << endl;
    } else {
      cout << ":(" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;

public class Main{
	static int[] c=new int[26];
	static int[] lastD=new int[26];
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long startTime = System.currentTimeMillis();
		Random rd=new Random();
		Random rc=new Random();
		int d=sc.nextInt();
		for(int i=0; i<26; i++){
			c[i]=sc.nextInt();
		}
		int[][] s=new int[d][26];
		for(int i=0; i<d; i++){
			for(int j=0; j<26; j++){
				s[i][j]=sc.nextInt();
			}
		}
		int maxSati=-1000000;
		int maxInd=-1;
		int[] ans=new int[d];
		TreeSet<Integer>[] memo=new TreeSet[26];
		for(int i=0; i<26; i++){
			memo[i]=new TreeSet<>();
			memo[i].add(0);
			memo[i].add(d+1);
		}
		//j:何日目
		int endSati=0;
		for(int j=0; j<d; j++){
			//i:どの大会をやるか
			for(int i=1; i<=26; i++){
				int sati=0;
				sati+=s[j][i-1];
				sati-=subSati(j+1,i-1);
				if(maxSati<sati){
					maxSati=sati;
					maxInd=i;
				}
			}
			ans[j]=maxInd;
			memo[maxInd-1].add(j+1);
			lastD[maxInd-1]=j+1;
			endSati+=maxSati;
			maxSati=-1000000;
			maxInd=-1;
		}
		long endTime=0;
		while(endTime-startTime<1800){
			int tmpd=rd.nextInt(d)+1;
			int tmpc=rc.nextInt(26)+1;
			int oldSati=endSati;
			endSati-=s[tmpd-1][ans[tmpd-1]-1];
			endSati+=s[tmpd-1][tmpc-1];
			endSati-=c[ans[tmpd-1]-1]*(tmpd-memo[ans[tmpd-1]-1].lower(tmpd))*(memo[ans[tmpd-1]-1].higher(tmpd)-tmpd);
			endSati+=c[tmpc-1]*(tmpd-memo[tmpc-1].lower(tmpd))*(memo[tmpc-1].higher(tmpd)-tmpd);
			if(oldSati<endSati){
				memo[ans[tmpd-1]-1].remove(tmpd);
				memo[tmpc-1].add(tmpd);
				ans[tmpd-1]=tmpc;
			}else{
				endSati=oldSati;
			}
			endTime = System.currentTimeMillis();
		}
		PrintWriter pw=new PrintWriter(System.out);
		for(int i:ans){
			pw.println(i);
		}
		pw.flush();
	}
	static int subSati(int d,int ii){
		int ret=0;
		for(int i=0; i<26; i++){
			if(i==ii) continue;
			ret+=c[i]*(d-lastD[i]);
		}
		return ret;
	}
}


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

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


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int n,m,f[200005],ans,h[200005];
int find(int x)
{
	if(f[x]==x) return x;
	return f[x]=find(f[x]);
}
void merge(int x,int y)
{
	int xx=find(x),yy=find(y);
	if(xx!=yy) f[xx]=yy;
}
signed main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++) f[i]=i;
	while(m--)
	{
		int a,b;
		cin>>a>>b;
		merge(a,b);
	}
	for(int i=1;i<=n;i++) int tmp=find(i);
	for(int i=1;i<=n;i++) h[f[i]]++;
	for(int i=1;i<=n;i++) ans=max(ans,h[i]);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 10424
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
  int n;
  cin >> n;
  if(n % 2 == 0){
    cout << "0.5" << endl;
  }else{
    printf("%.8f\n", (double)((double)((int)(n / 2) + 1) / (double)n));
  }
  return 0;
}

Measured memory_bytes: 256
text = input()
times = int(input())

for i in range(times):
    function = input().split()
    word = text[int(function[1]):int(function[2])+1]

    if function[0] == "print":
        print(word)

    elif function[0] == "reverse":
        word_reverse = word[::-1]
        text = text[:int(function[1])] + word_reverse + text[int(function[2])+1:]

    elif function[0] == "replace":
        text = text[:int(function[1])] + function[3] + text[int(function[2])+1:]

Measured memory_bytes: 7692
#include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;

int par[100008];

int ran[100008];

long long int find(long long int X) {
	if (par[X] == X)return X;
	else return par[X] = find(par[X]);
}

void unite(long long int X, long long int Y) {
	X = find(X);
	Y = find(Y);
	if (X == Y)return;

	if (ran[X] < ran[Y])par[X] = Y;
	else par[Y] = X;

	if (ran[X] == ran[Y])ran[X]++;
}

int main() {
	long long int N, M;
	cin >> N >> M;
	long long int P[100008];
	long long int a,b,c;
	for (long int i = 1; i <= N; i++) {
		cin >> P[i];
	}

	for (long int i = 1; i <= N; i++) {
		par[i] = i;
		ran[i] = 0;
	}


	for (int i = 0; i < M; i++) {
		cin >> a >> b;
		unite(a, b);
	}
	long long int Y = 0;
	for (long long int i = 1; i <= N; i++) {
		if (find(P[i]) == find(i))Y++;
	}

	cout << Y << endl;
	return 0;
}



Measured memory_bytes: 1792
#include <stdio.h>
int N,K,X,Y;
int main()
{
	scanf("%d",&N);
	scanf("%d",&K);
	scanf("%d",&X);
	scanf("%d",&Y);

	if (N<=K)
	{
		printf("%d",X*N);
	}
	else
	{
		printf ("%d",X*K+Y*(N-K));
	}
}

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

typedef long long int ll;
int main(){
    int N;
    cin >> N;
    int A[110];
    for(int i = 0;i < N;i++){
        cin >> A[i];
    }
    vector<bool> L(8,false);
    int C = 0;
    for(int i = 0;i < N;i++){
        if(A[i] >= 3200){
            C++;
        }else{
            L[A[i] / 400] = true;
        }
    }
    int ans = 0;
    for(int i = 0;i < 8;i++){
        if(L[i]){
            ans++;
        }
    }
    int M = ans + C;
    if(ans == 0){
        cout << 1 << " " <<  M << endl;
    }else{
        cout << ans << " " << M <<endl;
    }
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

const ll MOD = 1000000007;
const int MAX = 200001;
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void comb_init() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算 (combination. nCkを求める.)
ll comb(int n, int k) {
  if (n < k) {
    return 0;
  }
  if (n < 0 || k < 0) {
    return 0;
  }
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll H, W, A, B;

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

  cin >> H >> W >> A >> B;

  ll ans = 0;
  for (ll h = 0; h < H - A; h++) {
    ll w1 = B - 1;
    ll w2 = B;
    ll w_end = W - 1;
    ll h_end = H - 1;
    ans += comb(w1 + h, w1) * comb(h_end - h + w_end - w2, w_end - w2);
    ans %= MOD;
  }

  cout << ans << endl;
  return 0;
}

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

int main() {
  int64_t n = 0;
  int64_t ans = LLONG_MAX;
  cin >> n;
  int64_t s = sqrt(n);
  for(int64_t i = 1; i <= s; ++i) {
    if (n%i == 0) {
      ans = min(ans, n/i + i - 2);
    }
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

typedef int64_t ll; typedef vector<int> VI; typedef pair<int,int> pii;
const ll mod = 1e9+7;

void dbg(){ cerr << "\n"; }  
template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

int main()
{
 
	//cin.tie(0); ios_base::sync_with_stdio(false);
	ll x,y;
	cin >>x >>y;
	
	ll ans = 1;
	for(ll w=x; 2*w <= y; w*=2){
		ans++;
		
	}
	
	cout << ans <<"\n";
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

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

        int n = stdin.nextInt();
        int[] a = new int[n];
        int count = 0;
        boolean existOdd = false;

        for (int i = 0; i < n; i++)
            a[i] = stdin.nextInt();

        while (!existOdd) {
            for (int i = 0; i < n; i++) {
                if (a[i] % 2 == 1) {
                    existOdd = true;
                    break;
                }

                a[i] /= 2;
            }
            count++;
        }

        System.out.println(count - 1);
    }
}


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

void print(int a, int b){
	for (int i = 0; i < a; ++ i){
		printf("2 ");
	}
	for (int i = 0; i < b; ++ i){
		printf("3 ");
	}
	putchar('\n');
}

int main(){
	int n;
	scanf("%d", &n);
	if (n > 15000){
		int sz = n & 1 ? 14999 : 15000;
		for (int i = 1; i <= sz; ++ i){
			printf("%d ", i << 1);
		}
		for (int j = 0; j < n - sz; ++ j){
			printf("%d ", 6 * j + 3);
		}
		putchar('\n');
		return 0;
	}
	if (n == 3){
		printf("2 5 63\n");
		return 0;
	}
	for (int i = n - 2; ; i -= 2){
		if (i % 3 == 0 || (i + 1) % 3 == 0){
			for (int j = 1; j <= i; ++ j){
				printf("%d ", j << 1);
			}
			for (int j = 0; j < n - i; ++ j){
				printf("%d ", 6 * j + 3);
			}
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld long double
int main(){
	/*
	#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
	#endif
	*/
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int n,k; cin>>n>>k;
	int a[n];
	for(int i=0;i<n;i++) cin>>a[i];
	int dp[n];
	dp[n-1]=0;
	for(int i=n-2;i>=0;i--){
		dp[i]=INT_MAX;
		for(int j=1;j<=k && j+i<=n-1;j++){
			dp[i]=min(abs(a[i]-a[i+j])+dp[i+j], dp[i]);
		}
	}	
	cout<<dp[0];
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 2e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int x, a;
    cin >> x >> a;
    if (x < a) cout << 0 << endl;
    else cout << 10 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int A,B;
	scanf("%d %d",&A,&B);
	if(-100<=A<=100&&-100<=B<=100)
	{
		if((A+B)>=(A-B))
	    {
		 if((A+B)>=(A*B))
			printf("%d",A+B);
		 else
		 printf("%d",A*B);
	    }
	  else if((A-B)>(A*B))
      printf("%d",A-B);
	  else
      printf("%d",A*B);
	}
	else
	printf("error");
	return 0;
}

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

string s;
int ans = 700;

int main(){
    cin>>s;

    for (int i = 0; i < 3; i++)
    {
        if(s[i] == 'o') ans +=100;
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<map>
using namespace std;
int main() {
    int n, y; cin >> n >> y;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j <= n; ++j) {
            if (n - i - j < 0) continue;
            if (10000 * i + 5000 * j + (n - i - j) * 1000 == y) {
                cout << i << " " << j << " " << n - i - j << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
    return 0;
}



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

const double pi  = 2 * acos(0.0);
const double eps = 1e-8;

#define REP(i,a,b) for(int i=(a); i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<29)
#define INFLL (1LL<<62)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

vector<bool> used;
vector<vector<int>> G;
vector<int> path;

int main(void) {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int N, M; cin >> N >> M;
  G.assign(N, vector<int>());
  used.assign(N, false);

  int a, b;
  rep(i, M) {
    cin >> a >> b;
    a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  path.push_back(a);
  path.push_back(b);
  
  used[a] = used[b] = true;

  while (true) {
    int ep = path.back();
    bool ok = true;

    for (auto n : G[ep]) {
      if (used[n]) continue;
      path.push_back(n);
      used[n] = true;
      ok = false;
      break;
    }

    ep = path.front();
    for (auto n : G[ep]) {
      if (used[n]) continue;
      path.insert(path.begin(), n);
      used[n] = true;
      ok = false;
      break;
    }

    if (ok)
      break;
  }

  cout << path.size() << endl;
  rep(i, path.size()) {
    if (i) cout << " ";
    cout << path[i] + 1;
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 6904
function Main(_input) {
    var lines = _input.split("\n");
    var first = lines.shift().split(' ');
    var dai = first[0] * 1;
    var road = first[1] * 1;
    var heights = lines.shift().split(' ').map((item) => item*1);
    var r = Array(dai).fill(true);

    for (var i = 0; i < road; i++) {
        var s = lines[i].split(' ');
        var f = s[0]*1 - 1;
        var n = s[1]*1 - 1;

        if (heights[f] <= heights[n]) r[f] = false;
        if (heights[n] <= heights[f]) r[n] = false;
    }

    var count = 0;
    for (var i = 0; i < dai; i++) {
        if (r[i]) count++;
    }

    console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 55436
package main

import (
	"fmt"
)

type Coords struct {
	i, j int
}

var p [3001][3001]int
var q [3001][3001]Coords

func main() {
	var s, t string
	fmt.Scan(&s, &t)

	for i := 0; i < len(s); i++ {
		for j := 0; j < len(t); j++ {
			if s[i] == t[j] {
				p[i+1][j+1] = p[i][j] + 1
				q[i+1][j+1] = Coords{i, j}
			}
			if p[i+1][j+1] < p[i][j+1] {
				p[i+1][j+1] = p[i][j+1]
				q[i+1][j+1] = Coords{i, j + 1}
			}
			if p[i+1][j+1] < p[i+1][j] {
				p[i+1][j+1] = p[i+1][j]
				q[i+1][j+1] = Coords{i + 1, j}
			}
		}
	}

	result := ""
	x := Coords{len(s), len(t)}
	for p[x.i][x.j] > 0 {
		y := q[x.i][x.j]
		if p[x.i][x.j] != p[y.i][y.j] {
			result = s[x.i-1:x.i] + result
		}
		x = y
	}

	fmt.Println(result)
}


Measured memory_bytes: 216448
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
#include <iomanip>
#include <climits>
#include <utility>
#include <queue>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

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

ll fact(ll n)
{
    if (n == 0)
    {
        return 1;
    }
    if (n == 1)
    {
        return 1;
    }
    return n * fact(n - 1) % MOD;
}

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

    for (double i = 1; i < 50000; i++)
    {
        if (floor(i * 1.08) == N) {
            cout << i << endl;
            return 0;
        }
    }
    cout << ":(" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(void){
    string s; cin>>s;
    vector<bool> abc(3);
    rep(i,3){
        if(s.at(i)=='a')abc.at(0)=true;
        else if(s.at(i)=='b')abc.at(1)=true;
        else if(s.at(i)=='c')abc.at(2)=true;
    }
    cout<<(abc.at(0) and abc.at(1) and abc.at(2)?"Yes":"No")<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int x, y;
	scanf("%d", &x);
	scanf("%d", &y);
	if(2*x <= y && y <= 4*x && y%2 == 0){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 1664
import math
N = int(input())
M = math.ceil(math.sqrt(N))
#print(N, M)
for i in range(M):
    if N % (M - i) == 0:
        P = int(N / (M - i))
        Q = M - i
        break
#print(P, Q)
R = max(P, Q)
#print(R)
for i in range(10):
    R = R / 10
    if R < 1:
        print(i + 1)
        break


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

char s[1010000]; int n;

bool check(int len)
{
	int l = -len, r = 0;
	int type = 1;
	for(int i = n; i >= 1; i--)
	{
		if(s[i] == '0')
		{
			if(r + len == 0) return 0;
			else
			{
				r--;
				if(l + len == 0) l += type; l--;
			}
		}
		if(s[i] == '1')
		{
			if(l == 0) return 0;
			else
			{
				l++;
				if(r == 0) r -= type; r++;
			}
		}
		if(s[i] == '?')
		{
			if(l == r)
			{
				if(l == 0) l--, r--;
				else if(l + len == 0) l++, r++;
				else
				{
					type = 2;
					l--; r++;
				}
			}
			else
			{
				if(l + len == 0) l += type; l--;
				if(r == 0) r -= type; r++;
			}
		}
	}
	return 1;
}

int main()
{
	scanf("%s", s + 1);
	n = strlen(s + 1);
	int l = 1, r = n + 1;
	while(l < r)
	{
		int mid = l + r >> 1;
		if(check(mid)) r = mid;
		else l = mid + 1;
	}
	printf("%d\n", r);
}

Measured memory_bytes: 4808
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

M, D = MAP()
M2, D2 = MAP()

if M != M2:
    print(1)
else:
    print(0)


Measured memory_bytes: 3064