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

using namespace std;

int main() {
	int n;
	cin >> n;
	
	int input;
	int min = INT_MAX, max = INT_MIN;

	for (int i = 0; i < n; i++) {
		cin >> input;

		if (max < input - min) max = input - min;
		if (min > input) min = input;
	}

	cout << max << endl;

	return 0;
}



Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = (int)1e9 + 7;
int INF = (int)2e18;
const int maxN = 3005;

int S[maxN], T[maxN];
int N, M, dp[maxN][maxN];

signed main() {
    cin >> N >> M;
    for (int i = 1; i <= N; i++) cin >> S[i];
    for (int i = 1; i <= M; i++) cin >> T[i];
    for (int i = 0; i <= M; i++) dp[0][i] = 1;
    int count[100001];
    for (int i = 1; i <= N; i++) {
        dp[i][0] = 1;
        memset(count, 0, sizeof count);
        for (int j = 1; j <= M; j++) {
            count[T[j]] = (count[T[j]] + dp[i - 1][j - 1]) % mod;
            dp[i][j] = (dp[i - 1][j] + count[S[i]]) % mod;
        }
    }
    cout << dp[N][M] << endl;
}


Measured memory_bytes: 47872
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#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;

#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define pb push_back
#define eb emplace_back
#define mt make_tuple
#define MP make_pair
#define fs first
#define sc second
#define F first
#define S second
#define nl "\n"
#define asche cerr<<"Ekhane asche\n";
#define pf printf
#define sf scanf
#define mem(a,x) memset(a,x,sizeof(a))
#define SZ(v) (int)v.size()
#define all(v) v.begin(),v.end()
#define one(x) __builtin_popcount(x)
#define fout(x) fixed<<setprecision(x)
#define BeatMeScanf ios_base::sync_with_stdio(false)
//int dx[]={1,0,-1,0,1,-1,-1,1};
//int dy[]={0,1,0,-1,1,1,-1,-1};
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); deb(_it, args); }
void deb(istream_iterator<string> it) {}
template<typename T, typename... Args>
void deb(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    deb(++it, args...);
}
//template <typename T> using o_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
namespace IO
{
    #define in() ( { int a ; scanf("%d",&a); a; } )
    #define LL() ( { ll a ; scanf("%lld",&a); a; } )
    #define ULL() ( { ull a ; scanf("%llu",&a); a; } )
    #define DD() ({ double a; scanf("%lf", &a); a;})
    #define CC() ( { char a ; scanf("%c",&a); a; } )
    #define pf1(a) printf("%d\n",a)
    #define pf1ll(a) printf("%lld\n",a)
}
using namespace IO;

const int mod=1e9+7;
const int N=3e5+9;
const double eps=1e-9;
const double PI=acos(-1.0);
ll qpow(ll n,ll k) {ll ans=1;assert(k>=0);n%=mod;while(k>0){if(k&1) ans=(ans*n)%mod;n=(n*n)%mod;k>>=1;}return ans%mod;}

int a[N];
int32_t main()
{
    ///BeatMeScanf;
    int n=in();
    for(int i=1;i<=n;i++) a[i]=in();
    int ans=0;
    for(int i=1,j;i<=n;i=j){
        for(j=i+1;j<=n&&a[j]<=a[j-1];j++);
        ans=max(ans,j-i);
    }
    pf1(ans-1);
    return 0;
}
///Before submit=>
///    *check for integer overflow,array bounds
///    *check for n=1


Measured memory_bytes: 640
num = gets.to_i
ary = gets.split.map(&:to_i)
  
count = 0
index_last = num - 2
  
while index_last >= 0
  
  for i in 0 .. index_last
  
    if ary[i] > ary[i + 1]
      ary[i], ary[i + 1] = ary[i + 1], ary[i]
      count += 1
    end
  end
  
  index_last -= 1
end

puts ary.join(" "), count


Measured memory_bytes: 8872
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<pii>;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (ll)((x).size())
#define all(x) (x).begin(), (x).end()
#define each(a, x) for (auto&& a : (x))
#define _overload3(_1,_2,_3,name,...) name
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) for (ll i=(a); i<(n); ++i)
#define rep(...) _overload3(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template<class T> inline void print(const T& x) {cout << x << "\n";}
template<class T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template<class T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
struct Init {Init() {cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10);}} init;

int main(){
    ll n; cin >> n;
    vi a(n);
    ll sall = 0;
    ll sodd = 0;
    rep(i, n) {
        cin >> a[i];
        sall += a[i];
        if (i & 1) sodd += a[i];
    }
    vi x(n);
    x[0] = sall - 2 * sodd;
    rep(i, n - 1) x[i + 1] = 2 * a[i] - x[i];
    each(a, x) cout << a << " ";
}

Measured memory_bytes: 4792
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
  
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
  
using namespace std;
  
typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;
  
const int INF=1<<29;
const double EPS=1e-9;
  
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int prime[100001];

void sieve() {
    for(int i = 0; i < 100000; i++) prime[i] = 1;
    prime[0] = prime[1] = 0;
    for(int i = 2; i <= 100000; i++) {
        if (prime[i]) {
            for(int j = i + i; j <= 100000; j += i) {
                prime[j] = 0;
            }    
        }
    }
}
/*
bool isPrime(int n) {
    if (n == 1) return false;
    if (n == 2) return true; 
    for(int i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            return false;
        }
    }
    return true;
}
*/


int isSimilarTo2017(int n) {
    return prime[n] && prime[(n + 1) / 2];
}

int main() {
    sieve();
    vector<int> acc(100001, 0);
    for(int i = 1; i <= 100000; i++) {
        acc[i] = acc[i - 1] + (isSimilarTo2017(i) == true ? 1 : 0);
    }
    int Q;
    cin >> Q;
    for(int q = 0; q < Q; q++) {
        int l, r;
        cin >> l >> r;
        cout << acc[r] - acc[l - 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
long long a[100010];
int main(void)
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long cnt;
    cin>>cnt;
    for(long long i=0;i<cnt;++i)
    {
        cin>>a[i];
    }
    long long sum=0;
    long long ans1=0;
    for(long long i=0;i<cnt;++i)
    {
        if(i%2==0&&sum+a[i]>0)
        {
            sum+=a[i];
        }
        else if(i%2==0&&sum+a[i]<=0)
        {
            ans1+=(1-sum-a[i]);
            sum+=(1-sum);
        }
        else if(i%2==1&&sum+a[i]>=0)
        {
            ans1+=(a[i]-(-1-sum));
            sum+=(-1-sum);
        }
        else
        {
            sum+=a[i];
        }
    }
    long long ans2=0;
    sum=0;
    for(long long i=0;i<cnt;++i)
    {
        if(i%2==1&&sum+a[i]>0)
        {
            sum+=a[i];
        }
        else if(i%2==1&&sum+a[i]<=0)
        {
            ans2+=(1-sum-a[i]);
            sum+=(1-sum);
        }
        else if(i%2==0&&sum+a[i]>=0)
        {
            ans2+=(a[i]-(-1-sum));
            sum+=(-1-sum);
        }
        else
        {
            sum+=a[i];
        }
    }
    cout <<min(ans1,ans2)<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define found(m,x) ((m).find(x)!=(m).end())
#define uset unordered_set
#define umap unordered_map
#define db(x) cerr << #x << " == " << x << ";\n";
#define a(x) x.begin(),x.end()
#define input(v,n) for(int i=0;i<n;i++)cin>>v[i]
typedef vector<int> vi;
typedef pair<int,int> pi;

const int nax = 1e5+7;
const int mod = 1e9+7; //1e9+2667
const int inf = numeric_limits<int> :: max();
// ===================== MANASH =================== //

int n,m;

void test() {

    cin >> n;
    vector<int> A,B,C;
    
    for ( int i = 0; i < n; i++ ) {
         int t;
         cin >> t;
         t--;
         A.push_back(t);
    }
    for ( int i = 0; i < n; i++ ) {
         int t;
         cin >> t;
         B.push_back(t);
    }
    for ( int i = 0; i < n-1; i++ ) {
         int t;
         cin >> t;
         C.push_back(t);
    }

    int prev = A[0];
    int sat = B[prev];

    for(int i = 1; i < n; i++) {
        int curr = A[i];
        sat += B[curr];
        if ( curr == prev +1 and prev <= n-2 ) sat+= C[prev];
        prev = curr;
    }

    cout << sat;
}

signed main() {

    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);

    #ifdef LOCAL
    freopen("input.txt","r",stdin);
    cout<<"Time Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec.\n";
    #endif

    int T = 1;
    //cin >> T;
    while(T--) {
        test();
        cout << "\n";
    }
    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) ((int)(x).size())
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N; cin>>N;
    vint a(N);
    REP(i,N){
        cin>>a[i];
        a[i]-=(i+1);
    }
    sort(ALL(a));

    int ans=0;
    REP(i,N) ans+=abs(a[i]-a[N/2]);
    cout<<ans<<endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, n) ;for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) ;for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF (922337203685477587+1)
#define sosuu 1000000007

int main() {
  lli N,H;
  cin >> N >> H;
  vector<lli> B(N);
  lli Amax=-1;
  lli a;
  rep(i, N){
  cin >> a >> B[i];
    Amax=max(a, Amax);
  }
  sort(ALL(B));
  reverse(ALL(B));
  lli st=0;
  rep(i, N){
    if(B[i]<=Amax){
    break;
    }
    st++;
  }
  lli ans=0;
  lli s=0;
  while(H>0){
  if(s<st){
  H-=B[s];
    s++;
    ans++;
  }
  else{
  if(  H%Amax==0){
  ans+=H/Amax;
    H=0;
  }
    else{
  ans+=H/Amax+1;
      H=0;
    }
  }
  
  
  
  
  }
  cout << ans <<  endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
#define fi first
#define se second
main(){
  string s;
  int a=700;
  cin>>s;
  r(i,3)if(s[i]=='o')a+=100;
  cout<<a<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n);
	std::string s; cin >> s;

	using P = std::pair<int, int>;
	using P2 = std::pair<P, int>;

	const int MOD = 998244353;

	i64 ans = 1;
	std::queue<int> R, G, B;
	std::queue<P> RG, RB, GR, GB, BR, BG;
	std::vector<P2> RGB, RBG, GRB, GBR, BRG, BGR;
	for(int i = 0; i < s.size(); i++) {
		if(s[i] == 'R') {
			if(!GB.empty()) {
				(ans *= GB.size() + BG.size()) %= MOD;
				GBR.push_back({GB.front(), i});
				GB.pop();
			} else if(!BG.empty()) {
				(ans *= GB.size() + BG.size()) %= MOD;
				BGR.push_back({BG.front(), i});
				BG.pop();
			} else if(!G.empty()) {
				(ans *= G.size() + B.size()) %= MOD;
				GR.push({G.front(), i});
				G.pop();
			} else if(!B.empty()) {
				(ans *= G.size() + B.size()) %= MOD;
				BR.push({B.front(), i});
				B.pop();
			} else {
				R.push(i);
			}
		} else if(s[i] == 'G') {
			if(!RB.empty()) {
				(ans *= RB.size() + BR.size()) %= MOD;
				RBG.push_back({RB.front(), i});
				RB.pop();
			} else if(!BR.empty()) {
				(ans *= RB.size() + BR.size()) %= MOD;
				BRG.push_back({BR.front(), i});
				BR.pop();
			} else if(!R.empty()) {
				(ans *= R.size() + B.size()) %= MOD;
				RG.push({R.front(), i});
				R.pop();
			} else if(!B.empty()) {
				(ans *= R.size() + B.size()) %= MOD;
				BG.push({B.front(), i});
				B.pop();
			} else {
				G.push(i);
			}
		} else if(s[i] == 'B') {
			if(!RG.empty()) {
				(ans *= RG.size() + GR.size()) %= MOD;
				RGB.push_back({RG.front(), i});
				RG.pop();
			} else if(!GR.empty()) {
				(ans *= RG.size() + GR.size()) %= MOD;
				GRB.push_back({GR.front(), i});
				GR.pop();
			} else if(!R.empty()) {
				(ans *= R.size() + G.size()) %= MOD;
				RB.push({R.front(), i});
				R.pop();
			} else if(!G.empty()) {
				(ans *= R.size() + G.size()) %= MOD;
				GB.push({G.front(), i});
				G.pop();
			} else {
				B.push(i);
			}	
		}
	}

	for(i64 i = 1; i <= n; i++) (ans *= i) %= MOD;
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 3072
from collections import Counter

S = input()
mods = [0]
num, ten = 0, 1
for n in S[::-1]:
    num += int(n) * ten
    num %= 2019
    mods.append(num)
    ten *= 10
    ten %= 2019

counter = Counter(mods)
ret = 0
for v in counter.values():
    ret += v * (v - 1) // 2
print(ret)

Measured memory_bytes: 16900
k,a,b = map(int,input().split())
add = b - a
ans = 1
if k <= a - 1:
    ans = 1 + k
    print(ans)
else:
    ans = a
    k = k - (a-1)
    ans += max(add*(k//2) + k%2,k)
    print(ans)
        

Measured memory_bytes: 2940
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

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

template<class T> inline T sqr(T x) {return x-x;}

void solve() {
    int t,a,b,c,d;
    cin >> t;
    d = t % 10;
    t /= 10;
    c = t % 10;
    t /= 10;
    b = t % 10;
    t /= 10;
    a = t % 10;
    if (a + b + c + d == 7) cout << a << "+" << b << "+" << c << "+" << d << "=7";
    else if (a + b + c - d == 7) cout << a << "+" << b << "+" << c << "-" << d << "=7";
    else if (a + b - c + d == 7) cout << a << "+" << b << "-" << c << "+" << d << "=7";
    else if (a + b - c - d == 7) cout << a << "+" << b << "-" << c << "-" << d << "=7";
    else if (a - b + c + d == 7) cout << a << "-" << b << "+" << c << "+" << d << "=7";
    else if (a - b + c - d == 7) cout << a << "-" << b << "+" << c << "-" << d << "=7";
    else if (a - b - c + d == 7) cout << a << "-" << b << "-" << c << "+" << d << "=7";
    else if (a - b - c - d == 7) cout << a << "-" << b << "-" << c << "-" << d << "=7";
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string a;
int g,p,w;
int main(){
	cin>>a;
	for(int i=0;i<a.length();i++){
		if(a[i]=='g'){
			if(g>=(p+1)){
				w++;
				p++;
			}
			else g++;
		}
		else{
			if(g>=(p+1))p++;
			else{
				g++;
				w--;
			}
		}
	}
	cout<<w<<endl;
	return 0;
}

Measured memory_bytes: 512
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Clue = Tuple!(long, "x", long, "y", long, "h");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

long cnt;

void main()
{
    long n, x;
    scan(n, x);
    auto a = aryread();
    long cnt;
    if (a[0] > x)
    {
        cnt += a[0] - x;
        a[0] = x;
    }
    foreach(i; iota(n - 1))
    {
        auto dif = a[i] + a[i + 1] - x;
        if(dif > 0)
        {
            cnt += dif;
            a[i + 1] -= dif;
        }
    }
    cnt.writeln();
}

void dfs(T)(T g, long current, bool[] visit)
{
    // current.writeln();
    foreach (e; g[current])
    {
        if (!visit[e])
        {
            visit[e] = true;
            dfs(g, e, visit);
            visit[e] = false;
        }
    }
    if (visit.all_true())
        cnt++;
}

bool all_true(bool[] a)
{
    bool ret = true;
    foreach (e; a)
        ret &= e;
    return ret;
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


Measured memory_bytes: 4160
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<stdio.h>
#include<set>
#include<vector>
using namespace std;
int main(){
    int n;
    int en;
    cin>>n;
    int x[n],y[n],h[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i]>>h[i];
        if(h[i]!=0){
            en=i;
        }
    }
 
    int ansx=0,ansy=0;
    int HH;
   
    for(int i=0;i<=100;i++){
        int flag=0;
        for(int j=0;j<=100;j++){
            HH=h[en]+abs(x[en]-i)+abs(y[en]-j);
            for(int u=0;u<n;u++){
                   /* int H=h[u]+abs(x[u]-i)+abs(y[u]-j);
                if(h[u]!=0){
                    if(HH!=H){
                        break;
                        }
                    }*/
                
                int hh=HH-abs(x[u]-i)-abs(y[u]-j);
                if(max(hh,0)!=h[u]){
                    break;
                }
                if(u==n-1){
                    int ansh=h[en]+abs(x[en]-i)+abs(y[en]-j);
                    cout<<i<<" "<<j<<" "<<ansh<<endl;
                    return 0;
                }
            }
        }
    }
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
X=int(input())

if X == 5 or X==7 or X==3:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 77208
X=int(input())

if X<=599:
    print(8)
elif X<=799:
    print(7)
elif X<=999:
    print(6)
elif X<=1199:
    print(5)
elif X<=1399:
    print(4)
elif X<=1599:
    print(3)
elif X<=1799:
    print(2)
else:
    print(1)

Measured memory_bytes: 9096
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif

    int n;
    cin >> n;
    vector <int> a(n + 1);
    for (int i  = 0; i <= n; ++i)
        cin >> a[i];
    
    if (n == 0) {
        if (a[0] == 1) {
            cout << 1 << endl;
        }   
        else {
            cout << -1 << endl;
        }   
        exit(0);
    }   

    if (a[0]) {
        cout << -1 << endl;
        exit(0);
    }   

    vector <int> suff(n + 2);
    for (int i = n; i >= 0; --i)
        suff[i] = suff[i + 1] + a[i];

    int cur = 1, ans = 1;
    for (int i = 1; i <= n; ++i) {

        if (cur > suff[i]) {
            cout << -1 << endl;
            exit(0);
        }   
        cur = min(cur * 2, suff[i]);

        ans += cur;
        if (cur < a[i]) {
            cout << -1 << endl;
            exit(0);
        }   
        cur -= a[i];
    }   
    cout << ans << endl;
}

Measured memory_bytes: 5116
#include <stdio.h>

int main()
{
    int n;
    int p[4][3][10] = {0};
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        int b, f, r, v;
        scanf("%d %d %d %d", &b, &f, &r, &v);
        p[b - 1][f - 1][r - 1] += v;
    }
    for (int b = 0; b < 4; b++)
    {
        for (int f = 0; f < 3; f++)
        {
            for (int r = 0; r < 10; r++)
            {
                printf(" %d", p[b][f][r]);
            }
            printf("\n");
        }
        if (b != 3)
        {
            printf("####################\n");
        }
    }
    return 0;
}


Measured memory_bytes: 2044
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
int a=0,b=-1,c=0,d=0;
char Char =0;
while (true) {
  b=-1;
rep(i,5){
  std::cin >> x>>y;
if(x==0&&y==0)return 0;
if(b<x+y){
  Char=i+65;
  b=x+y;
}
}
std::cout <<Char<<" "<<b<< '\n';
}
  }



Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
int N,a,o,t,f;
int main(){
    cin>>N;
    while(N--){
        cin>>a;
        if(a%2)++o;
        else if(a%4)++t;
        else ++f;
    }
    cout<<(f+1<o+(t>0)?"No":"Yes")<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
const int Nmax = 100000;
typedef long long ll;
int N, A[Nmax];

void pr(int res, int minv){
  cout << res << " " << minv << " ";
  for(int i=0; i<N; i++) cout << A[i] << " ";
  cout << endl;
}

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

  ll res=A[0]-1;
  A[0]=1;
  int minv=2;
  //pr(res,minv);
  for(int i=1; i<N; i++){
    if(A[i] > minv && A[i] % minv == 0){
      A[i] -= minv+1;
      res += 1;
    }
    if(A[i] > minv){
      int k = A[i]/minv;
      A[i] -= k*minv;
      res += k;
    }
    if(A[i] == minv){
      minv++;
    }
    //pr(res,minv);
  }

  cout << res << endl;
  return 0;
}


Measured memory_bytes: 640
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		Interval[] p = new Interval[m];
		for(int i=0;i<m;i++) {
			p[i] = new Interval(sc.nextInt(),sc.nextInt());
		}
		UnionFind uf = new UnionFind(m);
		for(int i=0;i<m;i++) {
			for(int j=i+1;j<m;j++) {
				if (p[i].intersects(p[j])) {
					uf.union(i, j);
				}
			}
		}
		ArrayList<ArrayList<Integer>> groups = uf.groups();
		int length = n + 1;
		for(ArrayList<Integer> l:groups) {
			int min = Integer.MAX_VALUE;
			int max = Integer.MIN_VALUE;
			for(int i:l) {
				Interval in = p[i];
				min = Math.min(min, in.a);
				max = Math.max(max, in.b);
			}
			length += (max - min) * 2;
		}
		System.out.println(length);
	}

}
//[a,b]
class Interval {
	int a,b;
	public Interval(int a,int b) {
		this.a = a;
		this.b = b;
	}
	public boolean intersects(Interval i) {
		return intersects(this, i);
	}
	public static boolean intersects(Interval i,Interval j) {
		Interval temp;
		if (i.a > j.a) {
			temp = i;
			i = j;
			j = temp;
		}
		if (i.b < j.a) {
			return false;
		}
		return true;
	}
	public Interval merge(Interval i) {
		return merge(this, i);
	}
	public static Interval merge(Interval i,Interval j) {
		if (!intersects(i, j)) {
			return null;
		}
		return new Interval(Math.min(i.a,j.a), Math.max(i.b,j.b));
	}
	public String toString() {
		return "[" + a + "," + b + "]";
	}
}
class UnionFind {
	int[] root;
	Interval[] data;
	int n;

	public UnionFind(int size) {
		n = size;
		root = new int[size];
		Arrays.fill(root, -1);
	}
	public void union(int x,int y) {
		x = root(x);
		y = root(y);
		if (x!=y) {
			if (root[y] < root[x]) {
				int tmp = y;
				y = x;
				x = tmp;
			}
			root[x] += root[y];
			root[y] = x;
		}
	}
	public boolean isConnected(int x,int y) {
		return root(x)==root(y);
	}
	private int root(int x) {
		return root[x] < 0 ? x : (root[x] = root(root[x]));
	}
	public int size(int x) {
		return -root[root(x)];
	}
	public ArrayList<ArrayList<Integer>> groups() {
		ArrayList<ArrayList<Integer>> g = new ArrayList<ArrayList<Integer>>();
		HashMap<Integer,Integer> hm = new HashMap<Integer, Integer>();
		for(int i=0;i<n;i++) {
			int r = root(i);
			if (!hm.containsKey(r)) {
				hm.put(r, g.size());
				g.add(new ArrayList<Integer>());

			}
			g.get(hm.get(r)).add(i);
		}
		return g;
	}
	public String toString() {
		return Arrays.toString(root);
	}
}

Measured memory_bytes: 21376
#include<stdio.h>

int ads(int a,int b){

  if(a < b){
    int temp = a;
    a = b;
    b = temp;
  }

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

int main(void){
  int n , k;
  scanf("%d %d",&n ,&k);

  int a[n] , max = 0;
  for(int i = 0;i < n;i ++){
    scanf("%d",&a[i]);
    if(max < a[i]){
      max = a[i];
    }
  }

  int g = a[0];
  for(int i = 1;i < n;i ++){
    g = ads(g,a[i]);
  }

  if(k%g == 0 && max >= k){
    printf("POSSIBLE\n");
  }

  else{
    printf("IMPOSSIBLE\n");
  }

  return 0;
}

Measured memory_bytes: 1996
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long lli;
lli i,o,t,j,l,s,z;
lli ans = 0;
int main(){
    cin >> i >> o >> t >> j >> l >> s >> z;
    ans = i + o + j + l;
    if(i%2 == j%2 && j%2 == l%2)ans+=0;
    else if(i == 0 || j == 0 || l == 0){
        ans -= i%2+j%2+l%2;
    }else{
        ans -= 1;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 998244353LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

ll fact[400005];

ll mod_pow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1LL){
			res=res*x%MOD;
		}
		x=x*x%MOD;
		n>>=1LL;
	}
	return res;
}

ll extgcd(ll a,ll b,ll& x,ll& y){
	ll d=a;
	if(b!=0LL){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;
		y=0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
	ll x,y;
	extgcd(a,m,x,y);
	return (m+x%m)%m;
}

ll mod_fact(ll n,ll p,ll& e){
	e=0;
	if(n==0)return 1;
	ll res=mod_fact(n/p,p,e);
	e+=n/p;
	if(n/p%2!=0){
		return res*(p-fact[n%p])%p;
	}
	return res*fact[n%p]%p;
}

ll mod_comb(ll n,ll k,ll p){
	if(n<0 || k<0 || n<k)return 0;
	ll e1,e2,e3;
	ll a1=mod_fact(n,p,e1),a2=mod_fact(k,p,e2),a3=mod_fact(n-k,p,e3);
	if(e1>e2+e3)return 0;
	return a1*mod_inverse(a2*a3%p,p)%p;
}

int n,m,k;

int main(void){
	fact[0]=1;
	fact[1]=1;
	for(ll i=2;i<=400000;i++){
		fact[i]=fact[i-1]*i%MOD;
	}
	scanf("%d%d%d",&n,&m,&k);
	ll ans=mod_pow(m,n);
	ll co=1;
	for(int i=k+1;i<n;i++){
		ll ch=n-i-1;
		ll val=m;
		val=val*mod_pow(m-1,ch)%MOD;
		val=val*mod_comb(n-1,ch,MOD)%MOD;
		ans-=val;
		if(ans>=MOD){
			ans-=MOD;
		}
		if(ans<0){
			ans+=MOD;
		}
	}
	printf("%lld\n",ans);
	return 0;
}


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

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

using namespace std;

int main(){
  ll n,c;cin>>n>>c;
  ll dists[n], r_dists[n], cals[n], r_cals[n];
  rep(i,n){
    cin>>dists[i]>>cals[i];
    r_cals[n-1-i]=cals[i];
  }
  rep(i,n)r_dists[i]=c-dists[n-1-i];

  rep(i,n-1){
    cals[i+1]=cals[i+1]+cals[i];
    r_cals[i+1]=r_cals[i+1]+r_cals[i];
  }
  rep(i,n){
    cals[i]-=dists[i];
    r_cals[i]-=r_dists[i];
  }
  rep(i,n-1){
    cals[i+1]=max(cals[i], cals[i+1]);
    r_cals[i+1]=max(r_cals[i], r_cals[i+1]);
  }

  ll result=0;
  result = max(result, cals[n-1]);
  result = max(result, r_cals[n-1]);
  rep(i,n-1){
    result = max(result, cals[i]);
    result = max(result, cals[i]+r_cals[n-2-i]-dists[i]);
    result = max(result, r_cals[i]);
    result = max(result, r_cals[i]+cals[n-2-i]-r_dists[i]);
  }

  cout<<result<<endl;

//rep(i,n)cout<<cals[i]<<' ';cout<<endl;
//rep(i,n)cout<<r_cals[i]<<' ';cout<<endl;

  return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <deque>
#include <numeric>
#include <sstream>
#include <iomanip>
using lint = long long;

lint cand_num(lint n, lint b, lint k)
{
    if (k == 0)
        return n;
    if (b <= k)
        return 0;
    lint out = 0;
    lint onecycle = b - k;

    out += (n / b) * onecycle;
    out += std::max(0ll, n % b - (k - 1));

    return out;
}

int main()
{
    lint n, k;
    scanf("%lld", &n);
    scanf("%lld", &k);

    lint ans = 0;

    for (int i = 1; i <= n; ++i)
    {
        ans += cand_num(n, i, k);
    }

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


Measured memory_bytes: 504
#include <stdio.h>

int main(void){
  int a,b;
  scanf("%d%d",&a,&b);

  if(a+b>=a-b&&a+b>=a*b){
    printf("%d\n",a+b);
  }else if(a-b>=a+b&&a-b>=a*b){
    printf("%d\n",a-b);
  }else{
    printf("%d\n",a*b);
  }

  return 0;
}


Measured memory_bytes: 128
#include <iostream>

const int MAX_COLUMN = 100;
const int MAX_ROW = 100;

void input2Array(int[MAX_COLUMN][MAX_ROW], const int&, const int&);
void outputRow(int[MAX_ROW], const int[MAX_ROW], const int&);

int main(){
	int r, c;
	int spreadSheet[MAX_COLUMN][MAX_ROW];
	int sumRow[MAX_ROW] = {};
	int total = 0;

	std::cin >> r >> c;
	input2Array(spreadSheet, r, c);

	for (int i = 0; i < r; i++)
	{
		outputRow(sumRow, spreadSheet[i], c);
	}

	for (int j = 0; j < c; j++)
	{
		std::cout << sumRow[j] << " ";
		total += sumRow[j];
	}
	std::cout << total << std::endl;

}

void input2Array(int spreadSheet[MAX_COLUMN][MAX_ROW], const int& ROW, const int& COLUMN){
	for (int i = 0; i < ROW; i++)
	{
		for (int j = 0; j < COLUMN; j++)
		{
			std::cin >> spreadSheet[i][j];
		}
	}
}

void outputRow(int sumRow[MAX_ROW], const int spreadSheetColumn[MAX_ROW], const int& COLUMN){
	int sumColumn = 0;
	for (int j = 0; j < COLUMN; j++)
	{
		std::cout << spreadSheetColumn[j] << " ";
		sumColumn += spreadSheetColumn[j];
		sumRow[j] += spreadSheetColumn[j];
	}
	std::cout << sumColumn << std::endl;
}


Measured memory_bytes: 3088
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
D = {0:0,1:0,2:0,3:0}
for a in A :
    D[a] += 1

one = D[1]
two = D[2]
three = D[3]

dp = [[[0.0]*(N+1) for j in range(N+1)] for i in range(N+1)]

def f(c1, c2, c3) :
    res = N
    if (c1 > 0) :
        res += dp[c1-1][c2][c3] * c1
    if (c2 > 0) :
        res += dp[c1+1][c2-1][c3] * c2
    if (c3 > 0) :
        res += dp[c1][c2+1][c3-1] * c3
    
    dp[c1][c2][c3] = res/(c1 + c2 + c3)

for k in range(three+1) :
    for j in range(two+three+1 - k) :
        for i in range(one+two+three+1 - (j+k)) :
            if i+j+k == 0 :
                continue
            f(i, j, k)

print(dp[one][two][three])


Measured memory_bytes: 256264
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,n,i,j,k,s=0;
	cin>>a>>b>>c>>n;
	for(i=0;i<=a;i++)
	{
		if(500*i>n) a=i;
		for(j=0;j<=b;j++)
		{
			if(100*j>n) b=j;
			for(k=0;k<=c;k++)
			{
				if(500*i+100*j+50*k==n) s++;
			}
		}
	}
	cout<<s;
	return 0;
 } 


Measured memory_bytes: 3572
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pli = std::pair<long long, int> ;

using namespace std;

const long long MOD = 1000000007;

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

	int a, b;
	cin >> a >> b;

	string ans = "";
	rep(i, max(a, b)) {
		ans += to_string(min(a, b));
	}

	cout << ans << "\n";

	return 0;
}


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

int main()
{
    int n,m;
    cin >> n >> m;
    vector<int> p(m);
    vector<int> y(m);
    vector<vector<int>> yd(n,vector<int>());
    int i;
    for(i = 0;i < m;++i){
        cin >> p.at(i) >> y.at(i);
        yd.at(p.at(i)-1).push_back(y.at(i));
    }
    for(i = 0;i < n;++i){
        sort(yd.at(i).begin(),yd.at(i).end());
    }
    for(i = 0;i < m;++i){
        printf("%012lld\n",ll(p.at(i))*1000000+int(lower_bound(yd.at(p.at(i)-1).begin(),yd.at(p.at(i)-1).end(),y.at(i))-yd.at(p.at(i)-1).begin())+1);
    }
    return 0;
}

Measured memory_bytes: 7808
n = int(input())
a = list(map(int, input().split()))

l = []
tmp = []
for i in range(n-1):
    if a[i] < a[i+1] and len(tmp) == 0:
        tmp.append(a[i])
    elif a[i] > a[i+1] and len(tmp) == 1:
        tmp.append(a[i])
        l.append(tmp)
        tmp = []
if len(tmp) == 1 and tmp[0] < a[-1]:
    tmp.append(a[-1])
    l.append(tmp)

res = 1000
for a, b in l:
    res += (res // a) * (b - a)

print(res)

Measured memory_bytes: 62012
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")


void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{
    ll aa;
    ll bb;
}frequent;

// (mod MOD1)
ll mod(ll n){return n%=MOD1;}

int main(void){
    // char ;
    ll n,k,ans=0;
    scanf("%lld%lld",&n,&k);
    ll a[n];
    rep(i,0,n){
        scanf("%lld",&a[i]);
    }
    ll inv1=0,inv2=0;
    rep(i,0,n){
        rep(j,0,n){
            if(a[i]>a[j]){
                if(j>i) inv1++;
                else inv2++;
            }
        }
        
    }
    ans= (inv1+inv2) * mod( k*(k-1)/2 ) + inv1*k;
    ans%=MOD1;
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 128
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)
	li := divisor(n)
	sort.Ints(li)
	var a, b int
	tmp := 1000000000001
	for i := 0; i <= len(li)/2; i++ {
		if li[len(li)-i-1] == li[i] {
			tmp = 0
			a = li[i]
			b = li[i]
		}
		if (li[len(li)-i-1] != li[i]) && tmp > li[len(li)-i-1]-li[i] {
			tmp = li[len(li)-1] - li[i]
			a = li[i]
			b = li[len(li)-i-1]
		}
	}
	if a == 1 {
		fmt.Println(b - 1)
	} else if b == 1 {
		fmt.Println(a - 1)
	} else {
		fmt.Println(a + b - 2)
	}
}

//約数の数が奇数個な値は平方根を整数でとれる
func divisor(n int) []int {
	var li []int
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			li = append(li, i)
			//if without below if state, insert 2500 then print 50 twice.
			if i != n/i {
				li = append(li, n/i)
			}
		}
	}
	return li
}

func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}


Measured memory_bytes: 768
import sys

N, M =  map(int, input().split())
a_list = [int(input()) for _ in range(M)]

if N == 1:
    print(1)

else:
    a = 1
    ans = 1

    if M == 0:
        b = 1
        for i in range(2, N+1):
            ans = (a+b)%1000000007
            a, b = b, ans

    elif M == 1:
        if a_list[0] == 1:
            b = 0
            m = 1
        else:
            b = 1
            m = 0
        for i in range(2, N+1):
            if a_list[0] == i:
                a, b = b, 0
            else:
                ans = (a+b)%1000000007
                a, b = b, ans

    else:
        if a_list[0] == 1:
            b = 0
            m = 1
        else:
            b = 1
            m = 0
        for i in range(2, N+1):
            if m < M-1:
                if a_list[m+1] - a_list[m] == 1:
                    print(0)
                    sys.exit()

                if a_list[m] == i:
                    a, b = b, 0
                    m += 1
                else:
                    ans = (a+b)%1000000007
                    a, b = b, ans

            else:
                if a_list[m] == i:
                    a, b = b, 0
                else:
                    ans = (a+b)%1000000007
                    a, b = b, ans

    print(ans)

Measured memory_bytes: 7100
#include<iostream>
#include<vector>
#include<math.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

int main(){
	long long int n;
	int k=1;
	cin>>n;
	while(n>pow(26,k)){
		n-=pow(26,k);
		k++;
	}
	n--;
	vector<char> c(k);
	rep(i,k){
		c[i]='a';
		c[i]+=(n%26);
		n=n/26;
	}
	rep(i,k)cout<<c[k-i-1];
	cout<<endl;
	/*
	while(n>0){
		c='a'-1;
		c+=(n%27);
		cout<<c;
		n=n/27;
	}
	cout<<endl;
	*/
	/*
	cout<<k<<endl;
	cout<<n<<endl;
	*/

	return 0;
}

Measured memory_bytes: 4068
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

int main() {
  char c;
  cin >> c;

  cout << (c >= 'a' && c <= 'z' ? 'a' : 'A') << endl;
  return 0;
}

Measured memory_bytes: 3628
use std::io;

fn main() -> io::Result<()>{
    let stdin = io::stdin();
    let mut buf = String::new();
    stdin.read_line(&mut buf)?;
    buf.retain(|c| c!='\n');
    let tmp = buf.chars().nth(0).unwrap();
    if tmp.is_uppercase() {
	println!("A");
    }else{
	println!("a");
    }
    Ok(())
}


Measured memory_bytes: 2168
//بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a, b, c, d, e, h1, m1, re;
    cin >>a >> b >> c >> d >>e ;
    h1 = (c - a)*60;
    m1 = d - b;
    re = h1 + m1;
    cout << re - e << endl;



    return 0;
}


Measured memory_bytes: 3636
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count=0;
		int max=0;
		int a=0;
		int[] A = new int[5];
		int c=0;
		
		for(int i=0;i<5;i++) {
			A[i]=sc.nextInt();
			if(A[i]%10!=0) {
				max=Math.max((10-A[i]%10), max);
				c=i;
				}	
		}
		
		for(int i=0;i<5;i++) {
			count+=A[i];
			for(int j=0;j<9;j++) {
				if(count%10!=0) {
					count++;
				}
			}
		}
		
		System.out.println(count-max);
		
		sc.close();
	}
}


Measured memory_bytes: 21588
import java.util.Scanner;

public class Main {
    static int c = 0;
    static int[][] directions = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}};
    static int[][] m;

    public static void spreadFrom(int x, int y) {
        if (m[y][x] != 1) {
            m[y][x] = 1;
            c++;
        }

        for (int k = 0; k < 4; k++) {
            int nx = x + directions[k][0];
            int ny = y + directions[k][1];
            if (nx >= 0 && nx < m[y].length && ny >= 0 && ny < m.length && m[ny][nx] == 0) {
                spreadFrom(nx, ny);
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            c = 0;
            int W = sc.nextInt();
            int H = sc.nextInt();
            if (W == 0 && H == 0)
                break;
            m = new int[H][W];
            int[] start = new int[2];
            for (int i = 0; i < H; i++) {
                String rowStr = sc.next();
                for (int j = 0; j < W; j++) {
                    int point = 1;
                    switch (Character.toString(rowStr.charAt(j))) {
                        case ".":
                            point = 0;
                            break;
                        case "#":
                            point = 1;
                            break;
                        case "@":
                            point = 2;
                            start[0] = j;
                            start[1] = i;
                            break;
                    }
                    m[i][j] = point;
                }
            }
            spreadFrom(start[0], start[1]);
            System.out.println(c);
        }
    }
}

Measured memory_bytes: 42344
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main(void) {
  int n, m, k[32], a[32][32], count = 1, ans = 0;

  if(scanf("%d %d", &n, &m) == 1);

  for(int i = 0; i < n; i++) {
    if(scanf("%d", &k[i]) == 1);
    for(int j = 0; j < k[i]; j++) {
      if(scanf("%d", &a[i][j]) == 1);
    }
  }

  for(int kl = 0; kl < k[0]; kl++) {
    count = 1;
    for(int j = 1; j < n; j++) {
      for(int i = 0; i < k[j]; i++) {
        if(a[0][kl] == a[j][i]) {
          count++;
          break;
        }
      }
    }
    if(count == n) {
      ans++;
    }
  }


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

  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vvi= vector<vi>;
using vs = vector<string>;
#define  rep(i,n) for(ll i = 0; i < (n); ++i)
#define  red(i,n) for(ll i = (n)-1; i >= 0; --i)
#define  all(a)   begin(a),end(a)
#define  pb(a)    push_back(a)
#define  mp(a,b)  make_pair(a,b)
#define  yn(a)    cout << ( (a)?"Yes\n":"No\n" )
inline ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; }
const ll INF = 1e9+9, LINF = 1e18;


int main()
{
    int a,b;
    cin>>a>>b;
    if(a+b==15)cout<<"+\n";
    else if(a*b==15)cout<<"*\n";
    else cout<<"x\n";   
    
    return 0;
}


Measured memory_bytes: 256
#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> VI;
typedef pair<int,int> PII;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define PB push_back
#define sz size()

const double EPS = 1e-10;
const int INF = 100000000;

int main(){
    string hoge[]={"NA","E","D","C","B","A","AA","AAA"};
    double a,b;
    while(cin>>a>>b){
        int s=-1,x=-1;
        
        if(a<70.0)s=0;
        if(a<55.0)s=1;
        if(a<50.0)s=2;
        if(a<43.0)s=3;
        if(a<40.0)s=4;
        if(a<37.5)s=5;
        if(a<35.5)s=6;
        
        if(b<148.0)x=0;
        if(b<116.0)x=1;
        if(b<105.0)x=2;
        if(b<89.0)x=3;
        if(b<83.0)x=4;
        if(b<77.0)x=5;
        if(b<71.0)x=6;

        cout<<hoge[min(s,x)+1]<<endl;
    }

    
    return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;

int main() {
  int a,b;
  cin >> a >>b;
  int max=3000;
  rep(i,max){
    if(floor(i*0.08)==a&&floor(i*0.10)==b){
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}




Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc =new Scanner(System.in);
		
		int n=sc.nextInt();
		int m=sc.nextInt();
		
        int []A = new int[n];
        int []B = new int[n];
        for(int i=0;i<n;i++) {
        	A[i]=sc.nextInt();
        	B[i]=sc.nextInt();
        }
        Data []d = new Data[n];
        for(int i= 0; i < n; i++) {
            d[i] = new Data(A[i], B[i]);
        }
        Arrays.sort(d, new Comparator<Data>() {
            public int compare(Data d1, Data d2) {
                return d1.getA() - d2.getA();
            }
        });
        
        int ans = 0;
        int j=0;
      
		Queue<Integer> q = new PriorityQueue(new MyComparator());
        
        for(int i=1;i<=m;i++) {
        	while(j<n&&d[j].getA()<=i) {
        		q.add(d[j].getB());
        		j++;
        	}
        	if(q.isEmpty()) continue;
        	ans+=q.poll();
        	
        }
        
        System.out.println(ans);
	}
	
}

	class Data{
		  private int a;
		    private int b;
		    public Data(int a, int b) {
		        this.a = a;
		        this.b = b;
		    }
		    public int getA() {
		        return a;
		    }
		    public int getB() {
		        return b;
		    }
}

	class MyComparator implements Comparator {
		 
	    public int compare(Object obj1, Object obj2) {
	         
	        int num1 = (int)obj1;
	        int num2 = (int)obj2;
	         
	        if(num1 < num2) {
	            return 1;
	        } else if(num1 > num2) {
	            return -1;
	        } else{
	            return 0;
	        }
	    }
	}




Measured memory_bytes: 89260
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<cmath>	

using namespace std;

int main() {
	long long N;
	cin >> N;
	vector<long long> R;
	for (int i = 0; i < N; ++i) {
		long long r;
		cin >> r;
		R.push_back(r);
	}

	long long minR = R[0];
	long long maxProfit = -10E+9;
	for (int i = 1; i < N; ++i) {
		maxProfit = max(maxProfit, R[i] - minR);
		minR = min(minR, R[i]);
	}

	cout << maxProfit << endl;

	return 0;
}


Measured memory_bytes: 4968
N,M,X,Y=map(int,input().split())
x_l=list(map(int,input().split()))
y_l=list(map(int,input().split()))
for i in range(X+1,Y+1):
    if max(x_l)<i and i<=min(y_l):
        print("No War")
        exit()
else:print("War")
        

Measured memory_bytes: 3060