akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int n,a[100005],b[100005];
void Get(int x)
{
	puts(x?"Second":"First");
	exit(0);
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1);
	for (int i=1;i<=n;i++)
	{
		if (a[i]!=a[i-1]) b[i]=1;
		else b[i]=b[i-1]^1;
		int t=n+1-i;
		if (t==a[i-1])
			if (a[i]==a[i-1]) Get(b[i]);
			else Get((b[i-1]==0)&&(((a[i]^t^b[i]^1)&1)==0));
		if (t>a[i-1]&&t<=a[i]) Get((a[i]^t^b[i])&1);
	}
}

Measured memory_bytes: 1152
//Jai Bhole Ki
#include <bits/stdc++.h>
using namespace std;
#define fast static int fastline = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();
#define ll long long
#define LL unsigned ll
#define pb push_back
#define pi pair<ll,ll>
#define debug(x) cout<<x<<"\n";
#define debug cout<<"debugged\n";
#define minval -2e9
#define maxval 2e9
long double PI =3.14159265358979323846;
 
const ll M=1e9+7;
const ll inf=1e18;
const ll ms=2e5+5;
fast;
double ans;
ll n;
void solve()
{
    cin>>n; vector<pair<double,double>> a(n);
    vector<ll>b(n);
    for(int i=0;i<n;i++)
        {cin>>a[i].first>>a[i].second;b[i]=i;}
    for(int i = 0; i < n; i++) {
        for(int j = i + 1; j < n; j++) ans += pow((a[i].first-a[j].first)*(a[i].first-a[j].first)+(a[i].second-a[j].second)*(a[i].second-a[j].second),0.5) * 2 / n;
    }
    cout<<fixed<<setprecision(12)<<ans<<endl;
}

int main()
{
 // freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
   // int t;cin>>t;while(t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
#define rep(i,ra,re) for((i)=ra;(i)<(re);(i)++)
#define _rep(i,ra,re) for((i)=ra;(i)>(re);(i)--)
#define rep_(i,ra,re) for((i)=ra;(i)<=(re);(i)++)
#define _rep_(i,ra,re) for((i)=ra;(i)>=(re);(i)--)
#define put(n) cout << n << " "; 
#define puts(n) cout << n << endl;
#define pu(n) cout << n;
#define mod 1000000007
int i,j,k,l;
static const int MAX_N=10e5;
int A[MAX_N];
int main(void){
	int N;cin >> N;
	rep(i,0,N)cin >> A[i];
	sort(A,A+N);
	double ans=A[0];
	rep(i,1,N){
		ans=(ans+A[i])/2;
	}puts(ans);
	
	return 0;
}


Measured memory_bytes: 256
n, *A = map(int, open(0).read().split())
a=sorted(A)
if n%2:
    print(sum(a[-n//2+1:])*2 - sum(a[:n//2])*2 - min(a[n//2+1]-a[n//2],a[n//2]-a[n//2-1]))
else:
    print(sum(a[n//2+1:])*2 -sum(a[:n//2-1])*2 +a[n//2] -a[n//2-1])


Measured memory_bytes: 91452
#include<iostream>
using namespace std;
static const long long prime = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7;
typedef long long ll;
#define dame {cout << 0 << endl; return 0;}
ll pow(long long a, long long n, long long p) {
    if (n == 0)
        return 1;
    if (n % 2 == 1) {
        ll b = (a * pow(a, n - 1, p)) % p;
        return b;
    }
    else {
        long long t = pow(a, n / 2, p);
        return (t * t) % p;
    }
}

int main() {

    ll ans, x, y;
    cin >> x >> y;

    if((x+y)%3!=0)
    dame
    if((2*x-y)%3!=0)
    dame
    if((2*y-x)%3!=0)
    dame
    ll m = 2*x/3-y/3;
    ll n = 2 * y / 3 - x / 3;
    if(m<0||n<0)
    dame
    ll Y = 1;
    ll X = 1;
    
    for (ll i = 0; i < n; i++)
    {
        X *= (m + n) - i;
        X %= prime;

        Y *= (i + 1);
        Y %= prime;
    }
    ans = X * pow(Y, prime - 2, prime) % prime;
    cout << ans << endl;
}



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

using namespace std;

int main() {
    string s, t, u;
    cin >> s >> t;

    u = t.erase(s.size());

    if(s == u) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3608
<?php
//https://atcoder.jp/contests/abc139/submissions/7295556
//error_reporting(0);
$N = (int)trim(fgets(STDIN));
//list($A,$B) =  explode(" ",trim(fgets(STDIN)));
//$H = explode(" ",trim(fgets(STDIN)));




for($row=0;$row<$N;$row++) {
  $H = explode(" ",trim(fgets(STDIN)));
  for($col =0;$col<$N-1;$col++) {
    $A[$row][$col]=(int)$H[$col];
  }
}

$siain = 0;
$maxday = 0;


//$sn =  array_fill(0,1000,0);
//$last = array_fill(0,1000,0);
$sn = new SplFixedArray(1000);
$last = new SplFixedArray(1000);
for($i=0;$i<1000;$i++) $sn[$i]=$last[$i]=0;


    while(1)
    {
        $siai = false;
        for($i=0;$i<$N;$i++)
        {
            if($sn[$i]==$N-1) continue;
            // jと試合できるならする
            $j = $A[$i][$sn[$i]]-1;
            if($wait[$j][$i])
            {
                $sn[$i]+=1;
                $sn[$j]+=1;
                $day = max($last[$i],$last[$j])+1;
                $last[$i] = $day;
                $last[$j] = $day;
                $maxday = max($day, $maxday);
                $siai = true;
                $siain++;
                $i--;
            }else
            {
                $wait[$i][$j] = true;
            }
        }
        if(!$siai)
        {
            printf("-1\n");
            return 0;
        }
        if($siain>=($N*($N-1)/2)) break;
    }
    printf("%d\n",$maxday);

    return 0;

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

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

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

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(int, n, m);
    if(n == 1){
        if(m == 0) Return(0);
        Cin(int, _, ans);
        Rep(m-1){
            Cin(int, s, c);
            if(c != ans) Return(-1);
        }
        Return(ans);
    }

    vc<int> ans(n+1, -1);
    Rep(m){
        Cin(int, s, c);
        if(s == 1 && c == 0) Return(-1);
        if(ans[s] != -1 && ans[s] != c) Return(-1);
        ans[s] = c;
    }
    cout << (ans[1] == -1 ? 1 : ans[1]);
    for(int s = 2; s <= n; s ++){
        cout << (ans[s] == -1 ? 0 : ans[s]);
    }
    Cout();
}


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

using namespace std;

int ap[10][10][10];

int cif[10];
int ok[10][10];

string s;

int main()
{
    int n;
    cin >> n;
    cin >> s;
    for(int i = 1; i <= n; i ++)
    {
        int a;
        a = s[i - 1] - '0';

        for(int h = 0; h <= 9; h ++)
        {
            for(int l = 0; l <= 9; l ++)
            {
                if(ok[h][l] == 1)
                    ap[h][l][a] = 1;
            }
        }

        for(int j = 0; j <= 9; j ++)
        {
            if(cif[j] == 1)
                ok[j][a] = 1;
        }

        cif[a] = 1;
    }

    int rez = 0;
    for(int i = 0; i <= 9; i ++)
    {
        for(int j = 0; j <=9; j ++)
        {
            for(int h = 0; h <= 9; h ++)
                rez += ap[i][j][h];
        }
    }

    cout << rez << "\n";

    return 0;
}


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

int main(void)
{
	int stack[100];
	int top = 0;
	int x;
	char str[100];
	while (scanf("%s", str) != EOF)
	{
		if (str[0] == '+')
		{
			stack[top - 2] = stack[top -2] + stack[top - 1];
			top--;
			continue;
		}
		if (str[0] == '-')
		{
			stack[top - 2] = stack[top -2] - stack[top - 1];
			top--;
			continue;
		}
		if (str[0] == '*')
		{
			stack[top - 2] = stack[top -2] * stack[top - 1];
			top--;
			continue;
		}
		x = atoi(str);
		stack[top] = x;
		top++;
	}

	printf("%d\n", stack[0]);
	return 0;
}


Measured memory_bytes: 1968
#include <bits/stdc++.h>
const char nl = '\n';
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int N = 21;

int n;
int a[N];
int dp[1 << N];

void add(int& p, int q) {
  p += q;
  if (p >= MOD) p -= MOD;
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int x; cin >> x;
      a[i] ^= x << j;
    }
  }
  dp[(1 << n) - 1] = 1;
  for (int i = (1 << n) - 2; i >= 0; i--) {
    int p = __builtin_popcount(i);
    for (int bm = ~i & a[p]; bm; bm -= bm & (-bm)) {
      //int j = __builtin_ctz(bm & (-bm));
      //cerr << (bm & (-bm)) << " " << j << nl;
      //if (i & (1 << j) || !a[p][j]) continue;
      add(dp[i], dp[i ^ (bm & (-bm))]);
    }
  }
  cout << dp[0] << nl;
  return 0;
}


Measured memory_bytes: 8448
/* Akshat Sharma @akshat98 */
#include <iostream>
#include <bits/stdc++.h>
#define IOS  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define mp   make_pair
#define pb   push_back
#define F    first
#define S    second
#define int long long
#define ll   long long
#define MOD  1000000007
#define MAX  1000000001
#define vi   vector<int>
#define vl   vector<ll>
#define vpi  vector<pair<int,int> >
#define vpl  vector<pair<ll,ll> >
#define rep(i,a,b) for(i=a;i<b;i++)
#define reqp(i,a,b) for(i=a;i<=b;i++)
#define ren for(i=0;i<n;i++)
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef pair<int,int>pii;
typedef pair<ll,ll>pll;
ll mod(ll a,ll m=MOD){
        a%=m;
        if(a<0)a+=m;
        return a;
}
ll fact[100005]{};
ll ifact[100005]{};
vl vec[100005];
int child[100005]{};
bool vis[100005]={0};
ll power(ll a,ll b,ll m=MOD){
        ll res=1;
        while(b){
                if(b%2)res=mod(1ll*res*a),b--;
                else a=mod(1ll*a*a),b/=2;
        }
        return res;
}

ll per(ll n,ll c){
	if(n<c)return 0;
	return mod(1ll*fact[n]*ifact[n-c]);
}


// void dfs_1(int ind){
// 	vis[ind]=1;
// 	int ind=0;
// 	for(auto it:vec[ind]){
// 		if(!vis[it]){
// 			dfs(it);
// 		}
// 	}
// }

signed main()
{
	#ifndef ONLINE_JUDGE
	//freopen("input_file.txt", "r", stdin);
	//freopen("output_file.txt", "w", stdout);
	#endif
	ll i,j,k,l,n,test_case,m,r,u,v;
	test_case=1;
	//cin>>test_case;
	fact[0]=fact[1]=1;
	ifact[0]=ifact[1]=1;
	rep(i,2,100005){
		fact[i]=mod(fact[i-1]*i);
		ifact[i]=power(fact[i],MOD-2);
	}
	while(test_case--){
		cin>>n>>k;
		int deg[100005]{};
		rep(i,0,n-1){
			cin>>u>>v;
			deg[u]++;
			deg[v]++;
			vec[u].pb(v);
			vec[v].pb(u);
		}
		child[1]=deg[1];
		reqp(i,2,n){
			child[i]=deg[i]-1;
		}
		ll ans=k;

		ans=mod(ans*per(k-1,child[1]));
		reqp(i,2,n){
			ans=mod(ans*per(k-2,child[i]));
		}
		cout<<ans<<"\n";





	}
	
	return 0;
}

Measured memory_bytes: 9588
#include <bits/stdc++.h>
#define boost ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define M 1000000007
#define eb emplace_back
#define watch(x) cout << (#x) <<" is "<< x <<"\n";


using namespace std;
//const int N = 1e6;

int32_t main(){
  boost;
  int tc = 1; //cin >> tc;
  while(tc--)
  {
    string s, t; cin >> s >> t;
    int ans = INT_MAX;
    for(int i=0; i<=s.size()-t.size(); i++)
    {
      int cnt = 0, k = 0;
      for(int j=i; j<i+t.size(); j++, k++)
      {
        if(s[j] != t[k])
          cnt++;
      }
      ans = min(ans, cnt);
    }
    cout << ans <<"\n";
  }
}



Measured memory_bytes: 3656
n = int(input())
a = [int(input()) for i in range(n)]

amax1 = max(a)
amax_i1 = a.index(amax1)

a.pop(amax_i1)
amax2 = max(a)
amax_i2 = a.index(amax2)

for i in range(n):
    if i == amax_i1:
        print(amax2)
    else:
        print(amax1)

Measured memory_bytes: 16880
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(c) begin(c), end(c)
#define dump(x) cerr << __LINE__ << ":\t" #x " = " << x << endl

using ld = double;
using P = complex<ld>;
using G = vector<P>;
const ld pi = acos(-1);
const ld eps = 1e-10;
const ld inf = 1e12;

ld cross(const P &a, const P &b) {
	return a.real() * b.imag() - a.imag() * b.real();
}
ld dot(const P &a, const P &b) {
	return a.real() * b.real() + a.imag() * b.imag();
}

using C = pair<ld, P>;
#define rad first
#define pnt second

C smallest_enclosing_disc(vector<P> ps) {
	auto c3 = [](const P &a, const P &b, const P &c) {
		ld A = norm(b - c);
		ld B = norm(c - a);
		ld C = norm(a - b);
		ld S = abs(cross(b - a, c - a));
		P p = (A * (B + C - A) * a + B * (C + A - B) * b + C * (A + B - C) * c)
				/ (4 * S * S);
		ld r = abs(p - a);
		return make_pair(r, p);
	};

	auto c2 = [](const P &a, const P &b) {
		P c = (a + b) / (ld) 2;
		ld r = abs(a - c);
		return make_pair(r, c);
	};

	auto in_circle = [](const P &a, const C &c) {
		return norm(a - c.pnt) <= c.rad * c.rad + eps;
	};

	int n = ps.size();
	random_shuffle(ps.begin(), ps.end());
	C c = c2(ps[0], ps[1]);
	for (int i = 2; i < n; ++i) {
		if (!in_circle(ps[i], c)) {
			c = c2(ps[0], ps[i]);
			for (int j = 1; j < i; ++j) {
				if (!in_circle(ps[j], c)) {
					c = c2(ps[j], ps[i]);
					for (int k = 0; k < j; ++k) {
						if (!in_circle(ps[k], c)) {
							c = c3(ps[i], ps[j], ps[k]);
						}
					}
				}
			}
		}
	}
	return c;
}
int main() {
	int n;
	cin>>n;
	G g(n);
	rep(i,n)
	{
		ld x, y;
		cin >> x >> y;
		g[i] = P(x, y);
	}
	printf("%.12lf\n",smallest_enclosing_disc(g).first);
}


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

int main() {
  int a;
  int b;
  cin >> a;
  cin >> b;
  double x;
  int y;
  int kai;
  x = ( a + b ) / 2;
  y = ( a + b ) % 2;
  kai = x + y;
  cout << kai << endl;
}

Measured memory_bytes: 3604
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

int main(){
	string s; cin >> s;
	int N = s.size();
	int ans = INF;
	for(char c = 'a'; c <= 'z'; c++){
		int cnt = 0;
		string t = s;
		rep(i,N){
			bool ok = true;
			rep(j,t.size()) if(t[j] != c) ok = false;
			if(ok) break;
			rep(j,(int)t.size()-1){
				if(t[j+1] == c){
					t[j] = c;
				}
			}
			t.erase((int)t.size()-1);
			cnt++;
		}
		ans = min(ans,cnt);
	}
	cout << ans << endl;

}



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

int selectionSort(int a[], int n){
  int sum=0;
  for(int i=0;i<n;i++){
    int minj=i;
    for(int j=i;j<n;j++){
      if(a[j]<a[minj]) minj=j;
    }
    if(i!=minj){
      int tmp=a[i];
      a[i]=a[minj];
      a[minj]=tmp;
      sum++;
    }
  }
  return sum;
}
      

int main(){
  int n,a[100];

  cin>>n;
  for(int i=0;i<n;i++)
    cin>>a[i];
  
  int sum=selectionSort(a,n);
  
  for(int i=0;i<n-1;i++)
    cout<<a[i]<<" ";
  cout<<a[n-1]<<endl;
  cout<<sum<<endl;
}


Measured memory_bytes: 1160
N = int(input())
Ws = []
for x in range(100):
  Ws.append(str(input()))
  if x+1 == N:
    break

words = [Ws[0]]
tmp = list(Ws[0])[-1]
Ws.remove(Ws[0])

for y in Ws:
  if y in words:
    print('No')
    break
  elif tmp == list(y)[0]:
    words.append(y)
    tmp = list(y)[-1]
  else:
    print('No')
    break

if len(words) == N:
  print('Yes')


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int func(long long a){
    int b = 0;
    while(a != 0){
        a /= 10;
        b++;
    }
    return b;
}

long long func2(int a, int b){
    long long c = 1;
    for(int i = 0; i <= b; i++){
        c *= a;
    }
    return c;
}

int main(){
    long double A, B, C;
    cin >> A >> B;
    C = floor(A * B);
    cout << fixed << setprecision(0) << C << endl;
    return 0;
}

Measured memory_bytes: 3796
H, W = [int(x) for x in input().split()]
G = []
for _ in range(H):
    G.append(input())

import queue, itertools
dist = {(i, j) : -1 for i, j in itertools.product(range(W), range(H))}
dist[(0, 0)] = 1
q = queue.Queue()
q.put((0, 0))

dx = [1,  0, -1,  0]
dy = [0,  1,  0, -1]

while not q.empty():
    x, y = q.get()
    d = dist[(x, y)]
    for i in range(4):
        nx, ny = x + dx[i], y + dy[i]
        if min(nx, ny) >= 0 and nx <= W - 1 and ny <= H - 1:
            if dist[(nx, ny)] == -1 and G[ny][nx] == '.':
                dist[(nx, ny)] = d + 1
                q.put((nx, ny))
            else: 
                continue

if dist[(W - 1, H - 1)] == -1:
    print(-1)
else:    
    print(H * W - ''.join(G).count('#') - dist[(W - 1, H - 1)])

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

int n,T[300],m,P,X;

int main(){

  while(cin>>n){

     for(int i=0;i<n;i++)
        scanf("%d",T+i);

     cin>>m;

     while(m--){
        scanf("%d %d",&P,&X);
        long long sum=0;
        for(int i=0;i<n;i++)
            if(i==P-1)
             sum+=X;
            else
             sum+=T[i];

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

     }


  }


return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {
     public static void main(String[] args) {
         FastScanner fs=new FastScanner();
         int T = 1;
         for (int tt=0; tt<T; tt++) {
                int d=fs.nextInt();
                int t = fs.nextInt();
                int s = fs.nextInt();

                if(s*t >= d)
                    System.out.println("Yes");
                else
                    System.out.println("No");
        }
}
 
 static class FastScanner {
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     StringTokenizer st=new StringTokenizer("");
     String next() {
     while (!st.hasMoreTokens())
         try {
             st=new StringTokenizer(br.readLine());
         } catch (IOException e) {
             e.printStackTrace();
         }
         return st.nextToken();
     }
     
     int nextInt() {
         return Integer.parseInt(next());
     }
     int[] readArray(int n) {
         int[] a=new int[n];
         for (int i=0; i<n; i++) a[i]=nextInt();
         return a;
     }
     long nextLong() {
         return Long.parseLong(next());
     }
 }

 
}


Measured memory_bytes: 32684
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18,MOD = 1e9 + 7;
const int INT_INF = 1e9,INT_MOD=1e9+7;
#define rep(i, N) for(int i = 0; i < N; i++)
typedef pair<int, int> Pi;
typedef pair<double, double> P;
signed main(){
   int k,a,b;cin>>k>>a>>b;
    for(int i=a;i<=b;i++){
        if(i%k==0){
            cout<<"OK"<<endl;
            return 0;
        }
    }
    cout<<"NG"<<endl;
    return 0;
}

Measured memory_bytes: 3620
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[ohara], b[ohara], c[ohara], d[ohara], tmp, m, h, w, x, y, sum,
    k, q;
ll dd[20];

void dfs(ll it, ll now[]) {
  if (it == n) {
    // vector<ll> dede;             //<ll>はaの型
    // rep(i, n) dede.p_b(now[i]);  // forのrange, 何をpush？
    // debug(dede);
    ll score = 0;
    rep(i, q) {
      if (now[b[i]] - now[a[i]] == c[i]) score += d[i];
    }
    ans = max(ans, score);
    return;
  }
  ll st;
  if (it == 0)
    st = 1;
  else
    st = now[it - 1];
  rrep(i, st, m + 1) {
    now[it] = i;
    dfs(it + 1, now);
  }
}

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

  cin >> n >> m >> q;
  rep(i, q) cin >> a[i] >> b[i] >> c[i] >> d[i], a[i]--, b[i]--;
  dfs(0, dd);
  Cout(ans);
  return 0;
}

Measured memory_bytes: 3676
solver::Int->Int->String
solver a b = if or (map (\x->mod x 3 == 0)  [a,b,a+b]) then "Possible\n" else "Impossible\n"

main::IO()
main=do
  abc<-getLine
  let a:b:[]=map read (words abc)
  putStr (solver a b)

Measured memory_bytes: 508
#include <iostream>
#include <string>

using namespace std;

int main(int argc, const char *argv[]) {
  string S, T;
  cin >> S >> T;

  T.pop_back();
  if(S == T){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
long long int Q,H,S,D,N;
int a[100001];
int main(){
  cin >> Q >> H >> S >> D >> N;
  //for(int i=0;i<N;i++)cin >> a[i];
  long long int Min=100000000000;
  long long int ans=0;
  
  if(N==1){
    Min=min(Min,4*Q);
    Min=min(Min,2*H);
    Min=min(Min,S);
    cout << Min << endl;
  }
  else {
    Min=min(Min,8*Q);
    Min=min(Min,4*H);
    Min=min(Min,2*S);
    Min=min(Min,D);
    long long int kosu=0;
    kosu=N/2;
    ans=kosu*Min;
    N%=2;
    if(N==0)cout << ans << endl;
    else{
      Min=100000000000;
      Min=min(Min,4*Q);
      Min=min(Min,2*H);
      Min=min(Min,S);
      ans+=Min;
      cout << ans << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
from heapq import nlargest
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()))
ab=nlargest(k,(x+y for x in a for y in b))
abc=nlargest(k,(xy+z for xy in ab for z in c))
for i in abc:
  print(i)

Measured memory_bytes: 4084
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;cin>>N;
  vector<pair<int,int>>A(100001);
  vector<pair<int,int>>B(100001);
  for(int i=0;i<100001;i++){
    A[i].second=i;
    B[i].second=i;
  }
  for(int i=0;i<N;i++){
    int a;cin>>a;
    if(i%2==0)A[a].first++;
    else B[a].first++;
  }
  sort(A.begin(),A.end());
  sort(B.begin(),B.end());
  reverse(A.begin(),A.end());
  reverse(B.begin(),B.end());
  if(A[0].second!=B[0].second)cout<<N-A[0].first-B[0].first<<endl;
  else cout<<min(N-A[0].first-B[1].first,N-A[1].first-B[0].first)<<endl;
}

Measured memory_bytes: 4832
n=int(input())
h=list(map(int,input().split()))
count=0
max=0
for i in range(n-1):
    if h[i]<h[i+1]:
        if max<count:
            max=count
        count=0
    else:
        count+=1
        if i==n-2:
            if max<count:
                max=count
print(max)


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

using namespace std;

int main() {
    int d;
    cin >> d;

    if (d == 25) {
        cout << "Christmas" << endl;
    } else if (d == 24) {
        cout << "Christmas Eve" << endl;
    } else if (d == 23) {
        cout << "Christmas Eve Eve" << endl;
    } else if (d == 22) {
        cout << "Christmas Eve Eve Eve" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n,k,q=map(int,input().split())
    P=[k-q]*n
    for _ in range(q):
        a=int(input())
        P[a-1]+=1

    for p in P:
        print("Yes" if(p>0) else "No")
resolve()

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

using namespace std;
using ll = long long;
constexpr int mod = 1e9+7;
constexpr int md = mod;

int main(){
    vector<int> d(5);
    for(auto & a : d) cin>>a;
    int ret = 0;
    vector<int> e;
    for(auto a : d)if(a%10 == 0){ret+=a;}else e.push_back(a);
    sort(e.begin(),e.end(),[](int a,int b){
        return a%10 > b%10;
    });
    for(int i=0;i<(int)e.size();++i){
        if(i != (int)e.size() -1)ret += ((e[i]/10)+1)*10;
        else ret += e[i];
    }
    cout << ret <<endl;
    return 0;
}



Measured memory_bytes: 256
def solve():
  N, M = map(int, input().split())
  X = list(map(int, input().split()))
  X.sort()
  lis = []
  for i in range(M-1):
    lis.append(X[i+1]-X[i])
  lis.sort(reverse=True)
  ans = X[-1]-X[0]-sum(lis[:N-1])
  return ans
print(solve())

Measured memory_bytes: 20300
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;
 
int main(void)
{
    string N;
    cin >> N;
    for(int i=0;i<3;i++){
        if(N.at(i)=='7'){
            cout <<"Yes"<<endl;
            break;
        }
        if(i==2&&N.at(2)!=7){
            cout<<"No"<<endl;
            break;
        }

    }

    
    return 0;
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
typedef long long int64;

int main()
{
  int n;
  int64 s[100];
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> s[i];
  }
  int64 dp[101][21] = {{}};
  fill_n( *dp, 100 * 21, 0);
  dp[0][s[0]] = 1LL;

  for(int i = 0; i < n - 2; i++){ //ほげ！！
    for(int j = 0; j < 21; j++){
      if(j + s[i + 1] <= 20) dp[i + 1][j + s[i + 1]] += dp[i][j];
      if(j - s[i + 1] >=  0) dp[i + 1][j - s[i + 1]] += dp[i][j];
    }
  }
  cout << dp[n - 2][s[n - 1]] << endl;
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
int main(){
    int x,a,b;cin>>x>>a>>b;
    if(a-b>=0)cout<<"delicious"<<endl;
    else if(b-a<=x) cout<<"safe"<<endl;
    else cout<<"dangerous"<<endl;
}


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

ll dfs(vector<int> &v, int N, int i, ll sum, ll addition) {
  if (i == N) return sum + addition;
  
  ll res = 0;
  res += dfs(v, N, i+1, sum,          10*addition+v[i]);
  res += dfs(v, N, i+1, sum+addition, v[i]);
  return res;
}

int main() {
  string S;
  cin >> S;
  
  int N = S.size();
  vector<int> v(N);
  rep(i,N) v.at(i) = S.at(i) - '0';
  cout << dfs(v, N, 1, 0, v[0]) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define ll long long 
#define M 1000000007
#define P pair<int,int>
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define rep(i,n) FOR(i,0,n)
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265

int n,k;
vector<int> xa,ya;

int main(){
  cin>>n>>k;
  vector<int> x(n),y(n);

  rep(i,n){
    cin>>x[i]>>y[i];
    xa.push_back(x[i]);
    ya.push_back(y[i]);
  }

  sort(xa.begin(),xa.end());
  sort(ya.begin(),ya.end());

  ll ans = (ll)(xa[n-1]-xa[0])*(ya[n-1]-ya[0]);

  for(int xi=0;xi<n;xi++){
    for(int xj=xi+1;xj<n;xj++){
      for(int yi=0;yi<n;yi++){
        for(int yj=yi+1;yj<n;yj++){
          int num=0;
          ll lx = xa[xi],rx = xa[xj];
          ll by = ya[yi],uy = ya[yj];

          for(int i=0;i<n;i++){
            if(lx<=x[i]&&x[i]<=rx&&by<=y[i]&&y[i]<=uy){
              num++;
            }
          }
          if(num>=k)
            ans=min(ans,(ll)(rx-lx)*(uy-by));
        }
      }
    }
  }

  cout<<ans<<endl;

  return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ll long long
#define lld long double
#define MOD 1000000007LL
#define inf 1000000000000000000ll
#define pii pair<int,int>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
ll power(ll x,ll y, ll md=MOD){ll res = 1;x%=md;while(y){if(y&1)res = (res*x)%md;x *= x; if(x>=md) x %= md; y >>= 1;}return res;}
 
using namespace std;

#define endl '\n'
#define int ll


int lcm(int a, int b) {
	int g = __gcd(a,b);
	int ans = a/g;
	ans *= b;
	return ans;
}

signed main() {
	fast;

	int x;
	cin>>x;

	int lc = lcm(x, 360);
	cout<<lc/x;

}

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

using namespace std;


int TotalMethodOfCard[8][1001];
int Number[7], Count[7];

int main() {
	int m, g, n;

	while (cin >> m, m) {
		memset(TotalMethodOfCard, 0, sizeof(TotalMethodOfCard));
		memset(Number, 0, sizeof(Number));
		memset(Count, 0, sizeof(Count));

		for (int i = 0; i < m; i++) {
			cin >> Number[i] >> Count[i];
		}

		TotalMethodOfCard[0][0] = 1;
		for (int i = 0; i < m; i++) {
			for (int j = 0; j <= Count[i]; j++) {
				for (int k = 0; k < 10001; k++) {
					if (k + Number[i] * j < 1001) {
						TotalMethodOfCard[i + 1][k + Number[i] * j] += TotalMethodOfCard[i][k];
					}
				}
			}
		}
		cin >> g;
		while (g--) {
			cin >> n;
			cout << TotalMethodOfCard[m][n] << endl;
		}
	}


	return 0;
}


Measured memory_bytes: 3024
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int a, b;

void solve() {
	cin >> a >> b;
	if(a <= 0 && 0 <= b) cout << "Zero\n";
	else if(0 < a) cout << "Positive\n";
	else {
		if((b - a + 1) % 2) cout << "Negative\n";
		else cout << "Positive\n";
	}
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll MOD = 1e9+7;

int main(){
  int n;
  cin>>n;
  int cnt[2][111111]={};
  int ma[2]={};
  int k[2];
  for(int i=0;i<n;i++){
	int a;
	cin>>a;
	cnt[i%2][a]++;
	int t=ma[i%2];
	ma[i%2]=max(ma[i%2],cnt[i%2][a]);
	if(t!=ma[i%2]){
	  k[i%2]=a;
	}
  }
  sort(cnt[0],cnt[0]+111111);
  sort(cnt[1],cnt[1]+111111);
  int a=111110;
  int b=111109;
  if(k[0]==k[1])cout<<n-max(cnt[0][a]+cnt[1][b],cnt[0][b]+cnt[1][a])<<endl;
  else cout<<n-ma[0]-ma[1]<<endl;
  return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
// ascii 97~122

int main(){
    string s;
    getline(cin,s);
    vector<bool> vec(26);
    for(int i=0; i<26; i++){
        vec.at(i) = false;
    }
    char c;
    int n = s.size();
    for(int i=0; i<n; i++){
        c = s.at(i);
        vec.at((int)(char)c - 'a') = true;
    }
    for(int i=0; i<26; i++){
        if(vec.at(i)==false){
            cout << (char)(i +'a') << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 3728
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
	double a, b, c, d, e, f;
	cout << setprecision(3) << fixed;
	while (cin >> a >> b >> c >> d >> e >> f) {
		double denom = a * e - b * d;
		double x = (c * e - b * f) / denom;
		x = (x == -0) ? 0 : x;
		double y = (a * f - c * d) / denom;
		y = (y == -0) ? 0 : y;

		cout << x << ' ' << y << endl;
	}
	return 0;
}

Measured memory_bytes: 1280
#include <cstdio>

using namespace std;

int main() {
    int k, s;
    int ans = 0;
    scanf("%d %d", &k, &s);
    for (int i = 0; i <= k; i++) {
        for (int j = 0; j <= k; j++) {
            if (s -i -j >= 0 && s - i - j <= k) {
                ans++;
            }
        }
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(void){
    int n;
    char lastChar;
    string str;
    int ans = 1;
    cin >> n;
    cin >> str;
    lastChar = str[0];
    for(int i = 1;i < n;i++){
        
        if (lastChar != str[i]){
            lastChar = str[i];
            ans++;
        }
    }
    cout << ans << endl;
}

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

using namespace std;

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

using ll = long long;
using pint = pair<int, int>;
using mint = map<int, int>;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1e9+7;
const int INF = 1e9;
const ll LINF = 1e18;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	int len = v.size();
    s << '[';
	for (int i = 0; i < len; ++i) {
		s << v[i]; if (i < len-1) s << ", ";
	}
    s << ']';
	return s;
}

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, k;
	string s;
	cin >> n >> s >> k;

	char c = s[k-1];
	rep(i, n){
	    if(s[i] != c) cout << '*';
		else cout << s[i];
	}
	cout << endl;
    return 0;
}


Measured memory_bytes: 256
import math

def func(A, B, x):
    return math.floor(A*x/B)-A*math.floor(x/B)

A, B, N = list(map(int, input().split()))

"""
i = 1
max_x = -9999999
max = -9999999
while (i <= N):
    ans =func(A, B, i) 
    if (ans > max):
        max = ans
        max_x = i
    i += 1

print(max)
"""

print(func(A, B, min(B-1, N)))

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

bool isprime(ll a)
{
	ll count=0;
	for(int i=1;i*i<=a;i++)
	{
		if(a%i==0)count+=2;
		if(i*i==a)count--;
	}
	
	if(count==2)return true;
	else
	return false;
	
}


vector<ll>d(151,0);
ll digitsum(ll n)
{
	ll s=0;
		while(n>0)
		{
			s+=n%10;
			n=n/10;
		}
		return s;
		
	
}
void solve()
{
	
 ll n,x;
 
 
 cin>>n;
 
string ans;
char c;

while(n>0)
{

	x=n%26;
	x--;
	
	if(x<0)
	x=25;
	
	c='a'+x;
	
	ans+=c;

	if(n%26==0)
	{
		n=n/26;
		n--;
		}	
		else
		n=n/26;
	
	
	
}

reverse(ans.begin(),ans.end());
cout<<ans;
	
	

 
 
	
	

}




int main()
{


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

		solve();
	
return 0;

		
	}
	
	
	


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

class Main{
    public static void main(String[] args){
	BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
	String st;
	try{
	    while((st=sc.readLine())!=null){
		int[] t = new int[10];
		for(int i=0; i<10; i++)
		    t[i] = st.charAt(i)-'0';
		for(int i=9; i>0; i--){
		    int j;
		    for(j=0; j<i; j++)
			t[j] = (t[j]+t[j+1])%10;
		}
		System.out.println(t[0]);
	    }
	}catch (Exception e){
	    System.out.println("Error");
	}
    }
}

Measured memory_bytes: 8956
import kotlin.math.PI
import kotlin.math.cos
import kotlin.math.sin
import kotlin.math.sqrt

fun main(args: Array<String>) {
    val line = readLine()!!.trim()
    val (jisin: Long, hunsin: Long, h: Long, m: Long) = line.split(" ").map { it.toLong() }

    val hunsinKaku: Double = 2 * m * PI / 60L
    val hunsinX: Double = sin(hunsinKaku) * hunsin
    val hunsinY: Double = cos(hunsinKaku) * hunsin

    val jisinKaku: Double = 2 * PI * (h.toDouble() / 12L + m.toDouble() / (60L * 12L))
    val jisinX: Double = sin(jisinKaku) * jisin
    val jisinY: Double = cos(jisinKaku) * jisin

    val x = hunsinX - jisinX
    val y = hunsinY - jisinY

    val kyori = sqrt(x * x + y * y)

    println("${kyori}")
}

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

int main() {
  ll W, H, x, y;
  cin >> W >> H >> x >> y;

  cout << fixed << setprecision(10) << double(W) * H / 2 << " ";

  if (x*2 == W && y*2 == H) cout << "1" << endl;
  else cout << "0" << endl;
}


Measured memory_bytes: 256
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


// CHECK THE LIMITS
typedef long long ll;

const int MOD = 1000000007;
const ll INFLL = 1e18;
const int INF = 1e9;
const int NMAX = 1000001;

int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
} 

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int x,k;
    cin >> k >> x;
    if(1LL * k * 500 >= x)
      cout << "Yes";
    else
    {
      cout << "No";

    }
    


    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int N, a, b, sum = 1;
    cin >> N;
    cin >> a;
    
    for(int i = 0;i<(N-1);i++){
        cin >> b;
        if(b >=a){
            sum++;
            a = b;
        }
    }
    cout << sum <<endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
using namespace std;
struct card{
    char suit;
    int number;
};

void printArray(const card *A, int N){
    for(int i=0; i<N-1; i++){
        cout << A[i].suit << A[i].number << " ";
    }
    cout << A[N-1].suit << A[N-1].number << endl;
}

bool checkStable(card* in, card* out, int N){
    for(int i=0; i<N-1; i++){
        for(int j=i+1; j<N; j++){
            for(int k=0; k<N-1; k++){
                for(int l=k; l<N; l++){
                    if(in[i].number == in[j].number &&
                       in[i].number == out[l].number &&
                       in[i].suit == out[l].suit &&
                       in[j].number == out[k].number &&
                       in[j].suit == out[k].suit){
                           cout << "Not stable" << endl;
                           return false;
                       }
                }
            }
        }
    }
    cout << "Stable" << endl;
    return true;
}

void bubbleSort(card *A, int N){
  int flag = 1;
  for(int i=0; flag; i++){
    flag = 0;
    for(int j=N-1; j>=i+1; j--){
      if(A[j].number < A[j-1].number){
        swap(A[j], A[j-1]);
        flag = 1;
      }
    }
  }
  printArray(A, N);
}

void selectionSort(card *A, int N){
  for(int i=0; i<N; i++){
    int minj = i;
    for(int j=i; j<N; j++){
      if(A[j].number < A[minj].number){
        minj = j;
      }
    }
    if(minj != i){
      swap(A[i], A[minj]);
    }
  }
  printArray(A, N);
}

int main(){
    int x;
    cin >> x;
    card* A = new card[x];
    for(int i=0; i<x; i++){
        cin >> A[i].suit >> A[i].number;
    }
    card* B = new card[x];
    card* origin = new card[x];
    memcpy(B, A, sizeof(card)*x);
    memcpy(origin, A, sizeof(card)*x);
    bubbleSort(A, x);
    checkStable(origin, A, x);
    selectionSort(B, x);
    checkStable(origin, B, x);
    delete A, B;
}


Measured memory_bytes: 3124
use std::io;
use std::cmp;

fn main() {
    let cs = read_one::<String>();
    let cs_clone = cs.clone();
    let mut cs = cs.chars().zip(0..).collect::<Vec<(char, usize)>>();
    let k = read_one::<usize>();

    cs.sort();
    let mut vec = Vec::new();
    let mut cnt = 0;
    let mut prev = cs[0].0;
    let max = cs_clone.len();
    for c in cs {
        if cnt >= 5 { break; }
        if prev != c.0 { cnt += 1; prev = c.0; }
        for i in 0..5 {
            vec.push(&cs_clone[(c.1)..cmp::min(c.1 + i + 1, max)]);
        }
    }
    vec.sort();
    vec.dedup();
    println!("{}", vec[k-1]);
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

Measured memory_bytes: 4352
#include <iostream>
#include <map>
#include <vector>
#include <cstring>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <string>
#include <stack>
#include <set>
#include <deque>
#define mp make_pair
typedef long long ll;
using namespace std;
string str;
long long cnt;
int main(){
	cin>>str;
	if (str.size()==1){
		cout<<str;
		return 0;
	}
	for (int i=1;i<str.size();i++){
		if (str[i]!='9'){
			break;
		}
		if (i==str.size()-1){
			cout<<str.size()*9-9+str[0]-'0';
			return 0;
		}
	}
	cout<<9*str.size()-9+str[0]-'1';
	return 0;
}

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

#define Rep0(i, n)  for (int i=0; i<n; i++)
#define Sort(P) sort(P.begin(), P.end())

void    Pre(const int &I, const vector<vector<int>> &A, vector<int> &l) {
    l.push_back(I);
    if (-1!=A.at(I).at(1))
        Pre(A.at(I).at(1), A, l);
    if (-1!=A.at(I).at(2))
        Pre(A.at(I).at(2), A, l);
}

void    In(const int &I, const vector<vector<int>> &A, vector<int> &l) {
    if (-1!=A.at(I).at(1))
        In(A.at(I).at(1), A, l);
    l.push_back(I);
    if (-1!=A.at(I).at(2))
        In(A.at(I).at(2), A, l);
}

void    Post(const int &I, const vector<vector<int>> &A, vector<int> &l) {
    if (-1!=A.at(I).at(1))
        Post(A.at(I).at(1), A, l);
    if (-1!=A.at(I).at(2))
        Post(A.at(I).at(2), A, l);
    l.push_back(I);
}

int     main() {
        int n;
        cin >>n;
        vector<vector<int>> A(n, vector<int> (3, 0));
        vector<bool> P(n, true);
        Rep0(i, n) {
                int N;
                cin >>N;
                for (int j=1; j<=2; j++) {
                        cin >>A.at(N).at(j);
                        if (0<=A.at(N).at(j))
                                P.at(A.at(N).at(j))=false;
                }
        }
        int B=0;
        Rep0(i, n)
                if (P.at(i))
                        B=i;
        vector<int> l;
        cout <<"Preorder" <<endl;
        l.erase(l.begin(), l.end());
        Pre(B, A, l);
        Rep0(i, n)
                cout <<' ' <<l.at(i);
        cout <<endl;
        cout <<"Inorder" <<endl;
        l.erase(l.begin(), l.end());
        In(B, A, l);
        Rep0(i, n)
                cout <<' ' <<l.at(i);
        cout <<endl;
        cout <<"Postorder" <<endl;
        l.erase(l.begin(), l.end());
        Post(B, A, l);
        Rep0(i, n)
                cout <<' ' <<l.at(i);
        cout <<endl;
        return 0;
}



Measured memory_bytes: 3164