akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#include <unordered_set>
using namespace std;

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
const int inf = 1000000001;
const ll INF = 1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<<fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

/*
int main() {
	int n, a, i, j, k;
	cin >> n >> a;
	vi x(n);
	for (i = 0; i < n; i++) {
		cin >> x[i];
	}
	vector< vll > dp(n + 1, vll(n + 1, vl(2501, 0)));
	dp[0][0][0] = 1;
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			for (k = 0; k <= 2500; k++) {
				if (dp[i][j][k] != 0) {
					dp[i + 1][j][k] += dp[i][j][k];
					dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
				}
			}
		}
	}
	ll sum = 0;
	for (j = 1; j <= n; j++) {
		sum += dp[n][j][a*j];
	}
	cout << sum << endl;
}
*/

int main() {
	int n, a, i, j, k;
	cin >> n >> a;
	vi x(n);
	for (i = 0; i < n; i++) {
		cin >> x[i];
		x[i] -= a;
	}
	vll dp(n + 1,vl(5010));
	dp[0][2500] = 1;
	for (i = 0; i < n; i++) {
		for (j = 0; j < 5010; j++) {
			if (dp[i][j] != 0) {
				dp[i + 1][j] += dp[i][j];
				dp[i + 1][j + x[i]] += dp[i][j];
			}
		}
	}
	cout << dp[n][2500]-1 << endl;
}

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

using namespace std;

int main() {

	long long n,a,b;
	cin >> n >> a >> b;
//	string s;
//	cin >> s;

	long long count;
	long long amari;
	count = 0;

	if (n >= (a+b)) {
		count = a * (long long)(n/(a+b));
	}

	amari = n % (a + b);

	//if (amari == 0) { count -= a; }

	if (amari >= a) { count += a; }
	else { count += amari; }

	cout << count << endl;

}

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

template <typename T>
ostream& operator <<(ostream& out, const vector<T>& vec) {
    out << "[";
    for (int x : vec) out << x << ", ";
    out << "]";
    return out;
}

#if DEBUG && !ONLINE_JUDGE
    ifstream input_from_file("input.txt");
    #define cin input_from_file
    #define dbg_var(x) cerr << #x << ": " << x << endl;
#endif


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    vector<int> p(n+1), pos(n+1), lung(n+1);
    for(int i=1; i<=n; i++){
        cin >> p[i];
        pos[p[i]] = i;
    }
    
    int ans = n;
    
    for(int k=1; k<=n; k++){        
        lung[k] = 1;
        if(k > 1) if(pos[k-1] < pos[k]) lung[k] = lung[k-1] + 1;
        int costo = k - lung[k];
        ans = min(ans, n - k + costo);
    }
    
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 2560
#include <iostream>

using namespace std;

int main() {

	int N, M;
	scanf("%d%d", &N, &M);

	int nFalseCnt;
	nFalseCnt = 0;

	bool* bIsAc = new bool[N];
	int*  vecFalseCnt = new int[N];
	for (int n = 0; n < N; ++n) {
		bIsAc[n] = false;
		vecFalseCnt[n] = 0;
	}

	int tmp;
	char S[2];
	for (int m = 0; m < M; ++m) {
		scanf("%d %s", &tmp, S);
		if (S[0] == 'A')
			bIsAc[tmp - 1] = true;
		else if (!bIsAc[tmp - 1]) {
			++vecFalseCnt[tmp - 1];
		}
	}

	int cnt = 0;
	for (int n = 0; n < N; ++n) {
		if (bIsAc[n]) {
			++cnt;
			nFalseCnt += vecFalseCnt[n];
		}

	}
	printf("%d %d\n", cnt, nFalseCnt);

	delete[] bIsAc;

	return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define endl '\n'
#define pb push_back
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;

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

  int n, a, b; cin >> n >> a >> b;

  int minv = min(n * a, b);

  cout << minv << endl;

  return 0;
}

Measured memory_bytes: 256
def main():
    N, M = map(int, input().split())
    students = [input().split() for _ in range(N)]
    checkpoints = [input().split() for _ in range(M) ]
    nearest = [None]*N

    for i, s in enumerate(students) :
        min_d = 10**9
        index = 0

        for j, p in enumerate(checkpoints, 1) :
            a, b = map(int, s)
            c, d = map(int, p)
            d = abs(a - c) + abs(b - d)

            if min_d > d:
                min_d = d
                index = j

        nearest[i] = index

    for i in range(N):
        print(nearest[i])   
main()


Measured memory_bytes: 39792
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), C = sc.nextInt(), D = sc.nextInt();
		int count = 0;
		int ans = 0;
		while(count < 101) {
			if(count >= A && count >= C &&
				count < B && count < D) {
				ans++;
			}
			count++;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 21716
#include<iostream>
using namespace std;
int main()
{
    string a,b;
    cin >> a;

    for(int i=0;i<a.size();i=i+2){
    if(a.at(i) == 'L'){
        b="No";
    }
    }

    for(int i=1;i<(a.size()-1);i=i+2){
    if(a.at(i) == 'R'){
        b="No";
    }
    }
    if(b != "No"){
        b="Yes";
    }
    cout << b <<endl;
    
}


Measured memory_bytes: 256
#include<stdio.h>
#define N 100
#define W 0
#define G 1
#define B 2

int n,M[N][N];
int color[N],d[N],f[N],tt;

void dfs_visit(int u){
  int v;
  color[u]=G;
  d[u]=++tt;
  for(v=0;v<n;v++){
    if(M[u][v]==0) continue;
    if(color[v]==W){
      dfs_visit(v);
    }
  }
  color[u]=B;
  f[u]= ++tt;
}
void dfs(){
  int u;
  for(u=0;u<n;u++) color[u]=W;
  tt=0;
  for(u=0;u<n;u++){
    if(color[u]==W) dfs_visit(u);
  }
  for(u=0;u<n;u++){
    printf("%d %d %d\n",u+1,d[u],f[u]);
  }
}

int main(){
  int u,v,k,i,j;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++) M[i][j]=0;
  }

  for(i=0;i<n;i++){
    scanf("%d %d",&u,&k);
    u--;
    for(j=0;j<k;j++){
      scanf("%d",&v);
      v--;
      M[u][v]=1;
    }
  }

  dfs();
  return 0;
}


Measured memory_bytes: 2772
#include <iostream>
#include <vector>

const long long MOD = 1000000007;

long long pow(long a, long n) {
  long long ret = 1;
  for (; n > 0; n >>= 1, a = a * a % MOD) {
    if (n % 2 == 1) ret = ret * a % MOD;
  }
  return ret;
}

long long inv(long long a) {
  return pow(a, MOD - 2);
}

long long comb(int n, int k) {
  long long ret = 1;
  for (int i = n; i >= n - k + 1; --i) ret = ret * i % MOD;
  for (int i = 1; i <= k; ++i) ret = ret * inv(i) % MOD;
  return ret;
}

int main() {
  long long N, M, K;
  std::cin >> N >> M >> K;
  long long xsum = 0, ysum = 0;
  {
    long long upper = 0;
    long long lower = N * (N - 1) / 2;
    for (int i = 0; i < N; ++i) {
      ysum =(ysum + upper + lower) % MOD;
      upper += i + 1;
      lower += MOD - (N - 1 - i);
      upper %= MOD;
      lower %= MOD;
    }
    {
      long long upper = 0;
      long long lower = M * (M - 1) / 2;
      for (int i = 0; i < M; ++i) {
	xsum =(xsum + upper + lower) % MOD;
	upper += i + 1;
	lower += MOD - (M - 1 - i);
	upper %= MOD;
	lower %= MOD;
      }
    }
  }
  long long ans = 0;
  long long totx = M * M % MOD * inv(2) % MOD;
  long long toty = N * N % MOD * inv(2) % MOD;
  ans = (ysum * totx % MOD + xsum * toty % MOD) % MOD * comb(N * M - 2, K - 2) % MOD;
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
typedef long long ll;
using namespace std;

int main() {
	ll n;
	cin >> n;
	vector<string> s(n);
	for (int i = 0; i < n; i++)
		cin >> s[i];
	ll m = 0, a = 0, r = 0, c = 0, h = 0;
	for (int i = 0; i < n; i++) {
		if (s[i][0] == 'M')
			m++;
		if (s[i][0] == 'A')
			a++;
		if (s[i][0] == 'R')
			r++;
		if (s[i][0] == 'C')
			c++;
		if (s[i][0] == 'H')
			h++;
	}
	ll ans = m * a * r + m * a * c + m * a * h + m * r * c + m * r * h + m * c * h + a * r * c + a * r * h + a * c * h + r * c * h;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6144
#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, int> pdd;

const ll mod = 1e9 + 7;
const int N = 1e5 + 10, M = 1e5 + 10;
const ll INF = 1e18;
const int inf = 0x3f3f3f3f;
const double eps = 1e-4;

#define pi acos(-1)
#define mk make_pair

vector<int> v[N];
int h[N];

int main()
{
    int n, m;
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        scanf("%d", &h[i]);
    }
    while (m--)
    {
        int x, y;
        scanf("%d%d", &x, &y);
        v[x].push_back(y);
        v[y].push_back(x);
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++)
    {
        int flag = 1;
        for (auto j : v[i])
        {
            if (h[i] <= h[j])
            {
                flag = 0;
                break;
            }
        }
        if (flag)
            cnt++;
    }
    cout << cnt << endl;
    return 0;
}

/*

*/

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

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

  int N;
  cin >> N;
  map<int, int> A;

  rep(i, N) {
    int a; cin >> a;
    A[a]++;
  }

  int ans = 0;
  int two = 0;
  for(auto a : A) {
    if(a.second == 1) {
      ans++;
      continue;
    }

    if(a.second == 2) {
      two++;
      continue;
    }

    if(a.second % 2 == 1) {
      ans++;
      continue;
    }

    if(a.second % 2 == 0) {
      two++;
    }
  }

  ans += two % 2 == 0 ? two : two - 1;

  cout << ans << endl;
}


Measured memory_bytes: 4992
#include<iostream>
using namespace std;
 
int main() {
    char c;
    while (1) {
        cin.get(c);
        if (c == '\n')break;
        else if ('A' <= c && c <= 'Z')c += 'a' - 'A';
        else if ('a' <= c && c <= 'z')c -= 'a' - 'A';
        cout<<c;
    }
    cout << endl;
        return 0;
}
     

Measured memory_bytes: 3096
#if defined(__GNUC__)
#include <bits/stdc++.h>
#define __int32 __int32_t
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(ALL(x), greater<decltype(x)::value_type>())
#define RSORT2(x, T) sort(ALL(x), greater<T>())
#define REVERSE(x) reverce(ALL(x))
#define ACM(x, y) accumulate(ALL(x), y)

#define INT_POW(x, y) [](int a, int b) -> int {int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)
#define FCT(x) [](int a) -> int {int r = 1; REP(i, a){r *= i;} return r;}(x)

// デバッグ用
#define PUT_LIST(x, y) std::copy(ALL(x), ostream_iterator<decltype(x)::value_type>(cout, y))

const int kMod = 1e9 + 7;

itn main() {
	ios::sync_with_stdio(false);

	string s;

	cin >> s;

	int n = s.size();

	string res;

	REP(i, n / 2) {
		if (s[i] != s[n - i - 1]) {
			cout << "No";
			return 0;
		}
	}

	int top = 1;
	int btm = (n - 1) / 2;

	REP(i, btm / 2) {
		if (s[i] != s[btm - i - 1]) {
			cout << "No";
			return 0;
		}
	}

	top = (n + 3) / 2;
	btm = n;

	REP(i, (btm - top) / 2) {
		if (s[top + i - 1] != s[n - i - 1]) {
			cout << "No";
			return 0;
		}
	}

	cout << "Yes";

	return 0;
}


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

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

    int key;
    for(int i = 0; i < size; ++i) {
        int j = i - 1;
        while(j >= 0 && A[j] > A[j + 1]) {
            key = A[j + 1];
            A[j + 1] = A[j];
            A[j] = key;
            --j;
        }
        for(int k = 0; k < size; ++k) {
            cout << A[k];
            if(k != size - 1) cout << " ";
        }
        cout << endl;
    }
}

Measured memory_bytes: 3088
import math

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

if h * 360 / 12 + m * 360 / 60 / 12 > m * 360 / 60:
    r = (h * 360 / 12 + m * 360 / 60 / 12) - m * 360 / 60
else:
    r = m * 360 / 60 - (h * 360 / 12 + m * 360 / 60 / 12)

if r > 180:
    r = 360 - r

# if r == 90:
#     t = a ** 2 + b ** 2
#     print(math.sqrt(t))
# else:
c = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(r))
print(math.sqrt(c))

Measured memory_bytes: 9516
/*|In The Name of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+5;

int n;
int a[N][4];
int dp[N][4];

int main(){
    scanf("%d" , &n);
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= 3; j++){
            int x;
            scanf("%d" , &x);
            a[i][j] = x;
        }
    }
    int mx = 0;
    for(int i = 1; i <= n; i++){
        dp[i][1] = max(dp[i - 1][2] , dp[i - 1][3]) + a[i][1];
        dp[i][2] = max(dp[i - 1][1] , dp[i - 1][3]) + a[i][2];
        dp[i][3] = max(dp[i - 1][1] , dp[i - 1][2]) + a[i][3];
        mx = max(mx , dp[i][1]);
        mx = max(mx , dp[i][2]);
        mx = max(mx , dp[i][3]);
    }
    printf("%d\n" , mx);
    return 0;
}


Measured memory_bytes: 5888
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int r = sc.nextInt();
		int D = sc.nextInt();
		int x = sc.nextInt();
		
		for(int i=1;i<=10;i++) {
			int t = r*x-D;
			System.out.println(t);
			x = t;
		}
		
		sc.close();
		
	}

}

Measured memory_bytes: 20820
import sys
sys.setrecursionlimit(100000000)

n = int(input())
x = input()

c1 = x.count('1')
if c1 > 1:
    cc1 = int('0b' + x, 0) % (c1 - 1)
cc2 = int('0b' + x, 0) % (c1 + 1)

def f(n):
    ans = 0
    while n > 0:
        ans += 1
        n = n % bin(n).count('1')
    return ans

if c1 == 1:
    for i in range(n):
        if x[i] == '1':
            print(0)
        else:
            print(f((pow(2, n-i-1, c1+1) + cc2) % (c1 + 1)) + 1)
    exit()

for i in range(n):
    if x[i] == '1':
        print(f((-pow(2, n-i-1, c1-1) + cc1) % (c1 - 1)) + 1)
    else:
        print(f((pow(2, n-i-1, c1+1) + cc2) % (c1 + 1)) + 1)

Measured memory_bytes: 81044
// g++ -std=c++14

/*

Today might be the chance to grasp the chance to let your talent bloom.
May be tomorrow, the day after, or next year...
May be even when you are 30. I'm not sure if physique has anything to do with it
but if you think that it will never come, it probably never will.

- Tooru Oikawa.

*/


#include<bits/stdc++.h>

typedef long long ll;
typedef long double lld;
using namespace std;

#define endl "\n"
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define all(c) c.begin(),c.end()
#define inf 1000000000000000001
#define pii pair<int, int>
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
ll l=v.size();for(ll i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

#define int ll

void solve() {
    int n;
    cin >> n;
    int p[n];
    for(int i = 0 ; i < n ; i++) cin >> p[i];
    int q[n];
    for(int i = 0 ; i < n ; i++) cin >> q[i];

    int a = -1, b = -1;
    int arr[n];
    for(int i = 0 ; i < n ; i++) arr[i] = i+1;

    int ind = 0;
    do { 
        int flag = 1;
        int flag2 = 1;
        for(int i = 0 ; i < n ; i++) {
            if(arr[i] != p[i]) flag = 0;
            if(arr[i] != q[i]) flag2 = 0;
        }
        if(flag) a = ind;
        if(flag2) b = ind;
        ind++;
    } while (next_permutation(arr, arr + n));
    cout << abs(a-b) << endl;

}
int32_t main(){ _
    ll t;
    // cin >> t;
    t = 1;
    while(t--) solve();
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

::std::int64_t gcd(::std::int64_t a, ::std::int64_t b) {
	while (b != 0) {
		::std::swap(a, b);
		b = b % a;
	}
	return a;
}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int32 N;
	int64 res;
	cin >> N;
	cin >> res;
	REP(i, N-1) {
		int64 a;
		cin >> a;
		res = gcd(a, res);
	}
	cout << res << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
	long double N, D;
	cin >> N >> D;
	int cont = 0;
	for(int i=0; i<N; i++)
	{
		long double x, y, dist;
		cin >> x >> y;
		dist = sqrt(pow(x, 2) + pow(y, 2));
		if(dist<=D){
			cont++;
		}
	}
	cout << cont;

	return 0;
}

Measured memory_bytes: 3144
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (n, k) = scan!(usize, usize);
    println!("{}", n - k + 1);
}


Measured memory_bytes: 4352
n = int(input())
s = input()
if n%2 == 0:
    t = s[:n//2]
    """
    for i in range(n//2):
        t.append(s[i])
        t.append(t)
    """
    t = t+t
    if s == t:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

int main(void) {
    long long A, B, N;
    std::cin >> A >> B >> N;
    long long x;
    if (N < B) {
        x = N;
    } else {
        x = ((N + 1) / B) * B - 1;
    }
    printf("%lld\n", (A * x / B) - A * (x / B));

    return 0;
}


Measured memory_bytes: 3776
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; cin >> n;
	string s; cin >> s;
	int rcnt = 0;
	int bcnt = 0;
	for(int i=0;i<n;i++){
		if(s[i]=='R'){
			rcnt++;
		}else{
			bcnt++;
		}
	}
	if(rcnt>bcnt){
		cout << "Yes" << endl;
		return 0;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main () {
  int x;
  int n ;
  n = 0;
  while (1) {
    scanf ("%d",&x);
    if (x == 0) break;
    n ++;
    printf ("Case ");
    printf ("%d",n);
    printf (": ");
    printf ("%d\n",x);
  }
  return 0;
}

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

const int INF = 1e9 + 10;

double cross_product(complex<double> a, complex<double> b) {
  return (conj(a) * b).imag();
}

int main() {
  int n;
  cin >> n;
  vector<complex<double>> P(n);
  for (int i = 0; i < n; i++) {
    double x, y;
    cin >> x >> y;
    P[i] = complex<double>(x, y);
  }
  double sum = 0.0;
  for (int i = 0; i + 2 < n; i++) {
    complex<double> a = P[0], b = P[i + 1], c = P[i + 2];
    sum += cross_product(b - a, c - a) / 2;
  }
  printf("%.1f\n", abs(sum));
}



Measured memory_bytes: 3216
<?php
list($k,$s) = explode(" ",trim(fgets(STDIN)));

if($s == 0){
echo 1;
}elseif($s == $k * 3){
echo 1;
}else{
$ans = 0;
$x = max(0,$s - $k * 2);
while($x <= $k){
$y = max(0,$s - $x - $k);
$ym = min($k,$s - $x);
while($y <= $ym){
$z= $s - $x - $y;
$zm = min($k,$s - $x - $y);
if($z <= $zm){
++$ans;
}
++$y;
}
++$x;
}
echo $ans;
}
?>

Measured memory_bytes: 3704
#include<bits/stdc++.h>
using namespace std;
int main ()
{
    int n;
    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n;i++)
        scanf("%d",&a[i]);
    sort(a,a+n);
    int count=0;
    for(int i=0;i<n-2;i++)
    {
        for(int j=i+1;j<n-1;j++)
        {
            if(a[i]==a[j])
                continue;
           for(int k=j+1;k<n;k++)
           {
               if(a[i]+a[j]>a[k]&&a[j]!=a[k])
                   count++;
           }
        }
    }
    printf("%d\n",count);
    return 0;
}


Measured memory_bytes: 3828
#include <stdio.h>
#include <limits.h>

static int units[8];
static int waitings[8];

void setup() {
	units[0] = 4;
	units[1] = 1;
	units[2] = 4;
	units[3] = 1;
	units[4] = 2;
	units[5] = 1;
	units[6] = 2;
	units[7] = 1;
}

int scan_waitings() {
	return scanf("%d %d %d %d %d %d %d %d",
			&waitings[0], &waitings[1], &waitings[2], &waitings[3],
			&waitings[4], &waitings[5], &waitings[6], &waitings[7]);
}

int count_passengers(int offset) {
	int sum = 0;
	int i;
	for (i = 0; i < 8; i++) {
		sum += (units[(i + offset) % 8] > waitings[i]) ? waitings[i] : units[(i + offset) % 8];
	}
	return sum;
}

void print_result(int offset) {
	int i;
	for (i = 0; i < 8; i++) {
		printf("%d", units[(i + offset) % 8]);
		if (i < 7) {
			printf(" ");
		} else {
			printf("\n");
		}
	}
}

int main() {
	int offset = 0;
	int max = 0;
	int count = 0;
	int max_offset = 0;
	char str[9];
	int num = INT_MAX;
	setup();

	while (scan_waitings() > 0) {
		max = 0;
		count = 0;
		max_offset = 0;
		num = INT_MAX;
		for (offset = 0; offset < 8; offset++) {
			count = count_passengers(offset);
			sprintf(str, "%d%d%d%d%d%d%d%d",
						units[(0 + offset) % 8],
						units[(1 + offset) % 8],
						units[(2 + offset) % 8],
						units[(3 + offset) % 8],
						units[(4 + offset) % 8],
						units[(5 + offset) % 8],
						units[(6 + offset) % 8],
						units[(7 + offset) % 8]
						);
			if (count > max) {
//				printf("新記録   offset = %d, 配置 = %d\n", offset, atoi(str));
				num = atoi(str);
				max_offset = offset;
				max = count;
			} else if (count == max) {
//				printf("タイ記録 offset = %d, 配置 = %d\n", offset, atoi(str));
				if (num > atoi(str)) {
					max = count;
					num = atoi(str);
					max_offset = offset;
				}
			}
		}
		print_result(max_offset);
	}
	return 0;
}

Measured memory_bytes: 616
#include<bits/stdc++.h>
#define MAX 200010
#define inf 2147483647
#define linf (1e16)
#define eps (1e-8)
#define Eps (1e-12)
#define mod 1000000007
#define pi acos(-1.0)
#define phi (1.0+sqrt(5.0))/2.0
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define pd(a) printf("%.10f\n",(double)(a))
#define pld(a) printf("%.10Lf\n",(ld)(a))
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(a)-1;(b)<=i;i--)
#define Unique(v) v.erase(unique(all(v)),v.end())
#define equals(a,b) (fabs((a)-(b))<eps)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,double> pid;
typedef pair<double,int> pdi;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<pii> vpi;

int n,n_,q;
ll st[MAX*2];

void init(){
  n_ = 1;
  while(n_<n)n_*=2;
  FOR(i,0,2*n_-1)st[i]=inf;
}

void update(int a,int b){
  a+=n_-1;
  st[a] = b;
  while(a>0){
    a = (a-1)/2;
    st[a] = min(st[a*2+1],st[a*2+2]);
  }
}

int find(int a,int b,int c,int l,int r){
  if(r<=a || b<=l)return inf;
  if(a<=l && r<=b)return st[c];
  
  int L = find(a,b,c*2+1,l,(l+r)/2);
  int R = find(a,b,c*2+2,(l+r)/2,r);
  return min(L,R);
}

int main()
{
  cin>>n>>q;
  init();
  FOR(i,0,q){
    int a,b,c;
    cin>>a>>b>>c;
    if(a)cout<<find(b,c+1,0,0,n_)<<endl;
    else update(b,c);
  }
  return 0;
}


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

int main() {
  int N,answer;
  cin >> N;
  vector<int> A(210);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  bool res = true;
  while(res) {
    bool res = false;
    for (int i = 0; i < N; i++) if (A.at(i) % 2 != 0) res = true;
    if (res) break;
    for (int i = 0; i < N; i++) A.at(i) /= 2;
    answer++;
  }
  cout << answer << endl;
}

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

int h;
int A[10][5];

int Get(){
	int res=0;
	REP(i,h){
		for(int l=0;l<3;l++){
			if(A[i][l]==0) continue;
			int key=A[i][l],r=l;
			while(r<5 && A[i][r]==key) r++;
			if(r-l>=3){
				res+=key*(r-l);
				for(int j=l;j<r;j++) A[i][j]=0;
			}
		}
	}
	return res;
}
int Update(){
	REP(j,5){
		REP(i,h){
			if(A[i][j]) continue;
			for(int k=i+1;k<h;k++){
				if(A[k][j]){
					swap(A[i][j],A[k][j]);
					break;
				}
			}
		}
	}
}
int main() {

	while(cin>>h,h){
		for(int i=h-1;i>=0;i--) REP(j,5) cin>>A[i][j];
		int ans=0;
		while(true){
			int score=Get();
			if(score==0) break;
			ans+=score;
			Update();
		}
		cout<<ans<<endl;
	}	
	return 0;
}


Measured memory_bytes: 3072
house = [[ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ "#" for i in range(20)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)],
        [ 0 for i in range(10)]]
n = int(input())
for i in range(n):
    b,f,r,v = map(int,input().split())
    house[f-1+(b-1)*4][r-1] += v

for i in range(len(house)):
    if (i+1)%4 ==0:
        print(''.join(str(i) for i in house[i]))
    else:
        print('',' '.join(str(i) for i in house[i]))


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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define repr(i,b,a) for(int i=int(b);i>=(a);i--)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

int main()
{
	int n;
	cin>>n;
	vector<ll> a(n+1,0);
	rep(i,n)cin>>a[i];


	ll ans=0;
	rep(s,n){
		rep(g,n){
			if(s>g)continue;
			ll m=1000%a[s], k=1000/a[s];
			repi(i,s,g){
				if(a[i]>a[i+1]){
					m+=k*a[i];
					k=0;
				}else if(a[i]<a[i+1]){
					k+=m/a[i];
					m=m%a[i];
				}
			}
			m+=k*a[g];
			// cout<<s<<" "<<g<<" "<<m<<endl;
			ans=max(ans,m);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int a[] = { 1, 3, 5, 7, 8, 10, 12 };
    int b[] = { 4, 6, 9, 11 };
    int x, y;
    cin >> x >> y;
    int t = 0;
    for (int i = 0; i < 7; i++)
    {
        if (a[i] == x) t++;
        if (a[i] == y) t++;
        if (t == 2)
        {
            cout << "Yes" << '\n';
            return 0;
        }
    }
    t = 0;
    for (int i = 0; i < 4; i++)
    {
        if (b[i] == x) t++;
        if (b[i] == y) t++;
        if( t == 2 )
        {
            cout << "Yes" << '\n';
            return 0;
        }
    }
    if (x == 2 && y == 2) {
        cout << "Yes" << '\n'; return 0;
    }
    else cout << "No" << '\n';
   
}



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

using namespace std;

int main(void) {
	string s; cin >> s;
	bool flag = true;
	for (int i = 0; i < s.size(); i++) {
		if (i % 2 != 0) {
			if (s[i] == 'L' || s[i] == 'U' || s[i] == 'D') {
				continue;
			}
			else {
				flag = false;
				break;
			}
		}
		else {
			if (s[i] == 'R' || s[i] == 'U' || s[i] == 'D') {
				continue;
			}
			else {
				flag = false;
				break;
			}

		}
	}

	if (flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)


def main():
    x=int(input())
    if x==1:
        print(1)
        exit()
    ans=0
    b=32
    for p in range(2,11):
        while b**p>x:
            b-=1
            if b==1:
                print(ans)
                exit()
        ans=max(ans,b**p)

main()

Measured memory_bytes: 3316
#include <fstream>
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

ifstream in("bleach.in");
ofstream out("bleach.out");

int const NMAX = 1e6;
int v[1 + NMAX];

int main() {

  string inp;
  cin >> inp;
  if((inp[0] - '0') * 10 + (inp[1] - '0') <= 12 && (inp[2] - '0') * 10 + (inp[3] - '0') <= 12 && (inp[0] - '0') * 10 + (inp[1] - '0') != 0 && (inp[2] - '0') * 10 + (inp[3] - '0') != 0){
    cout << "AMBIGUOUS";
  }else if((inp[0] - '0') * 10 + (inp[1] - '0') <= 12 && (inp[0] - '0') * 10 + (inp[1] - '0') != 0){
    cout << "MMYY";
  }else if((inp[2] - '0') * 10 + (inp[3] - '0') <= 12 && (inp[2] - '0') * 10 + (inp[3] - '0') != 0){
    cout << "YYMM";
  }else{
    cout << "NA";
  }
  return 0;
}


Measured memory_bytes: 3572
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#define pb push_back
#define mp make_pair
#define ll long long
using namespace std;
const int N = 2e5 + 5;
const ll MOD = 1e9 + 7;

int n, m, a, b;

ll pw(ll x, ll e)
{
    if(e == 0)
        return 1LL;
    if(e == 1)
        return x;

    ll res = pw(x, e / 2);
    res = (res * res) % MOD;
    if(e & 1)
        res = (res * x) % MOD;
    return res;
}

ll f[N], inv_f[N];
ll choose(int x, int y)
{
    if(y > x)
        return 0;
    ll res = (((f[x] * inv_f[y]) % MOD) * inv_f[x - y]) % MOD;
    return res;
}

ll ans;
ll ways_small[N];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    cin >> n >> m >> a >> b;

    f[0] = 1;
    for(int i = 1; i < N; i++)
        f[i] = (f[i - 1] * i) % MOD;
    inv_f[N - 1] = pw(f[N - 1], MOD - 2);
    for(int i = N - 2; i >= 0; i--)
        inv_f[i] = (inv_f[i + 1] * (i + 1)) % MOD;

    ans = choose(n + m - 2, n - 1);
    for(int i = 1; i <= b; i++)
    {
        ll cur = (choose((n - a) + i - 2, i - 1) * choose((m - i + 1) + a - 2, a - 1)) % MOD;
        ans = ((ans - cur) + MOD) % MOD;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3456
# n = int(input())
# a = map(int,input().split())
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if x == 500*i+100*j+50*k: count+= 1

print(count)

Measured memory_bytes: 3060
A, B, K = map(int, input().split())

ans = []

for i in range(K):
  if A + i <= B and A + i not in ans:
    ans.append(A + i)
  
  if B - i >= A and B - i not in ans:
    ans.append(B - i)
    
ans.sort()

for i in ans:
  print(i)

Measured memory_bytes: 9188
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define FOR1(i, n) FOR(i, 1, n+1)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define int long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));
#define myCeil(dividend, divisor) ceil((double)(dividend) / (double)(divisor))
#define myFloor(dividend, divisor) floor((double)(dividend) / (double)(divisor))
#define calcDigits(num) floor(log10(num))+1

#define dl(line) cerr << "RUN: until " << (line) << "th line." << endl;
#define dv(name, value) cerr << (name) << " is " << (value) << endl;
#define da(v)  cerr << "["; REPI(itr, v){cerr << *itr << (itr != --v.end() ? ", " : "");} cerr << "]" << endl;
#define dpa(v) cerr << "[ " << endl;REPI(itr, v) { cerr << "  [" << (*itr).first << ", " << (*itr).second << ']' << (itr != --v.end() ? "," : "") << endl; } cerr << "]" << endl;


void solve(long long A, long long B, long long C){
  cout << max(C - (A - B), (ll)0) << endl;
}

signed main(){
  long long A;
  scanf("%lld",&A);
  long long B;
  scanf("%lld",&B);
  long long C;
  scanf("%lld",&C);
  solve(A, B, C);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++){
    cin >> a[i];
  }
  map<int, int> mp;
  for (int i = 0; i < N; i++){
    mp[a[i]]++;
  }
  int ans = 0;
  for (auto P : mp){
    if (P.second >= P.first){
      ans += P.second - P.first;
    } else {
      ans += P.second;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 5120
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
#include<complex>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)

int keta(int x) {
    int c = 0;
    if (x == 0) return 1;
    while (x) {
        x /= 10;
        c++;
    }
    return c;
}
int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    int a0, l;
    while (cin >> a0 >> l && (a0 || l)) {
        set<int> st;
        vector<int> v;
        int flg = 0;
        while (1) {
            string s;
            rep(i, l - keta(a0)) {
                s += '0';
            }
            s += to_string(a0);
            if (flg == 0) {v.push_back(stoi(s)); st.insert(stoi(s)); /*cout << "init " << s << endl;*/}
            flg = 1;
            sort(s.begin(), s.end());
            int mmin = stoi(s);
            sort(s.begin(), s.end(), greater<char>());
            int mmax = stoi(s);
            int dif = mmax - mmin;
            //cout << "dif " << dif << endl;
            if (st.find(dif) == st.end()) {
                st.insert(dif);
                v.push_back(dif);
            } else {
                rep(i, v.size()) if (v[i] == dif) {
                    cout << i << " ";
                    cout << dif << " ";
                    cout << v.size() - i << endl;
                }
                break;
            }
            a0 = dif;
        }
    }
}



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

int main(){
    int h,w,t,y,s;
    
    while(1){
        cin >> h >> w;
        if(h==0 && w==0)break;
        
        
        for(t=1; t<=h; t++){
            for(y=1; y<=w; y++){
                if( (t+y)%2==0 ){
                    cout << "#";
                }
                    else{cout << ".";}
             }
             cout << "\n";
            }
        cout << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3116
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        static Tuple<int, int[][]> Solve(int L)
        {
            int N = 0;
            for (int i = L; i > 0; i >>= 1) { ++N; }
            var path = new List<int[]>();
            for (int i = 1; i <= N - 1; ++i)
            {
                path.Add(new[] { i, i + 1, 0 });
                path.Add(new[] { i, i + 1, 1 << (N - i - 1)});
            }
            int sum = 1 << (N - 1);
            for (int i = 0; i < N - 1; ++i)
            {
                if ((L & (1 << i)) != 0)
                {
                    path.Add(new[] { 1, N - i, sum });
                    sum += 1 << i;
                }
            }
            return new Tuple<int, int[][]>(N, path.ToArray());
        }
        static void Main(string[] args)
        {
            var ans = Solve(ReadInt());
            Console.WriteLine("{0} {1}", ans.Item1, ans.Item2.Length);
            foreach (var path in ans.Item2)
            {
                Console.WriteLine(string.Join(" ", path));
            }
        }
    }
}


Measured memory_bytes: 13396
# include <bits/stdc++.h>
#define ll long long
#define str string
#define print  cout
#include <set>
using namespace std;
set<int> st;
vector<int> A={1,1},B,C;
ll int  a,b,c,d,e,f,lo,k,cnt,bnt;
str s,t;
bool  S=true,L=true;
int main(){
        cin>>s>>t;
        cout<<t<<s;;
}


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

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

    static class CAXBC {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt(), ans = 0;
            for (int i = 1; i <= n; ++i) for (int j = 1; j * i < n; ++j) ans++;
            out.println(ans);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 32456
#include<bits/stdc++.h>
#define endl enjoy_codeforces
using lint=long long;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    lint h,w;std::cin>>h>>w;
    std::vector<std::vector<lint>>a(h,std::vector<lint>(w));
    for(lint i=0;i<h;i++){
        for(lint j=0;j<w;j++){
            std::cin>>a.at(i).at(j);
        }
    }
    for(lint i=0;i<h;i++){
        for(lint j=0;j<w;j++){
            lint x;std::cin>>x;
            a.at(i).at(j)=std::abs(a.at(i).at(j)-x);
        }
    }
    lint max=80*80*2+100;
    std::vector<std::vector<std::vector<lint>>>dp(
        h,std::vector<std::vector<lint>>(w, std::vector<lint>(max+1,false))
    );
    dp.at(0).at(0).at(a.at(0).at(0))=true;
    for(lint i=0;i<h;i++){
        for(lint j=0;j<w;j++){
            lint x=a.at(i).at(j);
            if(i){
                for(lint k=0;k<=max;k++){
                    dp.at(i).at(j).at(k) |=
                        dp.at(i-1).at(j).at(std::abs(k-x))||
                        k+x<=max&&dp.at(i-1).at(j).at(k+x);
                }
            }
            if(j){
                for(lint k=0;k<=max;k++){
                    dp.at(i).at(j).at(k) |=
                        dp.at(i).at(j-1).at(std::abs(k-x))||
                        k+x<=max&&dp.at(i).at(j-1).at(k+x);
                }
            }
        }
    }
    for(int i=0;;i++){
        if(dp.at(h-1).at(w-1).at(i)){
            std::cout<<i<<'\n';
            return 0;
        }
    }
}


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

typedef long long ll;
typedef pair<int,int> ii;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int x,a; cin>>x>>a; cout<<(x<a?0:10)<<"\n";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 100000000
#define INFLL 100000000000
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

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

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



int N, K;
int res[110000];

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

  rep (i, N) {
    res[i] = std::ceil(max(std::log2((double)K/(double)i), 0.0));
  }

  int n = res[1];

  rep(i, 100){
    //cout << res[i] << "\n";
  }

  rep (i, N) {
    res[i] = n - res[i];
  }

  double ans = 0;
  rep (i, N) {
    ans += pow(2, res[i]);
  }
  //cout << ans << "\n";
  //cout << n << "\n";
  //cout << N * pow(2, n) << "\n";
  ans /= (N * pow(2, n));

  printf("%.10f\n", ans);
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<stack>
#include<string.h>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<list>

#define ln 1e6
#define pi acos(-1.0)
#define pb push_back
#define mp make_pair
#define F first
#define S second

#define sortvac(a,b) sort(akash.begin(),akash.end())
#define sortvdc(a,b) sort(akash.begin(),akash.end(),greater<int>())

#define sortaac(a,b) sort(arr,arr+b)
#define sortadc(a,b) sort(arr,arr+b,greater<int>())

#define searchv(data) binary_search(akash.begin(),akash.end(),data)
#define searcha(data) binary_search(arr,arr+b,data)

#define reversev(akash) reverse(akash.begin(),akash.end())
#define reversea(arr) reverse(arr,arr+b)

#define removev(data) remove(akash.begin(),akash.end(),data);
#define removea(data) remove(arr,arr+b,data);

#define maxv(akash) *max_element(akash.begin(),akash.end())
#define maxa(arr) *max_element(arr,arr+b)

#define minv(akash) *min_element(akash.begin(),akash.end())
#define mina(arr) *min_element(arr,arr+b)

#define fori(i,a,b) for(int i=0;i<b;i++)
#define ford(i,a,b) for(int i=b-1;i>=0;i--)

using namespace std;

int main()
{
    int k,a,b;
    cin>>k;
    cin>>a>>b;
    
    for(int i=a;i<=b;i++){
        if(i%k==0){
            cout<<"OK\n";
            return 0;
        }
    }
    cout<<"NG\n";
    return 0;
}







Measured memory_bytes: 3100
#include <stdio.h>


int main(int argc, char const *argv[]) {

  
  int n, d;
  scanf("%d", &n);
  scanf("%d", &d);


  int per;
  int kansi = 0;
  for (int i = 1; kansi < n; i++){
      kansi += 2*d + 1;
      per = i;
  }

  printf("%d\n", per);

  return 0;
}

Measured memory_bytes: 128
from bisect import bisect_left, bisect_right

n = int(input())
stick = list(map(int, input().split()))
stick.sort()

count = 0
for i in range(n - 1, -1, -1):
    for j in range(i - 1, -1, -1):
        l = bisect_left(stick, stick[i] - stick[j] + 1)
        r = bisect_right(stick, stick[i] + stick[j] - 1) - 1
        if j <= l or l > r:
            break
        count += min(r + 1, j) - l
print(count)



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

using namespace std;

#define ll long long
#define ld long double
#define pll pair <ll , ll>

#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define mp make_pair

#define X first
#define Y second

#define LB(x) ((x) & -(x))
#define BIT(a , b) (((a)>>(b)) & 1)

#define ll int

const ll MAXN=3e2+10;

ll dp[MAXN][MAXN][MAXN];

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

	string s;
	cin>>s;

	ll n=(ll)(s.size());

	ll k;
	cin>>k;

	for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<=k;j++)
        {
            dp[i][i][j]=1;
        }
    }

	for(ll i=1;i<n;i++)
    {
        for(ll j=0;j+i<n;j++)
        {
            ll w=j+i;

            for(ll u=0;u<=k;u++)
            {
                if (s[j]==s[w])
                {
                    dp[j][w][u]=dp[j+1][w-1][u]+2;
                }
                else
                {
                    dp[j][w][u]=max(max(dp[j+1][w][u] , dp[j][w-1][u]) , (u>0 ? dp[j+1][w-1][u-1]+2 : 0));
                }
            }
        }
    }

    cout<<dp[0][n-1][k];
}


Measured memory_bytes: 112896
#include <bits/stdc++.h>
using namespace std;
char a, b;

void solve(){
	if(a == 'H' xor b == 'H')
		cout << "D" << endl;
	else
		cout << "H" << endl;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> a >> b;
		solve();
	return 0;
}


Measured memory_bytes: 256