akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;
    const char White = '.';
    const char Black = '#';

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());
        var s1 = input.ReadLine();
        var s2 = input.ReadLine();

        const int yoko = 1;
        const int tate = 2;

        var list = new List<int>();

        for(int i=0; i<n;) {
            if (s1[i] == s2[i]) {
                list.Add(tate);
                i += 1;
            } else {
                list.Add(yoko);
                i += 2;
            }
        }

        var prev = 0;
        long count = 1;

        foreach(var x in list) {
            if(x == tate) {
                if (prev == tate) count *= 2;
                else if (prev == yoko) count *= 1;
                else count *= 3;

                count %= Mod;
            } else {
                if (prev == tate) count *= 2;
                else if (prev == yoko) count *= 3;
                else count *= (3 * 2);

                count %= Mod;
            }
            prev = x;
        }

        return count % Mod;
    }

    static int[] ToIntArray(string strs, int n) {
        var ret = new int[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = int.Parse(spl[i]);
        return ret;
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int w, h, n;
  cin >> w >> h >> n;
  
  vector<int> x(n), y(n), a(n);
  for (int i = 0; i < n; i++) {
    cin >> x.at(i) >> y.at(i) >> a.at(i);
  }

  vector<vector<int>> data(h, vector<int>(w, 0));
  
  for (int i = 0; i < n; i++) {
    if(a.at(i) == 1){
      for (int j = 0; j < h; j++) {
        for (int k = 0; k < x.at(i); k++) {
          data.at(j).at(k) = 1;
        }
      }
    }
    if(a.at(i) == 2){
      for (int j = 0; j < h; j++) {
        for (int k = x.at(i); k < w; k++) {
          data.at(j).at(k) = 1;
        }
      }
    }
    if(a.at(i) == 3){
      for (int j = h - y.at(i); j < h; j++) {
        for (int k = 0; k < w; k++) {
          data.at(j).at(k) = 1;
        }
      }
    }
    if(a.at(i) == 4){
      for (int j = 0; j < h - y.at(i); j++) {
        for (int k = 0; k < w; k++) {
          data.at(j).at(k) = 1;
        }
      }
    }
  }
  
  int count = 0;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      if(data.at(i).at(j) == 0){
        count++;
      }
    }
  }
  
  cout << count << endl;

}
             
 

Measured memory_bytes: 3636
import sys
input=sys.stdin.readline
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = list(map(int,input().split()))
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
N,M = map(int,input().split())
dicti = {i:True for i in range(N+2)}
for i in range(M):
    a = int(input())
    dicti[a] = False
ans = [0] * (N+3)
ans[0] = 1
for i in range(N):
    if dicti[i]:
        ans[i+1] += ans[i]
        ans[i+1] = ans[i+1] % 1000000007
        ans[i+2] += ans[i]
        ans[i+2] = ans[i+2] % 1000000007
    else:
        ans[i] = 0
print(ans[N])

Measured memory_bytes: 16212
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cassert>

using namespace std;

#define print(x) cout << x << endl
#define input(x) cin >> x

typedef long long llint;

const llint INFLL = 0x3f3f3f3f3f3f3f3fLL;
const int INF = 0x3f3f3f3f;

struct Point {
    int x, y, p;
};

int main() {
    int n;
    vector<Point> ps;
    vector<pair<int, int> > xs;
    vector<pair<int, int> > ys;

    input(n);

    int x, y, p;
    for (int i = 0; i < n; i++) {
        scanf("%d%d%d", &x, &y, &p);
        ps.push_back({x, y, p});

        xs.push_back({ x, i });
        ys.push_back({ y, i });
    }

    vector<llint> ans(n + 1, INFLL);
    vector<vector<int> > disx(1 << n);
    vector<vector<int> > disy(1 << n);

    for (int i = 0; i < (1 << n); i++) {
        disx[i] = vector<int>(n, INF);
        for (int j = 0; j < n; j++) {
            disx[i][j] = min(disx[i][j], abs(ps[j].x));
            if ((i & (1 << j)) == 0) {
                continue;
            }
            for (int k = 0; k < n; k++) {
                disx[i][k] = min(disx[i][k], abs(ps[j].x - ps[k].x));
            }
        }
    }

    for (int i = 0; i < (1 << n); i++) {
        disy[i] = vector<int>(n, INF);
        for (int j = 0; j < n; j++) {
            disy[i][j] = min(disy[i][j], abs(ps[j].y));
            if ((i & (1 << j)) == 0) {
                continue;
            }
            for (int k = 0; k < n; k++) {
                disy[i][k] = min(disy[i][k], abs(ps[j].y - ps[k].y));
            }
        }
    }

    int status = 1;
    for (int i = 0; i < n; i++) {
        status *= 3;
    }

    for (int i = 0; i < status; i++) {
        int yy = 0;
        int xx = 0;

        int cur = i;
        int cnt = 0;
        for (int j = 0; j < n; j++) {
            xx <<= 1;
            yy <<= 1;
            int c = cur % 3;
            if (c == 0) {
                // pass
            } else if (c == 1) {
                xx |= 1;
                cnt++;
            } else {
                yy |= 1;
                cnt++;
            }
            cur /= 3;
        }

        vector<int> dis(n, INF);
        for (int j = 0; j < n; j++) {
            dis[j] = min(abs(ps[j].x), abs(ps[j].y));
        }

        for (int j = 0; j < n; j++) {
            dis[j] = min(dis[j], disx[xx][j]);
            dis[j] = min(dis[j], disy[yy][j]);
        }

        llint tot = 0;
        for (int j = 0; j < n; j++) {
            tot += 1LL * dis[j] * ps[j].p;
        }
        ans[cnt] = min(ans[cnt], tot);
    }

    for (int i = 0; i <= n; i++) {
        printf("%lld\n", ans[i]);
    }

    return 0;
}



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

int main() {
	int n;
	cin >> n;
	vector<int> x(n);
	vector<pair<int, int>> m(n);
	rep(i, n) {
		cin >> x[i];
		m[i] = make_pair(x[i], i);
	}
	sort(all(m));
	if(m[n/2].first == m[n/2 - 1].first) rep(i, n) cout << m[n/2].first << endl;
	else {
		rep(i, n) {
			if(x[i] <= m[n/2 - 1].first) {
				cout << m[n/2].first << endl;
		// cout << "w" << endl;
			} else {
				cout << m[n/2 - 1].first << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 4480
/* Author: Akkapaka Saikiran (@saikidon911) */
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using vi = vector<int>; using vll = vector<long long>; 
using vvi = vector<vector<int> >; using vb = vector<bool>;
using pii = pair<int,int>; 
#define pb push_back
#define all(v) v.begin(),v.end()
#define llmax 9223372036854775807
#define intmax 2147483647
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
const ll mod = 1e9+7;
//////////////////////////////////////////
#define test(t) int t; cin>>t; while(t--)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
////////////////////////////////////////////
#define tki take_input 
#define tkii take_input<int>
template <typename T> void take_input(vector<T> &a,int sz){
	T t;rep(i,sz){cin>>t;a.pb(t);}}
#define prv print_vector
#define prvi print_vector<int> 
template <typename T> void print_vector(vector<T> v){
	rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl;}
/////////////////////////////////////////

int main(){
	fastio;

	int n; cin>>n;
	if(n%1000 == 0) cout<<0<<endl;
	else cout<<(1+n/1000)*1000 - n<<endl;

}

Measured memory_bytes: 3676
#include <stdio.h>

int main(void)
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	if((0<=a<=100)&&(0<=b<=100)&&(0<=c<=100)){
		if(a<b && b<c){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}
	return 0;
}

Measured memory_bytes: 580
#include <algorithm>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using std::cin;
using std::cout;
using std::endl;

int main(void) {
    cout << std::fixed << std::setprecision(10);
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    int n, a, b;
    cin >> n >> a >> b;
    int diff = b - a;
    bool is_alice;
    if (diff == 1) {
        is_alice = false;
    } else {
        if (diff % 2 == 0) {
            is_alice = true;
        } else {
            is_alice = false;
        }
    }
    cout << (is_alice ? "Alice" : "Borys") << endl;

    return 0;
}


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

using namespace std;

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


Measured memory_bytes: 3100
def main():
    # 入力
    s = input()

    target = ["A", "T", "C", "G"]

    cnt = 0
    current_cnt = 0
    for c in s:
        if c in target:
            current_cnt += 1
        else:
            if current_cnt > cnt:
                cnt = current_cnt
            current_cnt = 0

    if current_cnt > cnt:
        cnt = current_cnt
    print(cnt)


main()


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int n;
struct node{
	int t,s;
}a[100005];
int cmp(node x,node y){
	return x.t<y.t;
}
int main()
{
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i].t;
		a[i].s=i+1;
	}
	sort(a,a+n,cmp);
	for(int i=0;i<n;i++){
		cout << a[i].s<<" ";
	}
	return 0;
} 

Measured memory_bytes: 1536
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
 
typedef long long ll;
 
using namespace std;
 
int main(){
    vector<int> vec;
    int n,in,last,c=1,ans=0,sum=0;
    
    scanf("%d",&n);
    
    scanf("%d",&in);
    last=in;
    
    for(int i=1;i<n;i++){
        scanf("%d",&in);
        if(last!=in){
            last=in;
            c++;
        }else{
            vec.push_back(c);
            c=1;
        }
    }
    
    vec.push_back(c);
    
    for(int i=0;i<vec.size();i++){
        sum+=vec[i];
        if(i>2)
            sum-=vec[i-3];
        ans=max(ans,sum);
    }
    
    printf("%d\n",ans);
    
    return 0;
}

Measured memory_bytes: 3292
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T = int> void print(vector<T> v){for(auto a:v)cout<<a<<" ";cout<<endl;}

/*
x回で出来る配置：x+1回でも出来る
動かさない箇所を
*/

template<int MOD>
struct ModInt {
	static const int Mod = MOD;
	unsigned x;
	ModInt() : x(0) { }
	ModInt(signed sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	ModInt(signed long long sig) { int sigt = sig % MOD; if (sigt < 0) sigt += MOD; x = sigt; }
	int get() const { return (int)x; }

	ModInt &operator+=(ModInt that) { if ((x += that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator-=(ModInt that) { if ((x += MOD - that.x) >= MOD) x -= MOD; return *this; }
	ModInt &operator*=(ModInt that) { x = (unsigned long long)x * that.x % MOD; return *this; }
	ModInt &operator/=(ModInt that) { return *this *= that.inverse(); }

	ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
	ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
	ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
	ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }

	ModInt inverse() const {
		signed a = x, b = MOD, u = 1, v = 0;
		while (b) {
			signed t = a / b;
			a -= t * b; std::swap(a, b);
			u -= t * v; std::swap(u, v);
		}
		if (u < 0) u += Mod;
		ModInt res; res.x = (unsigned)u;
		return res;
	}
};
typedef ModInt<1000000007> mint;
vector<mint> fact, factinv;
void nCr_computeFactinv(int N) {
	N = min(N, mint::Mod - 1);
	fact.resize(N + 1); factinv.resize(N + 1);
	fact[0] = 1;
	reg(i, 1, N) fact[i] = fact[i - 1] * i;
	factinv[N] = fact[N].inverse();
	for (int i = N; i >= 1; i --) factinv[i - 1] = factinv[i] * i;
}
mint nCr(int n, int r) {
	if (n >= mint::Mod)
		return nCr(n % mint::Mod, r % mint::Mod) * nCr(n / mint::Mod, r / mint::Mod);
	return r > n ? 0 : fact[n] * factinv[n - r] * factinv[r];
}
mint nPr(int n, int r) {
	if (r<0)return 0;
	return r > n ? 0 : fact[n] * factinv[n-r];
}
mint nHr(int n, int r) { return r == 0 ? 1 : nCr(n + r - 1, r); }

ll n,k;
mint ans=0;

void init(){
	cin>>n>>k;
	nCr_computeFactinv(2*n);
}

int main(void){
	init();
	reg(i,0,min(k,n)){
		ans += nCr(i+n-i-1,i)*nCr(n,i);
	}
	cout<<ans.get()<<endl;
	return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
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; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(11);
  int T;
  T = 1;
  while (T--) solve();
}

void solve() {
  string s;
  cin >> s;
  int n = sz(s);

  ll ans = 0;
  auto dfs = [&](auto&& dfs, ll sum = 0, ll cur = 0, int i) -> void {
    // cout << sum << " " << cur << " " << i << endl;
    if (i == n) {
      if (cur) sum += cur;
      ans += sum;
      return;
    }
    cur = cur * 10 + s[i] - '0';

    if (i != n - 1) { // 後に + をつけることができる
      dfs(dfs, sum + cur, 0, i + 1);
    }
    // + をつけない場合
    dfs(dfs, sum, cur, i + 1);
  };
  dfs(dfs, 0, 0, 0);
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main {

	static PrintWriter out;
	static InputReader ir;
	static int[] par, dep, ch;

	static void solve() {
		int n=ir.nextInt();
		int k=ir.nextInt();
		int cur=1;
		for(int i=0;i<n;i++){
			if(cur>k)
				cur+=k;
			else
				cur<<=1;
		}
		out.println(cur);
	}

	public static void main(String[] args) throws Exception {
		ir = new InputReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	static class InputReader {

		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}


Measured memory_bytes: 21332
#include<iostream>
using namespace std;
int main(){
	int a,b,k,i;
	cin>>a>>b>>k;
	for(i=0;i<k;i++)
		if(i%2==0){
			a/=2;
			b+=a;
		}
		else{
			b/=2;
			a+=b;
		}
	cout<<a<<' '<<b;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
like = [0] * n
for i in range(n):
    like[i] = a[i] - 1  # 0idx
ans = 0
for i in range(n):
    if like[like[i]] == i:
        ans += 1
print(ans // 2)


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


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

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

namespace ABC085A
{
	class Program
	{
		static void Main(string[] args)
		{
			string s;

			s = Console.ReadLine();

			char[] cs = s.ToCharArray();

			cs[3] = '8';

			Console.WriteLine(cs);

			Console.ReadKey();
		}
	}
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define era(t) t.erase(unique(be(t)),t.end())
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=1000000007,mod9=1000000009;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin>>n>>m;
    ll ans=1;
    if(abs(n-m)>1){
        cout << 0 <<endl;
        return 0;
    }
    else if(n-m==0){
        ans*=2;
    }
    for(int i=1;i<=n;i++){
        ans*=i;
        ans%=mod;
    }
    for(int i=1;i<=m;i++){
        ans*=i;
        ans%=mod;
    }
    cout << ans<<endl;
    return 0;

}






Measured memory_bytes: 256
#include <iostream>

int main(void) {
    int a, b, c;
    std::cin >> a >> b >> c;

    int n = 0;
    for(int i=a; i<=b; i++) {
        if(c % i == 0) n++;
    }

    std::cout << n << std::endl;

    return 0;
}



Measured memory_bytes: 3120
#include <iostream>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <queue>
#include <vector>
#define ll long long
const int N=1e6+10;
using namespace std;
ll n;

int main() {
   cin>>n;
   ll ans=n+1;
   for(ll i=1;i*i<=n;i++){
       if(n%i==0){
           ans=min(ans,i+n/i-2);
       }
   }
   cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split()]
n = max(A)
max_r = n / 2
r_list = [abs(a-max_r) for a in A]
r = A[r_list.index(min(r_list))]
print(str(n) + " " + str(r)) if n!=r else print(str(n) + " " + str(0))

Measured memory_bytes: 14052
#include <bits/stdc++.h>
using namespace std;
int n;
char s[123][2];
int main() {
	cin>>n;
	if(n%2==1){
		cout<<"No"<<endl;
		return 0;
	}
	for(int i=0;i<n/2;i++)cin>>s[i][0];
	
	for(int i=0;i<n/2;i++){
		cin>>s[i][1];
		if(s[i][0]!=s[i][1]){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
}


Measured memory_bytes: 256
#include <iostream>

int main () {
	std::string a, b, c;
      
  std::cin >> a >> b >> c;
 
  if(a.substr(a.size()-1, 1) == b.substr(0, 1) && b.substr(b.size()-1, 1) == c.substr(0, 1)) {
  	std::cout << "YES" << std::endl;
  }else {
  	std::cout << "NO" << std::endl;
  }
}

Measured memory_bytes: 3632
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
const int Nmax = 200000;
int N;
ll A[Nmax];


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

	vector<ll> cum(N);
	cum[0] = A[0];
	for(int i=1; i<N; i++){
		cum[i] = cum[i-1]+A[i];
	}

	int j=0;
	int k=2;
	ll ans = 1e18;
	for(int i=1; i<N-2; i++){
		while(j < i-1 &&
				abs(cum[j]-(cum[i]-cum[j])) > abs(cum[j+1]-(cum[i]-cum[j+1]))) j++;
		k = max(k, i+1);
		while(k < N-1 &&
				abs(cum[k]-cum[i]-(cum[N-1]-cum[k])) > abs(cum[k+1]-cum[i]-(cum[N-1]-cum[k+1]))) k++;
		//cout << j << " " << i << " " << k << endl;
		ll a = max(max(cum[j],cum[i]-cum[j]), max(cum[k]-cum[i], cum[N-1]-cum[k]));
		ll b = min(min(cum[j],cum[i]-cum[j]), min(cum[k]-cum[i], cum[N-1]-cum[k]));
		ans = min(ans, a-b);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3328
#include <cstdio>
#include <algorithm>
using namespace std;

int add(int a, int b) {return a+b;}
int sub(int a, int b) {return a-b;}
int mul(int a, int b) {return a*b;}

int ps[4];
int (*op[3])(int, int) = {add, sub, mul};
char ops[] = {'+', '-', '*'};

void solve() {
  sort(ps, ps+4);
  do {
    for (int i=0; i<3; i++) {
      for (int j=0; j<3; j++) {
        for (int k=0; k<3; k++) {
          int res;

          res = op[k](op[j](op[i](ps[0], ps[1]), ps[2]), ps[3]);
          if (res == 10) {
            printf("(((%d%c%d)%c%d)%c%d)\n", ps[0], ops[i], ps[1], ops[j], ps[2], ops[k], ps[3]);
            return;
          }

          res = op[k](op[i](ps[0], ps[1]), op[j](ps[2], ps[3]));
          if (res == 10) {
            printf("((%d%c%d)%c(%d%c%d))\n", ps[0], ops[i], ps[1], ops[k], ps[2], ops[j], ps[3]);
            return;
          }
        }
      }
    }
  } while (next_permutation(ps, ps+4));
  puts("0");
}

int main() {
  while (1) {
    for (int i=0; i<4; i++) {
      scanf("%d", &ps[i]);
    } 

    if ((ps[0] | ps[1] | ps[2] | ps[3]) == 0) return 0;
    solve();
  }
}

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

using namespace std;

int main(){
    int r,g,b;
    cin>>r>>g>>b;
    if((100*r+10*g+b)%4==0){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
    return 0;
}

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

int main() {
    int N;
    cin >> N;
    N *= 2;
    vector<int> L(N);
    for (int i = 0; i < N; i++) {
        cin >> L[i];
    }

    sort(L.begin(), L.end());
    int ans = 0;
    for (int i = 0; i < N; i += 2) {
        ans += L[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
h = Hash.new(0)
n, k = gets.split.map(&:to_i)

n.times do
  a, b = gets.split.map(&:to_i)
  h[a] += b
end

def find_kth(h, k)
  cumsum = 0
  1.upto(10**5).each do |i|
    cumsum += h[i]
    return i if cumsum >= k
  end
end

puts find_kth(h, k)

Measured memory_bytes: 5884
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC136
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int ans = 0;
            if (n <= 9) { ans = n; }
            else if (n <= 99) { ans = 9; }
            else if (n <= 999) { ans = 9 + (n - 99); }
            else if (n <= 9999) { ans = 9 + 900; }
            else if (n <= 99999) { ans = 9 + 900 + (n - 9999); }
            else { ans = 9 + 900 + 90000; }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  ll n, k;
  cin >> n >> k;
  map<ll, ll> mp;
  REP(i, n){
    ll a;
    cin >> a;
    mp[a]++;
  }
  vector<ll> v;
  for(auto p : mp) v.emplace_back(p.second);
  sort(ALL(v));
  ll m = v.size();
  ll ans = 0;
  REP(i, m-k) ans += v[i];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 14964
"""

https://atcoder.jp/contests/arc092/tasks/arc092_b

桁における1の数の偶奇だけで決まる
1+1 -> 0 (1繰り上がり)
1+0 -> 1
0+0 -> 0
なので、1の位においてはそう

2の位では？繰り上がりがある
繰り上がりも含めて、1がいくつあるかわかればいい
その桁への繰り上がりがあるかは、二分探索でわかるはず

200000*28*log

"""

from sys import stdin
import bisect

N = int(stdin.readline())
a = list(map(int,stdin.readline().split()))
b = list(map(int,stdin.readline().split()))

ans = 0

for i in range(29):

    ndig = 2**i
    now = 0

    for j in a:
        if j & ndig > 0:
            if N % 2 == 1:
                now ^= 1
    for j in b:
        if j & ndig > 0:
            if N % 2 == 1:
                now ^= 1
    
    nb = [j % ndig for j in b]
    nb.sort()
    nb.reverse()
    #print (now)
    
    for j in a:
        
        na = j % ndig
        l = -1
        r = N

        while r-l != 1:
            m = (l+r)//2
            if nb[m] + na < ndig:
                r = m
            else:
                l = m

        if r % 2 == 1:
            now ^= 1

    ans += now * ndig

print (ans)
        


Measured memory_bytes: 171084
#include<bits/stdc++.h>
using namespace std;
int A[300002],x=0;
vector<int>a;
unordered_map<int,int>mp;
void dfs(int vis[],int ch,int pa,vector<int>adj[])
{
    a.push_back(ch);
    vis[ch]=1;
    for(auto i: adj[ch])
    {
        if(i!=pa)
        {
            dfs(vis,i,ch,adj);
            vis[ch]+=vis[i];
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,q;
    cin>>n>>q;
    vector<int>adj[n+1];
    for(int i=0;i<n-1;i++)
    {
        int a,b;cin>>a>>b;
        
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    int vis[n+1]={0};
    dfs(vis,1,0,adj);
    int xx=a.size();
    
    for(int i=0;i<xx;i++)
    mp[a[i]]=i;
   
while(q--)
    {
        int a,b;
        cin>>a>>b;
        int ind=mp[a];
        int hei=vis[a];
      //  cout<<ind<<" "<<hei<<" ";
        A[ind]+=b;
      //  cout<<ind+hei<<'\n';
        A[ind+hei]-=b;
    }
    for(int i=1;i<=n;i++)
    A[i]+=A[i-1];
    for(int i=1;i<=n;i++)
    cout<<A[mp[i]]<<" ";
    
    return 0;
}

Measured memory_bytes: 39580
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N=2e4+10;
int n,h,a[N],b[N],dp[N],ans;

int main(){
    scanf("%d%d",&h,&n);
    for(int i=1;i<=n;i++)scanf("%d%d",&a[i],&b[i]);
    memset(dp,0x3f3f3f3f,sizeof(dp));
    ans=0x3f3f3f3f;
    dp[0]=0;
    for(int i=1;i<=n;i++)
        for(int j=0;j<=h+1e4;j++){
            if(j>=a[i])dp[j]=min(dp[j],dp[j-a[i]]+b[i]);
        }
    for(int i=h;i<h+1e4;i++)if(dp[i]<ans)ans=dp[i];
    cout<<ans;
}

Measured memory_bytes: 384
import sys
N = int(sys.stdin.readline())

testimonies = [[-1 for _ in range(N)] for _ in range(N)]
for i in range(N):
    A = int(sys.stdin.readline())
    for _ in range(A):
        x, y = map(int, sys.stdin.readline().rstrip().split())
        testimonies[i][x-1] = y

def check(honest_persons):
    flag = True
    for i in range(N):
        if honest_persons[i]:
            for j in range(N):
                if testimonies[i][j] == -1:
                    continue
                if testimonies[i][j] != honest_persons[j]:
                    flag = False
                    break
    return flag

def main():
    ans = 0
    for i in range(1, 2**N):
        honest_persons = bin(i)[2:].zfill(N)
        honest_persons = list(map(int, list(honest_persons)))

        if check(honest_persons):
            ans = max(ans, sum(honest_persons))

    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3064
#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 main() {
  int n;
  cin >> n;
  vector<int> p(n);
  for(int i=0;i<n;i++) cin >> p.at(i);
  int ans=0;
  for(int i=0;i<n;i++){
    if(p.at(i)!=i+1) ans++;
  }
  if(ans==0||ans==2) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}

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

const int MAX = 510000;
const int MOD = 1000000007;
const int MAX_N = 200000;

int ctoi(const char c){
 switch(c){
   case '0': return 0;
   case '1': return 1;
   case '2': return 2;
   case '3': return 3;
   case '4': return 4;
   case '5': return 5;
   case '6': return 6;
   case '7': return 7;
   case '8': return 8;
   case '9': return 9;
   default : return -1;
 }
}

long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main(int argc, const char * argv[]) {
  ll N; cin >> N ;
  vector< bitset<61> > A;

  for(ll i=0;i<N;i++){
    ll temp; cin >> temp;
    bitset<61> B(temp);
    A.push_back(B);    
  }

  ll ans = 0;
  for(ll i=0; i<61; i++){
    ll one_num = 0;
    for(ll j=0; j<N;j++){
      if(A[j][i]) one_num++;
    }
    ans = ( ans + ((one_num * (N - one_num)) % MOD ) * modpow(2,i) ) % MOD;
  }

  cout << ans % MOD << endl;

  return 0;
}


Measured memory_bytes: 6384
#!/usr/bin/env python3
import fractions
# import numpy as np
import sys


def solve(A: int, B: int):
    ans = (A * B) // fractions.gcd(A, B)
    # print(np.lcm(A, B))
    print(ans)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()


Measured memory_bytes: 5048
#include <stdio.h>
#define MAXNUM 200002

int lower = 0;
int upper = 0;
int stack[MAXNUM] = {0};
char reverse = 'T';

void push(int);

int main(void){
	int n;
	int i, j;
	int a[MAXNUM] = {0};

	scanf("%d", &n);
	scanf("%d", &a[0]);

	if(n != 1){
		for(i=1; i<n; i++){
			scanf(" %d", &a[i]);
		}

		for(i=0; i<n; i++){
			push(a[i]);
		}

		if(reverse == 'T'){
			for(i=(MAXNUM/2)+upper; i>(MAXNUM/2)-lower; i--){
				printf("%d ", stack[i]);
			}
			printf("%d", stack[i]);
		}else{
			for(i=(MAXNUM/2)-lower; i<(MAXNUM/2)+upper; i++){
				printf("%d ", stack[i]);
			}
			printf("%d", stack[i]);
		}
	}else{
		for(i=0; i<n-1; i++){
			printf("%d ", a[i]);
		}
		printf("%d", a[n-1]);
	}

	return 0;
}

void push(int num){
	if(reverse == 'T'){
		if(lower==0 && upper==0){
			stack[MAXNUM/2] = num;
		}else{
			lower++;
			stack[(MAXNUM/2)-lower] = num;
		}
		reverse = 'F';
	}else{
		upper++;
		stack[(MAXNUM/2)+upper] = num;
		reverse = 'T';
	}
}

Measured memory_bytes: 3712
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>
#include <list>

using namespace std;



int main() {
	int n, m;
	map<string, int> ab;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		ab[s]++;
	}
	cin >> m;
	for (int i = 0; i < m; i++) {
		string t;
		cin >> t;
		ab[t]--;
	}
	int maxi = -110;
	for (auto x:ab) {
		maxi = max(maxi, x.second);
	}
	if (maxi > 0)cout << maxi << endl;
	else cout << 0 << endl;
	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <algorithm>

using namespace std;


int main(){

	int id,amount,sum;

	for(int i = 0; i < 4; i++){
		scanf("%d %d",&id,&amount);

		switch(id){
		case 1:sum = 6000*amount;
		break;
		case 2:sum = 4000*amount;
		break;
		case 3:sum = 3000*amount;
		break;
		case 4:sum = 2000*amount;
		break;
		}
		printf("%d\n",sum);
	}

    return 0;
}

Measured memory_bytes: 2664
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <climits>
#include <string.h>
#include <stdio.h>
#define LL long long
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define piii pair<int, pii >
#define REP(i,n) for (int (i)=0;(i)<(n);(i)++)
#define vi vector<int>
#define vpi vector< pii >
#define INF 2147483647
#define big 20160116
#define pb push_back
#define mp make_pair
using namespace std;
const int Maxk=1005;
string mul(string a,string b){
	int res[Maxk];
	memset(res,0,sizeof(res));
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());
	for (int i=0;i<a.length();i++){
		for (int j=0;j<b.length();j++){
			res[i+j]+=(a[i]-'0')*(b[j]-'0');
		}
	}
	for (int i=0;i<Maxk;i++){
		if (res[i]>=10) {
			res[i+1]+=(res[i]/10);
			res[i]%=10;
		}
	}
	string ret;
	bool flag=false;
	for (int i=Maxk-1;i>=0;i--){
		if (flag || res[i]){
			flag=true;
			ret=ret+(char)(res[i]+'0');
		}
	}
	if (ret=="") ret="0";
	return ret;
}
string add(string a,string b){
	if (a.length()<b.length()) swap(a,b);
	while (a.length()!=b.length()){
		b='0'+b;
	}
	for (int i=a.length()-1;i>=0;i--){
		a[i]+=(b[i]-'0');
		if (a[i]>'9' && i){
			a[i]-=10;
			a[i-1]++;
		}
	}
	if (a[0]>'9'){
		a[0]-=10;
		a='1'+a;
	}
	return a;
}
// cf IO: I64d
// atcoder IO: ｌｌｄ
const int Maxn=55;
int a[Maxn];
long long C(int n,int k){
	if (k*2>n) k=n-k;
	long long ret=1;
	for (int i=1;i<=k;i++){
		ret=ret*(n-i+1);
		ret=ret/i;
	}
	return ret;
}
int main(){
	int n,p;
	scanf("%d %d",&n,&p);
	int cnt=0,c=0;
	for (int i=0;i<n;i++){
		scanf("%d",&a[i]);
		if (a[i]%2==1) cnt++;
		else c++;
	}
	long long ans=0;
	for (int i=p;i<=cnt;i+=2){
		ans+=C(cnt,i);
	}
	for (int i=0;i<c;i++) ans*=2;
	printf("%lld\n",ans);
	return 0;
} 

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

class Program
{
    static void Main(string[] args)
    {
        var str = Console.ReadLine();
        var input = str.Split(' ');
        var H = int.Parse(input[0]);
        var W = int.Parse(input[1]);
        var str2 = Console.ReadLine();
        var input2 = str2.Split(' ');
        var h = int.Parse(input2[0]);
        var w = int.Parse(input2[1]);
        
        var x = H - h;
        var y = W - w;
        Console.WriteLine(x * y);
    }
}


Measured memory_bytes: 11092
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
int n, d[300010], ct[300010], tc[300010], ans = 300010;
char buf[300010];
int main(){
    scanf("%d%s", &n, buf + 1);
    for(int i = 1;i <= n;i++){
        d[i] = buf[i] == 'W';
    }
    for(int i = 1;i <= n;i++)ct[i] = ct[i - 1] + d[i];
    for(int i = n;i >= 1;i--)tc[i] = tc[i + 1] + !d[i];
    for(int i = 1;i <= n;i++){
        ans = std::min(ans, ct[i - 1] + tc[i + 1]);
    }
    printf("%d\n", ans);
    return 0;
}

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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int a,b; cin>>a>>b;
	if (a*b%2) cout << "Yes\n" << endl;
	else cout << "No" << endl;	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;




#define P pair<ll,ll>
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define st std::string 
#define pb push_back 
#define ll long long 
#define pq(x) std::priority_queue<x> 
#define ultapq(x) priority_queue<x,vector<x>,greater<x>> cle
#define show_pq(x,n) for(ll i = 0; i < n; i++){cout<<x.top(); x.pop();} 
#define itrt(yo) for(auto x:yo){std::cout<<x<<" ";} 
#define vec(x) std::vector<x> 
#define inll(x)  ll x; cin>>x;
#define inint(x)  ll x; cin>>x;
#define nl '\n' 
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define ALL(x) x.begin(),x.end() 
#define BN(x) x.begin()
#define ED(x) x.end()
#define MAP_traverse(it,x)  for(auto it = BN(x); it!= ED(x); it++)

int main()
{
    inll(a);

    int o = a%10;
    //cout<<o;

    if (o == 2 || o == 4 ||o == 5 ||o ==7|| o ==9)
    {
        cout<<"hon";
    }else
     if (o == 0 || o == 1 ||o == 6 || o==8)
     {
         cout<<"pon";
     }else
     if (o == 3)
     {
         cout<<"bon";
     }
     
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i, n)                                                              \
    for (int64_t i = 0; i < (int64_t)(n); i++)                                 \
        ;
using namespace std;
using vi = vector<int64_t>;
using vvi = vector<vi>;
using namespace std;
int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t n, res = 0;
    string s;
    cin >> n >> s;
    for (int i = 2; i < n; i++) {
        if (s.at(i) == 'C' && s.at(i - 1) == 'B' && s.at(i - 2) == 'A') {
            res++;
        }
    }
    cout << res << endl;
}

Measured memory_bytes: 256
N_ori = int(input())
i = 1
N = N_ori
sum = 0
while True:
    N = N//10
    if i%2==1 and N >= 1:
        sum += 10**(i-1)*9
    elif i%2 == 1 and N < 1:
        sum += N_ori - 10**(i-1) + 1
    if N == 0:
        break
    i+=1
print(sum)


Measured memory_bytes: 2940
package main

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

var (
	rdr   = bufio.NewReaderSize(os.Stdin, 1000000)
	reply string
)

func main() {
	var a, b, ans int
	fmt.Scan(&a, &b)
	for tmp := 0; tmp < a; {
		tmp += b*2 + 1
		ans++
	}
	fmt.Println(ans)
}

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func nextSlice() []string {
	return strings.Split(readLine(), "")
}

func atoi(a []string) (b []int) {
	b = make([]int, len(a))
	for i := range a {
		b[i], _ = strconv.Atoi(a[i])
	}
	return
}

func atof(a []string) (b []float64) {
	b = make([]float64, len(a))
	for i := range a {
		b[i], _ = strconv.ParseFloat(a[i], 64)
	}
	return
}

func scanSlice2(n int) (a []int, b []int) {
	a = make([]int, n)
	b = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i], &b[i])
	}
	return
}

func scanFloatSlice2(n int) (a []float64, b []float64) {
	a = make([]float64, n)
	b = make([]float64, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i], &b[i])
	}
	return
}

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

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

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func min(a ...int) int {
	min := a[0]
	for i := 1; i < len(a); i++ {
		if min > a[i] {
			min = a[i]
		}
	}
	return min
}

func max(a ...int) int {
	max := a[0]
	for i := 1; i < len(a); i++ {
		if max < a[i] {
			max = a[i]
		}
	}
	return max
}

func sum(a []int) (ans int) {
	for i := range a {
		ans += a[i]
	}
	return
}

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

func yesOrNo(b bool) {
	if b {
		reply = "Yes"
		fmt.Println(reply)
		return
	}
	reply = "No"
	fmt.Println(reply)
}

func yesorNO(b bool) {
	if b {
		reply = "YES"
		fmt.Println(reply)
		return
	}
	reply = "NO"
	fmt.Println(reply)
}


Measured memory_bytes: 640
#include <iostream>
#include <stdio.h>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <cstring>
 
typedef long long ll;

#define rep(i,n) for(ll i = 0; i < n; i++)
 
using namespace std;
 
const ll INF = ll(1e18)+1;
const double PI=3.14159265358979323846;

int w,h,C[100][100], dx[8]={-1,1,0,0,-1,-1,1,1}, dy[8]={0,0,1,-1,-1,1,-1,1};
bool seen[100][100];

void dfs(int x, int y){
  seen[x][y] = true;
  rep(i,8){
    int movex = x+dx[i], movey = y+dy[i];
    if((movex<0 && w<=movex) || (movey<0 && h<=movey) || \
       seen[movex][movey] || C[movex][movey] == 0) continue;
    dfs(movex, movey);
  }
}

int main(){
  while(1){
    cin >> w >> h;
    if(!w && !h) break;
    rep(i,h) rep(j,w){
      cin >> C[i][j];
    }
    int ans = 0;
    rep(i,h) rep(j,w){
      if(seen[i][j] || C[i][j] == 0) continue;
      else{
	dfs(i,j);
	ans++;
      }
    }
    cout << ans << endl;
    memset(C, 0, sizeof(C));
    memset(seen, false, sizeof(seen));
  }
}



Measured memory_bytes: 3192
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>

#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>

#include <cmath>
#include <numeric>
#include <random>
#include <cstring>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <stack>

// type
#include <cstdint>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    int mn = INF;
    int ret = 0;
    for (int i = 0; i < N; i++) {
        if (A[i] < mn) ret++;
        mn = min(mn, A[i]);
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

/*
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
*/

/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

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



int main(){
    int  n,k;
    cin >> n >> k;
    ll r,s,p;
    cin >> r >> s >> p;
    string t ;
    cin >> t;

    rep(i,k,n){
	if(t[i-k] == t[i])t[i] = 'n'; 
    }

    ll ans = 0;
    rep(i,0,n){
	switch(t[i]){
	case 'r':
	    ans += p;
	    break;
	case 's':
	    ans += r;
	    break;
	case 'p':
	    ans += s;
	    break;
	}
    }
    P(ans);
    
    
    return  0;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int A,B;
    cin >> A >> B;
    if(A == 1)A+=13;
    if(B == 1)B+=13;
    
    string ans;
    if(A>B){
        ans = "Alice";
    }
    if(A<B){
        ans = "Bob";
    }
    if(A == B){
        ans = "Draw";
    }
    cout << ans << endl;
}


Measured memory_bytes: 3072