akhauriyash/Code-Regression huggingface dataset:
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;

typedef long long ll;
//typedef pair<int,int> Pint;
//typedef pair<ll, ll> P;
//typedef pair<ll, pair<ll, ll>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
ll INFL = 1LL << 60;//10^18 = 2^60
int INF = 1 << 30;//10^9
ll MOD = 1e9 + 7;
//ll MOD  = 998244353;
vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};

ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}

ll pow_mod(ll x, ll k){
  x %= MOD; x += MOD; x %= MOD;
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}
ll inverse(ll x){return pow_mod(x, MOD - 2);};

ll gcd(ll a, ll b){
    if(b == 0) return a;
    return gcd(b, a % b);
}
ll lcm(ll x, ll y){return x / gcd(x, y) * y % MOD;};




int main(){
  ll N; cin >> N;
  vector<ll> A(N); rep(i, N) cin >> A[i];
  ll ans = 0;

  ll amari = 0;
  rep(i, N){
    if(A[i] == 0){
      amari = 0;
      continue;
    }
    ans += (A[i] + amari) / 2;
    if((A[i] + amari) % 2) amari = 1;
    else amari = 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <algorithm>
    #include <iostream>
    #include <string>
    using namespace std;
     
    int main() {
    	string s;
    	cin >> s;
    	sort(s.begin(), s.end());
    	
    	string t;
    	cin >> t;
    	sort(t.begin(), t.end());
    	reverse(t.begin(), t.end());
    	
    	if (s < t) cout << "Yes" << endl;
    	else cout << "No" << endl;
    }

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

using namespace std;

int n,a,b,i,j,h[100005];
long long newh[100005];

bool check(int v){
	for(i = 0; i < n; i++)
	newh[i] = (long long)h[i] - (long long)v * b;
	
	int val = a - b;
	long long cnt = 0;
	
	for(i = 0; i < n; i++){
		if(newh[i] > 0)
		cnt += (newh[i] - 1) / val + 1;
	}
	
	return cnt <= v;
}

int main(){
	scanf("%d%d%d", &n, &a, &b);
	
	for(i = 0; i < n; i++)
	scanf("%d", &h[i]);
	
	int lb = 0;
	int ub = 1000000001;
	
	while(ub - lb > 1){
		int mid = (lb + ub) / 2;
		
		if(check(mid))
		ub = mid;
		else
		lb = mid;
	}	
	
	printf("%d\n", ub);
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, lint> pll;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

vector<int> min_factor, prime;

void sieve(int n){
    min_factor.resize(n+1, 0);
    For(i, 2, n+1){
        if(min_factor[i] == 0){
            min_factor[i] = i;
            prime.push_back(i);
        }
        for(int x: prime){
            if(x*i > n || x > i) break;
            min_factor[x*i] = x;
        }
    }
}

int main(){
    sieve(1000000);
    int n, p;
    while(scanf("%d%d", &n, &p) && n>=0){
        auto cmp = [&](pii a, pii b){
            return prime[a.fi]+prime[a.se] > prime[b.fi]+prime[b.se];
        };
        priority_queue<pii, vector<pii>, decltype(cmp)> que(cmp);
        int idx = upper_bound(prime.begin(), prime.end(), n) - prime.begin();
        que.emplace(idx, idx);
        set<pii> S;
        rep(_, p-1){
            pii t = que.top();
            que.pop();
            pii u = {t.fi+1, t.se}, v = {t.fi, t.se+1};
            if(u.fi > u.se) swap(u.fi, u.se);
            if(v.fi > v.se) swap(v.fi, v.se);
            if(S.find(u) == S.end()){
                que.push(u);
                S.insert(u);
            }
            if(S.find(v) == S.end()){
                que.push(v);
                S.insert(v);
            }
        }
        pii t = que.top();
        printf("%d\n", prime[t.fi]+prime[t.se]);
    }
}


Measured memory_bytes: 7200
// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Wed Dec 19 22:26:27 2018
//
package main

import "fmt"

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func maxVal(m map[int]int) (int, int) {
	max := 0
	key := 0
	for k, v := range m {
		if max < v {
			key = k
			max = v
		}
	}

	return key, max
}

func main() {
	var n int
	fmt.Scan(&n)

	arr := make([]int, n)
	m1, m2 := map[int]int{}, map[int]int{}
	for i := range arr {
		fmt.Scan(&arr[i])
		if i%2 == 0 {
			m1[arr[i]]++
		} else {
			m2[arr[i]]++
		}
	}

	key1, max1 := maxVal(m1)
	key2, max2 := maxVal(m2)
	if key1 != key2 {
		fmt.Println(n - max1 - max2)
	} else {
		m1[key1] = 0
		_, max3 := maxVal(m1)
		m2[key2] = 0
		_, max4 := maxVal(m2)
		fmt.Println(min(n-max1-max4, n-max2-max3))
	}
}


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

using namespace std;

using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vvvll = vector<vector<vector<ll>>>;
using vvvvll = vector<vector<vector<vector<ll>>>>;
using pl4 = pair<ll,ll>;
using str = string;
using vpl4 = vector<pair<ll,ll>>;

#define sz size()
#define be begin()
#define en end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define llin(x) ll (x);cin >>(x);
#define stin(x) str (x);cin >>(x);
#define vllin(x,n) vll (x)(n);FOR(i,0,n-1){cin >>(x)[i];}
#define vllin2(a,b,n) vll (a)(n);vll (b)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
#define vllin3(a,b,c,n) vll (a)(n);vll (b)(n);vll (c)(n);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
#define vlling(x,n) (x).assign(n,0);FOR(i,0,n-1){cin >>(x)[i];}
#define vlling2(a,b,n) (a).assign(n,0);(b).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i];}
#define vlling3(a,b,c,n) (a).assign(n,0);(b).assign(n,0);(c).assign(n,0);FOR(i,0,n-1){cin >>(a)[i]>>(b)[i]>>(c)[i];}
#define vpl4in(x,n) vpl4 (x)((n),mp(0,0));FOR(i,0,n-1){cin >>x[i].fi>>x[i].se;}
#define FOR(i,a,b) for(ll i = a ; i <= b ; i++)
#define rFOR(i,b,a) for(ll i = a; i >= b ; i--)
#define SORT(x) sort(x.be, x.en)
#define rSORT(x) sort(x.rbegin(), x.rend())
#define say(x) cout<<(x);
#define sal(x) cout<<(x)<<endl;
#define says(x) cout<<(x)<<(' ');
#define sas cout<<(' ');
#define sayR(x) cout<<fixed<<setprecision(10)<<(x);
#define salR(x) cout<<fixed<<setprecision(10)<<(x)<<endl;
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Imp(a) cout <<((a)?"Possible":"Impossible")<<endl;
#define IMP(a) cout <<((a)?"POSSIBLE":"IMPOSSIBLE")<<endl;
#define pow(a,b) ll(pow(a,b))

ll MOD=1000000007;

signed main(){
    llin(h);
    llin(w);
    llin(a);
    llin(b);
    if(w/2<a|h/2<b){
        sal("No")
        return 0;
    }
    ll t=0;
    FOR(i,0,h-1){
        if(i==b) t=1;
        FOR(j,0,w-1){
            if(j<a) say(t)
            else say(1-t)
        }
        cout << endl;
    }
}


Measured memory_bytes: 1280
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <map>
#include <bitset>
using namespace std;
#define len(n) (int)n.length()
#define dump cout
#define pb push_back
#define ll long long

int main()
{
	int N;
	cin >> N;
	
	int *a = new int[N];
	
	for (int i = 0; i < N; i++) {
	    cin >> a[i];
	}
	
	int v = 0;
			for (int k = 0; k < N - 1; k++) {
		    cout << a[k] << " ";
		}
		cout << a[N - 1] << endl;
	for (int i = 1; i < N; i++) {
	    v = a[i];
		int j = i - 1;
		while ((j >= 0) && (a[j] > v))
		{
			a[j+1] = a[j];
			j--;
		}
		a[j+1] = v;
				for (int k = 0; k < N - 1; k++) {
		    cout << a[k] << " ";
		}
		cout << a[N - 1] << endl;
	}
	
	getchar();getchar();
	
	delete[] a;
	
	return 0;
}

Measured memory_bytes: 3084
def main():
  n=int(input())
  s=input()
  R,G,B=s.count('R'),s.count('G'),s.count('B')
  ans=R*G*B
  for i in range(n):
    for j in range(i+1,n):
      if 2*j-i>n-1:
        break
      if s[i]!=s[j] and s[j]!=s[2*j-i] and s[2*j-i]!=s[i]:
        ans-=1
  print(ans)
if __name__=='__main__':
  main()

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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll MOD = (ll)1e9 + 7;
const ll mxN = 200200;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
    cout.precision(20);
    cout << fixed;
	
	string s;
	cin>>s;
	ll ans1=0,ans2=0;
	for(int i=0;i<s.length();i++) if(s[i]=='A') {ans1=i;break;}
	for(int j=s.length()-1;j>=0;j--) if(s[j]=='Z'){ans2=j;break;}
	cout<<ans2-ans1+1<<"\n";

}


Measured memory_bytes: 720
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin,(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    int a,p;
    cin >> a >> p;
    cout << (a*3+p)/2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define fin(ans) cout << (ans) << endl
const int INF = 1<<30;
const ll MOD = 1000000007;

int main() {
    ll a,b;
    ll ans=-1;
    cin >> a >> b;

    
    for (int i = 0; i <= 1000; i++) {
        if(floor(i*0.08)==a&&floor(i*0.1)==b){
            ans=i;
            break;
        }
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
 
#define x1 qeerdx
#define y1 qeerdy
 
#define lb lower_bound
#define ub upper_bound
 
#define endl '\n'
#define fast_in ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
#define mp  make_pair
#define pb  push_back
 
#define fi first
#define se second
 
#define   sz(x)  (int)x.size()
#define  all(x)  x.begin(), x.end()
#define  bit(x)  __builtin_popcountll(x)
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
typedef pair <int,int> pii;
 
const int inf = (int) 1e9+99999, mod = (int)1e9+7;
const ll linf = (ll) 2e18+99999;
 
int kob (int x, int y) { return ((ll)x * y) % mod; } 
int aza (int x, int y) { x -= y; if (x < 0) return x + mod; return x; } 
int kos (int x, int y) { x += y; if (x >= mod) return x - mod; return x; }
 
const int maxn = (int)3e5, maxn2 = (int) 1e6+55;
 
static long holdrand = 1L;
void srand(unsigned int seed){holdrand = (long) seed;} 
int rand() {return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);}

int a[maxn];

int main () {
	int n, K;
	cin >> n >> K;
	for (int i = 1; i <= n; i ++) {
		cin >> a[i];
	}

	int res = 0;
	for (int k = 0; k <= K; k ++) {
	for (int del = 0; del <= k; del ++) {
		for (int left = 0; left <= k-del; left ++) {
			int right = k - left - del;
			int beg = n - right + 1;
			
			vector <int> v;
			if (beg <= left) {
				for (int i = 1; i <= n; i ++) {
					v.pb (a[i]);
				}

				sort (all (v));
			} else {
				for (int i = 1; i <= left; i ++) {
					v.pb (a[i]);
				}

				for (int i = beg; i <= n; i ++) {
					v.pb (a[i]);
				}

				sort (all (v));
			}

			int sum = 0;
			for (int i = del; i < sz (v); i ++) {
				sum += v[i];
			} 

			res = max (res, sum);
		}
	}      
	}


	cout << res;
}


Measured memory_bytes: 256
#include <iostream>
#include <set> 
#include <iterator>
#include <bitset> 
#include <bits/stdc++.h> 
using namespace std;
typedef  long long int ll;
ll mod=1000000007;


int main() {
    int T=1;
    //cin>>t;
    while(T--)
    {   string s,t;
        cin>>s>>t;
        int l=t.length();
        int mc=INT_MAX;
        for(int i=0;i<=s.length()-l;i++)
        {   int count=0;
            for(int j=0;j<l;j++)
            {   if(s[i+j]!=t[j])
                    count++;
            }
            mc=min(mc,count);
        }
        cout<<mc;
        
            
            
    }
	return 0;
}


Measured memory_bytes: 3636
d=input()
a,b=map(int, [d[:2],d[2:]])
temp=[]
for i in [a,b]:
    if 1 <= i <=12:
        temp.append(2)
    elif 0 <= i <= 99:
        temp.append(1)
    else:
        temp.append(0)

if sum(temp) == 4:
    print('AMBIGUOUS')
elif sum(temp) == 3:
    if temp[0]==2:
        print('MMYY')
    else:
        print('YYMM')
else:
    print('NA')

Measured memory_bytes: 3064
import sys

N, M = map(int, input().split())
s = [0] * M
c = [0] * M
for i in range(M):
    s[i], c[i] = map(int, input().split())


for i in range(1000):
    S = str(i)

    if len(S) != N:
        continue

    for j in range(M):
        if int(S[s[j]-1]) != c[j]:
            break
        if j == M-1:
            print(S)
            sys.exit()

    if M == 0:
        print(S)
        sys.exit()

print("-1")

Measured memory_bytes: 62952
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
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;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const int inf=1<<30;

int dp[10010];

int main(){
  int h,n; cin >> h >> n;
  vector<int> a(n);
  vector<int> b(n);
  rep(j,h+1) dp[j]=inf;
  rep(i,n) cin >> a[i] >> b[i];
  dp[0]=0;
  rep(i,n){
    rep(j,h+1){
      if(j+a[i]<=h) chmin(dp[j+a[i]],dp[j]+b[i]);
      else chmin(dp[h],dp[j]+b[i]);
    }
  }
  cout << dp[h] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<math.h>
#include <iostream>
#include <vector>
#include <queue>

using namespace std;

int main() {
  int N;
  cin>>N; 
  string S;
  cin>>S;
  int ans=0;
  int a=0;
  for (int i = 0; i < N; i++) {
    if(S.at(i)=='I'){
      a++;
    }
    else{
      a--;
    }
    ans=max(ans,a);
  }
      cout<<ans<<endl;
    
}



Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int money;
  int n;

  n = 0;

  while (1){
    scanf("%d", &money);

    if (money == 0){
      break;
    }
  
    money = 1000 - money;

    if (money >= 500){
      n += money / 500;
      money %= 500;
    }
    if (money >= 100 && money < 500){
      n += money / 100;
      money %= 100;
    }
    if (money >= 50 && money < 100){
      n += money / 50;
      money %= 50; 
    }
    if (money >= 10 && money < 50){
      n += money / 10;
      money %= 10;
    }
    if (money >= 5 && money < 10){
      n += money / 5;
      money %= 5;
    }
  
    n += money;

    printf("%d\n", n);
    n = 0;
  }
   
  return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FOR1(i, n) for(int (i)=1; (i)<=(n); (i)++)
#define FORI(i, n) for(int (i)=n-1; (i)>=0; (i)--)
const ll MOD = 1e9+7;

vector<ll> fact, ifact, invs;
ll combmod(int n, int k, ll MOD, int M = 1e5){
    if (!fact.size()){
        fact.resize(M+1); ifact.resize(M+1); invs.resize(M+1);
        fact[0] = ifact[0] = invs[0] = fact[1] = ifact[1] = invs[1] = 1;
        for(int i = 2; i <= M; i++){
            fact[i] = fact[i-1] * i % MOD;
            invs[i] = MOD - MOD / i * invs[MOD % i] % MOD;
            ifact[i] = ifact[i-1] * invs[i] % MOD;
        }
    }
    return fact[n] * ifact[k] % MOD * ifact[n-k] % MOD;
}

template<class T> T powmod(T x, ll n, ll m)
{
    T r = 1;
    T a = x % m;
    while (n>0)
    {
        if (n & 1)
            r = (r*a)%m;
        a = (a*a)%m;
        n = n >> 1;
    }
    return r;
}

int main(int argc, char** argv) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << setprecision(15);
    if (argc == 2 && atoi(argv[1]) == 123456789) freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);

    int k;
    cin >> k;
    string s;
    cin >> s;
    int n = s.length();
//    vector<int> cnt(26);
//    FOR(i, n) cnt[s[i]-'a']++;
    combmod(2, 1, MOD, n+k);

//    vector<vector<ll>> dp(27, vector<ll>(n+k+10));
//    dp[26][0] = 1;
//    FORI(c, 26){
//        FOR(x, k+1) {
//            FOR(i, x+1) {
//                dp[c][x] += ifact[i] * dp[c+1][x-i] % MOD;
//            }
//            dp[c][x] %= MOD;
//        }
//    }
//    ll sol = dp[0][k];
//    sol *= fact[k];
//    sol %= MOD;
//    sol *= combmod(n+k, k, MOD);
//    sol %= MOD;
//    cout << sol << endl;

    ll sol = 0;
    for(int i = n; i<=k+n; i++){
        sol += combmod(n+k, i, MOD) * powmod(25ll, n+k-i, MOD) % MOD;
        sol %= MOD;
    }
    cout << sol << endl;

    if (argc == 2 && atoi(argv[1]) == 123456789) cout << clock()*1.0/CLOCKS_PER_SEC << " sec\n";
    return 0;
}

Measured memory_bytes: 51248
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+5;
pair<int,int>a[N];
int n;
int t,mn=0x3f3f3f3f;
int main()
{
    cin>>n>>t;
    for(int i=0;i<n;i++){
        int x,y;
        cin>>x>>y;
        a[i].first=x;
        a[i].second=y;
    }

    for(int i=0;i<n;i++){
        if(a[i].second<=t){
            mn=min(mn,a[i].first);
        }
    }
    if(mn!=0x3f3f3f3f){
        cout<<mn;
                return 0;


    }
    cout<<"TLE";
    //cout << "Hello world!" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	}
}

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

#define int long long
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = INT_MAX / 2;
constexpr int MOD = 1e9 + 7;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vec>;

template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) {
    return stream << p.first << " " << p.second;
}
template <typename T>
void print(const vector<vector<T>> matrix) {
    repall (vec, matrix)
        print(vec);
}
template <typename T>
void print(const vector<T> vec) {
    unsigned int len = vec.size();
    rep (i, len - 1)
        cout << vec[i] << ' ';
    cout << vec[len - 1] << '\n';
}
template <typename Arg>
void print(const Arg arg) {
    cout << arg << '\n';
}
template <typename Head, typename... Args>
void print(const Head head, const Args... args) {
    cout << head << " ";
    print(args...);
}
template <typename T>
T sum_(vector<T> vec, T init = 0) {
    return std::accumulate(all(vec), T(init));
}

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

template <typename T>
void init(vector<T>& v) {
    rep (i, v.size())
        cin >> v[i];
}

template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) {
    assert(v.size() == w.size());
    rep (i, v.size())
        cin >> v[i] >> w[i];
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4

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

    vec v;

    int a, b;
    cin >> a >> b;
    int low, high;

    if (a % 2) {
        low = a + 1;
        v.pb(a);
    } else {
        low = a;
    }

    if (b % 2) {
        high = b;
    } else {
        high = b - 1;
        v.pb(b);
    }

    int ans = (high - low + 1) / 2 % 2;
    repall (i, v)
        ans ^= i;

    print(ans);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cstring>
#include <cstdio>
#include<utility>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
#include<stack>
#include<set>
#include <limits>
#include <climits>
#include <numeric>
#include<cassert>
#include<cctype>
#include<iterator>
using namespace std;
typedef long long ll;
typedef vector<ll>VI;
typedef vector<bool>VB;
typedef pair<ll,ll>P;
typedef pair<double,double>P_D;
#define VV(T) vector<vector<T>>
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define reprev(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define bitrep(bit,A) for(int bit=A; ;bit=(bit-1)&A)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) (ll)((a).size())
#define c_max(a, b) (((ll)a)>((ll)b)?(a):(b))
#define c_min(a,b) (((ll)a)<((ll)b)?(a):(b))
#define chmax(x,a) x=c_max(x,a)
#define chmin(x,a) x=c_min(x,a)
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define SORT(c) stable_sort(ALL(c))
#define $(x) {cout<<#x<<" = " <<(x)<<endl;}
#define fi first
#define se second
#define MAX 100100//5
#define MAX2 200100
#define MAX_6 1001001//6
#define MAX_7 10010010//7
#define SENTINEL 2000000000//9
#define NIL -1
#define MOD 1000000007
#define INF 1<<30
#define INFTY 1000000000000000001LL
#define MAX_INT INT_MAX
#define Endl '\n'
#define greater greater<int>()
VI findAll(string S,string pattern){VI P;ll pos=(ll)S.find(pattern);
while(pos!=string::npos){P.push_back(pos);pos=(ll)S.find(pattern,pos+1);}return P;}
inline ll GCD(ll a,ll b){return b?GCD(b,a%b):a;}
inline ll lcm(ll a,ll b){return a*b/GCD(a,b);}
bool is_prime(ll n){if(n<2)return 0;for(int i=2;i*i<n;i++)if(n%i==0)return 0;return 1;}
inline void eratosthenes(VB& p){rep(i,SZ(p))p[i]=1;p[0]=p[1]=0;
rep(i,SZ(p)/2+1){if(p[i])for(ll j=i+i;j<SZ(p);j+=i)p[j]=0;}}
inline ll mod_add(ll a,ll b){return (a+b)%MOD;}
inline ll mod_sub(ll a,ll b){return (a+MOD-b)%MOD;}
inline ll mod_mul(ll a,ll b){return ((a%MOD)*(b%MOD))%MOD;}
inline ll mod_pow(ll x,ll n,ll mod=(ll)MOD){ll res=1;while(n>0){
if(n&1)res=res*x%mod;x=x*x%mod;n>>=1;}return res;}
inline ll mod_inv(ll x){return mod_pow(x,MOD-2);}
inline ll mod_div(ll a, ll b){return mod_mul(a,mod_inv(b));}
using Graph=vector<vector<int> >;//int と P

int main(){
    ll n,k;cin>>n>>k;
    double ans=0.0;
    if(k-1<=n){
        ans=(double)(n-k+1)/(double)n;
    }
    for(int i=1;i<=n;i++){
        if(i<=k-1){
            int score=i;
            int j=0;
            while(score<k){
                score*=2;j++;
            }
            ans+=pow(0.5,j)*1.0/(double)n;
        }
        
    }
    printf("%.12lf\n",ans);
}



Measured memory_bytes: 512
//g++ -std=c++14 test.cpp -o test.out

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL K;

vector<LL> ans;

void solve(){
	const LL N = 50;
	ans = vector<LL>(N);
	for(int i=0;i<N;i++) ans[i] = N-1 + K/N;
	for(int i=0;i<K%N;i++){
		ans[i] += (N-(K%N-1));
	}
	for(int i=K%N;i<N;i++){
		ans[i] -= K%N;
	}
}
 
int main(){
    cin >> K;
 
    solve();

	cout << ans.size() << endl;
    for(int i=0;i<ans.size();i++) {
    	cout << ans[i] << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long A, B;
    cin >> A >> B;
    long long count=1;
    while(1){
        long long check=A*count;
        if(check%B==0){
            cout << check << endl;
            break;
        }
        count++;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,r) RFOR(i,0,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define lower(a,x) lower_bound(all(a), x) - a.begin();
#define COUNT(a,x)  upper_bound(all(a), x) - lower_bound(all(a), x);
#define MCOUNT(a,x,y) upper_bound(all(a), y) - lower_bound(all(a), x);
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end());
#define scan(x) scanf("%lld",&x);
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
typedef set<ll> SET;
typedef double D;
const ll inf = 5555555555555555555;
const ll mod = 1000000007;
const D pi = acos(-1);
const D eps = 1e-10;

ll n = 0, m = 0, ans = 0, sum = 0, cnt = 0, tmp = 0, ma = 0, mi = 0;
string s;
bool ok, flag;
ll dx[4] = { 1,-1,0,0 }, dy[4] = { 0,0,1,-1 };
ll ddx[9] = { 1,-1,0,0,1,1,-1,-1,0 }, ddy[9] = { 0,0,1,-1,1,-1,1,-1,0 };
#pragma endregion
#define MAX 111111


int main(void) {
  ll k, rsum = 0, le = 0;
  cin >> n >> k;
  vll a(n);
  rep(i, n) cin >> a[i];
  rep(i, n) if (a[i] > 0) sum += a[i];
  rep(i, k - 1) if (a[i] > 0) tmp += a[i];
  rep(i, k - 1) rsum += a[i];
  while (le + k - 1 < n) {
	if (a[le + k - 1] > 0) tmp += a[le + k - 1];
	rsum += a[le + k - 1];
	ans = max(ans, sum - tmp);
	ans = max(ans, sum - tmp + rsum);
	if (a[le] > 0) tmp -= a[le];
	rsum -= a[le];
	le++;
  }
  cout << ans << endl;

  return 0;
}

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

#define boost ios_base::sync_with_stdio(false), cin.tie(NULL);

using namespace std;
const int N = 1e5 + 41;
const int X[] = {1,0,-1,0,1,-1,1,-1};
const int Y[] = {0,1,0,-1,1,1,-1,-1};
const int mod = 1e9 + 7;
const long long INF = 1e16;
const int inf = 1e9;

int a[109];

long long dp[109][N];

int main () {
	int n, k;
	cin >> n >> k;
	for (int i = 1 ; i <= n ; ++ i) {
		cin >> a[i];
	}
	dp[0][0] = 1;
	for (int i = 1 ; i <= n ; ++ i) {
		long long pref = 0;
		for (int j = 0 ; j < N ; ++ j) {
			if (j - a[i] - 1 >= 0)
				pref += mod - dp[i - 1][j - a[i] - 1];
			pref += dp[i - 1][j];
			pref %= mod;
			dp[i][j] += pref;
			dp[i][j] %= mod;
		}
	}
	cout << dp[n][k];
}

Measured memory_bytes: 79360
#include<iostream>
#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
using namespace std;
int main()
{
int w,a,b,ans=0;
cin>>w>>a>>b;
ans=max(a-b,b-a);
if(ans<w)
cout<<0;
else
cout<<ans-w;
system("pause");
return 0;
}


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


void solve(long long N, long long K, long long X, long long Y){
    if(N <= K) cout << N*X << endl;
    else {
        cout << K*X + (N-K)*Y << endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    long long X;
    scanf("%lld",&X);
    long long Y;
    scanf("%lld",&Y);
    solve(N, K, X, Y);
    return 0;
}


Measured memory_bytes: 256
N, A, B, C, D = map(int, input().split()) # 横に2個
S = [0 if s == '.' else 1  for s in input()]

if C <= B:
    ans = 'Yes'
    for i in range(A, C):
        if S[i] == 1 and S[i-1] == 1:
            ans = 'No'
            break
    for i in range(B, D):
        if S[i] == 1 and S[i-1] == 1:
            ans = 'No'
            break

elif C < D:
    ans = 'Yes'
    for i in range(A, D):
        if S[i] == 1 and S[i-1] == 1:
            ans = 'No'
            break
else:
    ans = '?'
    for i in range(A, C):
        if S[i] == 1 and S[i-1] == 1:
            ans = 'No'
            break
        if B - 1 <= i <= D - 1 and S[i] == 0 and S[i-1] == 0 and S[i+1] == 0:
            ans = 'Yes'
            break
    if ans == '?':
        ans = 'No'

print(ans)


Measured memory_bytes: 4924
program B177
    implicit none
    character(1000) :: S, T
    character(1) :: js, jt
    integer(8) :: i, lenS, lenT, ans, j, k


    read(5,*) S
    read(5,*) T
    lenS = len_trim(S)
    lenT = len_trim(T)
    ans = lenT
    
    do i = 1, lenS-lenT+1
        k = 0
        do j = 1, lenT
            read(S(i+j-1:i+j-1),*) js
            read(T(j:j),*) jt
            if (js == jt) then
                k = k + 1
            end if
        end do

        if (ans > lenT-k) then
            ans = lenT - k
        end if
    end do

    write(6,*) ans
            




end program B177

Measured memory_bytes: 2856
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iterator>
#include <fstream>
#include <cstddef>
#include <cstring>

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define PB push_back
#define rep(i, a) for(int i = 0; i < a; i++)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define mp make_pair
#define INT int_64
#define MOD 1000000007
const ll INF = (1<<30);
const ll NEGA=-INF*10000; 

//階乗
ll Kaijou(int a) {
if (a < 2) return 1;
return a * Kaijou(a - 1)%MOD;
}

//逆元の計算用(pは素数のときb=p-2で逆元)
ll calc(int a, int b, int p) {
	if (b == 0) return 1;
	if (b % 2 == 0) {
		ll d = calc(a, b / 2, p);
		return (d*d) % p;
	}
	else {
		return (a*calc(a, b - 1, p)) % p;
	}
}

int main() 
{
int h,w,a,b;
cin>>h>>w>>a>>b;

ll ans=0;

ll x=Kaijou(h-a-1);
ll y=Kaijou(a-1);
ll z=Kaijou(b-1);
ll xx=Kaijou(h-a+b-2);
ll de[100000]={0};
ll du[100000]={0};
du[0]=y;
de[0]=1;
rep(i,w-b){
  if(i){
    de[i]=(de[i-1]*i)%MOD;
    du[i]=(du[i-1]*(a+i-1))%MOD;
  }
}
for(int i=b+1;i<=w;++i){
ll bunbo=(((x*z)%MOD)*(i-1))%MOD;
z=(z*(i-1))%MOD;
bunbo=calc(bunbo,MOD-2,MOD)%MOD;
ll bunsi=(xx*(h-a+i-2))%MOD;
xx=(xx*(h-a+i-2))%MOD;
ll lu=(bunbo*bunsi)%MOD;
bunbo=(de[w-i]*y)%MOD;
bunbo=calc(bunbo,MOD-2,MOD)%MOD;
bunsi=(du[w-i])%MOD;
ll rd=(bunbo*bunsi)%MOD;
ans=(ans+(lu*rd)%MOD)%MOD;
}
cout<<ans<<endl;
}



Measured memory_bytes: 4224
#include<bits/stdc++.h>
#define N 2005
#define mod 998244353
#define ll long long
using namespace std;
ll C[N<<1][N<<1],mul[N<<1];
int n,k;
inline ll calc(int i,int tot){
	int k2=min(k-i/2,(i-1)/2),k1=k-(k2<<1)-((i&1)==0);
	ll f=1,ret=0;
	for(int j=k2;j+k1>0&&j>=0;--j,f=-f)(ret+=f*C[j+k1+tot-1][j+k1-1]*mul[j]%mod*C[k2][j]%mod)%=mod;
	return (ret+mod)%mod;
}
inline ll read(){
	ll ans=0;
	char ch=getchar();
	while(!isdigit(ch))ch=getchar();
	while(isdigit(ch))ans=(ans<<3)+(ans<<1)+(ch^48),ch=getchar();
	return ans;
}
int main(){
	k=read();
	n=read();
	mul[0]=1;
	for(int i=1;i<=4000;++i)mul[i]=(mul[i-1]<<1)%mod;
	C[0][0]=1;
	for(int i=1;i<=4000;++i){
		C[i][0]=1;
		for(int j=1;j<=i;++j)C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
	}
	ll tmp=0;
	for(int i=2;i<=2*k;++i){
		if(!(i&1))tmp=(calc(i,n)+calc(i,n-1))%mod;
		else tmp=calc(i,n);
		cout<<tmp<<'\n';
	}
	return 0;
}

Measured memory_bytes: 123904
n=input()
if(n[-1]=="0" or n[-1]=="1" or n[-1]=="6" or n[-1]=="8"):
    print("pon")
elif(n[-1]=="3"):
    print("bon")
elif(n[-1]=="2" or n[-1]=="4" or n[-1]=="5" or n[-1]=="7" or n[-1]=="9"):
    print("hon")

Measured memory_bytes: 61652
#include <iostream>
using namespace std;
double a,b,t[8]={35.5,37.5,40.0,43.0,50.0,55.0,70.0,2e+9},u[8]={71.0,77.0,83.0,89.0,105.0,116.0,148.0,2e+9};
string s[8]={"AAA","AA","A","B","C","D","E","NA"};
int main(){
while(cin>>a>>b){
for(int i=0;i<8;i++){
if(a<t[i]&&b<u[i]){cout<<s[i]<<endl;break;}
}
}
}

Measured memory_bytes: 0
// atcoder/abc157/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr lli mod = 1e9 + 7;

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

  const int N = 3;
  int g[N][N];
  while (true) {
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < N; ++j) {
        cin >> g[i][j];
      }
    }
    int n;
    unless (cin >> n) break;
    set<int> vis;
    for (int i = 0; i < n; ++i) {
      int x;
      cin >> x;
      vis.insert(x);
    }

    bool f = false;

    const int D = 8;
    int di[D] = {-1, 0, +1, -1, +1, -1, 0, +1};
    int dj[D] = {-1, -1, -1, 0, 0, +1, +1, +1};
    for (int i = 0; i < N; ++i) {
      for (int j = 0; j < N; ++j) {
        for (int d = 0; d < D; ++d) {
          int ai = i + di[d];
          int aj = j + dj[d];
          int bi = ai + di[d];
          int bj = aj + dj[d];
          unless (0 <= ai && ai < N) continue;
          unless (0 <= bi && bi < N) continue;
          unless (0 <= aj && aj < N) continue;
          unless (0 <= bj && bj < N) continue;
          bool p = vis.count(g[i][j]) && vis.count(g[ai][aj]) && vis.count(g[bi][bj]);
          f = f || p;
        }
      }
    }

    cout << (f ? "Yes" : "No") << endl;
  }

  return 0;
}


Measured memory_bytes: 256
my $min = 0;

MAIN : {
	my $s1 = <STDIN>;
	chomp $s1;
	my $s2 = <STDIN>;
	chomp $s2;
	my ($n, $m) = split(" ", $s1);
	my @list = split(" ", $s2);
	my @slist = sort {$a <=> $b} (@list);
	
	#print STDOUT join(",", @slist), "\n";
	
	# 間を計算
	my @aidalist = ();
	
	my $before = shift(@slist);
	
	foreach my $a (@slist) {
		push @aidalist, $a - $before;
		$before = $a;
	}
	
	#print STDOUT join(",", @slist), "\n";
	#print STDOUT join(",", @aidalist), "\n";
	
	@aidalist = sort {$b <=> $a} (@aidalist);
	#print STDOUT join(",", @aidalist), "\n";
	
	$n--;
	for (my $i = 0; $i < $n; $i++) {
		my $aaa = shift(@aidalist);
	}
	
	my $sum = 0;
	foreach my $a (@aidalist) {
		$sum += $a;
	}
	
	print STDOUT $sum, "\n";
}

exit 0;








Measured memory_bytes: 28604
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<complex>

typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second

int n,a[100005];

int main(){
	cin >> n;
	REP(i,n) cin >> a[i];

	ll ans = 0;
	REP(i,n) {
		while(a[i]%2==0){
			a[i]/=2;
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
package main

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

var par []int

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	par = make([]int, n)
	for i := range par {
		par[i] = i
	}

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	for i := 0; i < m; i++ {
		sc.Scan()
		a, _ := strconv.Atoi(sc.Text())
		sc.Scan()
		b, _ := strconv.Atoi(sc.Text())
		a--
		b--
		unite(a, b)
	}

	mp := make(map[int]bool)
	for i := range par {
		r := root(par[i])
		mp[r] = true
	}

	fmt.Println(len(mp) - 1)
}

func root(x int) int {
	if par[x] == x {
		return x
	}
	par[x] = root(par[x])
	return par[x]
}

func unite(x, y int) {
	rx := root(x)
	ry := root(y)
	if rx == ry {
		return
	}
	par[rx] = ry
}

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

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

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


Measured memory_bytes: 6108
/*
--------------              |   /
      |                     |  /
      |                     | /
      |             *       |/          |    |         ------            *
      |                     |           |    |        /      \
      |             |       |\          |    |       |       |\          |
   \  |             |       | \         |    |       |       | \         |
    \ |             |       |  \        |    |        \     /   \        |
     V              |       |   \        \__/|         -----     \       |
*/
#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);
#define mem(i,j) memset(i,j,sizeof (i));
#define F first
#define S second
#define lowbit(x) ((x)&(-(x)))
#define siz(v) (long long)(v).size()
typedef int64_t ll;
typedef uint64_t ull;
const double EPS  = 1e-8;
const int INF     = 0x3F3F3F3F;
const ll LINF     = 4611686018427387903;
const int MOD     = 1e9+7;
/*-----------------------------------------------------------------------------------------------------*/
#define int ll

int c[51][51];

void init() {
	for(int i = 0; i <= 50; i++)
		c[i][0] = c[i][i] = 1;
	for(int i = 1; i <= 50; i++)
		for(int j = 1; j < i; j++)
			//c[i][j] = c[i][j-1] + c[i-1][j-1];// Wrong
			c[i][j] = c[i-1][j] + c[i-1][j-1];// Correct
	cout << fixed << setprecision(15);
}

signed main() {
	EmiliaMyWife

	init();
	int n, a, b;
	cin >> n >> a >> b;
	vector<int> arr(n);
	for(int i = 0; i < n; i++)
		cin >> arr[i];
	sort(arr.begin(), arr.end(), greater<int>());

	int sum = 0, ans = 0;
	for(int i = 0; i < a; i++)
		sum += arr[i];
	long double x = sum;
	cout << x/a << '\n';

	if(arr[0]==arr[a-1]) {
		int cnt = 0;
		for(int i = 0; i < n; i++)
			if(arr[i] == arr[0])
				cnt++;
		for(int i = a; i <= min(b, cnt); i++)
			ans += c[cnt][i];
	}
	else {
		map<int,int> cnt;
		int w = 0;
		for(int i = 0; i < n; i++)
			cnt[arr[i]]++;
		for(int i = 0; i < a; i++)
			if(arr[i]==arr[a-1])
				w++;
		ans = c[cnt[arr[a-1]]][w];
		//cout << c[3][1] << ' ';
	}
	cout << ans;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int   long long int  
#define pb push_back
#define BOOST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define debugL(i)  cout<<"line no-> "<<i<<" working"<<endl
#define debugVL(i,l)  cout<<"val at line no."<<i<< " ->"<<l<<endl
#define  init(st,et,val,arr) for(int i=st;i<=et;i++)arr[i]=val;
const int M=1e9 + 7;
using namespace std;
int N=200000;
int32_t main() {
	BOOST;
    int n;cin>>n;
    int p=pow(n,3);
    cout<<p<<endl;
    return 0;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Measured memory_bytes: 384
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;

class Solver {
    Scanner sc = new Scanner();

    public void Solve() {
        var N = sc.nextInt();
        for (int i = N; i < 1000; i++) {
            var s = i.ToString();
            if (s[0] == s[1] && s[1] == s[2] && s[0] == s[2]) {
                WriteLine(i);
                return;
            }

        }
    }
}



class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Program {
    static void Main(string[] args) {
        Solver s = new Solver();
        s.Solve();
    }
}


Measured memory_bytes: 11220
/******Old_school_@15******/
#include<bits/stdc++.h>
using namespace std;
#define lld               long long int
#define ld                long double
#define pb                push_back
#define ppb               pop_back hellooitsme1
#define mp                make_pair
#define F                 first
#define S                 second
#define nl                '\n'
#define all(c)            (c).begin(),(c).end()
#define rall(c)           (c).rbegin(),(c).rend()
#define sz(c)             (c).size()
#define tr(x,a)           for(auto &a : x)
#define psnt(x,a)         (x).find(a)!=(x).end()
#define vpsnt(x,a)        find(all(x),a)!=(x).end()
#define lexichar(x,y)     lexicographical_compare(x,x+strlen(x),y,y+strlen(y)) //modify the ranges
#define lexistr(x,y)      lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()) 
#define MOD               1000000007
#define pi                3.1415926536
#define tod               1
#define itr(i,a,b)        for(lld i=a;i<=b;i++)
#define itrn(i,a,b)       for(lld i=a;i>=b;i--)
#define iot(n)            for(lld i=0;i<n;i++)
#define pls(n,arr)        lld arr[n]; iot(n)  cin>>arr[i];
#define bye               fflush(stdout)

typedef pair<lld,lld>     pii;
typedef pair<string,lld>  psi;
template <typename T>
bool mycomp(T x,T y){ 
   return (x==y);  //give your condition here
}
bool paircomp(const pair<lld,lld> &x,const pair<lld,lld> &y){ 
return x.second<y.second;
}

int main(){
       ios_base::sync_with_stdio(false);
             cin.tie(0);
            cout.tie(0);
      lld t=1; //cin>>t;  
      while(t--){
          lld n,d; cin>>n>>d;
          lld ans=0;
          ld dd=d*1.00000000+0.000000000;
          while(n--){
              lld x,y; cin>>x>>y;
              ld z=x*x*1.000000000+y*y*1.000000000;
              ld zz=1.00000000*sqrt(z*1.000000000);
              if(dd-zz>=0.00000000)  ans++;
          }
          cout<<ans;
      }
}


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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

int main()
{
    int N, M, K; cin >> N >> M >> K;
    vector<ll> A(N), B(M);
    rep(i,N) cin >> A[i];
    rep(i,M) cin >> B[i];
    rep(i,N){
        if(i == 0) continue;
        A[i] = A[i] + A[i-1];
    }
    rep(i,M){
        if(i == 0) continue;
        B[i] = B[i] + B[i-1];
    }
    int A_up_K = -1;
    rep(i,N){
        if(A[i] <= K){
            A_up_K = i;
        }
    }
    // つまりAの本を一冊も読めない場合
    if(A_up_K == -1){
        auto itrB = upper_bound(B.begin(), B.end(), K);
        ll B_read_n = distance(B.begin(), itrB);
        cout << B_read_n << endl;
        return 0;
    }
    ll max_n = 0;
    for(int i=A_up_K; i>=0; i--){
        ll A_read_n = i+1;
        auto itrB = upper_bound(B.begin(), B.end(), (K-A[i]));
        // if(itrB == B.end()) cout << "ok" << endl;
        ll B_read_n = distance(B.begin(), itrB);
        // printf("%d %d\n", A_read_n, B_read_n);
        // cout << B[M-1] << endl;
        ll sum = A_read_n + B_read_n;
        if(max_n < sum) max_n = sum;
    }
    auto itrB = upper_bound(B.begin(), B.end(), K);
    ll B_read_n = distance(B.begin(), itrB);
    if(max_n < B_read_n) max_n = B_read_n;
    cout << max_n << endl;




    /*
    auto itrA = A.begin();
    if(A[N-1] < K) itrA = A.end();
    else itrA = upper_bound(A.begin(), A.end(), K);
    ll max_n = 0;
    for(auto itr = A.begin(); itr != itrA; ++itr){
        ll A_min = *itr;
        // cout << A_min << endl;
        ll B_min = K - A_min;
        // cout << B_min << endl;
        auto itrB = B.begin();
        if(B[N-1] <= B_min) itrB = B.end();
        else itrB = upper_bound(B.begin(), B.end(), B_min);
        ll sum = distance(A.begin(), itr) + distance(B.begin(), itrB) + 1;
        // cout << distance(A.begin(), itr) << endl;
        if(max_n < sum) max_n = sum;
    }
    cout << max_n << endl;
    */
}

Measured memory_bytes: 6420