akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
int main(){
    int H,W,i,j;
    while(true){
        std::cin >> H >> W;
        if(H==0 && W==0) break;
        for(i = 0; i< H ; i++){
            for(j=0;j<W;j++){
               if(i==0||i==H-1||j ==0||j==W-1) std::cout << "#";
               else std::cout << ".";
            }
            std::cout << std::endl;
        }
        std::cout  << std::endl;
    }
    return 0;
}


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

using namespace std;

#define ff              first
#define ss              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void sb()
{	
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}


int main()
{
	
	ll d,t,s;
	cin>>d>>t>>s;


	if((d+s-1)/s<=t)
		cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	
}

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

int dp[55][55][2550];

signed main() {
    int n,a;
    cin >> n >> a;

    vector<int> x(n);
    rep(i,n) cin >> x[i];

    memset(dp,0,sizeof(dp));
    dp[0][0][0] = 1;

    for(int i = 0; i <= n; i++){
        for(int k = 0; k <= 50; k++){
            for(int s = 0; s <= 2500; s++){
                dp[i + 1][k][s] += dp[i][k][s];
                dp[i + 1][k + 1][s + x[i]] += dp[i][k][s];
            }
        }
    }

    int ans = 0;
    for(int k = 0; k <= 50; k++){
        ans += dp[n][k][k * a];
    }
    cout << ans - 1 << endl;
}

Measured memory_bytes: 60544
#include <iostream>
#include <set>
#include <numeric>
#include <iterator>

#define u unsigned
#define s short
#define ll long long
#define REP(i, a, b) for (auto i = (a); i < (b); i++)
#define REPR(i, a, b) for (auto i = (a-1); i >= (b); i--)

using namespace std;

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

    multiset<int> p;

    REP(i, 0, N)
    {
        int x;
        cin >> x;

        p.insert(x);
    }

    cout << accumulate(p.begin(), next(p.begin(), K), 0) << "\n";

}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, n+1)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define rwhole(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define P pair<int, int>
#define debug(var) cerr << "[" << #var << "] " << var << '\n'
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define pr(s) cout << (s) << '\n'
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
const int INF = 1001001001;
const ll INFll = 1E+18;



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<pair<P, int>> v(n);
    rep(i, n) {
        cin >> v[i].fi.fi >> v[i].fi.se;
        v[i].se = i;
    }
    sort(whole(v));
    dsu u(n);
    set<P> sx;
    
    rep(i, n) {
        auto it = sx.lower_bound(P(v[i].fi.se, 0));
        if (it!=sx.begin()) {
            it--;
            while (1) {
                u.merge(v[i].se, it->se);
                if (it==sx.begin()) break;
                sx.erase(it--);
            }
        }
        else sx.insert(P(v[i].fi.se, v[i].se));
    }
    /*
    set<P> sy;
    auto comp = [](pair<P, int> a, pair<P, int> b) {
        return a.fi.se < b.fi.se;
    };
    
    sort(whole(v), comp);
    rep(i, n) {
        auto it = sy.lower_bound(P(v[i].fi.fi, 0));
        if (it!=sy.begin()) {
            it--;
            u.merge(v[i].se, it->se);
            //debug(i); debug(it->se);
        }
        sy.insert(P(v[i].fi.fi, v[i].se));
    }
    */
    
    
    vector<int> ans(n);
    rep(i, n) {
        ans[i] = u.size(i);
    }
    
    
    rep(i, n) pr(ans[i]);
    return 0;
}


Measured memory_bytes: 11124
#include <iostream>
#include <cstdio>
 
using namespace std;
 
int main()
{
  for(int i=1;i<=9;i++){
    for(int j=1;j<=9;j++){
      printf("%dx%d=%d\n",i,j,i*j);
    }
  }
  return 0;
}

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

typedef long long ll;

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

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

    vector<int> pre_gcd(n + 1), suf_gcd(n + 1);

    for(int i = 1; i <= n; i++) {
        pre_gcd[i] = __gcd(pre_gcd[i - 1], a[i - 1]);
    }

//    for(auto it : pre_gcd) {
//        cout << it << " ";
//    }
//    cout << endl;

    for(int i = n; i >= 1; i--) {
        suf_gcd[i - 1] = __gcd(suf_gcd[i], a[i - 1]);
    }

//    for(auto it : suf_gcd) {
//        cout << it << " ";
//    }
//    cout << endl;

    int ans = 0;
    for(int i = 0; i + 1 < pre_gcd.size(); i++) {
        ans = max( ans, __gcd(pre_gcd[i], suf_gcd[i + 1]) );
    }

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

/**
5
12 6 3 4 10
*/


Measured memory_bytes: 1408
#include<iostream>
#include<queue>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
/****************************/
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define qi queue<int>
#define mii map<int,int>
#define msi map<string,int>
#define vs vector<string>
#define vc vector<char>
/****************************/
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rep3(i,a,n) for(ll i=(a);i<(n);i++)
#define rep4(i,a,n) for(ll i=(a)-1;i>=n;i--)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define pi 3.1415926535897932384626433832795
#define zero(n) memset(n,0,sizeof(n));
#define SZ(n) n.size()
#define sn st.nd 
ll dx[4]={0,-1,0,1};
ll dy[4]={1,0,-1,0};
/****************************/
int n;
ll a[200010];
ll ans=0;
int main()
{
	cin>>n;
	rep(i,n)
	{
		cin>>a[i];
	}
	ll last=a[0];
	rep3(i,1,n)
	{
		if(last>a[i])
		{
			ans+=last-a[i];
			a[i]=last;
		}
		last=a[i];
	}
	cout<<ans;
	return 0;
}

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

int main(){
    vector<int> a(3);
    rep(i,3){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    int b = a[2]-a[1];
    int c = a[1]-a[0];
    if(c%2){
        cout << b + c/2 + 2<<endl;
    }else{
        cout << b+c/2 << endl;
    }
    
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin>>k;
    cout<<a[k-1]<<endl;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstdlib>
#include <tuple>
#include <queue>
#include <functional>
#include <stack>
#include <numeric>
#include <cassert>
#include <sstream>

using namespace std;

class agc020_b {
public:
    void solve(istream& in, ostream& out) {
        int K;
        in >> K;
        vector<int> A(K);
        for (int i = 0; i < K; ++i) {
            in >> A[i];
        }
        long long res = 2, res1 = 2;
        for (int i = K - 1; i >= 0; --i) {
            long long x = (res + A[i] - 1) / A[i] * A[i];
            long long y = res1 / A[i] * A[i];
            res = x;
            res1 = y + A[i] - 1;
        }
        if (res > res1) {
            out << -1 << "\n";
        } else {
            out << res << " " << res1 << "\n";
        }
    }
};


int main() {
	std::ios::sync_with_stdio(false); cin.tie(nullptr);
	agc020_b solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>

inline char transform(char x) {
	if(x == 'b') return 'd';
	if(x == 'd') return 'b';
	if(x == 'q') return 'p';
	if(x == 'p') return 'q';
	return 0;
}

char s[1000005];
int main(int argc, char** args) {
	scanf("%s", s);
	int len = strlen(s) - 1;
 	for(int i = 0;s[i];i++) {
		if(transform(s[i]) != s[len - i]) {
			return printf("No\n"), 0;
		}
	}
	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 256
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,b) for(ll i=(b)-1; i>=a; --i)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define scanv(n,v) v.resize(n); rep(i,n){ cin>>v[i];}
#define MOD 1000000007ll
#define Yes(flag) cout<<((flag)? "Yes":"No");
#define YES(flag) cout<<((flag)? "YES":"NO");
#define be begin
#define pb push_back
#define fi first
#define se second
#define square(x) x*x
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
template<class T>T 
chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>T 
chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
//------------------------------------------------------
char a,b,x;
vector<ll>v;
void input(){
    cin>>a;
}
void src(){
    cout<<(char)(a+1);
}    
int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
  int n,m;
  long  h[200000];
  int a[200000];
  int b[200000];
  int flag[200000]={0};
  int count=0;


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

  for(long i=1;i<=n;i++){
    scanf("%ld",&h[i]);
  }


  for(long i=1;i<=m;i++){
    scanf("%d %d",&a[i],&b[i]);
  }


  for(int i=1;i<=m;i++){
    if(h[a[i]]>h[b[i]]){
      flag[b[i]]=1;
      //flag[a[i]]=0;
    }else if(h[a[i]]<h[b[i]]){
      flag[a[i]]=1;
      //flag[b[i]]=0;
    }else{
      flag[a[i]]=1;
      flag[b[i]]=1;
    }
  }


  for(long i=1;i<=n;i++){
    if(flag[i]==0){
      count++;
    }
  }


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

  return 0;
}


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


using namespace std;

using ll   = long long;
using ii   = pair   < int , int >;
using i3   = pair   < int , ii  >;
using li   = pair   < ll  , int >;
using lii  = pair   < ll  , ii  >;
using pll  = pair   < ll  , ll  >;
using vi   = vector < int       >;
using vl   = vector < ll        >;
using vii  = vector < ii        >;
using vli  = vector < li        >;
using vpll = vector < pll       >;
using vi3  = vector < i3        >;
using vlii = vector < lii       >;


const int N = 2e5 + 5;
const ll INF = 1e17 + 7;
const double eps = 1e-9 , PI = acos(-1);



ll n , m;


void solve(int testCase){

    scanf("%lld %lld" , &n , &m);
    printf("%lld\n" , (n*m) / __gcd(n , m));

}

main(){

    int t = 1;
    // scanf("%d" , &t);

    for(int testCase = 1 ; testCase <= t ; testCase ++){
            solve(testCase);
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
constexpr ll mod = 1e9 + 7;
#define endl '\n'
 
int main() {
  ios::sync_with_stdio(0); cin.tie(0);
 
  ll A,B,C,K;
  cin >> A >> B >> C >> K;
  ll ans = min(K,A);
  K -= ans;
  if (!K) {
    cout << ans << endl;
    return 0;
  }
  ll b = min(K,B);
  K -= b;
  if (!K) {
    cout << ans << endl;
    return 0;
  }
  cout << ans - min(K,C) << endl;
}


Measured memory_bytes: 3592
#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
long long n,k,ans;
int a[60];
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
     cin>>n>>k;
     for(int i=1;i<=n;i++)
     {
        cin>>a[i];
     }
     sort(a+1,a+n+1,cmp);
     for(int i=1;i<=k;i++)
     {
        ans=ans+a[i];
     }
     cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
n, q = [int(item) for item in input().split()]
ball = [0] * n
ball[0] = 1
ball[1] = 1
place = 0
for i in range(q):
    a, b = [int(item) - 1 for item in input().split()]
    if a == place:
        place = b
    elif b == place:
        place = a
    ball[a], ball[b] = ball[b], ball[a]
    if place - 1 >= 0:
        ball[place - 1] = 1
    if place + 1 < n:
        ball[place + 1] = 1
print(sum(ball))

Measured memory_bytes: 3828
import numpy as np

N = int(input())
A = np.array(list(map(int,input().split())))
B = np.array(list(map(int,input().split())))
Bsi = np.argsort(B)
A2 = A[Bsi]
Bs = B[Bsi]
A2si = np.argsort(A2)
As = A2[A2si]
C = Bs-As
if any(C[C<0]):
    ans = 'No'
else:
    D = A2-As
    if any(D == 0):
        ans = 'Yes'
    elif all(As[1::]-Bs[:-1:] > 0):
        pi = 0
        i = 0
        while i<N-1:
            pi = A2si[pi]
            if pi == 0:
                ans = 'Yes'
                break
            else:
                i += 1
        else:
            ans = 'No'
    else:
        ans = 'Yes'
        
print(ans)

Measured memory_bytes: 24052
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict(list)
#import bisect
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    a,b,c,d,e,f = readInts()
    water = set()
    sugar = set()
    # water
    # A,B の制約が 1 <= A,B <= 30 だから、ループは31まで回せば位
    for i in range(31):
        for j in range(31):
            w = 100 * a * i + 100 * b * j
            if w <= f: # 水の合計が F より大きくなってはいけない (砂糖0gの時もあるが、)
            # -1g とかはないので
                water.add(w)
    # sugar
    # C,D の制約が、 1 <= C,D <= 3000 であるから、 3001 までまわせばい
    for i in range(3001):
        for j in range(3001):
            s = c * i  + d * j
            if s <= f: # 砂糖の合計が F より大きくなってはいけない
            # 水 0 g はあっても、-1gとかはないから
                sugar.add(s)
    # 濃度の限界値を決める
    nl = e/(100 + e) # *100 すれば、限界の濃度のパーセント
    noudo = -1
    ans1 = 0
    ans2 = 0
    for s in sugar:
        for w in water:
            # 砂糖水をつくる
            sum = s + w
            if sum == 0:# 和が0はだめー てか1 <= だから 1からループ回せばええやんけ
                continue
            x = s/sum # suger / 砂糖水 * 100 すれば%やで
            if sum <= f and x <= nl and x > noudo:
                # 砂糖水は fg以下 , 砂糖水の濃度は限界以下 , 濃度が最大になるまで回せ
                noudo = x
                ans1 = sum
                ans2 = s
    print(ans1,ans2)
if __name__ == '__main__':
  main()


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

void dfs(int now,int last = -1){
    for(auto next:graph[now]){
        if(next == last)continue;
        if(visited[next])continue;
        visited[next] = 1;
        dfs(next,now);
    }
}
signed main(){
    
    int n,m;cin >> n >> m;
    rep(i,m){
        int a,b,c;
        cin >> a >> b >> c;
        a--;b--;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    int ans = 0;
    rep(i,n){
        if(!visited[i]){
            dfs(i);
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 11392
#include "bits/stdc++.h"
#define ll long long int
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef pair<ll, ll> pairs;
typedef pair<ll, pairs> tpl;
ll dp[100001], a[100001], n;
ll getans(ll i)
{
	if (i >= n)
		return INT_MAX;
	if (i == n - 1)
		return 0;
	if (dp[i] != -1)
		return dp[i];
	return dp[i] = min(getans(i + 1) + abs(a[i] - a[i + 1]), getans(i + 2) + abs(a[i] - a[i + 2]));
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	for (ll i = 0; i < n; i++)
		cin >> a[i];
	memset(dp, -1, sizeof(dp));
	cout << getans(0);
}

Measured memory_bytes: 7480
import sys

stdin = sys.stdin

ni = lambda: int(ns())
ns = lambda: stdin.readline().rstrip()
na = lambda: list(map(int, stdin.readline().split()))

# code here
n, a, b = na()
mod = 1000000007

def c(n, r):
    nu = 1
    de = 1
    for i in range(r):
        # nCr の分子
        nu = nu * (n - i) % mod
        # nCr の分母
        de = de * (i + 1) % mod
    # フェルマーの小定理より
    return nu * pow(de, mod - 2, mod) % mod

print((pow(2, n, mod) - c(n, a) - c(n, b) - 1) % mod)


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)

int main(){
   int n,m;
   cin >> n >> m;
   vector<vector<int>> v(n);
   vector<pair<int,int>> per(m);
   rep(i,m){
      int x,y;
      cin >> x >> y;
      x--;
      v[x].push_back(y);
      per[i] = {x+1,y};
   }
   rep(i,n){
      if (v[i].size() == 0) continue;
      sort(v[i].begin(),v[i].end());
   }
   rep(i,m){
      int x,y; 
      x = per[i].first; y = per[i].second;
      printf("%06d",x);
      printf("%06d\n",int(lower_bound(v[x-1].begin(),v[x-1].end(),y)-v[x-1].begin())+1);
   }
   //printf("%06d",100000);
   
   
   return 0;
   
}



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

using namespace std; 

int solve(vector<int> &x){
    int counter = 0;
    do{
        counter++;
    }while(prev_permutation(x.begin(), x.end()));

    return counter;
}

int main(){

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

    int n;
    cin >> n;

    vector<int> a(n), b(n);

    for(int i=0;i<n;++i)
        cin >> a[i];
    
    for(int i=0;i<n;++i)
        cin >> b[i];
    
    cout << abs(solve(a)-solve(b)) << '\n';

    return 0;
}

Measured memory_bytes: 256
// ABC 055 D
#include<bits/stdc++.h>
 
using namespace std;
//container util
//------------------------------------------
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)

#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())

#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).begin(),(c).end(),greater<int>())

#define PB(a) push_back(a)

#define ALL(x) (x).begin(),(x).end()
#define MAX_EL(c) *max_element((c).begin(),(c).end())
#define MIN_EL(c) *min_element((c).begin(),(c).end())
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef string str;
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

str split(str s,int i){
  str ret;
  while(s[i]!='/'&&i<10)
  {
    ret+=s[i];
    i++;
  }
  return ret;
}

int main(){
// magic spell------------------------------
  cin.tie(0);
  ios::sync_with_stdio(false);
//------------------------------------------

  int y,m,d;
  str s;
  cin >> s;
  y = atoi(split(s,0).c_str());
  m = atoi(split(s,5).c_str());
  d = atoi(split(s,8).c_str());
  str ans;
  if(y>2019||(y==2019&&m>=5))
  {
    ans = "TBD";
  }else{
    ans = "Heisei";
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#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 Sq(x) (x)*(x)
#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 Unique(a) a.erase(unique(Range(a)), a.end())
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#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 = 998244353;

int main(void){
    Cin(int, n);
    Cin(string, s);
    
    vector<int> b(n+1), w(n+1);
    For(i, n){
        b[i+1] = ((s[i] == '#') ? b[i]+1 : b[i]);
        w[i+1] = ((s[i] == '.') ? w[i]+1 : w[i]);
    }

    int ans = n;
    For(i, n+1){
        ans = min(ans, b[i] + w[n]-w[i]);
    }
    Cout(ans);
}


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

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());
    cout << a[n - 1] - a[0] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>


using namespace std;



int main() {

	int N, *B, sum = 0;

	cin >> N;
	B = new int[N - 1];

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

	sum += B[0];
	sum += B[N - 2];

	for (int i = 1; i < N - 1; i++) {
		sum += min(B[i], B[i - 1]);
	}

	cout << sum;

	return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;

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

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

int main() {
  int N;
  cin >> N;
  vector<double> A(N);
  rep(i, N) cin >> A[i];

  double ans = 0.0;
  rep(i, N) {
    ans += 1.0 / A[i];
  }
  ans = 1.0 / ans;
  printf("%.12f\n", ans);
}

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

int main() {
  int N;
  scanf("%d", &N);

  int ans = 0;
  for (int i = 0; i < N; i++) {
    int a = 0;
    scanf("%d", &a);
    if (a % 2 == 0) {
      while (a % 2 == 0) {
        ans++;
        a /= 2;
      }
    }
  }

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


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

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> A(N+2);
  A[0] = 0;
  for(int i = 1; i < N+1; i++){
    cin >> A[i];
  }
  A[N + 1] = 0;
  long long int total = 0LL;
  for(int i = 1; i < N+2; i++){
    total += abs(A[i] - A[i-1]);
  }
  for(int i = 1; i < N+1; i++){
    cout << total - abs(A[i] - A[i - 1]) - abs(A[i+1]-A[i]) + abs(A[i+1]-A[i-1]) << endl;
  
  }
}


Measured memory_bytes: 1664
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  std::size_t N;
  std::cin >> N;

  std::string s;
  std::function<void(char)> dfs;
  dfs = [&](const char max) {
    if (s.size() == N) {
      std::cout << s << std::endl;
    } else {
      for (char c = 'a'; c <= max + 1; ++c) {
        s.push_back(c);
        dfs(std::max<char>(max, c));
        s.pop_back();
      }
    }
  };
  dfs('`');

  return 0;
}

Measured memory_bytes: 1536
#include<stdio.h>
int main()
{
	int N,A,B,C;
	scanf("%d %d %d",&N,&A,&B);
	C=N*A;
	if(C>B)
	{
		printf("%d\n",B);
	}
	else if(C==B)
	{
		printf("%d\n",C);
	}
	else
	printf("%d\n",C);
	
	
return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#define N 100000
int CanLay(int); 
int n, k, w[N];
int main(void){
    int i, P, max=1, ave=0;
     
    scanf("%d %d",&n,&k);
    for (i=0; i<n; i++) {
      scanf("%d",&w[i]);
      if(max<w[i]) max = w[i];
      ave += w[i];
    }
    
    ave /= k;
    if(ave > max) P = ave;
    else P = max;
    while (CanLay(P)==0)  P++;        
    printf("%d\n",P);    
    return 0;
}

int CanLay(int P){
  int i, temp, sum;
  
    temp = sum = i = 0;
    while (i < n) {
      if( sum + w[i] <= P )   sum += w[i];
      else {
	sum = 0;
	temp++;
	if(temp >= k) return 0;
        continue;
      }
      i++;
    }
    return 1;
}

Measured memory_bytes: 984
#include <float.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>

#ifdef __cplusplus
#include <algorithm>
#include <functional>
#endif

//#define P 1000000007

int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}

void rsortr_u32(void *base, const int count);


int p[100000];
int q[100000];
int r[100000];
int main(void){
	int x=nextpint()-1;
	int y=nextpint()-1;
	int z=0;
	int a=nextpint();
	int b=nextpint();
	int c=nextpint();
	for(int i=0; i<a; i++){ p[i]=nextpint(); }
	for(int i=0; i<b; i++){ q[i]=nextpint(); }
	for(int i=0; i<c; i++){ r[i]=nextpint(); }
	rsortr_u32(p, a);
	rsortr_u32(q, b);
	rsortr_u32(r, c);
	while(z<c){
		if(x>=0 && y>=0 && p[x]<r[z] && q[y]<r[z]){
			if(p[x]<q[y]){
				x--;
			}else{
				y--;
			}
		}else if(x>=0 && p[x]<r[z]){
			x--;
		}else if(y>=0 && q[y]<r[z]){
			y--;
		}else{
			break;
		}
		z++;
	}
	long ans=0;
	for(int i=0; i<=x; i++){ ans+=p[i]; }
	for(int i=0; i<=y; i++){ ans+=q[i]; }
	for(int i=0; i<z; i++){ ans+=r[i]; }
	printf("%ld\n", ans);
}

void rsortr_u32(void *base, const int count){
	uint32_t *a=(uint32_t *)base;
	uint32_t *b=(uint32_t *)malloc(count*sizeof(uint32_t));
	int *c=(int *)malloc(0x100*sizeof(int));
	memset(c, 0, 0x100*sizeof(int)); for(int i=0; i<count; i++){ c[(a[i]>>(0<<3))&0xFF]++; } for(int i=0xFE; i>=0; i--) c[i]+=c[i+1]; for(int i=count-1; i>=0; i--){ b[--c[(a[i]>>(0<<3))&0xFF]]=a[i]; }{uint32_t *t=a; a=b; b=t;}
	memset(c, 0, 0x100*sizeof(int)); for(int i=0; i<count; i++){ c[(a[i]>>(1<<3))&0xFF]++; } for(int i=0xFE; i>=0; i--) c[i]+=c[i+1]; for(int i=count-1; i>=0; i--){ b[--c[(a[i]>>(1<<3))&0xFF]]=a[i]; }{uint32_t *t=a; a=b; b=t;}
	memset(c, 0, 0x100*sizeof(int)); for(int i=0; i<count; i++){ c[(a[i]>>(2<<3))&0xFF]++; } for(int i=0xFE; i>=0; i--) c[i]+=c[i+1]; for(int i=count-1; i>=0; i--){ b[--c[(a[i]>>(2<<3))&0xFF]]=a[i]; }{uint32_t *t=a; a=b; b=t;}
	memset(c, 0, 0x100*sizeof(int)); for(int i=0; i<count; i++){ c[(a[i]>>(3<<3))&0xFF]++; } for(int i=0xFE; i>=0; i--) c[i]+=c[i+1]; for(int i=count-1; i>=0; i--){ b[--c[(a[i]>>(3<<3))&0xFF]]=a[i]; }{uint32_t *t=a; a=b; b=t;}
	free(c);
	free(b);
}


Measured memory_bytes: 1784
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define MOD  1000000007
#define inf  1e18
#define ll long long
#define multiply(x) x*x*(x-=1)

#define ar array
#define wt(x) int x;cin>>x;while(x--)
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> pbds;
 void  c_p_c(){
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
 
#ifndef ONLINE_JUDGE
  freopen("input1.txt","r",stdin);
  freopen("output1.txt","w",stdout);
#endif
 
 
}


            




    
  



 
int32_t main() {
   c_p_c();
  
       
      int a,b,hour,minute;

      cin>>a>>b>>hour>>minute;
      
  
    
    if (hour == 12) {
            hour = 0;
        }
        if (minute == 60) {
            minute = 0;
            hour += 1;
        }
        double hourAngle = (hour * 60 + minute) * 0.5;
        double minAngle = minute * 6;
        double bwAngle = abs(hourAngle - minAngle);
        double angle=min(360 - bwAngle, bwAngle);
 
 double pi=acos(-1);
 if(angle==90){
    double fm=b*b+a*a;
    double o=sqrt(fm);
    cout<<fixed<<setprecision(30)<<o;
 }
 else{
   
     double p=(double)pi/180;
     
      double j=(double)angle *p;
     
    double res=cos(j);
    
    double t=(a*a+b*b)-(2*b*a*res);
    double ans=sqrt(t);

    cout<<fixed<<setprecision(30)<<ans;
}
        
    
    return 0;
 }

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

const int MAX_N = 1e6;

int a[MAX_N],b[MAX_N],c[MAX_N];
int dp[MAX_N][3];

int MAX(const int &a, const int &b, const int &c){ 
  if( a >= max(b,c) ){ return a;}
  else{
    if( b >= c ){ return b;}
    else{ return c;}
  }
}

signed main(void){
  
  int N; cin >> N;
  for(int i = 1; i <= N; i++){ 
    cin >> a[i] >> b[i] >> c[i];
  } //念のため1-indexedで
  
  dp[1][0] = a[1],dp[1][1] = b[1],dp[1][2] = c[1];
  
  for(int i = 2; i <= N; i++){ 
    dp[i][0] = max(dp[i-1][1],dp[i-1][2])+a[i];
    dp[i][1] = max(dp[i-1][0],dp[i-1][2])+b[i];
    dp[i][2] = max(dp[i-1][0],dp[i-1][1])+c[i];
  }
  
  cout << MAX(dp[N][0],dp[N][1],dp[N][2]) << endl;
  
  return 0;
}

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

using namespace std;


bool side(string& left, char key){
    for(int i = 0; i < left.size(); i++){
        if(left[i] == key)return true;
    }
    return false;
}

int main(){
    string str;
    string left = "qwertasdfgzxcvb";
    sort(left.begin(), left.end());
    while(cin >> str && str != "#"){
        bool isleft = side(left,str[0]);
        int ans = 0;
        for(int i = 1; i < str.size(); i++){
            if(isleft != side(left, str[i])){
                ans++;
                isleft = !isleft;
            }
        }
        cout << ans << endl;
    }

    return 0;
}




Measured memory_bytes: 3216
def get(i):
    mx = 0
    while i > 0:
        if bit[i] > mx:
            mx = bit[i]
        i -= i & -i
    return mx


def update(i, x):
    while i < n + 1:
        if x > bit[i]:
            bit[i] = x
        i += i & -i


def f(n, hs, a_s):
    for h, a in zip(hs, a_s):
        update(h, get(h - 1) + a)
    print(max(bit))


n = int(input())
hs = list(map(int, input().split()))
a_s = list(map(int, input().split()))
bit = [0] * (n + 1)
f(n, hs, a_s)


Measured memory_bytes: 35972
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<limits>
#include<tuple>
#include<utility>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define INF 1e18
using ll = long long;
using namespace std;

int main(){
  ll a,b,q;  cin >> a >> b >> q;
  vll s(a),t(b),x(q);
  rep0(i,a){ cin >> s[i]; }
  rep0(i,b){ cin >> t[i]; }
  rep0(i,q){ cin >> x[i]; }

  rep0(i,q){
    ll ans = INF;
    rep0(j,2){
      auto a1 = lower_bound(all(s),x[i]) - j;
      auto a2 = lower_bound(all(t),x[i]) - j;
      ll ax1 = *a1, ax2 = *a2; //変数に代入
      if(a1 == s.begin()-1) ax1 = INF;
      if(a1 == s.end()) ax1 = INF;
      if(a2 == t.begin()-1) ax2 = INF;
      if(a2 == t.end()) ax2 = INF;
      rep0(k,2){
        auto b1 = lower_bound(all(t),x[i]) - k;
        auto b2 = lower_bound(all(s),x[i]) - k;
        ll bx1 = *b1, bx2 = *b2; //変数に代入
        if(b1 == t.begin()-1) bx1 = INF;
        if(b1 == t.end()) bx1 = INF;
        if(b2 == s.begin()-1) bx2 = INF;
        if(b2 == s.end()) bx2 = INF;
        //INFは答えに含まれないので除く
        if (ax1 != INF && bx1 != INF)
          ans = min(ans, abs(x[i]-ax1)+abs(ax1-bx1));
        if (ax2 != INF && bx2 != INF)
          ans = min(ans, abs(x[i]-ax2)+abs(ax2-bx2));
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) ll(x.size()) //sizeをsize_tからllに直しておく
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB emplace_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define Umap unordered_map
#define Uset unordered_set

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    REP(i, n) cin >> a[i];
    vector<ll> b(n);
    ll cnt = 0;
    REPD(i, n){
        int tmp = 0;
        for(ll j = 1; (i+1)*j <= n; j++){
            if(b[(i+1)*j - 1] == 0) continue;
            tmp++;
            tmp %= 2;
        }
        if(a[i] != tmp){
            b[i]++;
            cnt++;
        }
    }
    cout << cnt << endl;
    REP(i, n){
        if(b[i] == 0) continue;
        cout << i+1 << " ";
    }
    return 0;
}

Measured memory_bytes: 6312
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        int t = gcd(a[0], a[1]);
        for (int i = 2; i < n; i++) {
            t = gcd(t, a[i]);
        }
        System.out.println(t);
    }

    static int gcd(int x, int y) {
        if (x < y)
            return gcd(y, x);
        if (y == 0)
            return x;
        else
            return gcd(y, x % y);
    }
}


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

int n;
char a[255][255];


bool in(int y,int x){
	return 0<=y&&y<n&&0<=x&&x<n;
}
int solve(){
	int res=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(a[i][j]=='0')continue;
			for(int dy=-1;dy<=1;dy++){
				for(int dx=-1;dx<=1;dx++){
					if(!dy&&!dx)continue;
					int y=i,x=j;
					int seq=0;
					while(in(y,x)&&a[y][x]=='1'){
						seq++;
						y+=dy;
						x+=dx;
					}
					res=max(res,seq);
				}
			}
		}
	}
	return res;
}



int main(){
	while(cin>>n&&n){
		for(int i=0;i<n;i++)for(int j=0;j<n;j++)cin>>a[i][j];
		cout<<solve()<<endl;
	}
	return 0;
}

Measured memory_bytes: 1224
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define FOR(i, m, n) for(ll i = m; i < (n); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
using vi = vector<int>;
using vii = vector<vi>;
using pii = pair<int, int>; 
using vl = vector<ll>;
using vll = vector<vl>;
using pll = pair<ll, ll>;

vl sieve(ll n){
    vector<bool> is_prime(n+1);
    for(ll i = 0; i <= n; i++){
        is_prime[i] = true;
    }
    vl res;
    for(ll i = 2; i <= n; i++){
        if(is_prime[i]){
            for(ll j = 2*i; j <= n; j += i){
                is_prime[j] = false;
            }
            res.push_back(i);
        }
    }
    return res;
}

vl f(ll n, vl& p){
    vl res;
    for(ll i = 0; p[i]*p[i] <= n; i++){
        if(n % p[i] != 0) continue;
        ll num = 0;
        while(n % p[i] == 0){
            num++;
            n /= p[i];
        }
        res.push_back(num);
    }
    if(n != 1) res.push_back(1);
    return res;
}

int main() {
    ll N;
    cin >> N;
    ll ans = 0;
    auto p = sieve(N);
    rep(i, N){
        if(i == 0) continue;
        auto a = f(i, p);
        ll tmp = 1;
        for(auto x : a){
            tmp *= x + 1;
        }
        ans += tmp;
    }
    cout << ans;
    // for(auto x : p){
    //     cout << x << " ";
    // }
}


Measured memory_bytes: 4428
import sys
import math
import collections
import bisect
import copy

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()
    yes = dict()
    for i in range(3, 1000):
        if (i * (i - 1)) % 2 == 0:
            yes[(i * (i - 1)) // 2] = [i, i - 1]
    tmp = max(yes)

    if n == 1:
        print("Yes")
        print(2)
        print(1, 1)
        print(1, 1)
        exit(0)


    if n not in yes.keys():
        print("No")
        exit(0)

    xl, xs = yes[n]

    ans = [[] for _ in range(xl)]
    cnt = 1
    idx = 0
    while xs >= 0:
        tmp = cnt
        for i in range(idx, min(xl, idx + 3)):
            for j in range(xs):
                if cnt == tmp + 3 * (xs - 1):
                    ans[i].append(tmp)
                    break
                else:
                    ans[i].append(cnt)

                if j != 0 and j != xs - 1:
                    ans[idx + 2 + j].append(cnt)
                if j != xs - 1:
                    cnt += 1
        idx += 3
        xs -= 3

    print("Yes")
    print(len(ans))
    for ansi in ans:
        print(len(ansi), *ansi, sep=" ")


if __name__ == '__main__':
    main()


Measured memory_bytes: 14828
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin>>n;
  string a="YES";
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(),vec.end());
  
  for(int i=0;i<n-1;i++){
      if(vec.at(i+1)==vec.at(i)){
        a="NO";
        break;
    }
  }
  cout<<a<<endl;
}

Measured memory_bytes: 1024
function Main(input){
    input=input.split("\n");  //ここまで必須
    var result=0;
    for (i=0;i<input[0].length;i++){
        if (input[0].slice(i,i+1)!=input[1].slice(i,i+1)){result=result+1}
    }
    console.log(result)
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));

Measured memory_bytes: 33020
import java.util.Scanner;

public class Main {

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

        String input_line = sc.nextLine();
        int N=input_line.length();

        String string1=input_line.substring(0, (N-1)/2);
        String string2=input_line.substring((N+3)/2-1,N);

        StringBuffer sb1 = new StringBuffer(string1);
        StringBuffer sb2 = new StringBuffer(string2);
        StringBuffer sb3 = new StringBuffer(input_line);

        String string1_rev=sb1.reverse().toString();
        String string2_rev=sb2.reverse().toString();
        String input_line_rev=sb3.reverse().toString();

        if(string1_rev.equals(string1)&&string2_rev.equals(string2)&&input_line_rev.equals(input_line)) {
        	System.out.print("Yes");
        }
        else {
        	System.out.print("No");
        }

	}

}

Measured memory_bytes: 24020
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N;
    string type;
    cin >> N;
    for( int i = 0; i < N; i++){
      string C;
      cin >> C;
      if(C == "Y"){
        type ="Four";}
         }
		if(type == "Four"){
          cout << type <<endl;
        }
  		else{
          cout << "Three"<<endl;
        }
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        if(a>b){
            System.out.println("a > b");
        }else if(a<b){
            System.out.println("a < b");
        }else{
            System.out.println("a == b");
        }
    }
}


Measured memory_bytes: 26172
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

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

	// s[i][j]: 電球i が スイッチj に影響されるか
	std::vector<std::vector<bool>> s(M, std::vector<bool>(N, false));
	for(int i = 0; i < M; i++) {
		int k;
		std::cin >> k;

		for(int j = 0; j < k; j++) {
			int ss;
			std::cin >> ss;
			s[i][ss - 1] = true;
		}
	}

	std::vector<bool> p(M);
	for(int i = 0; i < M; i++) {
		int pp;
		std::cin >> pp;
		p[i] = (pp == 1);
	}

	const int n = std::pow(2, N);
	int result = 0;
	for(int i = 0; i < n; i++) {
		std::vector<bool> f(M, false);
		
		for(int j = 0; j < N; j++) {
			const bool bit = ((i >> j) & 1) != 0;
			for(int k = 0; k < M; k++) {
				if(s[k][j]) {
					f[k] = f[k] != bit;
				}
			}
		}

		for(int i = 0; i < M; i++) {
			f[i] = f[i] != p[i];
		}

		if(std::count(f.begin(), f.end(), false) == f.size()) {
			result++;
		}
	}

	std::cout << result << std::endl;

	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define For(i, a, b) for (int i = int(a); i < int(b); i++)
#define Dor(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define Foz(i, a) For(i, 0, a)
#define Doz(i, a) Dor(i, 0, a)
#define Trav(e, v) for (auto& e : v)
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vii = vector<ii>;
template <typename T> bool ckmin (T& a, T b) { return (b < a) ? a = b, 1 : 0; }
template <typename T> bool ckmax (T& a, T b) { return (b > a) ? a = b, 1 : 0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#ifdef XVENOM
	#define errp(...) fprintf(stderr, __VA_ARGS__)
	#define dbg(...) errp("[%s]: ", #__VA_ARGS__), dbg_str(__VA_ARGS__)
#else
	#define errp(...)
	#define dbg(...)
#endif
template <typename U, typename V> string to_string (pair<U, V>);
string to_string (string& e) { return "\"" + e + "\""; }
string to_string (char e) { return "\'" + string(1, e) + "\'"; }
string to_string (bool e) { return e ? "true" : "false"; }
template <typename T> string to_string (T e) {
	string s = "[ ";
	for (auto& x : e) s += to_string(x) + " ";
	return s + "]";
}
template <typename U, typename V> string to_string (pair<U, V> e) {
	return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
void dbg_str () { errp(" \n"); }
template <typename U, typename... V> void dbg_str (U u, V... v) {
 	errp(" %s", to_string(u).c_str()); dbg_str(v...);
}
/* --- */
string num, mx;
int k, d;

int calc (int z, int itr) {
	if (z == 0) {
		return (num <= mx);
	}
	int res = 0;
	for (int i = '1'; i <= '9'; i++) {
		for (int j = itr + 1; j < d; j++) {
			num[j] = i;
			res += calc(z - 1, j);
			num[j] = '0';
		}
	}
	return res;
}

int f (int n, int m) {
	int res = 1;
	for (int i = 0; i < m; i++)
		res = (res * (n--));
	for (int i = 1; i <= m; i++)
		res /= i;
	for (int i = 0; i < m; i++)
		res *= 9;
	return res;
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	/* --- */
	cin >> mx >> k;
	d = sz(mx);
	num = mx;
	For(i, 1, sz(num)) num[i] = '0';
	int ans = calc(k - 1, 0);
	dbg(ans);
	for (int i = '1'; i < mx[0]; i++) ans += f(d - 1, k - 1);	
	ans += f(d - 1, k);
	cout << ans << '\n';
}



Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Console = System.Console;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var tmp = Math.Sqrt(N);
            var val = Math.Truncate(tmp);
            Console.WriteLine(val * val);
        }

    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define fr(i,j,p)   for(int i=j; i<p; i++)
#define frr(i,j,p)  for(int i=j; i>=p; i--)
#define PI          3.14159265358979323846
#define pb          push_back
#define mkp         make_pair
#define print(m)    std::cout << std::fixed << std::setprecision(11) << m <<endl;
#define ff          first
#define ss          second
#define mod         1000000007
#define removeDuplicates(a) a.resize(unique(all(a))-a.begin())

int main() {
    lli h,w;    cin>>h>>w;
    char a[h][w];
    lli dp[h][w];
    fr(i,0,h) {
        fr(j,0,w) {
            cin>>a[i][j];
        }
    }
    fr(i,0,h) {
        fr(j,0,w) {
            if(i==0 && j==0) {dp[i][j]=1; continue;}
            else if(i==0) {
                if(a[i][j]=='#') dp[i][j]=0;
                else dp[i][j]=dp[i][j-1];
                dp[i][j]%=mod;
            }
            else if(j==0) {
                if(a[i][j]=='#') dp[i][j]=0;
                else dp[i][j]=dp[i-1][j];
                dp[i][j]%=mod;
            }
            else {
                if(a[i][j]=='#') dp[i][j]=0;
                else dp[i][j]=dp[i-1][j]+dp[i][j-1];
                dp[i][j]%=mod;
            }
        }
    }
    cout<<dp[h-1][w-1];
    
    return 0;
}


Measured memory_bytes: 12344