akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int town;
    long long A, B;

    cin >> town >> A >> B;

    vector<long long> V;

    long long fatigue = 0;

    for (long long i = 0; i < town; i++){
        int x;
        cin >> x;
        V.push_back(x);
    }


    for (int i = 0; i < V.size()-1; i++){
        long long walk = A*abs(V[i]-V[i+1]);
        long long teleport = B;

        if (walk < teleport){
            fatigue += walk;
            continue;
        }else if (teleport < walk){
            fatigue += teleport;
            continue;
        }
    }

    cout << fatigue << endl;

    return 0;
}


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

long long n;
vector<long long> l;

long long solve();

int main() {
  cin >> n;
  l.resize(n);
  for(int i = 0; i < n; ++i) cin >> l[i];

  cout << solve() << endl;
  return 0;
}

long long solve() {
  sort(l.begin(), l.end());
  long long ans = 0;
  for(int i = 0; i < n; ++i)
    for(int j = i + 1; j < n; ++j) {
      long long now = 0;
      auto it =
          lower_bound(l.begin(), l.end(), l[i] + l[j]);
      --it;
      auto lit =
          upper_bound(l.begin(), l.end(), abs(l[i] - l[j]));
      long long lid, rid;
      lid = lit - l.begin(), rid = it - l.begin();
      now = rid - lid + 1;
      if(lid <= i && i <= rid) --now;
      if(lid <= j && j <= rid) --now;
      ans += max(0LL, now);
    }
  return ans / 3;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;

const int N = 60;
char A[N][N], B[N][N];

int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", A[i]);
  }
  for (int j = 0; j < m; ++j) {
    scanf("%s", B[j]);
  }
  bool ret = false;
  for (int i = 0; i + m <= n; ++i) {
    for (int j = 0; j + m <= n; ++j) {
      bool found = false;
      for (int u = 0; u < m; ++u) {
        for (int v = 0; v < m; ++v) {
          if (B[u][v] != A[i + u][j + v]) {
            found = true;
            break;
          }
        }
      }
      if (!found) {
        ret = true;
        break;
      }
    }
  }
  puts(ret ? "Yes" : "No");
  return 0;
}


Measured memory_bytes: 256
class Dice(object):
    def __init__(self):
        self.number = [0 for _ in range(6)]
        self.before = [0 for _ in range(6)]

    def set_number(self, l):
        for i in range(6):
            self.number[i] = l[i]

    def roll(self, loc):
        d = {
            'N': (1, 5, 2, 3, 0, 4),
            'S': (4, 0, 2, 3, 5, 1),
            'E': (3, 1, 0, 5, 4, 2),
            'W': (2, 1, 5, 0, 4, 3)
        }
        for i in range(6):
            self.before[i] = self.number[i]

        for i, j in enumerate(d[loc]):
            self.number[i] = self.before[j]

    def get_Top(self):
        return self.number[0]


if __name__ == '__main__':
    l = list(map(int, input().split()))
    dice = Dice()
    dice.set_number(l)
    s = input()
    for i in s:
        dice.roll(i)
    print(dice.get_Top())


Measured memory_bytes: 5608
#include <bits/stdc++.h>
#pragma GCCtarget("popcount")
using namespace std;
#define int long long
const int mod = 1e9 + 7;

signed main() {
    int a, b;
    cin >> a >> b;
    if ((a + b) % 2 != 0){
        cout << "IMPOSSIBLE";
        return 0;
    }
    cout << (a + b) / 2;
}


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

#define mp make_pair
#define sz(x) (int)((x).size())
#define all(x) (x).begin(),(x).end()
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define eb emplace_back

typedef pair< int, int > pii;
typedef pair< long long, long long > pll;
typedef long long ll;
typedef unsigned long long ull;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vll;
typedef vector< vll > vvll;
typedef vector< pii > vpii;
typedef vector< vpii > vvpii;
typedef vector< pll > vpll;
typedef long double ld;
typedef vector< ld > vld;
typedef unsigned int uint;
 
template <uint MD> struct ModInt {
    using M = ModInt;
    const static M G;
    uint v;
    ModInt(ll _v = 0) { set_v(uint(_v % MD + MD)); }
    M& set_v(uint _v) {
        v = (_v < MD) ? _v : _v - MD;
        return *this;
    }
    explicit operator bool() const { return v != 0; }
    M operator-() const { return M() - *this; }
    M operator+(const M& r) const { return M().set_v(v + r.v); }
    M operator-(const M& r) const { return M().set_v(v + MD - r.v); }
    M operator*(const M& r) const { return M().set_v(uint(ull(v) * r.v % MD)); }
    M operator/(const M& r) const { return *this * r.inv(); }
    M& operator+=(const M& r) { return *this = *this + r; }
    M& operator-=(const M& r) { return *this = *this - r; }
    M& operator*=(const M& r) { return *this = *this * r; }
    M& operator/=(const M& r) { return *this = *this / r; }
    bool operator==(const M& r) const { return v == r.v; }
    const bool operator<(const M& o) const {return v < o.v; }
    M pow(ll n) const {
        M x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    M inv() const { return pow(MD - 2); }
    friend ostream& operator<<(ostream& os, const M& r) { return os << r.v; }
};
 
using Mint = ModInt<(int)1e9 + 7>;
 
int main() { 
    #ifdef BLAT
        freopen("stdin", "r", stdin);
        freopen("stderr", "w", stderr);
    #endif
 
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(12);
    srand(time(NULL));
    
    int n;
    cin >> n;

    ll lim = 1e18;

    vll v(n);
    for(auto &x : v) {
        cin >> x;
        if(x == 0) return puts("0"), 0;
    }

    ll prod = 1;
    for(auto &x : v) {
        if(lim / x < prod) return puts("-1"), 0;
        prod *= x;
    }

    cout << prod;
    return 0;
}

Measured memory_bytes: 3972
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class A { public static void Main() => (new Solver()).Solve(); }

public class Solver
{
	public void Solve()
	{
		long N = GetLong();
		long q = (N + 999) / 1000;
		WriteLine(1000 * q - N);
	}
}

public static class MyIO
{
	private static string[] args = new string[0];
	private static int cnt = 0;
	private static IEnumerable<string> getArgs(long N) => Range(0, N).Select(_ => getArg());
	private static string getArg()
	{
		if(cnt == args.Length) { args = Console.ReadLine().Split(); cnt = 0; }
		return args[cnt++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => getArgs(N).Select(int.Parse).ToArray();
	public static long[] GetLongs(long N) => getArgs(N).Select(long.Parse).ToArray();
	public static double[] GetDoubles(long N) => getArgs(N).Select(double.Parse).ToArray();
	public static decimal[] GetDecimals(long N) => getArgs(N).Select(decimal.Parse).ToArray();
	public static string[] GetStrings(long N) => getArgs(N).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) < 0) x = y; }
	public static void chmin<T>(ref T x, T y) where T : IComparable<T> { if(x.CompareTo(y) > 0)	x = y; }
	public static void swap<T>(ref T x, ref T y) { T tmp = x; x = y; y = tmp; }
	public static long rightShift(long x, long y) => (x >> (int)y);
	public static long leftShift(long x, long y) => (x << (int)y);
	public static bool contains(long s, long x) => (rightShift(s, x) & 1L) == 1L;
	public static long gcd(long x, long y) => (y == 0) ? x : gcd(y, x % y);
	public static long lcm(long x, long y) => (x / gcd(x,y)) * y;	
	public static IEnumerable<int> Range(long start, long count) => Enumerable.Range((int)start, (int)count);
	public static void Sort(this List<string> source) => source.Sort(StringComparer.Ordinal);
}


Measured memory_bytes: 27488
#include <bits/stdc++.h>
using namespace std;
// ==================================================
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,a,b) for(i64 i=(int64_t)(a);i<(int64_t)(b);i++)
#define repn(i,n) rep(i,0,n)
#define din(t, ...) t __VA_ARGS__;_din(__VA_ARGS__)
#define v(t,n) vector<t> n
void _din() {}
void dout() { cout << endl; }
template <typename T, typename ... Args> inline void _din(T& head, Args& ... rest) { cin >> head; _din(rest...); }
template <typename T, typename ... Args> inline void dout(T head, Args ... rest) { cout << head; if (sizeof...(rest)) cout << ' '; dout(rest...); }
template <typename T>inline void qsortv(vector<T>& v) { qsort(v.data(), v.size(), sizeof(T), [](const void*a, const void*b)->int {if ((*(T*)a) < (*(T*)b))return -1; if ((*(T*)a) == (*(T*)b))return 0; return 1; }); }
template <typename T, typename F>inline void qsortv(vector<T>& v, F func) { qsort(v.data(), v.size(), sizeof(T), func); }
template <typename T>inline void sortv(vector<T>& v) { sort(v.begin(), v.end()); }
// ==================================================

int main()
{
	din(int, r);

	dout(r < 1200 ? "ABC" : (r < 2800 ? "ARC" : "AGC"));
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main{
        public static void main(String[] args){
                Scanner sc = new Scanner(System.in);
                Map hs = new HashMap();
                PrintWriter ou = new PrintWriter(System.out);
                long a = Long.parseLong(sc.next());
                int v = Integer.parseInt(sc.next());
                a -= Long.parseLong(sc.next());
                a = Math.abs(a);
                v -= Integer.parseInt(sc.next());
                int t = Integer.parseInt(sc.next());
                sc.close();
                if(v < 0) ou.print("NO\n");
                else{
                        if(a * 1.0 / v <= t) ou.print("YES\n");
                        else ou.print("NO\n");
                }
                ou.flush();
        }
}

Measured memory_bytes: 35708
#include <stdio.h>
#include <math.h>

int main(){
  int N,M,m;
  int prime[10000]={2,0}; // under 100,000
  int exp[10000];
  int list[10000];
  int tmp,i,exp_N=0;
  
  scanf("%d %d",&N,&M);
  tmp = sqrt(M);

  for(int n=3;n<=tmp;n++){
    for(i=0;prime[i]!=0;i++)
      if(n%prime[i]==0)
	break;
    if(prime[i]==0){
      prime[i]=n;
      prime[i+1]=0;
    }
  }

  for(int n=0;prime[n]!=0;n++)
    exp[n]=0;

  i=0;
  m=M;
  while(M!=1 && prime[i]!=0){
    //    printf("%d\n",prime[i]);
    if(M%prime[i]==0){
      M=M/prime[i];
      exp[i]++;
    }else
      i++;
  }
  if(M!=1){
    prime[i]=M;
    exp[i]=1;
    prime[i+1]=0;
  }

  exp_N=0;
  for(int n=0;prime[n]!=0;n++)
    if(exp[n]!=0)
      if(exp_N==0){
	list[0]=1;	
	for(int j=1;j<=exp[n];j++)
	  list[j]=list[j-1]*prime[n];
	exp_N=exp[n]+1;
      }else{
	for(int j=1;j<=exp[n];j++)
	  for(int k=0;k<exp_N;k++)
	    list[exp_N*j+k]=list[k+exp_N*(j-1)]*prime[n];
	exp_N*=(exp[n]+1);
      }
  /*
  for(int n=0;prime[n]!=0;n++)
    printf("%d ^ %d\n",prime[n],exp[n]);
  
  for(int n=0;n<exp_N;n++)
    printf("%d (%d)\n",list[n],m/list[n]);
*/  
  tmp=1;
  for(int n=0;n<exp_N;n++)
    if(N<=m/list[n] && tmp<list[n])
      tmp=list[n];

  printf("%d\n",tmp);
  return 0;
}


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

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

    int n, q;
    string s;
    cin >> n >> s >> q;
    vector<int> di, ci;
    vector<int> dmcnt, cmcnt;
    int mc = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == 'D') {
            di.push_back(i);
            dmcnt.push_back(mc);
        }
        if (s[i] == 'M') {
            ++mc;
        }
        if (s[i] == 'C') {
            ci.push_back(i);
            cmcnt.push_back(mc);
        }
    }
    for (int _ = 0; _ < q; ++_) {
        int k;
        cin >> k;
        int j = 0, pj = 0, c = 0;
        long long ans = 0, sum = 0;
        for (int i = 0; i < di.size(); ++i) {
            while (pj < ci.size() && ci[pj] < di[i]) {
                sum -= cmcnt[pj];
                ++pj;
                --c;
            }
            while (j < ci.size() && ci[j] - di[i] < k) {
                sum += cmcnt[j];
                ++j;
                ++c;
            }
            ans += max(0LL, sum - dmcnt[i] * (long long)c);
        }
        cout << ans << "\n";
    }
    return 0;
}


Measured memory_bytes: 12180
N=int(input())
flg=False
for i in range(25):
    cnt=4*i
    if cnt>N: break
    if cnt==N:
        flg=True
        break
    for j in range(13):
        cnt+=7
        if cnt>N: break
        if cnt==N:
            flg=True
            break
print("Yes" if flg else "No")

Measured memory_bytes: 3060
#include <iostream>
#include <vector>

using namespace std;
vector<int> parents;

int root(int k)
{
    while (parents[k] != k) {
        k = parents[k];
    }
    return k;
}

int main()
{
    int n, q;
    cin >> n >> q;

    for (int i = 0; i < n; i++) {
        parents.push_back(i);
    }

    for (int j = 0; j < q; j++) {
        int c, x, y;
        cin >> c >> x >> y;

        if (c) {
            if (root(x) == root(y))
                cout << 1 << endl;
            else
                cout << 0 << endl;
        } else {
            int rx = root(x);
            int ry = root(y);
            if (rx != ry) {
                parents[rx] = ry;
            }
        }
    }
}

Measured memory_bytes: 3240
package main

import (
	"fmt"
)

func main() {
	var k, n int
	fmt.Scanf("%d %d", &k, &n)

	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &a[i])
	}
	aPlus := append(a, k+a[0])

	distances := make([]int, n)
	for i := 0; i < n; i++ {
		distances[i] = aPlus[i+1] - aPlus[i]
	}

	maxDistance := distances[0]
	for _, d := range distances {
		if d > maxDistance {
			maxDistance = d
		}
	}

	answer := k - maxDistance
	fmt.Printf("%d\n", answer)
}


Measured memory_bytes: 8704
#include <iostream>

int main()
{
	int A, B;
	std::cin >> A >> B;

	if ( ( A & 1 ) && ( B & 1 ) )
	{
		std::cout << "Yes" << std::endl;
	}
	else
	{
		std::cout << "No" << std::endl;
	}

	return ( 0 );
}


Measured memory_bytes: 256
//B
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int n;
	cin >> n;
	ll ans = 0;
	for(int i = 1;i <= n;i++)if(i%3 and i%5)ans += i;
	cout << ans;
	return 0;
}


Measured memory_bytes: 3600
s=gets.chomp
flag=true
l=s.size
flag=false if s[0]!=?A
flag=false if s[1].upcase==s[1]
c=0
(2...l-1).each do |i|
  if s[i].upcase==s[i]
    c+=1 if s[i]==?C
    flag=false if s[i]!=?C
  end
end
flag=false if c!=1
flag=false if s[l-1].upcase==s[l-1]
puts flag ? 'AC':'WA'


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

#define ll long long
#define NIL 0
#define INF 2e9
#define vi vector<int> 
#define vvi vector<vector<int>> 
#define vl vector<ll>
#define vvl vector<vector<ll>> 
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define pb push_back
#define F first
#define S second
#define pp pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define rpk(i,k,n) for(int i=k;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++) 
#define RPK(i,k,n) for(int i=k;i<=n;i++) 
#define ritr(i,gr) for(auto i=gr.begin();i!=gr.end();i++)

const int M = 1e9+7;

int V, E, i, j, k, u, v, x, y, p, q, r, t, n,w,m;
vi *g;
vb sn;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n>>m;
    char a[n][m];
    rep(i,n) rep(j,m) cin>>a[i][j];
    ll dp[n][m];
    dp[0][0]=1;
    REP(i,n-1) {dp[i][0]= a[i][0]=='#'?0:dp[i-1][0];}
    REP(i,m-1) {dp[0][i]= a[0][i]=='#'?0:dp[0][i-1];}
    REP(i,n-1) {
        REP(j,m-1) {
            if(a[i][j]=='#') dp[i][j] = 0;
            else { dp[i][j] = (dp[i-1][j]+dp[i][j-1])%M;}
        }
    }
    cout<<dp[n-1][m-1]<<endl;
}
    

Measured memory_bytes: 12420
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int N=100005;

int n,m,tot;
int vis[N],low[N];
vector<int>G[N];
int ap[N];

void dfs(int u,int r) {
    vis[u]=low[u]=++tot;
    int son=0;
    for (int v:G[u]) {
        if (!vis[v]) {
            dfs(v,r);
            low[u]=min(low[u],low[v]);
            if (low[v]>=vis[u] && u!=r) ap[u]=1;
            if (u==r) ++son;
        }
        low[u]=min(low[u],vis[v]);
    }
    if (u==r && son>1) ap[u]=1;
}

int main() {
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n>>m;
    while (m--) {
        int u,v; cin>>u>>v,
        G[u].pb(v),
        G[v].pb(u);
    }
    for (int i=0;i<n;++i) if (!vis[i]) dfs(i,i);
    for (int i=0;i<n;++i) if (ap[i]) cout<<i<<'\n';
}


Measured memory_bytes: 7000
# N, K = 3, 2
# X = [int(i) for i in '10 20 30'.split()]
N, K = map(int, input().split())
X = [int(i) for i in input().split()]
X_plus = []
X_minus = []
for i in range(N):
    if X[i] < 0:
        X_minus.append(X[i])
    else:
        X_plus.append(X[i])
# print(X_plus)
# print(X_minus)

res = []
len_plus = len(X_plus)
len_minus = len(X_minus)
if len_minus != 0:
    for i_plus in range(len_plus):
        if K-i_plus-1 <= len_minus:
            res.append(X_plus[i_plus]*2 - X_minus[-(K-i_plus-1)])
if len_plus >= K:
    res.append(X_plus[K-1])
# print(res)

if len_plus != 0:
    for i_minus in range(len_minus):
        if K-i_minus-1 <= len_plus:
            res.append(abs(-X_minus[-i_minus-1])*2 + X_plus[K-i_minus-2])

if len_minus >= K:
    if len_plus > 0:
        if X_plus[0]==0:
            res.append(-X_minus[-K+1])
    else:
        res.append(-X_minus[-K])
# print(res)
print(min(res))

Measured memory_bytes: 14228
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265359
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
ll power(ll x,ll y,ll p) 
{ 
    ll res=1;  
    x=x%p;
    while (y > 0) 
    { 
        if(y&1) 
            res=(res*x)%p; 
        y=y>>1;
        x=(x*x)%p;   
    } 
    return res; 
}
const ll L = 1e5 + 5;
ll w[101];
ll v[101];
ll dp[101][L];
ll rec(ll n,ll w1)
{
	if(dp[n][w1]!=-1)
		return dp[n][w1];
	if(n == 0 || w1 == 0)
		return dp[n][w1] = 0;
	if(w[n-1] <= w1)
	{
		dp[n-1][w1-w[n-1]] = rec(n-1,w1-w[n-1]);
		dp[n][w1] = v[n-1] + dp[n-1][w1-w[n-1]];
	}
	dp[n-1][w1] = rec(n-1,w1);
	return dp[n][w1] = max(dp[n-1][w1],dp[n][w1]);
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 	ll i,j,n,w1;
 	cin >> n >> w1;   
	for(i=0;i<=n;i++)
		for(j=0;j<=w1;j++)
			dp[i][j] = -1;
	for(i=0;i<n;i++)
		cin >> w[i] >> v[i];
	cout << rec(n,w1) << endl;
	return 0;
}

Measured memory_bytes: 79232
#include <stdio.h>

#define MAX 2

int main()
{
	int man[MAX];
	int day[MAX];

	scanf("%d %d", &man[0], &day[0]);
	scanf("%d %d", &man[1], &day[1]);

	if (man[0] != man[1]) {
		printf("1\n");
	} else {
		printf("0\n");
	}

	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
long long n;
int main() {
	scanf("%lld",&n);
	if(n==1)
		printf("%lld\n",0);
	else{
		long long ans=n*(n-1)/2;
		printf("%lld\n",ans);
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
const int INF = numeric_limits<int>::max();

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

int main()
{
    ll n; cin >> n;
    if (n == 1) {
        cout << "a" << endl;
        return 0;
    }

    stack<ll> ans;
    while (n > 0) {
        int tmp = n % 26;
        ans.push(tmp);
        if (tmp == 0)
            n--;
        n /= 26;
    }

    while(ans.size()) {
        ll c = ans.top();
        ans.pop();
        if (c == 0)
            cout << 'z';
        else
            cout << char(c+96);
    }
    cout << endl;
    return 0;
}



Measured memory_bytes: 3628
import numpy as np
H, W = map(int, input().split())
a = []
for i in range(H):
  s = str(input())
  l = [c for c in s]
  a.append(l)
  
a = np.array(a)
cnt = 0
for i in range(H):
  s = np.array([a[0]])
  a = np.delete(a, 0, 0)
  if '#' in s:
    a = np.append(a, s, axis=0)
    cnt += 1
    
for i in range(W):
  s = np.array([a[:, 0]]).reshape(cnt, 1)
  a = np.delete(a, 0, 1)
  if '#' in s:
    a = np.append(a, s, axis=1)

for ans in a:
  print(''.join(ans))

Measured memory_bytes: 27212
#include <stdio.h>

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

        bool find = false;
        for(int i = 1 ; i <= 9 ; i++) {
                for(int j = 1 ; j <= 9 ; j++) {
                        if(n == (i*j)) {
                                find = true;
                        }
                }
        }

        if(find) {
                printf("Yes");
        } else {
                printf("No");
        }
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

int main() {
  ll N, A, B;
  cin >> N >> A >> B;
  ll D = B - A;
  if (D & 1) {
    ll ans = A + (B - A - 1) / 2;
    ll num = (N - B + 1);
    ll pos = A + num;
    ans = min(ans, num + (N - pos) / 2);
    cout << ans << endl;
  } else {
    cout << D / 2 << endl;
  }
  return (0);
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;

class Program
{
    static string InputPattern = "Input3";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("2");
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("3");
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int wkVal = int.Parse(InputList[0]);
        Console.WriteLine(wkVal * wkVal * wkVal);
    }
}

Measured memory_bytes: 5644
import numpy as np

inp = input()
A, B, K = int(inp.split(' ')[0]), int(inp.split(' ')[1]), int(inp.split(' ')[2])
  
if K>A:
  B = np.max([0, B-(K-A)])
A = np.max([0, A-K])

print(f'{A} {B}')

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

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;

void solve() {
    string a, b;
    cin >> a >> b;

    int ans = 10000;
    for (int i = 0; i + b.size() <= a.size(); i++) {
        int cur = 0;
        for (int j = i; j < i + b.size(); j++) {
            cur += a[j] != b[j - i];
        }
        ans = min(ans, cur);
    }
    cout << ans << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) { return a * b / GCD(a, b); }


int main(){
    int n;
    cin >> n;
    vector<string> S(n);
    vector<vector<int>> cnt(n, vector<int>(26, 0));

    rep(i, n) cin >> S[i];

    rep(i, n) {
        for (auto s: S[i]) {
            cnt[i][s - 'a']++;
        }
    }
    vector<int> ans(26, 0);
    rep(j, 26) {
        int res = INF;
        rep(i, n) {
            res = min(res, cnt[i][j]);
        }
        ans[j] = res;
    }

    cout << "";
    rep(j, 26) {
        for (int i=0;i<ans[j];++i) {
            cout << (char)('a' + j);
        }
    }
    cout << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(){
	double x=0,y=0,angle=90,a,b;
	int ix,iy;
	for(;;){
		scanf("%lf,%lf",&a,&b);
		if(a==0 && b==0){break;}
		x+=(cos(angle*3.1415926/180))*a;
		y+=(sin(angle*3.1415926/180))*a;
		angle-=b;
	}
	ix=x;
	iy=y;
	printf("%d\n%d\n",ix,iy);
	return 0;
}

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

#define REP(i,n)for (int i=0;i<(n);i++)
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define ll long long
using namespace std;
typedef pair<int,int> P;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(a+b>c+d){
		cout<<"Left"<<endl;
	}else if(a+b==c+d){
		cout<<"Balanced"<<endl;
	}else{
		cout<<"Right"<<endl;
	}
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <set>
#include <array>
#include <string>
#include <map>
#include <cmath>
//#include <iomainp>
using namespace std;

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


int getIntSp(){
    string str;
    getline(cin,str,' ');
    return stoi(str);
}

int getIntLF(){
    string str;
    getline(cin,str);
    return stoi(str);
}


double calc(int x1,int y1,int x2,int y2)
{
    uint32_t X = abs(x2-x1);
    uint32_t Y = abs(y2-y1);
    return std::sqrt(X*X+Y*Y);
}

int main() {
    int N;
    cin >> N;
    vector<int> x;
    vector<int> y;
    rep(i,N){
        int tmpx,tmpy;
        cin >> tmpx >> tmpy;
        x.push_back(tmpx+1000);
        y.push_back(tmpy+1000);
    }
    
    double count = 0;
    double distance = 0;
    rep(i,N-1){
        for(int j = i+1;j<N;++j){
            count += 1;
            distance += calc(x[i],y[i],x[j],y[j]);
        }
    }
    
    cout << std::fixed << distance*(N-1)/count << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair<int, int>
#define vi vector<int>
#define pb emplace_back
#define sz(x) (int)x.size()
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define rep(i, j, k) for(i=j; i<k; i++)
#define sep(i, j, k) for(i=j; i>k; i--)
const int N = 1e5+5, inf = 1e9+7;
int n, k, i, j;
int w[N], v[N], dp[N];

signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int i, j, a, b, ans = 0;
    cin>>n>>k;
    rep(i, 1, n+1) cin>>w[i]>>v[i];
    fill(dp, dp+N, inf*inf);
    dp[0] = 0;
    rep(i, 1, n+1)
        sep(j, N-1, v[i]-1) dp[j] = min(dp[j], dp[j-v[i]]+w[i]);
    sep(i, N-1, -1) if(dp[i]<=k) return cout<<i, 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
typedef long long ll;

using namespace std;

#define REP(i,a,b) for (int i = a; i <= b; i++)
#define ALL(a)              a.begin(), a.end()
#define ALLN(a, n)          (a, a+n)
#define MAX                 10000007
#define MIN                 -10000007

void constructXOR(ll A[], ll n) 
{ 
  // calculate xor of array 
  int XOR = 0; 
  for (int i = 0; i < n; i++) 
    XOR ^= A[i]; 

  // update array 
  for (int i = 0; i < n; i++) 
    A[i] = XOR ^ A[i]; 
} 


              
int main()
{
  ios::sync_with_stdio(0);
    cin.tie(0);
  #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    //freopen("error.txt", "w", stderr);
    #endif
      
    int t;
    t=1;
     //  cin>>t;
    while(t--){
         


  ll A[200000],n;
  cin>>n;
  REP(i,0,n-1){cin>>A[i];}  
  //ll n = sizeof(A) / sizeof(A[0]); 
  constructXOR(A, n); 

  // print result 
  for (int i = 0; i < n; i++) 
    cout << A[i] << " "; 
  

       


             }
             cerr<<"Time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
    return 0;
}


Measured memory_bytes: 5348
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;

int main() {
    vector<vector<ll>> A(3, vector<ll>(3,0));
    vector<vector<bool>> B(3, vector<bool>(3,false));
    for (ll i = 0; i < 3; ++i) {
        for (ll j = 0; j < 3; ++j) {
            cin >> A[i][j];
        }
    }
    ll N;
    cin >> N;
    for (ll k = 0; k < N; ++k) {
        ll b;
        cin >> b;
        for (ll i = 0; i < 3; ++i) {
            for (ll j = 0; j < 3; ++j) {
                if (A[i][j] == b) {
                    B[i][j] = true;
                }
            }
        }
    }
    bool res = false;
    if (B[0][0] && B[0][1] && B[0][2]) res = true;
    if (B[1][0] && B[1][1] && B[1][2]) res = true;
    if (B[2][0] && B[2][1] && B[2][2]) res = true;

    if (B[0][0] && B[1][0] && B[2][0]) res = true;
    if (B[0][1] && B[1][1] && B[2][1]) res = true;
    if (B[0][2] && B[1][2] && B[2][2]) res = true;

    if (B[0][0] && B[1][1] && B[2][2]) res = true;
    if (B[2][0] && B[1][1] && B[0][2]) res = true;

    //for (ll i = 0; i < 3; ++i) {
    //    for (ll j = 0; j < 3; ++j) {
    //        cerr << B[i][j] << ",";
    //    }
    //    cerr << endl;
    //}
    
    if (res) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int n,sum,c;
	int a[100];
	while(~scanf("%d",&n)){
		for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
		sum=0;
		for(int i=1;i<n;i++)
		sum+=a[i];
		c=0;
		for(int i=0;i<n-1;i++){
		c+=a[i]*sum;
		sum-=a[i+1];
	}
	printf("%d\n",c);	
	}
	return 0;
}

Measured memory_bytes: 256
/*
                    Author: Ankit Kaul
**********************Code Belongs to Respective Author Only************************************
*/
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include <bits/stdc++.h>
#define endl       '\n'
#define PI          3.141592653589
#define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           1000000007
#define int         long long int
#define inf         INT_MAX
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
using namespace std;
            
int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
        int result=1;
        while(n>0)
        {   if(n % 2 ==1)
            result=(result * x) % M;
            x=(x*x)% M;
            n=n/2;
        }
    return result % M;
    }     
signed main()
{   jaldi
    string str,ch;
    cin>>str;
    int count=0;
    ch=str;
    reverse(ch.begin(),ch.end());
    for(int i=0;i<str.length()/2;i++)
    {   if(str[i]!=ch[i])
        count++;
    }
    cout<<count;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;

public class Main {

	static PrintWriter out;
	static InputReader ir;

	static void solve() {
		int n=ir.nextInt();
		int[] a=ir.nextIntArray(n);
		Arrays.sort(a);
		out.println(a[n-1]-a[0]);
	}

	public static void main(String[] args) throws Exception {
		ir = new InputReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.flush();
	}

	static class InputReader {

		private InputStream in;
		private byte[] buffer = new byte[1024];
		private int curbuf;
		private int lenbuf;

		public InputReader(InputStream in) {
			this.in = in;
			this.curbuf = this.lenbuf = 0;
		}

		public boolean hasNextByte() {
			if (curbuf >= lenbuf) {
				curbuf = 0;
				try {
					lenbuf = in.read(buffer);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (lenbuf <= 0)
					return false;
			}
			return true;
		}

		private int readByte() {
			if (hasNextByte())
				return buffer[curbuf++];
			else
				return -1;
		}

		private boolean isSpaceChar(int c) {
			return !(c >= 33 && c <= 126);
		}

		private void skip() {
			while (hasNextByte() && isSpaceChar(buffer[curbuf]))
				curbuf++;
		}

		public boolean hasNext() {
			skip();
			return hasNextByte();
		}

		public String next() {
			if (!hasNext())
				throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while (!isSpaceChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}

		public int nextInt() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

		public long nextLong() {
			if (!hasNext())
				throw new NoSuchElementException();
			int c = readByte();
			while (isSpaceChar(c))
				c = readByte();
			boolean minus = false;
			if (c == '-') {
				minus = true;
				c = readByte();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res = res * 10 + c - '0';
				c = readByte();
			} while (!isSpaceChar(c));
			return (minus) ? -res : res;
		}

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

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

		public long[] nextLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public char[][] nextCharMap(int n, int m) {
			char[][] map = new char[n][m];
			for (int i = 0; i < n; i++)
				map[i] = next().toCharArray();
			return map;
		}
	}
}


Measured memory_bytes: 20948
import java.util.Scanner;
class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)){
			int N = Integer.parseInt(sc.next());
			char[] S = sc.next().toCharArray();
			int[] isSheep = new int[N];
			
			StringBuilder answer= new StringBuilder();
			boolean isAnsExists=false;
			int[][] isSheepInitial= {{1,1},{0,0},{0,1},{1,0}};
			for(int ini=0; ini<4;ini++){
				isSheep[0]=isSheepInitial[ini][0];
				isSheep[1]=isSheepInitial[ini][1];
				for(int i=1;i<N-1;i++){
					isSheep[i+1]=succ(isSheep[i-1],isSheep[i],S[i]);
				}
				if((succ(isSheep[N-2],isSheep[N-1],S[N-1])==isSheep[0])&&(succ(isSheep[N-1],isSheep[0],S[0])==isSheep[1])&&!isAnsExists){
					for(int k=0;k<N;k++){answer.append((isSheep[k]==1)?"S":"W");
					isAnsExists=true;
					}
				}
			}
			if(isAnsExists){
				System.out.println(answer.toString());
			}else{
				System.out.println(-1);
			}
			
			
		}
	}
	static int succ(int back,int now, char ox){
		int answer=0;
		int[][] succMato={{1,0},{0,1}};
		int[][] succMatx={{0,1},{1,0}};
		if(ox=='o')answer=succMato[back][now];
		if(ox=='x')answer=succMatx[back][now];
		return answer;
	}
	
}

Measured memory_bytes: 56520
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()

using namespace std;

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

int nextInt() {int a; cin >> a; return a;}
char nextChar() {char a; cin >> a; return a;}
double nextDouble() {double a; cin >> a; return a;}
string nextString() {string a; cin >> a; return a;}

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

signed main() {
	int n;
	cin >> n;

	vector<int> a;
	inputVector(a, n);

	int once = 0;
	rep(i, n) once += i + 1;

	int maxval = 0;
	int sum = 0;
	rep(i, n) {
		sum += a[i];
		maxval = max(maxval, a[i]);
	}

	if (sum % once) {
		cout << "NO" << endl;
		return 0;
	}

	int times = sum / once;

	vector<int> b(n);
	rep(i, n - 1) {
		b[i] = a[i + 1] - a[i];
	}
	b[n - 1] = a[0] - a[n - 1];

	int maxr = 0;
	int ret = 0;
	rep(i, n) {
		int x = b[i] + (n - 1) * times;
		if (x % n) {
			cout << "NO" << endl;
			return 0;
		}
		ret += x / n;
		maxr = max(maxr, x / n);
	}

	if (ret != (n - 1) * times || maxr > times) {
		cout << "NO" << endl;
	} else {
		cout << "YES" << endl;
	}

    return 0;
}


Measured memory_bytes: 1792
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		long C = sc.nextLong();
		long D = sc.nextLong();
		
		boolean ok = false;
		for(int i=0; i<N; i++) {
			long max = (N-1-i)*D-i*C;
			long min = (N-1-i)*C-i*D;
			if(min <= B-A && B-A <=max) {
				ok = true;
				break;
			}
		}
		
		System.out.println(ok ? "YES" : "NO");
		
		sc.close();
	}
}


Measured memory_bytes: 23764
package main

import (
	"bufio"
	"os"
	"strconv"
	"fmt"
)

var sc = bufio.NewScanner(os.Stdin)

func nextString() string {
	if !sc.Scan() {
		panic("failed scan string")
	}
	return sc.Text()
}

func nextInt() int {
	if !sc.Scan() {
		panic("failed scan int")
	}
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	if n == 3 || n == 5 || n == 7 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <string>

using namespace std;
#define loop(i,n) for(int i = 0; i < (n); i++)
#define loops(i,f,n) for(int i = (f); i < (n); i++)
#define VEC vector<int>
#define INF 9999999
#define inta long long
typedef pair<int, int>pii;
typedef pair<int, bool>pib;
// vector<VEC> v (n, VEC(n))
//loop(i,n)loop(j,n)dp[i][j]=-1;
//printf("%d\n", n);

int main()
{
	cin.tie(0);
	cin.sync_with_stdio(0);
	int n;
	cin >> n;
	long long int f[86] = { 0 };
	f[0] = 2;
	f[1] = 1;
	loops(i, 2, n + 1)
	{
		f[i] = f[i - 1] + f[i - 2];
	}
	cout << f[n] << endl;
		return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())


map<int, vector<int>> s1, s2;
map<int, map<int,int>> si1, si2;

int x[100000], y[100000];

int d;

int count(int i) {
	int res = 0;

	auto p = s1.find(x[i] + y[i] + d);
	if (p != s1.end()) {
		res += upper_bound(all(p->second), x[i] + d)
			- lower_bound(all(p->second), x[i]);
	}
	p = s1.find(x[i] + y[i] - d);
	if (p != s1.end()) {
		res += upper_bound(all(p->second), x[i])
			- lower_bound(all(p->second), x[i] - d);
	}

	p = s2.find(x[i] - y[i] + d);
	if (p != s2.end()) {
		res += lower_bound(all(p->second), x[i] + d)
			- upper_bound(all(p->second), x[i]);
	}
	p = s2.find(x[i] - y[i] - d);
	if (p != s2.end()) {
		res += lower_bound(all(p->second), x[i])
			- upper_bound(all(p->second), x[i] - d);
	}
	return res;
}

bool visited[100000];
void f(int i) {
	if (visited[i])return;
	visited[i] = true;
	vector<int> vi;

	auto p = si1.find(x[i] + y[i] + d);
	if (p != si1.end()) {
		auto it = p->second.lower_bound(x[i]);
		for (; it != p->second.end() && it->first <= x[i] + d; ) {
			vi.push_back(it->second);
			p->second.erase(it++);
		}
	}
	p = si1.find(x[i] + y[i] - d);
	if (p != si1.end()) {
		auto it = p->second.lower_bound(x[i] - d);
		for (; it != p->second.end() && it->first <= x[i]; ) {
			vi.push_back(it->second);
			p->second.erase(it++);
		}
	}

	p = si2.find(x[i] - y[i] + d);
	if (p != si2.end()) {
		auto it = p->second.upper_bound(x[i]);
		for (; it != p->second.end() && it->first < x[i] + d; ) {
			vi.push_back(it->second);
			p->second.erase(it++);
		}
	}
	p = si2.find(x[i] - y[i] - d);
	if (p != si2.end()) {
		auto it = p->second.upper_bound(x[i] - d);
		for (; it != p->second.end() && it->first < x[i] ; ) {
			vi.push_back(it->second);
			p->second.erase(it++);
		}
	}

	for (int v : vi)f(v);
}



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

	int n, a, b;
	cin >> n >> a >> b;
	a--; b--;
	rep(i, n) {
		cin >> x[i] >> y[i];
	}
	d = abs(x[a] - x[b]) + abs(y[a] - y[b]);
	rep(i, n) {
		s1[x[i] + y[i]].push_back(x[i]);
		s2[x[i] - y[i]].push_back(x[i]);

		si1[x[i] + y[i]][x[i]] = i;
		si2[x[i] - y[i]][x[i]] = i;
	}
	for (auto &v : s1) {
		sort(all(v.second));
	}
	for (auto &v : s2) {
		sort(all(v.second));
	}


	long long ans = 0;
	si1[x[a] + y[a]].erase(x[a]);
	si2[x[a] - y[a]].erase(x[a]);
	f(a);
	rep(i, n)if(visited[i])ans += count(i);

	cout << ans / 2 << endl;


	return 0;
}

Measured memory_bytes: 49536
#include<stdio.h>

int main(){
    char input[8][9];
    int i,j;

    for(i = 0;i < 8;i++){
        for(j = 0;j < 8;j++){
            scanf("%c",&input[i][j]);
        }
        getchar();
    }

    printf("90\n");
    for(i = 0;i < 8;i++){
        for(j = 0;j < 8;j++){
            printf("%c",input[7 - j][i]);
        }
        puts("");
    }

    printf("180\n");
    for(i = 0;i < 8;i++){
        for(j = 0;j < 8;j++){
            printf("%c",input[7 - i][7 - j]);
        }
        puts("");
    }

    printf("270\n");
    for(i = 0;i < 8;i++){
        for(j = 0;j < 8;j++){
            printf("%c",input[j][7 - i]);
        }
        puts("");
    }

    return 0;
}

Measured memory_bytes: 524
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

set<int> lst[200001];
bool used[200001];

int main() {
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for (auto &e: a) cin >> e;

    for (int i = 0; i < n; ++i) {
        lst[a[i]].emplace(i);
    }

    vector<int> cost(n+1, -1);
    cost[0] = 0;
    int i = 0;
    do {
        set<int> &s = lst[a[i]];
        auto it = s.lower_bound(i);
        for (++it; it != s.end(); ++it) {
            if (cost[(*it)+1] == -1) {
                cost[(*it)+1] = cost[i];
                i = (*it)+1;
                break;
            }
        }
        if (it != s.end()) continue;
        for (it = s.begin(); ; ++it) {
            if (cost[(*it)+1] == -1) {
                cost[(*it)+1] = cost[i]+1;
                i = (*it)+1;
                break;
            }
        }
    } while (i != n);

    // for (auto &e: cost) cerr << e << " ";
    // cerr << endl;

    int dur = cost[n]+1;
    k %= dur;
    if (k == 0) {
        cout << endl;
    } else {
        int i;
        for (i = n-1; i >= 0; --i) {
            if (cost[i]+1 == k) break;
        }
        vector<int> ans;
        ans.push_back(a[i]);
        ++i;
        while (i != n) {
            set<int> &s = lst[a[i]];
            auto it = s.lower_bound(i);
            auto nit = it;
            ++nit;
            if (nit == s.end()) {
                ans.push_back(a[i]);
                ++i;
            } else {
                i = *nit + 1;
            }
        }

        for (auto &e: ans) cout << e << " ";
        cout << endl;
    }



    return 0;
}


Measured memory_bytes: 23544
fun main(args: Array<String>) {
    val (n, m) = readLine()!!.split(' ').map { it.toInt() }
    val xs = readLine()!!.split(' ').map { it.toLong() }.sorted().toMutableList()
    val ys = (0 until m).map {
        val (b, c) = readLine()!!.split(' ').map { it.toLong() }
        Pair(b.toInt(), c)
    }.sortedByDescending { it.second }

    var i = 0
    for (y in ys) {

        var j = 0
        while (j < y.first && i < n) {
            j++
            if (y.second > xs[i]) {
                xs[i] = y.second
                i++
            } else {
                i = n
            }
        }

        if (i == n) {
            break
        }
    }

    println(xs.sum())
}


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n; cin>>n;
	vector<int>d(n); for(auto&&i:d)cin>>i;
	sort(d.begin(),d.end());
	cout<<d.at(n/2)-d.at(n/2-1)<<"\n"s;
}


Measured memory_bytes: 3760