akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b ) { a = b; return true; } else { return true; } }
const long long INF = 1LL << 60;
long long dp[1000010];
int main() {
  int N;
  int h[100010];

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

  //dp
  for (int i = 0; i < 1000010; i++) {
    dp[i] = INF;
  }
  dp[0] = 0;
  dp[1] = abs(h[0] - h[1]);
  for (int i = 2; i < N; i++) {
    chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
    chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
  }
  cout << dp[N - 1] << endl;

  return 0;
}


Measured memory_bytes: 8448
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	N, A, B := ReadInt(), ReadInt(), ReadInt()
	h := ReadInts(N)
	d := A - B
	l, r := 0, int(1e10)
	for r-l > 1 {
		c := (r + l) / 2
		v := 0
		for i := 0; i < N; i++ {
			remain := h[i] - B*c
			if remain > 0 {
				v += (remain + d - 1) / d
			}
		}
		if v <= c {
			r = c
		} else {
			l = c
		}
	}
	fmt.Println(r)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 4364
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    ll H;
    cin >> N >> H;
    vll a(N), b(N);
    rep(i, N) cin >> a[i] >> b[i];
    auto a_max_it = max_element(a.begin(), a.end());
    ll a_max = *a_max_it;
    int a_max_idx = distance(a.begin(), a_max_it);
    sort(b.begin(), b.end(), greater<ll>());
    int ans = 0;
    rep(i, N) {
        if (b[i] > a_max) {
            H -= b[i];
            ans++;
            if (H <= 0) break;
        }
    }
    if (H > 0) {
        ans += H / a_max;
        if (H % a_max != 0) ans++;
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int x, y;
  cin >> x >> y;
  for (int a = 0; a <= x; a++) {
    int b = x - a;
    if (2 * a + 4 * b == y) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3592
from collections import defaultdict

class XUnionFind(object):

    def __init__(self):
        self.table = defaultdict(lambda:-1)
        self.dtable = defaultdict(lambda:0)

    def find(self, x):
        parent = self.table[x] 
        if parent < 0:
            return x, 0
        else:
            root, distance = self.find(parent)
            new_distance = distance + self.dtable[x]
            self.table[x] = root
            self.dtable[x] = new_distance
            return root, new_distance

    def union(self, x1, x2, d = 0):
        root1, distance1 = self.find(x1)
        root2, distance2 = self.find(x2)
        if root1 == root2:
            if distance2 - distance1 != d:
                return False
            return True
        if root1 < root2:
            self.table[root1] += self.table[root2]
            self.table[root2] = root1
            self.dtable[root2] = distance1 + d - distance2
        else:
            self.table[root2] += self.table[root1]
            self.table[root1] = root2
            self.dtable[root1] = distance2 - d - distance1
        return True

def solve(N, M, lrd):
    uf = XUnionFind()
    for l, r, d in lrd:
        rc = uf.union(l, r, d)
        if rc == False:
            return False
    return True
        

if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    lrd = []
    for i in range(M):
        lrd.append([int(x) for x in input().split()])
    if solve(N, M, lrd):
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 59772
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template<class T> using VE = vector<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// const ll MOD = 1e9 + 7;
const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
int main() {
	V a(3);
	rep(i, 3) {
		cin >> a[i];
	}
	sort(all(a));
	cout << abs(a[0] - a[1]) + abs(a[1] - a[2]) << endl;
	return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main(){
  int n;cin>>n;
  int a[n],b[n],suma=0,sumb=0;
  rep(i,n)cin>>a[i];
  rep(i,n){cin>>b[i];sumb+=b[i];}
  int mx=0;
  rep(i,n){
    suma+=a[i];
    if(i>0)sumb-=b[i-1];
    mx=max(mx,suma+sumb);
  }
  cout<<mx;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>

using namespace std;

int n,k,a,ak,h,i;

int max(int a,int b)
{return(a>b?a:b);}

int main()
{
    scanf("%d %d %d",&n,&k,&a);
    h=a;
    for(i=2;i<=n;++i)
    {
        scanf("%d",&ak);
        a=__gcd(a,ak);
        h=max(ak,h);
    }
    if(k%a==0&&k<=h)printf("POSSIBLE\n");
    else printf("IMPOSSIBLE\n");
    return 0;
}

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

int main(){
	int K, A, B;
	cin >> K >> A >> B;
	int p = 0;
	for(int i = A; i <= B; i++){
		if(i % K == 0){
			p = p + 1;
		}
		if(p > 0){
			break;
		}
	}
	if(p > 0){
		cout <<  "OK" << endl;
	}else{
		cout << "NG" << endl;
	}




} 

Measured memory_bytes: 3132
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main{
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    int AC =0, WA=0, TLE =0,RE=0;
    String AC1="AC", WA1="WA", TLE1="TLE", RE1 ="RE";
    for(int i=0; i<n; i++){
      String curr = br.readLine();
      if(AC1.equals(curr)) AC++;
      else if(WA1.equals(curr)) WA++;
      else if(TLE1.equals(curr)) TLE++;
      else RE++;

    }
    System.out.println(AC1+" x "+AC);
    System.out.println(WA1+" x "+WA);
    System.out.println(TLE1+" x "+TLE);
    System.out.println(RE1+" x "+RE);
  }
}

Measured memory_bytes: 43792
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#define INF 1000000007
using namespace std;
using P = pair<int, int>;
using ll = long long;
int main(){
    string s;
    cin>>s;
    int cnt=1;
    for(int i=1;i<s.size();i++){
        if(s[i]!=s[i-1])cnt++;
    }
    cout<<cnt-1<<endl;
    return 0;
}



Measured memory_bytes: 512
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <vector>

using namespace std;

int main(){

	int n,m;
	while(cin >> n >> m && !(n == 0 && m == 0)){
		vector<int> v(m,0);
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				int p;
				cin >> p;
				if(p)
					v[j]++;
			}
		}
		vector<pair<int,int > > v2;
		for(int i = 0; i < v.size(); i++){
			v2.push_back(make_pair(v[i],-i));
		}

		sort(v2.begin(),v2.end(),greater<pair<int,int> >());
		for(int i = 0; i < v2.size(); i++){
			cout << -(v2[i].second-1) << ((i != v2.size()-1) ? " " : "\n");
		}
	}

	return 0;
}

Measured memory_bytes: 0
#include<stdio.h>
int main(){
	long int s[3];
	int a,n;
	scanf("%d",&n);
	s[0]=1;
	s[1]=0;
	s[2]=0;
	for(a=1;a<=n;a++){
		s[0]=s[0]*a;
		s[1]=s[1]*a;
		s[2]=s[2]*a;
		s[1]+=s[0]/100000;
		s[2]+=s[1]/100000;
		s[0]=s[0]%100000;
		s[1]=s[1]%100000;
	}
	if(s[1]==0){printf("%ld\n",s[0]);}
	else if(s[1]!=0 && s[2]==0){printf("%ld%05ld\n",s[1],s[0]);}
	else{printf("%ld%05ld%05ld\n",s[2],s[1],s[0]);}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <cstring>
#include <climits>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <sstream>
#include <numeric>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>

///////////////////////////////////////////////////////////////
// namespace
///////////////////////////////////////////////////////////////
using namespace std;
// namespace mp = boost::multiprecision;

///////////////////////////////////////////////////////////////
// types
///////////////////////////////////////////////////////////////
using pii = pair<int, int>;
using ll = long long int;
using ld = long double;
// using mpi = mp::cpp_int;
// using mpf = mp::number<mp::cpp_dec_float<1024>>;

///////////////////////////////////////////////////////////////
// mod https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
///////////////////////////////////////////////////////////////
// ll MOD = 1000000007;
// ll mod(long long val) {
//     long long res = val % MOD;
//     if (res < 0) res += MOD;
//     return res;
// }
// ll modinv(ll a) {
//     ll b = MOD, u = 1, v = 0;
//     while (b) {
//         ll t = a / b;
//         a -= t * b; swap(a, b);
//         u -= t * v; swap(u, v);
//     }
//     u %= MOD;
//     if (u < 0) u += MOD;
//     return u;
// }

int N;
vector<int> a;
vector<int> dp;

// dp[i]: LIS for the first i elements [v0, ..., v_i-1] using a_i
// int lis() {
//     dp = vector<int>(N + 1, 0);
//     for (int i = 0; i < a.size(); ++i) {
//         dp[i] = 1;
//         for (int j = 0; j < i; ++j)
//             if (a[j] < a[i]) dp[i] = max(dp[i], dp[j] + 1);
//     }
//     return *max_element(dp.begin(), dp.end());
// }

// dp[L]: Minimum element value of subarray whose length is L
// dp[l + 1] = min(dp[l + 1], dp[l] + 1) if dp[l] < a[i]
int lis() {
    dp = vector<int>(N + 1, INT_MAX);
    for (int i = 0; i < a.size(); ++i) *lower_bound(dp.begin(), dp.end(), a[i]) = a[i];
    return lower_bound(dp.begin(), dp.end(), INT_MAX) - dp.begin();
}

int main() {
    cin >> N;
    for (int i = 0; i < N; ++i) {
        int t;
        cin >> t;
        a.push_back(t);
    }
    int ans = lis();
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 3916
#include <iostream>
#include <vector>
#include <stack>

using namespace std;

class UnionFind {
    vector<int> par;
    vector<int> tree_count;

public:
    UnionFind(int N) : par(N), tree_count(N) {
        for(int i = 0; i < N; i++) {
            par[i] = i;
            tree_count[i] = 1;
        }
    }

    int size(int x) {
        return tree_count[root(x)];
    }

    int root(int x) {
        if(par[x] == x) return x;
        //親を探すときに経路上のノードを親にくっつける
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if(rx == ry) return;
        //ryに所属するグループの頂点数を格納(親でなくなった頂点は-1)
        tree_count[ry] += tree_count[rx];
        tree_count[rx] = -1;
        //xの親をyの親の下にくっつける
        par[rx] = ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};


int main() {
    int N, M;
    cin >> N >> M;

    vector<long long> A(M, 0);
    vector<long long> B(M, 0);
    for(int i = 0; i < M; i++) {
        cin >> A[i] >> B[i];
    }

    vector<long long> ret(M, 0);
    UnionFind uf(N);
    long long change = 0;
    ret[M-1] = (long long)N*(N-1)/2;
    for(int i = M - 2; i >= 0; i--) {
        if (!uf.same(A[i+1] - 1, B[i+1] - 1)) 
            change =  (uf.size(A[i+1]-1) * uf.size(B[i+1]-1));
        else 
            change = 0;

        //cout << "change:" << change   << endl;
        
        uf.unite(A[i+1]-1, B[i+1]-1);
        ret[i] = ret[i+1] - change;
        //cout << (uf.size(A[i]-1)) << "," << (uf.size(B[i]-1)) <<endl;

    }
    
    for(int i = 0; i < M; i++) {
        cout << ret[i] << endl;
    }
}

Measured memory_bytes: 4480
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
typedef tuple<ll, ll, ll> T;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x,a,b;
    cin>>x>>a>>b;
    (abs(x-a)<abs(x-b))?cout<<"A":cout<<"B";
    cout<<endl;
}

Measured memory_bytes: 256
import static java.lang.System.*;
import java.util.*;

class Cost {
	int x, c;
	
	Cost(int _x, int _c) {
		x = _x;
		c = _c;
	}
}

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

        int n = sc.nextInt();
		ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();
		for(int i=0; i<n; i++) list.add(new ArrayList<Integer>());
	
		for(int i=0; i<n-1; i++) {
			int a = sc.nextInt() - 1;
			int b = sc.nextInt() - 1;
			list.get(a).add(b);
			list.get(b).add(a);
		}

		boolean[] closed = new boolean[n];
		Arrays.fill(closed, false);
		LinkedList<Cost> open = new LinkedList<Cost>();
		open.add(new Cost(0, 0));
		closed[0] = true;
		int max = 0;
		while(!open.isEmpty()) {
			Cost now = open.poll();
			max = now.x;
			
			for(int nx: list.get(now.x)) {
				if(closed[nx]) continue;
				open.add(new Cost(nx, now.c + 1));
				closed[nx] = true;
			}
		}
		//out.println(max+1);
		
		Arrays.fill(closed, false);
		open.add(new Cost(max, 0));
		closed[max] = true;
		int ans = 0;
		while(!open.isEmpty()) {
			Cost now = open.poll();
			ans = Math.max(ans, now.c);
			//out.println(now.x+1 + " " + now.c);

			for(int nx: list.get(now.x)) {
				if(closed[nx]) continue;
				open.add(new Cost(nx, now.c + 1));
				closed[nx] = true;
			}
		}
		
		//out.println(ans);
        out.println(ans%3==1?"Second":"First");
    }
}


Measured memory_bytes: 186176
#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 FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

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

int main() {
  int n;
  cin >> n;
  vector<ll> t(n);
  rep(i, n) cin >> t[i];

  ll ans = 1;
  rep(i, n) {
    ans = ans / gcd(ans, t[i]) * t[i];
  }
  cout << ans << endl;



  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,k;
  cin >> n >> k;
  if(k%2==0){
    cout << (n/k+n%k/(k/2))*(n/k+n%k/(k/2))*(n/k+n%k/(k/2))+(n/k)*(n/k)*(n/k) << endl;
  }
  else{
    cout << (n/k)*(n/k)*(n/k) << endl;
  }
}

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

int main() {
    int i,c1=0,c2=0,N;
    string S;
    cin >> S;
    N = S.size();

    for(i=0; i<N; i++)
        if(i%2) {
            if(S.at(i) == '0')
                c1++;
            else
                c2++;
        } else {
            if(S.at(i) == '1')
                c1++;
            else
                c2++;
        }

    if(c1 > c2)
        cout << N-c1;
    else
        cout << N-c2;
    cout << endl;
}

Measured memory_bytes: 512
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx,avx2")
#pragma GCC optimize ("trapv")

#include <bits/stdc++.h>
using namespace std;

#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cin.exceptions(cin.failbit);
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (x).size()
#define what_is(x) cerr << #x << " is " << x << endl;
#define wis cout<<endl<<"I already speak english, bitch"<<endl<<endl;
 
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef pair<ii,lli> iii;
typedef long double C; 

#define trace(args...) { string  _s =#args; replace(_s.begin(), _s.end(), ',',' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
void err(istream_iterator<string> it){}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args){
    cerr <<  *it  << " : " << a << endl;
    err(++it, args...);
}

int main(){
	fastio;
	int cont=0;
	string s; cin>>s;
	for(int i=0,j=sz(s)-1;i<sz(s)/2;i++,j--){
		if(s[i]!=s[j]) cont++;
	}
	cout<<cont<<endl;
	return 0;
}

/* 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: 256
#include <iostream>
using namespace std;

int main(int argc, char const* argv[])
{
	int a[3];
	cin >> a[0] >> a[1] >> a[2];

	for (int i=0; i<2; i++) {
		for (int j=0; j<2; j++) {
			if ( a[j] > a[j+1] ) {
				int tmp = a[j+1];
				a[j+1] = a[j];
				a[j] = tmp;
			}
		}
	}

	cout << a[0] << " " << a[1] << " " << a[2] << endl;

	return 0;
}


Measured memory_bytes: 1164
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:512000000")
#include<utility>
#include<iostream>
#include<fstream>
#include<vector>
#include<array>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<functional>
#include<random>
#include<climits>
#include<queue>
#include<stack>
#include<deque>
#include<bitset>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<cassert>
#include<ccomplex>
#include<chrono>

#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#define int128 __int128
#else
#define int128 long long
#endif

#define all(x) x.begin(), x.end()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
#define mp make_pair
#define X first
#define Y second

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937_64 gen(time(nullptr));

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

ll mod = 1e9 + 7;

namespace {
    ll mul(ll a, ll b) {
        ll val = a * b - (ll)((ld)a * b / mod) * mod;
        if (val < 0) val += mod;
        if (val >= mod) val -= mod;
        return val;
    }
    ll poww(ll a, ll b) {
        ll val = 1;
        a %= mod;
        while (b > 0) {
            if (b % 2) val = mul(a, val);
            a = mul(a, a);
            b >>= 1;
        }
        return val % mod;
    }
    ll inv(ll a) {
        return poww(a, mod - 2);
    }
    ll gcd(ll a, ll b) {
        return (a == 0 ? b : gcd(b % a, a));
    }
    ll gcdex(ll a, ll b, ll& x, ll& y) {
        if (a == 0) {
            x = 0; y = 1;
            return b;
        }
        ll x1, y1;
        ll d = gcdex(b % a, a, x1, y1);
        x = y1 - (b / a) * x1;
        y = x1;
        return d;
    }

    ll inv_eu(ll a, ll m) {
        ll x, y;
        ll g = gcdex(a, m, x, y);
        if (g != 1)
            assert(0);
        else {
            x = (x % m + m) % m;
            return x;
        }
    }
}

ll const maxn = 1e6 + 6;

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n; cin >> n;
    ll ans = 0;
    for (ll a = 1; a <= n; a++) {
        ans += (n - 1) / a;
    }

    cout << ans << endl;

    return 0;
}

/*

*/

Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
int n;
double ans=0,x;

int main()
{	int n;
	cin>>n;
	for(int i=1;i<=n;++i)
	{
		cin>>x;
		ans+=(1.0000000000/x);
	}
	ans=1.0000000000/ans;
	cout<<ans<<endl;
	return 0;
}

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

using namespace std;

int main() {
	int H, N;
	cin >> H >> N;
	for(int i = 0; i < N; i++) {
		int A;
		cin >> A;
		if((H -= A) <= 0) {
			cout << "Yes" << '\n';
			return 0;
		}
	}
	cout << "No" << '\n';
}


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

int main(){
  long long int N;
  cin >> N;
  string S[N];
  set<string> st;
  for(long long int i=0; i<N; i++){
    cin >> S[i];
  }
  for(long long int i=0; i<N; i++){
    st.insert(S[i]);
  }
  cout << st.size() << endl;
  // int count=0;
  // int t=0;
  // for(long long int i=0; i<N; i++){
  //   if(S[t]!=S[i]){
  //     if(i>t)count++;
  //     }
  //   }
  // }



  return 0;
}


Measured memory_bytes: 25428
from itertools import permutations
import math

n = int(input())
l = [list(map(int, input().split())) for _ in range(n)]
m = math.factorial(n)
p = list(permutations(l))
d = 0

for i in range(m):
    for j in range(n-1):
        x = p[i][j][0] - p[i][j-1][0]
        y = p[i][j][1] - p[i][j-1][1]
        d += math.sqrt(x**2 + y**2)

print(d/m)

Measured memory_bytes: 13928
#include <stdio.h>

int min(int m, int a)
{
	if (m > a)
		m = a;

	return m;
}

int main(void) {
	int i, j, k, l, num, n;
	int a[200];
	int m[200][200];

	scanf("%d", &num);

	for (i = 0; i < num; i++)
		scanf("%d %d", &a[i], &a[i + 1]);

	for (l = 2; l <= num; l++)
	{
		for (i = 1; i <= num - l + 1; i++)
		{
			j = i + l - 1;
			m[i][j] = 1000000;

			for (k = i; k <= j - 1; k++)
				m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + a[i - 1] * a[k] * a[j]);
		}
	}

	printf("%d\n", m[1][num]);

	return 0;
}


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

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

	int n = 0, ans = 0;
	for (int i = 0; i < s.size(); i++) {
		n %= 4;
		if (s[i] == 'R') {
			n++;
		} else {
			n--;
		}
		if (n == 4) {
			ans++;
			n = 0;
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3208
#include<iostream>
using namespace std;
int main(){
        
        int n;
        cin>>n;
        
        int h[n];
        int i;

        for(i=1;i<=n;i++){
            cin>>h[i];
        }
        for(i=1;i<=n;i++){
            cout<<"node "<<i<<": key = "<<h[i]<<", ";
            if(i/2>=1){
                cout<<"parent key = "<<h[i/2]<<", ";
            }
            if(i*2<=n){
                cout<<"left key = "<<h[i*2]<<", ";
            }   
                if(i*2+1<=n){
                    cout<<"right key = "<<h[i*2+1]<<", ";
                }
                cout<<endl;
        } 
    return 0;
}


Measured memory_bytes: 3016
#include <iostream>
#include <algorithm>
using namespace std;
int n,a[2100000],ans;
int main(void)
{
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        int x;
        cin>>x;
        a[x]++;
    }
    for(int i=1;i<=1000000;i++)
    {
        if(a[i]==1)ans++;
        if(a[i]>0)
        {
            for(int j=i;j<=1000000;j+=i)
            {
                a[j]=0;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 7508
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp make_pair
#define pb push_back
#define mes(a,b) memset(a,b,sizeof(a))
#define mes0(a) memset(a,0,sizeof(a))
#define lson l,mid,pos<<1
#define rson mid+1,r,pos<<1|1
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define fi first
#define se second
#define sss(a) a::iterator
#define all(a) a.begin(),a.end()

using namespace std;

typedef double DB;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<long long ,int> pli;
typedef pair<int,long long > pil;
typedef pair<string,int> psi;
typedef pair<long long ,long long > pll;

const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1);
const int maxn = 100000+10;

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    int T;
    int a,b;
    string s;
    cin>>s;
    cout<<s[0]<<(int)s.length()-2<<s.back();

    return 0;
}


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

#define ll long long
#define ld long double

#define all(x) x.begin(),x.end()

using namespace std;

string s;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>s;
    int n = s.length();
    bool f=0;
    
    if (s[0]==s[n-1]) f=1;
    else f=0;
    
    f=n%2-f;
        
    if (!f) cout<<"Second";
    else cout<<"First";
    
    
    return 0;
}

Measured memory_bytes: 512
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();
    int ans = 0;
    while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0) {
      if (A == B && B == C) {
        System.out.println(-1);
        return;
      }
      int tmpA = A;
      int tmpB = B;
      int tmpC = C;
      ans++;
      A = tmpB / 2 + tmpC / 2;
      B = tmpA / 2 + tmpC / 2;
      C = tmpA / 2 + tmpB / 2; 
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using pq = priority_queue<int>;
template<class T>
using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int under = (1 << 31);
int upper = under - 1;
ll UNDER = (1LL << 63);
ll UPPER = UNDER - 1;
const int MOD = 1e9 + 7;
const long double pi = 3.141592653589793;
struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n) {
		rep(i, n) par[i] = i;
	}
	int root(int x) {
		if (par[x] == x) return x;
		else return par[x] = root(par[x]);
	}
	void unite(int x, int y) {
		int rx = root(x);
		int ry = root(y);
		if (rx == ry) return;
		par[rx] = ry;
	}
	bool same(int x, int y) {
		return root(x) == root(y);
	}
};
int main(){
	UnionFind G(13);
	G.unite(1, 3);
	G.unite(1, 5);
	G.unite(1, 7);
	G.unite(1, 8);
	G.unite(1, 10);
	G.unite(1, 12);
	G.unite(4, 6);
	G.unite(4, 9);
	G.unite(4, 11);
	int a, b;
	cin >> a >> b;
	puts((G.same(a, b)) ? "Yes" : "No");
	return 0;
}

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

int main (){
	int a,b,c,x,y;
	cin>>a>>b>>c>>x>>y;
	ll ans=x*a+y*b,ans1,ans2;
	if(x>=y){
		ans1=y*2*c;
		ans1+=(x-y)*a;
	}
	else {
		ans1=x*2*c;
		ans1+=(y-x)*b;
	}
	ans=min(ans,ans1);
	ans1=max(x,y)*2*c;
	ans=min(ans,ans1);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M (1000000007)
#define N (2510)
struct node{
	int x,y,z;
}g[N<<1];
int n,m,p,dis[N];
bool vis[N][N];
vector<int>G[N];

void dfs(int x,int t){
	vis[t][x]=1;
	for (int i=0;i<G[x].size();i++){
		int y=G[x][i];
		if (!vis[t][y]) dfs(y,t);
	}
}

int bellman_ford(){
	memset(dis,-63,sizeof(dis));
	dis[1]=0;
	for (int i=1;i<=n;i++){
		bool f=0;
		for (int j=1;j<=m;j++)
			if (vis[1][g[j].x]&&vis[g[j].y][n]&&dis[g[j].x]+g[j].z>dis[g[j].y])
				f=1,dis[g[j].y]=dis[g[j].x]+g[j].z;
		if (!f) break;
		if (i==n) return -1;		
	}
	return max(0,dis[n]);
}

int main(){
	scanf("%d%d%d",&n,&m,&p);
	int x,y,z;
	for (int i=1;i<=m;i++){
		scanf("%d%d%d",&x,&y,&z);
		g[i]={x,y,z-p};
		G[x].push_back(y);
	}
	for (int i=1;i<=n;i++) dfs(i,i);
	printf("%d",bellman_ford());
}


Measured memory_bytes: 6656
#include <stdio.h>
int main(){
	int x,y,d,tmp;
	
	scanf("%d %d",&x,&y);
	
	if(x<y){
	    tmp=x;
	    x=y;
	    y=tmp;
	}
	
	while(y>0){
		d=x%y;
		x=y;
		y=d;
	}
	
	printf("%d\n",x);
	
	return 0;
}


Measured memory_bytes: 2124
#define _USE_MATH_DEFINES

#include <cmath>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <limits>
#include <cstring>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <bitset>

using namespace std;

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

const int dx[] = {1, 0, -1, 0, 0};
const int dy[] = {0, 1, 0, -1, 0};

const int Maxn = 100010;

int n, m;

ll sum[Maxn];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        ll a;
        cin >> a;
        sum[i + 1] = (sum[i] + a) % m;
    }

    map<int, int> mp;
    ll ans = 0;
    mp[0] = 1;
    for (int i = 0; i < n; ++i) {
        ans += mp[sum[i + 1]]++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3968
#include <iostream>

int main()
{
    int n;
    int max;
    int min;
    long sum;

    std::cin >> n;

    for (int i = 0; i < n; i++) {
        if (i == 0) {
            int first;
            std::cin >> first;
            max = first;
            min = first;
            sum = first;
        } else {
            int current;
            std::cin >> current;

            if (max < current) {
                max = current;
            }

            if (min > current) {
                min = current;
            }

            sum += current;
        }
    }

    std::cout << min << " " << max << " " << sum << std::endl;
    return 0;




}

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

using namespace std;

typedef long long LL;

const LL N = 1234567;

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

int main()
{

  LL n = read(); LL m=read();
  
  if(n>m) swap(n,m);

  if(n==1 && m==1){printf("1\n"); return 0;}
  else if(n==1){printf("%lld\n",m-2); return 0;}
  else
  {
    printf("%lld\n",(n-2) * (m-2));
  }




  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
template<typename T> auto compare = [](T x, T y) -> bool{return (x < y);};
const int MOD = 1000000007;

signed main(){
    ll N;
    cin >> N;
    ll n = N, ans = 0, cnt = 0, t = 1;
    for(ll i = 2; i * i <= N; i++){
        if(n % i != 0) continue;
        while(n % i == 0){
            n /= i; cnt++;
            if(cnt >= t){
                ans++;
                t++;
                cnt = 0;
            }
        }
        cnt = 0; t = 1;
    }
    if(n > 1) ans++;
    PRINT(ans);
    return 0;
}

Measured memory_bytes: 3636
/**
 *      purpose : ARC 80 D
 *      author  : kyomukyomupurin
 *      created : 2018-11-03 05:19:14
**/

#include <bits/stdc++.h>
using namespace std;
#define int64 long long
#define print(x) cout << (x) << '\n'

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int H, W, N; cin >> H >> W >> N;
    int a[N] = {};
    for (int i = 0; i < N; ++i) cin >> a[i];

    vector<int> v;
    for (int i = 0; i < N; ++i){
        for (int j = 0; j < a[i]; ++j){
            v.push_back(i + 1);
        }
    }

    int beg = 0;
    int ans[H][W] = {};

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            ans[i][j] = v[beg]; ++beg;
        }
    }

    for (int i = 0; i < H; i += 2) {
        reverse(ans[i], ans[i] + W);
    }

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            cout << ans[i][j] << " ";
        }
        cout << '\n';
    }
    
    return 0;
}

Measured memory_bytes: 512
# 解説AC

n, x = map(int, input().split())

# 層数、パティ数をA, Pに格納する
A = [1]
P = [1]
for i in range(n):
    A.append(A[i]*2 + 3)
    P.append(P[i]*2 + 1)

def f(n, x):
    if n == 0:
        if x <= 0:
            return 0
        else:
            return 1
    elif x <= 1 + A[n-1]:
        return f(n-1, x-1)
    else:
        return P[n-1] + 1 + f(n-1, x-2-A[n-1])
print(f(n, x))
    

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD (int)1e9+7
#define EPS 1e-8
#define INF 1e9+10
#define INFL 1e18
typedef long long ll;
using namespace std;
int main()
{
  int N;
  cin >> N;
  int odd=0;
  int evn=0;
  rep(i,N){
      int A;
      cin >> A;
      if(A%2==0){evn++;}
      else{odd++;}
  }
  if(odd%2!=0&&N!=1){
      cout << "NO" << endl;
  }
  else{
      cout << "YES" << endl;
  }
}


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

int main(){
  int n;
  string s;
  cin >> n >> s;
  
  int ans = 0;
  for (int i=0 ; i<n-2 ; i++){
    if (s.at(i) == 'A' && s.at(i+1) == 'B' && s.at(i+2) == 'C')
      ans++;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3588
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
using namespace std;
const int _=1e5+5;
#define ll long long
inline ll read()
{
	char ch='!';ll z=1,num=0;
	while(ch!='-'&&(ch<'0'||ch>'9'))ch=getchar();
	if(ch=='-')z=-1,ch=getchar();
	while(ch<='9'&&ch>='0')num=(num<<3)+(num<<1)+ch-'0',ch=getchar();
	return z*num;
}
ll n,ans;
map<ll,ll>g,vis,line;
int main()
{
	n=read();
	for(int i=1;i<=n;++i)
	{
		ll x=read();
		ll a=1,b=1;
		for(ll j=2;j*j*j<=x;++j)
		{
			int p=0;
			while(x%j==0)x/=j,++p;p%=3;
			if(p)a*=pow(j,p),b*=pow(j,3-p);
		}
		ll m=sqrt(x);
		a*=x;
		if(m*m==x)b*=m;
		else b*=x*x;
		line[a]=b;line[b]=a;g[a]++;
	}
	for(auto x:g)
		if(!vis[x.first]&&x.first!=1)
		{
			ans+=max(x.second,g[line[x.first]]);
			vis[x.first]=vis[line[x.first]]=1;
		}
	printf("%lld\n",ans+(g[1]>0));
	return 0;
}

Measured memory_bytes: 37760
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
    long int d,n,ans;
    cin>>d>>n;
    if(d==0)ans=n;
    else if(d==1)ans=100*n;
    else if(d==2)ans=10000*n;
    if(d==0&&n==100)ans+=1;
    if(d==1&&n==100)ans+=100;
    if(d==2&&n==100)ans+=10000;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)

using namespace std;
using ll = long long;
using P = pair<int,int>;
using ull= unsigned long long;
const ll K_MAX=1e5+5;
const int INF=1e9;


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

  if(n<=k){//すべて必殺技
    cout<<0<<endl;
    return 0;
  }

  int m=n-k;//攻撃する敵数
  
  sort(h.begin(),h.end());
  ll ans=0;

  rep(i,m){
    ans+=h[i];
  }

  cout<<ans<<endl;
}


Measured memory_bytes: 3968
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
typedef long long ll;
using namespace std;
#define int long long
#define mod 1000000007

//素数判定
inline bool IsPrime(int p) {
	if (p == 1) return false;
	for (int i = 2; i <= sqrt(p); i++) {
		if (p%i == 0) return false;
	}
	return true;
}

//10進数の自然数の桁数を返す
inline int GetDigit(int num) {
	return (int)log10(num) + 1;
}

//各位の和を返す
int GetDigitsSum(int num) {
	int N = 0;
	while (num > 0) {
		N += num % 10;
		num /= 10;
	}
	return N;
}

//互除法
ll gcd(ll a, ll b) {
	if (a < b) {
		return gcd(b, a);
	}
	else if (a%b) {
		return gcd(b, a%b);
	}
	else {
		return b;
	}
}

//最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b; // Be careful not to overflow

}

//異なるn個からr個の整数を取り出す組合せの数を求める
int combination(int n, int r) {
	if (r == 0 || n == r) {
		return 1;
	}
	else if (r == 1) {
		return n;
	}
	else {
		return combination(n - 1, r - 1) + combination(n - 1, r);
	}

}

//Ｏ(√n)
//素因数分解
map<int, int> prime_factor(int n) {
	map<int, int> res; // map[i]:=ｎを素因数分解したときiは何乗か。
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) {
				res[i]++;
				n /= i;
			}
		}
	}
	if (n != 1)
		res[n] = 1;
	return res;
}

//Ｏ(√n)
//素因数分解
map<int, int> prime_factor_ver2(int n, map<int, int> res) {
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			while (n % i == 0) {
				res[i]++;
				n /= i;
			}
		}
	}
	if (n != 1)
		res[n]++;
	return res;
}


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

	int N;
	int ans = 1;
	map<int,int> mp;

	cin >> N;

	for (int i = 2; i <= N; i++)
	{
		mp = prime_factor_ver2(i, mp);
	}

	for (int i = 2; i <= N; i++)
	{
		if (mp[i] != 0) {
			ans *= (mp[i] + 1);
			ans %= mod;
		}
	}

	cout << ans << endl;

	return 0;
}


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

using namespace std;
#define DBG(x)                         \
    (void)(cout << "L" << __LINE__     \
                << ": " << #x << " = " \
                << (x) << '\n')

typedef long long ll;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const int maxn = 110000;
int main()
{
    //检查有没有特判0,有没有越界限.
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setiosflags(ios::fixed) << setprecision(12);
    int n;
    cin >> n;
    string s;
    cin >> s;
    int len = n / 2;
    bool ok = 1;
    if (n == 1 || (n % 2 != 0))
    {
        cout << "No\n";
        return 0;
    }
    for (int i = 0; i < len; i++)
    {
        if (s[i] != s[i + len])
        {
            ok = 0;
            break;
        }
    }
    if (ok)
    {
        cout << "Yes\n";
    }
    else
    {
        cout << "No\n";
    }
    return 0;
}

Measured memory_bytes: 3620
/***************************************************
 * Problem Name : C.cpp
 * Problem Link :
 * OJ           :
 * Verdict      : Trying
 * Date         : 2020-01-19
 * Problem Type :
 * Author Name  : Saikat Sharma
 * University   : CSE, MBSTU
 ***************************************************/
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <cstdlib>
#include <deque>
#include <stack>
#include <bitset>
#include <cassert>
#include <map>
#include <set>
#include <cassert>
#include <iomanip>
#include <random>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;

#define __FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define __FileRead freopen ("input.txt", "r", stdin)
#define __FileWrite freopen ("output.txt", "w", stdout)
#define SET(a,v) memset(a,v,sizeof(a))
#define SZ(v) (int)v.size()
#define pii pair<int,int>
#define pil pair <int, ll>
#define pli pair <ll, int>
#define pll pair <ll, ll>
#define debug cout <<"######\n"
#define debug1(x) cout <<"### " << x << " ###\n"
#define debug2(x,y) cout <<"# " << x <<" : "<< y <<" #\n"
#define nl cout << "\n";
#define sp cout << " ";
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define ss(n) scanf("%s", n)
#define pf(n) scanf("%d", n)
#define pfl(n) scanf("%lld", n)
#define all(v) v.begin(), v.end()
#define rall(v) v.begin(), v.end()
#define srt(v) sort(v.begin(), v.end())
#define r_srt(v) sort(v.rbegin(), v.rend())
#define rev(v) reverse(v.begin(), v.end())
#define Sqr(x) ((x)*(x))
#define Mod(x, m) ((((x) % (m)) + (m)) % (m))
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
#define pb push_back
#define mk make_pair
#define MAX 100005
#define INF 1000000009
#define MOD 1000000007

template<class T>
using min_heap = priority_queue<T, std::vector<T>, std::greater<T>>;
template<typename T>
using ordered_set  = tree<T, null_type, less<T>, rb_tree_tag,
      tree_order_statistics_node_update>;

template <typename T> string toString ( T Number ) {
    stringstream ss;
    ss << Number;
    return ss.str();
}
template<typename T> int toInt (T str) {
    stringstream ss;
    ss << str;
    int num;
    ss >> num;
    return num;
}
ll lcm (ll a, ll b) {
    return a * b / __gcd (a, b);
}
/************************************ Code Start Here ******************************************************/
int main () {
    //~ __FastIO;
    //~ cout << setprecision (10);
    //~ cout << fixed;
    int n;
    cin >> n;
    //~ vector<pii>vec;
    int mn = INF;
    int cnt = 0;
    for(int i = 0; i<n; i++){
		int x;
		cin >> x;
		mn = min(mn, x);
		if(x<=mn)cnt++;
	}
	cout << cnt << "\n";
	
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<queue>
using namespace std;

typedef long long ll;

int N,A,B,C;
vector<int>L;

int rec ( int i, int a, int b , int c ) {
  if ( i == N ) {
    if( !a || !b || !c ) return 1e9;
    return abs(a-A)+abs(b-B)+abs(c-C);
  }

  int res = rec(i+1,a,b,c);
  res = min(res,rec(i+1,a+L[i],b,c) + ( a? 10:0));
  res = min(res,rec(i+1,a,b+L[i],c) + ( b? 10:0));
  res = min(res,rec(i+1,a,b,c+L[i]) + ( c? 10:0));

  return res;
}

int main() {
  cin >> N >> A >> B >> C;
  L.resize(N);
  for ( int i = 0; i < N; i++ ) cin >> L[i];

  cout << rec(0,0,0,0) << endl;
  return 0;
}


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

using namespace std;

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb emplace_back
#define ll long long
#define ld long double

const int INF = 2e9 + 1;
const ll INFLL = 1e18 + 1;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int k;
    cin >> k;
    ll ans = 0;
    for (int i = 1; i <= k; i++) {
        for (int j = 1; j <= k; j++) {
            for (int l = 1; l <= k; l++) {
                ans += __gcd(__gcd(i, j), l);
            }
        }
    }
    cout << ans;
    return 0;
}



Measured memory_bytes: 3648
import java.util.*;
public class Main {
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char c = s.charAt(0);
    char ans;
    switch (c) {
      case 'A':
        ans = 'T';
        break;
      case 'C':
        ans = 'G';
        break;
      case 'G':
        ans = 'C';
        break;
      case 'T':
        ans = 'A';
        break;
      default:
        throw new IllegalArgumentException("invalid input");
    }
    
    System.out.println(ans);
  }  
}

Measured memory_bytes: 21460
x1, y1, x2, y2 = map(int, input().split())

x3 = x2 + (y1-y2)
y3 = y2 - (x1-x2)
x4 = x3 + (y2-y3)
y4 = y3 - (x2-x3)

for item in [x3, y3, x4, y4]:
  print(item, end=" ")

Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>

#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

struct Ed {
  int v;
  Ed* next;
};

const int N = 200010;

int n, m;
int prt[N], dep[N];
bool vis[N];
Ed* g[N];

void adde(int u, int v);
void dfs(int u);

int main() {

  scanf("%d%d", &n, &m);
  m += n - 1;
  while (m--) {
    int u, v;
    scanf("%d%d", &u, &v);
    adde(v, u);
  }
  for (int i = 1; i <= n; ++i) {
    dfs(i);
    printf("%d\n", prt[i]);
  }

  return 0;
}

void dfs(int u) {
  if (vis[u])
    return;
  vis[u] = true;
  if (!g[u])
    return;
  pair<int, int> ans = make_pair(-1, 0);
  for (Ed* p = g[u]; p; p = p->next) {
    dfs(p->v);
    ans = max(ans, make_pair(dep[p->v], p->v));
  }
  dep[u] = ans.first + 1;
  prt[u] = ans.second;
}

void adde(int u, int v) {
  static Ed pool[N];
  static Ed* p = pool;
  p->v = v;
  p->next = g[u];
  g[u] = p;
  ++p;
}


Measured memory_bytes: 9088
n,m=map(int,input().split())

def prime_factorize(n):
    n_origin=n+0
    primelist=[]
    a=2
    while a*a<=n_origin:
        if n%a!=0:
            a+=1
            continue
        ex=0
        while n%a==0:
            ex+=1
            n=n//a
        primelist.append([a,ex])
        a+=1
    if n!=1:
        primelist.append([n,1])
    return primelist

#nCkをmodで割ったあまり
#テーブルを作る前処理
mod=10**9+7
fac=[0,1]
finv=[0,1]
inv=[0,1]
nmax=110000
for i in range(2,nmax+1):
    fac.append(fac[i-1]*i%mod)
    inv.append(mod-inv[mod%i]*(mod//i)%mod)
    finv.append(finv[i-1]*inv[i]%mod)
#二項係数計算部分
def combinations_mod(n,k,mod):
    if n<k:
        return 0
    if n<0 or k<0 :
        return 0
    if k==0 :
        return 1
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod
primelist=prime_factorize(m)
ans=1
for pi,bi in primelist:
    ans=(ans*combinations_mod(bi+n-1,n-1,mod))%mod
print(ans)


Measured memory_bytes: 89772
def examC():
    N = LI(); N.sort()
    if N[0]==1:
        if N[1]==1:
            ans = 1
        else:
            ans = max(0,N[1]-2)
    else:
        ans = (N[1]-2)*(N[0]-2)
    print(ans)
    return

def examD():
    N, K = LI()
    ans = 0
    b = K+1
    while(b<=N):
        cur = N//b * (b-K) + max(0,N%b - K+1)
        if cur==N+1:
            cur = N
        ans += cur
        b += 1
#        print(ans)
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examD()

"""

"""

Measured memory_bytes: 3444