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

#define fastio                  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define input_output            freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); 

#define ll                      long long
#define read1(x)                 cin>>x
#define read2(x,y)               cin>>x>>y
#define print(x)				cout<<x<<endl
#define pii                     pair<int, int>
#define pli                     pair<ll, int>
#define pil                     pair<int, ll>
#define pll                     pair<ll, ll>
#define vi                      vector<int>
#define vll                     vector<ll>
#define vb                      vector<bool>
#define vd                      vector<double>
#define vs                      vector<string>
#define ff                      first
#define ss                      second
#define pb                      push_back
#define ppb                     pop_back
#define pf                      push_front
#define ppf                     pop_front
#define vpii                    vector<pii>
#define umap                    unordered_map
#define uset                    unordered_set
#define clr(a,b)                memset(a,b,sizeof a)
#define all(ds)                 ds.begin(), ds.end()
#define rev(ds)                 ds.rbegin(), ds.rend()
#define asc(A)                  sort(A.begin(), A.end())
#define dsc(A)                  sort(A.begin(), A.end(), greater<int>())
#define gcd(x,y)                __gcd(x,y)
#define clr(a,b)                memset(a,b,sizeof a)
#define fr(i, n)                for(int i=0; i<n;++i)
#define fr1(i, n)               for(int i=1; i<=n; ++i)
#define rfr(i, n)               for(int i=n-1; i>=0; --i)
#define printVector(v)          for(int i= 0;i<v.size();i++) {cout<<v[i]<<" ";} cout<<endl;
#define precise(x)              cout<<fixed<<setprecision(x)
#define inf                     10000000000000

 

ll lcm(ll a, ll b) {return (a*b)/__gcd(a, b); }
ll power(ll x, ll y, ll m) { if(!y) return 1; ll p=power(x, y>>1, m)%m; p=p*p%m; return (y&1)?(x*p)%m:p;}
ll modInverse(ll a, ll m){ return power(a, m-2, m); }
bool isPrime(ll num){bool flag=true;for(ll i =2;i<=num/2;i++){if(num%i==0) {flag=false; break;} }return flag;}
ll sumofdigits(ll n){ll c=0;while(n>0){c++;n/=10;}return c;}
bool sortinrev(const pair<int,int>&a,const pair<int,int>&b) {return a.first > b.first; }
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) {return a.second < b.second; }

//const double PI= 2*acos(0.0);
const long long MOD= 1000000007;



void solve(){
    int n, x, t;
    cin>>n>>x>>t;
    int mult = n%x == 0 ? n/x : (n/x) +1;
    ll ans = mult*t;
    cout<<ans<<endl;


}
int main()
{
#ifndef ONLINE_JUDGE  
    input_output  
#else   
    fastio
#endif

    int t =1 ;
    // cin>>t;
    while(t--){
        solve();
    }

    return 0;
}

Measured memory_bytes: 3652
#include<iostream>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<algorithm>
    #include<string>
    using namespace std;
    #define INF 10000000;
     
    int main() {
        int n,x,count = 0;
        cin >> n >> x;
        vector<int> m(n);
        for(int i=0;i<n;i++)cin >> m[i];
        sort(m.begin(),m.end());

        for(int i=0;i<n;i++){
            x -= m[i];
            count++;
            if(x<0)break;
        }
        while(x>=m[0]){
            x -= m[0];
            count++;
        }
        cout << count <<endl; 
    }

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

const int MAXN=2e5+5;
int n;
int a[MAXN];
char s[MAXN];

inline int chr_idx(char c){return c-'a';}

template<class T>
long long mge_sort(T a[],int l,int r){
	static T tmp[MAXN];
	if(l==r) return 0;
	int mid=l+r>>1;
	long long ret=mge_sort(a,l,mid)+mge_sort(a,mid+1,r);
	int lp=l,rp=mid+1,cur=l-1;
	while(lp<=mid && rp<=r){
		if(a[lp]<=a[rp]) tmp[++cur]=a[lp++];
		else{
			ret+=mid-lp+1;
			tmp[++cur]=a[rp++];
		}
	}
	while(lp<=mid) tmp[++cur]=a[lp++];
	while(rp<=r) tmp[++cur]=a[rp++];
	memcpy(a+l,tmp+l,(r-l+1)*sizeof(T));
	return ret;
}

inline void deal(){
	static int pos[26],pre[MAXN],nex[MAXN];
	static bool use[MAXN];
	for(int i=n;i;--i){
		nex[i]=pos[chr_idx(s[i])];
		pos[chr_idx(s[i])]=i;
	}
	memset(pos,0,sizeof(pos));
	for(int i=1;i<=n;++i){
		pre[i]=pos[chr_idx(s[i])];
		pos[chr_idx(s[i])]=i;
	}
	for(int i=1,x,y;i<=n;++i){
		if(use[i]) continue;
		x=i,y=pos[chr_idx(s[i])];
		while(y){
			a[n-x+1]=y;
			use[x]=true;
			x=nex[x],y=pre[y];
		}
	}
}

inline bool spj(){
	static int cnt[26];
	for(int i=1;i<=n;++i)
		++cnt[chr_idx(s[i])];
	int tot=0;
	for(int i=0;i<26;++i){
		if(cnt[i]&1) ++tot;
	}
	return tot==(n&1);
}

int main(){
	scanf("%s",s+1);
	n=strlen(s+1);
	if(!spj()){
		printf("-1");
		return 0;
	}
	deal();
	printf("%lld",mge_sort(a,1,n)>>1);
	return 0;
}

Measured memory_bytes: 3712
def main():
    n_ansl = [0]*(2*(10**5))
    for i in range(1,2*(10**5)):
    # for i in range(1,20):
        cnt = 0
        one_cnt = bin(i).count("1")
        rem = i
        while rem != 0:
            one_cnt = bin(rem).count("1")
            rem = rem%one_cnt   
            cnt += 1
        n_ansl[i] = cnt
 
    n = int(input())
    x = list(input())
    one_cnt = x.count('1')

    if one_cnt == 0:
        for i in range(n):
            print(1)
        exit()
    
    curr_2b_p = 1
    curr_2b_m = 1
    curr_sum_p1 = 0
    curr_sum_m1 = 0
    for i in range(n-1, -1, -1):
        if x[i] == '1':
            curr_sum_p1 += curr_2b_p
            curr_sum_m1 += curr_2b_m
            curr_sum_p1%=(one_cnt+1)
            if one_cnt > 1:
                curr_sum_m1%=(one_cnt-1)
        curr_2b_p*=2
        curr_2b_p%=(one_cnt+1)
        if one_cnt > 1:
            curr_2b_m*=2
            curr_2b_m%=(one_cnt-1)
 
        
 
    curr_2b_p = 1
    curr_2b_m = 1
    ansl = [0]*(n)
    for i in range(n-1, -1, -1):
        if x[i] == '1':
            diff = (-1)*curr_2b_m
            if one_cnt > 1:
                ans = (curr_sum_m1 + diff)%(one_cnt-1)
                ansl[i] = n_ansl[ans]+1
            else:
                ansl[i] = 0
        else:
            diff = curr_2b_p
            ans = (curr_sum_p1 + diff)%(one_cnt+1)
            ansl[i] = (n_ansl[ans]+1)
        curr_2b_p*=2
        curr_2b_p%=(one_cnt+1)
        if one_cnt > 1:
            curr_2b_m*=2
            curr_2b_m%=(one_cnt-1)
 
 
    # print(ansl)
    for a in ansl:
        print(a)
 
if __name__ == "__main__":
    main()

Measured memory_bytes: 87192
#include <cmath>
#include <iostream>
using namespace std;
int main(){
	int m, d;
	cin >> m >> d;
	int ans = 0;
	for(int i=1;i<=m;i++){
		for(int j=10;j<=d;j++){
			if(j % 10 >= 2 && j / 10 >= 2 && (j % 10) * (j / 10) == i){
				ans++;
			}
		}
	}
	cout << ans;
}

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

//.define
// #define FILE_IN_OUT
#define RET(_x)    return cout << (_x) << '\n', 0;
#define all(_obj)  (_obj).begin(), (_obj).end()
#define loop(_n)   for (int i = 0; i < (_n); ++i)
#define sz(_obj)   static_cast<int>((_obj).size())
#ifdef SHJ_LOCAL
#define debug(_x)  std::cerr << (#_x) << " = " << (_x) << '\n' << std::flush;
#else
#define debug(_x)  {}
#endif
#define endl "\n"
template<typename P, typename Q>
P CeilDiv(P _dividend, Q _divider) {
    return static_cast<P>((_dividend - 1LL + _divider) / _divider);
}
template<typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
    for (Tp current = _begin; current != _end; ++current) {
        std::cout << *current << _delim;
    }
    std::cout << '\n';
}

//.constant
using ll  = long long;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);

//.data

//.code
int main() {
#ifdef FILE_IN_OUT
    std::ifstream cin ("input.txt",  std::ios::in);
    std::ofstream cout("output.txt", std::ios::out);
#else
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif

    string s;
    cin >> s;
    int ans = 0;
    int cur = 0;
    for (int i = 0; i < 3; ++i) {
        if (s[i] == 'R') {
            ++cur;
        } else {
            ans = max(cur, ans);
            cur = 0;
        }
    }
    ans = max(cur, ans);
    cout << ans << endl;

#ifdef FILE_IN_OUT
    cin.close();
    cout.close();
#endif
    return 0;
}

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

using namespace std;

#define ll long long

void solve() {
    int n, x;
    cin >> n >> x;
    int a, ans = 0;
    for(int i=0; i<n; ++i){
        cin >> a;
        if(a>=x)
            ans++;
    }
    cout << ans;
}

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

    int t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }
}


Measured memory_bytes: 3588
import java.util.*; 
import java.math.BigDecimal;

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
  		BigDecimal a=sc.nextBigDecimal();
  		BigDecimal b=sc.nextBigDecimal();
  		BigDecimal c=a.multiply(b);
  		BigDecimal ans=c.setScale(0,BigDecimal.ROUND_DOWN);
  		System.out.println(ans);
    }
}

Measured memory_bytes: 37492
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
				Scanner scan = new Scanner(System.in);
				int n = scan.nextInt();
			
				int m = scan.nextInt();
				
				int sum = 0;
				
				sum+=1900*m+(n-m)*100;
				for(int i=0;i<m;i++)
				    sum*=2;

				
				
				System.out.println(sum);
	}

}


Measured memory_bytes: 23764
import heapq
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
a = list(map(lambda x: x*(-1), A)) 
heapq.heapify(a)
for i in range(M):
  mina = heapq.heappop(a)
  heapq.heappush(a, (-1)*(-mina//2))
print(-sum(a))
  

Measured memory_bytes: 14180
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		FastScanner sc=new FastScanner();
		String s=sc.next();
		String t=sc.next();
		int n=s.length();
		long ans=0;
		for(int i=0;i<n;i++){
		    if(s.charAt(i)!=t.charAt(i))
		    ans++;
		}
		System.out.println(ans);
		
	}
		static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
}
}


Measured memory_bytes: 30776
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;

const int N = 2e5 + 5;
const int Mod = 1e9 + 7;

int n;
int a[N];

int main()
{
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0, sum = 0;
  for(int i = n - 1; i >= 0; i--) {
    ans = (ans + 1LL * a[i] * sum % Mod) % Mod;
    sum = (sum + a[i]) % Mod;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4412
#include<cstdio>
int n,k,m,j,p,i;long long f[333][333][333];main(){scanf("%d%d%d",&n,&k,&m);for(f[i=0][1][0]=1;i<=n;++i)for(j=1;j<=k;++j)for(p=i;~p;--p)
(f[i+1][j][p]+=f[i][j][p]*(p+1))%=m,((p?f[i][j][p-1]:f[i][j+1][i])+=f[i][j][p])%=m;printf("%d",f[n][k+1][n]);}

Measured memory_bytes: 262144
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
typedef pair<LL, LL> P;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)      (x).begin(),(x).end()
# define UNIQ(c)     (c).erase(unique(ALL((c))),(c).end())
# define mp          make_pair
# define eb          emplace_back
# define FOR(i,a,b)  for(int i=(a);i<(b);i++)
# define RFOR(i,a,b) for(int i=(a);i>=(b);i--)
# define REP(i,n)    FOR(i,0,n)
# define INIT        std::ios::sync_with_stdio(false);std::cin.tie(0)

LL n, a, b;

int main() {
	cin >> n >> a >> b;
	if ((a + b) % 2) {
		cout << "Borys" << endl;
	}
	else {
		cout << "Alice" << endl;
	}
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
        int c = sc.nextInt();
        int d = Math.max(a,Math.max(b,c));
		System.out.println(a+b+c-d);
	}
}


Measured memory_bytes: 23124
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    boolean flg = true;
    ArrayList<List<Integer>> list = new ArrayList<>();
    while(flg) {
      int h = sc.nextInt();
      int w = sc.nextInt();

      if(h == 0 && w == 0) {
        flg = false;
        sc.close();
        break;
      }
      List<Integer> data = new ArrayList<Integer>();
      data.add(h);
      data.add(w);
      list.add(data);

    }

    for(int i = 0; i < list.size(); i++) {
      int h = list.get(i).get(0);
      int w = list.get(i).get(1);
      for(int j = 0; j < h; j++) {
        for(int k = 0; k < w; k++) {
          System.out.print('#');
        }
        System.out.print('\n');
      }
        System.out.print('\n');
    }
  }
}


Measured memory_bytes: 40084
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <cstdlib>

using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pi;

const ll MOD = 1e9+7;

static long gcd(long a, long b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}
/*
long long int facctorialMethod(int k){//階乗
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}*/

long long int tousasum(long long int n){//等差数列
    return n*(n+1)/2;
}

unsigned GetDigit(unsigned num){//桁数
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

bool IsPrime(int num)//素数判定
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

map< ll, ll > prime_factor(ll n) {//素因数分解
    map< ll, ll > ret;
    for(ll i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if(n != 1) ret[n] = 1;
    return ret;
}

ll calcNumOfCombination(ll n, ll r){
    ll num = 1;
    for(ll i = 1; i <= r; i++){
        num = num * (n - i + 1) / i;
    }
    return num;
}

int bubblesort(vector<int> array,int size){//バブルソート　転倒数
    int kaisu = 0;
    for(int i = 0; i < size; i++){
        for(int j = i + 1; j < size; j++){
            if(array[i] > array[j]){
                int number = array[i];
                array[i] = array[j];
                array[j] = number;
                kaisu++;
            }
        }
    }
    return kaisu;
}

ll facctorialMethod(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum = (sum * i)%MOD;
    }
    return sum;
}

int main() {
    ll N,M;
    cin >> N >> M;
    ll p[M],y[M];
    vector<ll> list[100001];

    for(int i=0;i<M;i++){
        cin >> p[i] >> y[i];
        list[p[i]].push_back(y[i]);
    }

    for(int i=0;i<=N;i++){

            sort((list[i]).begin(),(list[i]).end());



    }


    for(int i=0;i<M;i++){
        auto it = lower_bound(list[p[i]].begin(), list[p[i]].end(), y[i]);

        int index = it - list[p[i]].begin();

        printf("%06lld",p[i]);
        printf("%06lld\n",index+1);
    }

}






Measured memory_bytes: 9344
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using St = string;
#define chmax(x, y) { x = max(x, y); }
#define chmin(x, y) { x = min(x, y); }

int main() {
    St s;
    cin >> s;
    int size = s.size();
    int sum = 0;
    rep(i, size){
        sum += s.at(i) - '0';
    }
    if(sum % 9 == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3700
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int rec[123456];
ll fc[123456]={1ll},nv[123456]={1ll};

ll rwpw(ll a, ll p){
	ll ret = 1ll;
	while(p){
		if(p%2){
			mul_mod(ret,a);
		}
		mul_mod(a,a);
		p /= 2;
	}
	return ret;
}

ll c(int n, int k){
	ll ret = fc[n];
	if(n<k){
		return 0ll;
	}
	mul_mod(ret,nv[k]);
	mul_mod(ret,nv[n-k]);
	return ret;
}

int main(void){
	int n,i,a,p,q;
	ll ans;
	fill(rec,rec+123456,-1);
	cin >> n;
	for(i=0; i<=n; ++i){
		fc[i+1] = fc[i]*(i+1)%MOD;
		nv[i+1] = rwpw(fc[i+1],MOD-2);
		cin >> a;
		if(rec[a]<0){
			rec[a] = i;
		}else{
			p = rec[a];
			q = n - i;
		}
	}
	fc[n+1] = fc[n]*(n+1)%MOD;
	nv[n+1] = rwpw(fc[n+1],MOD-2);
	for(i=1; i<=(n+1); ++i){
		ans = c(n+1,i);
		add_mod(ans,MOD-c(p+q,i-1));
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 3200
from itertools import product
import time
def ok(s):
    if '(+' in s or '(-' in s or '(*' in s or '++' in s or '+-' in s or '-+' in s \
    or '--' in s or '**' in s or '*+' in s or '*-' in s:
        return False
    if '(' in s or ')' in s:
        dic={}
        count=-1
        for c in s:
            if c=='(':
                count+=1
                dic[count]=0
            elif c==')':
                if dic[count]==0:
                    return False
                count-=1
            elif c in '+-*' and count in dic:
                dic[count]+=1
        return True
    else:
        return True

def check(s):
    i=0
    ans=''
    tmp=[]
    try:
        while i<len(s):
            if s[i] in '01':
                tmp.append(s[i])
            else:
                if len(tmp):
                    t=''.join(tmp)
                    t=str(int(t,2))
                    if int(t)>=1024:
                        return -99999999
                    ans+=t
                ans+=s[i]
                tmp=[]
            i+=1
        if len(tmp):
            t=''.join(tmp)
            t=str(int(t,2))
            ans+=t
    except:
        return -99999999
    try:
        if ok(ans):
            xxx=eval(ans)
            if '-' not in ans and xxx<1024:
                return xxx
            elif '-' in ans and xxx<1024:
                for i in range(len(ans)):
                    if ans[i]=='-':
                        mid=i
                        r,l=mid-1,mid+1
                        count=0
                        while r>=0:
                            if ans[r]==')':
                                count+=1
                            elif ans[r]=='(':
                                count-=1
                                if count<0:
                                    r+=1
                                    break
                            if count==0 and ans[r] in '+-':
                                r+=1
                                break
                            r-=1
                        r=max(r,0)
                        count=0
                        while l<len(ans):
                            if ans[l]=='(':
                                count+=1
                            elif ans[l]==')':
                                count-=1
                                if count<0:
                                    break
                            if count==0 and ans[l] in '+-':
                                break
                            l+=1
                        a,b=eval(ans[r:mid]),eval(ans[mid+1:l])
                        if a>=1024 or b>=1024 or \
                        a - b <0:
                            return -99999999
                return xxx
            else:
                return -99999999
        else:
            return -99999999
    except:
        return -99999999

s=input().split('.')
mx=-1
hoge = product('01+-*()', repeat=len(s)-1)
for table in hoge:
    tmp=s[0]
    i=1
    for c in table:
        tmp+=c+s[i]
        i+=1
    mx=max(mx,check(tmp))
print(mx)



Measured memory_bytes: 5728
import java.util.Scanner;


public class Main {
	static int A,B;
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		 A = sc.nextInt();
		 B = sc.nextInt();
		 sc.close();


		 int ans = 0 ;

		 for(int i = 0 ; i < A+1 ; i++){
			 for(int j = 0 ; j < A+1 ; j++){
					 if(B-i-j<=A && B-i-j>=0){
						 ans+=1;
				 }
			 }
		 }

		 System.out.println(ans);
	}
}


Measured memory_bytes: 22996
n,t=map(int,input().split())
a=list(map(int,input().split()))
saisyo=a[0]
saidai=0
count=0
for i in range(n):
    if a[i]<saisyo:saisyo=a[i]
    else:
        if a[i]-saisyo>saidai:
            saidai=a[i]-saisyo
            count=1
        elif a[i]-saisyo==saidai:
            count+=1
print(count)

Measured memory_bytes: 14292
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
const int INF (1<<30);

int getN(int n) {
  int res = 1;
  while (res < n) res *= 2;
  return res;
}

void update(int idx, char val, vector<vector<int>> &dat, int N) {
  idx += N - 1;
  dat[idx][val-'a']++;
  while (idx > 0) {
    idx = (idx - 1) / 2;
    dat[idx][val-'a']++;
  }
}
void erase(int idx, char val, vector<vector<int>> &dat, int N) {
  idx += N - 1;
  if (dat[idx][val-'a'] > 0) dat[idx][val-'a']--;
  while (idx > 0) {
    idx = (idx - 1) / 2;
    if (dat[idx][val-'a'] > 0) dat[idx][val-'a']--;
  }
}

void getSet(int queryL, int queryR, int tmpIdx, int tmpL, int tmpR, vector<vector<int>> &dat, set<char> &st) {
  if (tmpR <= queryL || queryR <= tmpL) return;
  
  if (queryL <= tmpL && tmpR <= queryR) {
    rep(i, 26) {
      if (dat[tmpIdx][i] > 0) st.insert(i+'a');
    }
    return;
  }

  getSet(queryL, queryR, tmpIdx*2 + 1, tmpL, (tmpL+tmpR)/2, dat, st);
  getSet(queryL, queryR, tmpIdx*2 + 2, (tmpL+tmpR)/2, tmpR, dat, st);
  return;
}

int main() {
  int N, Q;
  string S;
  cin >> N >> S >> Q;

  N = getN(N);
  vector<vector<int>> dat(2*N-1, vector<int>(26,0));

  rep(i,S.length()) {
    update(i, S[i], dat, N);
  }


  vector<int> ans;
  rep(i, Q) {
    int a;
    cin >> a;
    if (a == 1) {
      int i;
      char c;
      cin >> i >> c;
      i--;
      erase(i, S[i], dat, N);
      S[i] = c;
      update(i, S[i], dat, N);
    }
    else {
      int l, r;
      cin >> l >> r;
      l--;
      r--;
      set<char> st;
      getSet(l, r+1, 0, 0, N, dat, st);
      ans.push_back(st.size());
    }
  }

  for (auto x : ans) {
    cout << x << endl;
  }

  return 0;
}


Measured memory_bytes: 142084
#include <bits/stdc++.h>
#define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) range(i,0,n)
using namespace std;

int main(void){
	string s;
	getline(cin,s);
	vector<string> ans;
	string cur="";
	rep(i,s.size()){
		if(s[i]==' '||s[i]==','||s[i]=='.'){
			int m=cur.size();
			if(3<=m&&m<=6) ans.push_back(cur);
			cur="";
		}else
			cur+=s[i];
	}
	rep(i,ans.size()){
		cout << (i?" ":"") << ans[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 1184
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
// template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }


int main() {
    int n;
    cin >> n;
    
    int dp[10007] = {0};
    rep(i, n) {
        int s;
        cin >> s;
        for (int j = 10007; j >= 0; --j) {
            if (dp[j] == 0) continue;
            dp[j + s] = 1;
        }
        dp[s] = 1;
    }
    
    for (int i = 10007; i >= 0; --i) {
        if (dp[i] != 0 && i % 10 != 0) {
            cout << i << endl;
            return 0;
        }
    }
    cout << 0 << endl;
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <cassert>
#include <iomanip>
#include <chrono>

using namespace std;

class

BTaxRate {
public:

    void solve(std::istream &in, std::ostream &out) {
        int N;
        in >> N;

        int price = 1.0 * N / 1.08;
        if (int(price * 1.08) == N) {
            out << price << endl;
        } else if (int((price + 1) * 1.08) == N) {
            out << price + 1 << endl;
        } else {
            out << ":(" << endl;
        }
    }

};


int main() {
    BTaxRate solver;
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    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;
    }
}
ll COM(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 gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N=in();
    int A=in();
    cout<<N*N-A<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		for(int i=0; i<S.length(); i++) {
			boolean a = true;
			if((i+1)%2 ==0) {
				a = even(S.substring(i,i+1));
			} else {
				a = odd(S.substring(i,i+1));
			}
			if(!a) {
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
	private static boolean odd(String a) {
		switch(a) {
		case "R":
		case "U":
		case "D":
			return true;
		default :
			return false;
		}
	}
	private static boolean even(String a) {
		switch(a) {
		case "L":
		case "U":
		case "D":
			return true;
		default :
			return false;
		}
	}
}

Measured memory_bytes: 26816
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

struct node {
  int key;
  struct node *right;
  struct node *left;
  struct node *parent;
};

typedef struct node* Nodepointer;
Nodepointer nil, root;

Nodepointer treeMinimum(Nodepointer x){
  while( x->left != nil ) x = x->left;
  return x;
}

Nodepointer find(Nodepointer u, int k){
  while( u != nil && k != u->key ){
    if( k < u->key ) u = u->left;
    else u = u->right;
  }
  return u;
}

Nodepointer treeSuccessor(Nodepointer x){
  if( x->right != nil ) return treeMinimum(x->right);
  Nodepointer y = x->parent;
  while( y != nil && x == y->right ){
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Nodepointer z){
  Nodepointer y;
  Nodepointer x;

  if( z->left == nil || z->right == nil ) y = z;
  else y = treeSuccessor(z);

  if( y->left != nil ) x = y->left;
  else x = y->right;

  if( x != nil ) x->parent = y->parent;
  if( y->parent ==nil ) root = x;
  else {
    if( y == y->parent->left) y->parent->left = x;
    else y->parent->right = x;
  }

  if( y != z ){
    z->key = y->key;
  }

  free(y);
}

void insert(int k){
  Nodepointer x, y, z;
  y = nil;
  x = root;

  z = (Nodepointer)malloc(sizeof(struct node));
  z->key = k;
  z->left = nil;
  z->right = nil;
  
  while( x != nil ){
    y = x;
    if( z->key < x->key ) x = x->left;
    else x = x->right;
  }
  z->parent = y;

  if( y == nil ) root = z;
  else if( z->key < y->key ) y->left = z;
  else y->right = z;
}

void inorder(Nodepointer u){
  if( u == nil ) return;
  inorder(u->left);
  printf(" %d", u->key);
  inorder(u->right);
}

void preorder(Nodepointer u){
  if( u == nil ) return;
  printf(" %d", u->key);
  preorder(u->left);
  preorder(u->right);
}

int main(){
  int n, i, x;
  char com[7];

  scanf("%d", &n);

  for( i = 0 ; i < n ; i++ ){
    scanf("%s",com);
    if( com[0] == 'f' ){
      scanf("%d", &x);
      Nodepointer t = find(root, x);
      if( t != nil ) printf("yes\n");
      else printf("no\n");
    }
    else if( strcmp("insert",com) == 0 ){
      scanf("%d", &x);
      insert(x);
    }
    else if( strcmp("print",com) == 0 ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
    else if( strcmp("delete", com) == 0 ){
      scanf("%d", &x);
      treeDelete(find(root, x));
    }
  }
  return 0;

}



Measured memory_bytes: 20444
from bisect import bisect_left
from itertools import accumulate

N,M = map(int,input().split())
A = sorted([int(i) for i in input().split()])

# 判定
def is_under_M(x:int):
    cnt = 0
    for i in range(N):
        # 幸福度x以上の個数を求める
        pos = bisect_left(A, x - A[i])
        cnt += N - pos
    return cnt < M

# 二分探索
ng, ok = 0, 2*(10**5)+1
while ok - ng > 1:
    mid = (ok + ng) // 2
    if is_under_M(mid):
        ok = mid
    else:
        ng = mid
# ng, ok = X-1, X

# Aの累積和
Aacum = tuple(accumulate([0] + A))

ans = 0
for i in range(N):
    # 幸福度ok以上の個数を求める
    pos = bisect_left(A, ok - A[i])
    cnt = N - pos

    ans += cnt * A[i] + (Aacum[N] - Aacum[pos])
    M -= cnt

ans += M * ng

print(ans)

Measured memory_bytes: 13920
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 10;
ll a[maxn], sum[maxn], dp[maxn];
int main()
{
    ll n;
    cin >> n;
    for(ll i = 1; i <= n; i++)cin >> a[i];
    for(int i = 1; i <= n; i++)
    {
        sum[i] = sum[i - 1] + a[i];
        dp[i] = dp[i - 1] ^ a[i];
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++)
    {
        int l = i, r = n, tot;
        while(l <= r)
        {
            int mid = (l + r) / 2;
            if(sum[mid] - sum[i - 1] == (dp[mid] ^ dp[i - 1]))
            {
                tot = mid;
                l = mid + 1;
            }
            else r = mid - 1;
        }
        ans += tot - i + 1;
    }

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


Measured memory_bytes: 9984
package main

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

var sc = bufio.NewScanner(os.Stdin)

func contains(target int, list []int) bool {
	for _, r := range list {
		if target == r {
			return true
		}
	}
	return false
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()

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

	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextF64() float64 {
	sc.Scan()

	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}

func isInteger(x float64) bool {
	return math.Floor(x) == x
}

func Ave(s []int) int {
	val := 0
	for _, i := range s {
		val += i
	}
	return int(val / len(s))
}
func cal(i int) (sum int) {
	for i != 0 {
		sum += i % 10
		i /= 10
	}
	return
}
func max(a []int) (idx int, val int) {
	max := a[0]
	idx = 0
	for j, i := range a {
		if max < i {
			max = i
			idx = j
		}
	}
	return idx, max
}

func draw(i int, a []int) (l []int) {
	// p = a[i]
	for j := i; j < len(a); j++ {
		if j != len(a)-1 {
			a[j] = a[j+1]
		} else if j == len(a)-1 {
			a = a[:len(a)-1]
		}
	}
	return a
}
func abs(i int64) int64 {
	if i < 0 {
		return -i
	}
	return i
}

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

func main() {
	sc.Split(bufio.ScanWords)
	// sc.Buffer([]byte{}, math.MaxInt64)
	// a := make([][]int, 3)
	// for i := 0; i < 3; i++ {
	// 	a[i] = make([]int, 3)
	// }
	// for i := 0; i < 3; i++ {
	// 	for j := 0; j < 3; j++ {
	// 		a[i][j] = nextInt()
	// 	}
	// }
	n := nextInt()
	d := nextInt()
	x := nextInt()

	var a []int
	var cnt int
	for i := 0; i < n; i++ {
		a = append(a, nextInt())
	}

	for _, val := range a {
		for i := 1; i <= d; i += val {
			cnt++
		}
	}
	fmt.Println(cnt + x)
}


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

int main() {
  int N;
  cin >> N;
  int S = 0;
  
  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    S += r - l + 1;
  }
  cout << S << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
int unx(){int x=0,n=0; char c=getchar(); for(;!isdigit(c);c=getchar()) n=(c=='-'); for(;isdigit(c);c=getchar())x=x*10+c-'0'; return (n)?-x:x;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l,int r){}
#define in unx()
#define fasty ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define forinc(a,b,c) for(int a=b, _c=c; a<=_c; ++a)
#define fordec(a,b,c) for(int a=b, _c=c; a>=_c; --a)
#define forv(a,b) for(auto &a:b)
#define ii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(),a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define mt make_tuple
#define bit(x,i) (x>>(i-1)&1ll)
#define onbit(x,i) (x|(1ll<<(i-1)))
#define offbit(x,i) (x&~(1ll<<(i-1)))

const int N=105;
int a[N][N], d[N];
int dd[N];

main(){
  fasty;

  int n,k;
  cin>>n>>k;
  forinc(i,1,k){
    cin>>d[i];
    forinc(j,1,d[i]) {
      int x;
      cin>>x;
      dd[x]=1;
    }
  }
  cout<<count(dd+1,dd+n+1,0);
}


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

int main(){
  int a, b;
  
  cin >> a >> b;
  
  if(a >= 13){
    cout << b << endl;
  }
  if((a >= 6) && (a <= 12)){
    cout << b / 2 << endl;
  }
  if(a <= 5){
    cout << 0 << endl;
  }
}

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

int main(){
  int w, a, b;
  cin >> w >> a >> b;
  if(a > b) swap(a,b);
  cout << max(0,b-a-w) << endl;
  return 0;
}

Measured memory_bytes: 256
import sys
from time import time
from random import randrange
from bisect import bisect_left

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 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

def deepcopy(li): return [x[:] for x in li]

def get_sum(a, d, n):
    """ 等差数列の和：(初項a, 公差d, 項数n) """
    return (2*a + (n-1)*d) * n // 2

TL = 1.8
start = time()

D = INT()
M = 26
C = LIST()
S = [[]] * (D+1)
S[0] = [0] * M
for i in range(1, D+1):
    S[i]  = LIST()

def check(T):
    score = 0
    for a in range(M):
        for i in range(1, len(adjli[a])):
            curd = adjli[a][i-1]
            nxtd = adjli[a][i]
            cnt = nxtd - curd
            score += S[curd][a]
            score -= C[a] * get_sum(0, 1, cnt)
    return score

# 初期状態をランダムで作成
last = [0] * M
T = [0] + [randrange(0, M) for i in range(D)]
adjli = [[0] for i in range(M)]
for d, t in enumerate(T[1:], 1):
    adjli[t].append(d)
for i in range(M):
    adjli[i].append(D+1)
score = check(T)

# day日目のコンテストをaからbに変更する
def change(day, a, b):
    res = 0
    # コンテストaのコストを再計算
    res -= S[day][a]
    di = adjli[a].index(day)
    for i in range(di, di+2):
        curd = adjli[a][i-1]
        nxtd = adjli[a][i]
        cnt = nxtd - curd
        res += C[a] * get_sum(0, 1, cnt)
    adjli[a].pop(di)
    curd = adjli[a][di-1]
    nxtd = adjli[a][di]
    cnt = nxtd - curd
    res -= C[a] * get_sum(0, 1, cnt)

    # コンテストbのコストを再計算
    res += S[day][b]
    di = bisect_left(adjli[b], day)
    curd = adjli[b][di-1]
    nxtd = adjli[b][di]
    cnt = nxtd - curd
    res += C[b] * get_sum(0, 1, cnt)
    adjli[b].insert(di, day)
    for i in range(di, di+2):
        curd = adjli[b][i-1]
        nxtd = adjli[b][i]
        cnt = nxtd - curd
        res -= C[b] * get_sum(0, 1, cnt)

    return res

# 時間ギリギリまでランダムな交換を試す
while time() - start < TL:
    d, q = randrange(1, D+1), randrange(0, M)
    if T[d] == q:
        continue

    tmp = deepcopy(adjli)
    res = change(d, T[d], q)
    # 結果がよければ適用
    if res > 0:
        score += res
        T[d] = q
    # 悪ければ状態を戻す
    else:
        adjli = tmp

for t in T[1:]:
    print(t+1)


Measured memory_bytes: 94028
#include <bits/stdc++.h>
#define mod 1000000007
 
using namespace std;
 
int main(){
  int64_t i,K,N;
  cin >> N >> K;
  int64_t diff;
  diff = N%K;
  int64_t mi;
  mi = min(K-diff, diff);
  cout << mi;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,d,cnt=0;
	cin >> n >> m >> d;
	for(int i=n;i<=m;i++){
		if(i%d==0) cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 3632
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int ans = 0;
		int n = (int) Math.floor(Math.log10(N));
		int na = 0, nc = N;
		while (nc > 0) {
			na = nc;
			nc /= 10;
		}
		for (int i = 1; i <= N; i++) {
			int b = i % 10;
			if (b == 0)
				continue;
			int c = i;
			int a = 0;
			while (c > 0) {
				a = c;
				c /= 10;
			}
			if (a == b)
				ans++;
			for (int j = 1; j < n; j++) {
				ans += Math.pow(10, j - 1);
			}
			if (b < na) {
				ans += Math.pow(10, n - 1);
			} else if (b == na) {
				int buf = b * (int)Math.pow(10, n) + a;
				int v = N-buf;
				if(v < 0)continue;
				v /=10;
				ans += v+1;
			}
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 22228
#include<bits/stdc++.h>
using namespace std;
long double X[200100];
int N;
long long Count(long double len)
{
  long long Ans=0;
  for(int i=0;i<N;i++)
  {
    Ans+=(long long)(X[i]/len);
    //Ans+= (ceil(X[i])-1/len);
  }
  return Ans;
}
int main()
{
  long long K;
  cin>>N>>K;
  for(int i=0;i<N;i++)
{
	cin>>X[i];
	//X[i]-=0.1;
}
  long double l=1,r=1e9;
  //while(l<r-0.1)//なぜかOK
	//for(int i=0;i<35;i++)//OK log2(10^9)
  //while(((long long)(r)-(long long)(l)) > 1)
  //while(!((ceil(r)-ceil(l)) == 0))//https://atcoder.jp/contests/abc174/submissions/15672399
  while(!((floor(r)-floor(l)) == 0))//https://atcoder.jp/contests/abc174/submissions/15672399
  {
    //long double mid=(l+r+0.1)/2;
    long double mid=(l+r)/2;
  //  cout<<l<<" "<<r<<" "<<mid<<endl;
    if(Count(mid)<=K) r=mid;
    else	l=mid;
    //else	l=mid+0.01;
  }
  cout<<(long long)(l+0.999)<<endl;
  return 0;
}

Measured memory_bytes: 6736
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>
#include <bitset>
#include <sstream>
#include <cassert>
#include <time.h>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}
void printvec (vec &v) {
    Rep (i, (ll)v.size()) {
        cout << v[i] << " \n"[i+1 == (ll)v.size()];
    }
}

struct UnionFind {
    vector<ll> par;
    vec siz;

    UnionFind(ll N) : par(N), siz(N, 1) {
        Rep (i, N) {
            par[i] = i;
        }
    }

    ll root (ll x) {
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite (ll x, ll y) {
        ll rx = root(x);
        ll ry = root(y);
        if (rx == ry) return;
        if (siz[rx] < siz[ry]) swap(rx, ry);
        siz[rx] += siz[ry];
        par[ry] = rx;
    }

    bool same (ll x, ll y) {
        ll rx = root(x);
        ll ry = root(y);
        return rx == ry;
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

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

    ll N, M;
    cin >> N >> M;

    UnionFind uf(N);
    while (M--) {
        ll a, b;
        cin >> a >> b;
        a--; b--;
        uf.unite(a, b);
    }

    ll ans = 1;
    Rep (i, N) {
        chmax(ans, uf.size(i));
    }

    cout << ans << endl;
}

Measured memory_bytes: 6364
N = int(input().rstrip())
P = map(int, input().rstrip().split())
Q = map(int, input().rstrip().split())

import itertools
l = list(itertools.permutations(list(range(1, N+1))))
a = l.index(tuple(P))
b = l.index(tuple(Q))
print(abs(a-b))



Measured memory_bytes: 8052
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val a, b = sc.nextInt()
  println(calcArea(a, b) + " " + calcCircumference(a, b))

  def calcArea(a: Int, b: Int): Int = a * b
  def calcCircumference(a: Int, b: Int): Int = a * 2 + b * 2
}

Measured memory_bytes: 44812
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define SZ(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef double db;
typedef pair <int, int> Pii;
typedef pair <ll, int> Pli;
typedef unsigned long long ull;
const double eps = 1e-8;
const int mod = (int)(1e9) + 7;
const int inf = 0x7fffffff;
const int N = (int)(2e5) + 7;

int n;
ll a[N], b[3];

int main() {

    // freopen("in.in", "r", stdin);
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);    
    int res = 0;
    for (int i = 1; i <= n; ++i) {
        for (int j = i + 1; j <= n; ++j) {
            for (int k = j + 1; k <= n; ++k) {
                b[0] = a[i], b[1] = a[j], b[2] = a[k];
                sort(b, b + 3);
                if (b[0] == b[1] || b[1] == b[2]) continue;
                if (b[0] + b[1] > b[2]) ++res;
            }
        }
    }
    printf("%d\n", res);

    return 0;
}

Measured memory_bytes: 3816
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

prev = -1
ans = 0
for a in A:
    ans += B[a - 1]
    if prev == a -  1:
        ans += C[a - 2]
    prev = a
print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<deque>
#include<map>
using namespace std;
typedef long long ll;

int main() {
    int n; cin >> n;
	vector<vector<pair<int, int>>> xy(n);
	for (int i = 0; i < n; i++)
	{
		int a; cin >> a;
		for (int j = 0; j < a; j++)
		{
			int X, Y; cin >> X >> Y;
			X--;
			xy[i].emplace_back(X, Y);
        }
	}

    int ans = 0;
    for (int bit = 0; bit < (1<<n); bit++)
    {
        int tmp = 0;
        bool ok = true;
        for (int i = 0; i < n; i++)
        {
            if (bit&(1<<i)) {
                tmp++;
                for (auto v: xy[i]) {
                    if (v.second == 1 && !(bit&(1<<v.first))) ok = false;
                    if (v.second == 0 && (bit&(1<<v.first))) ok = false;
                }
            }           
        }
        if (ok) ans = max(ans, tmp);
    }
    cout << ans << endl;
	
    return 0;
}


Measured memory_bytes: 256
n1 = int(input())
li1 = list(input() for i in range(n1))
n2 = int(input())
li2 = list(input() for i in range(n2))

prof = []
for i in range(n1):
    if li1[i] in li2:
        prof.append(li1.count(li1[i]) - li2.count(li1[i]))
    elif li1[i] not in li2:
        prof.append(li1.count(li1[i]))
#print(prof)
if max(prof)>0:
    print(max(prof))
else:
    print(0)

Measured memory_bytes: 3064
import java.util.*;
 
public class Main {  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] a = new int[N];
    int total =0, ans =0;
    for (int i =0; i<N; i++) {
      a[i] = sc.nextInt();
      total += a[i];
    }
    long ave = Math.round((double)total / N);
    for (int i =0; i<N; i++) {
      ans += (a[i] - ave) * (a[i] - ave);
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 21332
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
  char a[27];
  scanf("%s",a);
  qsort(a,strlen(a),sizeof(char),strcmp);
  int f=0;
  for(int i=0;i<strlen(a)-1;i++)if(a[i]==a[i+1])f=1;
  puts(f==0?"yes":"no");
  return 0;
}

Measured memory_bytes: 128
first = "1:"
second = "2:"
third = "3:"
fourth = "4:"
fifth = "5:"
sixth = "6:"

n = gets.to_i
n.times do
  height = gets.to_f
  if height < 165.0
  	first += "*"
  elsif height < 170.0
  	second += "*"
  elsif height < 175.0
  	third += "*"
  elsif height < 180.0
  	fourth += "*"
  elsif height < 185.0
  	fifth += "*"
  else
  	sixth += "*"
  end
end

puts first, second, third, fourth, fifth, sixth

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


int cmp(long long int a,long long int b)
{
    return a>b;
}

int main()
{
   long long int s[200005];
   int N,K;
   cin>>N>>K;
   for(int i=0;i<N;i++)
   {
       cin>>s[i];
   }
   sort(s,s+N,cmp);
   long long int sum=0;
   for(int i=K;i<N;i++)
   {
       sum+=s[i];
   }
   cout<<sum;
}


Measured memory_bytes: 1792
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()

n = int(input())
a = list(map(int,input().split()))

count = 0

while True:
    for _ in range(n):
        if a[_]%2==0:
            a[_]//=2
        else:
            break
    else:
        count+=1
        continue
    break
print(count)



Measured memory_bytes: 3316