akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <numeric>
#include <set>
#include <iomanip>
#include <functional>
#define FOR(i, a, n) for (long long i = (a); i < (n); i++)
#define REP(i, n) for(long long i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
using namespace std;
typedef long long ll;

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

	int a, b, ans;

	cin >> a >> b;

	if (a < b)
	{
		cout << 1 << endl;
	}
	else
	{
		int c = a % b;
		ans = a / b;
		if (c >= 1)
			ans++;
		cout << ans << endl;
	}

	return 0;
}

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

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

    int a, b, c;
    cin >> a >> b >> c;
    //A-> quanto gasta pra ouvir
    //B -> quanto ele tem
    //C -> vezes que ele ta satisfeito

    int result;
    result = b/a;
    if(result >= c)
        cout << c << endl;
    else
    {
        cout << result << endl;
    }
    
}

Measured memory_bytes: 256
//
//  atcoder.cpp
//
//
///
#include <bits/stdc++.h>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/multiset_of.hpp>
#include <boost/multi_array.hpp>
#include <boost/math/common_factor.hpp>
#include <boost/algorithm/string.hpp>

#define REP(i, N) for(int i=0; i<(N); i++)
#define REC(f, ...) (void)0; const auto f = [&](const auto f, __VA_ARGS__)
using namespace std;
using namespace boost::math;

using ll = long long;
namespace bst = boost;
template<typename T> class in {
    T value;
public:
    in() { cin >> value; }
    operator const T&() const { return value; }
    operator T&() { return value; }
    in& operator=(T source) { value = source; return *this; }
};
template<> class in<string> : public string {
public:
    in() { cin >> *this; }
};
template<class T> class inseq : public T {
public:
    template<typename... Arg> inseq(Arg... arg) : T(forward<Arg>(arg)...) { for (auto&& i : *this) cin >> i; }
};
template<class T> using invec = inseq<vector<T>>;

auto solve() {
  in<int> A, B;

  if (A > B)
    swap(A,B);
  
  string r;
  
  REP(i, B)
    r += to_string(A);

  return r;
}

template<typename T> void plot(const T& func) { cout << func() << endl; }
template<> void plot<void()>(void(&func)()) { func(); }

int main() {
  plot(solve);

  return 0;
}



Measured memory_bytes: 256
#include<cstdio>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
typedef pair<int,int>pii;
typedef pair<int,pii>piii;
const int dxy[5]={0,-1,0,1,0};
int main(){
    int r;
    while(scanf("%d",&r),r){
        vector<pair<int,int> >ans[2];
        for(int k=0;k<2;k++){
            int w,h,sx,sy;
            int fld[500][500];
            vector<int>vec(1,0);
            scanf("%d%d%d%d",&w,&h,&sx,&sy);
            sx--;sy--;
            for(int i=0;i<h;i++){
                for(int j=0;j<w;j++){
                    int v;
                    scanf("%d",&v);
                    fld[i][j]=v;
                    vec.push_back(v);
                }
            }
            sort(vec.begin(),vec.end());
            vec.erase(unique(vec.begin(),vec.end()),vec.end());
            priority_queue<piii,vector<piii>,greater<piii> >Q;
            int pos=0,cnt=0;
            Q.push(piii(1,pii(sy,sx)));
            bool used[500][500]={{0}};
            while(Q.size()){
                int y=Q.top().second.first,x=Q.top().second.second;
                int v=Q.top().first;
                Q.pop();
                if(used[y][x])continue;
                if(v>vec[pos]){
                    ans[k].push_back(pii(cnt,vec[pos]));
                    pos++;
                    Q.push(piii(v,pii(y,x)));
                    continue;
                }
                used[y][x]=true;
                cnt++;
                for(int i=0;i<4;i++){
                    int ty=y+dxy[i+1],tx=x+dxy[i];
                    if(ty<0||ty>=h||tx<0||tx>=w)continue;
                    Q.push(piii(fld[ty][tx],pii(ty,tx)));
                }
            }
            ans[k].push_back(pii(cnt,vec[pos]));
        }
        //for(int k=0;k<2;k++)for(int i=0;i<ans[k].size();i++)printf("%d...%d:%d\n",k,ans[k][i].first,ans[k][i].second);

        int Min=1000000000;
        for(int i=0;i<ans[0].size();i++){
            int to=r-ans[0][i].first;
            int lb=-1,ub=ans[1].size();
            while(ub-lb>1){
                int mid=(ub+lb)/2;
                if(ans[1][mid].first>=to)ub=mid;
                else lb=mid;
            }
            if(ub==ans[1].size())continue;
            int value=ans[0][i].first+ans[1][ub].first;
            Min=min(Min,ans[0][i].second+ans[1][ub].second);

            //printf("%d:%d->%d\n",ans[0][i].second,ans[1][ub].second,value);
        }
        printf("%d\n",Min);
    }
    return 0;
}

Measured memory_bytes: 9524
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int (i) = 0;(i) < (n) ; ++(i))
#define REPS(a,i,n) for(int (i) = (a) ; (i) < (n) ; ++(i))
#define REVERSE(i,n) for(int (i) = n-1;(i) >= 0 ; --i)
#define ALL(c) (c).begin() , (c).end()
#define LL long long
#define int LL
#define inf  (1LL << 60)
#define mod 1000000007
#define QUICK_CIN ios::sync_with_stdio(false); cin.tie(0);
#define lower lower_bound
#define upper upper_bound
#define ZERO(c,n) memset(&c[0],0,sizeof(int)*n)
#define ZERO2(c,n) memset(&c[0][0],0,sizeof(int)*n
#define pl(a) cout << ""#a": " << a << endl;
#ifdef _DEBUG
#define debug_io fstream cin("input.txt");ofstream cout("output.txt");
#else
#define debug_io ;
#endif
#define debug_input debug_io
#define DOWN(T) std::greater<T>()
template<class T>void scan(vector<T>& a, int n, istream& cin)
{
	T c; REP(i, n) { cin >> c; a.push_back(c); }
}
using vs = vector<string>; using vi = vector<int>; using pii = pair<int, int>;
using psi = pair<string, int>; using vvi = vector<vi>; using pss = pair<string, string>;
using vpii = vector<pii>;
template<class T>bool valid(T x, T w) { return 0 <= x&&x < w; }
int dx[4] = { 1, -1, 0, 0 }; int dy[4] = { 0, 0, 1, -1 };
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------

bool ed[200001];

signed main()
{
	QUICK_CIN;
	debug_input;

	int n;
	cin >> n;
	vpii balls;
	vpii aballs;
	REP(i, n) {
		int c, d;
		cin >> c >> d;
		balls.push_back({ c,d });
		aballs.push_back({ c,i });
		aballs.push_back({ d,i });
	}
	vi r, b;
	REP(i, n) {
		r.push_back(max(balls[i].first, balls[i].second));
		b.push_back(min(balls[i].first, balls[i].second));
	}
	sort(ALL(r));
	sort(ALL(b));

	int cand1 = (r.back() - r[0])*(b.back() - b[0]);

	sort(ALL(aballs));
	int rc = aballs.back().first - aballs[0].first;

	set<pii> select;
	int min_d = inf;
	REP(i, n) {
		select.insert({ min(balls[i].first,balls[i].second),i });
	}
	REP(i, n) {
		min_d = min(min_d, select.rbegin()->first - select.begin()->first);
		auto it = select.begin()->second;
		select.erase(select.begin());
		select.insert({ max(balls[it].first ,balls[it].second),it });
	}

	cout << min(cand1, rc*min_d) << endl;

}

Measured memory_bytes: 28632
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M,length,ans,num;cin>>N>>M;
  vector<pair<int,int>> man(N);
  vector<pair<int,int>> point(M);
  for(int i=0;i<N;i++)cin>>man.at(i).first>>man.at(i).second;
  for(int i=0;i<M;i++)cin>>point.at(i).first>>point.at(i).second;
  
  for(int i=0;i<N;i++){
    ans=1000000000;
    for(int j=0;j<M;j++){
      length=abs(man.at(i).first-point.at(j).first)+abs(man.at(i).second-point.at(j).second);
      if(length<ans){
        num=j+1;
        ans=length;
      }
    }
    cout<<num<<endl;
  }
}

Measured memory_bytes: 256
//rohitaas_15
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> o_set;
#define um<a,b> unordered_map<a,b>
#define ll  long long
#define fastio() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(),v.end()
#define f(a,b) for(ll i=a;i<=b;i++)
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
#define show(x) cout<<x<<"\n"
#define printvector(v,n) f(0,n-1){cout<<v[i]<<" ";}
#define input(v,n) f(0,n-1){cin>>v[i];}
#define vr vector<ll>
#define check() cout<<"hi"<<"\n"
#define MOD 1000000007
#define endl "\n"
#define maxv(v) *max_element(all(v));
#define minv(v) *min_element(all(v));
#define sumv(v) accumulate(all(v),0)
#define test() ll t;cin>>t;while(t--)
ll search(vr arr, ll l, ll r, ll x){if (r >= l) {ll mid = l + (r - l) / 2;if (arr[mid] == x)return mid;if (arr[mid] > x)return search(arr, l, mid - 1, x);return search(arr, mid + 1, r, x);} return -1;}
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll lcm(ll a , ll b){return (a*b)/ gcd(a,b);}
ll power(ll x, ll y, ll p){ll res = 1;x = x % p;while (y > 0){ if (y & 1) res = (res*x) % p; y = y>>1;x = (x*x) % p; } return res; }
ll modInverse(ll n, ll p){return power(n, p-2, p);}
ll CmP(ll n, ll r, ll p=MOD){if (r==0)return 1;ll fac[n+1];fac[0] = 1;for (ll i=1 ; i<=n; i++)fac[i] = fac[i-1]*i%p; return (fac[n]* modInverse(fac[r], p) % p *modInverse(fac[n-r], p) % p) % p; }
int main()
{
	fastio();
	string s;
	cin>>s;
	if(s[2]==s[3] && s[4]==s[5])
	{
		show("Yes");
	}
	else
	{
		show("No");
	}
}







Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int n;
    cin >> n;
    vector<ld> p(n);
    rep(i, n)cin >> p[i];
    vector<vector<ld>> dp(n+1, vector<ld>(n+1, 0));
    dp[0][0] = 1;
    rep(i, n)rep(j, n){
        dp[i+1][j] += dp[i][j] * (1 - p[i]);
        dp[i+1][j+1] += dp[i][j] * p[i];
    }
    ld ans = 0;
    for(int i = (n+1)/2; i <= n; i++){
        ans += dp[n][i];
    }
    cout << setprecision(11);
    cout << ans << endl;
}

Measured memory_bytes: 144276
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

int main() {
  int H, W, h, w;
  cin >> H >> W >> h >> w;
  cout << (H-h)*(W-w) << endl;
}

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

int main() {
	int x, y;
	cin>>x>>y;
	int ans = 0;
	if (x == 1 && y == 1)
		ans += 400000;
	auto add = [&](int st) {
		if (st == 1)
			return 300000;
		else if (st == 2)
			return 200000;
		else if (st == 3)
			return 100000;
		return 0;
	};
	ans += add(x) + add(y);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
struct UnionFind {
  /*
  UnionFind uf(x)で初期化
  root(x) xの根を返す
  unite(x,y) xとyを同一の根にする
  same(x,y) xとyの根が同一ならtrue
  size(x)　集合の大きさを返す*/
  vector<int> d;
  UnionFind(int n) : d(n, -1) {}
  int root(int x) {  // xの根を返す
    if (d[x] < 0) return x;
    return d[x] = root(d[x]);
  }
  bool unite(int x, int y) {
    x = root(x);  // xとyを連結する
    y = root(y);
    if (x == y) return 0;
    if ((d[x] > d[y])) swap(x, y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  bool same(int x, int y) { return root(x) == root(y); }
  int size(int x) { return -d[root(x)]; }
};
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> p(N);
  REP(i, N) cin >> p[i], p[i]--;
  UnionFind uf(N);
  REP(i, M) {
    int a, b;
    cin >> a >> b, a--, b--;
    uf.unite(a, b);
  }
  int ans = 0;
  REP(i, N) {
    if (uf.root(i) == uf.root(p[i])) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3972
import fractions

K = int(input())

gcds = []

for i in range(K):
  g = []
  for j in range(K):
    g.append(fractions.gcd(i + 1, j + 1))
  gcds.append(g)

result = 0

for a in range(K):
  for b in range(K):
    gcd_ab = gcds[a][b]
    for c in range(K):
      result += (gcds[gcd_ab-1][c])

print(result)

Measured memory_bytes: 10908
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

K = int(input())
A, B = map(int, input().split())

for i in range(A, B+1):
    if i%K == 0:
        print('OK')
        exit()
print('NG')


Measured memory_bytes: 9472
#include <iostream>

int main()
{
    int n = 0;
    int money = 0;

    std::cin >> n;
    std::cin >> money;

    bool suc_f = false;

    int i,j,k;

    for(i = 0;i <= n;i++)
    {
        for(j = 0;j <= n - i;j++)
        {
            if(i * 10000 + j * 5000 + (n - i - j) * 1000 == money && n - i - j >= 0)
            {
                suc_f = true;

                goto l;
            }
        }
    }

    l:

    if(suc_f)std::cout<<i<<" "<<j<<" "<<n-i-j<<std::endl;
    else std::cout<<"-1 -1 -1"<<std::endl;
}

Measured memory_bytes: 256
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

x,y = imap()
a = 2*x - y//2
b = -x + y//2

ans = "Yes"
if a<0 or b<0: ans = "No"
if y%2 != 0: ans = "No"

print(ans)


Measured memory_bytes: 37608
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <iomanip>       // fixed, setprecision
using namespace std;

int main()
{
  string S;
  cin >> S;
  bool easy = true;
  for (int i = 0; i < S.length(); i++)
  {
    if ((i % 2 == 0) && (S[i] == 'L'))
    {
      easy = false;
    }
    if ((i % 2 == 1) && (S[i] == 'R'))
    {
      easy = false;
    }
  }

  cout << (easy ? "Yes" : "No") << endl;
}


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


int main() {
    string S;
    long long K;
    int ans=0;
    cin >> S >> K;
    for(int i = 0; i < S.size() ;i++){
        if(S.at(i)=='1' && i==K-1){
            cout << 1 << endl;
            break;
        }
        if(S.at(i)!='1'){
            cout << S.at(i) << endl;
            break;
        }
    }
        
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
#include <numeric>

using namespace std;

int main() {
	int64_t k;
	cin >> k;
	/*
	if (k < 1000000) {
		if (k % 2 == 0) {
			cout << k / 2 + 1 << " " << k / 2 + 1 << endl;
		}
		else {
			cout << k / 2 + 1 + 2 << " " << k / 2 + 1 - 1 << endl;
		}
	}*/

	//else {
		int n = 50;
		int64_t base = k / n;
		int64_t res = k % n;
		int64_t bb = base + n - 1;
		vector<int64_t> vec(n, bb);
		for (int i = 0; i < n; ++i) {
			if (i < res) {
				vec[i] += n - res + 1;
			}
			else {
				vec[i] -= res;
			}
		}
		cout << n << endl;
		for (int i = 0; i < n; ++i) {
			if (i == 0) cout << vec[i];
			else cout << " " << vec[i];
		}
		cout << endl;
	//}
	return 0;
}

Measured memory_bytes: 256
let read_lines () =
  let rec iter xs =
    try read_line() :: xs |> iter
    with End_of_file -> xs
  in iter [] |> List.rev

let split_nums str =
  Str.split (Str.regexp " ") str
  |> List.map float_of_string

let solve_se = function
    | [a; b; c; d; e; f] ->
       let x = (e*.c -. b*.f) /. (e*.a -. b*.d) in
       let y = (c -. a*.x) /. b in
       (x, y)
    | _ -> raise (Invalid_argument "line should be 6 nums.")

let print_answer (x, y) =
  let fmt x =
    let s = Printf.sprintf "%.3f" x in
    if s = "-0.000" then "0.000"
    else s
  in
  Printf.printf "%s %s\n" (fmt x) (fmt y)

let () =
  read_lines ()
  |> List.map split_nums
  |> List.map solve_se
  |> List.iter print_answer

Measured memory_bytes: 2236
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int x[114514];
lint dp[114514],mi[114514];
int main()
{
	int n,e,t,now=0;lint out=0,inf=1145141919810893LL,nmi=inf;
	scanf("%d %d %d",&n,&e,&t);
	rep(i,n) scanf("%d",&x[i]);x[n]=2001001001;
	rep(i,n+10) dp[i]=mi[i]=inf;dp[0]=0;
	rep(i,n+1){
		if(i>1) nmi+=2*(x[i-1]-x[i-2]);
		nmi=min(nmi,mi[i]);
		dp[i]=min(dp[i],nmi);
		int ne=lower_bound(x,x+n+1,x[i]+t/2+1)-x;
		dp[ne]=min(dp[ne],dp[i]+t);
		if(ne<n) mi[ne+1]=min(mi[ne+1],dp[i]+2*(x[ne]-x[i]));
	}
	out=e+dp[n];
	cout<<out<<endl;
}


Measured memory_bytes: 2304
using System;
using System.Linq;

class B
{
	static void Main()
	{
		var n = int.Parse(Console.ReadLine());
		var d = Console.ReadLine().Split().Select(int.Parse).ToArray();
		Console.WriteLine(Enumerable.Range(0, n).SelectMany(i => Enumerable.Range(i + 1, n - i - 1).Select(j => d[i] * d[j])).Sum());
	}
}


Measured memory_bytes: 13396
n = int(input())
point = []
for _ in range(n):
    point.append((tuple(map(int, input().split()))))
point = list(set(point))
point = sorted(point)
if len(point) == 1: print(0)
else:  
    d1 = max([(x+y) for x,y in point])- min([(x+y) for x,y in point])
    d2 = max([(x-y) for x,y in point]) - min([(x-y) for x,y in point])
    print(max(d1,d2))

Measured memory_bytes: 48276
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
vector<string> split(string s, char p){vector<string>v;stringstream m(s);string b;while(getline(m,b,p))v.push_back(b);return v;}
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 (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

int main(){
    ll N, K; cin >> N >> K;
    vector<ll> p(N);
    REP(i, N) cin >> p[i];
    ASC(p);
    ll ans = 0;
    REP(i, K) ans += p[i];
    cout << ans << "\n";
}


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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    int N,K,T,U,V,L; cin >> N >> K >> T >> U >> V >> L;
    vector<int> D(N);
    for (int i=0;i<N;++i) cin >> D[i];
    int rest=0,carrot=0,now=0;
    double ans=0;
    for (int i=1;i<=L;++i){
        if (rest>0) ans+=(double)1.0/V,--rest;
        else ans+=(double)1.0/U;
        if (now<N&&D[now]==i){
            ++now;
            if (carrot==K) rest=T*V;
            else ++carrot;
        }
        if (rest==0&&carrot>0) rest=T*V,--carrot;
    }
    cout << ans << '\n';
}


Measured memory_bytes: 3296
library = """
# distutils: language=c++
# distutils: include_dirs=[/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
cdef extern from "/opt/atcoder-stl/atcoder/dsu.hpp" namespace "atcoder":
    cdef cppclass dsu:
        dsu(int n)
        int merge(int a, int b)
        bool same(int a, int b)
        int leader(int a)
        int size(int a)
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "atcoder":
    cdef cppclass fenwick_tree[T]:
        fenwick_tree() except +
        fenwick_tree(int n) except +
        void add(int p, T x)
        T sum(int l, int r)
cdef class DSU:
    cdef dsu *_thisptr
    def __cinit__(self, int n):
        self._thisptr = new dsu(n)
    def __dealloc__(self):
        del self._thisptr
    cpdef int merge(self, int a, int b):
        return self._thisptr.merge(a, b)
    cpdef bool same(self, int a, int b):
        return self._thisptr.same(a, b)
    cpdef int leader(self, int a):
        return self._thisptr.leader(a)
    cpdef int size(self, int a):
        return self._thisptr.size(a)
cdef class BIT:
    cdef fenwick_tree[long] _thisptr
    def __cinit__(self, int n = 0):
        if n == 0:
            self._thisptr = fenwick_tree[long]()
        else:
            self._thisptr = fenwick_tree[long](n)  
    cpdef void add(self, int p, long x):
        self._thisptr.add(p, x)
    cpdef long sum(self, int l, int r):
        return self._thisptr.sum(l, r)
"""
import os,sys
if sys.argv[-1] == 'ONLINE_JUDGE':
    open('atcoder.pyx','w').write(library)
    os.system('cythonize -i -3 -b atcoder.pyx')
 
# ↑ここまでライブラリ↓ここから解法
 
import sys
import atcoder
input = sys.stdin.buffer.readline
n, q = map(int, input().split())
dummy = atcoder.BIT()
bit = atcoder.BIT(n)
*map(bit.add, range(n), map(int, input().split())),
res = []
for i in range(q):
    t, u, v = map(int, input().split())
    if t: res.append(bit.sum(u, v))
    else: bit.add(u, v)
print('\n'.join(map(str, res)))

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

using namespace std;
typedef long long ll;
const int maxn = 1e6 + 100;
const ll inf = 0x3f3f3f3f3f;
const int mod = 1e9 + 7;


int main() {
    int n, m, a, b;
    scanf("%d %d %d %d", &n, &m, &a, &b);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (j < a && i < b) printf("0");
            else if (j >= a && i >= b) printf("0");
            else printf("1");
        }
        printf("\n");
    }

    return 0;
}


Measured memory_bytes: 1280
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            int N = cin.ReadInt;
            int A = cin.ReadInt;
            int B = cin.ReadInt;
            int ans = 0;
            for(int i=1;i<=N;i++){
                int Man = i/10000;
                int Sen = i/1000%10;
                int hyaku = i/100%10;
                int juu = i/10%10;
                int ichi = i%10;
                int X =Sen+ hyaku + juu+ ichi + Man;
                if ((A<=X) && (X<=B)){
                    ans+=i;
                }
            }
            WriteLine(ans);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator =' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }
}

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

#define INF 100000000

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

    rep2(i,a,b+1){
        if(i % k == 0){
            cout << "OK" <<endl;
            return 0;
        }
    }

    cout << "NG" <<endl;
    return 0;
}


Measured memory_bytes: 3592
import java.util.Scanner;
public class Main {
    public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int[]a = new int[3];
    int[]b = new int[3];
    int[]c = new int[3];

    for(int i=0; i<3; i++) {
    	a[i] = sc.nextInt();
    }
    for(int i=0; i<3; i++) {
    	b[i] = sc.nextInt();
    }
    for(int i=0; i<3; i++) {
    	c[i] = sc.nextInt();
    }
    int n = sc.nextInt();
    int[]d = new int[n];
    
    int coua = 0;
    int coub = 0;
    int couc = 0;
    int cou1 = 0;
    int cou2 = 0;
    int cou3 = 0;
    int coue = 0;
    int couf = 0;
  
     for(int i=0; i<n; i++) {
    	d[i] = sc.nextInt();
    	if(d[i]==a[0]){
    		coua++; cou1++; coue++;
    	}else if(d[i]==a[1]) {
    		coua++; cou2++;
    	}else if(d[i]==a[2]) {
    		coua++; cou3++; couf++;
    	}else if(d[i]==b[0]) {
    		coub++; cou1++;
    	}else if(d[i]==b[1]) {
        	coub++; cou2++; coue++; couf++;
    	}else if(d[i]==b[2]) {
        	coub++; cou3++;
    	}else if(d[i]==c[0]) {
        	couc++; cou1++; couf++;
        }else if(d[i]==c[1]) {
        	couc++; cou2++;
        }else if(d[i]==c[2]) {
        	couc++; cou3++; coue++;   
     	}
    }
    	if(coua==3 || coub==3 || couc==3 || cou1==3 || cou2==3 || cou3==3 || coue==3 || couf==3) {
    	System.out.println("Yes");
    	}else {
    	System.out.println("No");
    }
      }
}


Measured memory_bytes: 35708
import java.util.Scanner;
import java.math.BigInteger;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    BigInteger A = sc.nextBigInteger();
    BigInteger B = sc.nextBigInteger();
    if (A.compareTo(B) > 0) System.out.println("GREATER"); 
    if (A.compareTo(B) < 0) System.out.println("LESS"); 
    if (A.compareTo(B) == 0) System.out.println("EQUAL"); 
  }
}

Measured memory_bytes: 20948
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mod 1000000007
using namespace std;

/*2進数配列+1*/
vector<int> twoadd(vector<int> v, int N){
    v[N-1]+=1;
    int ind = N-1;
    int j=N-1;
    for(j=N-1;j>=1;j--){
        if(v[j]>1){
            v[j-1]+=1;
            v[j]=0;
        }
    }
    return v;
}

/*フィボナッチ*/
long long fibonatti(long long d){
    long long count = 0;
    long long f1 = 1;
    long long f2 = 1;/*ここを変える*/
    long long temp;
    if(d == 1){
        count = f1;
    }else if(d == 2){
        count = f2;
    }else if(d==0){
        count = 1;
    }else{
        for(int i=0;i<d-2;i++){
            temp = f1+f2;
            f1 = f2;
            f2 = temp;
        }
        count = temp;
    }
    return count;
}

/*最大公約数*/
unsigned long long GCD(long long L,long long R){
    if(L>R){
        long long temp=R;
        R = L;
        L = temp;
    }
    unsigned long long pp=0,ppt=0;
    unsigned long long ans=0;
    if(R%L==0){
        ans = L;
    }else{
        while(true){
            ppt = pp;
            pp=R%L;
            if(pp == 0){
                ans = ppt;
                break;
            }
            R = L;
            L = pp;
        }
    }    
    return ans;    
}

/*最小公倍数*/
unsigned long long LCM(long long L,long long R){
    unsigned long long ans;
    unsigned long long gcd = GCD(L,R);
    ans = (L/gcd)*R;
    return ans;
}

/*Combination set*/
#define maxcomb 3000/*大きいものを求めるときはここを変える*/
vector<long long> fc(maxcomb+1);
vector<long long> ifc(maxcomb+1);
long long modpow(long long x,long long n){
    long long ans = 1;
    while(n > 0){
        if(n & 1) {
            ans = ans*x%mod;
        }
        x = x*x%mod;
        n >>= 1;
    }
    return ans;
}
void Conb(){
    fc[0]= 1;
    ifc[0]=1;
    for(long long i=0;i<maxcomb;i++){
        fc[i+1] = fc[i]*(i+1)%mod;//n!(mod)
        ifc[i+1] = ifc[i]*modpow(i+1,mod-2)%mod;//k!^{M-2} (mod)
    }
}
unsigned long long Combination(long long L,long long R){
    unsigned long long up=1,ans;
    Conb();
    if(L==0&&R==0){
        return 1;
    }else if(L<R||L<0){
        return 0;
    }else{
        long long t = ifc[L-R]*ifc[R]%mod;
        ans = t*fc[L]%mod;
    }
    return ans;
}
/*Combination set ここまで*/

/*ここから*/
int main() {
    ll K,N;
    cin >> N >> K;
    ll Red = N-K;
    for(int i=1;i<=Red+1;i++){
        ull ans = (Combination(Red+1,i)%mod)*(Combination(K-1,i-1)%mod);
        ans %= mod;
        cout << ans << endl;
        if(i==K){
            break;
        }
    }
    if(Red+1<K){
        for(int i=0;i<K-Red-1;i++){
            cout << 0 << endl;
        }
    }
    return 0;
}

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

using namespace std;

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

int main(){
  string s, t;
  cin >> s >> t;
  cout << (t.substr(0, s.size()) == s ? "Yes" : "No") << endl;
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define fin(x) cout << x << endl;

using namespace std;
using ll = long long;

int main(void) {
  int n;
  cin >> n;
  int ans = n / 2 + n % 2;
  fin(ans);
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#define bogo_sort std::sort
#define bozo_sort std::stable_sort
#define alles(obj) obj.begin(), obj.end()
#define elif else if
#define unless(flg) if(!(flg))
#define elless(flg) else if(!(flg))
#define echo std::cout <<
#define read std::cin >>
#define endl std::endl
#define fin << '\n'
#define bash push_back
#define makePair std::make_pair
#define _ << ' ' <<
// type-define
#define Stack std::stack
#define Queue std::queue
#define Set std::set
#define PQueue std::priority_queue
#define Vector std::vector
#define Pair std::pair
#define Map std::map
#define HashMap std::unordered_map
#define Greater std::greater
using String = std::string;
using llong = long long;
using boolean = bool;
using Pii = Pair<int, int>;
using Vi = Vector<int>;
using Vii = Vector<Pii>;
// utils
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;

namespace {
    template<class A, class B> A power ( llong x, llong n, llong mod ) {
        llong ans = 1;
        while ( n > 0 ) {
            if ( n & 1 ) ans = ( ans * x ) % mod;
            x = ( x * x ) % mod;
            n >>= 1;
        }
        return ans;
    }
    template<class A, class B> A power ( A x, B n ) { return power( x, n, 1000000007 ); }
    template<class A> A gcd ( A x, A y ) { return x % y ? gcd( y, x % y ) : y; }
    template<class A, class B> A lcm ( A x, B y ) { return ( x / gcd(x, y) * y ); }
    template<class A> inline A abs ( A n ) { return ( n < 0 ) ? -n : n; }
    template<class A, class B> inline bool chmax ( A &a, const B &b ) { return b > a ? a = b, true : false; }
    template<class A, class B> inline bool chmin ( A &a, const B &b ) { return b < a ? a = b, true : false; }
    boolean isMovable ( int x, int y, int w, int h ) {
        return ( x >= 0 && y >= 0 && x < w && y < h );
    }
}

namespace Rlyeh {

    int sum;
    int max;

    signed call_of_Cthulhu( signed datum ) {

        int n;
        read n;
        for ( int i = 0; i < n; i++ ) {
            int a;
            read a;
            sum += a;
            chmax(max, a);
        }
        sum -= (max/2);
        echo sum fin;

        return 0;
    }
}
signed main(){std::cin.tie(0); std::ios::sync_with_stdio(false); int main_result = Rlyeh::call_of_Cthulhu(114514); return 0;}


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

int main() {
   int N, K, count=0;
   cin >> N >> K;
   vector<int> v(N);
   for(int i=0; i<N; i++) {
      cin >> v[i];
      if(v[i] >= K) count++;
   }
   cout << count << endl;
}

Measured memory_bytes: 3532
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define R(i,c,n) for(int i=c;i<n;i++)
#define DEBUG(x) cerr << #x << ": " << x << endl;
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v)  sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back
using namespace std;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c;
  cin >> a >> b >> c;
  cout << a * b / 2 << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector <int> d(n);
    for(int i = 0; i < n; i++){
        cin >> d[i];
    }
    sort(d.begin(),d.end());
    int value1 = d[n/2];
    int value2 = d[n/2-1];
    vector <int> ans;
    while(value1>value2){
        ans.push_back(value1);
        value1--;
    }
    cout << ans.size() << endl;
    return 0;
}

Measured memory_bytes: 4240
#include<stdio.h>
#include<stdlib.h>
int cmp(const void*a,const void *b){return *(int*)a-*(int*)b;}
int main(){
    int n;
    scanf("%d",&n);
    int d[n];
    for(int i=0;i<n;i++)
        scanf("%d",&d[i]);
    qsort(d,n,sizeof(int),cmp);
    int p=d[n/2-1];
    int q=d[n/2];
    printf("%d\n",q-p);
    return 0;
}

Measured memory_bytes: 892
#include <vector>
#include <stack>
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <typeinfo>
#include <queue>

using namespace std;

void ni_exe(){
	int n,a,b;
	string s;
	cin >> n >> a >> b;
	cin >> s;
	int tmp_a = 0;
	int tmp_b = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == 'a'){
			//tmp_a++;
			if(tmp_a + tmp_b < a + b){
				tmp_a++;
				cout << "Yes" << endl;
			}
			else
				cout << "No" << endl;
		}
		else if(s[i] == 'b'){
			if((tmp_a + tmp_b < a + b) && tmp_b < b){
				tmp_b++;
				cout << "Yes" << endl;
			}
			else
				cout << "No" << endl;
		}
		else
			cout << "No" << endl;
	}
}


int main(){
	ni_exe();
	return 0;
}

Measured memory_bytes: 896
#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(dead_code)]
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(dead_code)]
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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(dead_code)]
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")
    };
}

fn main() {
    input!{
        l: usize,
        r: usize,
    }
    // 2019 でわりきれる数字があるなら最小は絶対0
    if 2019 * ((l / 2019) + 1) <= r {
        println!("0");
        return;
    }
    // そうでないなら幅は2019未満なので全探索できる
    let mut v = 2019;
    for i in l .. r {
        for j in l + 1 .. r + 1 {
            v = min(v, i * j % 2019);
        }
    }
    println!("{}", v);
}


Measured memory_bytes: 4352
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("");

  const answer = (input[0] === input[1]) && (input[0] === input[2]) && (input[1] === input[2]) ? "No" : "Yes";

  console.log(answer);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 22080
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

struct Edge{
	int src,dst;
	Edge(){}
	Edge(int s,int d):src(s),dst(d){}
};
typedef vector<vector<Edge>> Graph;

void dfs(const Graph& g,int v,vector<int>& flg)
{
	if(flg[v]) return;
	flg[v]=1;
	for(Edge e:g[v])
		dfs(g,e.dst,flg);
}

int main()
{
	for(int n;cin>>n,n;){
		map<string,int> ntoi;
		Graph g;
		for(int i=0;i<n;i++){
			string line; cin>>line;
			for(char& c:line)
				if(c==':' || c==',' || c=='.')
					c=' ';
			istringstream iss(line);
			vector<int> temp;
			for(string name;iss>>name;){
				if(!ntoi.count(name)){
					ntoi.insert(make_pair(name,ntoi.size()));
					g.resize(g.size()+1);
				}
				temp.push_back(ntoi[name]);
			}
			for(int i=1;i<temp.size();i++)
				g[temp[0]].emplace_back(temp[0],temp[i]);
		}
		
		int m=g.size();
		vector<int> flg(m);
		dfs(g,0,flg);
		
		int res=0;
		for(int i=0;i<m;i++)
			if(flg[i] && g[i].size()==0)
				res++;
		cout<<res<<endl;
	}
}

Measured memory_bytes: 1408
from itertools import product

x,y,z,k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
d = sorted([s+t for s,t in product(a,b)], reverse=True)[:3000]
e = sorted([s+t for s,t in product(c,d)], reverse=True)[:k]
[print(i) for i in e]


Measured memory_bytes: 144012
import java.util.*;
import java.io.*;

public class Main {
	static PrintWriter out;
	static StringBuilder sb;
	static int mod = 998244353;
	static int inf = (int) 1e15;
	static ArrayList<Integer>[] ad;
	static int n, s;
	static int[][][] memo;
	static int[] a;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		System.out.println(c+" "+a+" "+b);
		out.close();
	}

	static class pair {
		int id;
		int v;

		public pair(int i, int vi) {
			id = i;
			v = vi;
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}


Measured memory_bytes: 21332
N = int(input())
A, B = map(int, input().split())
P = list(map(int, input().split()))
L1 = [1 for x in P if x <= A]
L2 = [1 for x in P if A < x <= B]
L3 = [1 for x in P if B < x]
print(min(sum(L1), sum(L2), sum(L3)))

Measured memory_bytes: 3064
n = int(input())
check = 0
for i in range(1, n // 2 + 1):
    if n % i == 0:
        if (n / i <= 9) and (i <= 9):
            check = 1
if n == 1:
    check = 1
if check == 1:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
import java.util.Scanner;

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 i;
        int nDiv = 0;
        for (i=a; i<=b; i++) {
            if (c % i == 0) nDiv++;
        }
        System.out.println(nDiv);
    }
}


Measured memory_bytes: 26276
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))
#define iter(v,ite) for(auto ite=(v).begin();ite!=(v).end();ite++)
#define mimunum(v,x) distance((v).begin(),lower_bound((v).begin(),(v).end(),x))


int n,k;
int qs[35]={};

int A[100005];
lli B[100005];

int main(void){
	scanf("%d%d",&n,&k);
	int b=1; qs[0]=k;
	rep(i,30){
		if(b<=k &&  (k&b)!=0){
			qs[i+1] = (k^b) | (b-1);
		}
		b *= 2;
	}
	rep(i,n){
		scanf("%d%lld",&A[i],&B[i]);
	}
	
	lli ans=-1;
	reg(i,0,30){
		k = qs[i];
		lli ns=0;
		rep(j,n){
			if((k & A[j]) == A[j])ns += B[j];
		}
		ans = max(ans,ns);
		//printf("  %d %lld\n",k,ns);
	}
	printf("%lld\n",ans);
	return 0;
}






Measured memory_bytes: 1408
#include <algorithm>
#include <boost/optional.hpp>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0, i##_MACRO = (n); i < i##_MACRO; i++)
#define RANGE(i, a, b) for(int i = (a), i##_MACRO = (b); i < i##_MACRO; i++)
#define EACH(e, a) for(auto&& e : a)
#define ALL(a) std::begin(a), std::end(a)
#define RALL(a) std::rbegin(a), std::rend(a)
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)
#define INT(x) (static_cast<int>(x))

using namespace std;

using ll = long long;
using VI = vector<int>;
using VI2D = vector<vector<int>>;

constexpr int INF = 2e9;
constexpr double EPS = 1e-10;
constexpr double PI = acos(-1.0);

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

template <typename T>
constexpr int sign(T x) {
	return x < 0 ? -1 : x > 0 ? 1 : 0;
}

template <>
constexpr int sign(double x) {
	return x < -EPS ? -1 : x > EPS ? 1 : 0;
}

template <typename T, typename U>
constexpr void chmax(T& m, U x) {
	m = max(m, x);
}

template <typename T, typename U>
constexpr void chmin(T& m, U x) {
	m = min(m, x);
}

template <typename T>
constexpr T square(T x) {
	return x * x;
}

bool is_lunlun(int x) {
	int last = x % 10;
	while(x /= 10) {
		int d = x % 10;
		if(abs(last - d) > 1) {
			return false;
		}
	}
	return true;
}

int main() {
	int k;
	cin >> k;
	VI n(11, -1);
	int count = 0;
	n[0] = 0;
	while(count != k) {
		int d;
		for(d = 0; n[d] != -1; d++) {
			if(n[d] == 9) {
				continue;
			}
			if((d == 0 || abs(n[d - 1] - (n[d] + 1)) <= 1) &&
			   (n[d + 1] == -1 || abs((n[d] + 1) - n[d + 1]) <= 1)) {
				n[d]++;
				for(int i = d - 1; i >= 0; i--) {
					if(n[i + 1] == 0) {
						n[i] = 0;
						continue;
					}
					n[i] = n[i + 1] - 1;
				}
				break;
			}
		}
		if(n[d] == -1) {
			n[d] = 1;
			for(int i = d - 1; i >= 0; i--) {
				n[i] = 0;
			}
		}
		count++;
	}
	int i;
	for(i = 0; i < 11; i++) {
		if(n[i] == -1) {
			break;
		}
	}
	for(i = i - 1; i >= 0; i--) {
		cout << n[i];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256