akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  string S;
  cin >> S;
  int prev = 0;
  vector<ll> ans_list(S.length() + 1, 0);
  for (int i = 0; i < S.length(); i++) {
    if (S[i] == '<') {
      ans_list[i] = 0;
      ll l_cnt = 1;
      while (S[i + l_cnt] == '<') {
        ans_list[i + l_cnt] = max(l_cnt, ans_list[i + l_cnt]);
        l_cnt++;
      }
      ans_list[i + l_cnt] = max(l_cnt, ans_list[i + l_cnt]);
      i += l_cnt - 1;
    } else {
      ll g_cnt = 1;
      while (S[i + g_cnt] == '>') g_cnt++;
      ll cnt = 0;
      for (int j = i + g_cnt; j > i; j--) {
        ans_list[j] = max(cnt, ans_list[j]);
        cnt++;
      }
      ans_list[i] = max(ans_list[i], cnt);
      i += g_cnt - 1;
    }
  }
  ll ans = 0;
  for (auto e : ans_list) {
    ans += e;
  }
  cout << ans << endl;
  return 0;
}

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

using namespace std;

#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define pb push_back
#define endl '\n'
#define snd second
#define fst first
#define fastio cin.tie(NULL),cout.sync_with_stdio(true)

typedef long long int ll;
typedef unsigned long long int ull;
typedef vector <int> vi;
typedef pair <ll, int> ii;
typedef pair <ii,int> iii;

const ll inf = 1e17;
const ll mod = 1e9 + 7;
const int N = 200005;

void solve(){
	string a,b;
	cin >> a >> b;
	int ans = 0;
	for(int i = 0; i < sz(a); i++)ans += a[i] != b[i];
	cout << ans << endl;
}

int main(){
	fastio;
	int t = 1;
	//cin >> t;
	while(t--)
		solve();
	return 0;
}


Measured memory_bytes: 3852
#include <stdio.h>
int main(void) {
	int N, i, b = 1;
	scanf("%d", &N);
	for (i = 0; b<=N; i++) {
		b = b * 2;
	}
	if (N%b == 0) {
		printf("%d\n",b);
	}
	else {
		b = b / 2;
		printf("%d\n",b);
	}
	return 0;
}


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

int main() {
 int a,b;
 cin >> a >> b;
 if (a==b){
   for(int i=0;i<a;i++){
     cout << a;
   }
   cout << endl;
 }
 else if (a < b){
   for(int i=0;i<b;i++){
     cout << a;
   }
   cout << endl;
 }
 else{
   for(int i=0;i<a;i++){
     cout << b;
   }
   cout << endl;
 }
}


Measured memory_bytes: 256
#include <iostream>
#define M 1000000007
using namespace std;
long long C[100050][32] = {};

int main() {
    int n, m; cin >> n >> m;
    long long ans = 1;
    C[0][0] = 1;
    for (int a = 1; a < 100050; a++) {
        C[a][0] = 1;
        for (int b = 1; b < 32; b++)
            C[a][b] = (C[a-1][b] + C[a-1][b-1]) % M;
    }
    for (int p = 2; p * p <= m; p++) {
        int e = 0;
        while (m % p == 0) { e++; m /= p; }
        if (e > 0) ans = ans * C[n+e-1][e] % M;
    }
    if (m > 1) ans = ans * n % M;
    cout << ans << endl;
}


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

int main(){
  int n;
  cin >> n;
  vector<int> p(n);
  for(int i=0;i<n;i++){
    cin >> p[i];
  }
  int cnt=0;
  for(int i=1;i<=n-2;i++){
    if(p[i-1]>p[i] && p[i]>p[i+1]){
      cnt++;
    }else if(p[i+1]>p[i] && p[i]>p[i-1]){
      cnt++;
    }
  }
  cout << cnt << endl;
}
                             
                           

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

int main() {
  double d;
  while(cin>>d) {
    double a[10],s=0; a[0] = s = d;
    for(int i=0; i<9; i++) {
      if(i%2)a[i+1]=a[i]/3;
      else a[i+1]=a[i]*2;
      s+=a[i+1];
    }
    cout<<setprecision(10)<<s<<endl;
  }
  return 0;
}

Measured memory_bytes: 1276
//#include "pch.h"
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
#include <numeric>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265359;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };





signed main() {
	int a1, a2, a3;

	cin >> a1 >> a2 >> a3;

	int num = a1 + a2 + a3;

	if (num >= 22) {
		cout << "bust" << endl;
	}
	else {
		cout << "win" << endl;
	}





	return 0;
}


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

int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> B(N+1, 0);
  vector<int> W(N+1, 0);
  
  for(int i = 0; i < N; i++){
    B[i+1]+=B[i];
    W[i+1]+=W[i];
    if(S[i] == '.') B[i+1]++;
    if(S[i] == '#') W[i+1]++;
  }
  int minv = 10000000;
  int ans;
  for(int left = 0; left < N+1; left++){
    ans = (B[N]-B[left])+(W[left]-W[0]);
    minv = min(minv, ans);
  }
  cout << minv << endl;
}

Measured memory_bytes: 2180
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


int main()
{
    COMinit();
    int n, m;
    cin >> n >> m;

    int ans = 0;
    ans += COM(n, 2);
    ans += COM(m, 2);
    cout << ans;

}


Measured memory_bytes: 12160
#include <bits/stdc++.h>
using namespace std;
#define ri register int
typedef long long ll;
const int N=20,M=N*N,mod=1e9+7,S=1<<15|1;
int f[S],g[S][N],power[M];
int main(){
	ri n,m,i,u,s,t,x,y,res;
	scanf("%d%d",&n,&m);
	for(i=1;i<=m;++i)
		scanf("%d%d",&x,&y),
		--x,--y,
		g[1<<y][x]=1;
	u=(1<<n)-1;
	for(s=1;s<=u;++s)
		for(i=0;i<n;++i)
			g[s][i]=g[s&-s][i]+g[s^s&-s][i];
	power[0]=1;
	for(i=1;i<=max(n,m);++i) power[i]=power[i-1]*2ll%mod;
	f[0]=1;
	for(s=0;s<=u;++s)
		if(f[s]){
		//	printf("f %d %d\n",s,f[s]);
			for(t=s+1|s;t<=u;t=t+1|s){
				x=t^s;
				if(x>>0&1^x>>1&1)
					continue;
				res=1;
				for(i=0;i<n;++i){
					if(s&1<<i)
						res=(ll)res*power[g[x][i]]%mod;
					else if(~t&1<<i)
						res=(ll)res*(power[g[x][i]]-1)%mod;
				}
			//	printf("upd %d %d %d %d\n",s,t,x,res);
				f[t]=(f[t]+(ll)f[s]*res)%mod;
			}
		}
	printf("%d\n",(power[m]-f[u]+mod)%mod);
	return 0;
}

Measured memory_bytes: 2944
#include "bits/stdc++.h"
#define FI first.first
#define SE first.second
#define TH second
#define fi first
#define se second
#define th second

using namespace std;

class DebugStream {}LOG;
template <typename T>DebugStream &operator<<(DebugStream &s, const T&) { return s; }
#ifdef DEBUG
#define LOG clog
#endif

typedef long long ll;
typedef pair<ll, ll> ii;
typedef long double ld;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int maxN = 1e5 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20, bs = 29;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	int n, k;
	cin >> n >> k;
	vector<ll> vc(n);
	for(int i = 0; i < n; i++) {
		cin >> vc[i];
	}
	ll cr = accumulate(vc.begin(), vc.begin() + k - 1, 0LL), ans = 0;
	for(int i = 0; i + k <= n; i++) {
		cr += vc[i + k - 1];
		ans = max(ans, cr);
		cr -= vc[i];
	}
	ans += k;
	cout << ans / 2;
	if(ans % 2) cout << ".5";
	cout << '\n';
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
int const MOD = 1000000007;
ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;}
int madd(int a, int b) {return (a + b) % MOD;}
int msub(int a, int b) {return (a - b + MOD) % MOD;}
int mmul(int a, int b) {return (a * b) % MOD;}
int minv(int a) {return mod_pow(a, MOD-2);}
int mdiv(int a, int b) {return mmul(a, minv(b));}

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int n, l, q;
int x[100010];
int table[100010][20];
signed main() {
    cin >> n;
    rep(i,0,n) cin >> x[i];
    cin >> l >> q;
    rep(i,0,n) table[i][0] = upper_bound(x, x+n, x[i]+l) - x - 1;
    rep(j,1,20) rep(i,0,n) {
        table[i][j] = table[table[i][j-1]][j-1];
        // printf("table[%lld][%lld] = %lld\n", i, j, table[i][j]);
    }
    rep(i,0,q) {
        int a, b; cin >> a >> b;
        a--; b--;
        if(a > b) swap(a, b);
        int ans = 0, idx = a;
        while(1) {
            int temp = lower_bound(table[idx], table[idx]+20, b) - table[idx] - 1;
            temp = max((ll)0, temp-1);
            idx = table[idx][temp];
            ans += (1 << temp);
            // printf("debug: temp = %lld, idx = %lld, b = %lld\n", temp, idx, b);
            if(idx >= b) break;
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 17280
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr long double PI = acos(-1);
constexpr long double EPS = 1e-15;
constexpr int inf = 2e9;
constexpr ll INF = 2e18;
constexpr ll MOD = 1e9+7;
constexpr ll MOD1 = 998244353;
typedef pair<ll,ll> P;

#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define rrep(i,a,b) for (int i = (a); i >= (b); i--)
#define REP(i,n) rep(i,0,n)
#define RREP(i,n) rrep(i,n,0)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

int n;

int main(){
  while(cin >> n, n){
    bitset<11234> a;
    rep(i, 1, n) a[i * i % n] = 1;
    for(int i = 1; i <= n / 2; ++i){
      int cnt = 0;
      REP(j, n) if(a[j] && a[(j + i) % n]) ++cnt;
      cout << cnt * 2 << endl;
    }
  }
}



Measured memory_bytes: 3080
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF = 1e9;
const ll MOD = 1e9 + 7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
    int a[3];
    rep(i, 3) cin >> a[i];
    sort(a, a + 3);
    if (a[0] == 5 and a[1] == 5 and a[2] == 7)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;

int main(){
  int x;
  std::cin >> x;
  for(int i = -118; i <= 119; i++){
    for(int j = 119; j >= -118; j--){
      ll a = pow(i,5), b = pow(j,5);
      if(a - b == (ll)x){
        std::cout << i << ' ' << j << '\n';
        return 0;
      }
    }
  }
  return 0;
}


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

int main(void)
{
	int n, r[200001], m[200001], ans = -2000000000;
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> r[i];
	}
	for(int i = n - 1; i > 0; i--) {
		m[i - 1] = max(r[i], m[i]);
	}
	for(int i = 0; i < n - 1; i++) {
		if(m[i] - r[i] > ans) {
			ans = m[i] - r[i];
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4656
#include <iostream>
#include <string>
#include <cctype>
#include <algorithm>
using namespace std;

string to_word_lower(string tgt) {
    for (int i=0; i<tgt.size(); i++) {
        tgt[i] = tolower(tgt[i]);
    }
    return tgt;
}

int main() {
    string sample;
    cin >> sample;
    sample = to_word_lower(sample);

    int count = 0;
    while (true) {
        string tgt;
        cin >> tgt;
        if ( tgt == "END_OF_TEXT" ) break;
        tgt = to_word_lower(tgt);
        if ( tgt == sample ) count++;
    }
    cout << count << endl;
    return 0;
}

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

int main() {
	int N, T, A, H;
	cin >> N >> T >> A >> H;
	int tmp = T * 1000 - 6 * H, ans = 1; // 温度は1000倍して考える
	for (int i = 2;i <= N;++ i) {
		cin >> H;
		if (abs(tmp - 1000 * A) > abs(1000 * T - 6 * H - 1000 * A)) {
			tmp = 1000 * T - 6 * H;
			ans = i;
		}
	}
	cout << ans;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

全部1000倍します。すなわち、平均気温は1000T-6xで、これが1000Aに近い物を探します
後は全部調べていくだけの問題ですね
*/

Measured memory_bytes: 256
// <swap.cpp> - Mon Mar 27 20:17:23 2017
// This file is created by XuYike's black technology automatically.
// Copyright (C) 2015 ChangJun High School, Inc.
// I don't know what this program is.

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long lol;
#define next NEXT
template<typename T>
inline void gg(T &res){
    res=0;T fh=1;char ch=getchar();
    while((ch>'9'||ch<'0')&&ch!='-')ch=getchar();
    if(ch=='-')fh=-1,ch=getchar();
    while(ch>='0'&&ch<='9')res=res*10+ch-'0',ch=getchar();
    res*=fh;
}
inline int gi(){int x;gg(x);return x;}
inline lol gl(){lol x;gg(x);return x;}
const int MAXN=500010;
const int MAXM=1000010;
const int INF=1e9;
int bt,b[MAXN],next[MAXM],to[MAXM],d[MAXN];
inline void add(int x,int y){next[++bt]=b[x];b[x]=bt;to[bt]=y;d[y]++;}
int p[MAXN],q[MAXN];
set <int> s;
set <int>::iterator it;
priority_queue <int,vector<int>,greater<int> > r;
int main(){
    int n=gi(),k=gi();
    for(int i=1;i<=n;i++)q[p[i]=gi()]=i;
    for(int i=1;i<=n;i++){
        if(i>k)s.erase(p[i-k]);
        it=s.insert(p[i]).first;
        if(++it!=s.end())add(i,q[*it]);
    }
    s.clear();
    for(int i=n;i;i--){
        if(i+k<=n)s.erase(p[i+k]);
        it=s.insert(p[i]).first;
        if(++it!=s.end())add(i,q[*it]);
    }
    for(int i=1;i<=n;i++)if(!d[i])r.push(i);
    for(int i=1;i<=n;i++){
        int x=r.top();r.pop();
        p[x]=i;
        for(int j=b[x];j;j=next[j])if(!--d[to[j]])r.push(to[j]);
    }
    for(int i=1;i<=n;i++)printf("%d\n",p[i]);
    return 0;
}

Measured memory_bytes: 42624
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>

#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>
#include <math.h>

#define INF 100100100

typedef long long int llint;

using namespace std;

typedef pair<int, int>Pii;

#define pi 3.141592653589793
#define mod 1000000007

int main() {
	string o, e;
	cin >> o >> e;
	int i = 0;
	while (i < o.size()) {
		cout << o[i];
		if (i < e.size())cout << e[i];
		i++;
	}
	cout << endl;
	return 0;
}

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


int student[100001];


int main(void)
{
    int N, M, K;
    int k, a, b;
    int i, j;
    int group;
    int output;
    
    scanf("%d%d%d", &N, &M, &K);
    
    memset(student, 0, sizeof(student));
    
    output = 0;
    for (i = 1; i <= K ; i++){
        scanf("%d%d%d", &k, &a, &b);
        if (output > 0){
            continue;
        }
        if (k == 1){
            if (student[a] == 0 && student[b] == 0){
                student[a] = student[b] = i * -1;
            }
            else if (student[a] == 0 && student[b] != 0){
                student[a] = student[b];
            }
            else if (student[a] != 0 && student[b] == 0){
                student[b] = student[a];
            }
            else if (student[a] < 0 && student[b] > 0){
                group = student[a];
                for (j = 1; j <= N; j++){
                    if (student[j] == group){
                        student[j] = student[b];
                    }
                }
            }
            else if (student[a] > 0 && student[b] < 0){
                group = student[b];
                for (j = 1; j <= N; j++){
                    if (student[j] == group){
                        student[j] = student[a];
                    }
                }
            }
            else if (student[a] < 0 && student[b] < 0){
                if (student[a] != student[b]){
                    group = student[b];
                    for (j = 1; j <= N; j++){
                        if (student[j] == group){
                            student[j] = student[a];
                        }
                    }
                }
            }
            else if (student[a] > 0 && student[b] > 0){
                if (student[a] != student[b]){
                    output = i;
                }
            }
        }
        else {
            if (student[a] == 0){
                student[a] = b;
            }
            else if (student[a] > 0){
                if (student[a] != b){
                    output = i;
                }
            }
            else if (student[a] < 0){
                group = student[a];
                for (j = 1; j <= N; j++){
                    if (student[j] == group){
                        student[j] = b;
                    }
                }
            }
        }
    }
    printf("%d\n", output);
    
    return (0);
}



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

int main()
{
    int n;
    ll k;
    cin >> n >> k;

    vector<vector<int>> next(60, vector<int>(n));
    for (int i = 0; i < n; i++)
    {
        cin >> next[0][i];
        next[0][i]--;
    }
    for (int d = 0; d + 1 < 60; d++)
    {
        for (int v = 0; v < n; v++)
        {
            next[d + 1][v] = next[d][next[d][v]];
        }
    }
    int v = 0;
    for (int d = 0; d < 60; d++)
    {
        if (k & (1LL << d)) v = next[d][v];
    }

    cout << v + 1 << endl;

    return 0;
}

Measured memory_bytes: 51036
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

x,y,z = inm()
print("{} {} {}".format(z,x,y))


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

int main() {
	int n,i,k;
	cin>>n>>k;
	int arr[n];
	for(i=0;i<n;i++)
	 cin>>arr[i];
	sort(arr,arr+n);
	int ans=0;
	for(i=0;i<k;i++)ans+=arr[i];
	cout<<ans;
	
	return 0;
}

Measured memory_bytes: 3596
#include<iostream>
#include<stdio.h>

using namespace std;

int main() {
	int n,u,k,v; //頂点数、頂点の番号、出次数、隣接する頂点の番号
	int M[101][101];

	//初期化
	for (int i = 0;i < 101;i++) {
		for (int j = 0;j < 101;j++) {
			M[i][j] = 0;
		}
	}

	cin >> n;
	for (int i = 0;i < n;i++) {
		cin>>u >> k;
		for (int j = 0; j < k;j++) {
			cin >> v;
			M[u][v] = 1;
		}
	}

	for (int i = 1;i < n + 1;i++) {
		for (int j = 1;j < n+1;j++) {
			cout << M[i][j];
			if (j != n) {
				cout << " ";
			}
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3124
a = 0
b = 0
c = 0
d = 0
N = int(input())
S = []
for i in range(N):
    S.append(input())
for j in range(N):
  if S[j] == 'AC':
    a += 1
  elif S[j] == 'WA':
    b += 1
  elif S[j] == 'TLE':
    c += 1
  elif S[j] == 'RE':
    d += 1
print('AC x', a)
print('WA x', b)
print('TLE x', c)
print('RE x', d)

Measured memory_bytes: 82616
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "random"

using namespace std;

const long long int MOD = 1000000007;
const long double EPS = 0.00000001;
const long double PI = 3.1415926535897932384626433;

long long int N, M, K, H, W, L, R;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> N >> H >> W >> L >> R;
	vector<long long int>pow(1001);
	vector<long long int>div(1001);
	pow[1] = 1;
	pow[0] = 1;
	div[0] = 1;
	for (int i = 2; i < 1001; i++) {
		pow[i] = pow[i - 1] * i;
		pow[i] %= MOD;
	}
	for (int i = 1; i <= 1000; i++) {
		div[i] = power(pow[i], MOD - 2, MOD);
	}
	vector<vector<long long int>>dp(1001, vector<long long int>(1001, 0));
	for (int i = 0; i <= 1000; i++) {
		dp[i][0] = 1;
	}
	for (int i = H; i <= W; i++) {
		for (int j = 0; j <= N; j++) {
			dp[i][j] = dp[i - 1][j];
			for (int k = L*i; k <= R*i; k += i) {
				if (j < k)break;
				long long int box = dp[i - 1][j - k];
				box *= pow[N - j + k];
				box %= MOD;
				box *= div[N - j];
				box %= MOD;
				box *= power(div[i], k / i, MOD);
				box %= MOD;
				box *= div[k / i];
				box %= MOD;
				dp[i][j] += box;
			}
			dp[i][j] %= MOD;
		}
	}
	cout << dp[W][N] << endl;
	return 0;
}


Measured memory_bytes: 8192
/****************************************************************
# @Author:      iLovePKU_zbtxdy
# @DateTime:    2020-01-27 14:06:38
# @Description: You build it. You run it
# @More: Once lots of AC, try Brute-force,dynamic programming
****************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define close std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define eps 1e-8
typedef long long ll;
const int maxn = 1e6+10;
const int INF = 0x3f3f3f3f;
const ll linf = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
ll mod = 1e9+7;
int main()
{
    stack<int > s;
    string ss;
    cin >> ss;
    int len = ss.length();
    for(int i = 0; i < len;i++){
        char c = ss[i];
        if(c == 'B'){
            if(s.empty()){
                continue;
            }else s.pop();
        } else {
            s.push(c);
        }
    }
    string ans = "";
    while(!s.empty()){
        ans += s.top();s.pop();
    }reverse(ans.begin(),ans.end());
    cout << ans << endl;
    system("pause");
}
/***************************************************************************
*stuff you should look for
*int overflow, array bounds
*special cases (n=1?), set tle
*do smth instead of nothing and stay organized
***************************************************************************/

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

typedef unsigned long long ull;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int N,R,S; cin>>N>>R;
	if(N>=10) cout << R << endl;
	else cout << R+100*(10-N) <<endl;

    return 0;
}




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

int main() {
  int n, k; cin >> n >> k;
  vector<int> h(n);
  for (int i=0; i<n; i++) {
    cin >> h[i];
  }
 
  
  int Min = INT_MAX;
  sort(h.begin(), h.end());
  for (int i=0; i<n-k+1; i++) {
    if(Min > (h[i+k-1]-h[i])) {
      Min = (h[i+k-1]-h[i]);
      }
  }
      cout << Min << endl;
                
}


Measured memory_bytes: 640
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;
use std::f64::consts::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        mut d: [u64; n],
    }
    d.sort();
    let l = d[n/2 - 1];
    let r = d[n/2];

    println!("{}", r-l);
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
 
#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
 
template <class T> T& chmin(T& a, T b){return (a > b) ? a = b : a;}
template <class T> T& chmax(T& a, T b){return (a < b) ? a = b : a;}
 
using lli = long long int;
 
std::vector<int> A, B;

bool possible(int n, int t, int k){
    REP(i, n) B[i] = A[i] % t;
    std::sort(B.begin(), B.end());
    int S = 0; REP(i, n) S += B[i];
    // m はゼロにする数
    lli L = 0;
    for(int m = 1; m <= n - 1; m++){
        L += B[m-1];
        lli R = n - m; R *= t; R -= S - L;
        lli K = (L < R) ? R : L;
        if(K <= k) return true;
    }
    return false;
}

int main(void){
    // 入力の受付
    int n, k; scanf("%d%d", &n, &k);
    A.resize(n); REP(i, n) scanf("%d", &A[i]);
    // 総和
    int S = 0; REP(i, n) S += A[i];
    // 和の約数の列挙
    std::queue<int> Bigger; Bigger.push(S);
    std::stack<int> Smaller; Smaller.push(1);
    for(int x = 2; x * x <= S; x++) if(S % x == 0){
        Bigger.push(S / x); Smaller.push(x);
    }
    while(not Smaller.empty()){ Bigger.push(Smaller.top()); Smaller.pop(); }
    int res; B.resize(n);
    while(not Bigger.empty()){
        int t = Bigger.front(); Bigger.pop();
        if(possible(n, t, k)){ res = t; break;}
    }
    printf("%d\n", res);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <stack>
#include <vector>
using namespace std;

char str[110];
int main() {
    while (scanf("%s",str) != EOF) {
        int n = strlen(str);
        int s = 0;
        for (int i = 0;i < n;i ++) {
            if (str[i] == 'C' && s == 0) {
                s = 1;
            }
            if (str[i] == 'F' && s == 1) {
                s = 2;
            }
        }
        printf("%s\n",s == 2 ? "Yes" : "No");
    }
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 0x6fffffff
#define INFL 0x6fffffffffffffffLL

int main() {
	ll		a,b,c,i,j,k,n,m,x,y,ans = 0;
	string	s;

	cin >> n >> m;
	vector<ll>	h(n+1),hh(n+1);

	for(i=1;i<=n;i++) {
		cin >> h[i];
		hh[i] = h[i];
	}

	for(i=0;i<m;i++) {
		cin >> a >> b;
		hh[a] = max(hh[a], h[b] );
		hh[b] = max(hh[b], h[a] );
		if (h[a]==h[b]) hh[a] = hh[b] = INF;
	}
	for(i=1;i<=n;i++) {
		if (hh[i] == h[i]) ans++;
	}
/*
	for(i=1;i<=n;i++) {
		cout << hh[i] << ' ';
	}
	cout << endl;
*/
	cout << ans << endl;

}


Measured memory_bytes: 4844
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,m,n) for(int i=m;i<n;i++)
#define mrep(i,m,n) for(int i=m;i>n;i--)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;


//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない

int main() {

	int n;
	int px = 0, py = 0, pret = 0;
	
	cin >> n;

	rep(i, 0, n) {
		int t, x, y;
		cin >> t >> x >> y;
		int dis = abs(x - px) + abs(y - py);
		if ( dis> t-pret||dis%2!=(t-pret)%2) {
			No; return 0;
		}
	}

	Yes;

	return 0;
}

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
typedef long long LL;

bool func(int p){
    if(p == 2)
        return true;
    for(int i = 2; i*i<= p; i++){
        if(p%i == 0)
            return false;
    }
    return true;
}

int main() {
    fastio
    int x;
    cin >> x;
    while(1){
        if(func(x)){
            break;
        }
        else
            x++;
    }
    cout<<x<<endl;
	return 0;
}






Measured memory_bytes: 256
#include <iostream>
#include <sstream>
using namespace std;
#include <bits/stdc++.h>
#include<utility>
#include <algorithm>
#include<iterator>
#define  go return 0
#define pb push_back
#define lp(j, n)  for(int j=0; j<(int)(n); ++j)
#define rep(i,n) for(int i=0;i<n;++i)
#define all(v)   ((v).begin()), ((v).end())
#define sz(v)    ( (int)((v).size()) )
#define F first
#define S second
#define m_p make_pair
typedef long long ll;
typedef double db;
typedef vector<int> ve;
typedef pair<int, int> pi;
typedef vector<pair<int,int> > vpii;
typedef map<int, int> mii;
const ll N=1e5+5;
ll arr[N],A[N],ARR[N]  ;
bool visited[N]={};
int cnt[N]={};
bool f;
int main()
{
    int n;cin>>n;
    rep(i,n&&cin>>arr[i]);
    sort(arr,arr+n);
    cout<<arr[n/2]-arr[(n/2)-1];

go;
}


Measured memory_bytes: 1024
import sys

argument = sys.stdin.readline()
args = argument.split()
a = int(args[0])
b = int(args[1])
c = int(args[2])

d = c - a - b

result = (d > 0) and 4 * a * b < d**2
if result:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
N = input()
num = int(N[len(N)-1])

if num == 2 or num == 4 or num == 5 or num == 7 or num == 9:
    print('hon')
elif num == 0 or num == 1 or num == 6 or num == 8:
    print('pon')
elif num == 3:
    print('bon')

Measured memory_bytes: 9120
#include<stdio.h>

int main(void){
  char s[3];
  int i = 0;
  for(i=0;i<3;i++){
    scanf("%c", &s[i]);
  }
  if(s[0]==s[1] && s[1] == s[2]){
    printf("No");
    return 0;
  }
  printf("Yes");
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
	int n;cin>>n;
	map<int,int> mp;
	for(int i=0;i<n;i++){
		int a;cin>>a;
		mp[a]++;
	}
	int cnt=0;
	for(auto i:mp){
		if(i.second%2==1) cnt++; 
	}
	cout<<cnt<<"\n";
}

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

using namespace std;

#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define fi first
#define se second
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"
#define Printv(v)                                                              \
    {                                                                          \
        FOREACH(x, v) { cout << x << " "; }                                    \
        cout << "\n";                                                          \
    }
template <typename T = string> inline void eputs(T s) {
    cout << s << "\n";
    exit(0);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *)array, (T *)(array + N), val);
}
template <typename T> using PQG = priority_queue<T, vector<T>, greater<T>>;
template <typename T> using PQ = priority_queue<T>;

typedef long long ll;
typedef unsigned long long ul;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18 + 1;
const ll dx[] = {1, -1, 0, 0};
const ll dy[] = {0, 0, 1, -1};

ll A, B, C, D;

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

ll lcm(ll a, ll b) { return a * b / gcd(a, b); }

signed main() {
    cin >> A >> B >> C >> D;
    ll ccnt = (B / C - A / C - (A % C ? 1 : 0) + 1);
    ll dcnt = (B / D - A / D - (A % D ? 1 : 0) + 1);
    ll cdcnt = (B / lcm(C, D) - A / lcm(C, D) - (A % lcm(C, D) ? 1 : 0) + 1);
    cout << (B - A + 1) - ccnt - dcnt + cdcnt << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int H,W; cin>>H>>W;
    vector<string> A(H);
    rep(h,0,H) cin>>A.at(h);

    vector<int> prjH,prjW;
    rep(h,0,H){
        bool allDot=true;
        rep(w,0,W){
            if(A.at(h).at(w)=='#'){allDot=false; break;}
        }
        if(!allDot){
            prjH.push_back(h);
        }
    }

    rep(w,0,W){
        bool allDot=true;
        rep(h,0,H){
            if(A.at(h).at(w)=='#'){allDot=false; break;}
        }
        if(!allDot){
            prjW.push_back(w);
        }
    }

    for(auto h:prjH){
        for(auto w:prjW) cout<<A.at(h).at(w);
        cout<<endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<=n;++i)
int main(){
  ll n;
  cin>>n;
  ll buf;
  ll tmp;
  ll root=sqrt(n);
  for(ll i=root+1;i>0;i--){
    if(n%i==0){
      tmp=i;
      buf=n/i;
      break;
    }
  }
  ll ans=tmp+buf-2;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i)
#define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i)
#define per(i,N) for(int i=(N)-1;i>=0;--i)
#define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i)
#define all(arr) (arr).begin(), (arr).end()
#define SP << " " <<
#define SPF << " "
#define SPEEDUP cin.tie(0);ios::sync_with_stdio(false);
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL; 
  typedef pair<ll,char> PLC; 
  typedef pair<char,ll> PCL; 

inline void YesNo(bool b){ cout << (b?"Yes" : "No") << endl;}
inline void YESNO(bool b){ cout << (b?"YES" : "NO") << endl;}
inline void Yay(bool b){ cout << (b?"Yay!" : ":(") << endl;}

int main(void){
  SPEEDUP
  cout << setprecision(15);
  int A,B;cin >> A >> B;
  if(A<10 && B<10) cout << A*B << endl;
  else cout << -1 << endl;
  return 0;
}


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

					#define mp make_pair
					#define pb push_back
					#define sqr(x) (x) * (x)
					#define sors(s) sort(s.begin(), s.end())
					#define sz(s) s.size()
					#define B begin()
					#define E end()
					#define F first
					#define S second
					#define I insert
					#define N 222222
					#define M 1000000007
					
					using namespace std;
					typedef long long ll;
					typedef vector<int> vi;
					typedef pair<int,int> pii;
					typedef set<int> si;
					typedef set<string> ss;
					typedef multiset<int> mi;
					typedef map<string, int> msi;
     				typedef vector<pair<int, int>> vii;
     				int a, b;
					int main()
					{
                      cin >> a >> b;
                      if(a<=2*b)
                        cout << 0;
                      else cout << a-2*b;	
					}


Measured memory_bytes: 256
#include<iostream>
#include<unordered_map>
using namespace std;
main()
{
 string s, t;
 cin >> s >> t;
 bool ok = true;
 long long int i;
 for(i=0;i<s.size();i++)
 if(s[i] != t[i])
 ok = false;
 if(ok)
 cout << "Yes" << endl;
 else
 cout << "No" << endl;
	return 0;
}

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

int main() {
  int a, b, c, d;
  int money = 0;
  cin >> a >> b >> c >> d;
  for(int i = 0; i < a; ++i) {
    if(i < b) {
      money += c;
    } else {
      money += d;
    }
  }
  cout << money << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long s64;
#define rep(i,l,r) for(int i=l;i<=r;++i)
const int U=1e9+7;
unordered_map<s64,int>mp;
int ans[10];
int main()
{
	int h,w,n;
	cin>>h>>w>>n;
	rep(i,1,n)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		rep(x1,max(1,x-2),min(x,h-2))
		rep(y1,max(1,y-2),min(y,w-2))++mp[(s64)x1*U+y1];
	}
	for(auto pr:mp)++ans[pr.second];
	printf("%lld\n",(s64)(h-2)*(w-2)-mp.size());
	rep(i,1,9)printf("%d\n",ans[i]);
}

Measured memory_bytes: 36624
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

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

int main() {
    int N;
    cin >> N;
    int a = 10000, b = 0, c;
    REP(i, N){
        cin >> c;
        a = min(a, c);
        b = max(b, c);
    }
    cout << (b - a) << endl;


    return 0;
}


Measured memory_bytes: 888
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Integer[] A = new Integer[3];
		A[0] = new Integer(sc.nextInt());
		A[1]= new Integer(sc.nextInt());
		A[2]= new Integer(sc.nextInt());
		Arrays.sort(A);
		
		System.out.println((A[1]-A[0])+(A[2]-A[1]));
	}
}


Measured memory_bytes: 21716
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

K = INT()

checked = [0]*K
a = 0
for i in range(K):
	a = (a+7*pow(10, i, K))%K
	if a == 0:
		print(i+1)
		break
	if checked[a]:
		print(-1)
		break
	checked[a] = 1


Measured memory_bytes: 80616
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#ifdef ENABLE_DEBUG
template <typename T>
void debug(T value) {
  cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                              \
  do {                                          \
    cerr << " \033[33m (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ":\033[0m ";        \
    debug(__VA_ARGS__);                         \
    cerr << endl;                               \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int M, K;
  cin >> M >> K;
  if (K == 0) {
    REP(i, 1LL << M) {
      if (i > 0) cout << " ";
      cout << i << " " << i;
    }
    cout << endl;
    return 0;
  }

  if (M == 1 || K >= (1LL << M)) {
    cout << -1 << endl;
    return 0;
  }

  i64 s = 0;
  REP(i, 1LL << M) { s ^= i; }
  DEBUG(s);
  assert(s == 0);
  bool first = true;
  REP(i, 1LL << M) {
    if (!first) {
      cout << " ";
    } else {
      first = false;
    }
    if (i != K) cout << i;
  }
  cout << " " << K;
  for (int i = (1LL << M) - 1; i >= 0; --i) {
    if (i != K) cout << " " << i;
  }
  cout << " " << K << endl;
}


Measured memory_bytes: 3580
object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val x = sc.next
    val y = sc.next

    val ans = if (x > y) {
      ">"
    } else if (x < y) {
      "<"
    } else {
      "="
    }

    println(ans)

  }
}


Measured memory_bytes: 25544
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,k,n,ans,cnt=0;
    cin>>a>>b>>k;
    n=max(a,b);
    for(int i=n;i>=1;i--){
        if(a%i==0&&b%i==0){
            ans=i;
            cnt+=1;
        }
        if(cnt==k) break;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
import itertools

n = int(input())
list = list(map(int, input().split()))
list2 = itertools.combinations(list, 3)

ans = 0
for ele in list2:
    a = ele[0]
    b = ele[1]
    c = ele[2]
    if a == b or b == c or c == a:
        continue
    if abs(a-b) < c and c < a+b:
        ans += 1
print(ans)

Measured memory_bytes: 9120
#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define PP pair<P,int>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define mod (int)(1000000007)
#define pie 3.141592653589793238462643383279
#define Bpri priority_queue
#define Spri priority_queue<P,vector<P>,greater<P>>
#define all(x) (x).begin(),(x).end()
using namespace std;
signed main(){
	int a,b;
	cin>>a>>b;
	for(int i=b-a+1;i<b+a;i++){
		cout<<i<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Text;

namespace _173_d_2
{
    internal class ChatInACircle
    {
        private static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine() ?? throw new InvalidOperationException());

            var sb = new StringBuilder();
            while (true)
            {
                var ch = Convert.ToChar(Console.Read());
                sb.Append(ch);
                if (ch == '\n') break;
            }

            var a = sb.ToString().Split(" ").Select(int.Parse).ToArray();

            // 前準備
            Array.Sort(a);
            Array.Reverse(a);

            long comfort = 0;

            // a[0], a[1], a[1], a[2]...
            for (var i = 1; i < n; i++)
            {
                comfort += a[i / 2];
            }

            Console.WriteLine(comfort);
        }
    }
}

Measured memory_bytes: 47048
package main
import (
  "fmt"
  "sort"
)
func main() {
  var n,a int
  fmt.Scan(&n)
  e := map[int]int{}
  o := map[int]int{}
  for i:=0;i<n;i++ {
    fmt.Scan(&a)
    if i%2 == 0 { e[a]++;continue }
    o[a]++
  }
  ee := Entries{Entry{0,0}}
  for k,v := range e { ee = append(ee,Entry{k,v}) }
  sort.Sort(sort.Reverse(ee))
  eo := Entries{Entry{0,0}}
  for k,v := range o { eo = append(eo,Entry{k,v}) }
  sort.Sort(sort.Reverse(eo))
  if ee[0].k != eo[0].k { fmt.Println(n-ee[0].v-eo[0].v);return }
  fmt.Println(n-max(ee[0].v+eo[1].v,ee[1].v+eo[0].v))
}
func max(x,y int) int {
  if x > y { return x }
  return y
}
type Entry struct { k,v int }
type Entries []Entry
func(e Entries) Len() int { return len(e) }
func(e Entries) Swap(i,j int) { e[i],e[j] = e[j],e[i] }
func(e Entries) Less(i,j int) bool { return e[i].v < e[j].v }

Measured memory_bytes: 10368
N = int(input())
Bs = list(map(int, input().split()))
ans = []


def solve(acc, xs):
    head, *tail = xs
    if not acc:
        acc.append(head)
    if not tail:
        acc.append(head)
        return acc

    peek, *_ = tail
    acc.append(min(head, peek))
    return solve(acc, tail)


arr = solve([], Bs)
print(sum(arr))


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

void print(const std::vector<int> &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << " ";
        cout << v[i];
    }
    cout << endl;
}
int main(void)
{
    int n;
    cin >> n;
    vector<int> A(n);
    for (int i = 0; i < n; i++)
    {
        A[i] = i + 1;
    }

    do
    {
        print(A);
    } while (next_permutation(A.begin(), A.end()));
    return 0;
}



Measured memory_bytes: 3080