akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
#[allow(unused_macros)]
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);
impl<T: PartialEq> Eq for Total<T> {}
impl<T: PartialOrd> Ord for Total<T> { fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering { self.0.partial_cmp(&other.0).unwrap() }}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    input!{a:i32,b:i32,c:i32,d:i32};

    println!("{}", if a+b > c+d {"Left"} else if a+b < c+d {"Right"} else {"Balanced"});

}

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

int main(){
	int n; cin>>n;
  	int ar[n];
  
  	for(int i=0;i<n;i++) cin>>ar[i];
  	int mn = 10001,mx = 0;
  	for(int i=0;i<n;i++){
    	mn = min(mn,ar[i]);
		mx = max(mx,ar[i]);
    }
  	cout<<mx-mn;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    
    new Main().run();
  }

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      String op;
      String[] words;
      Tree tree = new Tree();

      for(int i=0,k=0; i<n; i++,k=0){
        words = br.readLine().split(" ");
        op  = words[k++];
        if ( op.equals("insert") ) { 
          tree.insert(Integer.parseInt(words[k++]));
        }
        else {
          tree.dispRoundPath();
        }
      }

    }
    catch(IOException e) {
      System.out.println("IOException!");
    }
  }
}

class Tree {

  static final BTreeNode NIL = new BTreeNode(-1);
  BTreeNode root;
  StringBuilder buf;

  public Tree() {
    root = NIL;
    buf = new StringBuilder();
  }

  public void insert(int val) {
    BTreeNode y = NIL;
    BTreeNode x = root;
    BTreeNode z = new BTreeNode(val);

    while( !x.equals(NIL) ) {
      y = x;
      if( z.key < x.key )
        x = x.left;
      else
        x = x.right;
    }
    z.parent = y;

    if( y.equals(NIL) ){
      root = z;
    }
    else if( z.key < y.key )
      y.left = z;
    else
      y.right = z;
  } 
  void preParse(BTreeNode u) {
    if( !u.equals(NIL) ) {
      buf.append(" ").append(u.key);
      preParse(u.left);
      preParse(u.right);
    }
  }
  void inParse(BTreeNode u) {
    if( !u.equals(NIL) ) {
      inParse(u.left);
      buf.append(" ").append(u.key);
      inParse(u.right);
    }
  }

  void dispRoundPath() {

    inParse(root);
    buf.append("\n");
    preParse(root);
    buf.append("\n");

    System.out.print(buf);
    buf.setLength(0);
  }
}

class BTreeNode {
  int key;
  BTreeNode parent,left,right;

  public BTreeNode(int key) {
    this.key = key;
    this.parent =
    this.left =
    this.right = Tree.NIL;
  }

  @Override
  public boolean equals(Object o) {
    if(o == this) return true;
    if(o == null) return false;
    if(!(o instanceof BTreeNode)) return false;

    BTreeNode node = (BTreeNode)o;
    if(!(this.key == node.key)) return false;

    return true;
  }
}


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

using namespace std;


int main() {
    int N, X = 0, Y = 0, res = 0;
    int V[20], C[20];

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

    for (int i = 0; i < N; i++) {
        if (V[i] > C[i]) {
            X += V[i];
            Y += C[i];
        }
    }

    res = X - Y;
    cout << res;

    return 0;
}

Measured memory_bytes: 256
import Data.List (minimumBy)
import Data.Function (on)

main = do n <- readLn :: IO Int
          [t, a] <- map read . words <$> getLine
          hs <- map read . words <$> getLine
          let assc = zip [1..] [abs (1000 * a - (1000 * t - 6 * h)) | h <- hs]
          print $ fst $ minimumBy (compare `on` snd) assc

Measured memory_bytes: 1404
d,m=1e9+7,p[10001][200]={1};i,j,k,x,I;char s[11111];main(L){for(scanf("%s%d",s,&d);i<strlen(s);i+=++j/2,j%=2)for(x=L=j?9:s[i]-48,k=0;~x;x-=++k/d,k%=d)p[i+1][I=(j|x<L)*d+(k+x)%d]+=p[i][j*d+k],p[i+1][I]%=m;printf("%d",(*p[i]+p[i][d]-1+m)%m);}

Measured memory_bytes: 7936
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define reads(s) string s; cin >> s;
#define readarr(a, n) int a[(n) + 1] = {}; fori (i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori (i, 1, n) {fori (j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) fori (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) fori (i, 1, n) {fori (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(s) (int)(s.size())
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
#define setprec(x) cout << fixed << setprecision(x);
 
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;
 
const int INF = 4e18;
const int mod = 1e9+7; 

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

    //start from here

    read(n) readarr(a, n)

    bool flag = false;

    fori (i, 1, n) if(a[i] == 0) flag = true;

    if(flag) {print(0) return 0;}

    int N = 1e18, M = 1e9;

    int mul = a[1];

    fori (i, 2, n)
    {
    	if(mul > N) {cout << -1; return 0;}
    	else if(mul <= M && a[i] <= M) mul *= a[i];
    	else if(mul > M && a[i] > M) {cout << -1; return 0;}
    	else
    	{
    		int x = N / mul + 1;
    		if(a[i] > x) {cout << -1; return 0;}
    		else mul *= a[i];
    	}
    }

    if(mul > N) print(-1)
    else print(mul)

    return 0;
}


Measured memory_bytes: 4400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;
	
	public static void Main(string[] args)
	{
		var n = Console.ReadLine();
		if(n == "a" || n == "i" || n == "u" || n == "e" || n == "o")
          Console.WriteLine("vowel");
      else
        Console.WriteLine("consonant");
	}
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

Measured memory_bytes: 11092
def SelectionSort(A):
    global count
    flag = False
    for i in range(len(A)):
        mini = i
        for j in range(i, len(A)):
            if A[j] < A[mini]:
                mini = j
        A[i], A[mini] = A[mini], A[i]
        if i is not mini:
            count += 1
        
N = input()
A = [int(i) for i in input().split()]
count = 0
SelectionSort(A)
print(*A)
print(count)

Measured memory_bytes: 7752
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define PQ priority_queue
#define UM unordered_map
#define US unordered_set
#define ALL(a) (a).begin(),(a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
const ll INF = (1ll << 60);
typedef pair<ll,ll> pii;
const ll MOD=1000000007;


pii extendedEuclid(ll a,ll b){
  bool swapped=false;
  if(a<b) {swap(a,b);swapped=true;}
  pii x={1,0},y={0,1};
  while(1){
    ll xv=a*x.first+b*x.second;
    ll yv=a*y.first+b*y.second;
    if(yv==0) {if(swapped) return {x.second,x.first}; else return x;}
    ll d=xv/yv;
    swap(x,y);
    y.first-=d*x.first;
    y.second-=d*x.second;
  }
}

ll inverse(ll a,ll mod) {
  return (mod+extendedEuclid(a,mod).first%mod)%mod;
}

int main() {
  ll n; cin>>n;
  vi a(n+1); REP(i,n+1) {cin>>a[i]; a[i]-=1;}
  vvi v(n); REP(i,n+1) v[a[i]].PB(i);
  ll y;
  for(vi &i:v) if(i.size()>1) y=i[1]-i[0];
  y=(n-y);

  vi c1(n+2),c2(n+2);
  c1[0]=1; c2[0]=1;
  FOR(i,1,n+2) c1[i]=(c1[i-1]*((n+2-i)*inverse(i,MOD)%MOD))%MOD;
  FOR(i,1,y+1) c2[i]=(c2[i-1]*((y+1-i)*inverse(i,MOD)%MOD))%MOD;
  FOR(k,1,n+2) {
    cout<<(c1[k]-c2[k-1]+MOD)%MOD<<endl;
  }
}


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

int main() {
  int N;
  cin >> N;
  vector<int> x(N), y(N);
  for(int i = 0; i < N; i++) {
    cin >> x.at(i) >> y.at(i);
  }
  vector<int> order;
  for(int i= 0; i < N; i++) {
    order.push_back(i);
  }
  double sum = 0;
  do {
    for(int i = 0; i < N - 1; i++) {
      int dx = x.at(order.at(i + 1)) - x.at(order.at(i));
      int dy = y.at(order.at(i + 1)) - y.at(order.at(i));
      sum += pow(dx * dx + dy * dy, 0.5);
    }
  } while(next_permutation(order.begin(), order.end()));
  for(int i = 1; i <= N; i++) {
    sum /= i;
  }
  cout << fixed << setprecision(6) << sum << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
   int k;
   scanf("%d", &k);
   char s[100];
   scanf("%s", s);
   int s_len;
   for(s_len = 0; s[s_len] != 0; s_len++);

   if(s_len <= k){
      printf("%s\n", s);
   } else {
      for(int i=0; i<k; i++){
         printf("%c", s[i]);
      }
      printf("...\n");
   }

   return 0;
}


Measured memory_bytes: 1660
#include <iostream>

using namespace std;

int main() {
  int n;
  cin >> n;
  for (auto &v : {111, 222, 333, 444, 555, 666, 777, 888, 999, 1111})
    if (n <= v) {
      cout << v << endl;
      break;
    }
}

Measured memory_bytes: 3516
N,M=map(int, input().split())
max_l=0
min_r=10**5+1
for i in range(M):
  l,r=map(int, input().split())
  if max_l < l:
    max_l = l
  if r < min_r:
    min_r = r
print(max(min_r - max_l + 1, 0))


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, W;
  cin >> N >> W;
  vector<int64_t> w(N), v(N);
  for (int i = 0; i < N; i++) {
    cin >> w.at(i) >> v.at(i);
  }
  vector<vector<int64_t>> DP(N + 1, vector<int64_t>(100001, 1000000001));
  DP.at(0).at(0) = 0;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j <= 100000; j++) {
      if (j >= v.at(i - 1)) {
        DP.at(i).at(j) =
          min(DP.at(i).at(j), DP.at(i - 1).at(j - v.at(i - 1)) + w.at(i - 1));
      }
      DP.at(i).at(j) = min(DP.at(i).at(j), DP.at(i - 1).at(j));
    }
  }
  for (int i = 100000; i >= 0; i--) {
    if (DP.at(N).at(i) <= W) {
      cout << i << endl;
      break;
    }
  }
}

Measured memory_bytes: 83224
#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#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())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const double EPS = 1E-10;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)


//ここから編集

const int MAX = 2000010;
long long fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll modPow(ll x, ll n, ll mod = MOD){
    ll res = 1;
    while(n){
        if(n&1) res = (res * x)%mod;
 
        res %= mod;
        x = x * x %mod;
        n >>= 1;
    }
    return res;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  
    int K; string s; cin >> K >> s;

    COMinit();

    ll ans = 0;
    for(int i=0; i<=K; i++){
        ans %= MOD;
        ans += modPow(26, i, MOD) * modPow(25, K-i, MOD) % MOD* COM(K-i + s.size()-1, K-i) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 51196
import sys
sys.setrecursionlimit(10 ** 6)
N, M = map(int, input().split())
G = [[] for i in range(N)]
for i in range(M):
    l, r, q = map(int, input().split())
    G[l - 1].append((r - 1, q))
    G[r - 1].append((l - 1, -q))
X = [None] * N


def dfs(u):
    global X, G
    for w, d in G[u]:
        if X[w] is None:
            X[w] = X[u] + d
            if not dfs(w):
                return False
        else:
            if X[w] != X[u] + d:
                return False

    return True


flag = True
for i in range(N):
    if X[i] is None:
        X[i] = 0
        flag &= dfs(i)

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

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

ll n, k, ar[maxn];
int main()
{
    //ios::sync_with_stdio(0); cin.tie(0); //C++关同步
    cin >> n >> k;
    vector<int> v;
    map<int, int> s;
    for(int i = 1; i <= n; ++i)cin >> ar[i];
    int now = 1, ins = 0;
    for(; ;){
        if(s.count(now))break;
        s[now] = ins++;
        v.push_back(now);
        now = ar[now];
    }
    if(k < v.size())cout << v[k] << "\n";
    else{
        int x = s[now];
        ins = (k - x) % (v.size() - x) + x;
        cout << v[ins] << '\n';
    }
    return 0;
}


Measured memory_bytes: 14568
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n; cin>>n;
    map<string,ll> m;
    rep(i,n){
        string s;cin>>s;
        m[s]++;
    }
    ll ans = 0;
    for(auto p:m){
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 19236
#include<bits/stdc++.h>
#define ll long long
#define all(v) v.begin(),v.end()
#define PB push_back
#define PI 3.1415926535897932384626433832795
#define what(x) cout<<#x<<" is "<<x<<endl;
using namespace std;


template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {
  return '"' + s + '"';
}

string to_string(const char* s) {
  return to_string((string) s);
}

string to_string(bool b) {
  return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifndef ONLINE_JUDGE
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

ll powmod(ll a,ll b,ll mod) {
    ll res=1;a%=mod;
    //assert(b>=0);
    for(;b;b>>=1){
        if(b&1)res=res*a%mod;a=a*a%mod;
    }
    return res;
}

void solve(){
	ll n,d;
	cin>>n>>d;
	d*=d;
	int ans=0;
	for(int i=0;i<n;i++){
		ll x,y;
		cin>>x>>y;
		if(x*x+y*y<=d)ans++;
	}
	cout<<ans<<endl;
}


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tc=1;
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	#endif
	// cin>>tc;
    while(tc--)solve();
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll/*, vl, greater<ll>*/> pql; //降順(/*昇順*/)
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e9;
const char newl = '\n';

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

  ll n, l;
  cin >> n >> l;
  
  ll ans=0;
  rep2(i, n) ans += l+i-1;
  if(l>0) ans -= l;
  if(l+n-1<0) ans -= l+n-1; 
  cout << ans << newl;
  return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back

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

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n;
    int A, B;
    cin >> n;
    cin >> A >> B;
    if((B - A) & 1){
        cout << "Borys" << endl;
    }else{
        cout << "Alice" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int N;
	int L;
	string answer = "";

	cin >> N >> L;
	vector<string> S(N);

	for (int i = 0; i < N; i++) {
		cin >> S.at(i);
	}
	
	sort(S.begin(), S.end());  // 昇順にソート

	for (int i = 0; i < N; i++) {
		answer += S.at(i);
	}
	
	cout << answer << endl;
	return 0;
}

Measured memory_bytes: 256
module e;
import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

class Node{
	int id;
	Node[] adjnodes;
	int x;
	int _value;
	bool hasValue = false;
	int color = 0; // 0: undef, 1: black, 2: white
	int min = 0, max = 1_000_000;
	int tmpmin, tmpmax;
	static hasError = false;
	this(int id){
		this.id = id;
		x = uniform(0, 100000);
		}
	void add(Node nd){
		this.adjnodes ~= nd;
		nd.adjnodes ~= this;
		}
	void setColor(int c){
		if(this.color > 0) return;
		this.color = c;
		foreach(nd; adjnodes) nd.setColor(1 + 2 - c);
		}
	int value(int v){
		this._value = v;
		this.hasValue = 1;
		return _value;
		}
	int value(){	
		return _value;
		}
	void start(){
		Node[] q = [this];
		while(q.length){
			Node nd = q[0];
			q = q[1 .. $];
			debug writeln("- ", [nd.id, nd.min, nd.max, nd.tmpmin, nd.tmpmax]);
			if(nd.min < nd.tmpmin || nd.max > nd.tmpmax){
				if(nd.min > nd.tmpmax || nd.max < nd.tmpmin){
					hasError = true;
					return;
					}
				if(nd.min < nd.tmpmin) nd.min = nd.tmpmin;
				if(nd.max > nd.tmpmax) nd.max = nd.tmpmax;
				debug writeln("  ", [nd.id, nd.min, nd.max, nd.tmpmin, nd.tmpmax]);
				foreach(nd2; nd.adjnodes){
					nd2.tmpmin = nd.min - 1, nd2.tmpmax = nd.max + 1;
					q ~= nd2;
					debug writeln("+ ", [nd2.id, nd2.min, nd2.max, nd2.tmpmin, nd2.tmpmax]);
					}
				}
			}
		}
	}

void main(){
	int n = readln.chomp.to!int;
	
	Node[] nodes;
	foreach(i; 0 .. n) nodes ~= new Node(i + 1);
	foreach(i; 0 .. n - 1){
		int[] tmp = readln.chomp.split.map!(to!int).map!(x => x - 1).array;
		nodes[tmp[0]].add(nodes[tmp[1]]);
		}
	
	Node[] valuednodes;
	int k = readln.chomp.to!int;
	foreach(i; 0 .. k){
		int[] tmp = readln.chomp.split.map!(to!int).array;
		tmp[0] -= 1;
		nodes[tmp[0]].value = tmp[1];
		valuednodes ~= nodes[tmp[0]];
		}
	
	valuednodes.sort!("a.x < b.x")();
	
	valuednodes[0].setColor((valuednodes[0].value % 2)? 1: 2);
	foreach(nd; valuednodes) if(nd.color != ((nd.value % 2)? 1: 2)){
		"No".writeln;
		return;
		}
	
	foreach(nd; valuednodes){
		nd.tmpmin = nd.value, nd.tmpmax = nd.value;
		nd.start;
		if(Node.hasError){
			"No".writeln;
			return;
			}
		}
	
	"Yes".writeln;
	foreach(nd; nodes) nd.max.writeln;
	
	}


Measured memory_bytes: 73980
#include <iostream>
#include <string>
#include <vector>

using namespace std;

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

  for (int k = 0; k < 4; ++k) {
    vector<bool> t(N, false);
    if (k & 1) t[0] = true;
    if (k & 2) t[1] = true;
    for (int i = 2; i < N; ++i) {
      t[i] = t[i - 2] ^ t[i - 1] ^ (s[i - 1] == 'x');
    }
    if (t[N - 2] ^ t[N - 1] ^ (s[N - 1] == 'x') == t[0] &&
	t[N - 1] ^ t[    0] ^ (s[    0] == 'x') == t[1]) {
      for (int i = 0; i < N; ++i) {
	cout << "SW"[t[i]];
      }
      cout << "\n";
      return 0;
    }
  }
  cout << "-1\n";
  return 0;
}


Measured memory_bytes: 512
#include<iostream>

using namespace std;

int main()
{
	int a;
	int b;
	int c;
	int d;
	int e;
	cin>>a>>b;
	c=a+b;
	d=a-b;
	e=a*b;

	if(c>d){
		if(e>c){
			cout<<e<<endl;
		}
		else{
			cout<<c<<endl;
		}
	}
	else{
		if(e>d){
			cout<<e<<endl;
		}
		else{
			cout<<d<<endl;
		}
	}
}

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

using namespace std;



int main(){
	long long n,a,b,x,ac=0;
	cin >> n;


	for (int i = 1; i < 10; i++){

		for (int j = 1; j < 10; j++){
			if (i*j == n){
				cout << "Yes" << endl;
				return 0;
			}
		}
	}

	cout << "No" << endl;
//	cin >> n;
	return 0;

	
}



Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),count=0;
		char[] str = sc.next().toCharArray();
		sc.close();
		ArrayList<ArrayList<Integer>> array = new ArrayList<ArrayList<Integer>>();
		for(int i=0;i<10;i++) array.add(new ArrayList<Integer>());
		for(int i=0;i<n;i++) array.get((int)str[i]-48).add(i);
		for(int i=0;i<=9;i++) {
			if(array.get(i).size()==0) continue;
			int left=array.get(i).get(0);
			for(int j=0;j<=9;j++) {
				ArrayList<Integer> temp = array.get(j);
				int size=temp.size(),center=0;
				for(int m=0;m<size;m++) {
					center=temp.get(m);
					if(center>left) break;
				}
				if(center==0 || center<=left) continue;
				for(int k=0;k<=9;k++) {
					ArrayList<Integer> temp2 = array.get(k);
					int size2 = temp2.size(),right=0;
					for(int m=0;m<size2;m++) {
						right=temp2.get(m);
						if(right>center) break;
					}
					if(right==0 || right<=center) continue;
					count++;
					//System.out.printf("%d%d%d\n",i,j,k);
				}
			}
		}
		System.out.println(count);
	}
}

Measured memory_bytes: 24984
#include<iostream>
using namespace std;
long long gcd(long long a, long long b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a%b);
}
int main()
{
	int n;
	cin >> n;
	long long temp, sum = 1, m = 1;
	while (n--)
	{
		cin >> temp;
		m = sum / gcd(sum, temp)*temp;
		sum = m;
	}
	cout << sum << endl;
	return 0;
}

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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < n; i++)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    string S;
    cin >> S;

    vector<char> s;
    rep (i, S.size()) {
        s.push_back(S[i]);
    }

    sort(s.begin(), s.end());

    if (s[0] == s[1] && s[1] == s[2] && s[2] == s[3]) {
        No;
        return 0;
    }
    if (s[0] == s[1] && s[2] == s[3]) {
        Yes;
    } else {
        No;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int x[100010];
long long int s[100010];
int main()
{
	int a;
	scanf("%d",&a);
	for(int i=0;i<=a;i++) scanf("%d",&x[i]);
	for(int i=a;i>=0;i--) s[i] = s[i+1] + x[i];
	
	long long int S = 1;
	long long int ans = 0;
	for(int i=0;i<=a;i++)
	{
		ans += S;
		if(S<x[i])
		{
			printf("-1");
			return 0;
		}
		S -= x[i];
		S*=2;
		S = S<s[i+1]?S:s[i+1];
	}
	printf("%lld",ans);
}

Measured memory_bytes: 2880
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


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

int main(void) {
    int n, m, i, a[100003], ft, t;
    ll lcm;

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

    for (i = 0; i < n; i++) {
        t = 0;
        while (a[i] % 2 == 0) {
            a[i] /= 2;
            t++;
        }
        if (i > 0) {
            if (ft != t) {
                cout << 0 << endl;
                return 0;
            }
        }
        else {
            ft = t;
        }
    }

    lcm = 1;
    for (i = 0; i < ft - 1; i++) {
        lcm *= 2;
    }

    for (i = 0; i < n; i++) {
        lcm *= a[i] / gcd(lcm, a[i]);
        if (lcm > m) {
            cout << 0 << endl;
            return 0;
        }
    }
    
    cout << (m + lcm) / (lcm * 2) << endl;

    return 0;
}

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

using namespace std;

int main()
{
    int n, m, p;
    
    while (scanf("%d %d %d", &n, &m, &p) && n){
        int s = 0, t = 0;
        
        for (int i = 1; i <= n; i++){
            int x;
            scanf("%d", &x);
            s += x;
            if (i == m) t = x;
        }
        
        printf("%d\n", t == 0 ? 0 : (s * 100 * (100 - p)) / (100 * t));
    }
    
    return (0);
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  
  vector<int> a(n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    if (i % 2 == 0 && a.at(i) % 2 == 1) ans++;
  }
  
  cout << ans << '\n';
}

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

using namespace std;

typedef long long ll;

const int maxn = 110;
ll v[maxn], w[maxn];
ll dp[maxn][100011];

const ll INF = 1e18;

int main()
{
    int n, W;
    cin >> n >> W;
    for(int i = 1; i <= n; i++){
        cin >> w[i] >> v[i];
    }
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= 100010; j++){
            dp[i][j] = INF;
        }
    }
    dp[0][0] = 0;
    for(int i = 0; i <= n; i++)
        dp[i][0] = 0;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= 100010; j++){
            if (j >= v[i]){
                dp[i][j] = min(dp[i - 1][j - v[i]] + w[i], dp[i - 1][j]);
            } else {
                dp[i][j] = dp[i - 1][j];
            }
        }
    }
    int best = -1;
    for(int i = 0; i <= 100010; i++){
        if (dp[n][i] <= W){
            best = max(best, i);
        }
    }
    cout << best;
    return 0;
}


Measured memory_bytes: 80128
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($arg:expr),*) => {
        #[cfg(debug_assertions)]
        $(writeln!(stderr(), "{} = {:?}", stringify!($arg), $arg).unwrap());*
    };
}

#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

// -----------------------------------------------
// Solution
// -----------------------------------------------
#[derive(PartialEq, Eq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

fn main() {
    let (_N, K, Q) = read!(usize, usize, usize);
    let A = read![[i64]];

    let mut mi = std::i64::MAX;

    let mut ys = A.to_owned();
    ys.sort();
    ys.dedup();

    'a: for y in ys {
        // Y >= y になる操作だけ考える。つまり、y 未満の要素は取り除かないとする。
        // y 未満の要素を含む部分列には操作を適用できないので、そこで列が分離していると考える。
        // y 未満の要素を列から除去して、列をいくつかの部分列に分離する。
        // X - Y を最小化するには、それらの部分列から最小の要素を取り除いていくことで、X を最小化すればいい。

        let mut available = vec![];

        let mut l = 0;
        for r in 0..A.len() + 1 {
            if r < A.len() && A[r] >= y {
                continue;
            }

            if l + K <= r {
                let mut chunk = A[l..r].to_owned();
                chunk.sort();
                for i in 0..(r - l) - (K - 1) {
                    available.push(chunk[i]);
                }
            }
            l = r + 1;
        }

        if available.len() < Q {
            break 'a;
        }

        available.sort();
        // debug!(available);

        let y = available[0];
        let x = available[Q - 1];
        mi = min(mi, x - y);
    }

    println!("{}", mi)
}


Measured memory_bytes: 4352
import Control.Applicative
import Data.List
import Text.Printf
main = do
    [a, b] <- (map read . words) <$> getLine
    putStr $ show $ div a b
    putStr " "
    putStr $ show $ mod a b
    putStr " "
    let f = fromIntegral a / fromIntegral b
    printf "%.8f" $ (f :: Double)
    putStrLn ""

Measured memory_bytes: 3928
import sys
input = sys.stdin.readline
from collections import deque
 
N, M = map(int, input().split())
X = [[] for i in range(N)]
for i in range(N-1):
    x, y = map(int, input().split())
    X[x-1].append(y-1)
    X[y-1].append(x-1)

P = [-1] * N
Q = deque([0])
R = []
while Q:
    i = deque.popleft(Q)
    R.append(i)
    for a in X[i]:
        if a != P[i]:
            P[a] = i
            X[a].remove(i)
            deque.append(Q, a)

##### Settings
unit = 1
merge = lambda a, b, m: a * b % m
adj_bu = lambda a, i: a + 1
adj_td = lambda a, i: a + 1
#####

ME = [unit] * N
XX = [0] * N
TD = [unit] * N
for i in R[1:][::-1]:
    XX[i] = adj_bu(ME[i], i)
    p = P[i]
    ME[p] = merge(ME[p], XX[i], M)
XX[R[0]] = adj_bu(ME[R[0]], R[0])

for i in R:
    ac = TD[i]
    for j in X[i]:
        TD[j] = ac
        ac = merge(ac, XX[j], M)
    ac = unit
    for j in X[i][::-1]:
        TD[j] = adj_td(merge(TD[j], ac, M), i)
        ac = merge(ac, XX[j], M)
        XX[j] = adj_bu(merge(ME[j], TD[j], M), j)

print(*[x - 1 for x in XX], sep = "\n")

Measured memory_bytes: 80424
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    long a,b;
    cin>>a>>b;
    if(a<b)
    {
        cout<<"a < b"<<endl;
    }
    if(a>b)
    {
        cout<<"a > b"<<endl;
    }
    if(a==b)
    {
        cout<<"a == b"<<endl;
    }
    
    return 0;
    
}



Measured memory_bytes: 3112
n,u,v = map(int,input().split())
u-=1
v-=1
# e={i:[] for i in range(1,n+1)}
# for i in range(n):
#     a,b=map(int,input().split)
#     e[a].append(b)
#     e[b].append(a)
roots=[ [] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    roots[a-1]+=[b-1]
    roots[b-1]+=[a-1]
dist=[-1]*n
stack=[]
stack.append(u)
dist[u]=0
while stack:
    label=stack.pop(-1)
    for i in roots[label]:
        if dist[i]==-1:
            dist[i]=dist[label]+1
            stack+=[i]
dist1=dist
dist=[-1]*n
stack=[]
stack.append(v)
dist[v]=0
while stack:
    label=stack.pop(-1)
    for i in roots[label]:
        if dist[i]==-1:
            dist[i]=dist[label]+1
            stack+=[i]
dist2=dist
goal = -1
d = 0
for i in range(n):
    if dist1[i]<dist2[i] and d < dist2[i]:
        d = dist2[i]
        goal = i
else:
    print(dist2[goal]-1)

Measured memory_bytes: 29104
#include <iostream>
using namespace std;
int main(){
	int W,H,x,y,r;
	cin >> W >> H >> x >> y >> r;
	if(x-r>=0 && x+r<=W){
		if(y-r>=0 && y+r<=H)
			cout << "Yes" << endl;
		else 
			cout << "No" << endl;
	}
	else 
		cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 3088
# AOJ ITP2_5_A: Sorting Pairs
# Python3 2018.6.24 bal4u

ps = []
n = int(input())
for i in range(n):
	x, y = map(int, input().split())
	ps.append((x, y))
a = sorted(ps, key=lambda x:(x[0], x[1]))
for i in range(n): print(*a[i])


Measured memory_bytes: 27616
// Back and Forth

func main() {
    let values = readLine()!.split(separator: " ").map{Int($0)!}
    let sx = values[0]
    let sy = values[1]
    let tx = values[2]
    let ty = values[3]

    let dx = tx - sx
    let dy = ty - sy
    var s = ""

    // 最初のゴールまで
    s += String(repeating: "R", count: dx)
    s += String(repeating: "U", count: dy)

    // 戻ってくる
    s += String(repeating: "L", count: dx)
    s += String(repeating: "D", count: dy)

    // 別ルートでゴールへ
    s += "D"
    s += String(repeating: "R", count: dx+1)
    s += String(repeating: "U", count: dy+1)
    s += "L"

    // 別ルートで戻ってくる
    s += "U"
    s += String(repeating: "L", count: dx+1)
    s += String(repeating: "D", count: dy+1)
    s += "R"

    print(s)
}

main()

Measured memory_bytes: 8268
import statistics
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

n = int(input())

x = [int(x) for x in input().split()]

mean = statistics.mean(x)

syukai = Decimal(str(mean)).quantize(Decimal('0'), rounding=ROUND_HALF_UP)

#print(syukai)

sum = 0

for i in range(len(x)):
    sum += (x[i] - syukai)**2

print(sum)

Measured memory_bytes: 6040
import math

def eratosthenes(n):
    prime_list = []
    num_list=[i for i in range(2, n+1)]
    limit = math.sqrt(n)
    while True:
        if limit <= num_list[0]:
            return prime_list + num_list
        prime_list.append(num_list[0])
        num_list = [e for e in num_list if e % num_list[0] != 0]

er_list = eratosthenes(100000)
count = [0]*100000
j = 0
for i in range(er_list[-1]):
    if i == er_list[j]:
        j += 1
        if (i+1)//2 in er_list:
            count[i] = 1 
            
for i in range(1,len(count)):
    count[i]  = count[i]+count[i-1]
    
Q = int(input())
for i in range(Q):
    l, r = map(int, input().split())
    print(count[r]-count[l-1])

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

int main()
{
  ll N;
  cin >> N;
  string s="";
  while(N>0){
    char a;
    if(N%26!=0){
      a = N%26+'a'-1;
      s=a+s;
      N/=26;
    }else{
      a = 'z';
      s=a+s;
      N=N/26-1;
    }
  }
  cout << s << endl;
}

Measured memory_bytes: 3628
import sys

#read = sys.stdin.buffer.read
#input = sys.stdin.buffer.readline
#inputs = sys.stdin.buffer.readlines


# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

def main():
	n=int(input())
	s,t=map(str,input().split())
	a=""
	for i in range(n):
		a+=s[i]+t[i]
	print(a)
	




	
if __name__ == "__main__":
	main()


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

int main(){
    long long a,b,k;
    cin >> a >> b >> k;
    if(a>=k) cout << a-k << " " << b;
    else if(a<k && a+b>=k) cout << 0 << " " << b-k+a;
    else if(a<k && b<k) cout << 0 << " " << 0;
    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 all(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<P>>;

int main() {
    int N;
    cin >> N;
    Graph G(N);
    rep(i, N-1) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        G[a].push_back(P(b, c));
        G[b].push_back(P(a, c));
    }
    int Q, K;
    cin >> Q >> K;
    K--;
    vector<int> x(Q), y(Q);
    rep(i, Q) {
        cin >> x[i] >> y[i];
        x[i]--; y[i]--;
    }

    vector<ll> dist(N, -1);
    queue<int> que;
    dist[K] = 0;
    que.push(K);

    while (!que.empty()) {
        int v = que.front(); que.pop();

        for (P nv: G[v]) {
            if (dist[nv.first] != -1) continue;
            dist[nv.first] = dist[v] + nv.second;
            que.push(nv.first);
        }
    }
    
    rep(i, Q) {
        cout << dist[x[i]] + dist[y[i]] << endl;
    }
    return 0;
}

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

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; }

using ll = long long;
using P = pair<ll,ll>;
using graph = vector<vector<int>>;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const ll INF = 1LL<<60;
const ll mod = 1000000007LL;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

ll dp[105][5][5][5];

int main(){
    int N;
    cin>>N;
    dp[0][0][0][0] = 1;
    rep(n,N){
        rep(i,5){
            rep(j,5){
                rep(k,5){
                    rep(l,5){
                        if(j==1&&k==2&&l==3) continue;
                        if(j==1&&k==3&&l==2) continue;
                        if(j==2&&k==1&&l==3) continue;
                        if(i==1&&j==2&&l==3) continue;
                        if(i==1&&k==2&&l==3) continue;
                        if(n<3||(i!=0&&j!=0&&k!=0&&l!=0))dp[n+1][j][k][l]=(dp[n+1][j][k][l]+dp[n][i][j][k])%mod;
                    }
                }
            }
        }
    }
    ll ans = 0LL;
    rep(i,4){
        rep(j,4){
            rep(k,4) ans = (ans + dp[N][i+1][j+1][k+1])%mod;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3672
package main

import (
	"fmt"
)

func main() {
	var N,M int
	fmt.Scan(&N,&M)
  ans := make([]bool,M)
  for i,_ := range ans{
    ans[i]=true
  }
  for i:=0;i<N;i++{
    var K int
    fmt.Scan(&K)
    temp := make([]bool,M)
    for j:=0;j<K;j++{
      var A int
      fmt.Scan(&A)
      temp[A-1]=true
    }
    for j:=0;j<M;j++{
      ans[j] = ans[j] && temp[j]
    }
  }
  count:=0
  for i:=0;i<M;i++{
    if ans[i]{
      count++
    }
  }
  fmt.Println(count)
	return
}


Measured memory_bytes: 512
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        long X = sc.nextLong();
      long money = 100l;
      int i = 0;
      while(money < X){
        money += money / 100l;
        i++;
      }
      System.out.println(i);
    } 
}

Measured memory_bytes: 35752
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



ll N;
ll A[3005];

int main(){

	scanf("%lld",&N);

	ll ans = 0;

	/*
	 * mを前部の数の最小公倍数-1とすれば良い
	 *
	 *
	 * */
	for(ll i = 0; i < N; i++){

		scanf("%lld",&A[i]);
		ans += A[i]-1;
	}

	printf("%lld\n",ans);

	return 0;
}


Measured memory_bytes: 3844
import numpy as np


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N = int(input())

# A,B = list(map(float, input().split()))

primes = prime_factorize(N)

prime2num = {}
for prime in primes:
    if prime in prime2num:
        prime2num[prime] += 1
    else:
        prime2num[prime] = 1

ans = 0
for prime, num in prime2num.items():
    i = 1
    c = 0
    while True:
        c += i
        if c > num:
            break
        i += 1
        ans += 1
        
print(ans)




Measured memory_bytes: 27152
#include <stdio.h>		// standard input output
#include <iostream>		// input output stream, cin cout( console in console out)
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>		// input output manipulation

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long 

int main() {
  string s;
  cin >> s;
     
  cout << s[0] << s[1] << s[2] << endl; // 標準出力
}

Measured memory_bytes: 3624
# -*- coding: utf-8 -*-
from sys import stdin
# import numpy as np
# import sys
# sys.setrecursionlimit(10**4)
from collections import Counter

def _li(): return list(map(int, stdin.readline().split()))
def _li_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def _lf(): return list(map(float, stdin.readline().split()))
def _ls(): return stdin.readline().split()
def _i(): return int(stdin.readline())
def _f(): return float(stdin.readline())
def _s(): return stdin.readline()[:-1]


MOD = 10**9 + 7
N = _i()
S = list(_s())

s_count = Counter(S)
ans = 1
for _, i in s_count.items():
    ans *= (i+1)
    ans %= MOD
print((ans - 1) % MOD)


Measured memory_bytes: 4336
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int cnt = 0;
		for(int i = a ; i <= b ;i++) {
			if(c % i == 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}

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

#define start          ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define nl            endl;
#define end_            system("pause");
#define sz(v)            ((int)((v).size()))
#define sc(x)            scanf("%d",&x)
#define sc2(x,y)         scanf("%d%d",&x,&y)
#define sc3(x,y,z)       scanf("%d%d%d",&x,&y,&z)
#define sc4(x,y,z,a)     scanf("%d%d%d%d",&x,&y,&z,&a)
#define sc5(x,y,z,a,b)   scanf("%d%d%d%d%d",&x,&y,&z,&a,&b)
#define sc6(x,y,z,a,b,c) scanf("%d%d%d%d%d%d",&x,&y,&z,&a,&b,&c)
#define scl(x)           scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define lp(i,n)        for(int i=0;i<n;i++)
#define lp1(i,f,l)     for(int i=f;i<l;i++)
#define R_(s)         freopen(s, "r", stdin)
#define W_(s)        freopen(s, "w", stdout)
#define R_W R_("input.txt"),W_("output.txt")
#define PI           acos(-1)
#define INF             1<<30
#define mp(a,b) make_pair(a,b)
typedef string            S;
typedef long long         ll;
typedef pair <int, int>   pii;
typedef pair<S, int>     si;
typedef pair<int, S>     is;
typedef pair<char, int>  chi;
typedef pair<S, S>       SS;
typedef vector<pii>        vii;
typedef vector<int>       vi;
typedef vector<vi>       vvi;
typedef vector<S>        vs;
typedef vector<ll>       vll;
typedef vector<vll>     vvll;
ll pw(ll b, ll p){ if (!p) return 1; ll sq = pw(b, p / 2); sq *= sq; if (p % 2) sq *= b; return sq; }
ll gcd(ll a, ll b)  { return (b == 0 ? a : gcd(b, a % b)); }
ll sd(ll x)  { return x<10 ? x : x % 10 + sd(x / 10); }
ll lcm(ll a, ll b){ return ((a*b) / gcd(a, b)); }
vector<ll> get_divisors(ll n){vector<ll> arr;ll i=1;for(i;i*i<=n;i++){if(n%i==0)arr.push_back(i),arr.push_back(n/i);}return arr;}
int dx[4]={0 , 1 , 0 , -1};
int dy[4]={1 , 0 , -1 , 0};
ll fac(ll n)
{
	int o=1;
	lp1(i,2,n+1)
		o*=i;
	return o;
}

int main()
{
    start;
	int x,y;
	string s[101];
	cin>>x>>y;
	lp(i,x)
		cin>>s[i];
	lp(i,y+2)
		cout<<"#";
	cout<<endl;
	lp(i,x)
		cout<<"#"<<s[i]<<"#"<<endl;
	lp(i,y+2)
		cout<<"#";
	cout<<endl;
	//end_;
}

Measured memory_bytes: 256