akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define all(X) (X).begin(), (X).end()
#define ll long long
#define linf (1ll << 60)

using namespace std;

// -------- FUNCS -------- //
vector<string> SPLIT(string str,char ch){vector<string> res;stringstream ss(str);string s;while(getline(ss, s, ch))res.push_back(s);return res;}
ll STOI(string str,int base){ll res=0;for(auto c:str){res*=base;res+=c-'0';}return res;}
string ITOS(ll val,int base){string res;while(val>0){res+='0'+(val%base);val/=base;}reverse(all(res));return res;}

class DJSet {
public:
    vector<int> upper, size;
	DJSet(int n) {
        upper.resize(n, -1);
        size.resize(n, 1);
	}

	int find(int x) {
		return upper[x] < 0 ? x : (upper[x] = find(upper[x]));
	}

	bool equiv(int x, int y) {
		return find(x) == find(y);
	}

	bool UN(int x, int y) {
		x = find(x);
		y = find(y);
		if (x != y) {
			if (upper[y] < upper[x]) {
				int d = x;
				x = y;
				y = d;
			}
            size[x] += size[y];
			upper[x] += upper[y];
			upper[y] = x;
		}
		return x == y;
	}

	int count() {
		int ct = 0;
		for (auto& u : upper)
			if (u < 0)
				ct++;
		return ct;
	}

    int getSize(int x) {
        return size[find(x)];
    }
};


// -------- Main Code -------- //
void runcase() {
    int N, M;
    cin >> N >> M;

    DJSet uf(N + 5);

    int a, b;
    for (int i=0; i<M; i++) {
        cin >> a >> b;
        uf.UN(a, b);
    } 

    int res = 0;
    for (int i=1; i<=N; i++) {
        res = max(res, uf.getSize(i));
    }

    cout << res << '\n';
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    // int t;
    // cin >> t;
    // while (t-- > 0)
        runcase();
    return 0;
}


Measured memory_bytes: 4792
#include <iostream>
#include <string>
#include <string.h>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <stdio.h>
#include <vector>
#include <time.h>

//     MLE,TLE魔
//↓↓↓↓↓↓↓↓↓↓↓↓
#define int long long
//↑↑↑↑↑↑↑↑↑↑↑↑
//     MLE,TLE魔
#define endre getchar();getchar();return 0
#define moder 1000000007
#define inf 1000000000000000000
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x%mod;
		}
		x = x * x%mod;
		y >>= 1;
	}
	return res;
}
int kai(int x) {
	if (x == 0)return 1;
	return (kai(x - 1)*x) % moder;
}
int comb(int x, int y) {
	return kai(x)*mod_pow(kai(x - y), moder - 2, moder) % moder*mod_pow(kai(y), moder - 2, moder) % moder;
}
struct edge { int to, cost; };
int dx[5] = { 0,1,0,-1 }, dy[5] = { 1,0,-1,0 };
map<int, int>factor(int x) {
	map<int, int>res;
	for (int i = 2; i*i <= x; i++) {
		while (x%i == 0) {
			x /= i;
			res[i]++;
		}
	}
	if (x != 1)res[x]++;
	return res;
}
/*--------Library Zone!--------*/


signed main() {
	int n, m;
	cin >> n >> m;
	cout << (m * 1900 + (n - m) * 100)*(1 << m) << endl;
	endre;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import time
 
START = (int(time.time() * 1000))

import random
import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache

D = int(input().strip())
C = list(map(int,input().split()))
S = [list(map(int, input().split())) for _ in range(D)]

ans = 0
score = 0
last = [[-1] for i in range(26)]
schedule = []

for d in range(D):
  t = random.choice(range(26))
  last[t].append(d)
  score += S[d][t]
  schedule.append(t)

for i in range(26):
  last[i].append(D)
  for k in range(len(last[i])-1):
    g = last[i][k+1]-last[i][k]-1
    score -= C[i]*g*(g+1)//2


while True:
  prev = score
  d,q = random.choice(range(D)),random.choice(range(26))
  p = schedule[d]
  schedule[d] = q
  score -= S[d][p]
  score += S[d][q]
  
  pos = last[p].index(d)
  score -= C[p]*(last[p][pos]-last[p][pos-1])*(last[p][pos+1]-last[p][pos])
  last[p].remove(d)
  
  pos = bisect.bisect(last[q],d)
  score += C[q]*(d-last[q][pos-1])*(last[q][pos]-d)
  bisect.insort(last[q],d)
  t = int(time.time() * 1000)-START
  if score<prev and random.random() > ((2000-t)/2000)**2*0.5:
    score = prev
    bisect.insort(last[p],d)
    last[q].remove(d)
    schedule[d] = p
  if t>1900:
    break
    
for i in schedule:
  print(i+1)

Measured memory_bytes: 83984
N = int(input())
A = list(map(int, input().split()))
for i in range(N//2+1, 0, -1):
  sum = 0
  for o in range(1, (N//i)+1):
    sum += A[i*o-1]
  A[i-1] = sum%2
  
print(A.count(1))
ans = [str(q) for q,w in zip(range(1, N+1), A) if w == 1]
print(" ".join(ans))   

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

corrects = [0] * n
wrongs = [0] * n

for i in range(m):
  p, cw = input().split()
  num = int(p) - 1
  if cw == "AC" and corrects[num] == 0:
    corrects[num] += 1
  if cw == "WA" and corrects[num] == 0:
    wrongs[num] += 1

print(sum(corrects))

wrong_ans = 0
for i in range(n):
  if corrects[i] == 1:
    wrong_ans += wrongs[i]
    
print(wrong_ans)

Measured memory_bytes: 4596
import fractions

N, K = map(int, input().split(" "))
A = list(map(int, input().split(" ")))
A.sort()
diff = 10 ** 9

if max(A) < K:
    print('IMPOSSIBLE')
else:
    gcd = max(A)
    for i in range(N):
        gcd = fractions.gcd(gcd, A[i])

    if K % gcd == 0:
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')

Measured memory_bytes: 84304
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
const int MAX = 510000;
const int MOD =  1000000007;

template <typename T,typename E>
struct SegmentTree{
  typedef function<T(T,T)> F;
  typedef function<T(T,E)> G;
  int n;
  F f;
  G g;
  T d1;
  E d0;
  vector<T> dat;
  SegmentTree(){};
  SegmentTree(int n_,F f,G g,T d1,
	      vector<T> v=vector<T>()):
    f(f),g(g),d1(d1){
    init(n_);
    if(n_==(int)v.size()) build(n_,v);
  }
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    dat.clear();
    dat.resize(2*n-1,d1);
  }
  void build(int n_, vector<T> v){
    for(int i=0;i<n_;i++) dat[i+n-1]=v[i];
    for(int i=n-2;i>=0;i--)
      dat[i]=f(dat[i*2+1],dat[i*2+2]);
  }
  void update(int k,E a){
    k+=n-1;
    dat[k]=g(dat[k],a);
    while(k>0){
      k=(k-1)/2;
      dat[k]=f(dat[k*2+1],dat[k*2+2]);
    }
  }
  inline T query(int a,int b){
    T vl=d1,vr=d1;
    for(int l=a+n,r=b+n;l<r;l>>=1,r>>=1) {
      if(l&1) vl=f(vl,dat[(l++)-1]);
      if(r&1) vr=f(dat[(--r)-1],vr);
    }
    return f(vl,vr);
  }
  
};
     signed main(){
          int al,n,x;
          cin>>al>>n;
     SegmentTree<int,int> r(n+1,
			   [](int a,int b){return a+b;},
			   [](int a,int b){return b;},
			   0),l(n+1,
			   [](int a,int b){return a+b;},
			   [](int a,int b){return b;},
			   0);
                  for(int i=0;i<n;i++){
                       cin>>x;
                       r.update(i,x);
                       l.update(n-1-i,al-x);
                       
                  }
                  int ans=0;
                  for(int i=0;i<n;i++){
                       if(i<n-1-i){
                            ans=max(ans,2*r.query(0,i)+r.query(i,i+1)+2*l.query(n-1-i-(i+1),n-1-i));
                            ans=max(ans,2*l.query(0,i)+l.query(i,i+1)+2*r.query(n-1-i-(i+1),n-1-i));
                       }else{
                             ans=max(ans,2*r.query(i-(n-1-i),i)+r.query(i,i+1)+2*l.query(0,n-1-i));
                            ans=max(ans,2*l.query(i-(n-1-i),i)+l.query(i,i+1)+2*r.query(0,n-1-i));
                       }
                  }
                  cout<<ans<<endl;
                  
}


        


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

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1000000000;
const ll LINF = (ll) 4000000000000000000;
const ll MOD = (ll) 1000000007;
const double PI = acos(1.0);
const int limit = 100010;

#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep2(i,n) REP(i,1,n+1)
#define rep3(i,n) REP(i,0,n+1)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define repll(i,n) REPLL(i,0,n)
#define repll2(i,n) REPLL(i,1,n+1)
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define NP(v) next_permutation(v.begin(),v.end())
#define Size(s) (int) s.size()

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

int grid[2010][2010] = {};

void imos(int x1, int y1, int x2, int y2) {
    grid[x1][y1]++;
    grid[x2 + 1][y2 + 1]++;
    grid[x1][y2 + 1]--;
    grid[x2 + 1][y1]--;
}

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

    rep(i, n) {
        int x, y;
        char c;
        cin >> x >> y >> c;
        if (c == 'W') x += k;
        x %= 2 * k;
        y %= 2 * k;
        if ((x < k && y < k) || (x >= k && y >= k)) {
            if (x >= k) {
                x -= k;
                y -= k;
            }
            imos(0, 0, x, y); //左下
            imos(x + 1, y + 1, x + k, y + k); //中央
            imos(0, y + k + 1, x, 2 * k - 1); //左上
            imos(x + k + 1, 0, 2 * k - 1, y); //右下
            imos(x + k + 1, y + k + 1, 2 * k - 1, 2 * k - 1); //右上
        } else {
            if (y >= k) {
                x += k;
                y -= k;
            }
            imos(x - k + 1, 0, x, y); //下
            imos(0, y + 1, x - k, y + k); //左
            imos(x - k + 1, y + k + 1, x, 2 * k - 1); //上
            imos(x + 1, y + 1, 2 * k - 1, y + k); //右
        }
    }

    rep(i, 2 * k) rep(j, 2 * k - 1) grid[i][j + 1] += grid[i][j];
    rep(i, 2 * k - 1) rep(j, 2 * k) grid[i + 1][j] += grid[i][j];

    int Max = 0;

    rep(i, 2 * k) rep(j, 2 * k) Max = max(Max, grid[i][j]);

    cout << Max << endl;

    return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;
  cout << (n-1) * (m-1) << endl;
  return 0;
}

Measured memory_bytes: 256
A = []
A.push gets.split.map(&:to_i)
A.push gets.split.map(&:to_i)
A.push gets.split.map(&:to_i)
N = gets.to_i
B = []
N.times do
  B.push gets.to_i
end


B.each do |b|
  A.each do |a|
    searched = false
    a.each_with_index do |n, i|
      if n == b
        a[i] = 0
        searched = true
        break
      end
    end
    break if searched
  end

  if A.any?{|a| a.all?{|x| x == 0 }}
    puts 'Yes'
    exit
  end

  3.times do |i|
    if A.all?{|a| a[i] == 0 }
      puts 'Yes'
      exit
    end
  end

  if A[0][0] == 0 && A[1][1] == 0 && A[2][2] == 0
    puts 'Yes'
    exit
  end

  if A[0][2] == 0 &&  A[1][1] == 0 && A[2][0] == 0
    puts 'Yes'
    exit
  end
end
puts 'No'

Measured memory_bytes: 1788
N = int(input())
X = list(map(int, input().split()))
sum_min = 10**8

for i in range(min(X), max(X)+1):
    s = 0
    for j in range(N):
        s += (X[j] - i)**2
    
    if s < sum_min:
        sum_min = s

print(sum_min)

Measured memory_bytes: 9116
import java.util.Scanner;
public class Main{
	int x;
	
	public void solve(){
		Scanner sc = new Scanner(System.in);
		x=sc.nextInt();
		System.out.println(x*x*x);
	}
	
	public static void main(String[] args){
		Main obj = new Main();
		obj.solve();
	}
}

Measured memory_bytes: 17304
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

int main(){
    int ans=0,rem=9;
    for(int i=0; i<5; i++){
        int a;
        cin>>a;
        ans+=(--a/10+1)*10;
        rem=min(rem,a%10);
    }
    cout<<ans-9+rem;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
/************************************************/
#define rep(i,n) for(int i=0;i<n;i++)
#define m_p make_pair
#define pb push_back
#define fr first
#define se second
#define forn(i,a,n) for(int i=a;i<n;i++)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define sz(s) s.size()
#define all(s) s.begin(),s.end()
#define zero(x) memset(x,0,sizeof(x))
#define vii vector<pair<int,int> >
#define mpis map<int,string>
#define mpii map<int,int>
#define mpsi map<string,int>
#define re return
#define mod 1000000007
/************************************************/
using namespace std;

long long get(){
	char c=getchar();
	long long x=0LL;
	while(c<'0'||c>'9')
	c=getchar();
	while(c>='0'&&c<='9'){
		x*=10LL;
		x+=(c-'0');
		c=getchar();
	}
	return x;
}
int n;
int a[200001]; 
bool f[1000001],d[1000001];
int main(){
	ios::sync_with_stdio(0);
	cin>>n;
	rep(i,n)
	cin>>a[i];
	sort(a,a+n);
	int ans=0;
	rep(i,n-1){
		if(a[i]==a[i+1])
		d[a[i]]=true;
	}
	rep(i,n){
		if(f[a[i]])
		continue;
		for(int j=a[i];j<=a[n-1];j+=a[i])
		f[j]=true;
		if(!d[a[i]])
		ans++;
	}
	cout<<ans;
	re 0;
}

Measured memory_bytes: 6276
N = int(input())

Alist = sorted([int(x) for x in input().split(" ")])
if len(Alist) != N:
  print("-1")
  exit()

result = 1
for a in Alist:
  result *= a
  # print(result)
  if result > 10**18:
    print("-1")
    exit()
print(result)


Measured memory_bytes: 21640
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

s = input()
t = input()

cnt = 0
for i in range(len(s)):
    if s[i] != t[i]:
        cnt += 1
print(cnt)

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

int main() {
  
  string str;
  cin >> str;
  
  int q;
  cin >> q;
  
  for (int i=0; i<q; i++) {
      string order;
      cin >> order;
      int a, b;
      cin >> a >> b;
      if ( order == "print") {
          cout << str.substr(a, b-a+1) << endl;
      } else if ( order == "reverse") {
          string x = str.substr(a, b-a+1);
          int s = x.size();
          string y = x;
          for (int j=0; j<s; j++) {
              y.at(j) = x.at(s-j-1);
          }
          str = str.replace(a, b-a+1, y);
      } else if ( order == "replace") {
          string p;
          cin >> p;
          str = str.replace(a, b-a+1, p);
      }
  }
  return 0;
}




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

struct Strongly_Connected_Component {
  int vsize;
  vector<vector<int>> G, reverseG;
  vector<int> vs, cmp;
  vector<bool> used;
  Strongly_Connected_Component(int newv = 1) {
    vsize = newv;
    G.resize(vsize);
    reverseG.resize(vsize);
    used.resize(vsize, 0);
    cmp.resize(vsize);
  }

  bool add(int from, int to) {
    G[from].push_back(to);
    reverseG[to].push_back(from);
    return 1;
  }
  void dfs(int v) {
    used[v] = true;
    int gvsize = G[v].size();
    for(int i = 0; i < gvsize; ++i)
      if(!used[G[v][i]]) dfs(G[v][i]);
    vs.push_back(v);
  }
  void rdfs(int v, int k) {
    used[v] = true;
    cmp[v] = k;
    int rgvsize = reverseG[v].size();
    for(int i = 0; i < rgvsize; ++i)
      if(!used[reverseG[v][i]]) rdfs(reverseG[v][i], k);
  }
  int solve() {
    used.assign(vsize, 0);
    vs.clear();
    for(int v = 0; v < vsize; ++v)
      if(!used[v]) dfs(v);
    used.assign(vsize, 0);
    int k = 0;
    for(int i = (int)vs.size() - 1; i >= 0; --i)
      if(!used[vs[i]]) rdfs(vs[i], k++);
    return k;
  }
  bool issame(int l, int r) { return cmp[l] == cmp[r]; }
};

long long n;
vector<long double> p, afterp;
vector<vector<bool>> a;
Strongly_Connected_Component scc;

long double solve();

int main() {
  cout << fixed << setprecision(10);
  while(1) {
    cin >> n;
    if(n == 0) break;
    p.resize(n);
    scc = Strongly_Connected_Component(n);
    a.assign(n, vector<bool>(n, 0));
    for(int i = 0; i < n; ++i) {
      int m, to;
      cin >> p[i] >> m;
      for(int j = 0; j < m; ++j) {
        cin >> to;
        scc.add(i, --to);
        a[i][to] = 1;
      }
    }
    cout << solve() << endl;
  }
  return 0;
}

long double solve() {
  long double res = 1;
  int apsize = scc.solve();
  afterp.assign(apsize, 1.0);
  for(int i = 0; i < n; ++i) afterp[scc.cmp[i]] *= p[i];
  for(int i = 0; i < apsize; ++i) {
    bool ch = 1;
    for(int j = 0; j < n; ++j)
      if(scc.cmp[j] == i)
        for(int l = 0; l < n; ++l)
          if(scc.cmp[l] != i && a[l][j]) ch = 0;
    if(ch) res *= 1.0 - afterp[i];
  }
  return res;
}


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

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        a[i]-=(i+1);
    }

    sort(a.begin(),a.end());
    ll ref=LONG_LONG_MAX;
    ll opt=a[n/2];
    for(int i = opt-11; i < opt+12; i++) {
        ll ans=0;
        for(int j = 0; j < n; j++) {
            ans+=abs(a[j]-i);
        }
        ans=min(ref,ans);
        ref=ans;
    }

    cout << ref << "\n";
    return 0;
}

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

#define _CRT_SECURE_NO_WARNINGS

#define REP(i, n) for(decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for(decltype(x) i = (x); i < (n); i++)
#define REP3(i, x, n) for(decltype(x) i = (x); i <= (n); i++)
#define RREP(i, n) for (decltype(n) i = (n) - 1; i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

const int INF = 1000000000;
const double PI = 3.1415926535897932384626433832795;

// N, E, S, W
const int dx[4] = { 1, 0, -1, 0};
const int dy[4] = { 0, 1, 0, -1};

using LL = long long int;
using LD = long double;
using pii = pair<int, int>;
using pdd = pair<double, double>;
using pll = pair<LL, LL>;
using vi = vector<int>;
using vd = vector<double>;
using vll = vector<LL>;
using vs = vector<string>;
using vvi = vector<vi>;

//==============================================

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

	string w;
	cin >> w;
	
	int wSz = w.size();
	set<char> wSet;

	REP(i, wSz) {
		wSet.insert(w[i]);
	}

	auto it = wSet.begin();
	REP(i, wSet.size()) {
		int cnt = 0;
		REP(i, wSz) {
			if (*it == w[i]) {
				cnt++;
			}
		}

		if (cnt % 2 != 0) {
			cout << "No" << "\n";
			return 0;
		}
		*it++;
	}

	cout << "Yes" << "\n";
	return 0;
}

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

int main(){
  constexpr int Nalp= 26;
  int H,W;
  cin >> H >> W;

  const int Cap_odd= (H%2==1 && W%2==1) ? 1
                                        : 0;
  const int Cap_2mod4= (H%2==1 && W%2==1) ? (H-1)/2+ (W-1)/2
                      :(H%2==1 && W%2==0) ? W/2
                      :(H%2==0 && W%2==1) ? H/2
                                          : 0;
  vector<int> freq(Nalp);
  string buf;
  for(int i=0; i<H; i++){
    cin >> buf;
    for(auto c:buf){
      freq.at(c-'a')++;
    }
  }

  int cnt_odd= 0;
  int cnt_2mod4= 0;
  for(auto f:freq){
    if(f%2==1){ cnt_odd++; }
    else if(f%4==2){ cnt_2mod4++; }
  }

  string ans= (cnt_odd <= Cap_odd && cnt_2mod4 <= Cap_2mod4) ? "Yes"
                                                             : "No";

  cout << ans << endl;
}

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

int main() {
	int n;
	scanf("%d", &n);
	int arr[n];
	for (int i=0; i<n; i++) scanf("%d", &arr[i]);
	sort(arr, arr+n);
	int hf = (arr[n-1]+1)/2;
	int ans = -1;
	int md = INT_MAX;
	for (int i=0; i<n-1; i++) {
		if (abs(hf-arr[i])<md) {
			md=abs(hf-arr[i]);
			ans=arr[i];
		}
	}
	printf("%d %d\n", arr[n-1], ans);
}


Measured memory_bytes: 640
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    for a in A:
        if a%2 == 0:
            if a%3==0 or a%5==0:
                continue
            else:
                print("DENIED")
                return
    print("APPROVED")

if '__main__' == __name__:
    resolve()

Measured memory_bytes: 61892
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split('/');
        if (int.Parse(input[0]) > 2019
            || (int.Parse(input[1]) > 4
                && int.Parse(input[0]) == 2019)
        )
            Console.WriteLine("TBD");
        else
            Console.WriteLine("Heisei");
        Console.Read();
    }
}


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

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

  double ans = 0, temp;
  int x;

  for (int i = 1; i <= n; i++) {
    temp = 1.0 / n;
    x = i;
    while (x < k) {
      temp *= 0.5;
      x *= 2.0;
    }
    ans += temp;
  }

  printf("%1.12f\n", ans);

  return 0;

}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)

using namespace std;

//????????????
class Point{
  public:
  double x, y;

  Point(double x=0, double y=0): x(x), y(y) {}

  Point operator + (Point p) { return Point(x+p.x, y+p.y); }
  Point operator - (Point p) { return Point(x-p.x, y-p.y); }
  Point operator * (double a) { return Point(a*x, a*y); }
  Point operator / (double a) { return Point(x/a, y/a); }

  double abs() {return sqrt(norm()); }
  double norm() { return x*x+y*y; }

  bool operator < (const Point &p) const{
    return x!=p.x ? x<p.x : y<p.y;
  }

  bool operator == (const Point &p) const{
    return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
  }

};

//(?????¢??????)????????????????????¨????§????????????§??????
typedef Point Vector;

//???????????????
typedef struct Segment{
  Point p1, p2;
}Segment;

//??´??????????§??????????
typedef Segment Line;

//????????????
class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(), double r=0.0): c(c), r(r) {}
};

//????§???¢(???????????¨????????????)
typedef vector<Point> Polygon;


//?????????????????????
double dot(Vector a, Vector b){
  return a.x*b.x+a.y*b.y;
}

//?????????????????????
double cross(Vector a, Vector b){
  return a.x*b.y-a.y*b.x;
}

//??´?????????(????????????????????????0????????´???)
bool isOrthogonal(Vector a, Vector b){
  return equals(dot(a,b), 0.0);
}
bool isOrthogonal(Point a1, Point a2, Point b1, Point b2){
  return isOrthogonal(a1- a2, b1-b2);
}
bool isOrthogonal(Segment s1, Segment s2){
  return equals(dot(s1.p2-s1.p1, s2.p2-s2.p1), 0.0);
}

//????????????(??????????????????????????§?????????0????????????)
bool isParallel(Vector a, Vector b){
  return equals(cross(a,b), 0.0);
}
bool isParallel(Point a1, Point a2, Point b1, Point b2){
  return isParallel(a1- a2, b1-b2);
}
bool isParallel(Segment s1, Segment s2){
  return equals(cross(s1.p2-s1.p1, s2.p2-s2.p1), 0.0);
}

//???????????´??????????°???±
Point project(Segment s, Point p){
  Vector base = s.p2 - s.p1;
  double r = dot(p-s.p1, base) / base.norm();
  return s.p1 + base*r;
}

int main(){
  Point p1, p2;
  cin >> p1.x >> p1.y >> p2.x >> p2.y;

  Segment s;
  s.p1=p1;
  s.p2=p2;

  int q;
  scanf(" %d", &q);
  for(int i=0; i<q; ++i){
    Point p;
    cin >> p.x >> p.y;
    Point ans=project(s, p);
    printf("%.10lf %.10lf\n", ans.x, ans.y);
    //cout << ans.x  << " " << ans.y << endl;
  }

}

Measured memory_bytes: 1276
#include <bits/stdc++.h>
using namespace std;
int main()
{ cin.tie(0);
  ios_base::sync_with_stdio(0);
  for(int i=1;i<=5;i++)
  { int x;
    cin>>x;
    if(x==0)
       cout<<i<<'\n';
  }
  return 0;
}


Measured memory_bytes: 3644
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  int n;
  cin >> n;
  vector<VI> a(n, VI(n));
  vector<VI> dist(n, VI(n));
  REP(i, 0, n) {
    REP(j, 0, n) {
      cin >> a[i][j];
      dist[i][j] = a[i][j];
    }
  }
  REP(k, 0, n) {
    REP(i, 0, n) {
      REP(j, 0, n) {
	dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]);
      }
    }
  }
  if (a != dist) {
    cout << -1 << endl;
    return 0;
  }
  vector<vector<bool> > nec(n, vector<bool>(n, false));
  REP(i, 0, n) {
    REP(j, 0, n) {
      if (i == j) {
	continue;
      }
      // is i-j inexpendable?
      bool ex = false;
      REP(k, 0, n) {
	if (k == i || k == j) { continue; }
	if (a[i][j] == a[i][k] + a[k][j]) {
	  ex = true;
	  break;
	}
      }
      nec[i][j] = not ex;
    }
  }
  ll tot = 0;
  REP(i, 0, n) {
    REP(j, 0, i) {
      tot += nec[i][j] ? a[i][j] : 0;
    }
  }
  cout << tot << endl;
      
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define mod 1000000007
#define pii pair<int,int>
#define pll pair<long long,long long>
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007 //998244353
#define ll long long
#define lli long long int
#define vi vector<int>
#define vll vector<long long>
#define vp vector<pair<long long,long long>>
#define vpp vector<pair<pair<long long,long long>,long long>>
#define mp make_pair
typedef std::numeric_limits< double > dbl;
using namespace std;

int main()
{
	IOS;
	int n;
	cin>>n;
	int d1,d2;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>d1>>d2;
		a[i] = d1-d2;
	}
	int flag=0;
	for(int i=0;i<=n-3;i++)
	{
		if(a[i]==0 && a[i+1]==0 && a[i+2]==0)
		{flag=1;
		break;}
	}
	if(flag)
	cout<<"Yes";
	else
	cout<<"No";
}

Measured memory_bytes: 3664
import java.lang.*;
import java.io.*;
import java.util.*;


public class Main {
	
	public static void main(String[] args) throws java.lang.Exception {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(in, out);
		out.close();
	}
}

class TaskA {
	
	public void solve(InputReader in, PrintWriter out) {
		String s = in.next();
		char c = 'c';
		int ans = 0;
		int len = s.length();
		
		for (int i=0; i<len; ++i) {
			if (s.charAt(i) != c) {
				++ans;
				c = s.charAt(i);
			}
		}
		
		out.println(ans - 1);
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;
	
	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream), 32768);
		tokenizer = null;
	}
	
	public String next() {
		while (tokenizer==null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	
	public int nextInt() {
		return Integer.parseInt(next());
	}
	
	public long nextLong() {
		return Long.parseLong(next());
	}
	
	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 25172
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <numeric>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<((x))<<endl
#define fi first
#define se second

#define INF 2147483600
#define MOD 1000000007
#define long long long

map<long, long> m;

long solve(long n){
  if(m[n]>0) return m[n]%MOD;
  else return m[n] = (solve(n/2)+solve((n-1)/2)+solve((n-2)/2))%MOD;
}

int main(){
  m[0]=1;
  m[1]=2;
  long n;
  cin>>n;

  cout << solve(n)%MOD << endl;

  return 0;
}


Measured memory_bytes: 256
gets
l=gets.split.map{|c|[c.to_i]}
i=0
l.sort.map{|a|a[0]=i+=1}
b=[s=0]*(1+r=l.size)
l.reverse_each{|n,|i=n;(s+=b[i];i&=i-1)while i>0;(b[n]+=1;n+=n&-n)until n>r}
p s

Measured memory_bytes: 32620
import math,sys,bisect,heapq
from collections import defaultdict,Counter,deque
from itertools import groupby,accumulate
#sys.setrecursionlimit(200000000)
int1 = lambda x: int(x) - 1
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda: map(int,input().split())
alele = lambda: list(map(int, input().split()))
ilelec = lambda: map(int1,input().split())
alelec = lambda: list(map(int1, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
MOD = 1000000000 + 7
def Y(c):  print(["NO","YES"][c])
def y(c):  print(["no","yes"][c])
def Yy(c):  print(["No","Yes"][c])

maxi= 1
first = 1 #if first node is 1
G = defaultdict(list)
def addEdge(a,b):
    G[a].append(b)
    G[b].append(a)

def DFSutil(node,vis):
    global maxi
    stack = deque()
    stack.append(node)
    c=0
    while len(stack) != 0:
        s = stack.pop()
        if not vis[s]:
            vis[s] = True
            c+=1
        for i in G[s]:
            if vis[i] == False:
                stack.append(i)
    maxi = max(maxi,c)
        
    
def countconnectedcompo(first,N):
    vis =[False for i in range(N+first)]
    count = 0
    for i in range(first,N+first):
        #do dfs for all the unvisited node after each dfs
        if vis[i] == False:
            DFSutil(i,vis)
            count+=1
    return count

N,M =ilele()
for i in range(M):
    u,v = ilele()
    addEdge(u,v)
countconnectedcompo(first,N) # N is the total no of nodes
print(maxi)

Measured memory_bytes: 150560
#include <bits/stdc++.h>
#define ll long long
#define lld float
#define MOD 1000000007
#define CAP 10000000
#define inf 1000000000000000000LL
#define pii pair<ll,ll>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define all(v)    v.begin(),v.end()
#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
ll power(ll x,ll y, ll md=MOD){ll res = 1;x%=md;while(y>0){if(y&1)res = (res*x)%md;x = (x*x)%md;y = y>>1;}return res%md;}
#define dbg(x) cout <<#x<<":"<<x<<endl;
ll max1(ll a, ll b, ll c=-inf, ll d=-inf) {ll mx1=(a>b)?a:b, mx2=(c>d)?c:d; return ((mx1>mx2)?mx1:mx2);}
#define int ll

struct node {
	vector<int> v,w;
	lld len;
	lld lenEx;
};

bool cmp(pii a, pii b) {
	return a.f - a.s > b.f - b.s;
}

node nodes[601];
int n,m;

set<pii> candidates;

void dfs(int index) {
	if(nodes[index].len >= 0) return;

	if(index==n-1) {
		nodes[index].len = 0;
		nodes[index].lenEx = 0;
		return;
	}

	lld ans = 0;
	int len = nodes[index].v.size();

	lld mx = -inf;
	int mnx = -1;

	for(int i=0;i<len;i++) {
		dfs(nodes[index].v[i]);

		if(mx < nodes[nodes[index].v[i]].len) {
			mx = nodes[nodes[index].v[i]].len;
			mnx = i;
		}
		ans += (nodes[nodes[index].v[i]].len);
	}

	candidates.insert({index, nodes[index].v[mnx]});

	ans /= 1.0*len;
	ans += 1.0;

	nodes[index].len = ans;
}

pii cur;

void dfs1(int index) {
	if(nodes[index].len >= 0) return;

	if(index==n-1) {
		nodes[index].len = 0;
		nodes[index].lenEx = 0;
		return;
	}

	lld ans = 0;
	int len = nodes[index].v.size();

	int off = 0;

	for(int i=0;i<len;i++) {
		dfs1(nodes[index].v[i]);

		if(index==cur.f && nodes[index].v[i]==cur.s) off++;
		else ans += (nodes[nodes[index].v[i]].len);
	}

	if(len-off==0) ans = inf;
	else ans /= 1.0*(len-off);

	ans += 1.0;

	nodes[index].len = ans;
}

signed main() {
	fast;

	cin>>n>>m;

	for(int i=0;i<n;i++) nodes[i].len = nodes[i].lenEx = -1;

	for(int i=0;i<m;i++) {
		int u,v;
		cin>>u>>v;
		u--;
		v--;
		nodes[u].v.pb(v);
	}

	dfs(0);
	lld ans = nodes[0].len;

	for(auto x: candidates) {
		cur = x;
		for(int i=0;i<n;i++) nodes[i].len = -1;

		dfs1(0);
		ans = min(ans, nodes[0].len);
	}

	cout<<std::fixed<<std::setprecision(6)<<ans<<endl;


}

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

int main(){
        int a,b;
        cin>>a>>b;

        if(a>=13) {
                cout<<b<<endl;
        }else if(a>=6) {
                cout<<b/2<<endl;
        }else{
                cout<<0<<endl;
        }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;                        // 任意長整数型
using Real = mp::number<mp::cpp_dec_float<1024>>;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)

using namespace std;
using ll = long long;
const long double eps = 1e-14;



ll ncr(ll n, ll r) {
   Bint res = 1;
   for (int i = n - r + 1; i <= n; i++) res *= i;
   for (int i = 1; i <= r; i++) res /= i;
   return (ll)res;
}

int main()
{

    int n, a, b;
    cin >> n >> a >> b;
    vector<ll> cost(n);
    map<ll,int, greater<ll>> mp;
    for(int i = 0; i < n; i++){
        cin >> cost[i];
        mp[cost[i]]++;
    }
    sort(cost.begin(), cost.end(), greater<ll>());

    long double ave = 0;
    for(int i = a; i <= b; i++){
        ll sum = 0;
        for(int j = 0; j < i; j++)sum += cost[j];
        ave = max(ave, (long double)sum / i);
    }
    cout << fixed <<setprecision(12) << ave << endl;
    ll res = 0;
    for(int i = a; i <= b; i++){
        ll sum = 0;
        for(int j = 0; j < i; j++)sum += cost[j];
        if(sum != ll(ave * i + eps))continue;
        ll ans = 0;
        int k = i;
        for(auto j : mp){
            if(k - j.second > 0){
                k -= j.second;
            }else{
                ans = ncr(j.second, k);
                break;
            }
        }
        res += ans;
    }
    cout << res << endl;


}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#define ll long long
using namespace std;
int main(){
    ll w,h,x,y;
    cin>>w>>h>>x>>y;
    double s=w*h/2.0;
    bool a=(x*2==w);
    bool b=(y*2==h);
    int ans=0;
    if(a&b){
        ans=1;
    }else{
        ans=0;
    }
    cout<<s<<" "<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <cstdlib>

using namespace std;
typedef long long int ll;

bool debug;
#define show(x) if (debug) {cout << "" # x << " = " << x << endl;}
#define rep(x, a, b) for (int x = a; x < b; x++)

int main(int argc, char **argv)
{
  (void)argv; debug = argc > 1;

  show(debug);

  int n;
  cin >> n;

  show(n);

  ll l = 0, r = 20000000;

  while (r - l > 1) {
    show(r);
    show(l);
    ll m = (l + r) / 2;
    if (m * (m + 1) / 2 <= n) {
      l = m;
    } else {
      r = m;
    }
  }

  ll sum = l * (l + 1) / 2;
  
  rep (i, 0, l) {
    cout << l - i + ((i < n - sum) ? 1 : 0) << endl;
  }

  return 0;
}


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

using namespace std ;

int where (char c) {
	return c - 'a' ; 
}

int main(int argc, char const *argv[])
{
	// freopen ("input", "r", stdin) ; 
	// freopen ("output", "w", stdout) ; 
	string s ; 
	cin >> s ;
	s = "?" + s ; 
	int n = s.size() - 1 ;
	vector < vector <int> > nxt (n + 5, vector <int> (27)); 
	for (char c = 'a' ; c <= 'z' ; ++ c) {
		nxt [n + 1][where(c)] = n + 1 ; 
	}
	for (int i = n ; i >= 1 ; -- i) {
		for (char c = 'a' ; c <= 'z' ; ++ c) {
			nxt [i][where(c)] = nxt [i + 1][where(c)] ; 
		}
		nxt [i][where(s[i])] = i ; 
	}
	vector <int> dp (n + 5, 0) ; 
	dp [n + 1] = 1 ; 
	for (int i = n ; i >= 1 ; -- i) {
		dp [i] = 1 << 30 ;
		for (char c = 'a' ; c <= 'z' ; ++ c) {
			dp [i] = min (dp [i], dp [nxt [i][where(c)] + 1] + 1) ; 
		}
	}
	// return 0 ; 
	string sol = "" ; 
	for (int i = 1 ; i <= n ; ) {
		for (char c = 'a' ; c <= 'z' ; ++ c) {
			if (dp [i] == dp [nxt [i][where(c)] + 1] + 1) {
				i = nxt [i][where(c)] + 1 ;
				sol += c ;  
				break ; 
			}
		}
	}
	cout << sol ; 
	return 0;
}

Measured memory_bytes: 30912
#include <bits/stdc++.h>
 
using namespace std;
 
const int MOD=1e9+7;
const double PI=3.14159265359;


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int a,b;
    cin>>a>>b;
    
    string s="x";
    if(a+b==15) s="+";
    else if(a*b==15) s="*";
    
    
    cout<<s;
   
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, x, n) for (int i = x; i < (n); i++)
#define all(n) begin(n), end(n)
struct cww
{
    cww()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
} star;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<char> vchar;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
vll div(ll N)
{
    vll yakusuu;
    for (ll i = 1; i * i <= N; i++)
    {
        if (N % i == 0)
        {
            yakusuu.push_back(i);
            if (i * i != N)
                yakusuu.push_back(N / i);
        }
    }
    return yakusuu;
}

int main()
{
    int N, K;
    cin >> N >> K;
    vll A(N);
    ll sum = 0;
    for (size_t i = 0; i < N; i++)
    {
        cin >> A[i];
        sum += A[i];
    }
    int ans = 0;
    auto fac = div(sum);
    for (int &&f : fac)
    {
        vint res(N);
        for (size_t i = 0; i < N; i++)
        {
            res[i] = A[i] % f;
        }
        sort(all(res));
        ll l = 0, r = N - 1, cnt = 0;
        while (l < r)
        {
            int t = min(res[l], f - res[r]);
            cnt += t;
            res[l] -= t;
            res[r] = (res[r]+t)%f;
            if (res[l] == 0)
            {
                l++;
            }
            if (res[r] == 0)
            {
                r--;
            }
        }
        if (cnt <= K)
        {
            chmax(ans, f);
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
s = list(input())

count = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == 'R' or s[i] == 'U' or s[i] == 'D':
            count += 1
        else:
            break
    else:
        if s[i] == 'L' or s[i] == 'U' or s[i] == 'D':
            count += 1
        else:
            break

if count == len(s):
    print('Yes')
else:
    print('No')

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

// See debug.cc for usage etc
#define DEBUG 0

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#if DEBUG
  #define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
  #define DCALL(func, ...) func(__VA_ARGS__)
#else
  #define DLOG(...)
  #define DCALL(func, ...)
#endif

ll MOD = 1e9 + 7;

// g = eGCD(a, b, s, t)  --->  sa + tb = g
constexpr ll eGCD(ll a, ll b, ll& s, ll& t) {
  if (a == 0) {
    s = 0;
    t = 1;
    return b;
  }
  ll u = 0;
  ll g = eGCD(b % a, a, t, u);
  s = u - (b / a) * t;
  return g;
}

constexpr ll gcd(ll a, ll b) {
  ll dummy1 = 0;
  ll dummy2 = 0;
  return eGCD(a, b, dummy1, dummy2);
}

struct Fp {
  ll val;

  Fp(ll t = 0) :
    val(t < 0 ? MOD + t % MOD : t >= MOD ? t % MOD : t) {}

  Fp& operator +=(const Fp& t) {
    val += t.val;
    if (val > MOD) val -= MOD;
    return *this;
  }

  Fp& operator -=(const Fp& t) {
    val -= t.val;
    if (val < 0) val += MOD;
    return *this;
  }

  Fp& operator *=(const Fp& t) {
    val = (val * t.val) % MOD;
    return *this;
  }

  Fp inv() const {
    if (val == 0) {
      cerr << "inv() is called for zero." << endl;
      exit(1);
    }
    ll u = 0;
    ll v = 0;
    eGCD(val, MOD, u, v);
    return Fp(u);
  }

  Fp& operator /=(const Fp& t) {
    return (*this) *= t.inv();
  }

  Fp operator +(const Fp& t) const { return Fp(val) += t; }
  Fp operator -(const Fp& t) const { return Fp(val) -= t; }
  Fp operator *(const Fp& t) const { return Fp(val) *= t; }
  Fp operator /(const Fp& t) const { return Fp(val) /= t; }
  Fp operator -() const { return Fp(-val); }

  bool operator ==(const Fp& t) const { return val == t.val; }
  bool operator !=(const Fp& t) const { return val != t.val; }
  
  operator ll() const { return val; }

};

ll N, K;
vector<vector<Fp>> vecA;
vector<vector<Fp>> vecB;

int main() {
#if !DEBUG
  ios_base::sync_with_stdio(false);
#endif
  cout << setprecision(20);

  cin >> N >> K;
  ll rB = sqrt(N);
  ll rA = N / rB;

  vecA.resize(K+2);
  vecB.resize(K+2);
  for (ll k = 0; k <= K+1; k++) {
    vecA.at(k).resize(rA + 1);
    vecB.at(k).resize(rB);
  }
  vecA.at(0).at(1) = 1;
  for (ll k = 1; k <= K+1; k++) {
    vector<Fp> sumA(rA + 1);
    vector<Fp> sumB(rB + 1);
    for (ll i = 1; i <= rA; i++) {
      sumA.at(i) = sumA.at(i-1) + vecA.at(k-1).at(i);
    }
    for (ll i = rB-1; i >= 1; i--) {
      sumB.at(i) = sumB.at(i+1) + vecB.at(k-1).at(i);
    }
    for (ll i = 1; i <= rA; i++) {
      vecA.at(k).at(i) = sumA.at(min(N / i, rA)) + sumB.at(min(rB, i));
    }
    for (ll i = 1; i < rB; i++) {
      vecB.at(k).at(i) = sumA.at(i) * Fp((N / i) - (N / (i+1)));
    }
  }
  cout << vecA.at(K+1).at(1) << endl;

  return 0;
}



Measured memory_bytes: 51408
#include<bits/stdc++.h>
using namespace std;
#define mod (int) 998244353
#define MOD (int) 1e9+7
#define X 1001100011100001111ll
#define all(a) a.begin(),a.end()
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define loop(i,a,b) for (int i = a; i < b; i++)
#define bloop(i,a,b) for (int i = a ; i>=b;i--)
#define tc(t) int t; cin >> t; while (t--)
#define int long long
#define ll long long
#define pb emplace_back
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define in(x) scanf("%d", &x)
#define rr return 0
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define inf (int)(1e18)
#define ini(a, i) memset(a, i, sizeof(a))
#define vi vector<int>
#define fi first
#define se second
#define endl "\n"
#define ii pair<int, int>
#define vii vector<ii>
#define sz(s) s.size()
#define bits(n) __builtin_popcount(n)
#define mx 10000
const int MAXN = (int)((1e5) + 100);
int cuberoot(int x)
{
    int lo = 1, hi = min(2000000ll, x);
    while (hi - lo > 1)
    {
        int mid = (lo + hi) / 2;
        if (mid * mid * mid < x)
        {
            lo = mid;
        }
        else hi = mid;
    }
    if (hi * hi * hi <= x) return hi;
    else return lo;
}
const int dx[4] = { -1, 1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
int XX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int YY[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int N =  (int)(1 * 1e6 + 10);
bool comp(pair<int, pair<int, int>> p1, pair<int, pair<int, int>> p2)
{
    if (p1.fi > p2.first) return true;
    else if (p1.se == p2.se)
    {
        if (p1.se.fi < p2.se.fi) return true;
    }
    return false;
}

long long  fact(long long n);

long long  ncr(long long  n,long long  r)
{
    return fact(n) / (fact(r) * fact(n - r));
}

long long  fact(long long  n)
{
    long long  res = 1;
    for (long long  i = 2; i <= n; i++)
        res = res * i;
    return res%1000000007;
}

const long long  a = 1000000000;

long long  nCr(long long  n,long long  r)
{
    long long  fac1 = 1,fac2=1,fac;
    for(long long  i=r; i>=1; i--,n--)
    {
        fac1 = fac1 * n;
        if(fac1%i==0)
            fac1 = fac1/i;
        else
            fac2 = fac2 * i;
    }
    fac = fac1/fac2;
    return fac%a;
}



const long long m=1000000007;

int tree[mx];


void build(int node,int tl,int tr,int arr[])
{
    if(tr==tl)
    {
        tree[node]=arr[tl];
        return;
    }
    int mid=(tr+tl)/2;

    build(2*node,tl,mid,arr);
    build(2*node+1,mid+1,tr,arr);

    tree[node]=tree[2*node]+tree[2*node+1];
}

int query_sum(int node,int tl,int tr,int l,int r)
{
    if(l>tr || r<tl)
        return 0;

    if(tl>=l && tr<=r)
        return tree[node];


    int mid=(tl+tr)/2;

    int p1=query_sum(2*node,tl,mid,l,r);
    int p2=query_sum(2*node+1,mid+1,tr,l,r);

    return p1+p2;
}

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

int lcm(int a, int b)
{
    return (a*b)/gcd(a, b);
}

signed main()
{

    long long n;
    cin>>n;

     if(n>=30)
     cout<<"Yes"<<endl;
     else
     cout<<"No"<<endl;
}




Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }

#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Vec2(T, n, m, xs, x0) vector<vector<T>> xs(n, vector<T>(m, x0))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(string, s);
    
    int ans = (int)s.size();
    for(char c = 'a'; c <= 'z'; c ++){
        int a = 0, l = 0;
        For(i, (int)s.size()){
            if(s[i] == c){
                a = max(a, l);
                l = 0;
            }
            else l ++;
        }
        a = max(a, l);
        ans = min(ans, a);
        // Cout(c, " ", a);
    }
    Cout(ans);
}


Measured memory_bytes: 256