akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <stddef.h>
#include <stack>
#include <queue>

using namespace std;


int main() {
	int m, f, r;
	

	while(1) {
		cin >> m >> f >> r;
		if (m == -1 && f == -1 && r == -1) break;
		if (m == -1 || f == -1) cout << 'F' << endl;
		else if (m + f >= 80) cout << 'A' << endl;
		else if (m + f < 80 && m + f >= 65) cout << 'B' << endl;
		else if (m + f < 65 && m + f >= 50) cout << 'C' << endl;
		else if (m + f < 50 && m + f >= 30) {
			if (r >= 50) cout << 'C' << endl;
			else cout << 'D' << endl;
		}
		else cout << 'F' << endl;
	}
}

Measured memory_bytes: 1152
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

typedef unsigned long long ULL;

void process();
int main(){
    int X,Y;
    int x;
    cin >> X >> Y;

    x = ( Y - 4 * X) / (-2);
    if( x >= 0 && x <= X && 2 * x + 4 * (X - x)  == Y){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    process();
}
void process(){

}

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


int main(void){
    int H,W;
    cin >> H >> W;
    
    vector<string> A(H);
    for(int i=0; i<H; i++) cin >> A[i];

    for(int i=0; i<H; i++){
        cout << A[i] << endl << A[i] << endl;
    }

    return 0;
}

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

int main() {
  long a, b, r, x, tmp;
  cin >> a >> b;

  x = a * b;

  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }

  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }

  cout << x / b << endl;
}

Measured memory_bytes: 256
if __name__ == '__main__':
    whn = list(map(int,input().split()))
    
    a = [0, whn[0], 0, whn[1]]
    for n in range(whn[2]):
        t = list(map(int,input().split()))
        if t[2] == 1:
            a[0] = max(a[0], t[0])
        elif t[2] == 2:
            a[1] = min(a[1], t[0])
        elif t[2] == 3:
            a[2] = max(a[2], t[1])
        elif t[2] == 4:
            a[3] = min(a[3], t[1])
    if a[1] < a[0] or a[3] < a[2]:
        print(0)
    else:
        print((a[1]-a[0])*(a[3]-a[2]))

Measured memory_bytes: 3064
n,m=map(int,input().split())
s=list(map(int,input().split()))
t=list(map(int,input().split()))
dp=[[1]*(m+1)for _ in range(n+1)]
dp[0][0]=1
for i in range(1,n+1):
    for j in range(1,m+1):
        dp[i][j]=dp[i-1][j]+dp[i][j-1]
        if s[i-1]!=t[j-1]:
            dp[i][j]-=dp[i-1][j-1]
        dp[i][j]%=10**9+7
print(dp[n][m])

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


int main() {
    double A,V,B,W,T;
    cin >> A >> V >> B >> W >> T ;

    double sec = 0;

    if(W-V == 0 || W-V>0) { cout << "NO" << endl;}

    else{

    sec = (max(A,B)-min(A,B))/(V-W);

    if(sec<=T) cout << "YES" << endl;
    else cout << "NO" << endl;
    }


}

Measured memory_bytes: 3724
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	void solve() throws IOException {
		solve(ni(), ni());
	}

	private void solve(int n, int m) {
		out.println((n + m == 15) ? "+" : (n * m == 15) ? "*" : "x");

	}

	String ns() throws IOException {
		while (!tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine(), " ");
		}
		return tok.nextToken();
	}

	int ni() throws IOException {
		return Integer.parseInt(ns());
	}

	long nl() throws IOException {
		return Long.parseLong(ns());
	}

	double nd() throws IOException {
		return Double.parseDouble(ns());
	}

	String[] nsa(int n) throws IOException {
		String[] res = new String[n];
		for (int i = 0; i < n; i++) {
			res[i] = ns();
		}
		return res;
	}

	int[] nia(int n) throws IOException {
		int[] res = new int[n];
		for (int i = 0; i < n; i++) {
			res[i] = ni();
		}
		return res;
	}

	long[] nla(int n) throws IOException {
		long[] res = new long[n];
		for (int i = 0; i < n; i++) {
			res[i] = nl();
		}
		return res;
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		tok = new StringTokenizer("");
		Main main = new Main();
		main.solve();
		out.close();
	}
}

Measured memory_bytes: 22356
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <math.h>
#include <queue>
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll;
using namespace std;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    sort(p.begin(),p.end());
    int sum=0;
    rep(i,k) sum+=p[i];
    cout << sum << endl;
}

Measured memory_bytes: 3168
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    H, W = map(int, readline().split())
    C = [readline().strip() for _ in range(H)]

    ans = [0] * (2 * H)
    for i in range(2 * H):
        ans[i] = C[i // 2]

    print(*ans, sep='\n')

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9184
#include<iostream>
using namespace std;
int main()
{
    long long a,b,k;
    cin>>a>>b>>k;
    if(k<=a){
        cout<<a-k<<" "<<b<<endl;
    }
    else if(k<=(a+b)){
        cout<<0<<" "<<b-(k-a)<<endl;
    }
    else{
        cout<<0<<" "<<0<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <set>
#include <map>
#define INF 1000000000
#define rep(i,n) for(int i =0;i<n;i++)
using namespace std;
typedef long long int ll;


int main(){
    for (;;) {
        int n,m,p;
        cin >> n >> m >> p;
        if(!n and !m and !p)break;
        double sum=0;
        int num=1;
        for (int i=0; i<n; i++) {
            int a;
            cin >> a;
            sum += a*100;
            if(i==m-1)num=a;
        }
        if(num==0){
            cout << 0<<endl;
            continue;
        }
        double rep = sum * (100.0-p) / 100.0;
        int ans = rep/num;
        cout << ans << endl;
    }
}

Measured memory_bytes: 1160
import sys
readline = sys.stdin.buffer.readline

N = int(readline())
A = [[] for _ in range(N)]

for i in range(N):
    count = int(readline())
    for j in range(count):
        x, y = map(int, readline().split())
        x -= 1
        A[i].append([x, y])


ans = 0
for i in range(2**N):
    good = [0] * N
    f = 1
    for j in range(N):
        if (i >> j) & 1:
            good[j] = 1

    for k in range(N):
        if good[k]:
            for x, y in A[k]:
                if good[x] != y:
                    f = 0
    if f:
        ans = max(ans, sum(good))

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <string>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    int N, M;
    cin >> N >> M;
    VEC(int) need = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};
    VEC(int) good(M);
    READVEC(good);
    sort(ALL(good));
    reverse(ALL(good));

    VEC(int) dp(N + 1, -1);
    dp[0] = 0;
    FOR(i, 1, N + 1) {
        for(int g : good)
            if (need[g] <= i && dp[i - need[g]] >= 0)
                dp[i] = max(dp[i], 1 + dp[i - need[g]]);
    }

    while (N > 0) {
        int digits = dp[N];
        for(int g : good)
            if (need[g] <= N && dp[N - need[g]] >= 0 &&
                    digits == 1 + dp[N - need[g]]) {
                cout << g;
                N -= need[g];
                break;
            }
    }

    cout << endl;
    return 0;
};


Measured memory_bytes: 256
def main():
    n, k, q = map(int, input().split())
    a = [int(input()) for _ in range(q)]
    ans = solve(n, k, q, a)
    for i in range(n):
        print('Yes' if ans[i] > 0 else 'No')


def solve(n, k, q, a):
    score = [k - q for _ in range(n)]
    for i in range(q):
        score[a[i] - 1] += 1
    return score


if __name__ == '__main__':
    main()

Measured memory_bytes: 11776
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
#define showm(m) for(auto i: m){cout << m.x << " ";}
typedef long long ll;
typedef pair<int, int> P;
long mod = 1000000007;
/* C++の構造体 メンバがpublicなclass */
typedef struct mint
{
    ll x;
    mint(ll x = 0) : x(x % mod) {} //コンストラクタ
    /* 演算子オーバーロード */
    mint &operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const
    {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const
    {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const
    {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const
    {
        return pow(mod - 2);
    }
    mint &operator/=(const mint a)
    {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const
    {
        mint res(*this);
        return res /= a;
    }
} mint_t;

mint ans = 0;
int k;
void dfs(const vector<vector<int>>&graph, int now, int from){
    if (graph[now].size() == 1 && from != -1) return;

    int color_var;
    int child_num;
    if(from == -1){
        color_var = k - 1;
        child_num = graph[now].size();
    } else {
        color_var = k - 2;
        child_num = graph[now].size() - 1;
    }
    if (graph[now].size() >= k){
        ans = 0;
        return;
    }
    rep(i, child_num){
        ans *= color_var-i;
        //cout << ans.x << " "<< now << endl;
    }
    for (auto next: graph[now])
    {
        if (next == from) continue;
        dfs(graph, next, now);
    }
    
}

int main()
{
    int n;cin >> n >> k;
    vector<vector<int>> graph(n);
    rep(i, n - 1){ 
        int a, b; cin>>a>>b;a--;b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    ans = k;    
    dfs(graph, 0, -1);
    cout << ans.x << endl;
}



Measured memory_bytes: 9216
#define y1 askjdkasldjlkasd
#include <bits/stdc++.h>
#undef y1

using namespace std;

#define pb push_back
#define mp make_pair
#define fi(a, b) for(int i=a; i<=b; i++)
#define fj(a, b) for(int j=a; j<=b; j++)
#define fo(a, b) for(int o=a; o<=b; o++)
#define fdi(a, b) for(int i=a; i>=b; i--)
#define fdj(a, b) for(int j=a; j>=b; j--)
#define fdo(a, b) for(int o=a; o>=b; o--)
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;

#ifdef LOCAL
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...) while (0)
#endif

double START_TIME;

void exit() {
#ifdef LOCAL	
	cerr << "TIME: " << setprecision(5) << fixed << (clock() - START_TIME) / CLOCKS_PER_SEC << endl;
#endif	
	exit(0);
}

template<typename A, typename B>
ostream& operator<<(ostream& os, pair<A, B> p) {
	os << "(" << p.first << ", " << p.second << ")";
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, vector<T> v) {
	fi(0, sz(v) - 1) {
		os << v[i] << " ";
	}
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T> t) {
	for (auto z : t) {
		os << z << " ";
	}
	return os;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
	cerr << endl;
	for (auto z : t) {
		os << "\t" << z.first << " -> " << z.second << endl;
	}
	return os;
}

#ifdef LOCAL
#define dbg(x) {cerr << __LINE__ << "\t" << #x << ": " << x << endl;}
#define dbg0(x, n) {cerr << __LINE__ << "\t" << #x << ": "; for (int ABC = 0; ABC < n; ABC++) cerr << x[ABC] << ' '; cerr << endl;}
#else
#define dbg(x) while(0){}
#define dbg0(x, n) while(0){}
#endif

#ifdef LOCAL
#define ass(x) if (!(x)) { cerr << __LINE__ << "\tassertion failed: " << #x << endl, abort(); }
#else
#define ass(x) assert(x)
#endif

///////////////////////////////////////////////////

vi vn, vp;
int n;

vpii answer;
int ans;

void print() {
	printf("%d\n", ans);
	for (auto z : answer) {
		printf("%d %d\n", z.first, z.second);
	}
}

void solve () {
	sort(vn.begin(), vn.end());
	sort(vp.begin(), vp.end());
	if (sz(vn) > 0 && sz(vp) > 0) {
		ans = vp.back();
		fi(0, sz(vp) - 2) {
			answer.pb(mp(vn[0], vp[i]));
			vn[0] -= vp[i];			
		}	
		fi(0, sz(vn) - 1) {
			answer.pb(mp(ans, vn[i]));
			ans -= vn[i];
		}
    print();
	} else if (sz(vn) > 0) {
		ans = vn.back();
		fi(0, sz(vn) - 2) {
			answer.pb(mp(ans, vn[i]));
			ans -= vn[i];
		}
		print();
	} else {
		if (sz(vp) == 2) {
			ans = vp[1] - vp[0];
			answer.pb(mp(vp[1], vp[0]));
		} else {
			ans = vp.back();
			fi(1, sz(vp) - 2) {
				answer.pb(mp(vp[0], vp[i]));
				vp[0] -= vp[i];
			}
			answer.pb(mp(ans, vp[0]));
			ans -= vp[0];			
		}
		print();
	}
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	START_TIME = (double)clock();
#endif
	
	scanf("%d", &n);
	fi(0, n - 1) {
		int x;
		scanf("%d", &x);
		if (x <= 0) {
			vn.pb(x);
		} else {
			vp.pb(x);
		}
	}
	solve();

	exit();
	return 0;
}





Measured memory_bytes: 3444
#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;
	
	ll n;
	cin>>n;
	ld a = ceil(n/1.08);
	if(ll(a*1.08)==n) cout<<ll(a)<<"\n";
	else cout<<":(\n";


}


Measured memory_bytes: 3648
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>

typedef long long ll;

using namespace std;

double calculate_len(int* r, int n)
{
	double t = 0;
	for (int i = 1; i < n; ++i)
		t += sqrt((double)r[i-1] * r[i]);
	return r[0] + r[n-1] + 2*t;
}
int main()
{
	while (true)
	{
		char buf[256];
		cin.getline(buf, sizeof(buf));
		if (strlen(buf) == 0)
			break;

		istringstream is(buf);
		int len, radius[16], n;
		is >> len;
		for (n = 0; is >> radius[n]; ++n)
			;

		sort(radius, radius + n);
		int r[16];
		int i, j, k;
		for (i = 0, j = n/2-1, k = 2; j >= 0 && j < n; ++i, j += k, k = -k/abs(k)*(abs(k)+2))
			r[j] = radius[i];
		for (i = n-1, j = n/2, k = -2; j >= 0 && j < n; --i, j += k, k = -k/abs(k)*(abs(k)+2))
			r[j] = radius[i];
		double ans = calculate_len(r, n);
		if (n & 1)
		{
			for (i = n-1, j = n/2-1, k = 2; j >= 0 && j < n; --i, j += k, k = -k/abs(k)*(abs(k)+2))
				r[j] = radius[i];
			for (i = 0, j = n/2, k = -2; j >= 0 && j < n; ++i, j += k, k = -k/abs(k)*(abs(k)+2))
				r[j] = radius[i];
			ans = min(ans, calculate_len(r, n));
		}

		if (ans <= len+1e-4)
			puts("OK");
		else
			puts("NA");
	}

	return 0;
}

Measured memory_bytes: 0
N = int(input())
s_list = [input() for _ in range(N)]

ans = 0
start_B = 0
end_A = 0
B_A = 0
for s in s_list:
  ans += s.count("AB")
  if s[0] == "B" and s[-1] == "A":
    B_A += 1
  elif s[0] == "B":
    start_B += 1
  elif s[-1] == "A":
    end_A += 1

if B_A > 0 and start_B + end_A == 0:
  ans += B_A - 1
else:
  ans += min(start_B, end_A) + B_A

print(ans)

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

#include<ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int mod = (int)1e7+9;
#define REP0(i,n) for(int i=0;i<n;i++)
#define REP(i,a,n) for(int i=a;i<=n;i++)
#define F first
#define S second
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define setbits(x) __builtin_popcountll(x)
#define inf (int)(1e18)
#define prec(x) fixed<<setprecision(x)<<x
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define all(x) x.begin(),x.end()

const int d4i[4]={-1, 0, 1, 0}, d4j[4]={0, 1, 0, -1};
const int d8i[8]={-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8]={0, 1, 1, 1, 0, -1, -1, -1};

void solve(){
   string s;
   cin>>s;
   if(s[s.size()-1] != 's'){
       cout<<s<<"s"<<endl;
   }
   else{
       cout<<s<<"es"<<endl;
   }
}


int main(){
    fastio;
    #ifndef ONLINE_JUDGE
        //freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif
    int tc = 1;
    // cin>>tc;
    for(int i=1;i<=tc;i++){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3660
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <algorithm>
#include <set>
#include <string>
#include <queue>
#include <utility>

#define rep(i, N) for(int (i) = 0; (i) < (N); (i) ++)
typedef long long ll;

using namespace std;
typedef pair<ll, int> mc;

int main(){
    int n, m, d;
    cin >> n >> m >> d;
    double exp = (n - d) * 2.0 / n / n;
    if(d == 0){
        exp = 1.0 / n;
    }
    double ans = 1.0 * (m - 1.0) * exp;
    cout << fixed;
    cout.precision(10);
    cout << ans << endl;

    return 0;

}


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

int main(){
    int n,y;
    cin >> n >> y;
    int r = y/1000 -n;
    int a=-1, b=-1, c=-1;
    for(int i=0; 9*i<=r; i++){
        if((r-9*i)%4 == 0 && i+(r-9*i)/4 <= n){
            a = i;
            b = (r-9*i)/4;
            c = n-a-b;
            break;
        }
    }
    cout << a << " " << b << " " << c << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {

	static BufferedReader reader;
	final static boolean MODE_DEBUG = false;
	//static field here
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		//code here
		int[] X = readLineInt();
		int N = X[0];
		
		print(Math.PI*N*2);
		//String[] s = readLine();
		//print(num);
	}
	
	//functions here
	//note that all methods should be STATIC


	private static <T> int arraySearch(T needle, T[] heystack) {
		for(int i=0;i<heystack.length;i++) {
			if(needle.equals(heystack[i])) {
				return i;
			}
		}
		return -1;
	}
	private static int[] sort(int[] base) {
		int[] copy = array_copy(base);
		Arrays.sort(copy);
		return copy;
	}
	private static int[] array_copy(int[] base) {
		int[] copy = new int[base.length];
		for(int i=0;i<base.length;i++) {
			copy[i] = base[i];
		}
		return copy;
	}
	private static int[] asArray(ArrayList<Integer> ints) {
		int[] intlist = new int[ints.size()];
		for(int i=0;i<intlist.length;i++) {
			intlist[i] = ints.get(i);
		}
		return intlist;
	}
	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static int[] readLineInt(){
		try{
			String[] s = readLine();
			int[] ints = new int[s.length];
			for(int i=0;i<ints.length;i++) {
				ints[i] = Integer.parseInt(s[i]);
			}
			return ints;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static byte[] readLineByte(){
		try{
			String[] s = readLine();
			byte[] bytes = new byte[s.length];
			for(int i=0;i<bytes.length;i++) {
				bytes[i] = Byte.parseByte(s[i]);
			}
			return bytes;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static char[] readLineChar(){
		try{
			String[] s = readLine();
			char[] chars = new char[s.length];
			for(int i=0;i<chars.length;i++) {
				chars[i] = (char)Integer.parseInt(s[i]);
			}
			return chars;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
	private static void printd(Object o){
		if(MODE_DEBUG)System.err.println(o);
	}
	private static void printd(){
		if(MODE_DEBUG)System.err.println();
	}
}


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

#define pi 3.141592654
#define fix(n) cout << fixed << setprecision(n)

#define rep(i,a,b) for(int i=a;i<b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)

#define si(d)  scanf("%d",&d)
#define sll(d) scanf("%lld",&d)
#define pin(d) printf("%d\n",d)
#define pln(d) printf("%lld\n",d)
#define nl 	   printf("\n")

#define ll  long long
#define ull unsigned long long

#define mp make_pair
#define pb push_back
#define fi first
#define se second

#define vi      vector<int>
#define pii     pair<int,int>
#define piii    pair<pair<int,int>,int>
#define all(v)  v.begin(), v.end()

#define chalne_de continue
int mod = 1000000007;
const int N = 1000005;

// gcd
ll gcd(ll a , ll b)
{
    if ( b == 0)
    return a;
    return gcd( b, a % b);
}
/*
ll lcm(ll a, ll b)
{
    ll x = gcd(a,b);
    a /= x;
    return a * b;
}
vector<pii> v[N];
ll inf = 1e18;
ll dist[N];
int bfs(int s)
{


    set<pii > st;
   st.insert({0,s});
    for (int i =0; i < N; i++)
        dist[i] = inf;
    dist[s] = 0;
    while ( !st.empty())
    {
        pii p = *st.begin();
        s = p.se;
        st.erase(st.begin());
        for ( int i = 0; i < v[s].size(); i++)
        {
                int w = v[s][i].se;
                if (dist[v[s][i].fi] > dist[s] + w)

                {
                    //visited[sx+ax[i]][sy+ay[i]] = 1;
                    if(dist[v[s][i].fi] != inf)
                    st.erase(st.find({dist[v[s][i].fi] ,i}));
                   dist[v[s][i].fi] = dist[s] + w;
                    st.insert({dist[v[s][i].fi],v[s][i].fi});
                }
            }
        }

}
*/
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll n;
    cin >> n;
    a *= 4;
    b *= 2;
    ll x = min(a,min(b,c));
    ll ans = 0;
    if ( n % 2 == 0)
    {
        ll fir = n / 2 * d;
        ll sec = n * x;
        ans = min(fir,sec);
    }
    else
    {
     ll fir = n / 2 * d + x;
        ll sec = n * x;
        ans = min(fir,sec);   
    }
    cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#define PII pair<int,int>
#define MP make_pair
#define fir first
#define sec second
#define PB push_back
#define db long double
#define ll long long
using namespace std;
template <class T>
inline void rd(T &x) {
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)) { if(c=='-') f=-1; c=getchar(); }
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}
const int N=200010;
char str[N];
int main() {
	scanf("%s",str+1);
	int n=strlen(str+1);
	ll ans=0;
	for(int j=n;j>=1;--j) {
		int cur=0,i=j;
		while(i>=1) {
			if(str[i]=='A') ans+=cur,--i;
			else if(i>1&&str[i]=='C'&&str[i-1]=='B') cur++,i-=2;
			else break;
		}
		j=i;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n,k;
    cin>>n>>k;
    vector<double>p(n);
    rep(i,n){
        cin>>p[i];
        p[i]++;
        p[i]/=2;
    }
    double ans=0;
    for(int i=0; i<k; ++i){
        ans+=p[i];
    }
    double cnt=ans;
    for(int i=1; i<=n-k; ++i){
        cnt+=-p[i-1]+p[i+k-1];
        ans=max(ans,cnt);
    }
    cout<<fixed<<setprecision(15)<<ans<<endl;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(signed i=0;i<n;++i)
#define int long long
#define str string
#define vint vector<signed>
#define pint pair<signed,signed>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define yn(b) cout<<((b)?"Yes":"No")<<endl
#define YN(b) cout<<((b)?"YES":"NO")<<endl
#define call(a) for(auto t:a)cout<<t<<" ";cout<<endl
#define ENDL printf("\n");
#define debg(a) cout<<#a<<":"<<a<<endl;

signed main(){
  int n,m;
  cin>>n>>m;
  if(n>=2&&m>=2){
    int ans=n*m;
    ans-=2*n+2*m;
    ans+=4;
    cout<<ans<<endl;
  }
  else if(n==m){
    cout<<n<<endl;
  }
  else {
    cout<<(max(n,m)-2)<<endl;
  }  
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) (a).begin(),(a).end()
#define print(A,x,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i]x;}cout<<endl;
#define pprint(A,y,m,n) rep(j,0,m){print(A[j],y,n);}
const long mod=1e9+7;
const int size=1e5;
const int inf=1e9+1;
int main(){
	int N;cin>>N;
	int P[N];cin>>P[0];
	int cnt=1;int res=P[0];
	rep(i,1,N){
		cin>>P[i];
		if(res>=P[i]) cnt++;
		res=min(res,P[i]);
	}cout<<cnt<<endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
	int s,ans=0,x=0;
	cin>>s;
	if(s==1||s==2||s==4)x=s;
	else x=4;
	for(;;){
		ans++;
		if(s==x){
			cout<<ans+3<<endl;
			return 0;
        }
		if(s%2==0)
			s=s/2;
		else
          s=s*3+1;
    }
}

Measured memory_bytes: 256
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


s = input()
n = len(s)
def run_length(s):
    if not s:
        return []
    c = s[0]
    v = 1
    n = len(s)
    l = []
    for i in range(1, n):
        if c==s[i]:
            v += 1
        else:
            l.append((c,v))
            c = s[i]
            v = 1
    l.append((c,v))
    return l
l = run_length(s)
ans = []
while l:
    ll,rr = l.pop()[1], l.pop()[1]
    tmp = [0]*(rr+ll)
    tmp[rr-1] = (rr-1)//2 + (ll)//2 + 1
    tmp[rr] = rr+ll - tmp[rr-1]
    ans.append(tmp)
res = []
for i in range(len(ans)-1, -1, -1):
    res.extend(ans[i])
write(" ".join(map(str, res)))

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

	#define start_routine() int begtime = clock();
	#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
	#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
	#define exit(a, b) return cout << a, b;

	#define PB push_back
	#define MP make_pair

	#define sd(n) scanf("%lld", &n)
	#define pdn(n) printf("%lld\n", n);
	#define pds(n) printf("%lld ", n);
	#define endl '\n'

	#define forn(a, b, i) for (int i = a; i < b; i += 1)
	#define all(v) v.begin(), v.end() 

	using vi = vector<int>;
	using vb = vector<bool>;
	using pii = pair<int, int>;
	using mii = map<int, int>;

	#define print(stuff) cout << stuff << endl
	#define len(stuff) stuff.size()

	#define int long long
	#define float long double 

	const int upper = 4e5 + 2;
	const int M = (int) 1e9 + 7;
	const int inf = (int) 1e17;
	const double eps =  1e-8;

	map<int, int> primecnt;
	signed main () {
		start_routine();
		speed();
		#ifndef ONLINE_JUDGE
		// freopen("input.txt", "r", stdin);	
		// freopen("output.txt", "w", stdout);
		// freopen("errlog.txt", "w", stderr);
		#endif

		int ans = 0;
		for (int i=0; i<4; i += 1) {
			char c; cin >> c;
			if (c == '2') ans += 1;
		}
		cout << ans;
	 	end_routine();	
	}

Measured memory_bytes: 256
k = int(input())


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


ans = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        for l in range(1, k + 1):
            ans += gcd(gcd(i, j), l)
print(ans)


Measured memory_bytes: 76896
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long ll;
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;}
typedef pair<int,int> P;


int main(){
    int n; cin>> n;
    map<int,int>mp;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
        mp[a[i]]++;
    }
    ll MAX=0;
    for(auto its:mp){
            ll k = its.second;
            MAX += k*(k-1)/2;
    }
    
    rep(i,n){
        ll k = mp[a[i]];
        cout << MAX - k*(k-1)/2 +(k-1)*(k-2)/2 <<endl;
    }
    return 0;
}


Measured memory_bytes: 9536
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <map>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;++i)
#define mod 1000000007

int main(){
  ll n,p;
  cin >> n >>p;
  ll a[100]={0};
  bool alleven=true;
  rep(i,n){
    cin >> a[i];
    if(a[i]%2==1)alleven=false;
  }
  ll ans;
  ans=pow(2,n-1);
  if(alleven&&p==1)ans=0;
  if(alleven&&p==0)ans=pow(2,n);
  cout << ans <<endl;
}


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

int main() {
    
    LL a,b;
    cin>>a>>b;
    LL ans=-1;
    for(LL i=1;i<1010;i++){
        if(((2*i)/25)==a){
            if((i/10)==b){
                ans=i;
                break;
            }
        }
    }
    cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
w = gets.chomp
hash = {}
w.each_char { |c|
  if hash.include?(c)
    hash[c] = 1 - hash[c]
  else
    hash[c] = 1
  end
}
flag = true
hash.each { |k, v|
  flag = false if v == 1
}
puts flag ? "Yes" : "No"


Measured memory_bytes: 1788
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

S = sys.stdin.readline().rstrip()
cnt = 0
p = None
for c in S:
    cnt += p != c
    p = c
print(cnt - 1)


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    ll N, K; cin >> N >> K;
    vector<ll> a(N), f(N);
    rep(i, N) cin >> a[i];
    rep(i, N) cin >> f[i];
    sort(all(a));
    reverse(all(a));
    sort(all(f));
    ll left = -1, right = INF;
    while(right-left > 1){
        ll mid = (left + right)/2;
        ll tk = K;
        rep(i, N){
            ll tmp = mid/f[i];
            if(a[i] > tmp) tk -= a[i]-tmp;
        }
        if(tk >= 0){
            right = mid;
        }else{
            left = mid;
        }
    }

    cout << right << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7552
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    int N,A,B,C;
    cin >> N >> A >> B >> C;
    int l[8] = {};
    for(int i = 0; i < N; i++) cin >> l[i];
    int d[8];
    int ans = 100000000;
    
    for(int i = 0; i < 4; i++){
        d[0] = i;
        for(int j = 0; j < 4; j++){
            d[1] = j;
            for(int k = 0; k < 4; k++){
                d[2] = k;
                for(int m = 0; m < 4; m++){
                    d[3] = m;
                    for(int n = 0; n < 4; n++){
                        d[4] = n;
                        for(int o = 0; o < 4; o++){
                            d[5] = o;
                            for(int p = 0; p < 4; p++){
                                d[6] = p;
                                for(int q = 0; q < 4; q++){
                                    d[7] = q;
                                    int a = 0,b = 0,c = 0,interim = 0;
                                    for(int z = 0; z < N; z++){
                                        if(d[z] == 0){
                                            a += l[z];
                                            interim += 10;
                                        }
                                        else if(d[z] == 1){
                                            b += l[z];
                                            interim += 10;
                                        }
                                        else if(d[z] == 3){
                                            c += l[z];
                                            interim += 10;
                                        }
                                    }
                                    if(a == 0 || b == 0 || c == 0) continue;
                                    interim += (abs(A-a) + abs(B-b) + abs(C-c) - 30);
                                    if(ans > interim)
                                        ans = interim;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}

int main(){
    int n,c,k;
    in(n,c,k);
    vector<int> vec(n);
    in(vec);
    sort(all(vec));
    int pa=0,wait=vec[0],ans=0;
    for(int i=0;i<n;i++){
        if(vec[i]-wait<=k){
            pa++;
        }else{
            ans++;
            wait=vec[i];
            pa=1;
        }
        if(pa>=c){
            ans++;
            pa=0;
            if(i+1<n)wait=vec[i+1];
        }
    }
    if(pa!=0)ans++;
    out(ans);
}

Measured memory_bytes: 3748
N = int(input())
*A, = map(int, input().split())
A.sort()
m = A[-1]
x = m / 2
ans = A[0]
for i in range(1, N-1):
    if abs(ans - x) > abs(A[i] - x):
        ans = A[i]
print(m, ans)

Measured memory_bytes: 19916
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;

char s[maxn];

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//  freopen("abc.inp", "r", stdin); freopen("abc.out", "w", stdout);
  cin >> s + 1;
  int n = strlen(s+1);

  for (int i = 1; i < n; ++i){
    if (s[i] == s[i+1]) return cout << i <<' '<< i + 1, 0;
  }

  for (int i = 1; i < n - 1; ++i){
    if (s[i] == s[i+2]) return cout << i <<' '<< i + 2, 0;
  }

  cout << "-1 -1";
  return 0;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef vector<ll> vi;
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
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; }

int main(){
  ll n;
  cin >> n;
  ll count = 0;
  for(ll i=1;i<=n;i++){
    string s = to_string(i);
    ll a = sz(s);
    if(a==1||a==3||a==5){
      count++;
    }
  }
  print(count);
}

Measured memory_bytes: 256
use std::io;
use std::str::FromStr;

fn input_tuple() -> (u64, u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1], vec[2])
}

fn main() {
    let (a, b, c) = input_tuple();
    if a == b && a != c {
        println!("Yes");
        return;
    }
    if a == c && a != b {
        println!("Yes");
        return;
    }
    if b == c && a != b {
        println!("Yes");
        return;
    }
    println!("No");
}


Measured memory_bytes: 4352
n,k = map(int,input().split())
d = []
a = []

for i in range(k):
	d.append(int(input()))
	a.append(list(map(int,input().split())))

# print(n,k)
# print(d)
# print(a)

check = [False  for i in range(n)]
# print(check)
for i in range(k):
	for sunuke in a[i]:
		check[sunuke-1] = True

# print(check)
print(len([sunuke for sunuke in range(n) if check[sunuke]==False]))

Measured memory_bytes: 9088
#include <bits/stdc++.h>
#define MP make_pair
using namespace std;
typedef long long LL;
const LL N = 100010;
inline LL read()
{
  char ch=getchar(); LL p=0; LL f=1;
  while(ch<'0' || ch>'9'){if(ch=='-') f=-1; ch=getchar();}
  while(ch>='0' && ch<='9'){p=p*10+(ch-'0'); ch=getchar();}
  return p*f;
}

int main()
{

  LL n=read();
  
  return printf("%lld\n",n/3),0;
}

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

using namespace std;

const int inf=4e9+10;
const long long linf=1e18+10;


long long calc(long long p1x,long long p2x,long long len){
        
        if (len==0) return 0;
        if (p1x>p2x) swap(p1x,p2x);
        long long p1y=p1x+len-1,p2y=p2x+len-1;
        if (p1y<p2x) return 1LL*p1y*p2x;

        long long dist=p2y-p1x+1;
        long long u1=p1x+dist/2;
        long long u2=p2y-dist/2;
        return 1LL*u1*u2;
}
long long getL(long long n,long long br){
        if (n>=br) n++;
        return n;
}
long long getR(long long st,long long n,long long br){
        n=st-n+1;
        if (n<=br) n--;
        return n;
}
long long check(long long n,long long v1,long long v2){
        /// n<v1
        if (n<v1) return calc(1,1,n);
        if (n<v2)
                return max(calc(1,n-(v1-1)+1,v1-1),calc(v1+1,1,n-(v1-1)));
        long long br1=v1-1,br2=n+1-v2;
        if (br1>br2) swap(br1,br2);
        long long ans=calc(getL(1,v1),getR(n+1,br1,v2),br1);
        ans=max(ans,calc(getL(br1+1,v1),getR(n+1,br2,v2),br2-br1));
        ans=max(ans,calc(getL(br2+1,v1),getR(n+1,n,v2),n-br2));
        return ans;
}
long long solve(int v1,int v2){
        if (v1>v2) swap(v1,v2);
        long long L=v1-1,R=inf;
        while (L<=R){
                long long mid=(L+R)/2;
                if (check(mid,v1,v2)<1LL*v1*v2) L=mid+1;
                else R=mid-1;
        }
        return R;
}
int main(){
        int test;
        cin>>test;
        while (test--){
                int v1,v2;
                cin>>v1>>v2;
                cout<<solve(v1,v2)<<'\n';

        }
}



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

int main() {
    int N, K;
    int display = 1;
    cin >> N >> K;
    for(int i = 0; i < N; i++){
        if(display < K){
            display *= 2;
        }else{
            display += K;
        }
    }
    cout << display << endl;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  vector<int> B(n);

rep(i,n) cin >> A[i];
rep(i,n) B[A[i]-1] = i + 1;
rep(i,n) cout << B[i] << " ";

  cout << endl;

}

Measured memory_bytes: 1664
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();

    let mut ws = s.trim().split_whitespace();
    let a: i64 = ws.next().unwrap().parse().unwrap();
    let b: i64 = ws.next().unwrap().parse().unwrap();

    if a>2*b {
        println!("{}",a-2*b);
    } else {
        println!("0");
    }
    
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const ll MOD = (ll) (1e9 + 7);
//const ll MOD = 998244353;
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

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

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

    int n;
    cin >> n;
    int a[20], b[20], c[20];

    rep(i, n) {
        cin >> a[i];
        a[i]--;
    }
    rep(i, n) cin >> b[i];
    rep(i, n) cin >> c[i];

    int before = -100;
    int sum = 0;

    rep(i, n) {
        sum += b[a[i]];
        if (a[i] == before + 1) sum += c[before];
        before = a[i];
    }
    cout << sum << endl;
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
int main()
{
	int h[25],m[60],s[60],bh[60],bm[60],bs[60],i;
	int zh[60],zm[60],zs[60];
	for(i=0;i<3;i++){
		scanf("%d%d%d",&h[i],&m[i],&s[i]);
		scanf("%d%d%d",&bh[i],&bm[i],&bs[i]);
	}
	for(i=0;i<3;i++){
		zh[i]=bh[i]-h[i];
		if(bm[i]<m[i]){
			zh[i]=zh[i]-1;
			bm[i]=bm[i]+60;
		}
		zm[i]=bm[i]-m[i];
		if(bs[i]<s[i]){
			zm[i]=zm[i]-1;
			if(zm[i]<0){
				zm[i]=zm[i]+60;
			}
			bs[i]=bs[i]+60;
		}
		zs[i]=bs[i]-s[i];
	}
	for(i=0;i<3;i++){
		printf("%d %d %d\n",zh[i],zm[i],zs[i]);
	}
	return 0;
}



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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n,m;
  cin >> n >> m;
  string g[n];
  long long dp[n][m];
  memset(dp,0,sizeof dp);
  long long mod = 1000000007;
  for(int i = 0; i<n;i++){
    cin >> g[i];
  }
  dp[0][0] = 1;
  for(int i = 1; i<m;i++){
    if(g[0][i]=='.'){
      dp[0][i] = dp[0][i-1];
    }
  }
  for(int i = 1;i<n;i++){
    if(g[i][0]=='.'){
      dp[i][0] = dp[i-1][0];
    }
  }
  for(int i = 1; i<n;i++){
    for(int j = 1; j<m;j++){
      if(g[i][j]=='.'){
	dp[i][j] = dp[i-1][j]+dp[i][j-1];
      }
      dp[i][j]%=mod;
    }
  }
  cout << dp[n-1][m-1];
  return 0;
}


Measured memory_bytes: 12524