akhauriyash/Code-Regression huggingface dataset:
// Written By NewbieChd
#include <cstdio>
#include <cctype>
#include <algorithm>
using namespace std;

const int BUF = 1000000;
char buf[BUF], *p1, *p2;
inline char getChar() { return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, BUF, stdin), p1 == p2) ? EOF : *p1++; }
inline int read() {
    register int f = 0;
    char c;
    while (!isdigit(c = getChar())) {}
    do
        f = f * 10 + (c ^ 48);
    while (isdigit(c = getChar()));
    return f;
}

const int maxN = 200003, yyb = 1e9 + 7;
int tmpX[maxN], tmpV[maxN];
struct Node {
    int x, v;
    Node() {}
    Node(int x, int v) : x(x), v(v) {}
    friend bool operator < (const Node& x, const Node& y) { return x.x < y.x; }
}node[maxN];

int l[maxN], r[maxN], dp[maxN], sum[maxN];

int main() {
    int n = read(), i;
    for (i = 1; i <= n; ++i)
        node[i].x = tmpX[i] = read(), node[i].v = tmpV[i] = read();
    sort(tmpX + 1, tmpX + n + 1), sort(tmpV + 1, tmpV + n + 1), sort(node + 1, node + n + 1);
    for (i = 1; i <= n; ++i)
        node[i].x = lower_bound(tmpX + 1, tmpX + n + 1, node[i].x) - tmpX,
        node[i].v = lower_bound(tmpV + 1, tmpV + n + 1, node[i].v) - tmpV;
    for (i = 1; i <= n; ++i)
        r[i] = max(r[i - 1], node[i].v);
    l[n + 1] = n + 1;
    for (i = n; i; --i)
        l[i] = min(l[i + 1], node[i].v);
    dp[0] = sum[0] = 1;
    int j = 0;
    for (i = 1; i <= n; ++i) {
        while (r[j] + 1 < l[i])
            ++j;
        dp[i] = (sum[i - 1] - sum[j - 1]) % yyb, sum[i] = (sum[i - 1] + dp[i]) % yyb;
    }
    for (i = 1; i <= n; ++i)
        if (r[i] == n) {
            printf("%d\n", ((sum[n] - sum[i - 1]) % yyb + yyb) % yyb);
            break;
        }
    return 0;
}


Measured memory_bytes: 7424
//
//AtCoder Beginner Contest 174
//A
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <functional>
#include <cassert>
#include <bitset>

using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) (int)(x).size()
#define SIZEL(x) (ll)(x).size()
#define MSG(a) cout << #a << " " << a << endl;

using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;

const double PI = 3.14159265358979323846;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }            //最小公倍数

int main()
{
    int x;
    cin >> x;
    if (x>=30) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
int a[1000010];
int dp[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    dp[2] = abs(a[1]-a[2]);
    for(int i=3;i<=n;i++)
    {
        dp[i] = min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
    }
    printf("%d\n",dp[n]);
}


Measured memory_bytes: 1024
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

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

  int cnt[N + 1];
  fill(cnt, cnt + N + 1, 0);
  vector<int> ans;

  for(int i = N; i >= 1; i--){
    //cout << "cnt" << i << " " << cnt[i] << endl;
    cnt[i] %= 2;
    if(cnt[i] != a[i]){
      ans.push_back(i);
      for(int j = 1; j * j <= i; j++){
        if(i % j == 0){
          if(j != i / j){
            cnt[j]++;
            cnt[i / j]++;
          } else {
            cnt[j]++;
          }
        }
      }
    }
  }

  cout << ans.size() << endl;
  for(int i = 0; i < ans.size(); i++){
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3064
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

K = int(input())
S = str(input())
mod = 10**9+7
lens = len(S)
length = lens+K

L = 1
pow_dic = [0]*(10**6*2+1)
pow_dic[0] = 1
for i in range(1, 10**6*2+1):
    L = L*i%mod
    pow_dic[i] = L%mod
ans = 0
for rest in range(K+1):
    lenall = length-rest-1
    nlens = lens-1
    l = pow_dic[lenall]*pow(pow_dic[lenall-nlens], mod-2, mod)%mod
    r = pow_dic[nlens]
    comb = l*pow(r, mod-2, mod)%mod
    ans += pow(25, K-rest, mod)*pow(26, rest, mod)*comb%mod
    ans %= mod
print(ans%mod)

Measured memory_bytes: 101904
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static int N, M;
	static ArrayList<ArrayList<Integer>> bar = new ArrayList<ArrayList<Integer>>();
	static HashSet<State> used = new HashSet<State>();
	static int[] goal;

	public static void main(String[] args) {
		N = sc.nextInt();
		M = sc.nextInt();
		goal = new int[N];
		for (int i = 0; i < N - 1; ++i) {
			bar.add(new ArrayList<Integer>());
			goal[i + 1] = i + 1;
		}
		for (int i = 0; i < M; ++i) {
			int a = sc.nextInt() - 1;
			bar.get(a).add(i);
			int tmp = goal[a];
			goal[a] = goal[a + 1];
			goal[a + 1] = tmp;
		}
		HashSet<State> cur = new HashSet<State>();
		cur.add(new State());
		for (int i = 0;; ++i) {
			HashSet<State> next = new HashSet<State>();
			for (State s : cur) {
				if (s.goal()) {
					System.out.println(i);
					return;
				}
				s.trans(next, 0, 0);
			}
			cur = next;
		}
	}

	static class State {
		int[] count;
		int[] match;

		State() {
			count = new int[N - 1];
			match = new int[N];
			for (int i = 0; i < N; ++i) {
				match[i] = i;
			}
		}

		State(State o) {
			count = o.count.clone();
			match = o.match.clone();
		}

		public int hashCode() {
			return Arrays.hashCode(count) * 31 ^ Arrays.hashCode(match);
		}

		public boolean equals(Object o) {
			if (this == o) return true;
			if (getClass() != o.getClass()) return false;
			return Arrays.equals(count, ((State) o).count) && Arrays.equals(match, ((State) o).match);
		}

		void trans(HashSet<State> next, int use, int pos) {
			if (pos == N - 1) {
				if (use == 0) return;
				State n = new State(this);
				for (int i = 0; i < N - 1; ++i) {
					if ((use & (1 << i)) != 0) {
						n.count[i]++;
						int tmp = n.match[i];
						n.match[i] = n.match[i + 1];
						n.match[i + 1] = tmp;
					}
				}
				if (!used.contains(n)) {
					used.add(n);
					next.add(n);
				}
				return;
			}
			trans(next, use, pos + 1);
			if (canUse(use, pos)) {
				trans(next, use | (1 << pos), pos + 1);
			}
		}

		boolean canUse(int use, int pos) {
			if (count[pos] == bar.get(pos).size()) return false;
			if (pos > 0 && (use & (1 << (pos - 1))) != 0) return false;
			//			if (pos > 0) {
			//				if (count[pos - 1] < bar.get(pos - 1).size()
			//						&& bar.get(pos - 1).get(count[pos - 1]) < bar.get(pos).get(count[pos])) return false;
			//			}
			//			if (pos < N - 2) {
			//				if (count[pos + 1] < bar.get(pos + 1).size()
			//						&& bar.get(pos + 1).get(count[pos + 1]) < bar.get(pos).get(count[pos])) return false;
			//			}
			return true;
		}

		boolean goal() {
			for (int i = 0; i < N - 1; ++i) {
				if (count[i] != bar.get(i).size()) return false;
				if (match[i] != goal[i]) return false;
			}
			return true;
		}
	}

}

Measured memory_bytes: 19604
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <thread>

#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)

using namespace std;

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

	vector<int> vs(n);
	for (auto& v : vs) {
		cin >> v;
	}

	vector<int> cs(n);
	for (auto& c : cs) {
		cin >> c;
	}

	int sum = 0;
	FOR_LT(i, 0, n) {
		sum += max(0, vs[i] - cs[i]);
	}

	cout << sum << endl;



	return 0;
}

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(N: int, M: int):
    if N == M:
        print("Yes")
    else:
        print("No")
    return


# 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()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    solve(N, M)


if __name__ == "__main__":
    main()


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

int main(int argc, const char * argv[]) {
    int N;
    cin >> N;
    bool seven = false;
    do {
        int n = N % 10;
        if (n == 7) {
            seven = true;
            break;
        }
        N = N / 10;
    }while(N > 0);
    
    if (seven) {
        std::cout << "Yes\n";
    }else {
        std::cout << "No\n";
    }
    return 0;
}

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

int main(){
  string S;
  cin >> S;
  
  for (int i = 0; i < S.size(); i++){
    if (i % 2 == 0){
      if (S[i] == 'L'){
        cout << "No" << endl;
        return 0;
      }
    }
    else{
      if (S[i] == 'R'){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  
  cout << "Yes" << endl;
}


Measured memory_bytes: 3628
n = int(input())
card = list(map(int, input().split()))
card.sort(reverse=True)
a = 0
b = 0
for i in range(n):
    try:
        if i%2 == 0:
            a += card[i]
        elif i%2 == 1:
            b += card[i]
    except:
        break
print(a - b)

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

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

    int h;

    int a = n%500;
    h = 1000*(n/500);

    if (a/5>0)
    {
        h= h+5*(a/5);
        cout<<h<<endl;
    }
    else
        cout<<h<<endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  cout << fixed << setprecision(10) << 2 * n * M_PI << endl;
}


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

int main() {

    string S;
    int N;
    cin >> S;
    N = S.length();

    ll ans = 0;
    ll tmp = 0;
    ll pow_10 = 1;
    vl d(2020, -1);

    for (int i = N-1; i >= 0; i--) {
        tmp = ((int(S[i]-'0') * pow_10) + tmp) % 2019;
        pow_10 = (pow_10 * 10) % 2019;
        // cout << tmp << endl;
        d[tmp]++;
    }

    d[0]++;
    for (int i = 0; i < 2019; ++i) {
        ans += (d[i] * (d[i]+1) / 2);
    }

    // cout << "======" << endl;
    cout << ans << endl;

    return 0;
}


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

int main(){

	ios::sync_with_stdio(0);
	cin.tie(0);

	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	
	long long int a,b,c,k;
	cin>>a>>b>>c>>k;

	long long int ans = 0;

	ans = min(a,k);
	k -= a;

	if(k > 0){
		k -= b;
		if(k > 0){
			ans -= min(c,k);
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

#define sz(x) (int) x.size()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end())
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x)) 
#define y1 aksjdaskdjksjfksdjf
#define left kdnvldvoiwejifejg
#define right lkdsjflksdjfdjfk
#define prev asdasfsadjkjsdfjs
#define tm aklsjdasjdasjdkdjjf
#define lcm hddalkwjeidjjhasda
#define random_shuffle asdasdd

const int MAXN = 10500;
const int mod = (int) 1e9 + 7;

int n;
int a[MAXN];
vector <int> p[MAXN];
map <int, int> mp;
long long lcm = 1;

long long binpow(long long x, long long p) {
  long long res = 1;
  while (p) {
    if (p & 1) {
      res = (res * x) % mod;
      p--;
    } else {
      x = (x * x) % mod;
      p /= 2;
    }
  }
  return res % mod;
}

long long inv(long long x) {
  return binpow(x, mod - 2) % mod;
}

int main() { 

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

  for (int i = 0; i < n; i++) {
    int cur = a[i];
    for (int j = 2; j * j <= cur; j++) {
      if (cur % j == 0) {
        p[i].push_back(j);
        int cnt = 0;
        while (cur % j == 0) {
          cur /= j;
          cnt++;
        }
        mp[j] = max(mp[j], cnt);
      }
    }
    if (cur > 1) {
      p[i].push_back(cur);
      mp[cur] = max(mp[cur], 1);
    }
  }

  for (auto p : mp) {
    int num = p.first, cnt = p.second;
    lcm = lcm * binpow(num, cnt) % mod;
  }

  long long ans = 0;
  for (int i = 0; i < n; i++) {
    long long cur = lcm * inv(a[i]) % mod;
    ans = (ans + cur) % mod;
  }

  cout << ans << endl;

  return 0;
}


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

const int N_MAX=100, M_MAX=100;
char p[N_MAX+1][M_MAX+1];

int main(){
	int n,a,b;
	cin >> n >> a >> b;
	int ans;
	ans = min(a*n,b);
	cout << ans << endl;

	return 0;
}




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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 5005;

struct data
{
	int h, p;
};

int n, mx;
struct data a[N];
int cache[N][N];

bool comp(struct data &d1, struct data &d2)
{
	return d1.h + d1.p < d2.h + d2.p;
}

int dp(int i, int taken) //should store minP sum
{
	if(i == 0)
	{
		if(taken == 0)
			return 0;
		return 1e14;
	}
	int &ans = cache[i][taken];
	if(ans != -1)
		return ans;
	ans = dp(i - 1, taken);
	int curSum = dp(i - 1, taken - 1);
	if(a[i].h >= curSum)
		ans = min(ans, dp(i - 1, taken - 1) + a[i].p);
	//cerr << i << " " << taken << " " << ans << endl;
	return ans;
}

int32_t main()
{
	IOS;
	memset(cache, -1, sizeof(cache));
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i].h >> a[i].p;
	sort(a + 1, a + n + 1, comp);
	for(int i = n; i >= 1; i--)
	{
		if(dp(n, i) < 1e14)
		{
			cout << i;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 199660
#include<bits/stdc++.h>
using namespace std;
int n,a[1010],ans=0;
int main()
{
	cin>>n;
	n*=2;
	for(int i=1;i<=n;++i)
		cin>>a[i];
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i+=2)
		ans+=a[i];
	cout<<ans<<endl;
	return 0;
 }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,t;
    cin>>s>>t;
    int ans=1000;

    for(int i=0;i<=(s.size()-t.size());i++)
    {
        int cnt=0;

        for(int j=0;j<t.size();j++)
        {
            if(s[i+j]!=t[j])
            {
                cnt++;
            }
        }

        if(ans>cnt)
            ans=cnt;
    }

    cout<<ans<<endl;
    return 0;
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  int K, S; cin >> K >> S;
  int cnt = 0;
  for(int i = 0; i <= K; ++i) {
    for(int k = 0; k <= K; ++k) {
      if(0 <= S - i - k && S - i - k <= K) cnt++;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main (){
  int N ;
  cin  >> N;
  
  int A = N / 100;
  int B = (N - A*100)/10;
  if (N / 100 == 7)
    cout << "Yes" << endl;
  else if ((N - A*100)/10 == 7)
    cout << "Yes" << endl;
  else if (N - A*100 - B*10 == 7)
    cout << "Yes" << endl;
  else 
    cout << "No" << endl;
}

Measured memory_bytes: 3504
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
using namespace std;

int main(){
    string S;
    cin>>S;
    int N=S.size(),n0=0,n1,ans;
    for(int i=0;i<N;++i)
        if(S[i]=='0')++n0;
    n1=N-n0;
    ans=2*min(n0,n1);
    cout<<ans<<endl;
    return 0;
}

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

public class Main {

	static boolean[] dp;
	static int[] choiceArray;

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int choiceCount = scan.nextInt();
		int pileCount = scan.nextInt();
		scan.nextLine();

		choiceArray = Arrays.stream(scan.nextLine().split(" "))
				.mapToInt(Integer::parseInt)
				.toArray();

		dp = new boolean[pileCount + 1];

		for (int i = 0; i < pileCount + 1; i++) {

			for (int choice : choiceArray) {

				if (i >= choice) {

					if (dp[i - choice] == false) {
						dp[i] = true;
						break;
					}
				}
			}
		}

		println(dp[pileCount] ? "First" : "Second");
	}

	public static void println(Object target) {
		System.out.println(target);
	}
}


Measured memory_bytes: 28884
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
 
#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
 
using namespace std;
 
typedef long long int lli;
 
template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
 
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}
 
int main() {
    int N;
    cin >> N;
    vector<lli> A(N);
    int check = 0;
    REP(i, 0, N) {
        cin >> A[i];
        if (i != 0 && A[i - 1] + 1 < A[i]) {
            check = 1;
        }
        if (i == 0 && A[i] != 0) {
            check = 1;
        }
    }
    if (check) {
        cout << -1 << endl;
        return 0;
    }
    lli ans = 0;
    lli cnt = 0;
    REP(i, 0, N) {
        if (A[i] == 0) {
            cnt = 0;
        } else {
            if (A[i] == cnt + 1) {
                ans++;
                cnt++;
            } else {
                ans += A[i];
                cnt = A[i];
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

int group[20] = {};
signed main()
{
    group[4] = 1;
    group[6] = 1;
    group[9] = 1;
    group[11] = 1;
    group[2] = 2;
    int x, y;
    cin >> x >> y;
    if(group[x] == group[y]) { printf("Yes\n"); }
    else { printf("No\n"); }

    return 0;
}


Measured memory_bytes: 256
a=list(input())
b=list(input())

L=[0]*(len(a)*2)

def AA(p):
      for i in range(p):
          L[i*2]=a[i]
          L[i*2+1]=b[i]

if len(a)==len(b):
  AA(len(a))
else:
  AA(len(a)-1)
  L[-2]=a[-1]
  del L[-1]
 
print("".join(L))

Measured memory_bytes: 3064
N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]

Dic = {}
for s in S:
    Dic[s] = Dic.get(s,0) + 1
for t in T:
    Dic[t] = Dic.get(t,0) - 1
             
print(max(max(Dic.values()),0))


Measured memory_bytes: 3060
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 2000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define seg_size 524288
int cnt_black[3000][3000] = {};
int yoko_black[3000][3000] = {};
int tate_black[3000][3000] = {};
int grid[3000][3000] = {};
int main() {
	int n, m, query;
	cin >> n >> m >> query;
	REP(i, n) {
		string s;
		cin >> s;
		for (int q = 0;q < s.length();++q) {
			if (s[q] == '1') {
				grid[i + 1][q + 1] = 1;
			}
		}
	}
	for (int i = 1;i <= n;++i) {
		for (int q = 1;q <= m;++q) {
			cnt_black[i][q] = cnt_black[i][q - 1] + grid[i][q];
			yoko_black[i][q] = yoko_black[i][q - 1];
			tate_black[i][q] = tate_black[i][q - 1];
			if (grid[i][q] == 1 && grid[i][q-1] == 1) {
				yoko_black[i][q]++;
			}
			if (grid[i][q] == 1 && grid[i - 1][q] == 1) {
				tate_black[i][q]++;
			}
		}
	}
	for (int i = 1;i <= m;++i) {
		for (int q = 1;q <= n;++q) {
			yoko_black[q][i] += yoko_black[q - 1][i];
			tate_black[q][i] += tate_black[q - 1][i];
			cnt_black[q][i] += cnt_black[q - 1][i];
		}
	}
	REP(i, query) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		int ans = cnt_black[c][d] - cnt_black[a - 1][d] - cnt_black[c][b - 1] + cnt_black[a - 1][b - 1];
		ans -= yoko_black[c][d] - yoko_black[a-1][d] - yoko_black[c][b] + yoko_black[a-1][b];
		ans -= tate_black[c][d] - tate_black[a][d] - tate_black[c][b-1] + tate_black[a][b-1];
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 100096
#include <iostream>
#include <string>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
ll s1, s2, c1, c2;
int main() {
	ll n, a;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a;
		s1 += a;
		s2 += a;
		if (i % 2) {
			if (s1 <= 0) c1 += 1 - s1,s1 = 1;
			if (s2 >= 0) c2 += 1 + s2,s2 = -1;
		}
		else {
			if (s1 >= 0) c1 += 1 + s1,s1 = -1;
			if (s2 <= 0) c2 += 1 - s2,s2 = 1;
		}
	}
	cout << min(c1, c2) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

const long long mod = pow(10, 9) + 7;

int main() {
	long long N,ans=pow(10,18),x=0,y=0; cin >> N;
	vector<long long> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i]; x += A[i];
	}
	for (int i = 0; i < N; i++) {
		ans = min(abs(x - y), ans);
		x -= A[i]; y += A[i];
	}
	cout << ans << endl;
}





Measured memory_bytes: 1792
import bisect
N=int(input())
A=sorted(list(map(int,input().split())))
num=A[-1]
if N>=3:
    i=bisect.bisect_left(A,num/2)
    num2=A[i-1] if num/2-A[i-1] <= A[i] - num/2 else A[i]
    print(num,num2)
else:
    print(A[-1],A[0])


Measured memory_bytes: 62704
input = input().split(' ')
N = int(input[0])
L = int(input[1])

tasts = [L + i -1 for i in range(1, N+1)]
abs_tasts = [abs(t) for t in tasts]
print(sum(tasts) - tasts[abs_tasts.index(min(abs_tasts))])

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

using ll = long long;

using namespace std;

int main() {
    int d, t, s;
    cin >> d >> t >>s;
    cout << (t * s >= d ? "Yes" : "No") << '\n';
    return 0;
}

Measured memory_bytes: 3620
n,d=map(int,input().split())
li=[list(map(int, input().split())) for _ in range(n)]
res=0
for i in range(n):
    x1=li[i][0]
    y1=li[i][1]
    len=x1**2+y1**2
    naga=len**(1/2)
    if naga<=d:res+=1
print(res)

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

int main() {
	int n;
	cin >> n;
	
	cout << (n + 1) / 2 << endl;
	
}

Measured memory_bytes: 3644
#include<stdio.h>

int main(void){
  	int a;
  	char text[1000];
	scanf("%d",&a);
  	scanf("%s",&text);
  
  	if(a>=3200){
    	printf("%s\n",text);
    }else{
    	printf("red\n");
    }
  
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int b[] = new int[6];
        int count = 0;

        for (int i = 0; i < 6; i++) {
            b[i] = scan.nextInt();
        }

        if( (b[1]-b[0]> b[5]) || (b[2]-b[0] > b[5]) || (b[3]-b[0] > b[5]) || (b[4]-b[0] > b[5]) ){
            count = 1;
        }

        if( (b[2]-b[1] > b[5]) || (b[3]-b[1] > b[5]) || (b[4]-b[1] > b[5]) ){
            count = 1;
        }

        if( (b[3]-b[2] > b[5]) || (b[4]-b[2] > b[5]) ){
            count = 1;
        }

        if( (b[4]-b[3] > b[5]) ){
            count = 1;
        }

        if(count == 0){            
            System.out.println("Yay!");
        }
        else{
            System.out.println(":(");
        }
    }
}

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

int main() {
	string s;cin >>s;
	int win =8;
	int rday =15;
	int day =0;
	while(s.size()> day){
		auto f = s.substr(day,1);
		if(f=="o"){
			--win;
		}
		--rday;
		++day;
	}
	string ans;
	if(rday>=win){
		ans = "YES";
	} else {
		ans = "NO";	
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define REPI(i,a,b) for (ll i=(a);i<(b);i++)
#define REP(i,n) REPI(i,0,n)

typedef long long int ll;

int SURP = 1000000007;

int main(){
	int N;
	cin >> N;
	ll a[N];
	REP(i,N) cin >> a[i];

	ll out = 0;

	REP(i,N){
		out += a[i] -1;
	}

	cout << out << endl;

	return 0;
}


Measured memory_bytes: 256
// Practice AtCoder
//author: Leonardone @ NEETSDKASU

// 解説読後

fn main() {
	let mut stdin = String::new();
    std::io::Read::read_to_string(
    	&mut std::io::stdin(),
        &mut stdin).unwrap();
    let mut stdin = stdin.split_whitespace();
    let mut get = || stdin.next().unwrap();
    macro_rules! get {
    	($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }
    
    let n =  get!(usize);
    
    let mut f = vec![0; n+1];
    for j in 2..n+1 {
    	let mut t = j;
        for i in 2..j+1 {
	    	while t % i == 0 {
    	    	f[i] += 1;
        	    t /= i;
        	}
		}
    }
    let mut ans = 0;
    for i in 0..f.len() {
    	if f[i] >= 74 {
        	ans += 1;
        }
    	for j in 0..f.len() {
        	if i == j {
            	continue;
            }
            if f[i]>=14&&f[j]>=4 {
            	ans += 1;
            }
            if f[i]>=24&&f[j]>=2 {
            	ans += 1;
            }
        	for k in j+1..f.len() {
            	if i == k {
                	continue;
                }
            	if f[i]>=2&&f[j]>=4&&f[k]>=4 {
                	ans += 1;
                }
            }
        }
    }
    // println!("{:?}", f);
    println!("{}", ans);
}

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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
 
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
 
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
 
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};


void solve(long long N){
    for(int i=111; i<=999; i+=111){
        if(N<=i) {
            cout << i << endl;
            break;
        }
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

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

int d[110][110];

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

  int n, m;
  cin >> n >> m;

  rep(i, n){
    rep(j, n){
      d[i][j] = 1e8;
    }
  }

  rep(i, n){
    d[i][i] = 0;
  }

  vector<int> a(m), b(m), c(m);
  rep(i, m){
    cin >> a[i] >> b[i] >> c[i];
    a[i]--;
    b[i]--;
    d[a[i]][b[i]] = c[i];
    d[b[i]][a[i]] = c[i];
  }

  rep(k, n){
    rep(i, n){
      rep(j, n){
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }

  int ans = 0;
  rep(i, m){

    bool ok = true;
    rep(j, n){
      if(d[a[i]][j] + d[j][b[i]] < c[i]){
        ok = false;
      }
    }
    if(!ok){
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#include <queue>
#include <cstring>
#include <cmath>
using namespace std;
#define MAXA 1001
#define MAXB 1001
#define MAXH 1000000001
#define MAXW 301
#define INF (1LL << 50)
#define MAXN 300003
#define MAXM 100001
#define MAXK 100002
#define MAXP 1000001
#define MOD 1000000007
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;


ll N;
ll a[MAXN];

int main(){
    cin >> N;
    for(ll i = 0;i < 3 * N;i++){
        cin >> a[i];
    }

    priority_queue<ll> qb;
    priority_queue<ll, vector<ll>, greater<ll>> qf;
    ll sumf[MAXN], sumb[MAXN];


    for(ll i = 0;i < N;i++){
        qf.push(a[i]);
        sumf[0] += a[i];
        qb.push(a[3 * N - i - 1]);
        sumb[N] += a[3 * N - i - 1];
    }

    for(ll i = 0;i < N;i++){
        sumf[i + 1] = sumf[i] + a[i + N];
        qf.push(a[i + N]);
        sumf[i + 1] -= qf.top();
        qf.pop();
    }

    for(ll i = N - 1;i >= 0;i--){
        sumb[i] = sumb[i + 1] + a[i + N];
        qb.push(a[i + N]);
        sumb[i] -= qb.top();
        qb.pop();
    }

    ll ans = -INF;
    for(ll i = 0;i <= N;i++){
        ans = max(ans, sumf[i] - sumb[i]);
    }

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

Measured memory_bytes: 8940
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    
    String s = sc.nextLine();
    String t = sc.nextLine();

    char[] schar = s.toCharArray();
    char[] tchar = t.toCharArray();

    int[] diff = new int[s.length() - t.length() + 1];

    for(int i=0; i<schar.length - tchar.length + 1; i++){
      for(int j=0; j<tchar.length; j++){
        if(schar[i + j] != tchar[j]){
          diff[i]++;
        }
      }
    }

    int min = 10000;
    for(int i=0; i<diff.length; i++){
      if(min > diff[i]){
        min = diff[i];
      }
    }

    System.out.println(min);

    return;

  }
}



Measured memory_bytes: 35760
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[200020];
int main() {
    long long n;
    cin >> n;
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
        cin >> a[i];
    }
    long long sum = 0, x = 0;
    long long right = 0;
    for (long long left = 0; left < n; left++) {
        while (right < n && (sum + a[right]) == (x ^ a[right])) {
            sum += a[right];
            x ^= a[right];
            right++;
        }
        ans += (right - left);
        if (left == right)right++;
        else { 
            sum -= a[left]; 
            x ^= a[left];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 5172
#include <iostream>
#include <stdio.h>

#include <vector>

using namespace std;

int main()
{
    int r, c, x ;
    cin >> r >> c;

    vector<vector<int> > a(r, vector<int>(c));

    for (int i = 0; i < r; i++) {
        for (int j = 0; j < c; j++) {
            cin >> x;
            a[i][j] = x;
        }
    }

    vector<vector<int> > aa(r+1, vector<int>(c+1));

    for (int i = 0; i < r+1;i++) {
        if (i != r) {
            for (int j = 0; j < c + 1; j++) {
                if (j != c) {
                    aa[i][j] = a[i][j];
                }
                else if (j == c) {
                    aa[i][c] = 0;
                    for (int j = 0; j < c; j++) {
                        aa[i][c] = aa[i][c] + a[i][j];
                    }
                }
            }
        }
        else if (i == r) {
            for (int k = 0; k< c + 1;k++) {
                aa[r][k] = 0;
                for (int h = 0; h < r; h++) {
                    aa[r][k] = aa[r][k] + aa[h][k];
                }
            }
        }
    }

    for (int i = 0; i < r+1; i++) {

        for (int j = 0; j < c + 1;j++) {
                cout << aa[i][j];
                if (j != c) {
                    cout <<" ";
                }
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 3160
N,T = map(int,input().split())
AB = [tuple(map(int,input().split())) for i in range(N)]

dp0 = {0:0}
dp1 = {0:0}

for i,(a,b) in enumerate(AB):
    _dp0 = {0:0}
    _dp1 = {0:0}
    for k0,v0 in dp0.items():
        if k0 in _dp0:
            _dp0[k0] = max(_dp0[k0], v0)
        else:
            _dp0[k0] = v0
        if k0+a < T:
            if k0+a in _dp0:
                _dp0[k0+a] = max(_dp0[k0+a], v0+b)
            else:
                _dp0[k0+a] = v0+b
        if k0 in _dp1:
            _dp1[k0] = max(_dp1[k0], v0+b)
        else:
            _dp1[k0] = v0+b
    for k1,v1 in dp1.items():
        if k1 in _dp1:
            _dp1[k1] = max(_dp1[k1], v1)
        else:
            _dp1[k1] = v1
        if k1+a < T:
            if k1+a in _dp1:
                _dp1[k1+a] = max(_dp1[k1+a], v1+b)
            else:
                _dp1[k1+a] = v1+b
    dp0 = _dp0
    dp1 = _dp1

print(max(dp1.values()))

Measured memory_bytes: 121560
"""
15,8,5の場合：
何回右に移動するか、何回左に移動するか。
dp[i][j] => i回目下降が終わった時点で、j列目にいる場合の数
memo[j] => 特定の高さを見たときに、j列目とj+1列目の間に横棒があるような横棒配置パターン数
memo2[j] => j列目の左右に横棒がないような場合の数
"""
mod = 10**9 +7
H,W,K = map(int,input().split())
if W == 1:
    print(1)
    exit()
memo = [0]*(W-1)
memo2 = [0]*(W-1)
cnt = 0
for i in range(2**(W-1)):
    binI = format(i,"0"+str(W-1)+"b")
    #パターンの有効性をチェックする
    for j in range(W-2):
        if binI[j] == "1" and binI[j+1] == "1":
            break
    else:
        cnt += 1
        for j in range(W-1):
            if binI[j] == "1":
                memo[j] += 1
        for j in range(1,W-1):
            if binI[j-1]=="0" and binI[j] =="0":
                memo2[j] += 1
dp = [[0]*W for _ in range(H+1)]
dp[0][0] = 1

for i in range(H):
    for j in range(W):
        #右の列に移動する
        if j != W-1:
            dp[i+1][j+1] += memo[j]*dp[i][j]%mod
            dp[i+1][j+1] %= mod
        #左の列に移動する
        if j != 0:
            dp[i+1][j-1] += memo[j-1]*dp[i][j]%mod
            dp[i+1][j-1] %= mod
        #真下に移動する
        if j == 0:
            dp[i+1][j] += (cnt-memo[j])*dp[i][j]%mod
        elif j == W-1:
            dp[i+1][j] += (cnt-memo[j-1])*dp[i][j]%mod
        else:
            dp[i+1][j] += memo2[j]*dp[i][j]%mod
        dp[i+1][j]%=mod

print(dp[-1][K-1])

Measured memory_bytes: 63604
a,b,c,x,y=map(int,input().split())
if a+b<=2*c:print(a*x+b*y)
else:
  if x<y:print(x*2*c+(y-x)*min(b,2*c))
  else:print(y*2*c+(x-y)*min(a,2*c))

Measured memory_bytes: 3060
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力(スペース改行関係なし)
		String s = sc.next();

		if(s.contains("RRR")){
			// 出力
			System.out.println(3);
		}else if(s.contains("RR")){
			System.out.println(2);
		}else if(s.contains("R")){
			System.out.println(1);
		}else{
        	System.out.println(0);
        }
		
	}
}

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

int main() {
  int H, W;
  cin >> H >> W;
  
  vector<vector<int>> data(H, vector<int>(W));
  
  //Generate table
  for (int i=0; i < H; i++){
    for (int j=0; j < W; j++){
      char x;
      cin >> x;
      if (x == '.'){
        data.at(i).at(j) = 1;
      }
      else if (x == '#'){
        data.at(i).at(j) = 0;
      }
    }
  }
  
  //Find empty row/column (1=empty, 0=occupied)
  vector<int> emp_r(H);
  vector<int> emp_c(W);

  for (int i=0; i < H; i++) emp_r.at(i) = 1;
  for (int j=0; j < W; j++) emp_c.at(j) = 1;
  
  for (int i=0; i < H; i++){
    for (int j=0; j < W; j++){
      emp_r.at(i) *= data.at(i).at(j);
      emp_c.at(j) *= data.at(i).at(j);
    }
  }  

  /*check
  for (int i=0; i < H; i++) cout << emp_r.at(i);
  cout << endl;
  for (int j=0; j < W; j++) cout << emp_c.at(j);
  cout << endl;
  */

  for (int i=0; i < H; i++){
    for (int j=0; j < W; j++){
      bool B = !emp_r.at(i) * !emp_c.at(j);
      if (B) {
        if (data.at(i).at(j)){
          cout << ".";
        }
        else {
          cout << "#";
        }
      }
    }
    if (!emp_r.at(i)) cout << endl;
  }  
  
}


Measured memory_bytes: 256
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

h,a = m()

print(-(-h//a))







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

int main() {
  int N,a,b,c=0;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>a;
    b=0;
    while(a%2==0){
      a/=2,
      b++;
    }
    if (i==0)
      c=b;
    c=min(b,c);
  }
  cout<<c<<endl;
}

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

int main(void){
	bool card[4][13];
	for(int i = 0;i < 4;i++){
		for(int j = 0;j < 13;j++){
			card[i][j] = false;
		}
	}
	
	int n;
	cin >> n;
	for(int i = 0;i < n;i++){
		char ch;
		int c;
		cin >> ch >> c;
		if(ch == 'S'){
			card[0][c-1] = true;
		}else if(ch == 'H'){
			card[1][c-1] = true;
		}else if(ch == 'C'){
			card[2][c-1] = true;
		}else if(ch == 'D'){
			card[3][c-1] = true;
		}
	}
	
	for(int i = 0;i < 4;i++){
		for(int j = 0;j < 13;j++){
			if(card[i][j] == false){
				if(i == 0){
					cout << "S " << j+1 << endl; 
				}else if(i == 1){
					cout << "H " << j+1 << endl;
				}else if(i == 2){
					cout << "C " << j+1 << endl;
				}else if(i == 3){
					cout << "D " << j+1 << endl;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 1160
h,w=map(int,input().split())
a=[]
s=0
for i in range(h):
    p=[int(j) for j in input().split()]
    a.append(p)
    s+=sum(p)
ans=[]
if s%2==0:
    if a[0][0]%2==1:
        if w!=1:
            ans.append([1,1,1,2])
            a[0][1]+=1
        elif h!=1:
            ans.append([1,1,2,1])
            a[1][0]+=1
else:
    if a[0][0]%2==0:
        if w!=1:
            ans.append([1,1,1,2])
            a[0][1]+=1
        elif h!=1:
            ans.append([1,1,2,1])
            a[1][0]+=1

for i in range(h):
    for j in range(w):
        if i==0 and j==0:
            continue
        if j==w-1:
            if i!=h-1:
                if a[i][j]%2==1:
                    ans.append([i+1,j+1,i+2,j+1])
                    a[i+1][j]+=1
        else:
            if a[i][j]%2==1:
                ans.append([i+1,j+1,i+1,j+2])
                a[i][j+1]+=1

print(len(ans))
for a,b,c,d in ans:
    print(a,b,c,d)






Measured memory_bytes: 71132
#include<bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;
using ll = long long;

ll find(ll x, vector<ll> &par){
    if(par.at(x)==x){
        return x;
    }else{
        return par.at(x)=find(par.at(x), par);
    }
}

int main(){
    ll N,M;
    cin >> N >> M;
    vector<ll> A(M),B(M);

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

    vector<ll> par(N), rank(N), size(N);
    for(ll i=0; i<N; i++){
        par.at(i)=i;
        rank.at(i)=0;
      	size.at(i)=1;
    }
    ll ans=N-1;
    for(ll i=0; i<M; i++){
        ll x=find(A.at(i)-1,par);
        ll y=find(B.at(i)-1,par);
        if(x!=y){
        ans--;
        if(rank.at(x)<rank.at(y)){
            par.at(x)=par.at(y);
            size.at(x)+=size.at(y);
      	    size.at(y)=size.at(x);
        }else{
            par.at(y)=par.at(x);
            if(rank.at(x)==rank.at(y)) rank.at(x)++;
            size.at(x)+=size.at(y);
      	    size.at(y)=size.at(x);
        }
        }
    }
    
    cout << ans;
    return 0;
}

Measured memory_bytes: 7220
#define rep(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
template<class T> inline void chmax(T &a, const T &b) {if(a < b) a = b;}
template<class T> inline void chmin(T &a, const T &b) {if(a > b) a = b;}
const long long INF = 1LL<<60;


int main(void) {
   ll N,M;
   cin>>N>>M;
   string S;
   cin>>S;
   vector<ll> vP;
   rep(i,0,N+1) {
      if (S[i]=='0') vP.push_back(i);
   }
   if (find(vP.begin(),vP.end(),0) == vP.end() || find(vP.begin(),vP.end(),N) == vP.end()) {
      cout<<-1<<endl;
      return 0;
   }

   int i = N;
   vector<ll> ans;
   while(1) {
      if (i==0) break;
      auto itr = lower_bound(vP.begin(),vP.end(),i-M);
      if (i==*itr) break;
      // cout<<i- *itr<<endl;
      ans.push_back(i- *itr);
      i = *itr;
   }

   if (i!=0) {
      cout<<-1<<endl;
      return 0;
   } else {
      auto itr = ans.end();
      while(1) {
         itr--;
         cout<<*itr<<" ";
         if (itr == ans.begin()) break;
      }
      cout<<endl;
   }


   return 0;
}

Measured memory_bytes: 2676
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

int main() {
    set<string> s;
    int n;  cin >> n;

    for (int i = 0; i < n; i++) {
        string t;
        cin >> t;
        s.insert(t);
    }

    cout << s.size() << endl;
    return 0;
}

Measured memory_bytes: 19228
import java.util.Scanner

import scala.util.Sorting

object Main {
  def solve(): Unit = {
    val sc = new Scanner(System.in)
    val H = sc.nextInt()
    val W = sc.nextInt()
    val D = sc.nextInt()
    val N = H * W
    val A = Array.ofDim[(Int, Int)](N + 1)
    
    for {
      h <- 1 to H
      w <- 1 to W
    } {
      val x = sc.nextInt()
      A(x) = (h, w)
    }

    def move(s: (Int, Int), t: (Int, Int)) = math.abs(s._1 - t._1) + math.abs(s._2 - t._2)

    // (1 to D-1) から xまでのコスト
    val cost = Array.ofDim[Int](N + 1)
    (1 to D) foreach { d =>  // 最初の地点dから
      (0 until (N / D) + (if(d <= N % D) 1 else 0)) foreach { j =>  // j回移動する
        if (j == 0) cost(d) = 0
        else {
          val next = d + D * j
          val prev = d + D * (j - 1)
          cost(next) = cost(prev) + move(A(prev), A(next))
        }
      }
    }

    val Q = sc.nextInt()
    (0 until Q) foreach { _ =>
      val L = sc.nextInt()
      val R = sc.nextInt()
      println(cost(R) - cost(L))
    }
  }

  def main(args: Array[String]): Unit = {
    solve()
  }
}


Measured memory_bytes: 108684
#include <cstdio>
 
char c[15][15],d[15],e[15];
int i,m,n;
 
inline bool dfs2(int x)
{
	if (x>m)
		return true;
	if (e[x])
		return dfs2(x+1);
	else
	{
		int t=0,r=0;
		for (int i=x;i<=m;i++)
			if (! e[i])
				t++;
		for (int i=x;i<=m;i++)
			if (! e[i])
			{
				e[x]=i,e[i]=x,r=1;
				for (int j=1;j<=n;j++)
					if ((c[j][x]!=c[d[j]][i]) || (c[d[j]][x]!=c[j][i]))
					{
						r=0;
						break;
					}
				if(i==x){
					if(r&&(t&1)&&dfs2(x+1))return true;
				}
				else{
					if(r){
						if(dfs2(x+1))return true;else return false;
					}
				}
				/*if ((r) && ((t&1) || (i!=x)) && (dfs2(x+1)))
					return true;
				else if(i!=x)return false;*/
				e[x]=0,e[i]=0;
			}
	}
	return false;
}
 
inline bool dfs1(int x)
{
	if (x>n)
		return dfs2(1);
	if (d[x])
		return dfs1(x+1);
	else
	{
		int t=0;
		for (int i=x;i<=n;i++)
			if (! d[i])
				t++;
		for (int i=x;i<=n;i++)
			if (! d[i])
			{
				d[x]=i,d[i]=x;
				if (((t&1) || (i!=x)) && (dfs1(x+1)))
					return true;
				d[x]=0,d[i]=0;
			}
	}
	return false;
}

int main()
{
	scanf("%d%d",&n,&m);
	for (i=1;i<=n;i++)
		scanf("%s",c[i]+1);
	if (dfs1(1))
		puts("YES");
	else
		puts("NO");
	return 0;
}

Measured memory_bytes: 256
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
ans = 0
for _ in range(n):
  a, b = rs()
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a)*380000
print(ans)
  
    










Measured memory_bytes: 26960
#include<stdio.h>
int main(void){
	int N, T, A, H[1000], i, j,min_i;
	double	K[1000],min;
	scanf("%d", &N);
	scanf("%d %d", &T, &A);
	for (i = 0; i < N; i++){
		scanf("%d", &H[i]);
	}
	for (i = 0; i < N; i++){
		K[i] = (double)T - H[i] * 0.006;
		K[i] = K[i] - (double)A;
		if (K[i] < 0){
			K[i] = K[i] * -1.0;
		}
	}
	min = K[0];
	min_i = 0;
	for (i = 1; i < N; i++){
		if (min>K[i]){
			min = K[i];
			min_i = i;
		}
	}
	printf("%d", min_i+1);

		return 0;
}

Measured memory_bytes: 128