akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main(){
    ll k,a,b;cin >> k >> a >> b;
    if(a>=b-2)cout << k+1 <<endl;
    else{
        ll t=k-(a-1);
        if(t<0){
            cout << k+1 <<endl;
        }
        else{
            cout << a+(t/2)*(b-a)+(t%2) <<endl;
        }
    }
}

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

typedef long long ll;
static const int MOD = 1e9+7;

int main(){
    string s;
    cin>>s;
    for(int i=0; i<3; i++){
        if(s[i] == '7'){
            cout<<"Yes"<<endl;
            return 0;
        }
    }

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

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

typedef long long ll;

int main() {
	int p = 1000;
	vector<int> val(1000 + 1);
	for (int i = 2; i <= p; ++i){
		if (!val[i]) {
			for (int j = i; j <= p; j += i) {
				val[j] = i;
			} 
		}
	}
	int n;
	cin >> n;
	int mod = 1e9 + 7;
	ll ans = 1;
	map<int,int> m;
	for (int i = 2; i <= n; ++i) {
		 //ll cp = 0;
		 int x = i;
		 while (x > 1) {
			 //cp++;
			 m[val[x]]++;
			 x /= val[x];
		 }
		 //ans = (ans * (cp + 1)) % mod; 
	 }
	 for (auto it = m.begin(); it != m.end(); ++it) {
		 ans = (ans * (it->second + 1)) % mod;
	 }
	 cout << ans;
	 
	 
	 
	 //3 4  12
 	//3 4 = 12 
 	//6  2 = 12
 	//1 2 3 4 5 6
 	//12 18 24 30
 	//10 15 20
 	//12 8
 	//6
 	
 	
 	//cout << (ans - 
	//ll ans = (n + ((n - 2) * (n - 1))/ 2
	//cout << ans;
	//for (ll i = 3; i <= n; ++i) {
       //p = (p 
	//}
  //(n - 1)C2 + (n - 1)C3 ..... (n-1) C(n -1) = 2^(n -1) - n + n
  //2^(n - 1) 
}
//n - 1
//2(n - 1) - 1 + 

//3! = 4 // 1 2 3 6 
// 4! =  // 1 2 3 4 // 4 // (n - 2)(n - 1) / 2 
//4 => 1 2 3 4   12 8 6 24






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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
template <class T>
T GCD(T a, T b)
{
    T r;
    while (a)
        r = b, b = a, a = r % a;
    return b;
}
template <class T>
T LCM(T a, T b) { return a / GCD(a, b) * b; }

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repe(i, n) for (ll i = 0; i <= (n); i++)
#define repd(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef vector<ll> vl;
#define ERASE(x) x.erase(unique(ALL(x)), x.end()); // erase same elements
#define VEC(type, c, n)     \
    std::vector<type> c(n); \
    for (auto &i : c)       \
        std::cin >> i;

// input
#define INIT                          \
    std::ios::sync_with_stdio(false); \
    std::cin.tie(0);
#define VAR(type, ...) \
    type __VA_ARGS__;  \
    MACRO_VAR_Scan(__VA_ARGS__);
template <typename T>
void MACRO_VAR_Scan(T &t)
{
    std::cin >> t;
}
template <typename First, typename... Rest>
void MACRO_VAR_Scan(First &first, Rest &... rest)
{
    std::cin >> first;
    MACRO_VAR_Scan(rest...);
}

// output
template <typename T>
void MACRO_OUT(const T t) { std::cout << t; }

#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define SP std::cout << " ";
#define TAB std::cout << "\t";
#define BR std::cout << "\n";
#define ENDL std::cout << std::endl;

#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define yes() printf("yes\n")
#define no() printf("no\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
    cout << a;
    ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
    cout << a << ' ';
}

double ans = 0;
bool check = 0;
bool boo = 0;
string s, t;
int N = 3;
vector<int> v(N);
double a, b, c, d, n, m, k = 0;
int x = 0, y = 0;
int sum;
char ch;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// cout << (conditon ? (result:  == 1 ): (==0)) << endl; <- output result of if
// long long 型が表せる値の上限はおよそ 9 × 10＾18 です．
int main()
{
    INIT;
    //33
    cin >> n;
    rep(i, n)
    {
        cin >> a >> s;
        if (s == "JPY")
            ans += a;
        else
        {
            ans += (a * 380000);
        }
    }
    pr(ans);
    return 0;
}


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

const int N = 1000000;

void insertion_sort(int n, int g, int &cnt, int A[]) {
  int i, j, v;
  
  for (i = g; i < n; i++) {
    v = A[i];
    for (j = i - g; j >= 0; j -= g) {
      if (A[j] > v) {
        A[j+g] = A[j];
        cnt++;
      } else {
        break;
      }
    }
    A[j+g] = v;
  }
}

int shell_sort(int n, int A[], vector<int> G) {
  int cnt = 0, m;
  
  m = G.size();
  for (int i = m - 1; i >= 0; i--) {
    insertion_sort(n, G[i], cnt, A);
  }

  return cnt;
}

int main() {
  int i, n;
  int A[N];
  vector<int> G;

  cin >> n;
  for (i = 0; i < n; i++) cin >> A[i];

  int g = 1;  
  while (g <= n) {
    G.push_back(g);
    g = 3 * g + 1;
  }
    
  int cnt = shell_sort(n, A, G);

  // output
  int m = G.size();
  cout << m << endl;

  for (i = m-1; i >= 0; i--) {
    if (i < m - 1) cout << " ";
    cout << G[i];
  }
  cout << endl;

  cout << cnt << endl;

  for (i = 0; i < n; i++) cout << A[i] << endl;

  return 0;
}



Measured memory_bytes: 7024
#include <stdio.h>

int	min(int a, int b, int c)
{
	int	m = a;

	if (b < m)
		m = b;
	if (c < m)
		m = c;
	return (m);
}

int	main(void)
{
	int	ab, bc, ca;
	int	area;

	scanf("%d %d %d", &ab, &bc, &ca);
	area = min(ab * bc, bc * ca, ca * ab) / 2;
	printf("%d\n", area);
	return (0);
}

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

#define real() cout<<"\n";

#define debug(arguments...) {string pri=#arguments;replace(pri.begin(),pri.end(),',',' ');stringstream prii(pri);istream_iterator<string> _iterat(prii);error(_iterat,arguments);}
void error(istream_iterator<string> _iterat) {}
template<typename T,typename...args>
void error(istream_iterator<string> _iterat,T a,args...arguments)
{
    cerr<<*_iterat<<"="<<a<<"\n";
    error(++_iterat,arguments...);
}

#define debugmp(z) {string pri=#z;error(pri,z);}
template<typename T,typename V>
void error(string pri,const pair<T,V> &z)
{
    cerr<<pri<<"="<<"{"<<z.first<<","<<z.second<<"}"<<"\n";
}
template<typename T,typename V>
void error(string pri,const map<T,V> &z)
{
    cerr<<pri<<" is={";
    for(auto it=z.begin();it!=z.end();++it)
    {
        cerr<<it->first<<":"<<it->second;
        auto _it=z.end();
        _it--;
        if(it!=_it) cerr<<",";
    }
    cerr<<"}";
    cerr<<"\n";
}

#define debugc(z,st,ed) {string pri=#z;error(pri,z,st,ed);}
template<typename T>
void error(string pri,const vector<T> &z,long long st,long long ed)
{
    cerr<<pri<<" in range["<<st<<","<<ed<<")=[";
    for(long long i=st;i<ed;++i)
    {
        cerr<<z[i];
        if(i!=ed-1) cerr<<" ";
    }
    cerr<<"]";
    cerr<<"\n";
}
template<typename T>
void error(string pri,const set<T> &z,long long st,long long ed)
{
    cerr<<pri<<" in range["<<st<<","<<ed<<")=[";
    long long tempcount=0;
    for(auto it=z.begin();it!=z.end();++it)
    {
        if(tempcount>=st and tempcount<ed)
        {
            cerr<<*it;
            if(tempcount!=ed-1) cerr<<" ";
        }
        tempcount++;
    }
    cerr<<"]";
    cerr<<"\n";
}
template<typename T>
void error(string pri,const T z[],long long st,long long ed)
{
    cerr<<pri<<" in range["<<st<<","<<ed<<")=[";
    for(long long i=st;i<ed;++i)
    {
        cerr<<z[i];
        if(i!=ed-1) cerr<<" ";
    }
    cerr<<"]";
    cerr<<"\n";
}

void logic()
{
    int n;
    cin>>n;
    long long arr[n];
    for(int i=0;i<n;++i)
    {
        cin>>arr[i];
    }
    long long count=0;
    for(int i=0;i<n;++i)
    {
        if(arr[i]%2==0)
        {
            while(arr[i]%2==0)
            {
                count++;
                arr[i]=arr[i]/2;
            }
        }
    }
    cout<<count;
    cout<<"\n";
    //incase of wrong answer...stress test your code...do not stress test yourself
    //overflow,bounds,size,constraints
    //sample tests,corner case/special case(n==0 or n==1 or negative numbers...),some hand written tests
    //read statement carefully
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    long long t;
    //cin>>t;
    //while(t--)
    {
        logic();
    }
}


Measured memory_bytes: 3724
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()


def main():
    A = list(map(int, list(input())))
    for op in range(1 << 3):
        ans = A[0]
        for i in range(3):
            if op & (1 << i):
                ans += A[i + 1]
            else:
                ans -= A[i + 1]
        if ans != 7: continue
        out = [str(A[0]), None, str(A[1]), None, str(A[2]), None, str(A[3]), "=7"]
        for i in range(3):
            if op & (1 << i):
                out[2 * i + 1] = "+"
            else:
                out[2 * i + 1] = "-"
        print("".join(out))
        return


if __name__ == "__main__":
    main()


Measured memory_bytes: 64896
#include <stdio.h>

int main(){
    int a, b, d, r;
    double f;
    scanf("%d %d", &a, &b);
    d=a/b;
    r=a%b;
    f=(double)a/(double)b;
    printf("%d %d %f\n", d, r, f);
    return 0;
}


Measured memory_bytes: 2104
#include<iostream>
#include<string>
  
using namespace std;
  
int main(){
    int n,m;
    int a[1000];
    int b[1000];
    int c[1000];
    int e,o;
    cin>>n>>m;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<m;i++){
        cin>>b[i];
    }
    for(int i=0;i<n;i++){
        c[i]=0;
    }
    for(int i=0;i<n;i++){
        int j=0;
        while(true){
            if(b[i]>=a[j]){
                c[j]+=1;
                break;
            }
            j++;
        }
    }
    e=c[0];
    o=0;
    for(int i=0;i<n;i++){
        if(e<c[i]){
            o=i;
            e=c[i];
        }
    }
    cout<<o+1<<endl;
    return 0;
} 

Measured memory_bytes: 1172
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

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; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Combination {

public:
    vector<ll> fact;

    Combination(int max_n) {
        //1 ~ n!までの階乗modを求める
        int n = max_n;
        vector<ll> fact(n + 1);
        fact[0] = 1;
        for (int i = 1; i <= n; i++) {
            fact[i] = (fact[i - 1] * i) % MOD;
        }
        this->fact = fact;
    }

    template<typename T>
    //templateをつかってみｔか
    ll pow(T x, int y) {
        if (y == 0) return 1;
        if (y == 1) return x;
        if (y == 2) return (x * x) % MOD;
//        if (y % 2 == 1) return pow(x, y / 2) * pow(x, y / 2) % MOD;
        if (y % 2 == 1) return pow(pow(x, y / 2), 2) * x % MOD;
//        return pow(x, y / 2) * pow(x, y / 2) % MOD;
        return pow(pow(x, y / 2), 2) % MOD;
    }

    ll nCk(int n, int k) {
//        return (fact[n] * pow(fact[n-k],MOD-2) * pow(fact[k],MOD-2)) % MOD;
        return (((fact[n] * pow(fact[n - k], MOD - 2)) % MOD) * pow(fact[k], MOD - 2)) % MOD;
    }

    /**
     * x ^ -1を求める
     */
    template<typename T>
    ll inv(T x) {
        return pow(x, MOD - 2);
    }
};

class Solve {
public:
    void input() {

    }

    void solve() {
        input();
        ll N, K;
        cin >> N >> K;
        Combination cmb(N + 2);
        ll blue = K;
        ll red = N - K;

        for (int i = 1; i <= K; ++i) {
            if (i <= red + 1) {
                ll tapi = cmb.nCk(K - 1, i - 1);
                ll tapu = cmb.nCk(N - K + 1, i);
                ll ans = (tapi * tapu) % MOD;
                cout << ans << endl;
            } else {
                cout << 0 << endl;
            }
        }

    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt();
		if(a+b<c+d) {
			System.out.println("Right");
		} else if(a+b==c+d) {
			System.out.println("Balanced");
		} else {
			System.out.println("Left");
		}
	}
	
	static int binarySearch(int[] A, int x) {
		int l = 0;
		int r = A.length;
		while(l<r) {
			int mid = (l+r)/2;
			if(A[mid] == x) return mid;
			else if(x<A[mid]) r = mid;
			else l = mid+1;
		}
		return -1;
	}
	
	static long upper_bound(int[] A, int b) {
		// bよりおおきい値がはじめて出てくるindexを返す
		return lower_bound(A, b+1);
	}

	static long lower_bound(int[] A, int b) {
		// b以上の値がはじめて出てくるindexを返す
		int lb=0;
		int ub=A.length;
		while(ub>lb) {
			int mid = (lb+ub)/2;
			if(A[mid]>=b) ub = mid;
			else lb = mid+1;
		}
		return lb;
	}
	
	// union find lib
	// usage:
	// 最初にinitを呼ぶ
	// root: 直接は呼ばないで
	// unite: まとめる
	// same: グループ判定
	static void init(int par[], int N) {
		for(int i=0; i<N; i++) {
			par[i] = i;
		}
	}
	
	static int root(int x, int [] par) {
		if(par[x] == x) {
			return x;
		} else {
			return (par[x] = root(par[x], par));
		}
	}
	
	static boolean same(int x, int y, int[] par) {
		return root(x, par) == root(y, par);
	}
	
	static void unite(int x, int y, int[] par) {
		x = root(x, par);
		y = root(y, par);
		if(x == y) return;
		par[x] = y;
	}
	
	// end union find lib
	
	// number lib
	
	static int max(int...ls) {
		int ans = Integer.MIN_VALUE;
		for(int i=0; i<ls.length; i++) {
			ans = Math.max(ans, ls[i]);
		}
		return ans;
	}
	
	static int min(int...ls) {
		int ans = Integer.MAX_VALUE;
		for(int i=0; i<ls.length; i++) {
			ans = Math.min(ans, ls[i]);
		}
		return ans;
	}
	
	static long lcm(long a, long b) {
		return a*(b/gcd(a, b));
	}
	
	static long gcd(long a, long b) {
		long ta = Math.max(a, b);
		long tb = Math.min(a, b);
		long tmp;
		while((tmp = ta%tb) != 0) {
			ta = tb;
			tb = tmp;
		}
		return tb;
	}
	
	static long modcomb(long n, long k, long mod) {
		if(k==1) {
			return n;
		}
		
		long ans = 1;
		for(long i=n; i>=n-k+1; i--) {
			ans = (ans * i)%mod;
		}
		for(long i=k; 0<i; i--) {
			ans = (ans * modpow(i, mod-2, mod)) % mod;
		}
		return ans;
	}
	
	static long modpow(long a, long b, long mod) {
		if(b==0) return 1;
		if(b%2==0) {
			long d = modpow(a, b/2, mod);
			return (d*d)%mod;
		} else {
			return (a*modpow(a, b-1, mod))%mod;
		}
	}
	
	static int disit(long a, long d) {
		int count = 0;
		while(a!=0) {
			a = a/d;
			count++;
		}
		return count;
	}
	
	// end number lib
}

Measured memory_bytes: 23892
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
using ll=long long;
using namespace std;

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

    string s;
    map<string,int> m;
    int maxnum=0;
    for(int i=0;i<N;i++){
        cin>>s;
        m[s]++;
        if(m[s]>maxnum){
            maxnum=m[s];
        }

    }

    for(auto p:m){
        if(p.second==maxnum){
            cout<<p.first<<endl;
        }
    }
    
    return 0;
}

Measured memory_bytes: 19244
#include <bits/stdc++.h>
//#include "Header.h"

#define pi 3.14159265358979323846264

#define ll long long
#define fori(n) for(long long i=0;i<n;i++)
#define forj(n) for(long long j=0;j<n;j++)

#define sp(n) setprecision(n)
#define d7 1000000007
#define mkp make_pair
#define mkt make_tuple

using namespace std;

bool isPrime(long long k){
    if(k<=1){return false;}
    if(k==2){return true;}
    if(k%2==0){return false;}
    long long i = 3;
   while (i*i <= k) {if (k % i == 0) {return false;}i += 2;}
return true;
}

ll binomialCoeff(ll n, ll k){
    ll C[n + 1][k + 1];ll i, j;
    for (i = 0; i <= n; i++){
        for (j = 0; j <= min(i, k); j++){
            if (j == 0 || j == i){C[i][j] = 1;}
            else{C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]);}}}
    return C[n][k];
 }

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

ll srihrg(ll n,ll k,ll m){
    ll ans;
    ans=1;
    fori(k){
        ans=(ans*n)%m;
    }
    return ans;
}


int main(int argc, const char * argv[]) {
 //cout<<"Om\n";
 //Praise to Lord
 //make cin/cout faster
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);cout.tie(NULL);
// code now
   
    ll n,k;
    cin>>n>>k;
    string b[n];
    fori(n) cin>>b[i];
    vector<vector<ll>> dp(n,vector<ll>(k));
    dp[0][0]=1;
    fori(n){
        forj(k){
            if(b[i][j]=='.'){
                if(i>0&&j>0) dp[i][j]=(dp[i-1][j]+dp[i][j-1])%d7;
                else{
                    if(i==0&&j>0){dp[0][j]=dp[0][j-1]%d7;}
                    else{
                        if(i>0&&j==0){dp[i][0]=dp[i-1][j]%d7;}
                    }
                }
            }
        }
    }
    cout<<dp[n-1][k-1];
    
//code ends
    return 0;
}


Measured memory_bytes: 9216
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;
typedef pair<int, string> P;


void solve()
{
	int n;
	while (scanf("%d\n", &n), n)
	{
		string str;
		map<string, int> Map;
		while (n--)
		{
			getline(cin, str);
			str += " ";
			string s;
			for (int i = 0; i < str.size(); ++i)
			{
				if (str[i] == ' ')
				{
					Map[s]++;
					s.clear();
				}
				else
				{
					s += str[i];
				}
			}
		}
		char c;
		cin >> c;
		vector<P> word;
		map<string, int>::iterator it = Map.begin();
		while (it != Map.end())
		{
			if (it->first[0] == c)
			{
				word.push_back(P(-it->second, it->first));
			}
			++it;
		}
		if (word.empty())
		{
			cout << "NA" << endl;
			continue;
		}
		sort(word.begin(), word.end());
		int displaySize = min((int)word.size(), 5);
		bool isFirst = true;
		for (int i = 0; i < displaySize; ++i)
		{
			if (!isFirst)
			{
				cout << " ";
			}
			isFirst = false;
			cout << word[i].second;
		}
		cout << endl;
	}
}

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

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

using namespace std;

int main(){
	int n;
	cin>>n;
	vector<int> heights(n, 0);
	int temp1=0, temp2=0;
	for(int i=0; i<n; i++){
		cin>>heights[i];
		if(i==1) temp2=abs(heights[i]-heights[i-1]);
		if(i>1){
			int minAns=min(temp1+abs(heights[i]-heights[i-2]), temp2+abs(heights[i]-heights[i-1]));
			temp1=temp2;
			temp2=minAns;			
		}
	}
	cout<<temp2<<"\n";
}


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

int main() {
    string s;
    cin>>s;
    
    
    rep(i,s.size()){
        if(s[i]=='L'&&(i+1)%2==1){
            cout<<"No"<<endl;
            break;
        }
        if(s[i]=='R'&&(i+1)%2==0){
            cout<<"No"<<endl;
            break;
        }
        else if(i==(s.size()-1)) {
            cout<<"Yes"<<endl;
        }
    }

    
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

ll n;
int main(){
    cin>>n;
    ll ans=0;
    for(ll i=1;i<=sqrt(n);++i){
        if(n%i==0&&n/i-1>i){
            ans+=n/i-1;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){
  string s;
  cin >> s;
  int x = 0;
  int ans = 999;
  for(int i = 0; i <= (s.size()-3); i++){
    x = ((s.at(i)- '0') * 100 )+ ((s.at(i + 1) -'0') * 10) + (s.at(i + 2) - '0');
    ans = min(abs(753-x),ans);  
  }
  cout << ans << endl;
}
    
      

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
#define _GLIBCXX_DEBUG
                    
using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll mod = 1e9+7;
void chmod(ll &M){
  if(M >= mod) M %= mod;
  else if(M < 0){
     M += (abs(M)/mod + 1)*mod;
    M %= mod;
}
}
ll modpow(ll x, ll n){
   if(n==0) return 1;
  ll res=modpow(x, n/2);
 if(n%2==0) return res*res%mod;
else return res*res%mod*x%mod;
}


int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  else return GCD(b, a % b);
}

using namespace std;

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int N; cin >> N;
  string S, T;
  cin >> S >> T;
  string R;
  rep(i, N) {
    R += S.at(i);
    R += T.at(i);
  }

  cout << R << endl;
}

Measured memory_bytes: 3612
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;

public class Main {
	static ContestScanner in;
	static Writer out;
	public static void main(String[] args) {
		Main main = new Main();
		try {
			in = new ContestScanner();
			out = new Writer();
			main.solve();
			out.close();
			in.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	void solve() throws IOException {
		int k = in.nextInt();
		int s = in.nextInt();
		long ans = 0;
		for(int x = 0; x <= k; x++) {
			for(int y = 0; y <= k; y++) {
				int z = s - (x + y);
				if(z < 0 || k < z) continue;
				ans++;
			}
		}
		System.out.println(ans);
	}
}

@SuppressWarnings("serial")
class MultiSet<T> extends HashMap<T, Integer>{
	@Override public Integer get(Object key){return containsKey(key)?super.get(key):0;}
	public void add(T key,int v){put(key,get(key)+v);}
	public void add(T key){put(key,get(key)+1);}
	public void sub(T key){final int v=get(key);if(v==1)remove(key);else put(key,v-1);}
	public MultiSet<T> merge(MultiSet<T> set)
	{MultiSet<T>s,l;if(this.size()<set.size()){s=this;l=set;}else{s=set;l=this;}
	for(Entry<T,Integer>e:s.entrySet())l.add(e.getKey(),e.getValue());return l;}
}

class Writer extends PrintWriter{
	public Writer(String filename)throws IOException
	{super(new BufferedWriter(new FileWriter(filename)));}
	public Writer()throws IOException{super(System.out);}
}
class ContestScanner implements Closeable{
	private BufferedReader in;private int c=-2;
	public ContestScanner()throws IOException 
	{in=new BufferedReader(new InputStreamReader(System.in));}
	public ContestScanner(String filename)throws IOException
	{in=new BufferedReader(new InputStreamReader(new FileInputStream(filename)));}
	public String nextToken()throws IOException {
		StringBuilder sb=new StringBuilder();
		while((c=in.read())!=-1&&Character.isWhitespace(c));
		while(c!=-1&&!Character.isWhitespace(c)){sb.append((char)c);c=in.read();}
		return sb.toString();
	}
	public String readLine()throws IOException{
		StringBuilder sb=new StringBuilder();if(c==-2)c=in.read();
		while(c!=-1&&c!='\n'&&c!='\r'){sb.append((char)c);c=in.read();}
		return sb.toString();
	}
	public long nextLong()throws IOException,NumberFormatException
	{return Long.parseLong(nextToken());}
	public int nextInt()throws NumberFormatException,IOException
	{return(int)nextLong();}
	public double nextDouble()throws NumberFormatException,IOException 
	{return Double.parseDouble(nextToken());}
	public void close() throws IOException {in.close();}
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD (ll)(1e9+7)
ll N,A[303030];
ll mk[66];
ll i, j, k,ans;
int main(){
    scanf("%lld", &N);
    fornum(i,0,N){
        scanf("%lld", &A[i]);
    }
    fornum(i,0,N){
        fornum(j,0,61){
            if(A[i]&(1ll<<j)){
                ans = (ans +(i-mk[j]) * ((1ll << j)%MOD)) % MOD;
                mk[j]++;
            }else{
                ans = (ans +mk[j] * ((1ll << j)%MOD)) % MOD;
            }
        }
        //printf("%lld\n", ans);
    }
    printf("%lld", ans);

    return 0;
}

Measured memory_bytes: 2560
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
using namespace std;

#define FOR(i,f,t) for(int i=(int)f; i<(int)t; i++)
#define FORR(i,f,t) for(int i=(int)f; i>(int)t; i--)
#define ms(obj, val) memset(obj, val, sizeof(obj))
#define pb push_back
#define SYNC ios_base::sync_with_stdio(false)
#define st(v) sort(v.begin(),v.end());
#define F first
#define S second
#define ri(x) scanf("%d",&x)
#define rii(x,y) scanf("%d %d",&x,&y)
#define riii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define lri(x) scanf("%lld",&x)
#define lrii(x,y) scanf("%lld %lld",&x,&y)
#define lriii(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

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

const int MAXN = 2e5+3; //AREGLAAAAAAAAR!!!!
const int MAXLOG = 20;

ii a[MAXN];

ll BIT[MAXN];
int N;

//suma val a la posicion p, tengan en cuenta que esto no modifica A, a veces se quiere
//modificar, entonces lo tienen que hacer tambien a parte.
void BIT_upd(int p, int val){ //O(log(n))
	p++;
	for(; p <= N; p += p & -p)
		BIT[p] += val;
}

//devuelve la suma de [0,p]
ll BIT_sum(int p){ //O(log(n))
	ll ret = 0;
	p++;
	for(; p; p -= p & -p)
		ret += BIT[p];
	return ret;
}
ii qy[MAXN],qy2[MAXN];
map<ii,ll>mapa;
int main(){
	int n,q,m;
	rii(n,m);
	N = n+1;
	ri(q);
	FOR(i,0,m){
		int u,v;
		rii(u,v);
		a[i]={u,v};
	}
	sort(a,a+m);
	FOR(i,0,m){
		int v = a[i].S;
		BIT_upd(v,1);
	}
	FOR(i,0,q){
		int u,v;
		rii(u,v);
		qy[i] = {u,v};
		qy2[i] = {u,v};
	}
	sort(qy,qy+q);
	int p =0;
	FOR(i,0,q){
		int u = qy[i].F, v = qy[i].S;
		FOR(j,p,m){
			if(a[j].F<u){
				p=j+1;
				BIT_upd(a[j].S,-1);
			}else{
				p=j;
				break;
			}
		}
		mapa[{u,v}] = BIT_sum(v);
	}
	FOR(i,0,q){
		int u = qy2[i].F, v = qy2[i].S;
		printf("%lld\n",mapa[{u,v}]);
	}
}


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

int N;
vector<int> A(101, 0);

int main(void){
    
    cin >> N;
    for(int i = 0; i < N; ++i) cin >> A[i];
    
    int perv = 0, ans = 0;
    for(int i = 0; i < N; ++i){
        if(perv == A[i]) ++ans, perv = 0;
        else perv = A[i];
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    for (int i = 0; i < s.size() + 1; i++) {
        rotate(s.begin(), s.begin() + 1, s.end());
        if (s == t) {
            cout << "Yes\n";
            return 0;
        }
    }

    cout << "No\n";

    return 0;
}


Measured memory_bytes: 256
def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 2*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

B,W=map(int,input().split())

p=[1]
for i in range(1,B+W+1) :
    p.append((p[-1]*inverse[2])%mod)

BD=[0]
for i in range(1,B+W+1):
    t=(BD[-1]+cmb(i-1,B-1,mod)*p[i])%mod
    BD.append(t)

WD=[0]
for i in range(1,B+W+1):
    t=(WD[-1]+cmb(i-1,W-1,mod)*p[i])%mod
    WD.append(t)

for i in range(1,B+W+1):
    ans=(1-BD[i-1]-WD[i-1])*p[1]+WD[i-1]
    ans%=mod
    print(ans)

Measured memory_bytes: 91256
#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main() {
  int n, m, x;
  cin >> n >> m >> x;
  vector<int> vec(n + 1);
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    vec[a] = 1;
  }
  partial_sum(vec.begin(), vec.end(), vec.begin());
  cout << min(vec[x], vec[n] - vec[x]) << endl;
}


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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main()
{
    int x, a, b;
    cin >> x >> a >> b;
    int disa = abs(x - a);
    int disb = abs(x - b);
    if (disa < disb)
        cout << "A" << endl;
    else
        cout << "B" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,d1[100100],d2[100100],ans=0;
vector<int> v[100100];
void Dfs1(int x,int fa,int d)
{
    d1[x]=d;
    for(int i=0;i<v[x].size();i++)
    {
        if(v[x][i]!=fa)
        {
            Dfs1(v[x][i],x,d+1);
        }
    }
}
void Dfs2(int x,int fa,int d)
{
    d2[x]=d;
    for(int i=0;i<v[x].size();i++)
    {
        if(v[x][i]!=fa)
        {
            Dfs2(v[x][i],x,d+1);
        }
    }
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n-1;i++)
    {
        int a,b;
        scanf("%d%d",&a,&b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    Dfs1(1,0,1);
    Dfs2(n,0,1);
    for(int i=1;i<=n;i++)
    {
        if(d1[i]<=d2[i])ans++;
        else ans--;
    }
    if(ans>0)printf("Fennec\n");
    else printf("Snuke\n");
    return 0;
}


Measured memory_bytes: 12800
def solve(S):
    pre = S[0]
    flag = False
    ans = 0
    cnt = 0
    for s in S[1:]:
        if flag:
            if pre == s:
                cnt += 1
            else:
                ans += cnt // 2
                cnt = 0
                flag = False
        else:
            if pre == s:
                cnt += 2
                flag = True
        pre = s
    if flag:
        ans += cnt // 2
    return ans


S = input()
K = int(input())
if len(S) == 1:
    print(K // 2)
elif len(S) == S.count(S[0]):
    print((len(S)*K)//2)
else:
    if K == 1:
        print(solve(S))
    elif K == 2:
        print(solve(S + S))
    else:
        ans2 = solve(S + S)
        ans3 = solve(S + S + S)
        print(ans2 + (ans3-ans2)*(K - 2))


Measured memory_bytes: 9156
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>
#include <numeric>
#include <string.h>
#include <sys/time.h>
#include <random>


#define fs first
#define sc second
#define endl "\n"

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef pair<int, int> P;



int main(){
    string s;   cin >> s;
    if(s == "ARC"){
        cout << "ABC" << endl;
    }
    else{
        cout << "ARC" << endl;
    }



    return 0;
}


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

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

using namespace std;


string rev(string s){
    reverse(s.begin(), s.end());
    return s;
}

bool same(string s, string t){
    return s == rev(t);
}

int h, w;
vector<string> s(12);

bool check(vector<string>& s){
    sort(s.begin(), s.end());

    set<int> used;
    rep(hx, w){
        if(0 < used.count(hx)) continue;
        rep(p, w){
            if(hx == p)           continue;
            if(0 < used.count(p)) continue;
            if(same(s[hx], s[p])){
                used.insert(hx);
                used.insert(p);
                break;
            }
        }
    }

    int un = used.size();
    if(un == w) return true;
    if(un == w-1){
        rep(hx, w){
            if(used.count(hx) == 0){
                rep(wx, h/2+1){
                    if(s[hx][wx] != s[hx][h-wx-1]) return false;
                }
                return true;
            }
        }
    }
    return false;
}

int mid = -1;

bool pairs(vector<pair<int, int>> rem, set<int>& st){
    if(st.empty()){
        vector<string> r(w, "");
        if(0 <= mid){
            rep(wx, w) r[wx] += s[mid][wx];
        }
        for(auto p : rem){
            rep(wx, w){
                r[wx] = s[p.first][wx] + r[wx];
                r[wx] = r[wx] + s[p.second][wx];
            }
        }
        return check(r);
    }
    

    int l = *st.begin();
    for(auto r : st){
        if(r <= l) continue;
        vector<pair<int, int>> v = rem;
        v.push_back({l, r});
        set<int> stt = st;
        stt.erase(l);
        stt.erase(r);
        if(pairs(v, stt)) return true;
    }

    return false;
}

int main(){
    cin >> h >> w;
    rep(i, h) cin >> s[i];

    set<int> st;
    rep(i, h) st.insert(i);
    if(h%2 == 0){
        cout << (pairs(vector<pair<int, int>>(), st)? "YES":"NO") << endl;
        return 0;
    }
    
    rep(hx, h){
        mid = hx;
        st.erase(hx);
        if(pairs(vector<pair<int, int>>(), st)){
            cout << "YES" << endl;
            return 0;
        }
        st.insert(hx);
    }
    cout << "NO" << endl;

}


Measured memory_bytes: 256
A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())
val1 = A + V*T
val2 = B + W*T
val3 = A - V*T
val4 = B - W*T
if A == B:
    print('YES')
elif A > B:
    if val3 <= val4:
        print('YES')
    else:
        print('NO')
elif A < B:
    if val1 >= val2:
        print('YES')
    else:
        print('NO')


Measured memory_bytes: 9196
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#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 repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1e9;
const long long LINF = 1LL << 50;
#define int long long
map<int, int>mp;
int cnt[1009];
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	for (int i = 2; i <= n; i++) {
		int tmp = i;
		for (int j = 2; tmp > 1; j++) {
			while (tmp % j == 0) {
				cnt[j]++;
				tmp /= j;
			}
		}
	}
	long long ans = 1;
	for (int i = 1; i <= n; i++) {
		ans = ans * (cnt[i] + 1) % MOD;
	}
	cout << ans << endl;
	return 0;
}


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

int main()
{
  int n,a,b;
  cin>>n>>a>>b;
  int x,y;
  x=a*n;
  y=b;
  if(x>y){
    x=y;
  }
  cout<<x<<endl;
  return 0;
}


Measured memory_bytes: 256
n=int(input())
p=list(map(int,input().split()))
count=0
for i in range(1,n-1):
	if (p[i]>p[i-1] and p[i]<p[i+1]) or (p[i]<p[i-1] and p[i]>p[i+1]):
		count+=1
print('{}'.format(count))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;


int main(){
    ll a, b, c;
    cin >> a >> b >> c;
    if (a + b >= c) cout << b + c << endl;
    else cout << a + b + b + 1 << endl;
    return 0;
}


Measured memory_bytes: 256
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, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

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

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

fn main() {
    input!{
        n: usize,
        k: usize,
    }
    println!("{}", if (n + 1) / 2 >= k {"YES"} else {"NO"});
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
	int n, a, b, c, d, e;
	cin >> n >> a >> b >> c >> d >> e;

	int m = min({a, b, c, d, e});

	int cnt = 4;

	if (n <= m) {
		cnt += 1;
	}
	else {
		cnt += n / m + (bool)(n % m);
	}

	cout << cnt << endl;
}


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

int main(void)
{
    int N, x;
    cin >> N >> x;

    int ans;
    if (N == 1)
    {
        ans = 1;
    }
    else if (N == 2)
    {
        if (x == 1)
            ans = 2;
        else
            ans = 1;
    }
    else
    {
        ans = N - x + 1;
    }
    cout << ans << endl;
    return (0);
}

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

using namespace std;

typedef long long int ll;
#define pb push_back


vector< vector<int> > gr;


int dp[1000005];
int vis[1000005];


int n,m;


int find(int u)
{
	if(dp[u]!=-1) return dp[u];

	int mx=0;

	for(int i=0;i<gr[u].size();i++)
	{
		mx=max(1+find(gr[u][i]),mx);
	}
	return dp[u]=mx;
}

class Graph 
{ 
    int V;    // No. of vertices 
    list<int> *adj;    // Pointer to an array containing adjacency lists 
    bool isCyclicUtil(int v, bool visited[], bool *rs);  // used by isCyclic() 
public: 
    Graph(int V);   // Constructor 
    void addEdge(int v, int w);   // to add an edge to graph 
    bool isCyclic();    // returns true if there is a cycle in this graph 
}; 
  
Graph::Graph(int V) 
{ 
    this->V = V; 
    adj = new list<int>[V]; 
} 
  
void Graph::addEdge(int v, int w) 
{ 
    adj[v].push_back(w); // Add w to v’s list. 
} 
  
// This function is a variation of DFSUtil() in https://www.geeksforgeeks.org/archives/18212 
bool Graph::isCyclicUtil(int v, bool visited[], bool *recStack) 
{ 
    if(visited[v] == false) 
    { 
        // Mark the current node as visited and part of recursion stack 
        visited[v] = true; 
        recStack[v] = true; 
  
        // Recur for all the vertices adjacent to this vertex 
        list<int>::iterator i; 
        for(i = adj[v].begin(); i != adj[v].end(); ++i) 
        { 
            if ( !visited[*i] && isCyclicUtil(*i, visited, recStack) ) 
                return true; 
            else if (recStack[*i]) 
                return true; 
        } 
  
    } 
    recStack[v] = false;  // remove the vertex from recursion stack 
    return false; 
} 
  
// Returns true if the graph contains a cycle, else false. 
// This function is a variation of DFS() in https://www.geeksforgeeks.org/archives/18212 
bool Graph::isCyclic() 
{ 
    // Mark all the vertices as not visited and not part of recursion 
    // stack 
    bool *visited = new bool[V]; 
    bool *recStack = new bool[V]; 
    for(int i = 0; i < V; i++) 
    { 
        visited[i] = false; 
        recStack[i] = false; 
    } 
  
    // Call the recursive helper function to detect cycle in different 
    // DFS trees 
    for(int i = 0; i < V; i++) 
        if (isCyclicUtil(i, visited, recStack)) 
            return true; 
  
    return false; 
}


int main()
{

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

	
	memset(dp,-1,sizeof(dp));

	cin>>n;

	Graph g(n*n);

	for(int i=0;i<=n*n;i++)
	{
		vector<int> v;
		gr.pb(v);
	}

	int l,r,now,l1,r1;


	for(int i=0;i<n;i++)
	{
		cin>>r;
		l=i;
		r--;
		l1=min(l,r);
		r1=max(l,r);
		now=n*l1+r1;
		for(int j=1;j<n-1;j++)
		{
			cin>>r;
			l=i;r--;
			l1=min(l,r);
			r1=max(l,r);
			gr[now].pb(n*l1+r1);
			g.addEdge(now,n*l1+r1);
			now=n*l1+r1;
		}
	}

	n*=n;

	memset(vis,0,sizeof(vis));

	if(g.isCyclic())
	{
		cout<<-1<<'\n';
		return 0;
	}


	
	for(int i=1;i<=n;i++)
	{
		int tt=find(i);
	}
	
	int mx=0;

	for(int i=1;i<=n;i++) mx=max(mx,dp[i]);

	cout<<mx+1<<'\n';
	return 0; 
}











Measured memory_bytes: 96612
import sys
N=int(input())
H=list(map(int,input().split()))
H.insert(0,0)
for i in range(N):
  if(H[i+1]<H[i]):
    print("No")
    sys.exit()
  if(H[i+1]>H[i]):
    H[i+1]-=1
print("Yes")

Measured memory_bytes: 14276
N,M,Q = [int(x) for x in input().split()]
ll = [[0] * (N+1) for i in range(N+1)]
for i in range(M):
    l,r = [int(x) for x in input().split()]
    ll[l][r] += 1
for i in range(1,N+1):
    for j in range(1,N+1):
        ll[i][j] += ll[i-1][j]
for i in range(Q):
    ans = 0
    p,q = [int(x) for x in input().split()]
    for i in range(p,q+1):
        ans += ll[q][i]-ll[p-1][i]
    print(ans)

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

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int N, M, Q;
int L[220000], R[220000];
int p[110000], q[110000];
vector<int> ed[550];

signed main() {
    cin >> N >> M >> Q;
    for (int i = 0; i < M; i++) {
        cin >> L[i] >> R[i];
    }
    for (int i = 0; i < Q; i++) {
        cin >> p[i] >> q[i];
    }
    for (int i = 0; i < M; i++) {
        ed[L[i]].push_back(R[i]);
    }
    for (int i = 1; i <= N; i++) {
        sort(ed[i].begin(), ed[i].end());
    }
    for (int i = 0; i < Q; i++) {
        int ans = 0;
        for (int j = p[i]; j <= q[i]; j++) {
            ans += lower_bound(ed[j].begin(), ed[j].end(), q[i] + 1) - ed[j].begin();
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 10112
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B;
  cin >> A >> B;
  bool b = true;
  for(int i = 0; i <= 1000; i++) {
    if(i * 0.08 - A >= 0 && i * 0.08 - A < 1 && i * 0.1 - B >= 0 && i * 0.1 - B < 1) {
      cout << i << endl;
      b = false;
      break;
    }
  }
  if(b) {
    cout << -1 << endl;
  }
}

Measured memory_bytes: 3588
#include<iostream>

using namespace std;

int main() {
	int ar[32] = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
	int K;
	cin >> K;
	cout << ar[K - 1] << endl;
	return 0;
}

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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const int INF = 1e9;

int main(void){

	int N; cin >> N;
	vector<int> a(N);
	REP(i,N) cin >> a[i];

	int t = 1;
	int ans = 0;
	REP(i,N){
		if(a[i] == t) t++;
		else ans++;
	}

	if(ans == N) ans = -1;
	
	cout << ans << endl;


	return 0;

}


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

int main() {
	while(1){
		int n,x;
		cin>>n>>x;
		if(n==0 && x==0){
			break;
		}
		int count=0;
		for(int i=1; i<=n;i++){
			for(int j=i+1; j<=n;j++){
				for(int k=j+1; k<=n; k++){
					if(i+j+k==x){
						count++;
					}
				}
			}
		}
		cout << count <<endl;
	}
	return 0;
}


Measured memory_bytes: 3092