akhauriyash/Code-Regression huggingface dataset:
#define ll long long
#define dd long double
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define mt make_tuple
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
//#include<bits/stdc++.h>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<utility>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<bitset>
#include<sstream>
dd pi = acos(-1) ;
ll z =  1000000007 ;
ll inf = 100000000000000000 ;
ll p1 = 37 ;
ll p2 = 53 ;
ll mod1 =  202976689 ;
ll mod2 =  203034253 ;
ll fact[100] ;
ll gdp(ll a , ll b){return (a - (a%b)) ;}
ll ld(ll a , ll b){if(a < 0) return -1*gdp(abs(a) , b) ; if(a%b == 0) return a ; return (a + (b - a%b)) ;} // least number >=a divisible by b
ll gd(ll a , ll b){if(a < 0) return(-1 * ld(abs(a) , b)) ;    return (a - (a%b)) ;} // greatest number <= a divisible by b
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
ll e_gcd(ll a , ll b , ll &x , ll &y){ if(b > a) return e_gcd(b , a , y , x) ; if(b == 0){x = 1 ; y = 0 ; return a ;}
ll x1 , y1 ; e_gcd(b , a%b , x1 , y1) ; x = y1 ; y = (x1 - ((a/b) * y1)) ; return e_gcd(b , a%b , x1 , y1) ;}
ll power(ll a ,ll b , ll p){if(b == 0) return 1 ; ll c = power(a , b/2 , p) ; if(b%2 == 0) return ((c*c)%p) ; else return ((((c*c)%p)*a)%p) ;}
ll inverse(ll a ,ll n){return power(a , n-2 , n) ;}
ll max(ll a , ll b){if(a > b) return a ; return b ;}
ll min(ll a , ll b){if(a < b) return a ; return b ;}
ll left(ll i){return ((2*i)+1) ;}
ll right(ll i){return ((2*i) + 2) ;}
ll ncr(ll n , ll r){if(n < r|| (n < 0) || (r < 0)) return 0 ; return ((((fact[n] * inverse(fact[r] , z)) % z) * inverse(fact[n-r] , z)) % z);}
void swap(ll&a , ll&b){ll c = a ; a = b ; b = c ; return ;}
//ios_base::sync_with_stdio(0);
//cin.tie(0); cout.tie(0);
using namespace std ;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
//__builtin_popcount(n) -> returns number of set bits in n
// ll seed;
//mt19937 rnd(seed=chrono::steady_clock::now().time_since_epoch().count()); // include bits
#define tll tuple<ll , ll ,ll , ll>
#define pll pair<ll ,ll>

void solve()
{
    string a , b ;
    cin >> a >> b ;
    ll ans = 0 ;
    fo(i , a.size())
    {
        if(a[i] != b[i])
            ans++ ;
    }
    cout << ans << endl ;
    return ;
}

int main()
{
    /*ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("inputf.txt" , "r" , stdin) ;
    freopen("outputf.txt" , "w" , stdout) ;
    freopen("error.txt" , "w" , stderr) ;
    #endif*/
    
    ll t ;
    //cin >> t ;
    t = 1 ;
   
    while(t--)
    {
        solve() ;
        
    }
    //cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
 
    return 0;
}

Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
#define ld long double
#define ll long long
#define pb push_back
#define F first
#define S second
const int mod = 1e9 + 7, A = 2e3 + 2;
string s;
ll dp[102][4][2][2], n, k;
ll solve(int ind, int rem, bool f, bool tiny)
{
    if (ind == n) return !tiny && !rem;
    if (~dp[ind][rem][f][tiny])
        return dp[ind][rem][f][tiny];

    ll ret = 0;
    if (ind) ret += solve(ind + 1, rem, (s[ind] - '0' == 0 ? f : 1), tiny) + (!rem);
    if (rem)
    {
        for (int i = 1; i <= 9; i++)
        {
            if (f || i < s[ind] - '0')
                ret += solve(ind + 1, rem - 1, 1, tiny);
            else if (i == s[ind] - '0')
                ret += solve(ind + 1, rem - 1, 0, tiny);
            else
                ret += solve(ind + 1, rem - 1, 0, 1);
        }
    }
    return dp[ind][rem][f][tiny] = ret;
}
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin >> s >> k;
    n = s.size();
    memset(dp, -1, sizeof dp);
    cout << solve(0, k, 0 ,0);
    return 0;
}

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

using namespace std;

int main() {
  	int n = 0;
  	int m = 0;
	cin >> n >> m;
  
  	int a = 0;
  	vector<int>ai;
  
  	while(cin >> a) {
  		ai.push_back(a);
    }
  	int total = 0;
  	for (auto& a_i : ai) {
        total += a_i;
    }
  
  	if (total <= n) {
    	cout << n - total << endl;
    }
  	else {
    	cout << -1 << endl;;
    }
}

Measured memory_bytes: 3700
import math

N,M=map(int,input().split())
if abs(N-M)>=2:
    print(0)
elif abs(N-M)==1:
    print((math.factorial(N)*math.factorial(M))%(10**9+7))
else:
    print((math.factorial(N)*math.factorial(M)*2)%(10**9+7))

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

#define ull unsigned long long int
#define ll long long int
#define pb push_back
#define MOD (ull)(double)(1e9 + 7)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pull pair<ull, ull>
#define m_p make_pair

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n,k;
	cin >> n >> k;
	
	int h[n];
	for(int i=0;i<n;i++){
		cin >> h[i];
	}
	
	if(k >= n)cout << "0";
	else{
		sort(h, h+n);
		ll sum=0;
		for(int i=0;i<n-k;i++){
			sum += h[i];
		}
		
		cout << sum;
	}
}


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

int main() {

	int x, n;
	cin >> x >> n;

	if (n == 0) {
		cout << x;
		return 0;
	}

	vector<int> p(n);
	vector<int> p2(n);
	for (int i = 0; i < n; i++) {
		cin >> p[i];
	}
	
	int count, ans;



	for (int i = 0;;i++) {
		count = 0;

		for (int j = 0; j < n; j++) {
			if (x - i != p[j]) count++;
		}
		if (count == n) {
			ans = x - i;
			break;
		}

		count = 0;
		for (int j = 0; j < n; j++) {
			if (x + i != p[j]) count++;
		}
		if (count == n) {
			ans = x + i;
			break;
		}
	}
	
	cout << ans;
	return 0;
}

Measured memory_bytes: 3192
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
 
#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef pair<int, int> pi;

const int INF = 1e9 + 10;

int main() {
  int n, k;
  cin >> n >> k;
  vi h(n);
  rep(i, n) cin >> h[i];

  int dp[k+1][n];
  rep(i, k+1) rep(j, n) dp[i][j] = -1;
  dp[0][0] = 0;
  // init
  for(int i=1;i<n;i++) {
    int mn = INF;
    for (int j=1;j<=k;j++){
      if (i < j) break;
      dp[j][i] = dp[0][i-j] + abs(h[i] - h[i-j]);
      mn = min(mn, dp[j][i]);
    }
    dp[0][i] = mn;
    // printf("d[%d]: ", i);
    // rep(j, k+1) cout << dp[j][i] << " ";
    // cout << endl;
  }
  cout << dp[0][n-1] << endl;
  return 0;
}

Measured memory_bytes: 40064
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;

using f64 = double;
using i64 = long long;
using pii = pair<int, int>;

const int K = 2048;

int n, k;

int sw[K][K], sb[K][K];

static int at(int mx[K][K], int x, int y) {
	return x < 0 || y < 0 ? 0 : mx[x][y]; }

static int sum(int mx[K][K], int ulx, int uly, int lrx, int lry) {
	if (lrx < 0 || lry < 0) return 0;
	lrx = min(lrx, 2 * k - 1);
	lry = min(lry, 2 * k - 1);
	--ulx, --uly;
	if (ulx >= lrx)	return 0;
	if (uly >= lry)	return 0;
	return at(mx, lrx, lry) - at(mx, lrx, uly) - at(mx, ulx, lry) + at(mx, ulx, uly); }	

int main() {
#ifdef HOME
	freopen("atc.in", "r", stdin);
	freopen("atc.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	int ant(0), w(0), b(0), x, y, u, v, cnt;
	char col;

	cin >> n >> k;
	for (int i = 0; i < n; ++i) {
		cin >> x >> y >> col;
		x%= 2 * k;
		y%= 2 * k;
		w+= int(col == 'W');
		b+= int(col == 'B');
		(col == 'W' ? sw : sb)[x][y]+= 1; }

	for (int i = 0; i <= 2 * k; ++i)
	for (int j = 0; j <= 2 * k; ++j) {
		sw[i][j]+= at(sw, i - 1, j) + at(sw, i, j - 1) - at(sw, i - 1, j - 1);
		sb[i][j]+= at(sb, i - 1, j) + at(sb, i, j - 1) - at(sb, i - 1, j - 1); }

	for (int i = 0; i < k; ++i)
	for (int j = 0; j < k; ++j) {
		u = 0, v = b;

		u+= sum(sw, i, j, i + k - 1, j + k - 1);  
		u+= sum(sw, 0, 0, i - 1, j - 1);
		u+= sum(sw, i + k, j + k, 2 * k, 2 * k);
		u+= sum(sw, 0, j + k, i - 1, 2 * k);
		u+= sum(sw, i + k, 0, 2 * k, j - 1);

		v-= sum(sb, i, j, i + k - 1, j + k - 1);
		v-= sum(sb, 0, 0, i - 1, j - 1);
		v-= sum(sb, i + k, j + k, 2 * k, 2 * k);
		v-= sum(sb, 0, j + k, i - 1, 2 * k);
		v-= sum(sb, i + k, 0, 2 * k, j - 1);

		ant = max(ant, u + v); }

	for (int i = 0; i <= k; ++i)
	for (int j = 0; j <= k; ++j) {
		u = w, v = 0;

		u-= sum(sw, i, j, i + k - 1, j + k - 1);  
		u-= sum(sw, 0, 0, i - 1, j - 1);
		u-= sum(sw, i + k, j + k, 2 * k, 2 * k);
		u-= sum(sw, 0, j + k, i - 1, 2 * k);
		u-= sum(sw, i + k, 0, 2 * k, j - 1);

		v+= sum(sb, i, j, i + k - 1, j + k - 1);
		v+= sum(sb, 0, 0, i - 1, j - 1);
		v+= sum(sb, i + k, j + k, 2 * k, 2 * k);
		v+= sum(sb, 0, j + k, i - 1, 2 * k);
		v+= sum(sb, i + k, 0, 2 * k, j - 1);

		ant = max(ant, u + v); }


	cout << ant << endl;

	return 0; }


Measured memory_bytes: 33024
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;	

int main() {
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	
	REP(i, k) {
		if (a >= b) {
			b *= 2;
		}
		else if (b >= c) {
			c *= 2;
		}
	}
	if (a < b && b < c) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 3640
N,K,Q=map(int,input().split())
# A=[int(input()) for _ in range(Q)]
point=[0]*N
for i in range(Q):
    point[int(input())-1]+=1
for i in range(N):
    ans=K-(Q-point[i])
    if ans>0:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 4680
#include <iostream>
#include <string>

using namespace std;

int main(void)
{
	string str;
	string::size_type index;
	int num;
	int number;
	int i,j;

	cin >> num;
	getline(cin,str);//ツ催渉可づ個づ「ツづつつセツつッツ禿づ敖債楪づ慊つケ
	for(i=0;i<num;i++)
	{
		getline(cin,str);
		number = 0;
		while((index = str.find("Hoshino") ) != string::npos)
		{
			str.replace(index,7,"Hoshina");
		}
		cout << str << endl;
	}
	return 0;
}

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            int[] A = new int[N + 1];
            int[] B = new int[N];
            for (int i = 0; i < N + 1; i++) {
                A[i] = in.nextInt();
            }
            for (int i = 0; i < N; i++) {
                B[i] = in.nextInt();
            }

            long count = 0;
            for (int i = 0; i < N; i++) {
                if (A[i] <= B[i]) {
                    count += A[i];
                    B[i] -= A[i];
                    if (A[i + 1] <= B[i]) {
                        count += A[i + 1];
                        A[i + 1] = 0;
                    } else {
                        count += B[i];
                        A[i + 1] -= B[i];
                    }
                } else {
                    count += B[i];
                }
            }
            out.println(count);
        }

    }
}



Measured memory_bytes: 64112
#include	<cstdint>
#include	<iostream>
#include	<fstream>
#include	<cmath>

typedef		std::uint_least16_t		USI;
typedef		std::int_least16_t		SSI;
typedef		std::uint_least32_t		ULI;		//10^9
typedef		std::int_least32_t		SLI;
typedef		std::uint_least64_t		ULLI;
typedef		std::int_least64_t		SLLI;

using namespace std;

ULI		cnt;
int		A[1'000'000];
int		G[100];
int		m;

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

void shellSort(int A[], int n)
{
	cnt = 0;
	m = 0;
	int		nn = n;

	while ((nn / 2) != 0)
	{
		G[m] = nn / 2;
		m++;
		nn /= 2;
	}

	if (m == 0)
	{
		m = 1;
		G[0] = 1;
	}

	for (int i = 0; i < m; i++)
	{
		insertionSort(A, n, G[i]);
	}
}

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

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

	shellSort(A, n);

	cout << m << "\n";
	for (int i = 0; i < m; i++)
	{
		if (i != 0)		cout << " ";
		cout << G[i];
	}
	cout << "\n";

	cout << cnt << "\n";

	for (int i = 0; i < n; i++)
	{
		cout << A[i] << "\n";
	}

	return 0;
}

Measured memory_bytes: 7000
#include <bits/stdc++.h>  // g++ -std=c++14 -o a a.cpp

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end()) // ユニークなvectorにする。連続した値を除去して切り出す。
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int A, B;
  cin >> A >> B;

  if (A == B) {
    cout << "Draw" << endl;
    return 0;
  }

  if (A == 1) {
    A = 14;
  } 

  if (B == 1) {
    B = 14;
  }

  if (A > B) {
    cout << "Alice" << endl;
    return 0;
  } else {
    cout << "Bob" << endl;
    return 0;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
int sdist[100000];
int fdist[100000];
vector<int> graph[100000];
main(){
    int N,A,B;
    cin >> N;
    for(int i = 0;i < N-1;i++){
        cin >> A >> B;
        A--;B--;
        graph[A].push_back(B);
        graph[B].push_back(A);
    }
    fill(sdist,sdist+100000,INF);
    fill(fdist,fdist+100000,INF);
    queue<int> qa,qb;
    qa.push(0);
    sdist[0] = 1;
    while(!qa.empty()){
        int num = qa.front();
        qa.pop();
        for(auto v:graph[num]){
            if(sdist[v]!=INF || v==N-1)continue;
            sdist[v] = sdist[num]+1;
            qa.push(v);
        }
    }
    qb.push(N-1);
    fdist[N-1] = 1;
    while(!qb.empty()){
        int num = qb.front();
        qb.pop();
        for(auto v:graph[num]){
            if(fdist[v]!=INF || v==0)continue;
            fdist[v] = fdist[num]+1;
            qb.push(v);
        }
    }
    int cnt = 0;
    for(int i = 0;i < N;i++){
//        cout << sdist[i] << " " << fdist[i] << endl;
        if(sdist[i] <= fdist[i])cnt++;
    }
    if(cnt > N-cnt)cout << "Fennec" << endl;
    else cout << "Snuke" << endl;
}

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

namespace ConsoleApp1
{
    static class DGatheringChildren
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var sList = s.ToCharArray();

            var answer = new List<int>(new int[sList.Count()]);
            int countR = 0;
            int countL = 0;
            int indexR = 0;
            int indexL = 0;

            for (int i = 0; i < sList.Count(); i++)
            {
                if (sList[i] == 'R')
                {
                    if (0 < countL)
                    {
                        answer[indexR] = (countR + 1) / 2 + countL / 2;
                        answer[indexR + 1] = countR / 2 + (countL + 1) / 2;
                        countR = countL = 0;
                    }
                    indexR = i;
                    countR++;
                    continue;
                }

                if (sList[i] == 'L')
                {
                    indexL = i;
                    countL++;
                    continue;
                }
            }

            answer[indexR] = (countR + 1) / 2 + countL / 2;
            answer[indexR + 1] = countR / 2 + (countL + 1) / 2;

            Console.WriteLine(string.Join(" ", answer));
            Console.ReadLine();
        }
    }
}



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

int main(){
  int a,b,c,d,e,k;
  cin>>a>>b>>c>>d>>e>>k;
  if(e-a<=k){
    cout<<"Yay!"<<endl;
  }
  else{
    cout<<":("<<endl;
  }
}

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

int main(){//偶奇が一致なら#, そうでないなら.
    while (1){
        int a, b;
        cin >> a >> b;
        if (a == 0 && b == 0) break;
        else{ 
            for (int i= 0; i<a; i++){
                for (int j=0; j<b; j++){
                    if ((i + j)%2 == 1)  cout << '.';
                    else cout << '#';
                }
            cout << endl;
            }
          cout << endl;
        }
    }
}


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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);  
	int n;
	cin >> n;
	map<long long, int, greater<int>> mp;
	for(int i = 0; i < n; i++) {
		int a;
		cin >> a;
		mp[a]++;
	}
	for(auto i = mp.begin(); i != mp.end(); i++) {
		i->second /= 2;
	}
	set<long long> st;
	for(auto i : mp) {
		if(i.second >= 2 && st.empty()) {
			cout << i.first * i.first << endl;
			return 0;
		}
		else if(i.second >= 1) {
			st.insert(i.first);
		}
		if(st.size() == 2) {
			break;
		}
	}
	if(st.size() < 2) {
		cout << 0 << endl;
		return 0;
	}
	long long ans = 1;
	for(auto i : st) {
		ans *= i;
	}
	cout << ans << endl;
	return 0;	
}


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

#define ll long long
#define f(i,s,e) for(int i=s;i<e;i++)
#define rf(i,s,e) for(int i=e;i>=s;i--)
#define fr first
#define sc second
#define pb push_back
#define  vii vector<int>
#define vll vector<ll>
#define vpii vector<pair<int ,int >>
#define vpll vector<pair<ll, ll> >
#define  pii pair<int,int>
const long mod =998244353;
const int N = 2e3+5;
const long long inf= 1e18;

ll gcd(ll a ,ll b){if(b==0) return a;return gcd(b,a%b);}
ll mul(ll a ,ll b){return (a%mod * b%mod )%mod;}
ll mpower(ll a, ll b){if(b==0) return 1;ll temp=mpower(a,b/2);if(b%2==0){return mul(temp,temp);}else{	return mul(mul(temp,temp) , a);}}
ll inv(ll a){return mpower(a,mod-2);}
ll ncr(ll n, ll r){if(r==0)return 1;ll ans=n%mod;ans=mul(ans,ncr(n-1,r-1));ans=mul(ans,inv(r));	return ans;}
ll power(ll a, ll b){if(b==0) return 1;ll temp=power(a,b/2);if(b%2==0)return temp*temp;else return temp*temp*a;}


void solve()
{
    set<string> mp;
    int n;cin>>n;
    while(n--)
    {
        string str;cin>>str;
        mp.insert(str);
    }
    cout<<mp.size()<<endl;
} 

int main()
{
	ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    while(t--)
    {
        solve();
    }
}

Measured memory_bytes: 19288
s=int(input())

nums=[s]

i=1

while True:
    if nums[i-1]%2==0:
        nums.append(int(nums[i-1]/2))

    else:
        nums.append(int(nums[i-1]*3+1))

    if nums.count(nums[i])==2:
        #print(nums)
        print(i+1)
        exit()

    i+=1


Measured memory_bytes: 2940
import java.util.Scanner;
import java.util.ArrayList;
class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			double lv = scan.nextDouble();
			int n = 1;
			while(true){
				double v = 0;
				v = 1.4*Math.sqrt((double)50*(n-1));
				if(lv <= v){
					System.out.println(n);
					break;
				}
				n++;
			}
		}
	}
}

Measured memory_bytes: 12000
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <functional>

#define MAX_N (1000)
#define MAX_M (1000)
#define NUM_MOD (1000000007L)

using namespace std;

int main(int argc, char *argv[]) {
  // read inputs
  long N, M, as[MAX_N], bs[MAX_M];
  scanf("%ld %ld", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%ld", &as[i]);
  }
  for (int j = 0; j < M; j++) {
    scanf("%ld", &bs[j]);
  }

  // sort as and bs
  sort(as, as + N);
  sort(bs, bs + M);

  // impossible if there are duplicates in as, bs
  for (int i = 1; i < N; i++) {
    if (as[i] == as[i - 1]) {
      printf("0\n");
      return 0;
    }
  }
  for (int j = 1; j < M; j++) {
    if (bs[j] == bs[j - 1]) {
      printf("0\n");
      return 0;
    }
  }

  // fill from the larger numbers
  long ans = 1;
  for (long num = N * M; num > 0; num--) {
    const long num_placed = N * M - num,
               i_min = lower_bound(as, as + N, num) - as,
               j_min = lower_bound(bs, bs + M, num) - bs,
               a = as[i_min], b = bs[j_min];
    if (num == a && num == b) {
      ans *= 1;
    } else if (num == a) {
      ans = ans * (M - j_min) % NUM_MOD;
    } else if (num == b) {
      ans = ans * (N - i_min) % NUM_MOD;
    } else {
      if ((N - i_min) * (M - j_min) <= num_placed) {
        printf("0\n");
        return 0;
      }
      ans = ans * ((N - i_min) * (M - j_min) - num_placed) % NUM_MOD;
    }
    // printf("num = %d, i_min = %ld, j_min = %ld, ans = %ld\n", num, i_min, j_min,
    //        ans);
  }
  printf("%ld\n", ans);

  return 0;
}


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

signed main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	string s, t;
	cin >> s >> t;
	int ans = 0;
	for (int i = 0; i < 3; i++)if (s[i] == t[i])ans++;
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;

int main() {
  int64_t N; cin>>N;
  vector<int64_t> S(N);
  rep(i,N){
    cin>>S.at(i);
    if(i>0) S.at(i)+=S.at(i-1);
  }
  sort(S.begin(),S.end());
  S.push_back(-1*INF);
  int64_t count=1,ans=0,cz=0;
  for(int i=1;i<(int)S.size();i++){
    if(S.at(i)==0) continue;
    else if(S.at(i)==S.at(i-1)){
      count++;
    }
    else{
      ans+=count*(count-1)/2;
      count=1;
    }
  }
  rep(i,N) if(S.at(i)==0) cz++;
  cout<<ans+cz*(cz+1)/2<<endl;
}


Measured memory_bytes: 6392
n = int(input())
a = list(map(int,input().split()))
a.sort()
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
divs = list(set(make_divisors(a[0])+make_divisors(a[1]))) #list

divsTF = [0]*len(divs)
for i in range(len(divs)):
    j = [1 if a[_] % divs[i] else 0 for _ in range(n) ]

    if sum(j) <= 1:
        divsTF[i] = 1

ans = 1
for i in range(len(divs)):
    if divsTF[i] == 1:
        ans = max(ans,divs[i])
print(ans)

Measured memory_bytes: 14488
#include <stdio.h>

#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = (n) - 1; i >= 0; i--)
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)
#define STRS(i,str) for(int i = 0; (str)[i]; i++)
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAXI(a,b) if(a < (b)) a = (b)
#define MINI(a,b) if(a > (b)) a = (b)

int main(){
	int n;
	int a[120];
	int count = 0;
	scanf("%d", &n);
	REP(i, n) scanf("%d", a + i);
	bool flag = 1;
	while(flag){
		flag = 0;
		RFOR(i, n, 1)
			if(a[i] < a[i - 1]){
				int tmp = a[i - 1];
				a[i - 1] = a[i];
				a[i] = tmp;
				count++;
				flag = 1;
			}
	}
	REP(i, n - 1) printf("%d ", a[i]);
	printf("%d\n%d\n", a[n - 1], count);
}

Measured memory_bytes: 2696
import math

a,b,h,m = map(int,input().split())

ar = (h + m/60)/12 * 360
br = m/60 * 360

cc = (a**2 + b**2) - 2*a*b*math.cos(math.radians(abs(ar-br)))

ans = math.sqrt(cc)


print(ans)

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

using namespace std;

long long int X, Y;

int main(int argc, char* argv[]) {
  cin >> X >> Y;

  int res = 1;
  while (Y / 2 >= X) {
    Y /= 2;
    res++;
  }
  cout << res << endl;

  return 0;
}

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

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

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main () {
  string S;
  cin >> S;
  
  bool flag = true; 
  for (int i = 0; i < S.size(); i++) {
    if((i % 2 == 0 && S[i] == 'L') || (i % 2 == 1 && S[i] == 'R')) {
      flag = false;
      break;
    }
  }
  
  cout << (flag ? "Yes" : "No");
  
  return 0;
}

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


using namespace std;
int main()
{
	int N, M, tmp = 1, ans = 1;

	cin >> N >> M;
	if (N == 1) {
		printf("%d", M);
		return 0;
	}
	//else if (N == M) {
	//	printf("1");
	//}
	else {
		for (int i = 1; i < sqrt(M); i++) {
			if (M % i == 0) {
				if ((double)M / N >= i) {
					tmp = i;
				}
				if ((double)M / N >= M / i && M / i > ans) {
					ans = M / i;
				}
			}
		}
		if (tmp > ans) {
			printf("%d", tmp);
		}
		else {
			printf("%d", ans);
		}
	}
	return 0;

}

Measured memory_bytes: 256
import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

T RD(T = string)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto T = RD!long;
	auto X = RD!long;

	writeln(cast(double)T / X);
	stdout.flush();
}

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

int a[]={1868,1912,1926,1989};
char b[]={'M','T','S','H'};
  
int main(){
  int E,Y;
  cin>>E>>Y;
  if(E==0){
    int i=upper_bound(a,a+4,Y)-a-1;
    cout<<b[i]<<Y-a[i]+1<<endl;
  }else{
    cout<<a[E-1]+Y-1<<endl;
  }
  return 0;
}

Measured memory_bytes: 3100
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');
		long a = long.Parse(input[0]);
		long p = long.Parse(input[1]);
		p += a*3;
		Console.WriteLine(p/2);
	}
}

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

using namespace std;

int main(void) {
  int n;
  while (cin >> n, n != -1) {
    if (!n) {
      cout << "0\n";
      continue;
    }
    
    string ans = "";
    while (n) {
      ans = (char)((n % 4) + '0') + ans;
      n /= 4;
    }
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 3152
#include <cstdio>
#include <algorithm>
#include <cstring>

using namespace std;

int main()
{

	int Test=1; while (Test--){
    int N, A; scanf("%d%d", &N, &A);
    puts(A >= N % 500 ? "Yes" : "No");
	}

	return 0;
}

Measured memory_bytes: 128
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;

class Solution {
public:
    vector<int> solve(string& s) {
        int n = s.length();

        vector<int> res(n, 0);

        for (int i = 0; i < n; ++i) {
            int l = i;
            while (i + 1 < n && s[i + 1] == s[i]) {
                ++i;
            }
            int m = i;
            ++i;
            while (i + 1 < n && s[i + 1] == s[i]) {
                ++i;
            }
            int r = i;

            for (int j = l; j <= m; ++j) {
                if ((m - j) % 2 == 0) {
                    res[m] += 1;
                } else {
                    res[m + 1] += 1;
                }
            }
            for (int j = r; j > m; --j) {
                if ((j - (m + 1)) % 2 == 0) {
                    res[m + 1] += 1;
                } else {
                    res[m] += 1;
                }
            }
        }
        return res;
    }
};

int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
 
    string s;
    cin >> s;
    Solution sol;
    auto res = sol.solve(s);
    int n = res.size();
    for (int i = 0; i < n; ++i) {
        cout << res[i] << (i == n - 1 ? '\n' : ' ');
    }

    return 0;
}

Measured memory_bytes: 1104
N, X, Y = map(int, input().split(' '))
X = X - 1
Y = Y - 1
cnt = [0] * N

for i in range(N):
    for j in range(N):
        if (j <= i): continue
        temp = j - i
        temp = min(temp, abs(i - X) + 1 + abs(j - Y))
        cnt[temp] = cnt[temp] + 1

for i in range(N):
    if i > 0:
        print(cnt[i])

Measured memory_bytes: 46684
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

D,N=get_i
if N==100
    puts 100**(D+1)+100**D
else
  puts 100**D*N
end

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

typedef long long ll;

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

    ll res = 0;
    for (ll i = 0; i <= min(k, n); i++) {
        for (ll j = 0; i+j <= min(k, n); j++) {
            vector<ll> b;
            ll cur = 0;
            for (ll s = 0; s < i; s++) {
                b.push_back(a[s]), cur += a[s];
            }
            for (ll t = 0; t < j; t++) {
                b.push_back(a[n-1-t]), cur += a[n-1-t];
            }
            sort(b.begin(), b.end());
            for (ll s = 0; s < min(k-i-j, (ll)b.size()); s++)
                if (b[s] < 0)
                cur -= b[s];
                res = max(res, cur);
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> vec(N);
  bool even = true;
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
    if(vec.at(i) %2 != 0){
      even = false;
    }
  }
  //相手に渡す時に1のみだと負けてしまう
  //相手に渡す時にリンゴが一種類で、奇数個だと負けてしまう
  //できるだけ偶数個ある状態で渡したい
  //全部偶数個に合わせる→相手が少なくとも1個とる。
  //偶数個に合わせる、を繰り返せば負けない。
  if(even){
    cout << "second" << endl;
  }
  else{
    cout << "first" << endl;
  }
  
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <chrono> 
 
using namespace std;
using namespace std::chrono; 
 
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define f0r(a, b) for (long long a = 0; a < (b); ++a)
#define f1r(a, b, c) for (long long a = (b); a < (c); ++a)
#define f0rd(a, b) for (long long a = (b); a >= 0; --a)
#define f1rd(a, b, c) for (long long a = (b); a >= (c); --a)
#define ms(arr, v) memset(arr, v, sizeof(arr))
#define pb push_back
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define fix(prec) {cout << setprecision(prec) << fixed;}
#define mp make_pair
#define f first
#define s second
#define presum(p, a, n) {p[0] = a[0]; for (int i = 1; i < (n); i++) p[i] = a[i] + p[i-1];}
#define all(v) v.begin(), v.end()
#define getunique(v) {sort(all(v)); v.erase(unique(all(v)), v.end());}
#define readgraph(list, edges) for (int i = 0; i < edges; i++) {int a, b; cin >> a >> b; a--; b--; list[a].pb(b); list[b].pb(a);}
#define ai(a, n) for (int ele = 0; ele < n; ele++) cin >> a[ele];
#define ain(a, lb, rb) for (int ele = lb; ele <= rb; ele++) cin >> a[ele];
#define ao(a, n) {for (int ele = 0; ele < (n); ele++) { if (ele) cout << " "; cout << a[ele]; } cout << '\n';}
#define aout(a, lb, rb) {for (int ele = (lb); ele <= (rb); ele++) { if (ele > (lb)) cout << " "; cout << a[ele]; } cout << '\n';}
typedef long long ll;
typedef double ld;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
 
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
  cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
 
// mt19937 rng(steady_clock::now().time_since_epoch().count());
mt19937 rng(61378913);
/* usage - just do rng() */
 
void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
 
const lld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;
 


ll n, m, k, q, l, r, x, y, z;
ll a[1000005];
ll b[1000005];
ll c[1000005];
string s, t;
ll ans = 0;



void solve(int tc) {
  cin >> n;
  cout << (n + 1) / 2;
}
 
int main() {
  send help
 
  // usaco("file");


  int tc = 1;
  // cin >> tc;
  for (int t = 0; t < tc; t++) solve(t);
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#define rep(i,n) for(int i = 0; i < n;++i)
using namespace std;
 
int main(){
	int a,b,c;
	cin >> a >> b >> c;
 
	if(b-a == c- b)
		cout << "YES"<<endl;
	else
		cout << "NO" <<endl;
 
	return 0;
}


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

using namespace std;




int main(void)
{
    int A,B,ans;
    char op;

    cin>>A>>op>>B;
    
    switch (op)
    {
    case '+'/* constant-expression */:
        /* code */
        ans=A+B;
        break;
    
    default:
    ans=A-B;
        break;
    }


    cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 3636
import sys

a, b, c = map(int,input().split())

if (a == 5 or a == 7):
  if (b == 5 or b == 7):
    if (c == 5 or c == 7):
      d = a * b * c
      if (d == 175):
        print("YES")
      else: print("NO")
    else: print("NO")
  else: print("NO")
else:
  print("NO")

Measured memory_bytes: 2940
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define fi first
#define se second
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = 1; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(), (x).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T> >

using namespace std;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;

const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

long long modpow(long long a, long long n, long long mod=1000000007) {
    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 n;
    cin >> n;
    vector<ll> c(n);
    rep(i,n) cin >> c[i];
    sort(all(c));
    ll ans = 0;
    rep(i,n) {
        ll cnt = modpow(2,n-1);
        cnt = cnt + (modpow(2,n-2) * (n-1-i) % mod);
        cnt %= mod;
        ans += (cnt * c[i] % mod);
        ans %= mod;
    }
    ans = ans * modpow(2,n) % mod;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>

int compare_int(const void *a,const void *b){
  return *(long*)a-*(long*)b;
}

int main(void){
  int N,K;
  int ans = 0;
  scanf("%d%d",&N,&K);
  int l[N];

  for(int i = 0;i < N;i++) scanf("%d",&l[i]);
  qsort(l,N,sizeof(int),compare_int);

  for(int i = N-1;i >= N-K;i--){
    ans += l[i];
  }

  printf("%d\n",ans);
  return 0;
}

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

using namespace std;

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'

int main()
{
	int n,a[100005];
	map<int,int>m;
	cin >>n;
	
	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
		m.insert({a[i],i});
	}
	vector<int>v;
	for(auto it : m)
	{
		v.push_back(it.second);
	} 
	
	for(int i = 0; i < n-1; i++)
	{
		cout << v[i] <<" ";
	}
	cout << v[n-1] << endl;
	return 0;
}

Measured memory_bytes: 6392
a = input()
ok = True
if len(a) % 2 == 0:
    for i in range(0, len(a)//2 + 1, 2):
        if a[i:i + 2] != "hi":
            ok = False
            break
else:
    ok = False


if ok:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 38384
/****************************************************************
# @Author:      iLovePKU_zbtxdy
# @DateTime:    2020-01-29 21:30:34
# @Description: You build it. You run it
# @More: Once lots of AC, try Brute-force,dynamic programming
****************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define close std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define eps 1e-8
#define int long long 
typedef long long ll;
const int maxn = 1e6+10;
const int INF = 0x3f3f3f3f;
const ll linf = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
ll mod = 1e9+7;
//状压dp
ll ans , dp[45][1 << 18];
int32_t main()
{
    int n  ,x , y , z;
    cin >> n >> x >> y >> z;
    int ans = 1, S , nw;
    for(int i = 1; i <= n; i++){
        ans = ans * 10 % mod;
    }
    nw = (1 << (x-1)) | (1 << x+y-1) | (1 << (x+y+z-1));
    S = (1 << x+y+z) - 1;
    dp[0][0] = 1;
    for(int i = 1; i <= n; i++){
        for(int j = 0; j <= S; j++){
            for(int k = 1; k <= 10; k++){
                int T = (j << k) | (1 << k-1);
                T &= S;
                if((T & nw) != nw){
                    dp[i][T] = (dp[i][T] + dp[i-1][j]) % mod;
                }
            }
        }
    }
    for(int i = 0; i <= S; i++){
        ans = (ans +mod - dp[n][i]) % mod;
    }cout << ans << endl;
    system("pause");
}
/***************************************************************************
*stuff you should look for
*int overflow, array bounds
*special cases (n=1?), set tle
*do smth instead of nothing and stay organized
***************************************************************************/

Measured memory_bytes: 82424
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>

using std::cin;
using std::cout;
using std::cerr;
using std::endl;

using std::map;
using std::set;
using std::bitset;
using std::vector;
using std::string;
using std::multimap;
using std::multiset;
using std::deque;
using std::queue;
using std::stack;
using std::pair;
using std::iterator;

using std::sort;
using std::stable_sort;
using std::reverse;
using std::max_element;
using std::min_element;
using std::unique;
using std::ios_base;
using std::swap;
using std::min;
using std::max;
using std::fill;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef string S;

namespace MySpace{

};

#define F(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define fi first
#define se second
#define re return
#define all(x) (x).begin(), (x).end()
#define int long long

const long long MOD = 1e9 + 7;
ll n, m;
ll a[500000];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> m >> n;
    for (int i = 1; i <= n; i++)
    {
        int d1 = i % 10;
        int d2 = i / 10;
        if (d1 >= 2 && d2 >= 2 && d1 * d2 <= m && 1 <= d1 * d2) a[0]++;
    }
    cout << a[0];
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <list>
#include <bitset>
#include <vector>
using namespace std;

#define I64d_OJ

//#ifdef I64d_OJ
//#define LL __int64
//#endif // I64d_OJ
#ifdef I64d_OJ
#define LL long long
#endif // I64d_OJ

typedef unsigned LL ULL;
typedef unsigned uint;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;
typedef vector<int> vi;

inline int read(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-f; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}

#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define ls rt<<1
#define rs rt<<1|1
#define MID(a,b) (((LL)(a)+(LL)(b))>>1)
#define absx(a) ((a)<0?-(a):(a))
#define MK(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define lowbit(x) ((x)&-(x))

#define lc c[x][0]
#define rc c[x][1]

template< typename T >
inline void Max(T &a,T &b){if(a<b) a=b;}
template< typename T>
inline void Min(T &a,T &b){if(a>b) a=b;}

const double pi=(double)acos(-1.0);
const double eps=(double)1e-8;
const int INF = (int) 0x3f3f3f3f;
const int MOD = (int) 1e9+7;
const int MAXN =(int) 1e5+10;
const int MAXM = (int) 3e6+10;

///--------------------START-------------------------
int N,K;

LL power(LL x,LL y){
    LL ret=1;
    for(;y;y>>=1,x=x*x%MOD)if(y&1){
        ret=ret*x%MOD;
    }
    return ret;
}

void work(){
    scanf("%d%d",&N,&K);
    LL ans=0;
    if(K>=N){
        ans=1;
        for(int i=1;i<=N-1;i++) ans=ans*(2*N-i)%MOD;
        for(int i=1;i<=N-1;i++) ans=ans*power(i,MOD-2)%MOD;
        printf("%lld\n",ans);
    }
    else{
        LL tmpans=1;
//        printf("N = %d, K = %d\n",N,K);
        ans+=tmpans;
//        printf("tmpans = %lld\n",tmpans);
        for(int i=1;i<=K;i++){
            tmpans=tmpans*power(i,MOD-2)%MOD;
            tmpans=tmpans*power(i,MOD-2)%MOD;
            tmpans=tmpans*(N-i+1)%MOD;
            tmpans=tmpans*(N-i)%MOD;
            ans+=tmpans;
//            printf("i = %d , tmpans = %lld\n",i,tmpans);
        }
        printf("%lld\n",ans%MOD);
    }
}

///--------------------END-------------------------
int main(){
#ifdef NNever
//freopen("data.in","r",stdin);
///freopen("out.txt","w",stdout);
#endif // NNever
    work();
    return 0;
}





Measured memory_bytes: 256
#include<cstdio>

using namespace std;

long long isqrt(long long x) {
    long long min = 0;
    long long max = 1LL << 31;
    long long mid = (max+min)/2;
    long long sqr = mid * mid;
    long long sqr2 = (mid+1) * (mid+1);
    while(x < sqr || sqr2 <= x) {
        if(x < sqr) max = mid;
        if(sqr2 <= x) min = mid;
        mid = (max+min)/2;
        sqr = mid * mid;
        sqr2 = (mid+1) * (mid+1);
    }
    return mid;
}

int main() {
    int Q;
    scanf("%d", &Q);
    for(int x = 0; x < Q; ++x) {
        long long A, B;
        scanf("%lld%lld", &A, &B);
        if(A == B) {
            printf("%lld\n", (A-1)*2);
        }
        else {
            long long sqr = isqrt(A * B);
            if(sqr * sqr == A * B) {
                printf("%lld\n", sqr*2-3);
            }
            else if(sqr * (sqr+1) >= A * B) {
                printf("%lld\n", sqr*2-2);
            }
            else {
                printf("%lld\n", sqr*2-1);
            }
        }
    }
    return 0;
}


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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define file "cycle"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 1e5 + 5;

void solve(){
	ll a = 1, b = 1, c, d;
	int n;
	cin >> n;
	REP(i, 0, n){
		cin >> c >> d;
		a = (a + c - 1) / c * c;
		b = (b + d - 1) / d * d;
		if (a / c < b / d){
			a = b / d * c;
		}
		if (b / d < a / c){
			b = a / c * d;
		}
	}
	cout << a + b << endl;
}	

int main(){

	//freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();	
	}
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
const int Dx[8] = {0,1,1,1,0,-1,-1,-1}, Dy[8] = {-1,-1,0,1,1,1,0,-1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
int a, b;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> a>>b;
    if(a<=5){
    cout << 0 << "\n";
    }
    else if(a>=13){
    cout << b<< "\n";
    }
    else{
        cout << b/2<< "\n";
    }
}


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

int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;

  int max_size = max(x, y);

  int ans = 1e9+1;
  for (int i = 0; i < max_size*2; i++) {
    ans = min(ans, 2*c*i + max(x-i, 0)*a + max(y-i, 0)*b);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod=1e9+7;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	string s;
	cin>>s;
	ll n=s.length();
	ll dp[n+5][15];
	memset(dp,0,sizeof(dp));
	if (s[0]!='?')
	dp[0][s[0]-'0']++;
	else
	{
		for(ll i=0;i<=9;i++)
			dp[0][i]++;
	}
	for(ll i=1;i<n;i++)
	{
		for(ll j=0;j<13;j++)
		{
			if (s[i]=='?')
			{
				for(ll k=0;k<=9;k++)
				{
					dp[i][(j*10+k)%13]+=dp[i-1][j];
					if (dp[i][(j*10+k)%13]>=mod)
						dp[i][(j*10+k)%13]%=mod;
				}
			}
			else
			{
				dp[i][(j*10+s[i]-'0')%13]+=dp[i-1][j];
				if (dp[i][(j*10+s[i]-'0')%13]>=mod)
					dp[i][(j*10+s[i]-'0')%13]%=mod;
			}
		}
	}
	cout<<dp[n-1][5];
}

Measured memory_bytes: 12240