akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solveA();
		// new Main().solveB();
		// new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		String s = "";

		try {
			scanner = new Scanner(System.in);
			s = scanner.next();

			char[] wk = s.toCharArray();

			int cntA = 0;
			int cntB = 0;
			int cntC = 0;

			for (int i = 0; i < wk.length; i++) {
				char c = wk[i];
				if (c == 'a' && cntA == 0) {
					cntA++;
				} else if (c == 'b' && cntB == 0) {
					cntB++;
				} else if (c == 'c' && cntC == 0) {
					cntC++;
				}
			}

			System.out.println((cntA + cntB + cntC) == 3 ? "Yes" : "No");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

Measured memory_bytes: 23380
#include <stdio.h>
int main(void){
    int A,B,C;
    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
  if(B/A>=C){
    printf("%d",C);
  }
  if(B/A<C){
    printf("%d",B/A);
  }
    return 0;
}

Measured memory_bytes: 128
# セグメントツリー
#############################################################

def segfunc(x, y):
    return max(x, y)

ide_ele = 0

class SegTree:

    def __init__(self, init_val, segfunc, ide_ele):
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

    def update(self, k, x):
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1

    def query(self, l, r):
        res = self.ide_ele
        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res
#############################################################


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

# val[i] = 最後の値がiである、最長の部分列の長さ
val = [0] * 300000
seg = SegTree(val, segfunc, ide_ele)
ans = 0

for i in range(N):
    a = int(input())
    # (a-K, a-K+1, ..., a+K-1, a+K の max) + 1 に更新する
    # 両端が範囲内に収まるように調整
    l = max(a - K, 0)
    r = min(a + K, 300000)
    tmp = seg.query(l, r + 1) + 1
    ans = max(ans, tmp)
    seg.update(a, tmp)

print(ans)


Measured memory_bytes: 113664
from itertools import accumulate
n,q = list(map(int,input().split()))
s = input()
A = [list(map(int,input().split())) for i in range(q)]

flg = []
for i in range(n-1):
    tmp_s = s[i:i+2]
    if tmp_s == 'AC':
        flg.append(1)
    else:
        flg.append(0)

flg2 = [0] + flg
flg2 = list(accumulate(flg2))


for a in A:
    print(flg2[a[1]-1] - flg2[a[0]-1])

Measured memory_bytes: 33140
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(v) v.begin(), v.end()
#define ll long long
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;

//snippets:tmp,cl,cvl,cs,co,coy,con,cov

int main(){
    cout << fixed << setprecision(15);
    ll r;
    cin >> r;
    cout<<r*2*3.14159<<endl;
}

Measured memory_bytes: 3788
import numpy as np
import math

n = int(input())
x = []
y = []
for i in range(n):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)

def kyori(xi, yi, xj, yj):
    return np.sqrt((xi-xj)**2 + (yi-yj)**2)

goukei = 0
for i in range(n):
    for j in range(n):
        goukei += kyori(x[i],y[i],x[j],y[j])

print(goukei*math.factorial(n-1)/math.factorial(n))

Measured memory_bytes: 21760
#include <iostream>

using namespace std;

int main(){
    int k;
    int x;
    cin >> k >> x;
    for(int i = x - k + 1; i < x + k; i++){
        if(i < x + k - 1){
            cout << i << " " << endl;
        }
        else{
            cout << i << endl;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F first
#define S second
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define abu ios_base::sync_with_stdio(0)
#define said cin.tie(0)
using namespace std;
ll const MOD = 1000000007;

void yes(){
    cout<<"YES"<<'\n';
}

void no(){
    cout<<"NO"<<'\n';
}

ll fact(int n){
    ll ans = 1;
    for(int i=2;i<=n;i++){
        ans = (ans*i)%MOD;
    }

    return ans;
}

ll powM(int n, int x){
    if(x==0){
        return 1;
    }
    if(x==1){
        return n%MOD;
    }

    if(x%2==0){
        ll a = powM(n,x/2);
        return (a*a)%MOD;
    }else{
        return (n*powM(n,x-1))%MOD;
    }
}

ll C(int n, int k){
    return (fact(n) * powM((fact(k)*fact(n-k))%MOD,MOD-2))%MOD;
}

ll A(int n, int k){
    return (fact(n) * powM(fact(n-k)%MOD,MOD-2))%MOD;
}




void solve(){
    int n,k;
    cin>>n>>k;
    vi a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    vector<bool> dp(k+1);

    for(int i=0;i<=k;i++){
        for(int x: a){
            if(i>=x && !dp[i-x])
                dp[i] = true;
        }
    }

    if(dp[k]){
        cout<<"First\n";
    }else{
        cout<<"Second\n";
    }
}

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

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var a, b, c int
	Fscanf(in, "%d%d.%d", &a, &b, &c)
	Fprint(out, a*(100*b+c)/100)
}

func main() { run(os.Stdin, os.Stdout) }


Measured memory_bytes: 1828
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);	
		
		int N=sc.nextInt();
		int D=sc.nextInt();
		
		int[] kns=new int[N];
		for(int i=0;i<N;i++){
			kns[i]=0;
		}
		int j=0;
		int sum=0;
		while(sum<N){
			sum+=1+2*D;
			j++;
		}
		System.out.println(j);
	}

}	


Measured memory_bytes: 21588
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;

const int N = 100000;

int main() {
  vector<int> one_time;
  for (int i = 6; i <= N; i *= 6) one_time.push_back(i);
  for (int i = 9; i <= N; i *= 9) one_time.push_back(i);
  
  int dp[N+1] = {};
  for (int i = 1; i <= N; i++) dp[i] = N + 1;
  for (auto x : one_time) dp[x] = 1;
  for (int i = 1; i < N; i++) {
    if (dp[i] > N) continue;
    for(auto x : one_time) {
      if (i + x > N) continue;
      dp[i + x] = min(dp[i + x], dp[i] + 1);
    }
  }
  
  int n; cin >> n;
  int ans = 0;
  while (n > 0 && dp[n] > N) {
    ans++;
    n--;
  }
  cout << ans + dp[n] << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
long check(long, long);
long movemoney(long, long, long);
int main() {
	vector<long> a;
	long n, load;
	long all = 0;
	cin >> n;
	a.push_back(0);
	for (long i = 0; i < n; i++) {
		cin >> load;
		a.push_back(load);
	}
	a.push_back(0);
	for (long j = 0; j < n+1; j++) {
		all += check(a[j], a[j + 1]);
	}
	
	for (long k = 0; k < n; k++) {
		cout << (all - movemoney(a[k], a[k + 1], a[k + 2])) << endl;
	}
	


	return 0;

}
long movemoney(long a0, long a1, long a2) {
	long x = check(a0, a1);
	x += (check(a1, a2));
	long y = check(a0, a2);
	return x - y;
}
long check(long a, long b) {
	if (a - b > 0) {
		return a - b;
	}
	return b - a;
}




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

struct edge{
  int to;
  ll cost;
};

vector<edge> tree[100010];
ll depth[100010];

void dfs(int v, int p,ll d){
  depth[v]=d;
  for(auto &e : tree[v]){
    if(e.to == p)continue;
    dfs(e.to,v,d+e.cost);
  }
}

int main() {
  int n;
  cin >> n;
  rep(i,n-1){
    int a,b,c;
    cin >> a >> b >> c;
    a--,b--;
    tree[a].push_back({b,c});
    tree[b].push_back({a,c});
  }
  int q,k;
  cin >> q >> k;
  k--;
  dfs(k,-1,0);
  rep(i,q){
    int x,y;
    cin >> x >> y;
    x--,y--;
    cout << depth[x] + depth[y] << endl;
  }
  return 0;
}


Measured memory_bytes: 14336
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}

template <class T>
ostream &operator<<(ostream &os, const set<T> &st) {
	for (const auto &e : st) os << e << " ";
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}

template <class T1, class T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
	for (const auto &e : mp) os << e << " ";
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

template<class T = lint>
struct Edge {
	int to;
	T cost;
	int tank;
	Edge() {}
	Edge(int to, T cost, int tank = 0) : to(to), cost(cost), tank(tank) {}
	bool operator>(const Edge &r) const { return this->cost > r.cost; }
};

int main() {

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

	int N, M, L;
	cin >> N >> M >> L;

	vector<vector<Edge<int>>> edges(N);
	for (int i = 0; i < M; i++) {
		int u, v, len;
		cin >> u >> v >> len;
		u--, v--;
		edges[u].emplace_back(v, len);
		edges[v].emplace_back(u, len);
	}

	auto bfs = [&](int st) {
		vector<pair<int, int>> dp(N, { INF, 0 });
		dp[st] = { 0, -L };
		queue<pair<int, pair<int, int>>> que;
		que.emplace(st, dp[st]);
		while (!que.empty()) {
			auto now = que.front();
			que.pop();
			for (const auto &e : edges[now.first]) {

				if (e.cost > L) continue;

				auto tmp = now.second;
				if (e.cost > -tmp.second) {
					tmp.first++;
					tmp.second = -L + e.cost;
				}
				else tmp.second += e.cost;

				if (tmp < dp[e.to]) {
					dp[e.to] = tmp;
					que.emplace(e.to, tmp);
				}

			}
		}
		return dp;
	};

	vector<vector<pair<int, int>>> memo(N);
	for (int i = 0; i < N; i++) memo[i] = bfs(i);

	int Q;
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		int s, t;
		cin >> s >> t;
		s--, t--;
		auto tmp = memo[s][t].first;
		if (tmp != INF) cout << tmp << "\n";
		else cout << -1 << "\n";
	}

	return 0;
}

Measured memory_bytes: 2944
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val x = sc.nextLong()
    val y = sc.nextLong()

    var count = 0
    var a = x
    while (a < y) {
        count++
        a *= 2
    }

    if (a == y) count++

    println(count)
}

Measured memory_bytes: 31644
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    ll t1,t2,a1,a2,b1,b2;cin>>t1>>t2>>a1>>a2>>b1>>b2;
    if(a1<b1){
        swap(a1,b1);
        swap(a2,b2);
    }
    ll a=a1*t1+a2*t2,b=b1*t1+b2*t2;
    if(a==b){
        cout<<"infinity"<<endl;
        return 0;
    }
    if(b<a){
        cout<<0<<endl;
        return 0;
    }else{
        ll buf=b-a;
        ll res=(a1-b1)*t1/buf;
        res*=2;
        if(((a1-b1)*t1)%buf!=0)res++;
        cout<<res<<endl;
    }
}

Measured memory_bytes: 3640
#include <iostream>
using namespace std;
typedef long long ll;
const int MAX_N = 300010;
const int INF = 10000000;
ll cnte[MAX_N], cntw[MAX_N];
int main() {
    int n;
    string s;
    cin >> n >> s;
    ll cnt = 0;
    for (int i=0;i<n;i++) {
        if (s[i] == 'W') cnt++;
        cntw[i] = cnt;
    }
    cnt = 0;
    for (int i=n-1;i>=0;i--) {
        if (s[i] == 'E') cnt++;
        cnte[i] = cnt;
    }
    cnt = INF;
    for (int i=0;i<n;i++) {
        cnt = min(cntw[i] + cnte[i] - 1, cnt);
    }
    cout << cnt << endl;
}


Measured memory_bytes: 5380
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> al(27,0);
    vector<char> text;
    string ala="abcdefghijklmnopqrstuvwxyz.";
    char s; 
    while(cin>>s){
    s=tolower(s);
    int num=s-'a';
    al[num]++;
    }

    for(int i=0; i<26; i++){
        cout<<(char)('a'+i)<<" : "<<al[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 3232
#!/usr/bin/env python3
import sys

def fill(D, A, c):
    for a in A:
        if a not in D:
            D[a] = {'A': 0, 'B': 0, 'C': 0}
        D[a][c] += 1


def solve(N: int, A, B, C):
    D = {}
    fill(D, A, 'A')
    fill(D, B, 'B')
    fill(D, C, 'C')
    D = sorted(D.items(), key=lambda x: x[0], reverse=True)

    a = 0
    b = 0
    c = 0
    for k, v in D:
        a += b * v['A']
        b += c * v['B']
        c += v['C']

    print(a)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    A = [int(next(tokens)) for _ in range(N)]
    B = [int(next(tokens)) for _ in range(N)]
    C = [int(next(tokens)) for _ in range(N)]
    solve(N, A, B, C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 151000
a,b,c,d=map(int,input().split())
t=0
k=0
while a>0:
  a=a-d
  t=t+1
while c>0:
  c=c-b
  k=k+1
if t>k:
  print('Yes')
elif k>t:
  print('No')
elif t==k:
  print('Yes')

Measured memory_bytes: 9192
first, second = input().split()

temp = ["A", "B", "C", "D", "E", "F"]

for i in range(len(temp)):
    if temp[i] == first:
        first_num = i
    if temp[i] == second:
        second_num = i

if first_num > second_num:
    print(">")
elif first_num == second_num:
    print("=")
elif first_num < second_num:
    print("<")


Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)
#define setp(X,Y) cout<<fixed<<setprecision(Y)<<X;
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

int N,K;
string S;
vector<int> v,v2;
int num[100010];

signed main(){
	cin>>N>>K;
	cin>>S;
	int cnt=1;
	int ans=0;
	REP(i,N-1){
		if(S[i]!=S[i+1]){
			cnt++;
		}
		else{
			ans++;
		}
	}
	if(cnt-K*2<=1){
		cout<<N-1<<endl;
	}
	else{
		ans+=2*K;
		cout<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 512
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scan() string {
	sc.Scan()
	return sc.Text()
}
func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}
func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}
func fSum(a []float64) float64 {
	x := 0.
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	s := Scan()
	count := 0
	a, ab, abc := 0, 0, 0
	for _, r := range s {
		if string(r) == "A" {
			a += repeatPow(3, count, mod)
		} else if string(r) == "B" {
			ab += a
		} else if string(r) == "C" {
			abc += ab
		} else {
			abc = abc*3 + ab
			ab = ab*3 + a
			a = a*3 + repeatPow(3, count, mod)
			count++
		}
		a %= mod
		ab %= mod
		abc %= mod
	}
	fmt.Println(abc)
}
func repeatPow(x, y, d int) int {
	if y == 0 {
		return 1
	} else if y == 1 {
		return x
	} else {
		z := repeatPow(x, y/2, d)
		if y%2 == 0 {
			return z * z % d
		} else {
			return z * z % d * x % d
		}
	}
}


Measured memory_bytes: 2168
#include <cstdio>
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <math.h>

using namespace std;

int main(void){
  long long int n,i,j;
  //cin >> n;
  //long long int h[n];
  string str;
  cin >> str;  
  long long int oddOne=0;
  long long int oddZero=0;
  long long int evenOne=0;
  long long int evenZero=0;
  bool isOdd = true;
  for(auto ch : str){
    if(isOdd){
      if(ch == '0'){
        oddZero++;
      }
      else{
        oddOne++;
      }
    }
    else{
      if(ch == '0'){
        evenZero++;
      }
      else{
        evenOne++;
      }
    }
    isOdd = isOdd?false:true;
  }
  cout << min(oddZero+evenOne,oddOne+evenZero) << endl;
  return 0;
}




Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
  int X,Y;
  scanf("%d%d",&X,&Y);
  printf("%d",X+Y/2);
}
  

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int x = sc.nextInt();
		
		int count = 0;
		for(int i=0; i<a+1; i++) {
			for(int j=0; j<b+1; j++) {
				for(int k=0; k<c+1; k++) {
					int sum = i*500 + j*100 + k*50;
					if(sum == x) {
						count++;
					}
				}
			}
		}
		
		System.out.println(count);
	}
}


Measured memory_bytes: 21204
// E - Colorful Hats 2

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
const ll MOD = 1e9 + 7;

int A[100001];
int hat[100001][3]; // hat[i][j]: i番目の人までの帽子のかぶり方（jは色の違いを表すが色は任意）

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

	for (int i=1; i<=N; i++) {
		cin >> A[i];
	}

	hat[0][0] = 0;
	hat[0][1] = 0;
	hat[0][2] = 0;

	for (int i=1; i<=N; i++) {
		bool impossible = true;

		for (int j=0; j<3; j++) {
			hat[i][j] = hat[i-1][j];
		}

		for (int j=0; j<3; j++) {
			if (hat[i-1][j] == A[i]) {
				hat[i][j]++;
				impossible = false;
				break;
			}
		}

		if (impossible) {
			cout << 0 << endl;
			return 0;
		}
	}

	/*
	// **** debug ****
	for (int i=0; i<=N; i++) {
		for (int j=0; j<3; j++) {
			cout << " " << hat[i][j];
		}
		cout << endl;
	}
	*/

	ll ans = 1;
	for (int i=1; i<=N; i++) {
		int cnt = 0;
		for (int j=0; j<3; j++) {
			if (hat[i-1][j] == A[i]) cnt++;
		}
		ans = (ans * cnt) % MOD;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1792
/*
        FFFFFFFFFFFFFFFFFFFFFF
        F::::::::::::::::::::F
        F::::::::::::::::::::F
        FF::::::FFFFFFFFF::::F
          F:::::F       FFFFFF
          F:::::F
          F::::::FFFFFFFFFF
          F:::::::::::::::F
          F:::::::::::::::F
          F::::::FFFFFFFFFF
          F:::::F
          F:::::F
        FF:::::::FF
        F::::::::FF
        F::::::::FF
        FFFFFFFFFFF
*/
 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//#define int long long
#define mod 1000000007
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define ms(v,n) memset((v),n,sizeof(v));
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod 
#define ad(a,b)  (a%mod+b%mod+mod)%mod
#define inf 1e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
 
using namespace std;

int main()
{
    
    fast
    ll n,a,b;
    cin>>n>>a>>b;
    ll t=n/(a+b);
    ll m=n%(a+b);
    if(m>a)
    cout<<t*a+a;
    else
    cout<<t*a+m;
    
    





    

    return 0;
    
}

Measured memory_bytes: 256
from collections import deque
k = int(input())

digsum = lambda x: sum(map(int, list(str(x))))
dignorm = lambda x: x/digsum(x)

n = 1
order = 1
while k > 0:
    print(n)
    k -= 1
    if dignorm(n+10**(order-1)) > dignorm(n+10**order):
        order += 1
    n += 10**(order-1)



Measured memory_bytes: 3444
//IIT Kanpur FacelessMen India
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( gg,itit )  for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define mp make_pair
#define pb push_back
#define all(s) s.begin(),s.end()
#define present(c,x) ((c).find(x) != (c).end())
const double EPS = 1e-8;
const int mod = 1e9+7;
const int N = 1e6+10;
const ll INF = 1e18;

//#define DEBUG
ll power(ll x,ll y){
  ll t=1;
  while(y>0){
    if(y%2) y-=1,t=t*x%mod;
    else y/=2,x=x*x%mod;
  }
  return t;
}
#ifdef DEBUG
#define dprintf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#else
#define dprintf(fmt,...)
#endif

int dp[105][305];
int main(){
  // freopen("product.in","r",stdin);
  // freopen("product.out","w",stdout);
  FILL(dp,-1);
  int n,W; scanf("%d%d",&n,&W);
  int w1;
  FILL(dp,-1);
  dp[0][0]=0;
  REP(i,n){
    int w,v; scanf("%d%d",&w,&v);
    if(i==0) w1=w;
    int d=w-w1;
    for(int j=n-1;j>=0;j--) REP(k,305) if(dp[j][k]!=-1){
      dp[j+1][k+d]=max(dp[j+1][k+d],dp[j][k]+v);
    }
  }
  int ans=0;
  REP(i,n+1) REP(j,305) if(dp[i][j]!=-1){
    if(1ll*i*w1+j<=W) ans=max(ans,dp[i][j]);
  }
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
using namespace std;
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
Def inf = sizeof(Def) == sizeof(long long) ?  2e18:1e9+10;
string s;
int t;
int f(){
	if(isdigit(s[t])){
		int a=0;
		while(isdigit(s[t]))a*=10,a+=s[t++]-'0';
		t++;
		return a/2+1;
	}
	vi in;
	while(s[t]=='['){
		t++;
		in.pb(f());
		
	}
	int sum=0;
	sort(all(in));
	rep(i,in.size()/2+1)sum+=in[i];
	t++;
	return sum;
}
int main(){
	int n;
	cin>>n;
	while(n--){
		cin>>s;
		t=1;
		cout<<f()<<endl;
	}
}


Measured memory_bytes: 3244
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main(){
    ll A, B, C;
    cin >> A >> B >> C;

    if(A%2 == 0 || B%2 == 0 || C%2 == 0)
        cout << 0 << endl;
    else
        cout << min ({A*B, B*C, C*A}) << endl;
    return 0;
}

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

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

ll power(ll  a, ll b){
   ll  ans = 1;
   while(b){
      if(b&1){
         ans *= a;
      }
      a *= a;
      b /= 2;
   }
   return ans;
}

int lar[2234567];

void pre(){
    memset(lar, 0, 1e6+7);
     lar[1] = 1;
     for(int i = 2; i <= 1e5; i++){
         cout << i << endl;
         if(lar[i]){
            continue;
         }
         lar[i] = i;
         for(ll j = 1LL*i*i; j <= 1e5; j += i){
             lar[j] = i;
         }
     }
     for(int i = 1; i <= 100; i++) cout << lar[i] << endl;

}

ll mod = 1e9+7;
int cnt[1234];

int main()
{
   int n, m;
   cin >> n >> m;
   vector <set <pair<int,int> > > vec(n);
   set <int> se;
   vector <map<int,int> > vec1(n);
   for(int i = 0; i < n; i++){
       for(int j = 0; j < m; j++){
            int n1;
            cin >> n1;
            vec1[i][n1] = j;
            vec[i].insert({j , n1});
       }
   }
   int i1 = m;
   int ans = n;
   while(i1--){
         for(int i = 1; i <= m; i++) cnt[i] = 0;
         int max1 = 0, e = -1;
         for(int i = 0; i < n; i++){
             pair <int,int> p1 = *vec[i].begin();
                cnt[p1.second]++;
                if(cnt[p1.second] > max1){
                   max1 = cnt[p1.second];
                   e = p1.second;
                }
         }
         if(max1 < ans) ans = max1;

         for(int i = 0; i < n; i++){
            vec[i].erase(vec[i].find({vec1[i][e], e}));
         }
         //cout << max1 << endl;
   }
   //cout << endl;
   cout << ans;
}



Measured memory_bytes: 8704
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long int ll;
  
bool chmax(ll& a, ll b) { if (a < b) { a=b; return true;} else return false;}
bool chmin(ll& a, ll b) { if (a > b) { a=b; return true;} else return false;}

const ll INF = 1 << 30;

int main(){
  ll h,w; cin >> h >> w;
  
  ll ans = INF;
  for(ll i = 1; i < h; ++i){
    chmin(ans, max({i*w, (h-i)/2*w, (h-i-(h-i)/2)*w}) - min({i*w, (h-i)/2*w, (h-i-(h-i)/2)*w}));
    chmin(ans, max({i*w, (h-i)*(w/2), (h-i)*(w-w/2)}) - min({i*w, (h-i)*(w/2), (h-i)*(w-w/2)}));
  }
  
  for(ll i = 1; i < w; ++i){
    chmin(ans, max({i*h, (w-i)/2*h, (w-i-(w-i)/2)*h}) - min({i*h, (w-i)/2*h, (w-i-(w-i)/2)*h}));
    chmin(ans, max({i*h, (w-i)*(h/2),(w-i)*(h-h/2)}) - min({i*h, (w-i)*(h/2),(w-i)*(h-h/2)}));
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
/*=============================================================================================================================/*
                                               Bismillahir Rahmanir Rahim

      _     ____  ___  ____   _   _  _         ___  ____   _         _     __  __
     / \   / ___||_ _|| __ ) | | | || |       |_ _|/ ___| | |       / \   |  \/  |
    / _ \  \___ \ | | |  _ \ | | | || |        | | \___ \ | |      / _ \  | |\/| |
   / ___ \  ___) || | | |_) || |_| || |___     | |  ___) || |___  / ___ \ | |  | |
  /_/   \_\|____/|___||____/  \___/ |_____|   |___||____/ |_____|/_/   \_\|_|  |_|

   _   __           __  __  __
  |_) (_  _  o__   /   (_  |_
  |_)o__)(_  || |  \__ __) |__

    ___                    _   _      _                _ _               __   ___                 _         _        _
   / __|_ _ ___ ___ _ _   | | | |_ _ (_)_ _____ _ _ __(_) |_ _  _   ___ / _| | _ ) __ _ _ _  __ _| |__ _ __| |___ __| |_
  | (_ | '_/ -_) -_) ' \  | |_| | ' \| \ V / -_) '_(_-< |  _| || | / _ \  _| | _ \/ _` | ' \/ _` | / _` / _` / -_|_-< ' \
   \___|_| \___\___|_||_|  \___/|_||_|_|\_/\___|_| /__/_|\__|\_, | \___/_|   |___/\__,_|_||_\__, |_\__,_\__,_\___/__/_||_|
                                                            |__/                           |___/


   FB: https://facebook.com/SIAsibul
   Gmail: asibulislam8@gmail.com

/*=============================================================================================================================*/

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef vector<pii> vii;
typedef vector<pil> vil;
typedef vector<pli> vli;
typedef vector<pll> vll;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define all(a)  a.begin(), a.end()
#define mem(a, b)     memset(a, b, sizeof(a))
#define f0(i,n) for(ll i=0;i<(n);i++)
#define f1(i,n) for(ll i=1;i<=(n);i++)
#define f2(i,a,n) for(ll i=(a);i<=(n);i++)
#define fr(i,n,a) for(ll i=(n);i>=(a);i--)
#define rep(i,a,b,c) for(ll i=(a);i!=(b);i+=(c))
#define nl "\n"


const int INF = 1e9 + 5;
const int MXN = 2e5 + 5;
const int MOD = 1e9 + 7;


void solve(){
    int n; cin >> n;
    int a[n];
    f0(i, n) cin >> a[i];

    int mn = 0;
    ll tk = 1000, st = 0;
    f0(i, n-1){
        if(a[i+1] > a[i]) continue;
        else{
            st = tk/a[mn];
            tk = tk-(st*a[mn])+(st*a[i]);
            mn = i+1;
        }
    }

    if(mn != n-1){
        st = tk/a[mn];
        tk = tk-(st*a[mn])+(st*a[n-1]);
    }

    cout << tk << nl;
}

int main(){
    ll t;
    //cin >> t;
    t = 1;
    while(t--){
        solve();
    }
    return 0;
 }


Measured memory_bytes: 3560
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}



signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int N, S, ans = INF;
	vector<int> a, con;
	
	cin>>N>>S;
	
	a.resize(N);
	con.resize(110000);
	
	for(int i = 0; i < N; i++){
		cin>>a[i];
		// con[a[i]]++;
	}
	
	for(int i = 0, j = 0, sum = 0; i < N; i++){
		for(; j < N; j++){
			if(sum >= S) break;
			if(con[a[j]] == 0 && a[j] <= S) sum++;
			con[a[j]]++;
		}
		
		if(sum >= S) ans = min(ans, j-i);
		if(con[a[i]] == 1 && a[i] <= S)sum--;
		con[a[i]]--;
	}
	
	if(ans != INF)cout<<ans<<endl;
	else cout<<0<<endl;
	
	return 0;
}


Measured memory_bytes: 4388
N = int(input())
T = [int(i) for i in input().split()]
M = int(input())
px = [[int(i) for i in input().split()] for j in range(M)]

for i in range(M):
    dt = T[px[i][0]-1] - px[i][1]
    print(sum(T) - dt)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef long long ll;

vector<ll> s(2);


int main() {
    s[0] = 1;   s[1] = -1;
    int n, m;  cin >> n >> m;
    vector<ll> x(n), y(n), z(n);
    for (int i = 0; i < n; i++)
        cin >> x[i] >> y[i] >> z[i];

    ll ans = -1e18;
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
            for (int k = 0; k < 2; k++) {
                vector<ll> v;
                for (int l = 0; l < n; l++) {
                    ll w = s[i] * x[l] + s[j] * y[l] + s[k] * z[l];
                    v.push_back(w);
                }
                sort(v.begin(), v.end(), greater<ll>());
                ll tmp = 0;
                for (int l = 0; l < m; l++)
                    tmp += v[l];
                ans = max(ans, tmp);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3644
#pragma GCC optimize("Ofast")
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//typedef tree < int , null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> TREE;
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define pss pair<short,short>
#define pld pair<long double,long double >
#define ld long double
#define piii  pair<pii,int>
#define vii vector<pair<int,int> >
#define st first
#define nd second
#define pll pair<ll,ll>
#define speed ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define M_PI 3.14159265358979323846
//#define int long long
const int mod=1000000007;
//const int mod=998244353;
const int inf=1000000009;
const long long INF=1000000000000000009;
const long long big=1000000000000000;
const long double eps=0.000000000000000000001;
using namespace std;
bool match(char a,char b)
{
    return (a=='?'||b=='?'||a==b);
}
bool ab[100005],ac[100005],bc[100005];
int main()
{
    speed
    string a,b,c;
    cin>>a>>b>>c;
    int x=a.size(),y=b.size(),z=c.size();
    for(int i=0; i<x; i++)
        for(int j=0; j<y; j++)
            if(!match(a[i],b[j]))
                ab[i-j+20000]=1;
    for(int i=0; i<x; i++)
        for(int j=0; j<z; j++)
            if(!match(a[i],c[j]))
                ac[i-j+20000]=1;
    for(int i=0; i<y; i++)
        for(int j=0; j<z; j++)
            if(!match(b[i],c[j]))
                bc[i-j+20000]=1;
    int wynik=inf;
    for(int i=-4000;i<=4000;i++)
        for(int j=-4000;j<=4000;j++)
            if(!ab[20000+i]&&!ac[20000+j]&&!bc[j-i+20000])
    {
        int l=min(0,min(i,j));
        int r=max(x,max(y+i,z+j));
        wynik=min(wynik,r-l);
    }
    cout<<wynik;
    return 0;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

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

int main(){
	
	int a, b;cin >> a >> b;
	int ans = 0;
	
	for(int i = 0;i < 2;i++){
		if(a > b){
			ans += a;
			a--;
		}
		else {
			ans += b;
			b--;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


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

int main() {
  string S;
  cin >> S;
  int a, b = 0;
  for(int i = 0; i < S.size(); i++) {
    if(S.at(i) == 'A' || S.at(i) == 'C' || S.at(i) == 'G' || S.at(i) == 'T') {
      a++;
    }
    else {
      b = max(a,b);
      a = 0;
    }
    if(i == S.size()-1) {
      b = max(a,b);
    }
  }
  cout << b << endl;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define USE_MATH_DEFINES
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

long long cnt;
vector<int> g;

void insertionSort(int a[], int n, int g) {
    for (int i = g; i < n; i++) {
        int v = a[i];
        int j = i - g;
        while (j >= 0 && a[j] > v) {
            a[j + g] = a[j];
            j = j - g;
            cnt++;
        }
        a[j + g] = v;
    }
}

void shellSort(int a[], int n) {
    cnt = 0;
    int gNum = 1;
    while (true) {
        if (gNum > n)
            break;
        g.push_back(gNum);
        gNum = gNum * 3 + 1;
    }
    int m = g.size();
    for (int i = g.size() - 1; i >= 0; i--) {
        insertionSort(a, n, g[i]);
    }
}

int main() {
    int n;
    cin >> n;
    int a[n];
    rep(i, n) scanf("%d", &a[i]);
    shellSort(a, n);
    printf("%d\n", g.size());
    for (int i = g.size() - 1; i >= 0; i--) {
        if (i > 0)
            printf("%d ", g[i]);
        else
            printf("%d\n", g[i]);
    }
    printf("%d\n", cnt);
    rep(i, n) printf("%d\n", a[i]);
}


Measured memory_bytes: 7124
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    N = INT()
    D, X = MAP()
    A = []
    for _ in range(N):
        A.append(INT())

    lis=[]
    for x in A:
        lis.append(1 + (D-1)//x)
    print(sum(lis) + X)

if  __name__=='__main__':
    main()

Measured memory_bytes: 5388
use proconio::input;

fn main() {
  input! {
    w: f64,
    h: f64,
    x: f64,
    y: f64
  }
  println!("{}", w * h / 2f64);
  if w / 2f64 == x  && h / 2f64 == y {
    println!("1");  
  } else {
    println!("0");
  }
}

Measured memory_bytes: 2140
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890123456789LL
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

typedef long long cat;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N;
	cin >> N;
	vector< vector<int> > A(N,vector<int>(N));
	for(int i =0; i < N*N; i++) cin >> A[i/N][i%N];
	vector< vector<cat> > D(N,vector<cat>(N,OVER9000));
	for(int i =0; i < N; i++) D[i][i] =0;
	cat ans =0;
	for(int i =0; i < N; i++) for(int j =0; j < i; j++) {
		bool is_direct =true;
		for(int k =0; k < N; k++) if(A[i][k]+A[k][j] == A[i][j] && i != k && j != k) is_direct =false;
		if(is_direct) {
			D[i][j] =D[j][i] =A[i][j];
			ans +=A[i][j];}
		}
	for(int i =0; i < N; i++) for(int j =0; j < N; j++) for(int k =0; k < N; k++) D[j][k] =min(D[j][k],D[j][i]+D[i][k]);
	for(int i =0; i < N*N; i++) if(D[i/N][i%N] != A[i/N][i%N] || D[i/N][i%N] == OVER9000) {
		cout << "-1\n";
		return 0;}
	cout << ans << "\n";
	return 0;}

// look at my code
// my code is amazing

Measured memory_bytes: 1408
from collections import defaultdict

n,p = map(int,list(input().split()))
i,dic = 2,defaultdict(int)

while i*i<=p: #素因数分解
    while p%i==0:
        p/=i
        dic[i]+=1
    i+=1
if p>=1:
    dic[p]=1

ans = 1
dic = dict(dic)
for k in dic.keys():
    while dic[k]>=n:
        dic[k]-=n
        ans *= k
print(int(ans))

Measured memory_bytes: 3316
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

const int INF = pow(2, 31) - 1;
#define ll long long
#define DEBUG(x) cout << "DEBUG>" << #x << ":" << x << endl;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  vector<int> wCS(N + 1, 0), eCS(N + 1, 0);
  REP(i, N) {
    if(S[i] == 'E') {
      eCS[i + 1] = 1 + eCS[i];
      wCS[i + 1] = wCS[i];
    } else {
      eCS[i + 1] = eCS[i];
      wCS[i + 1] = 1 + wCS[i];
    }
  }
  int ans = N;
  REP(i, N) {
    ans = min(ans, wCS[i] + eCS[N] - eCS[i + 1]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3076
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#define test ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int a[MAX]={0};
int n,k;
int dp[MAX]={0};
signed main()
{
	fastio;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int K=0;K<=k;K++){
		for(int i=1;i<=n;i++){
			if(K>=a[i] && dp[K-a[i]]==0)
				dp[K]=true;
		}
	}
	if(dp[k])
		cout<<"First";
	else
		cout<<"Second";
}


Measured memory_bytes: 4476
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println(o);
    }

    static Object run() {
        try (Scanner sc = new Scanner(System.in)) {
            long resultNum = 0;
            String resultStr = "";

            return sc.nextInt() * sc.nextInt();
        }
    }
}

class ChenNumberUtil {
    static Collection<Integer> getDivisors(int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 1; i * i <= n; i++) {
            if (n % i == 0) {
                al.add(i);
                if (n / i != i)
                    al.add(n / i);
            }
        }
        Collections.sort(al);
        return al;
    }
}

class ChenBitUtil {
    static int popCount(int bit) {
        return Integer.bitCount(bit);
    }

    static boolean isFlag(int bit, int i) {
        return 0 != (bit & (1 << i));
    }

    static int setTrue(int bit, int i) {
        return bit |= (1 << i);
    }

    static int setFalse(int bit, int i) {
        return bit &= ~(1 << i);
    }

    static int setReverse(int bit, int i) {
        return isFlag(bit, i) ? setFalse(bit, i) : setTrue(bit, i);
    }

    static int reverseAll(int bit) {
        return ~bit;
    }
}

Measured memory_bytes: 26988
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define fi first
#define se second
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define mod 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 200009
#define M 2000009
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll, ll>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define endl "\n"
#define int long long
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};  
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}




void test_case()
{
    string s;
    cin>>s;

    int n = s.size();

    int ans =0;
    for(int i=0; i<n/2; i++) {
        if(s[i] != s[n-1-i]) {
            ans++;
        }
    }

    cout<<ans<<endl;



}

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

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

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

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

int main (void){
  int n;
  string s;
  bool a = false;
  
  cin >> n >> s;
  if(n % 2 == 0){
  	for(int i = 0; i < n/2; i++){
      if(s.at(i) == s.at(i + n/2)){
        a = true;
      }else{
        a = false;
        break;
      }
    }
  }
  
  if(a == true)
    cout << "Yes" << endl;
  if(a == false)
    cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 256