akhauriyash/Code-Regression huggingface dataset:
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Numerics;

namespace abc162
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            if (File.Exists("input.txt"))
            {
                Console.SetIn(new StreamReader("input.txt"));
            }
			solve_abc162A();
			//Console.Out.Flush();

        }

        public static void solve_abc162B()
        {
        }

        public static void solve_abc162A()
        {
            string s = Console.ReadLine();
            Console.WriteLine(s.Contains("7") ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 26832
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

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

	for (int i = 0; i < s.length(); i++) {
		if (i % 2 == 0) {
			if (s[i] == 'L') {
				cout << "No" << endl;
				return 0;
			}
		} else {
			if (s[i] == 'R') {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;
}


Measured memory_bytes: 256
from collections import defaultdict


def factorize(N):  # 素因数分解
    p = 2 
    while p * p <= N:
        while N % p == 0:
            N //= p
            fact[p] += 1
        p += 1
    if N > 1:
        fact[N] += 1

n = int(input())
fact = defaultdict(int)
for i in range(n):
    factorize(i + 1)

cnt4 = sum(cnt >= 4 for cnt in fact.values())
cnt2 = sum(cnt >= 2 for cnt in fact.values())
cnt24 = sum(cnt >= 24 for cnt in fact.values())
cnt14 = sum(cnt >= 14 for cnt in fact.values())
cnt74 = sum(cnt >= 74 for cnt in fact.values())

ans = cnt4 * (cnt4 - 1) * (cnt2 - 2) // 2
ans += cnt24 * (cnt2 - 1) + (cnt4 - 1) * cnt14 + cnt74
print(ans)


Measured memory_bytes: 65040
//#include<bits/stdc++.h>	// 全てのヘッダーファイルをinclude
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<utility>	// wrap,pair
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR (i,n) for(int i=n;i>0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
const int MOD{ int(1e9 + 7) };	// int 1000000007
const int inf{ int(1e9) };	// inf = 1000000000 // 1e9 はdouble型
using namespace std;
typedef long long ll;

// 最大公約数（ユークリッドの互除法）
int GCD(int x, int y) {
	if (x > y) {
		swap(x, y);
	}
	int r = y % x;
	while (r != 0) {
		y = x;
		x = r;
		r = y % x;
	}
	return x;
}

// 最小公倍数
int LCM(int x, int y) {
	ll gcd = GCD(x, y);
	return x * y / gcd;
}

// 素数判定(素数ならtrue,合成数ならfalse)
bool IsPrime(int num) {
	if (num < 2) return false; // 0,1
	else if (num == 2) return true;	// 2
	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; // 全部通ったら素数
}

// pairをsecond基準で昇順sort
// sort(vector_name.begin(),vector_name.end(),compare_by_b);
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;
}

// 桁数を返す：unsigned(-の値をとらない)
unsigned Digit(unsigned num) {
	return log10(num) + 1;
}

// ----------------------------------------------------------------

int main(void) {

	int n;
	cin >> n;
	vector<int> a(n);
	int S = 0, A = 0;
	REP(i, n) {
		cin >> a[i];
		S += a[i];
		if (i % 2 == 1) A += a[i];
	}

	vector<int> x(n);
	x[0] = S - 2 * A;
	REP(i, n) {
		if (i == 0) cout << x[0] << " " << flush;
		else {
			x[i] = 2 * a[i - 1] - x[i - 1];
			cout << x[i] << " " << flush;
		}
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
#define ll long long
ll mod=1000000007;
#define vl vector<ll>
#define pl pair<ll,ll>
#define rep(i,b) for(ll i=0;i<b;i++)
#define all(v) (v).begin(),(v).end()
using namespace std;

vector<string>m;
int main(){
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    if(s[0]==s[1]&&s[2]==s[3]&&s[1]!=s[2])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() {
  cout << "Yes";
}

void no() {
  cout << "No";
}

int main() {
  kyun;
  in6 n;
  cin >> n;
  vector<pair<int,int>> data(n);
  rep(i,n) {
    cin >> data[i].first;
    data[i].second = i+1;
  }
  sort(all(data));
  rep(i,n) {
    if(i != n-1) cout << data[i].second << " ";
    else cout << data[i].second;
  }
  hinata;
}

Measured memory_bytes: 1664
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

template<typename T>
class SegmentTree{
    int n;
    int realsize;
    T initialvalue;
    vector<T> tree;

    public:
    
    SegmentTree(int size,T initial):realsize(size),initialvalue(initial){
        n = 1;
        while(n < size)n *= 2;

        tree = vector<T>(2*n + 1,initial);
    }

    //1-indexed
    void insert(int i,T data){
        int ind = n+i-1;
        tree[ind] = data;
        ind >>= 1;
        while(ind > 0){
            tree[ind] = max(tree[ind*2] , tree[ind*2+1]);
            ind >>= 1;
        }
    }

    void add(int i,T data){
        int ind = n+i-1;
        tree[ind] += data;
        ind >>= 1;
        while(ind > 0){
            tree[ind] = max(tree[ind*2] , tree[ind*2+1]);
            ind >>= 1;
        }
    }

    T get(int l,int r){
        if(l > realsize || r > realsize || l <= 0 || r <= 0)return initialvalue;
        l = n+l-1;
        r = n+r-1;
        if(l == r)return tree[l];
        int prel = l;
        int prer = r;
        T lnum = tree[l];
        T rnum = tree[r];
        l >>= 1;
        r >>= 1;
        while(l != r){
            if(l*2 == prel){
                lnum = max(lnum,tree[l*2+1]);
            }
            if(r*2+1 == prer){
                rnum = max(rnum,tree[r*2]);
            }
            prel = l;
            prer = r;
            l >>= 1;
            r >>= 1;
        }
        return max(lnum,rnum);
    }
};

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

    vector<ll> h(n),a(n);
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    vector<ll> asc = h;
    sort(asc.begin(),asc.end());

    SegmentTree<ll> st = SegmentTree<ll>(n,0);

    vector<ll> dp(n,0);

    for(int i = 0; i < n; i++){
        auto itr = lower_bound(asc.begin(),asc.end(),h[i]);
        ll idx = (ll)(itr - asc.begin()) + 1;
        dp[i] = st.get(1,idx) + a[i];
        st.insert(idx,dp[i]);
    }

    cout << st.get(1,n) << endl;
    
    return 0;
}

Measured memory_bytes: 10624
public class Main {

    /**
     * ????????????????????????
     * @param args
     */
    public static void main(String[] args) {
        for(int i = 1; i < 10; i++) {
            for(int j = 1; j < 10; j++) {
                System.out.println(i + "x" + j + "=" + i*j);
            }
        }
    }

}

Measured memory_bytes: 23908
#include <stdio.h>
int main(void){
    int N, i, X, Y, ans;
    int V[50];
    int C[50];
    
    scanf("%d", &N);
    ans= 0;
    X =0;
    Y = 0;
    
    for(i = 0; i < N; i++){
        scanf("%d", &V[i]);
        //printf("%d\n", V[i]);
    }
    
    for(i = 0; i < N; i++){
        scanf("%d", &C[i]);
        //printf("%d\n", C[i]);
    }
    
    for(i = 0; i < N; i++){
        if(V[i]>C[i]){
            X = X + V[i];
            
            Y = Y + C[i];
            
        }
    }
    
    
    ans = X - Y;
    printf("%d", ans);
    
}


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

using namespace std;

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

    int a,b;
    cin>>a>>b;
    if(b==1){
        cout<<0<<"\n";
        return 0;
    }
    int cnt=a;
    int tap=1;
    while(cnt<b){
        cnt--;
        cnt+=a;
        tap++;
    }
    cout<<tap<<"\n";
}

Measured memory_bytes: 3652
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

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

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	vector<vector<int>> a(3, vector<int>(3, 0));
	map<int, pair<int, int>> ind;
	for (int i = 0; i <= 2; i++) for (int j = 0; j <= 2; j++) cin >> a[i][j], ind[a[i][j]] = {i, j};
	vector<int> rw(3, 0), cl(3, 0);
	int diag1 = 0, diag2 = 0;

	int n; cin >> n;
	for (int i = 1; i <= n; i++) {
		int b; cin >> b;
		if (ind.find(b) == ind.end()) continue;
		pair<int, int> p = ind[b];
		if (a[p.ff][p.ss] == 0) continue;
		a[p.ff][p.ss] = 0;
		rw[p.ff]++;
		cl[p.ss]++;
		if (p.ff == p.ss) diag1++;
		if (p.ff + p.ss == 2) diag2++;
	}

	bool flg = (diag1 == 3) or (diag2 == 3);
	for (int i = 0; i <= 2; i++) if (rw[i] == 3) {flg = true; break;}
	for (int j = 0; j <= 2; j++) if (cl[j] == 3) {flg = true; break;}

	cout << (flg ? "Yes" : "No");

	return 0;
}

Measured memory_bytes: 3044
# @author 

import sys

class SDigitSum:
    def solve(self):
        MOD = 10 ** 9 + 7

        k = input().strip()
        d = int(input())

        s = len(k)
        dp = [[0] * d for _ in range(s + 1)]
        dp[0][0] = 1
        for i in range(10):
            dp[1][i % d] += 1

        pre = [[0] * (d + 1) for _ in range(s + 1)]
        for i in range(d):
            pre[1][i] = pre[1][i - 1] + dp[1][i]
        for l in range(2, s):
            # cur is sum(dp[l - 1][(-lm + r) % d] for lm in range(1, 10)
            cur = sum(dp[l - 1][(-lm + 0) % d] for lm in range(1, 10))
            for r in range(d):
                # dp[l][r] = (dp[l - 1][r] + sum(dp[l - 1][(-lm + r) % d] for lm in range(1, 10))) % MOD
                dp[l][r] = (dp[l - 1][r] + cur) % MOD
                cur -= dp[l - 1][(r - 9) % d]
                cur += dp[l - 1][(r + 1 - 1) % d]


        ans = dp[s - 1][0]
        done = 0
        for i in range(s):
            lm = int(k[i])
            ans = (ans + sum(dp[s - 1 - i][(-done - (lm - v)) % d] for v in range(1, lm + 1 * (i != 0)))) % MOD
            done += lm

        if (sum(int(x) for x in k)) % d == 0:
            ans = (ans + 1) % MOD

        print((ans - 1) % MOD)

solver = SDigitSum()
input = sys.stdin.readline

solver.solve()


Measured memory_bytes: 61276
#include <stdlib.h>
#include <cmath>
#include <cstdio>
#include <cstdint>
#include <string>
#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
using namespace std;

int main(){
  long long A,B,N;
  cin >> A >> B >> N;
  long long ans=0;
  long long x;
  if(B-1<=N) x=B-1;
  else x=N;
  ans=(A*x)/B-A*(x/B);
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n, l = 1, r = 1, l1, r1, tmp, l_tmp, r_tmp;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> l1 >> r1;
        // if (l1 >= l and r1 >= r)
        // {
        //     l = l1;
        //     r = r1;
        // }
        // else
        // {
        // l_tmp = (ll)ceill(l / (l1 + .0));
        // r_tmp = (ll)ceill(r / (r1 + .0));
        l_tmp = (l % l1) ? l / l1 + 1 : l / l1;
        r_tmp = (r % r1) ? r / r1 + 1 : r / r1;
        tmp = max(l_tmp, r_tmp);
        l = tmp * l1;
        r = tmp * r1;
        // }
    }
    tmp = l + r;
    cout << tmp << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

#define max(a, b) (a > b ? a : b)
#define min(a, b) (a < b ? a : b)

int main( void ) {
	int a, b, h;
	scanf("%i %i %i", &a, &b, &h);
	
	
	printf("%i\n", (a + b) * h / 2);
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int N;
vector<int> X, Y;

double dist(double x, double y) {
    double ma = 0;
    for (int i = 0; i < N; i++) {
        double dx = X[i] - x;
        double dy = Y[i] - y;
        ma = max(ma, dx * dx + dy * dy);
    }
    return ma;
}

double g(double x) {
    double left = 0, right = 1000;
    rep(i, 80) {
        double l2 = (left * 2 + right) / 3;
        double r2 = (left + right * 2) / 3;
        if (dist(x, l2) < dist(x, r2)) right = r2;
        else left = l2;
    }
    return dist(x, left);
}

int main() {
    // 2重3分探索
    cin >> N;
    X = Y = vector<int> (N);
    rep(i, N) {
        cin >> X[i] >> Y[i];
    }
    double left = 0, right = 1000;
    while (abs(right - left) > 0.00000001) {
        double l2 = (left * 2 + right) / 3;
        double r2 = (left + right * 2) / 3;
        if (g(l2) < g(r2)) right = r2;
        else left = l2;
    }
    double ans = sqrt(g(left));
    printf("%.10f\n", ans);
    return 0;
}

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

int main()
{
int A,B;
cin>>A>>B;
if(B%2==0){
    if(A>=13){
        cout<<B<<endl;
    }
    else if(A>=6&&A<=12){
        cout<<B/2<<"\n";
    }
    else{
        cout<<"0"<<endl;
    }
}
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
 
class C
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var a = Enumerable.Range(1, n).Select(i => int.Parse(Console.ReadLine())).ToArray();
        var M = a.Max();
        var k = Array.IndexOf(a, M);
        for (var i = 0; i < n; i++) Console.WriteLine(i == k ? a.Where((x, j) => j != i).Max() : M);
    }
}

Measured memory_bytes: 21460
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <map>
#include <set>
#include <queue>
using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

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

    if(N%2 == 0){
        cout << 0.5 << endl;
    } else {
        cout << (int(N/2)+1)/float(N) << endl;
    }

    return 0;
}


Measured memory_bytes: 256
//
//  main.swift
//  atCoderTest
//
//  Created by jun on 2020/05/23.
//  Copyright © 2020 jun. All rights reserved.
//

import Foundation

func solution() -> String {
   let AV = readLine()!.components(separatedBy: " ").map { Int($0)! }
   let BW = readLine()!.components(separatedBy: " ").map { Int($0)! }
   let A = AV.first!
   let V = AV.last!
   let B = BW.first!
   let W = BW.last!
   let T = Int(readLine()!)!
   
   let BetweenAtoB = abs(A - B)
   let speedAtoB = V - W
   
   if A == B { return "YES" }
   
   if BetweenAtoB <= speedAtoB * T {
      return "YES"
   }


 
   return "NO"
}

print(solution())





Measured memory_bytes: 14072
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }



int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(25);

  int n;
  cin >> n;
  vector<int> a(n - 1);
  rep(i, n - 1) {
    cin >> a[i];
    a[i]--;
  }

  map<int, int> ans;
  rep(i, n - 1) ans[a[i]]++;
  rep(i, n) cout << ans[i] << '\n';




  
  return 0;
}

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

Measured memory_bytes: 13980
N,C,K = list(map(int,input().split()))
T = [0]*N
for i in range(N):
  T[i] = int(input())
T.sort()
i = 0
ret = 0
while i < N:
  j = i
  ret += 1
  while j < N and j < i+C and T[j] <= T[i]+K:
    j += 1
  i = j
print(ret)

Measured memory_bytes: 7472
#include <bits/stdc++.h>
//#include <boost/math/common_factor.hpp> 
using namespace std;
#define endl              "\n"
#define pb              push_back
#define fir               first
#define sec               second
#define all(arr,n)          ((arr , arr+n))
#define allv(v)            ((v).begin()), ((v).end())
#define sz(v)            ((int)((v).size()))
#define ll              long long
#define ld              long double
#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)
#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)
#define isPowerOfTwo(s) (!(s & (s-1)))
#define vll vector<ll>
typedef vector<int> vi;
typedef deque<int> de;
void origi() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
ll findTrailingZeros(ll n)
{
    ll count = 0;
    for (ll i = 5; n / i >= 1; i *= 5)
        count += n / i;
    return count;
}
void tiranga() {
    ll n;
    cin >> n;
    if (n % 2) cout << 0;
    else
        cout << findTrailingZeros( (n / 2));
}
int main() {
#ifndef ONLINE_JUDGE.
    //freopen("input.txt", "r", stdin);
#else
#endif
    //cout << 43 % 2;
    origi();
    tiranga();
    //cout << sumOfDig(123654);
   // genLarge(10, 10);
   // genSmall(10);

}

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

vector<int> v  ;

bool compa(int a ,int b){
    return ( (v[a+1] -v[a]) <(v[b+1] -v[b]) ) ;
}


unsigned combinaison( unsigned k, unsigned n )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;

    int result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

int main(){
    int n  ,p, temp,test ;
    long long int s = 0;

    cin >> n  ;
    for(int i=0 ; i<n ;i++){
        cin >> temp  ;
        v.push_back(temp) ;
        //diffOrd.push_back(i) ;
    }

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

   // sort(diffOrd.begin(),diffOrd.end(),compa) ;

    for(int i=0 ; i<n-2 ;i++){
        s += combinaison(2,n-i-1) ;
       // p = -1 ;
        //nbr = 0 ;
        for(int j=i+1 ; (j<n-1)  ; j++){
            test = 0 ;
           for(int jj = j ;jj <n-1 && (test == 0) ; jj++){
             if(v[jj+1] - v[j] >= v[i]){

                s -= n-jj-1 ;
                test = 1 ;
             }

           }

        }


    }
    cout << s ;


    return 0 ;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <string>

using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)

int main() {
	ll d[1001] = {};
	d[1] = 1;
	ll N; cin >> N;

	repe(k, 2, N) {
		ll t = k;
		repe(i, 2, k) {
			while (t > 0) {
				if (t % i == 0) {
					d[i]++;
					t /= i;
				}
				else {
					break;
				}
			}
		}
	}
	ll ans = 1;
	repe(i, 2, 1000) {
		if (d[i] != 0) {
			ans = (d[i] + 1) * ans % 1000000007;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>


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; }

constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
//constexpr long long mod = 1000000007LL;
constexpr long long mod = 998244353LL;

using namespace std;
typedef long long ll;

int dh[] = { 1,0,-1,0 };
int dw[] = { 0,1,0,-1 };


vector<ll> dijkstra(int start, vector<vector<pair<int, ll>>>& graph) {
	vector<ll> dist(graph.size(), INF); dist[start] = 0;
	priority_queue<pair<ll, int>, vector<pair<ll, int>>, greater<pair<ll, int>>> pq; pq.emplace(0, start);
	while (!pq.empty()) {
		ll cost; int idx; tie(cost, idx) = pq.top(); pq.pop();
		if (dist[idx] < cost) continue;
		for (auto next : graph[idx]) if (chmin(dist[next.first], cost + next.second)) pq.emplace(dist[next.first], next.first);
	}
	return dist;
}


int main()
{

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int H, W; cin >> H >> W;
	int sh, sw; cin >> sh >> sw; sh--; sw--;
	int th, tw; cin >> th >> tw; th--; tw--;
	vector<string> vs(H); for (int i = 0; i < H; i++) cin >> vs[i];
	vector<vector<pair<int, ll>>> g(H * W);
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (vs[i][j] == '#') continue;
			for (int k = 0; k < 4; k++) {
				int nh = i + dh[k];
				int nw = j + dw[k];
				if (nh < 0 or nh >= H or nw < 0 or nw >= W) continue;
				if (vs[nh][nw] == '#') continue;
				g[i * W + j].emplace_back(nh * W + nw, 0);
			}
			for (int k = -2; k <= 2; k++) {
				for (int l = -2; l <= 2; l++) {
					int nh = i + k;
					int nw = j + l;
					if (nh < 0 or nh >= H or nw < 0 or nw >= W) continue;
					if (vs[nh][nw] == '#') continue;
					g[i * W + j].emplace_back(nh * W + nw, 1);
				}
			}
		}
	}
	auto d = dijkstra(sh * W + sw, g);
	ll res = d[th * W + tw];
	if (res == INF) res = -1;
	cout << res << endl;
}

Measured memory_bytes: 205988
n = int(input())
d = [int(i) for i in input().split()]
a = [0] * n
k = 0
for i in d:
    a[i] += 1
    k=max(k,i)
if d[0] != 0:
    print(0)
elif a[0] != 1:
    print(0)
else:
    j = 1
    for i in range(k):
        j *= a[i] ** a[i + 1]
        j %= 998244353
    print(j)


Measured memory_bytes: 14396
#include <iostream>
using namespace std;
int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int x;
	if (a > b) {
		if (a > c)
			x = a;
		else
			x = c;
	}
	else if (b > c)
		x = b;
	else
		x = c;
	if (x == a + b + c - x)
		cout << "Yes" << "\n";
	else
		cout << "No" << "\n";
}

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

using namespace std;


void solve() {
    int K, S; cin >> K >> S;
    
    int ans = 0;
    for (int x = 0; x <= K; x++) {
        for (int y = 0; y <= K; y++) {
            int z = S - x - y;
            if (0 <= z && z <= K) ans++;
        }
    }

    cout << ans << endl;
}


int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
ll M=1e9+7;


#define MAXN 10000005
ll spf[MAXN]; 
ll hash1[MAXN] = { 0 }; 
void sieve() 
{ 
	spf[1] = 1; 
	for (ll i = 2; i < MAXN; i++) 
		spf[i] = i; 
	for (ll i = 4; i < MAXN; i += 2) 
		spf[i] = 2; 
	for (ll i = 3; i * i < MAXN; i++) { 
		if (spf[i] == i) { 
			for (ll j = i * i; j < MAXN; j += i) 
				if (spf[j] == j) 
					spf[j] = i; 
		} 
	}
} 

void getFactorization(ll x) 
{ 
	ll temp; 
	while (x != 1) { 
		temp = spf[x]; 
		
		if (x % temp == 0) {
			hash1[spf[x]]++; 
			
			x = x / spf[x];
		} 
		while (x % temp == 0) 
			x = x / temp; 
	} 
} 

bool check(ll x) 
{ 
	ll temp; 
	while (x != 1) { 
		temp = spf[x]; 
		if (x % temp == 0 && hash1[temp] > 1) 
			return false; 
		while (x % temp == 0) 
			x = x / temp; 
	} 
	return true; 
} 
 
int main()
{
	ll n;
	cin>>n;
	sieve();
	vector<ll> vec(n+1,0);
	bool bb=1;
	for(ll i=1;i<=n;i++){
		cin>>vec[i];
		getFactorization(vec[i]);
	}
	
	for(ll i=1;i<=n;i++){
		if(check(vec[i])==0){
			bb=0;break;
		}
	}
	
	if(bb==1){
		cout<<"pairwise coprime"<<endl;
	}
	else{
		ll g=vec[1];
		for(ll i=2;i<=n;i++){
			g=__gcd(g,vec[i]);
		}
		if(g==1){
			cout<<"setwise coprime"<<endl;
		}
		else{
			cout<<"not coprime"<<endl;
		}
	}
	
}


Measured memory_bytes: 96820
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000000;
constexpr ll INF= 1e18;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;

int par[100010]; //親
int siz[100010]; //根ノードiの木に含まれる要素数。iが根ノード出ない場合無意味な値となる。

//n要素で初期化
void init(int n) {
	for(int i = 0;i < n;i++) {
		par[i] = i;
		siz[i] = 1;
	}
}

//木の根を求める
int find(int x) {
	if(par[x] == x) {
		return x;
	}
	else {
		return par[x] = find(par[x]);
	}
}

//ｘとｙの属する集合を併合
void unite(int x,int y) {
	x = find(x);
	y = find(y);
	if(x == y) {
		return;
	}
	if(siz[x] < siz[y]) {
		swap(x,y);
	}
	par[y] = x;
	siz[x] += siz[y];
}

//ｘとｙが同じ集合に属するか否か
bool same(int x,int y) {
	return find(x) == find(y);
}

int size(int x) {
	return siz[find(x)];
}

int main() {
    ll N,M;
    cin >> N >> M;
    init(N);
    vector<pair<int,int>> vec(M);
    for(int i = 0;i < M;i++) {
        int A,B;
        cin >> A >> B;
        A--;
        B--;
        vec.at(i) = make_pair(A,B);
    }
    reverse(vec.begin(),vec.end());
    vector<ll> ret(M);
    ret.at(0) = N * (N - 1) / 2;
    for(int i = 0;i < M - 1;i++) {
        int A = vec.at(i).first;
        int B = vec.at(i).second;
        if(same(A,B) == true) {
            ret.at(i + 1) = ret.at(i);
        }
        else {
            ret.at(i + 1) = ret.at(i) - size(A) * size(B);
            unite(A,B);
        }
    }
    reverse(ret.begin(),ret.end());
    for(int i = 0;i < M;i++) {
        cout << ret.at(i) << endl;
    }
}

Measured memory_bytes: 3712
#include <iostream>
#include <string.h>
using namespace std;

const int N = 18;
int n, a[2][N], fl[N];
int f[1 << N][N][2], Ans = 10000;

void upd(int &a, int b) {
    if(a > b) a = b;
}

int main() {
	iostream::sync_with_stdio(false);
	cin >> n;
	for(int i = 0; i < n; ++ i) cin >> a[0][i];
	for(int i = 0; i < n; ++ i) cin >> a[1][i];

	memset(f, 69, sizeof f);
	for(int i = 0; i < n; ++ i) f[1 << i][i][i & 1] = i;

	for(int mask = 1; mask < (1 << n); ++ mask) {
        memset(fl, 0, sizeof fl);
        for(int i = 0; i < n; ++ i) if(mask & (1 << i))
            for(int j = 0; j < i; ++ j) fl[j] ^= 1;

		for(int i = 0; i < n; ++ i) for(int d = 0; d < 2; ++ d) if((mask & (1 << i)) && (f[mask][i][d] < 10000)) {
			if(mask == (1 << n) - 1) {
                upd(Ans, f[mask][i][d]);
                continue;
			}

            int cnt = -1;
            for(int nxt = 0; nxt < n; ++ nxt) if((mask & (1 << nxt)) == 0) {
                ++ cnt;
                int sign = fl[nxt] ^ (cnt & 1);
                if(a[d][i] <= a[sign][nxt]) upd(f[mask ^ (1 << nxt)][nxt][sign], f[mask][i][d] + cnt);
            }
		}
	}
	cout << ((Ans < 10000) ? Ans : -1) << endl;
}


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

using namespace std;

int main(){
int N,K; cin >> N >> K;
  vector<long long> V(N);
  for(int i = 0; i < N; i++){ cin >> V[i];}
 
  long long ans = -1LL << 60;
  
  for(int a = 0; a <= min( N, K); a++){
    for(int b = 0; b <= min( N, K) - a; b++){
     vector<int> vec; long long res = 0;
      for(int i = 0; i < b; i++){
        vec.push_back(V[i]); res += V[i];}
      for(int j = N - a; j < N; j++){
        vec.push_back(V[j]); res += V[j];} 
     sort(vec.begin(),vec.end()); int cnt = 0;
      for(int i = 0; i < vec.size(); i++){
        if( vec[i] < 0 && cnt < ( K - ( a + b))){
          res += abs(vec[i]); cnt++;} //小さい順に K - ( a + b) こ分までは捨てられる
      }
      ans = max(ans, res);}}
      
  
  cout << ans << endl; return 0;}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file  
#include <ext/pb_ds/tree_policy.hpp>  
#include <functional> // for less  
using namespace         std;
#define                 int long long
#define                 double long double
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<'\n'
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define N 1014159
#define  vi vector<int>
#define  v  vector
#define die exit(0)
#define alln(arr) arr+1 , arr+1+n
using namespace __gnu_pbds;  
typedef tree<int, null_type, less<int>, rb_tree_tag,  
            tree_order_statistics_node_update> oset; 

int n,arr[N];

void solve()
{
    cin>>n;
    map<string,int>m;
    forn(i,1,n)
    {
    	string s;
    	cin>>s>>arr[i];
    	m[s] = i;
    }
    string s;
    cin>>s;
    int ans = 0;
    forn(i,m[s]+1,n)
    {
    	ans+=arr[i];
    }
    cout<<ans;

}


signed main() 
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 
    int t = 1;
    //cin>>t;
    forn(i,1,t)
    {
        solve();
        nl;
    }



    return 0;

}

//       clang++ c.cpp ; ./a.out < a.txt ;  

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

int main()
{
	int a,b;
	cin >> a >> b;
	if(a<b) cout <<"a < b"<<endl;
	else if(a>b) cout <<"a > b"<<endl;
	else if(a==b) cout << "a == b"<<endl; 
 	return 0;
}

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

class Dice{
public:
    int f[6];
    Dice(){}
    void roll_x(){ roll(1, 2, 4, 3);}
    void roll_y(){ roll(0, 2, 5, 3);}
    void roll_z(){ roll(0, 1, 5, 4);}
    void roll(int i, int j, int k, int l){
        int t= f[i]; f[i] = f[j]; f[j] = f[k]; f[k] = f[l]; f[l] = t;
    }
};

bool di( Dice d1, Dice d2){
    for(int i=0; i<6; i++)
        if(d1.f[i] != d2.f[i]) return false;
    return true;
    
}

bool equal( Dice d1, Dice d2 ){
    
    for(int i=0; i<6; i++){
        for(int j=0; j<4; j++){
            if( di(d1, d2)) return true;
            d1.roll_x();
        }
        
        if(i%2 == 0) d1.roll_y();
        else d1.roll_z();
    }
    
    return false;
}


Dice D[100];
int n;

bool differ(){
    for(int i=0; i< n-1; i++){
        for(int j=i+1; j<n; j++){ 
        if(equal(D[i], D[j])) return false;
        }
    }
    return true;
}

int main(){
    
    cin >> n;
    for(int i=0; i<n; i++){
        for(int j=0; j<6; j++){
            cin >> D[i].f[j];
        }
    }
    
    if(differ()) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
    
}





Measured memory_bytes: 3092
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    char s[6];
    RS(s);
    W((s[0]==s[1]||s[1]==s[2]||s[2]==s[3])?"Bad":"Good");
    return 0;
}


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

int main () {
  
  vector<string> line(3) ;
  
  for ( int i = 0 ; i < 3 ; i++ ) {
    cin >> line.at(i) ;
  }
  
  if ( line.at(0).at(line.at(0).size() -1) == line.at(1).at(0) && line.at(1).at( line.at(1).size()-1) == line.at(2).at(0)){
    cout << "YES" << endl ;
  } else {
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
n = int(input())
s = list(input())

r = s.count('R')
g = s.count('G')
b = n - r - g
ans = r*g*b

for i in range(n-2):
  for j in range(i+1,i+((n-i-1)//2)+1):
    if s[i] != s[j] and s[i] != s[2*j - i] and s[j] != s[2*j - i]:
      ans -= 1
      
print(ans)

Measured memory_bytes: 9208
"""
まず、最短距離が2であるような点の組み合わせの数が最も多くなるように木を作る。
そのあと、最短距離が2であるような点の組み合わせの数がKになるまで、辺を増やしていく。
"""

N,K = map(int,input().split())

if K > (N-1)*(N-2)//2:
    print(-1)
    exit()

ans = []
for i in range(1,N):
    ans.append((str(i),str(N)))

cnt = (N-1)*(N-2)//2
for i in range(1,N):
    for j in range(i+1,N):
        if cnt == K:
            break
        ans.append((str(i),str(j)))
        cnt -= 1
    else:
        continue
    break
print(len(ans))
for a in ans:
    print(" ".join(a))

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

using namespace std;
using ll =long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}
 
//Write From this Line

//const ll mod = 1e9+7;
//const ll mod = 998244353;
int main()
{
	string s, t;
	cin >> s >> t;
	// |s| >= |t|
	int ans = t.size();
	rep(i,s.size()){
		//s[i] から　s[i+t.size()]まで見る
		int num = 0;
		int tmp = 0;
		rep(j,t.size()){
			if(i+j >= s.size())continue;
			num++;
			if(s[i+j] != t[j]) tmp++;
		}
		if(num < t.size()) continue;
		else {
			ans = min(tmp,ans);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
int main() {
    int n;
    scanf("%d", &n);
    string s;
    cin >> s;

    int count[n + 1];
    // i文字目までにWがいくつあるか(1-indexed)

    // 累積和テーブル
    count[0] = 0;
    rep(i, n) {
        // その地点までの累積和だから前のcount[i]を代入してる
        count[i + 1] = count[i];
        // もしwなら加算
        if (s[i] == 'W') ++count[i + 1];
    }

    int ans = n;
    for (int i = 1; i <= n; ++i) {
        // 自分より西にいて西を向いている人が
        //  count[i-1]人
        // 自分より東にいて東を向いている人が
        //  (n-i)-(count[n]-count[i])人
        ans = min(ans, count[i - 1] + (n - i) - (count[n] - count[i]));
    }

    printf("%d\n", ans);
}

Measured memory_bytes: 5052
#include <cstdio>
using namespace std;
bool memo[100005];
int main(){
    memo[0]=true;
    for (int x=100;x<=105;x++){
        for (int y=x;y<100005;y++){
            memo[y]|=memo[y-x];
        }
    }
    
    int n;
    scanf("%d",&n);
    printf("%d\n",memo[n]);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a, b;
	cin >> a >> b;

	int ans=-1;
	for(int i=1; i<=1250; ++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>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
using ll = long long;
 
int main(){
	int a, b;
  	cin >> a >> b;
  	int ans = max(a - 2*b, 0);
   	cout << ans << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define MOD (int)1e9+(int)7
#define INF 2147483647
typedef long long ll;
typedef unsigned long long ull;

//dark power
//#define int ll
//define Error、大抵は、セミコロン忘れとか、Defineは関係ない
/*
vector<int> d(100000);
vector<int> b(100000);
class UnionFind{
	public:
	UnionFind(signed n){rep(i,n){d[i]=i;b[i]=0;}}
	signed find(signed x){
		if(d[x]==x){
			return x;
		}else{
			return d[x]=find(d[x]);
		}
	}
	UnionFind(signed n){rep(i,n){d[i]=i;b[i]=0;}}
	void unite(signed x,signed y){
		x=find(x);
		y=find(y);
		if(x==y)return;
		if(b[x]<b[y]){
			d[x]=y;
		}else{
			d[y]=x;
			if(b[x]==b[y])b[x]++;
		}
	}
	bool same(signed x,signed y){return (find(x)==find(y));}
};
*/
ull s[51];
ull p[51];
ull now=0;
signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	ull x;
	cin>>n>>x;
	s[0]=1;
	p[0]=1;
	ull mid;

	rep(i,1,51){s[i]=(2*s[i-1])+3;p[i]=(2*p[i-1])+1;}

	for( int i=n;i>=0;i--){
		if(x<=0)break;
//		if(i!=0&&x<=1)break;
		mid=s[i]/2+1;
		if(mid==x){now+=p[i-1]+1;break;}
		if(mid>x){x=x-1;}
		if(mid<x){x=x-s[i-1]-2;now=now+1+p[i-1];}
	}
	cout<<now<<endl;

	return 0;
}


Measured memory_bytes: 256
module mod_radix_sort
  implicit none
  integer, private, parameter :: intkind = 4
  integer, private, parameter :: nbit = 8
  integer, private, parameter :: upper = lshift(1, nbit) - 1
contains
  subroutine radix_sort(a)
    integer(intkind), intent(inout) :: a(:)
    integer(intkind), allocatable :: queue(:, :)
    integer :: n, m, i, j, k, cnt(0:upper)
    n = size(a)
    m = 0
    do i = 0, 8 * intkind - 1, nbit
      cnt = 0
      do j = 1, n
        k = and(rshift(a(j), i), upper)
        cnt(k) = cnt(k) + 1
      end do
      m = max(m, maxval(cnt))
    end do
    allocate(queue(m, 0:upper))
    do i = 0, 8 * intkind - 1, nbit
      cnt = 0
      do j = 1, n
        k = and(rshift(a(j), i), upper)
        cnt(k) = cnt(k) + 1
        queue(cnt(k), k) = a(j)
      end do
      k = 0
      do j = 0, upper
        if (cnt(j) == 0) cycle
        a(k + 1:k + cnt(j)) = queue(1:cnt(j), j)
        k = k + cnt(j)
      end do
    end do
  end
end module mod_radix_sort
program chat_in_a_circle
  use mod_radix_sort
  implicit none
  integer :: n, a(200000) = 0, i, j
  integer(8) :: b(200000) = 0
  read(*,*) n
  read(*,*) a(1:n)
  call radix_sort(a(1:n))
  j = n
  do i = n, 1, -1
    b(j) = a(i)
    j = j - 1
    if (j == 0) exit
    b(j) = a(i)
    j = j - 1
    if (j == 0) exit
  end do
  b(n) = 0
  write(*,'(i0)') sum(b(1:n))
end program chat_in_a_circle

Measured memory_bytes: 6948
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> l(n);
    for(int i = 0; i < n; i++){
        cin >> l[i];
    }

    sort(l.begin(), l.end());
    int sum = accumulate(l.begin(), l.end() - 1, 0);
    if(l[n - 1] < sum){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
function checkMod2(val, index){
    if(val % Math.pow(2, index + 1) === 0){
        return checkMod2(val, index + 1);
    }
    return index;
}

function main(input) {
    var lines = input.split('\n');
    var N = parseInt(lines[0]);
    var array = lines[1].split(' ');
    var sum = 0;

    array.forEach(function(str){
        var val = parseInt(str);
        var checkedVal = checkMod2(val, 0);
        sum += checkedVal;
    });

    console.log(sum);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7756
#include <bits/stdc++.h>
using namespace std;
int main() {
  char s, a;
  cin >> s;
  if(s == 'A') a = 'T';
  else if(s == 'T') a = 'A';
  else if(s == 'G') a = 'C';
  else if(s == 'C') a = 'G';
  cout << a << endl;
  return 0;
}

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

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORd(i, a, b) for (int i = (a) ; i >= (b); i--)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define sp system("pause")
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
const int N = (int) 1e5 + 10;
void TimeExecution() {
    cout << "\n\n===>> Time Execution: " << clock() / (double)1000 << " sec(s).";
}
int t;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    /*
    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
    */
    int h, n;
    cin >> h >> n;
    int x, s = 0;
    FOR(i, 1, n)
    {
        cin >> x;
        s += x;
    }
    if(s >= h) cout << "Yes";
    else cout << "No";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n;
long long a[100005];
long long ruia[100006];
long long ans = 0;
long long nowleef = 1;
int main(){
    cin >> n;
    for(long long i = 0;i<n+1;i++){
        cin >> a[i];
    }
    for(long long i = 0;i<n+1;i++){
        ruia[n-i] = ruia[n-i+1] + a[n-i];
    }
    for(long long i = 0;i<n+1;i++){
        if(nowleef>ruia[i]){
            ans = -1;
            break;
        }
        ans += nowleef;
        if(nowleef<a[i]){
            ans = -1;
            break;
        }
        nowleef -= a[i];
        nowleef = min(nowleef*2LL,ruia[i+1]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5180
n = int(input())
amari = 0
i = 0
result = []
while i <= 40:
  if i ==0:
   hoge =  n % 2
   if hoge ==1:
      result.append(1)
      amari = 1
      i += 1
   else:
    result.append(0)
    i += 1
  else:
    hoge = n % (2**(i+1))
    if (amari + (-2)**(i)) % (2**(i+1)) == hoge:
      result.append(1)
      amari = amari + (-2)**(i)
      i += 1
    else:
      result.append(0)
      i += 1
      
result = result[::-1]
if n == 0:
  print(0)
else:
  s = ""
  check = False
  for r in result:
    if r == 0 and check == True:
      s += str(r)
    if r == 1:
      s += str(r)
      check = True
  print(int(s))
   
  

    


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

void main_()
{
    ll N, M;
    cin >> N >> M;

    set<ll> s1;
    set<ll> s2;
    for (ll i = 0; i < M; i++) {
        ll a, b;
        cin >> a >> b;
        if (a == 1) {
            s1.insert(b);
        }
        if (b == N) {
            s2.insert(a);
        }
    }

    set<ll> r;
    set_intersection(
        begin(s1), end(s1),
        begin(s2), end(s2),
        inserter(r, begin(r)));

    cout << (r.empty() ? "IMPOSSIBLE\n" : "POSSIBLE\n");
}
int main()
{
    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    main_();
    return 0;
}


Measured memory_bytes: 9600
import sys 
N, M = map(int, input().split())
X = list(map(int, input().split()))

X = sorted(X)

anslis = []


if M <= N:
    print(0)
    sys.exit()


    
for i in range(M-1):
    ans = abs(X[i+1] - X[i])
    anslis.append(ans)
    ans = 0

anslis = sorted(anslis)

if N==1:
    print(sum(anslis))
else:
    print(sum(anslis[0:M-N]))

Measured memory_bytes: 92420
#include <iostream>
//#include <set>
//#include <map>
//#include <iomanip>
#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
#include <vector>
//#include <string>
//#include <unordered_map>
//typedef long long LL;
//typedef long double LD;
using namespace std;

//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1

int main() {
    int n;
    int m;
    int x;
    int y;
    vector<int> xs;
    vector<int> ys;
    int tmp_x;
    int tmp_y;
    cin >> n >> m >> x >> y;
    for(int i=0; i<n; i++){
        cin >> tmp_x;
        xs.push_back(tmp_x);
    }
    xs.push_back(x);
    for(int i=0; i<m; i++){
        cin >> tmp_y;
        ys.push_back(tmp_y);
    }
    ys.push_back(y);
    sort(xs.begin(), xs.end());
    sort(ys.begin(), ys.end());
    if(xs[n]>=ys[0]){
        cout << "War" << endl;
    }else{
        cout << "No War" << endl;
    }

    return 0;
}

Measured memory_bytes: 256