akhauriyash/Code-Regression huggingface dataset:
// /*
// power code taken from geeks for geeks
// */

#include <bits/stdc++.h>
#define MODD 1000000007LL
#define MAX_SIZE 100000000
#define MAX_N 100001
using namespace std;
typedef long long ll;
typedef long double ld;

ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
double max(double a,double b){return a>b?a:b;}
double min(double a,double b){return a<b?a:b;}

ll modd(ll a){if(a<0LL) return a*-1LL;return a;}
double modd(double a){if(a<0.0) return a*-1.0;return a;}

ll modulo(ll a){return a % MODD; }

ll power(ll k, ll p){
    if (p == 0)
        return 1LL;
 
    ll P = power(k, p/2LL);
    P = (P * P) % MODD;
 
    if (p % 2 == 1)
        P = (P * k) % MODD;
 
    return P;
}

ll power(ll k, ll p, bool f){
    if (p == 0)
        return 1LL;
 
    ll P = power(k, p/2LL);
    P = (P * P);
 
    if (p % 2 == 1)
        P = (P * k) ;
 
    return P;
}


struct p_str{
    ll a, b;
};


void swap(ll& s1, ll &s2){
    ll temp=s1;
    s1=s2;
    s2=temp;
}
ll gcd(ll a, ll b){
    if(b==0){
        return a;
    }
    return gcd(b, a%b);
}


void solve(){
    ll k;
    cin>>k;
    string s;
    cin>>s;
    if(s.length()<=k){
        cout<<s<<endl;
        return;
    }
    s=s.substr(0, k)+"...";
    cout<<s<<endl;
}



int main(){




    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll t=1;

    // cin>>t;
    
    while(t--){
        solve();
    }
    return 0;
}


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

#define REP(i,n) for (int i=0;i<(n);i++)

using namespace std;

class graph
{
    private:
        const int number_of_nodes;
        const bool is_directed;
    public:
        vector<int> *edges;
        graph(int number_of_nodes, bool is_directed = true): number_of_nodes(number_of_nodes), is_directed(is_directed) {
            edges = new vector<int>[number_of_nodes];
        }
        ~graph() {
            delete [] edges;
        }
        int size() const {return number_of_nodes;}
        void make_edge(int u, int v) {
            edges[u].push_back(v);
            if (!is_directed) {
                edges[v].push_back(u);
            }
        }
};

// lp[v] = (maximum length of a path which starts from node v)
// the length of a path with single node is 1.
// if graph g has a cycle, return nullptr.
int * longest_path(graph &g)
{
    int *lp = new int[g.size()]();
    function<int(int, int)> f = [&](int u, int depth) -> int {
        if (lp[u] != 0) {
            return lp[u];
        }
        if (g.edges[u].size() == 0) {
            return lp[u] = 1;
        }
        if (depth == g.size()) {
            return lp[u] = -1;
        }
        int x_max = 0;
        for (int v: g.edges[u]) {
            int x = f(v, depth + 1);
            if (x == -1) {
                return lp[u] = -1;
            }
            x_max = max(x_max, x);
        }
        return lp[u] = x_max + 1;
    };
    for (int v = 0; v < g.size(); ++v) {
        if (f(v, 0) == -1) {
            delete [] lp;
            return nullptr;
        }
    }
    return lp;
}

// g: directed graph
// return topological sorted array.
// if g has a cycle, return nullptr.
int * topological_sort(graph &g)
{
    int *lp = longest_path(g);
    if (lp == nullptr) {
        return nullptr;
    }
    pair<int, int> *a = new pair<int, int>[g.size()];
    for (int v = 0; v < g.size(); ++v) {
        a[v] = pair<int, int>(lp[v], v);
    }
    sort(a, a + g.size(), greater<pair<int, int> >());
    int *result = new int[g.size()];
    for (int i = 0; i < g.size(); ++i) {
        result[i] = a[i].second;
    }
    delete [] lp;
    delete [] a;
    return result;
}

int main(void)
{
    int V, E;
    cin >> V >> E;
    graph g(V);
    REP(i, E) {
        int s, t;
        cin >> s >> t;
        g.make_edge(s, t);
    }
    int *a = topological_sort(g);
    REP(i, V) cout << a[i] << endl;

    return 0;
}


Measured memory_bytes: 3692
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

#define MOD 1000000007

void solve(int test_case) {//236
	int r,g,b,n;
	cin>>r>>g>>b>>n;
	int cnt = 0;
	for(int i=0;i<=n;i+=r) {
		for(int j=0;j+i<=n;j+=g) {
			if((n-i-j)%b==0)cnt++;
		}
	}
	cout<<cnt;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define N 100005
typedef pair<char,int> ii;
string s;
int n, res;
ii a[N];
int m;
int main()
{
	// freopen("vao.inp","r",stdin);
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> s;
	n = s.size();
	a[++m] = ii ( s[0], 0 );
	for ( int i = 1; i < n; i++) 
		if ( s[i] == a[m].st ) a[m].nd = i;
			else a[++m] = ii(s[i],i);
	cout << m-1;
}

Measured memory_bytes: 1232
#include <stdio.h>

main()
{
	int n,a[100],count;
	
	scanf("%d",&n);
	
	for(count=0;count<n;count++){
		scanf("%d",&a[count]);
	}
	for(count=n-1;count>=0;count--){
		printf("%d",a[count]);
		if(count!=0) printf(" ");
	}
	printf("\n");
	
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>
#include <tuple>

using lli=long long int;
const lli mod=1000000007;

constexpr lli mod_normalize(lli a){
  return ((a%mod)+mod)%mod;
}

constexpr lli mod_inv(lli a){
  lli b=mod, u=1, v=0, tmp=0;
  while(b){
    lli t = a/b;
    a -= t*b;
    tmp = a; a = b; b = tmp; //swap(a, b);
    u -= t*v;
    tmp = u; u = v; v = tmp; //swap(u, v);
  }
  return mod_normalize(u);
}

constexpr lli fac_pre_num = 100100;
struct fac_pre_struct{
  lli fac[fac_pre_num], finv[fac_pre_num];
  constexpr fac_pre_struct() : fac{}, finv{} {
    fac[0] = fac[1] = finv[0] = finv[1] = 1;
    for(int i = 2; i < fac_pre_num; i++) fac[i] = i*fac[i-1] % mod;
    finv[fac_pre_num-1] = mod_inv(fac[fac_pre_num-1]);
    for(int i = fac_pre_num-1; i > 2; i--) finv[i-1] = i*finv[i] % mod;
  }
};
constexpr fac_pre_struct fac_pre;

std::tuple<lli, lli, lli> fac_3_mod(lli a, lli b, lli c){
  lli t = 1;
  lli tb=1, tc=1;
  for(int i = 1; i <= a; i++){
    t = (t*i)%mod;
    if(i == b) tb = t;
    if(i == c) tc = t;
  }
  return std::make_tuple(t, tb, tc);
}

lli mod_comb(lli n, lli k){
  if(n < k || k < 0 || n < 0) return 0;
  if(n < fac_pre_num) return fac_pre.fac[n] * (fac_pre.finv[k] * fac_pre.finv[n-k] % mod) % mod;
  lli fn, fk1, fk2;
  std::tie(fn, fk1, fk2) = fac_3_mod(n, k, n-k);
  return fn * (mod_inv(fk1) * mod_inv(fk2) % mod) % mod;
}

int main(){
  lli X,Y;
  std::cin >> X >> Y;

  if((X+Y)%3 != 0){
    std::cout << 0 << std::endl;
    return 0;
  }
  lli dx = X-(X+Y)/3;

  lli ans = mod_comb((X+Y)/3, dx);
  std::cout << ans << std::endl;

  return 0;
}



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

int N, M, Q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int> A) {
  if (A.size() == N+1) {
    int now = 0;
    rep(i,Q) {
      if (A[b[i]] -A[a[i]] == c[i]) now += d[i];
    }
    ans = max(ans, now);
    return;
  }
  A.push_back(A.back());
  while(A.back() <= M) {
    dfs(A);
    A.back()++;
  }
}

int main() {
  cin >> N >> M >> Q;
  a = b = c = d = vector<int>(Q);
  rep(i,Q) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  dfs(vector<int>(1,1));
  cout << ans << endl;
  return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

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

  vector<double> ave(n);
  for (int i = 0; i < n; ++i) {
    ave[i] = abs((t - h[i] * 0.006) - a);
  }
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    if (ave[i] < ave[ans]) ans = i;
  }
  cout << ans + 1 << "\n";
  return 0;
}


Measured memory_bytes: 256
n = int(input())
s = list(map(int, input().split()))
ans = 0
for i in range(1, n):
  l = 0
  r = n-1
  cur = 0
  while True:
    l += i
    r -= i
    if l>=n or r<=i or (r%i==0 and r<=l):
      break
    cur += s[l] + s[r]
    ans = max(ans, cur)
print(ans)

Measured memory_bytes: 14860
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];
  sort(all(A));
  if(N%2) {
    int l=0, r=N-1;
    bool flag=1;
    ll sum = A[N-1]-A[N/2];
    rep(i, N-2) {
      sum += A[r]-A[l];
      if(flag) r--;
      else l++;
      flag = 1-flag;
    }
    l=0, r=N-1;
    flag=1;
    ll sum2 = A[N/2]-A[0];
    rep(i, N-2) {
      sum2 += A[r]-A[l];
      if(flag) l++;
      else r--;
      flag = 1-flag;
    }
    cout << max(sum, sum2) << endl;
  } else {
    int l=0, r=N-1;
    bool flag=1;
    ll sum = A[N-1]-A[N/2-1];
    rep(i, N-2) {
      sum += A[r]-A[l];
      if(flag) r--;
      else l++;
      flag = 1-flag;
    }
    cout << sum << endl;
  }
  return 0;
}


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

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF 1e9 + 1
#define INF_LL 1LL<<60
#define ll long long

#define MAX_V 105

#define MAX_N 100
#define MAX_M 100

ll d[305][305];

int main(){
    ll n;
    cin >> n;
    ll kyori[n][n];
    REP(i, n) REP(j, n) {
        cin >> kyori[i][j];
    }

    bool flag[n][n];
    REP(i, n) REP(j, n) flag[i][j] = true;

    /* 存在するかどうか */
    REP(k, n) REP(i, n) REP(j, n) {
        if(kyori[i][j] > kyori[i][k] + kyori[k][j]) {
            cout << "-1" << endl;
            return 0;
        } else if ((kyori[i][j] == kyori[i][k] + kyori[k][j]) && i != k && k != j) {
            //cout << "a" << endl;
            flag[i][j] = false;
        }
    }

    ll ans = 0;

    REP(i, n) REP(j, n) {
        if(flag[i][j]) ans += kyori[i][j];
    }

    cout << ans / 2 << endl;

    return 0;
}

Measured memory_bytes: 1024
#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
void init(int n);
int find(int n);
void unite(int x,int y);
bool same(int x, int y);
int dx[4] = {1,0,0,-1};
int dy[4] = {0,1,-1,0};
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
bool cmp_P(const P &a,const P &b){
  return a.second < b.second;
}
int main()
{
  ll Q,sum[100001],l[100001],r[100001];
  bool sosu[100001];
  fill(sosu,sosu+100001,true);
  sosu[0] = false;
  sosu[1] = false;
  for(int i = 2;i<100001;i++){
    if(sosu[i]){
      for(int j=2*i;j<100001;j+=i)
        sosu[j] = false;
    }
  }
  sum[0] = 0;
  sum[1] = 0;
  sum[2] = 0;
  for(int i=3;i<100001;i++){
    sum[i] = sum[i-1] + (sosu[i] && sosu[(i+1)/2] ? 1 : 0);
  }
  cin >> Q;
  REP(i,Q){
    cin >> l[i] >> r[i];
  }
  REP(i,Q){
    cout << sum[r[i]] - sum[l[i]] + (sosu[l[i]] && sosu[(l[i]+1)/2] ? 1 : 0)<< endl;
  }
  
  return 0;
}

int par[MAX_N];
int ranks[MAX_N];

//n要素で初期化
void init(int n){
  REP(i,n){
    par[i] = i;
    ranks[i] = 0;
  }

}

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

void unite(int x,int y){
  x = find(x);
  y = find(y);
  if(x == y) return ;
  if(ranks[x] < ranks[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(ranks[x] == ranks[y]) ranks[x]++;
  }
}

bool same(int x, int y){
  return find(x) == find(y);
}



Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-6;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair

const int MAX_N = 105;
int x[MAX_N], y[MAX_N], h[MAX_N];
int N;

void solve()
{
	int cx=-1,cy=-1,H=0;
	for(int xx=0;xx<=100;++xx)for(int yy=0;yy<=100;++yy){
	    bool ok = true;
	    int ub = INF;
	    ll ch = -1;
		for(int i=0;i<N;++i){
            if(h[i]==0){
                ub = min(ub, abs(x[i]-xx)+abs(y[i]-yy));
            }else{
                if(ch==-1) ch = h[i]+abs(x[i]-xx)+abs(y[i]-yy);
                else {
                    if(h[i]+abs(x[i]-xx)+abs(y[i]-yy) != ch){
                        ok = false;
                        break;
                    }
                }
            }
		}
		if(ok && ch <= ub){
			cx=xx;cy=yy;H=ch;
			cout << cx << " " << cy << " " << H << endl;
			return;
		}
	}
}

int main()
{
	cin >> N;
	for(int i=0;i<N;++i) cin >> x[i] >> y[i] >> h[i];
	solve();
}

Measured memory_bytes: 256
read -d $'\0' c11 c12 c13 c21 c22 c23 c31 c32 c33
[ \( $((c12-c11)),$((c13-c11)) != $((c22-c21)),$((c23-c21)) -o $((c32-c31)),$((c33-c31)) != $((c22-c21)),$((c23-c21)) \) -a \( $((c21-c11)),$((c31-c11)) != $((c22-c12)),$((c32-c12)) -o $((c23-c13)),$((c33-c13)) != $((c22-c12)),$((c32-c12)) \) ] &&echo No||echo Yes

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

long n;
int main() {
  cin >> n;
  map<long, long> mp;
  long sum = 0;
  for (int i = 0; i < n; ++i) {
    long a;
    cin >> a;
    sum += mp[i - a];
    ++mp[i + a];
  }
  cout << sum << endl;
}

Measured memory_bytes: 26316
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
# 文字列の入力
s = [input() for i in range(n)]
# 数え上げ
C0 = s.count('AC')
C1 = s.count('WA')
C2 = s.count('TLE')
C3 = s.count('RE')
# 出力
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))


Measured memory_bytes: 16216
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
  
public class Main{
  
    public static void main(String[] args) throws IOException {
    
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String[] line = br.readLine().split(" ");
        int n = Integer.parseInt(line[0]);
        int m = Integer.parseInt(line[1]);
        
        int num_a[][] = new int[n][m];
        
        for (int i = 0; i < n; i++) {
            String[] line1 = br.readLine().split(" ");
            for (int x = 0; x < m; x++) {
                num_a[i][x] = Integer.parseInt(line1[x]);
            }
        }
          
        int num_b[] = new int[m];
        int num_c[] = new int[n];
          
        for(int i = 0; i < m; i++) {
            num_b[i] = Integer.parseInt(br.readLine());
        }
        
        for(int i = 0; i < n; i++) {
            for(int x = 0; x < m; x++) {
                num_c[i] += num_a[i][x] * num_b[x];
            }
        }
          
        for(int i = 0; i < n; i++) {
            System.out.println(num_c[i]);
        }
    }
  
}

Measured memory_bytes: 27416
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int x=sc.nextInt();
		int y=sc.nextInt();
		System.out.println(gcd(x,y));
	}
	static int gcd(int a,int b){
		int t=0;
		while(true){
			if(b==0){
				break;
			}else{
				t=a%b;
				a=b;
				b=t;
				gcd(a,b);
			}
		}
		return a;
	}
}

Measured memory_bytes: 26284
#include <vector>
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

int main(){
    int n,a=1,k;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        if(a+a>a+k){
            a+=k;
        }else{
            a+=a;
        }
    }
    cout << a;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
*/public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}
static class TaskC   {
public void solve(int testNumber, Scanner in, PrintWriter out) {
        int N = in.nextInt();
        int K = in.nextInt();
        long ans = (long)Math.pow(N/K, 3);
        if(K%2 == 0 && N%K < K/2) ans += Math.pow(N/K, 3);
        else if(K%2 == 0 && N%K >= K/2) ans += Math.pow(N/K+1, 3);
        out.println(ans);
    }

}
}



Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int ss=0;
    char s[4];
    cin>>s;
    for(int i=0;i<4;i++)
    {
        if(s[i]=='+')
        {
            ss++;
        }
        else
        {
            ss--;
        }
    }
    cout<<ss<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;

int main(void) {
	int N, M;
	cin >> N >> M;
	vector<int> vec(N, 0);

	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		vec.at(A - 1)++;
		vec.at(B - 1)++;
	}

	for (int i = 0; i < N; i++) {
		cout << vec.at(i) << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int n = scan.nextInt();
	int k = scan.nextInt();

	if(n % k == 0){
	    System.out.println(0);
	}else{
	    System.out.println(1);
	}
    }
}
	    


Measured memory_bytes: 21716
#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;


int main(){
    double pai=3.141592653589;
    int n,ans=0,chk,tmp;
    scanf("%d",&n);
    list<int> lst;
    for(int i=0;i<n;i++){
        char c[12];
        int p;
        scanf("%s %d",&c,&p);
        string s=c;
        if(s=="deleteFirst"){
            lst.pop_front();
        }else if(s=="deleteLast"){
            lst.pop_back();
        }else if(s=="insert"){
            lst.push_front(p);
        }else{
            for(auto itr=lst.begin(); itr!=lst.end();itr++){
                if(*itr==p){
                    lst.erase(itr);
                    break;
                }
            }
        }
    }
    int l=lst.size();
    for(int i=0;i<l-1;i++){
        printf("%d ",*lst.begin());
        lst.pop_front();
    }
    printf("%d\n",*lst.begin());
    return 0;
}

Measured memory_bytes: 32404
#include<iostream>
#include<string>
#include<algorithm>


using namespace std;

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

   bool flag = false;

   int n = s.size();

   for (int i = 1; i <= n; i++){

       char a = s.at(n-1);

       for(int j = n-1; j >= 1; j--){
           s.at(j) = s.at(j-1);
       }

       s.at(0) = a;

       if(s == t) {
           flag = true;
           break;
       }
   }
   if(flag){
           cout << "Yes" << endl;
       }
       else {
           cout << "No" << endl;
       }
}

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

int n;
string a, b, c;

int main() {
	int i;
	
	cin >> n >> a >> b >> c;
	
	int ans = 0;
	for (i = 0; i < n; i++) {
		if (a[i] == b[i] && b[i] == c[i]) { continue; }
		if (a[i] == b[i] || b[i] == c[i] || c[i] == a[i]) { ans++; }
		else { ans += 2; }
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};
constexpr int N_MAX = 200;

vector<int> graph[N_MAX];
vector<int> color(N_MAX, -1);

bool is_bipartite(int node, int par, int c) {
    color[node] = c;
    for(int child: graph[node]) {
        if(color[child] != -1 && color[child] == color[node]) return false;
        if(color[child] != -1) continue;
        if(!is_bipartite(child, node, 1-c)) return false;
    }
    return true;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    string s;
    vector<vector<int>> dist(n, vector<int>(n, 1<<28));
    for(int i=0;i<n;++i) {
        cin >> s;
        dist[i][i] = 0;
        for(int j=0;j<n;++j) {
            if(s[j] == '1') {
                graph[i].push_back(j);
                dist[i][j] = 1;
            }
        }
    }

    // 二部グラフ判定
    if(!is_bipartite(0, -1, 0)) {
        cout << -1 << endl;
        return 0;
    }

    // 最長パス
    for(int k=0;k<n;++k) {
        for(int i=0;i<n;++i) {
            for(int j=0;j<n;++j) {
                dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j]);
            }
        }
    }

    int ans = 1;
    for(int i=0;i<n;++i) {
        for(int j=0;j<n;++j) {
            if(dist[i][j] < (1<<28)) ans = max(dist[i][j], ans);
        }
    }

    cout << ans+1 << endl;

}


Measured memory_bytes: 640
//HSI
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
using namespace std;
int main(){
    int N,M;
    cin >> N >> M;
    
    int a = 1;
    for(int i=0; i<M; i++){
        a *= 2;
    }

    int ans = 1900*a*M + 100*a*(N-M);
    cout << ans << endl;
    return 0;
}

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


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t = 1;
    while(t--){
        int x;
        cin>>x;
        if(x%1000==0) cout<<0;
        else cout<<1000-x%1000;
    }
    return 0;
}


Measured memory_bytes: 3612
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long ll;
const ll maxn=1e14;
double eps=1e-6;
static int a[20];
ll n;
ll sum=0;
int main(){
    cin>>n;
    for(ll i=1; i<=sqrt(n)+sqrt(sqrt(n)); i++){
        if(n%i==0 && n/i-1>i){
            sum+=n/i-1;
        }
    }

    cout<<sum;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<random>
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first - r.first, l.second - r.second); }
const lint MOD = 1e9 + 7, INF = 1e18;

lint N;
lint arr[80];
int main() {
	cin >> N;
	REP(i, N) {
		cin >> arr[i];
	}
	lint hav = 1000 / arr[0];
	lint money = 1000 - hav * arr[0];
	REP(i, N - 1) {
		if (arr[i + 1] < arr[i]) {
			money += arr[i] * hav;
			hav = money / arr[i + 1];
			money -= arr[i + 1] * hav;
		}
	}
	money += arr[N - 1] * hav;
	cout << money;
}

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

int n;
long long a[223456];
long long ans;

int main() {
   // freopen("test.txt","r",stdin);
    cin >> n ;
    for (int i = 1; i<= n ; i++) cin >> a[i];
    sort(a+1,a+1+n);
    int now = a[1];
    int cnt = 1;
    for (int i =2 ; i<= n+1 ; i++) {
        if ( a[i] == now ) {
            cnt++;
        } else {
            now = a[i];
            if ( cnt % 2 != 0 ) ans++;
            cnt = 1;
        }
    }
    cout << ans;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define int      long long int
#define MOD      1000000007
#define pb       push_back
#define mp       make_pair
#define vi       vector<int>
#define mi  	 map<int,int>
#define umi		 unordered_map<int,int>
#define pii      pair<int,int>
#define ff 		 first
#define ss 		 second
#define inf		 1e18
#define case	int t;cin>>t;while(t--)
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
void pre()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int32_t main()
{	//pre();
	//case
	{	int n, k;
		cin >> n >> k;
		int a[n];
		for (int i = 0; i < n; i++)
			cin >> a[i];
		if (n == 2)
		{cout << abs(a[0] - a[1]); return 0;}
		int dp[n];
		dp[0] = 0;
		dp[1] = abs(a[0] - a[1]);
		for (int i = 2; i < n; i++)
		{	int s = INT_MAX;
			for (int j = i - 1; j >= max(i - k, 0ll); j--)
			{	int tp = dp[j] + abs(a[j] - a[i]);
				s = min(s, tp);
			}
			dp[i] = s;
		}
		cout << dp[n - 1];
	}
	return 0;
}

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

int N;
int A[1000000];
int sum = 0;

int main(){
	cin >> N;
	A[0] = 0;
	A[N + 1] = 0;
	for(int i = 1; i <= N; i++){
		cin >> A[i];
	}
	for(int i = 0; i <= N; i++){
		sum += abs(A[i] - A[i + 1]);
	}
	for(int i = 1; i <= N; i++){
		int diff = abs(A[i] - A[i + 1]) + abs(A[i] - A[i - 1]) - abs(A[i - 1] - A[i + 1]);
		cout << sum - diff << endl;
	}
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <set>
#include <map>
#include <list>
#define debug(x) cout << #x << ": " << (x) << endl
using namespace std;

const double PI  = 3.141592653589793238463;
const int INF = 1000000007;

using ull = unsigned long long;
using ll = long long;

using Int = int;
using Double = double;

using P = pair<Int, Int>;
using V = vector<Int>;
using M = vector<V>;

string solve(char c){
    switch(c){
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
        return "vowel";
    default:
        return "consonant";
    }
}

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

    char c;
    cin >> c;

    cout << solve(c) << endl;

    return 0;
}


Measured memory_bytes: 256
N=int(input())
A,B=map(int,input().split())
series = list(map(int,input().split()))
count1=0
count2=0
count3=0
for s in series:
	if s <= A:
		count1 += 1
	elif s <= B:
		count2 += 1
	else:
		count3 += 1
print(min(count1,count2,count3))

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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#define MAX_N 200010
ll bit[MAX_N + 1], n;

ll sum(int i){
  ll s = 0;
  while(i > 0){
    s += bit[i]; // s += bit[i];
    i -= i & -i; // xの下のビットをみる
  }
  return s;
}

void add(int i,ll x){
  // 親に更新伝えて行く
  while(i <= n){
    bit[i] += x;
    i += i & -i; // xのもっとも下の立っている最も下のビット
  }
}

void cocomp(VLL &v){
    VLL p(v);
    sort(all(p));
    map<ll,ll> mp;
    ll cnt = 1;
    int n = v.size();
    rep(i,n){
        if(mp[p[i]] != 0){
            continue;
        }else{
            mp[p[i]] = cnt;
            cnt++;
        }
    }
    rep(i,n){
        v[i] = mp[v[i]];
    }
}


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

  rep(i,n) cin >> a[i];
  FOR(i,1,n) a[i] += a[i-1];

  rep(i,n) v[i] = a[i] - (k * i);

  cocomp(v);

  // rep(i,n+1) cout << v[i] << " ";
  // cout << endl;

  ll ans = 0;
  // l == 0 のとき
  rep(i,n) {
    if( a[i] >= k * (i+1) ) ans++;
  }

  rep(i,n){
    ans += sum(v[i]);
    add(v[i],1);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 17568
#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cstring>
#include <limits.h>
#include <bitset>
#include <complex>
#include <cassert>
#define FOR(i,k,n)  for (int i=(k); i<(int)(n); ++i)
#define REP(i,n)    FOR(i,0,n)
#define FORIT(i,c)	for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define SZ(i) ((int)i.size())
#define GI(i) (scanf("%d",&i))
#define GLL(i) (scanf("%lld",&i))
#define GD(i)  (scanf("%lf",&i))
#define PB          push_back
#define MP          make_pair
#define MT          make_tuple
#define GET0(x)     (get<0>(x))
#define GET1(x)     (get<1>(x))
#define GET2(x)     (get<2>(x))
#define ALL(X)      (X).begin(),(X).end()
#define LLMAX       (1LL<<60)
#define LLMIN       -(1LL<<60)
#define IMAX        (1<<30)
#define IMIN        -(1<<30)
typedef long long LL;
using namespace std;

int nW[300000];

int main(void){
    int N;
    cin>>N;
    string S;
    cin>>S;
    REP(i,N){
        if(i==0)
            nW[i] = (S[i] == 'W');
        else
            nW[i] = (S[i] == 'W') + nW[i-1];
    }
    int ans = SZ(S);
    REP(i,N){
        if(i==0){
            ans = min(ans, (SZ(S)-1) - (nW[SZ(S)-1] - nW[0]));
        }else if(i<N-1){
            ans = min(ans, nW[i-1] + (N - (i+1) - (nW[N-1] - nW[i])));
        }else{
            ans = min(ans, nW[N-2]);
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1796
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  vector<int> r, g, b;
  rep(i, n) {
    if (s[i] == 'R')
      r.push_back(i);
    else if (s[i] == 'G')
      g.push_back(i);
    else
      b.push_back(i);
  }
  ll ans = 0;
  rep(i, r.size()) rep(j, g.size()) {
    ans += b.size();
    int mn = min(r[i], g[j]), mx = max(r[i], g[j]), d = mx-mn;
    auto it = lower_bound(b.begin(), b.end(), mx+d);
    if (it != b.end() && *it == mx+d)
      ans--;
    it = lower_bound(b.begin(), b.end(), mn-d);
    if (it != b.end() && *it == mn-d)
      ans--;
    it = lower_bound(b.begin(), b.end(), mn+d/2);
    if (d%2 == 0 && it != b.end() && *it == mn+d/2)
      ans--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  string s;
  cin>>s;
  int cnt1=0,cnt2=0;
  for(int i=0; i<n; i++){
    cin>>s[i];
    if(s[i]=='('){cnt1++;}
    else{
      if(cnt1>0){cnt1--;}
      else cnt2++;
    }
  }
  for(int i=0; i<cnt2; i++){
      cout<<'(';
  }
  cout<<s;
  for(int i=0; i<cnt1; i++){
      cout<<')';
  }
    cout<<endl;
}


Measured memory_bytes: 256
// MOHIT KUMAR
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pin;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

#define ff(i, a, b) for ( ll i=a; i<(b); i++)
#define ffd(i, a, b) for ( ll i=a; i<= b; i++)
#define fr(i, a, b) for ( ll i = (b)-1; i >= a; i--)
#define ffr(i, a, b) for ( ll i = b ; i >= a; i--)
#define vl vector < ll >
#define vp vector < pl >
#define endl "\n"
#define sz(x) (ll)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const ld pi = acos(-1) ;
const ll maxn = 105 ;
const int mod = 1e9 + 7 ;
const ll INF = 1e18 ;
const int MX = 2000000001 ; // check the limits, dummy

int main() {
  ios_base::sync_with_stdio(0) , cin.tie(0);
  ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
  cin >> n ;
  vl v, vc ;
  ff(i, 0, n) {
    cin >> a >> b;
    v.pb(a + b) ;
    vc.pb(a - b) ;
  }
  sort(all(v)) ;
  sort(all(vc)) ;
  cout << max({v.back() - v[0], abs(vc.back() - vc[0]) } ) ;
}

Measured memory_bytes: 6692
import java.util.*;
import java.io.*;

public class Main {
	private static void solve(){
	//Implement solution here.
		int n = ni();
		double result = 0;
		for(int i = 0; i < n; i++){
			double x = nd();
			String u = next();
			if("JPY".equals(u)){
				result += x;
			}else{
				result += x * 380000.0;
			}
		}
		System.out.println(result);
	}
	

    //Switch input source (stdin/file)
	private static Scanner scanner = new Scanner(System.in);
	public static void main(String[] args){
        String debugDataPath = System.getenv("DD_PATH");        
        if(debugDataPath != null){
            try{
                scanner = new Scanner(new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath)))));
            }catch(Exception e){
                throw new RuntimeException(e);
            }
        }
        solve();
	}

    //Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(scanner.nextLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
    //Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
    //Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
    //Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
    //Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
    //Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 23252
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
#include <string.h>
using namespace std;

int main() {
	long long int N,M,ans;
	cin>>N>>M;
	if(N==1&&M==1)ans=1;
	else if(N==1^M==1)ans=N*M-2;
	else{
		ans=N*M-2*(N+M)+4;
	}
	cout<<ans;
	}

Measured memory_bytes: 256
use std::io::Read;
use std::cmp::{max, min};

fn divisors(num: &i32) -> Vec<i32>{
    let mut d = 1i32;
    let mut res = vec![];
    while d * d <= *num{
        if num % d == 0{
            res.push(d);
            if num / d != d {
                res.push(num / d);
            }
        }
        d += 1;
    }
    res
}

fn valid(nums: &Vec<i32>, d: &i32, k:&i32)->bool{
    let mut rems:Vec<i32> = nums.into_iter().map(|x| {x%d}).collect();
    let mut remsum = 0i32;
    for val in &rems{
        remsum += *val;
    }
    rems.sort();
    let mut movecnt = 0i32;
    for i in 0..(rems.len() as i32)-remsum/d{
        movecnt += rems[i as usize];
    }
    movecnt <= *k
}

fn main(){
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let n:i32 = iter.next().unwrap().parse().unwrap();
    let k:i32 = iter.next().unwrap().parse().unwrap();

    let mut nums = vec![];
    let mut sum = 0i32;
    for _ in 0..n{
        let a:i32 = iter.next().unwrap().parse().unwrap();
        nums.push(a);
        sum += a;
    }
    let mut divs = divisors(&sum);
    divs.sort();
    divs.reverse();
    for d in divs{
        if valid(&nums, &d, &k){
            println!("{}", d);
            return;
        }
    }
}




Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <ctime>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
#define fs first
#define sc second
#define INF 1000000000
#define MOD 1000000007
#define EPS 0.00000001


int main() {
    vector<int> V(5);
    for(int &v:V)
        cin >> v;
    int K; cin >> K;
    bool f = false;
    for(int i=0; i<5; i++){
        for(int j=i+1; j<5; j++){
            if(abs(V[i]-V[j]) > K) f = true;
        }
    }
    if(f) cout << ":(" << endl;
    else cout << "Yay!" << endl;
    return 0;
}


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

int getGCD(int a, int b) {
    if (a < b) {
        int tmp = a;
        a = b;
        b = tmp;
    }
    return (a % b == 0 ? b : getGCD(b, a % b));
}

long long getLCD(int a, int b) {
    return (long long)(a / getGCD(a, b)) * b;
}

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

    long long L = getLCD(N, M);
    map<long long, char> mp;
    for (int i = 0; i < N; i++) mp[i * (L / N)] = S[i];
    for (int i = 0; i < M; i++) {
        if (mp.find(i * (L / M)) != mp.end() && mp[i * (L / M)] != T[i]) {
            L = -1;
            break;
        }
    }

    cout << L << endl;
}

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

using namespace std;

#define show(x) cerr << #x << " = " << x << endl;


int main()
{
  int x, y, z;
  cin>>x>>y>>z;

  cout<<z<<" "<<x<<" "<<y;

  return 0;
}


Measured memory_bytes: 256
import sys

def Forbidden_List(x,n,p):
  for i in range(n):
    if x - i not in p: 
        return x - i
    if x + i not in p:
        return x + i
  return x - n

if __name__ == '__main__':
    input = sys.stdin.readline
    
    inp1 = input().rstrip().split()
    x,n = int(inp1[0]),int(inp1[1])
    if n == 0:
        print(x)
    else: 
        inp2 = input().rstrip().split()
        p = list(map(int,inp2))
        print(Forbidden_List(x,n,p))

Measured memory_bytes: 9196
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define cc continue
#define bb break
#define rem 1000000007
#define PI 3.141592653589793238462643383279502
//fflush(stdin);
// do {
// // process permutation
// } while (next_permutation(permutation.begin(),permutation.end()));
class abc
{
    public:
    ll x,y;
};
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    ld h,a;
    cin>>h>>a;
    cout<<(ll)ceil(h/a)<<"\n";
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _0222
{
    class Program
    {
        static void Main(string[] args)
        {
            const int MAX = 10000000;

            bool[] notPrime = new bool[MAX + 1];
            long boundary = (long)Math.Floor(Math.Sqrt(MAX));
            notPrime[0] = notPrime[1] = true;

            for (long i = 2; i <= boundary; ++i)
            {
                if (notPrime[i]) continue;
                for (int j = 2; i * j <= MAX; j++)
                {
                    notPrime[i * j] = true;
                }
            }

            while (true)
            {
                int n = RInt();
                if (n == 0) break;

                for (int i = n; i >= 13; i--)
                {
                    if (!notPrime[i] && !notPrime[i - 2] & !notPrime[i - 6] & !notPrime[i - 8])
                    {
                        Console.WriteLine(i);
                        break;
                    }
                }
            }
        }

        static string RSt() { return Console.ReadLine(); }
        static int RInt() { return int.Parse(Console.ReadLine().Trim()); }
        static long RLong() { return long.Parse(Console.ReadLine().Trim()); }
        static double RDouble() { return double.Parse(Console.ReadLine()); }
        static string[] RArSt(char sep = ' ') { return Console.ReadLine().Trim().Split(sep); }
        static int[] RArInt(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => int.Parse(e)); }
        static long[] RArLong(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => long.Parse(e)); }
        static double[] RArDouble(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Trim().Split(sep), e => double.Parse(e)); }
        static string WAr<T>(IEnumerable<T> array, string sep = " ") { return string.Join(sep, array.Select(x => x.ToString()).ToArray()); }
    }
}



Measured memory_bytes: 25168
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n0 = 0;
		int n1 = 0;

		int[] num = new int[3];

		for (int i = 0; i < 3; i++) {
			num[i] = s.nextInt();
		}
		Arrays.sort(num);

		if (num[0] % 2 == 0 && num[1] % 2 == 0) {
			if (num[2] % 2 == 0) {
				//2,4,6
				n0 = (num[2] - num[0]) / 2;
				n1 = (num[2] - num[1]) / 2;
				System.out.println(n0 + n1);
			} else {//2,4,5
				n0 = (num[2] - num[0]) / 2;
				n1 = (num[2] - num[1]) / 2;
				System.out.println(n0 + n1+1);
			}
		} else if (num[0] % 2 == 0 || num[1] % 2 == 0) {
			if (num[2] % 2 == 0) {
				//2,5,6
				n0 = (num[2] - num[0]) / 2;
				n1 = (num[2] - num[1]) / 2;
				System.out.println(n0 + n1+2);
			} else {//2,5,7
				n0 = (num[2] - num[0]) / 2;
				n1 = (num[2] - num[1]) / 2;
				System.out.println(n0 + n1+2);
			}
		} else {

			if (num[2] % 2 == 0) {
				//3,5,6
				n0 = (num[2] - num[0]) / 2;
				n1 = (num[2] - num[1]) / 2;
				System.out.println(n0 + n1 + 1);
			} else {
				//3,5,7
				n0 = (num[2] - num[0]) / 2;
				n1 = (num[2] - num[1]) / 2;
				System.out.println(n0 + n1);
			}
		}
	}
}


Measured memory_bytes: 22100
#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 1400;

int a[MAX_N][MAX_N];
int dp[MAX_N][MAX_N];

int main()
{
	int h,w;
	cin >> h >> w;
	int ans=0;
	rep(i,h){
		rep(j,w){
			scanf("%d",&a[i][j]);
			if(a[i][j]==0){
				dp[i][j] = 1;
				ans = 1;
			}
		}
	}
	for(int i=1;i<h;i++){
		for(int j=1;j<w;j++){
			if(a[i][j] == 0){
				dp[i][j] = min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
				ans = max(ans,dp[i][j]);
			}else{
				dp[i][j] = 0;
			}
		}
	}
	cout << ans*ans << "\n";
}

Measured memory_bytes: 18448
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  ll k, x;
  cin >> k >> x;
  if (500 * k >= x) {
    puts("Yes");
  } else {
    puts("No");
  }
}


Measured memory_bytes: 256
#include <functional>
#include <vector>

template<typename Monoid>
class segment_tree {
	using value_type = Monoid;
	using size_type = size_t;

	using binary_function = std::function<value_type(value_type, value_type)>;
	using checker = std::function<bool(value_type)>;
	
	const size_type size_;
	size_type height_;

	const value_type id;
	const binary_function bi_func;
	std::vector<value_type> data;
	
	private:
	const size_type get_height(const size_type& size) const {
		size_type height = 1;
		while(1 << height < size) height++;
		return height;
	}
	const size_type base_size() const {
		return 1 << height_;
	}
	void meld(const size_type& index) {
		data[index] = bi_func(data[index << 1 ^ 0], data[index << 1 ^ 1]);
	}
	
	public:
	segment_tree(const size_type& size, const binary_function& bi_func, const value_type& id)
		: size_(size),
		  bi_func(bi_func),
		  id(id) {
		height_ = get_height(size);
		data.assign(base_size() << 1, id);
	}
	value_type fold(size_type left, size_type right) {
		value_type l_value = id,
				   r_value = id;

		for(left += base_size(), right += base_size();
			left < right;
			left >>= 1, right >>= 1) {
			if(left & 1)  l_value = bi_func(l_value, data[left++]);
			if(right & 1) r_value = bi_func(data[--right], r_value); 
		}
		return bi_func(std::move(l_value), std::move(r_value));
	}
	void update(size_type index, const value_type& value) {
		index += base_size();
		data[index] = bi_func(data[index], value);

		while(index >>= 1) meld(index);
	}
	void change(size_type index, const value_type& value) {
		index += base_size();
		data[index] = value;

		while(index >>= 1) meld(index);
	}
	const size_type search(const size_type & left, const checker & check) {
		value_type val = id;
		size_t base_size_ = base_size();
		auto find = [&](auto&& find, size_type k, size_type l, size_type r) -> int {
			if(l + 1 == r) {
				val = bi_func(val, data[k]);
				
				return (check(val) ? k - base_size_ : -1);
			}

			const size_type mid = (l + r) >> 1;
			if(mid <= left) return find(find, k << 1 ^ 1, mid, r);
			if(left <= l and !check(bi_func(val, data[k]))) {
				val = bi_func(val, data[k]);
				return -1;
			}

			const int left_ret = find(find, k << 1 ^ 0, l, mid);
			if(left_ret == -1) return find(find, k << 1 ^ 1, mid, r);
			return left_ret;
		};

		return find(find, 1, 0, base_size_); 
	}
	
	value_type operator[](const size_type& index) const {
		return data[index + base_size()];
	}
	const size_type size() const {
		return size_;
	}
	const bool empty() const {
		return data.empty();
	}
};

// verify
// + https://judge.yosupo.jp/submission/116
//	 RmQ
// + https://atcoder.jp/contests/abc130/submissions/7347630
//	 search

int main() {
	int n, q; scanf("%d%d", &n, &q);

	segment_tree<int> seg(n, [](int a, int b) { return std::min(a, b); }, (1LL << 31) - 1);
	while(q--) {
		int type, x, y; scanf("%d%d%d", &type, &x, &y);

		if(type == 0) seg.change(x, y);
		else printf("%d\n", seg.fold(x, y + 1));
	}
	return 0;
}



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

using namespace std;

typedef long long ll;

int main(){
	int n, k;
	cin >> n >> k;
	vector<int> H(n);
	for(int i = 0; i < n; i++){
		cin >> H[i];
	}
	sort(H.begin(), H.end());
	int ans = 1001001001;
	for(int i = 0; i+k-1 < n ; i++){
		int temp = H[i+k-1] - H[i];
//		cout << temp << endl;
		ans = min(ans , temp);
	}

	cout << ans << endl;
}

Measured memory_bytes: 640