akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;
 
const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const double PI = 3.1415926535;
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;
 
const int MAX = 1000000;
const int MOD = 1000000007;
 
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }
 
int main(){
  int n;
  cin >> n;
  priority_queue<int>que;
  que.push(1);
  rep(i, 2, n){
    int p = i;
    p*= i;
    while(p<=1000){
      que.push(p);
      p*= i;
    }
  }
  while(true){
    int q = que.top();
    que.pop();
    if(q>n)continue;
    else{
      cout << q << endl;
      return 0;
    }
  }
}

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

#define int long long

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N, M;
    cin >> N >> M;
    int x = 1900 * M + 100 * (N - M);
    int p_inv = 1;
    for (int i = 0; i < M; i++) {
        p_inv *= 2;
    }
    int ans = p_inv * x; 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
using namespace std;
 
 
template<class T> bool chmin(T& a, T b){
    if(a > b){
        a = b;
        return true;
    }
    return false;
}

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

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

    vector<vector<long long>> a(N+1, vector<long long>(3, 0));
    vector<vector<long long>> dp(N+1, vector<long long>(3, 0));

    for(int i = 0; i < N; i++){
        cin >> a[i][0];
        cin >> a[i][1];
        cin >> a[i][2];
    }

    for(int i = 0; i < N; i++){
        for(int j = 0; j < 3; j++){
            for(int k = 0; k < 3; k++){
                if(j != k){
                    chmax(dp[i+1][j], dp[i][k] + a[i][j]);
                }
            }
        }
    }

    long long ans = 0;
    chmax(ans, dp[N][0]);
    chmax(ans, dp[N][1]);
    chmax(ans, dp[N][2]);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
const int mod = 1000000007;
ll modpow(ll a, int b) { return b ? modpow(a * a % mod, b / 2) * (b % 2 ? a : 1) % mod : 1; }
template<class T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i, sz(v)) { if (i) os << " "; os << v[i]; } return os; }
template<class T, class U> ostream& operator<<(ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
inline int add(int a, int b) { a += b; if (a >= mod) return a - mod; return a; }

void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}

// editorial

void solve() {
  int n, m, k;
  cin >> n >> m >> k;
  rep(i, n + 1) rep(j, m + 1) {
    int x = i * (m - j) + (n - i) * j;
    if (x == k) {
      cout << "Yes" << endl;
      return;
    }
  }
  cout << "No" << endl;
}


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

#define int long long

using namespace std;

const int mod = 998244353;
int f[400001];
int inv[400001];
int n, a, b, k;
int ans;

int bp (int a, int b) {
	int res = 1;
	while (b) {
		if (b & 1) res = (res * a) % mod;
		b >>= 1;
		a = (a * a) % mod;
	}
	return res;
}

int C (int n, int k) {
	if (k > n) return 0;
	return (f[n] * ((inv[k] * inv[n - k]) % mod)) % mod;
}

int calc (int x, int y) {
	int fi = C (n, x);
	int se = C (n, y);
	return (fi * se) % mod;
}

 main () {   
 	cin >> n >> a >> b >> k;
 	inv[0] = 1;
 	f[0] = 1;
 	for (int i = 1;i <= n;i ++) {
 		f[i] = (f[i - 1] * i) % mod;
 		inv[i] = bp (f[i], mod - 2);
 	}
 	for (int i = 0;i <= n;i ++) {
 		int fi = a * i;
 		int need = k - fi;
 		if (need < 0 || need % b != 0) continue;
		int j = need / b;
		ans = (ans + calc (i, j)) % mod;	
 	}
 	cout << ans;
    return 0;           		
}

Measured memory_bytes: 6400
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <cstring>

using namespace std;

typedef long long LL;
typedef vector<LL> VL;
typedef vector<vector<LL>> VVL;
typedef vector<string> VS;

#define REPD(i,a,b) for (LL i=(a);i<(b);i++)
#define REP(i,n) REPD(i,0,n)

LL llRead(){
  LL a;
  cin >> a;
  return a;
};

string stringRead(){
  string a;
  cin >> a;
  return a;
};

vector<LL> vlRead(LL a){
  vector<LL> rv;
  REP(i, a){
    LL input;
    cin >> input;
    rv.push_back(input);
  }
  return rv;
}

vector<string> vsRead(LL a){
  vector<string> rv;
  REP(i, a){
    string input;
    cin >> input;
    rv.push_back(input);
  }
  return rv;
}
vector<vector<LL>> vvlRead(LL a, LL b){
  vector<vector<LL>> rv;
  REP(i, a){
    rv.push_back(vector<LL>());
    REP(j, b) {
      LL input;
      cin >> input;
      rv.at(i).push_back(input);
    }
  }
  return rv;
}

#if 1
#define debug(d) debug1(__LINE__,#d, d)
void debug1(LL line, const char* name, VL& v) {
  cout << line << ":" << name << ":vector<LL>(" << v.size() << ") ";
  REP(i, (LL)v.size()) {
    cout << v.at(i) << " ";
  }
  cout << endl;
}
void debug1(LL line, const char* name, LL i) {
  cout << line << ":" << name << ":LL " << i << endl;;
}
void debug1(LL line, const char* name, VS& v) {
  cout << line << ":" << name << ":vector<string>(" << v.size() << ") ";
  REP(i, (LL)v.size()) {
    cout << v.at(i) << " ";
  }
  cout << endl;
}
void debug1(LL line, const char* name, VVL& v) {
  cout << line << ":" << name << ":vector<vector<LL>>(" << v.size() << ") ";
  REP(i, (LL)v.size()) {
    REP(j, (LL)v.at(i).size()) {
      cout << v.at(i).at(j) << " ";
    }
    cout << ", ";
  }
  cout << endl;
}
void debug1(LL line, const char* name, char* s) {
  cout << line << ":" << name << ":char* " << s << endl;;
}
void debug1(LL line, const char* name, vector<const char*>& v) {
  cout << line << ":" << name << ":vector<const char*>(" << v.size() << ") ";
  REP(i, (LL)v.size()) {
    cout << v.at(i) << " ";
  }
  cout << endl;
}
void debug1(LL line, const char* name, priority_queue<LL>& p) {
  cout << line << ":" << name << ":priority_queue<LL>(" << p.size() << ") ";
  priority_queue<LL> copy = p;
  while(!copy.empty()) {
    cout << copy.top() << " ";
    copy.pop();
  }
  cout << endl;
}
#else
#define debug(n)
#endif

int main(int argc, const char * argv[]) {
	cout.precision(16);
  // source code

  auto a = llRead();
  auto b = llRead();
  if (a > 9 || b > 9) cout << "-1" << endl;
  else cout << a * b << endl;


  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <set>
#include <numeric>
#include <map>
#include <iomanip>
#include <climits>
#include <string>

using namespace std;


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

	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a.begin(), a.end());
	double ans = a[0];
	for (int i = 1; i < n; i++)
		ans = (ans + a[i]) / 2.0;
	cout << ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define f(i,a,b) for(long long i=a;i<b;i++)
#define Find find_by_order
#define Order order_of_key
#define F first
#define S second
#define pb(i) push_back(i)
#define mp(x,y) make_pair(x,y)
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
using namespace std;

int main(){
	ll p=ll('Z');
	ll n;cin>>n;
	string s,s1="";cin>>s;
	f(i,0,s.size()){
		ll tem=s[i]+n;
		if(tem>p){
			tem=tem%p;
			s[i]=char(tem+'A'-1);
		}
		else{
			s[i]=char(tem);
		}
	}
	cout<<s<<"\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
typedef long long int lint;
using namespace std;

//セグメント木
// ref:https://ei1333.github.io/luzhiled/snippets/structure/segment-tree.html
template <typename Mnd>
struct segment_tree {
    int sz;
    vector<Mnd> data;
    function<Mnd(Mnd, Mnd)> f;
    Mnd e;
    //サイズだけ指定して初期化
    segment_tree(int _sz, function<Mnd(Mnd, Mnd)> _f, Mnd _e) : f(_f), e(_e) {
        sz = 1;
        while (sz < _sz) sz <<= 1;
        data.assign(sz * 2, e);
    }
    //参照渡しなので代入とかもできる
    Mnd& operator[](const int& k) {
        return data[k + sz];
    }
    //木を構築 O(n)
    void build() {
        for (int i = sz - 1; i > 0; i--)
            data[i] = f(data[2 * i], data[2 * i + 1]);
    }
    //更新しつつ木を再構築 O(log n)
    void update(int k, Mnd x) {
        data[k += sz] = x;
        while (k >>= 1) data[k] = f(data[2 * k], data[2 * k + 1]);
    }
    //[a,b)でのクエリに答える　O(log n)
    Mnd query(int a, int b) const {
        Mnd l = e, r = e;
        for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
            if (a & 1) l = f(l, data[a++]);
            if (b & 1) r = f(r, data[--b]);
        }
        return f(l, r);
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    segment_tree<int> rsq(
        n, [](int a, int b) { return a + b; }, 0);
    for (int i = 0; i < q; i++) {
        int com, x, y;
        cin >> com >> x >> y;
        if (com) {
            x--, y--;
            cout << rsq.query(x, y + 1) << endl;
        } else {
            x--;
            rsq.update(x, rsq[x] + y);
        }
    }
}


Measured memory_bytes: 3836
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k,index=1,sum=1,ans=0;
    cin>>n>>k;
    ll a[n],num[n+1];
    for(int i=0;i<=n;i++)num[i]=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    for(int i=1;i<n;i++){
        if(a[i]==a[i-1]){
            index++;
        }
        else{
            num[index]++;
            index=1;
            sum++;
        }
    }
    num[index]++;
    int maki=(sum-k);
    if(maki<=0){
        cout << 0<<endl;
        return 0;
    }
    for(int i=1;i<=n;i++){
        if(num[i]>=maki){
            ans+=maki*i;
            cout << ans<<endl;
            return 0;
        }
        else{
            maki-=num[i];
            ans+=i*num[i];
        }
    }
    return 0;
}



Measured memory_bytes: 3328
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define endl "\n"
#define ll long long
#define pb emplace_back
#define fi first
#define se second
#define pll pair<ll, ll>
#define ull unsigned long long
#define ld long double

#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=n-1; i>=0; i--)
#define repa(i,a,b) for(ll i=(a);i<=(b);i++)
#define all(x) (x).begin(), (x).end()
#define ordered_set tree<int , null_type, less<int> , rb_tree_tag, tree_order_statistics_node_update>
/*
 Ordered set docs:
 order_of_key (k) : Number of items strictly smaller than k .
 find_by_order(k) : K-th element in a set (counting from zero).
*/
#define blc boost::lexical_cast<long long>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using namespace __gnu_pbds;
const int MOD = 1e9+7;

ll add(ll x, ll y) {ll res=x+y; return(res>=MOD?res-MOD:res);}

ll sub(ll x, ll y) {ll res=x-y; return(res<0?res+MOD:res);}

ll lcm(ll x, ll y) {ll res=(x*y)/__gcd(x,y); return res;}

ll powerLL(ll x, ll n, ll mod) 
{ 
    ll result = 1; 
    while (n) { if (n & 1) result = (result%mod * x%mod) % mod; n = n / 2; x = (x%mod * x%mod) % mod; } return result; 
} 

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve()
{
    ll n, k;
    cin>>n;
    ll res;
    res = 8-((n-400)/200);
    cout<<res<<endl;
}
int32_t main()
{
    fast;
    int t;
    t=1;
    //cin>>t;
    while(t--)
        solve();
    return 0; 
}

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

using namespace std;
#define _USE_MATH_DEFINES_
#define ll long long
#define ld long double
#define Accepted 0
#define pb push_back
#define mp make_pair
#define sz(x) (int)(x.size())
#define every(x) x.begin(),x.end()
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define For(i,x,y)  for (ll i = x; i <= y; i ++) 
#define FOr(i,x,y)  for (ll i = x; i >= y; i --)
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
// ROAD to...                                                                                                                                                                                                                Red

inline void Input_Output () {
	//freopen(".in", "r", stdin);
   //freopen(".out", "w", stdout);
}

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 6e5 + 123;                                          
const int M = 22;
const int pri = 997;
const int Magic = 2101;

const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
 
int n, m, k;
int a[300] = {300000, 200000, 100000};



int main () {
   SpeedForce;
	cin >> n >> m;
	n--;
	m--;
	int res = 0;
	if (n == 0 && m == 0)
		res += 400000;
	res += a[n];
	res += a[m];
	cout << res << '\n';
   return Accepted;
}

// B...a

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

using namespace std;

int main()
{
	int A, B, C;
	cin >> A >> B >> C;

	int diff1 = A - B;

	if (diff1 >= C) {
		cout << 0 << endl;
	}
	else {
		cout << C - diff1 << endl;
	}
}


Measured memory_bytes: 3620
n = input()

if n[-1] == "2" or n[-1] == "4" or n[-1] == "5" or n[-1] == "7" or n[-1] == "9":
	print("hon")
elif n[-1] == "0" or n[-1] == "1" or n[-1] == "6" or n[-1] == "8":
	print("pon")
elif n[-1] == "3":
  	print("bon")

Measured memory_bytes: 61828
#include<bits/stdc++.h>
 
#define ll long long int
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f
#define show(x) cerr<<#x<<" : "<<x<<'\n';
#define yogeshk972() cerr<<"\nTime Taken : "<<(float)(clock()-time_p)/CLOCKS_PER_SEC<<"\n";
clock_t time_p=clock();

using namespace std;
const int N=1e6+1, mod= 1e9+7;

signed main(){
	ios_base::sync_with_stdio(0);	cin.tie(0);
	string s;
	cin>>s;
	
	int cur=0;
	ll sum=0;
	int last=-1;
	vector<int> a(s.length()+1);
	a[0]=0;
	
	for(int i=1;i<=(int)s.length();i++){
		if(s[i-1]=='<'){
			++cur;
			a[i]=cur;
			sum+=cur;
			last=i;
		}else{
			if( last==-1 ){
				sum+=i;
			}else if( a[last] < i-last ){
				sum+=i-last;
			}else{
				sum+=i-last-1;
			}
			cur=0;
		}
	}
	
	cout<<sum;
	
    yogeshk972();
}


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

int main()
{
    int n,m;
    cin >> n >> m;
    int h[n+1];
    int a[m+1];
    int b[m+1];
    for( int i = 1; i<=n; i++) cin >> h[i];
    for( int i = 1; i<=m; i++){
         cin >> a[i]>> b[i];
        }
    int maxx[n+1]={0};
    for( int i = 1; i<m+1; i++ )
    {
        maxx[a[i]] = max( maxx[a[i]], h[b[i]]);
        maxx[b[i]] = max( maxx[b[i]], h[a[i]]);
    }

    int ans = 0;
    for( int i = 1; i<n+1; i++ ){
        if( h[i] > maxx[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5196
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;
using static System.Console;

namespace A_ABC128
{
    class MainClass
    {

        static int[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
           WriteLine((s[0]*3+s[1])/2);
           


        }
    }
}


Measured memory_bytes: 13268
#include<iostream>
#include<algorithm>
#include<string>
#include<functional>
#include<utility>
#include<stack>
#include<queue>
#include<cmath>
#include<list>
#include<cstdint>
#include<vector>
#include<map>
#define rep(i,rept)	for(ll i = 0; i<rept;i++)
typedef long long ll;
const ll MOD = 1e9 + 7;
using namespace std;

int main() {
	//三日目
	ll n = 0, k = 0;
	ll a = 0, b = 0;
	ll imadoko = 0, f = 0;
	map<ll, ll> ab;
	vector<ll> type;
	cin >> n >> k;
	rep(i, n) {
		cin >> a >> b;
		if (ab[a] == 0) {
			type.push_back(a);
		}
		ab[a] += b;	
	}
	sort(type.begin(), type.end());
	while (imadoko < k) {
		imadoko += ab[type[f]];
		f++;
	}
	cout << type[f-1] << endl;
	return 0;
}

Measured memory_bytes: 4728
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
int main() {
    ll n;
    cin >> n;
    ll ans=n;
    for(ll i=0;i<=n;i++){
        ll x=0,t=i;
        while(t>0){
            x+=t%6;
            t/=6;
        }
        t=n-i;
        while(t>0){
            x+=t%9;
            t/=9;
        }
        ans=min(ans,x);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

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

    string S;
    cin >> S;
    bool isok = true;
    for (int i = 0; i < S.length(); i += 2) {
        if (S[i] != 'h' || S[i + 1] != 'i') {
            isok = false;
            break;
        }
    }

    cout << (isok ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 764
import java.util.Scanner

import scala.io.StdIn._
object Main extends App {

  val n = scala.io.StdIn.readInt()
  val A = scala.io.StdIn.readLine().split(" ").map(BigInt(_))

  def solve(): BigInt = {
    val limit = BigInt(1000000000000000000L)

    if(A.contains(0)) return 0
    A.foldLeft(BigInt(1)) { (acc, num) =>
      if(acc * num > limit) return BigInt(-1)
      else acc * num
    }
  }

  println(solve())

}



Measured memory_bytes: 79044
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=readln.splitter;foreach(ref v;t){v=r.front.to!T;r.popFront;}}

void main()
{
  int n; readV(n);
  int[] x; readA(n, x);

  auto y = x.dup.sort();
  foreach (i; 0..n)
    writeln(x[i] <= y[n/2-1] ? y[n/2] : y[n/2-1]);
}


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

using namespace std;

int main()

{
    int n,temp,j,mini;
    scanf("%d",&n);
    int ara[n];
    for(int i=0;i<n;i++)
    {
        scanf("%d",&ara[i]);
    }
    int cnt=0;
    for(int i=0;i<n;i++)
    {
        mini=i;
        j=i-1;
       for(int j=i+1;j<n;j++)
       {
           if(ara[j]<ara[mini])
           {
               mini=j;
           }
       }
       if(i!=mini)
       {
           swap(ara[i],ara[mini]);
           cnt++;
       }
    }
    for(int i=0;i<n;i++)
    {
        printf("%d",ara[i]);
        if(i!=n-1)printf(" ");
    }
    cout<<endl<<cnt<<endl;



}

Measured memory_bytes: 3304
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
 
typedef long long ll;
typedef vector<int> vi;
typedef unsigned long ul;
typedef vector<ll> vl;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef set<int> si;
typedef multiset<int> mi;
 
const ll INF = 1e18;
const int MOD = 1e9+7;
 
int main() {
	
	cin.tie(NULL);
	ios_base::sync_with_stdio(false);
	
	//ofstream cout ("fileName.out");
	//ifstream cin ("fileName.in");
	
	int N;
	cin>>N;
	
	int bills=ceil(double(N)/1000);
	cout<<bills*1000-N<<"\n";
 	
	return 0;
}


Measured memory_bytes: 3608
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <ctime>
#include <cstring>
#define ll long long
#define INF 1000000000
#define For(i,a,b) for(int i=a;i<=b;++i)
#define Rev(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define pq priority_queue
#define PI acos(-1)

namespace IO
{
#define p(x) ('0'<=x&&x<='9')
	char cc; int C;
	template <class T>
	void read( T &x )
	{
		x=0; cc=getchar(); C=1;
		while(!p(cc)) { if(cc=='-') C=-1; cc=getchar(); }
		while(p(cc)) { x=x*10+cc-48; cc=getchar(); }
		x*=C;
	}
#undef p
}

using namespace IO;
using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	srand(time(0));
#ifdef LOCAL
	freopen("./tmp/input.txt", "r", stdin);
#endif

	int n;
	read(n);
	printf("%d\n",(n>>1)*((n>>1)+(n&1)));


	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> P;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REPR(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define FOR(i, n, m) for (ll i = (n); i < (m); ++i)
#define FORR(i, n, m) for (ll i = (m) - 1; i >= (n); --i) 
#define FORE(x, xs) for (auto &x: (xs))
#define ALL(v) v.begin(), v.end()
#define ZERO(a) memset(a,0,sizeof(a))

const int INF = 1000000009;
const int MOD = 1000000007;
const double EPS = 1e-14;
const double PI = acos(-1);

const int MAX = 2e5+10;

int N;
string S;
int cnt[MAX];

int main() {
    cin >> N >> S;
    REP (i, N) {
        if (S[i] == '#') cnt[i]++;
        cnt[i+1] = cnt[i];
    }
    int ans = N - cnt[N]; // all black
    REP (i, N) {
        int n = cnt[i]; // w -> b
        int m = N-i-1 - (cnt[N]-cnt[i]);
        ans = min(ans, n + m);
    }
    cout << ans << endl;
}

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

#define fast                     ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int                      long long 
#define pb                       push_back
#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 l                        first
#define r                        second
#define sz(x)                    (int)x.size()
#define endl                     '\n'
#define MOD                      1000000007
#define loop(i,a,b)              for(int (i)=(a);(i)<(b);(i)++)
#define rloop(i,a,b)             for(int (i)=(a);(i)>=(b);(i)--)
#define Unique(A)                (A).resize(distance((A).begin(),unique(all((A)))))
#define MXe(A)                   *max_element(all(A))
#define MNe(A)                   *min_element(all(A))
#define SP(val,precision)        fixed << setprecision((precision)) << (val)
#define setBits(x)               __builtin_popcountll(x)
#define zroBits(x)               __builtin_ctzll(x)
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define mem(name,val)            memset(name,val,sizeof(name))
#define traceA(A,x)              cerr<<#A<<": ";loop(i,0,x)cerr<<A[i]<<' ';cerr<<endl
#define traceV(A)                cerr<<#A<<": ";for(auto i:A)cerr<<i<<' ';cerr<<endl
#define maxheap                  priority_queue<int>
#define minheap                  priority_queue<int,vector<int>,greater<int>>

using namespace std;

const int N = 2e5+77;
int A[N];

long double Dis(int a ,int b){
    return sqrt(a*a*1.0 + b*b*1.0);
}

int32_t main(){
    int n , d; cin >> n >> d;
    int ans = 0;
    loop(i,0,n){
        int a , b ; cin >> a >> b ;
        long double x = Dis(a,b);
        if(x<=d) ans++;
    }
    cout << ans << endl;
    return 0;
}

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


int main() {
    vector<int> a(9);

    rep(i, 9) cin >> a[i];

    int n;
    cin >> n;
    vector<int> b(n);
    rep(i, n) cin >> b[i];

    vector<vector<int>> rmap = {{0,0,0},{0,0,0},{0,0,0}};

    rep(i, n){
        rep(j, 9){
            if(b[i] == a[j]){
                rmap[j/3][j%3] = 1;
                break;
            }
        }
    }

    //行に関して確認
    int result = 0;
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            if(rmap[i][j] == 1){
                result++;
            }
        }
        if(result == 3){
            cout << "Yes" << endl;
            return 0;
        }
        result = 0;
    }

    //列に関して確認
    result = 0;
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            if(rmap[j][i] == 1){
                result++;
            }
        }
        if(result == 3){
            cout << "Yes" << endl;
            return 0;
        }
        result = 0;
    }

    //斜めに関して確認
    if(rmap[0][0] == 1 && rmap[1][1] == 1 && rmap[2][2] == 1){
        cout << "Yes" << endl;
        return 0;
    }
    if(rmap[0][2] == 1 && rmap[1][1] == 1 && rmap[2][0] == 1){
        cout << "Yes" << endl;
        return 0;
    }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
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;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}
 
void solve() {
    int n;
    cin >> n;
    vector<ll> a(n);
    REP(i, n) cin >> a[i];
    sort(ALL(a));

    ll ans = 0;
    while (a[n - 1] >= n) {
        ll c = (a[n - 1] - n) / n + 1;
        ans += c;
        a[n - 1] -= n * c;
        REP(i, n - 1) a[i] += c;
        sort(ALL(a));
    }
    cout << ans << EOL;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long a[3];
    for(int i=0;i<3;i++)
    {
        cin>>a[i];
    }
    if((a[2]>=a[1]&&a[2]<=a[0])||(a[2]>=a[0]&&a[2]<=a[1]))
    {
        cout<<"Yes\n";
    }
    else
        cout<<"No\n";
}


Measured memory_bytes: 256
# input
N, M, K = map(int, input().split())

Friends = [set() for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    Friends[a].add(b)
    Friends[b].add(a)

Blocked = [set() for _ in range(N)]
for _ in range(K):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    Blocked[c].add(d)
    Blocked[d].add(c)

# process
# 友人グループを作成
checked = set()
ans = [0]*N

for i in range (N):
    if i in checked:
        continue
    
    fg = set()

    stack = list(Friends[i])
    while stack:
        f = stack.pop()
        if f in checked:
            continue

        checked.add(f)
        fg.add(f)
        stack.extend(Friends[f])

    for f in fg:
        ans[f] += len(fg)-1-len(fg&(Friends[f]|Blocked[f]))

# output
print(" ".join(map(str, ans)))


Measured memory_bytes: 87824
import scala.io.StdIn

object Main extends App {

  case class Dice(su1: Int, su2: Int, su3: Int, su4: Int, su5: Int, su6: Int){
    private val nums = Map(1 -> su1, 2 -> su2, 3 -> su3, 4 -> su4, 5 -> su5, 6 -> su6)
    def currentTop(): Int = nums(1)
    
    def roll(d: Char): Dice = d match {
        case 'N' => Dice(su2, su6, su3, su4, su1, su5)
        case 'S' => Dice(su5, su1, su3, su4, su6, su2)
        case 'W' => Dice(su3, su2, su6, su1, su5, su4)
        case 'E' => Dice(su4, su2, su1, su6, su5, su3)
    }
    
  }
  
  val nums = StdIn.readLine().split(' ').map(_.toInt)
  var dice1 = Dice(nums(0), nums(1), nums(2), nums(3), nums(4), nums(5))

  val direction = StdIn.readLine()
  direction.foreach{ d =>
    dice1 = dice1.roll(d)
  } 
  
  println(dice1.currentTop())
  
}


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

int main() {
	ll N,W,b,w,v,rr=0;
	cin >> N >> W;
	vector<vector<ll>> x(4, vector<ll>());

	cin >> w >> v;
	b=w, x.at(0).push_back(v);

	rep(i,N-1) {
		cin >> w >> v;
		x.at(w-b).push_back(v);
	}

	rep(i,4) {
		x.at(i).push_back(0);
		sort(x.at(i).begin(), x.at(i).end(), greater<ll>());
		rep(j,x.at(i).size()-1) {
			x.at(i).at(j+1) += x.at(i).at(j);
		}
	}

	// rep(i,4) {
	// 	rep(j,x.at(i).size())
	// 		cout << x.at(i).at(j) << " ";
	// 	cout << endl;
	// }

	rep(i,x.at(0).size())
		rep(j,x.at(1).size())
			rep(k,x.at(2).size())
				rep(l,x.at(3).size()) {
					ll t = i*b+j*(b+1)+k*(b+2)+l*(b+3), r=0;
					if(t > W)
						continue;

					if(i != 0)
						r += x.at(0).at(i-1);
					if(j != 0)
						r += x.at(1).at(j-1);
					if(k != 0)
						r += x.at(2).at(k-1);
					if(l != 0)
						r += x.at(3).at(l-1);

					rr = max(rr, r);
				}

	cout << rr << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define MOD 1000000007

char s[3010];
ll dp[3010][3010];//dp[i][j]=(i番目まで決めて、i番目より大きいものがj個残っている)

int main(){
	ll n;
	scanf("%lld %s",&n,s);
	rep(j,0,n)dp[1][j]=1;
	rep(i,1,n){
		ll temp[3010]={};
		if(s[i-1]=='<'){
			//大きいものから使うので、jは減る
			//配るDP
			//rep(j,0,n-i+1)rep(k,0,j)dp[i+1][k]=(dp[i+1][k]+dp[i][j])%MOD;
			rep(j,0,n-i+1)temp[0]+=dp[i][j],temp[j]-=dp[i][j];
		}else{
			//小さいものから使うので、jは増える
			//配るDP
			//rep(j,0,n-i+1)rep(k,j,n-i+1)dp[i+1][k]=(dp[i+1][k]+dp[i][j])%MOD;
			rep(j,0,n-i+1)temp[j]+=dp[i][j],temp[n-i+1]-=dp[i][j];
		}
		dp[i+1][0]=temp[0];
		rep(j,0,n-i+1)dp[i+1][j+1]=(dp[i+1][j]+temp[j+1])%MOD;
	}
	printf("%lld\n",(dp[n][0]+MOD)%MOD);
	return 0;
}

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

int main() {
  int N;
  string Ans="YES";
  cin>>N;
  vector<int> vec(N);
  rep(i,N){cin >> vec.at(i);}
  sort(vec.begin(),vec.end());
  rep(i,N-1){if(vec.at(i+1)==vec.at(i)){Ans="NO";break;}}
  cout<<Ans<<endl;
}

Measured memory_bytes: 3900
using System;
using System.Collections.Generic;
using System.Linq;


namespace AtCoder
{
    class Program
    {
        public static void Main()
        {
            new Program().Solve();
        }

        void Solve()
        {
            int n = int.Parse(Console.ReadLine());
            var cards = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            Array.Sort(cards);
            Array.Reverse(cards);
            int alice = 0;
            int bob = 0;
            for (int i = 0; i < cards.Length; i++)
            {
                if (i % 2 == 0)
                {
                    alice += cards[i];
                }
                else
                {
                    bob += cards[i];
                }
            }
            Console.WriteLine(alice - bob);

        }
    }
}


Measured memory_bytes: 13396
yymm = input()

if (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('AMBIGUOUS')
elif (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and int(yymm[2:4]) <= 99:
    print('MMYY')
elif int(yymm[0:2]) <= 99 and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('YYMM')
else:
    print('NA')

Measured memory_bytes: 9104
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
ll dp[2][100005];
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int n, z, w;
	cin >> n >> z >> w;
	int a[n];
	rep(i, n) cin >> a[i];
	int ans = abs(a[n - 1] - w);
	for (int i = n - 2; i >= 0; i--) {
		int now = abs(a[n - 1] - a[i]);
		for (int j = i + 1; j < n - 1; j++) now = min(now, abs(a[n - 1] - a[j]));
		ans = max(ans, now);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<bitset>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<set>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

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 int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
static const int N=114514;

#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)

long long INF=1e9;
const long long mod=2019;
#define ll long long

int main(){
  int d1,d10,ans=0;
  int m,d;
  cin>>m>>d;
  for(int i=22;i<=d;i++){
        d1=i%10;
        d10=i/10;
        for(int j=1;j<=m;j++){
          if(d1*d10==j&&d1>=2&&d10>=2){
            ans++;
          }
        }
  }
  cout<<ans<<endl;
  return 0;
}

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

// Loops
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define _rrep(i, n) rrepi(i, n, 0)
#define rrepi(i, a, b) for (int i = int(a) - 1; i >= int(b); --i)

#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__, rrepi, _rrep, )(__VA_ARGS__)
#define each(xi, x) for (auto &&xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)

// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi = vec<ll>;
using vvi = vec<vi>;
using vvvi = vec<vvi>;
using pii = pair<ll, ll>;

// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define mp make_pair

// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase(unique(all(v)), v.end())
#define perm(c)                                                                \
  sort(all(c));                                                                \
  for (bool c##p = 1; c##p; c##p = next_permutation(all(c)))

template <class T> pair<T, size_t> max(vector<T> &x) {
  auto it = max_element(all(x));
  return mp(*it, it - x.begin());
}
template <class T> pair<T, size_t> min(vector<T> &x) {
  auto it = min_element(all(x));
  return mp(*it, it - x.begin());
}

template <class T> inline bool chmax(T &maxval, const T &newval) {
  if (maxval < newval) {
    maxval = newval;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &minval, const T &newval) {
  if (minval > newval) {
    minval = newval;
    return 1;
  }
  return 0;
}

// Utilities
// Grid world utilities
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
#define inside(H, W, y, x) 0 <= (x) && (x) < (W) && 0 <= (y) && (y) < (H)

// Debug
#ifdef LOCAL
#include "dump.hpp"
#define debug(x) cerr << #x << ": " << x << '\n'
#else
#define dump(...)
#define debug(x)
#endif

// Yes or No
void yesno(bool ok, string yes = "Yes", string no = "No") {
  cout << (ok ? yes : no) << endl;
}

// Paste snippets here!!

//

void solve(long long a) {
  cout << a + a*a + a*a*a << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false); // Magic for faster cin
  cout.precision(12);
  long long a;
  std::cin >> a;
  solve(a);
  return 0;
}


Measured memory_bytes: 3580
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <limits>
#include <list>
#include <numeric>
#include <queue>
#include <stack>
#include <utility>
#include <array>
#include <random>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
using namespace std;
typedef long long ll;
#define dump(x) cerr << #x << " = " << (x) << " [" << __LINE__ << ":" << __FUNCTION__ << "] " << endl;
// vector出力
template < typename T >
ostream& operator<<(ostream& os, vector< T >& v) {
    os << "{";
    for (int i = 0; i < (int)v.size(); i++) {
        os << v[i] << (i < v.size() - 1 ? ", " : "");
    }
    os << "}";
    return os;
}
// pair出力
template < typename T, typename U >
ostream& operator<<(ostream& os, pair< T, U >& p) {
    return os << "(" << p.first << ", " << p.second << ")";
}
// map出力
template < typename T, typename U >
ostream& operator<<(ostream& os, map< T, U >& map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set 出力
template < typename T >
ostream& operator<<(ostream& os, set< T >& set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
#pragma endregion

/////////////////////////////////////////

int main() {
    int n;cin >> n;
    for (int i = 0; i < n; i++) {
        cout << "ACL";
    }
    cout << endl;
    return 0;
}

/////////////////////////////////////////

Measured memory_bytes: 3620
#include <iostream>

using namespace std;

int function(int x){
    if(x % 2 == 0)
        return x / 2;
    else
        return 3 * x + 1;
}

int main(void){
    int s;
    cin >> s;
    int retsu[10000];
    retsu[0] = s;
    int i = 0;
    int check;

    while(i != 10000){
        i++;
        check = retsu[i] = function(retsu[i-1]);
         //cout << retsu[i] << endl;
        for(int j = 0; j < i; j++){
            if(retsu[j] == check)
               goto out;
        }
    }
    out:
    cout << i+1 << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws FileNotFoundException {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int temp = sc.nextInt();
            if(temp==0) break;
            System.out.println(solve(temp));
        }
    }

    static int solve(int num){
        int ans=0;
        for(int i=num+1;i<=2*num;i++){
            if(primeChecker(i)) ans++;
        }
        return ans;
    }

    static boolean primeChecker(int num){
        for(int i=2;i<=Math.sqrt(num);i++){
            if(num%i==0) return false;
        }
        return true;
    }
}

Measured memory_bytes: 20060
#include <iostream>
#include <cstdio>

using namespace std;

int main(){
	
	string str;
	
	bool first;
	
	first = true;
	
	while(true){
		
		cin >> str;
		
		if(cin.eof()){
			cout << endl;
			break;
		}
		
		if(str[str.size() - 1] == '.' || str[str.size() - 1] == ','){
			if(str.size() >= 4 && str.size() <= 7){
				if(!first){
					cout << " ";
				}
				first = false;
				for(int i = 0; i < str.size() - 1; i++){
					cout << str[i];
				}
			}
		}else{
			if(str.size() >= 3 && str.size() <= 6){
				if(!first){
					cout << " ";
				}
				first = false;
				cout << str;
			}
		}
	}
	
	return 0;
}

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


int main() {
  int h,w;
  cin>>h>>w;
  rep(i,h){
    string c;
    cin>>c;
    cout<<c<<"\n"<<c<<"\n";
  }

  return 0;
}


Measured memory_bytes: 256
import scala.io.StdIn

object Main extends App {
  val a = StdIn.readLine().split(' ').map(_.toInt)
  
  val result = (0 to a(0)).foldLeft(0){ (acc ,i) =>
    val r = i.toString.foldLeft(0)( (acc, c) => Integer.parseInt(c.toString) + acc)
    acc + (if(a(1) <= r && r <= a(2)) i else 0)
  }
  
  println(result)
  
}

Measured memory_bytes: 33412
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define inf 1000000000000000
#define mod 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}

signed main() {
	int x,a;
	cin>>x>>a;
	if(x<a) cout<<0<<endl;
	else cout<<10<<endl;
	
	return 0;
}


Measured memory_bytes: 256
import itertools

n = int(input())
p_list = tuple(map(int,input().split()))	
q_list = tuple(map(int,input().split()))	

count=1
for i in itertools.permutations(range(1,n+1)):
    if i == p_list:
        num1 = count
    if i == q_list:
        num2 = count
    count += 1

if num1 - num2 <0:
    print (num2-num1)
else:
    print (num1-num2)

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
int main()
{
	int n;
	std::cin >> n;
	std::vector<int>a(n);
	for(auto&i : a)
	{
		std::cin >> i;
	}
	for(int i = n - 1; i >= 0; i -= 2)
	{
		if(i != n - 1)
		{
			std::cout << ' ';
		}
		std::cout << a[i];
	}
	for(int i = n % 2; i < n; i += 2)
	{
		std::cout << ' ' << a[i];
	}
	std::cout << std::endl;
	return 0;
}

Measured memory_bytes: 2944
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <functional>
#include <vector>
#include <queue>
#include <map>
#include <stack>
#include <string>

using namespace std;

typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)

ll const INF = 1000000000000000000;
int const I_MAX = 2147483647;
ll const MOD = 1e9 + 7;
int const POW_MAX = 1e5;

ll pow[POW_MAX + 2];

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

ll mod_inv (ll x) {
  return mod_pow(x, MOD - 2) % MOD;
}

ll comb(int n, int r) {
  return (((pow[n] * mod_inv(pow[r])) % MOD) * mod_inv(pow[n - r])) % MOD;
}

int const N_MAX = 1e5;

int N, M;
int X[N_MAX + 1];

int main() {
  scanf("%d %d", &N, &M);
  int min_x = 1e5;
  int max_x = -1e5;
  rep(i, M) {
    scanf("%d", &X[i]);
    min_x = min(min_x, X[i]);
    max_x = max(max_x, X[i]);
  }
  if (N >= M) {
    printf("0\n");
    return 0;
  }
  int d = max_x - min_x;
  sort(X, X + M, greater<int>());
  int ds[M];
  FOR(i, 1, M) {
    ds[i - 1] = X[i - 1] - X[i];
  }
  sort(ds, ds + M - 1, greater<int>());
  rep(i, N - 1) {
    d -= ds[i];
  }
  printf("%d\n", d);
}


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

int main()
{
	string buf;

	while( true ) {
		cin >> buf;
		if( buf == "-" ) {
			break;
		}

		int m = 0;
		cin >> m;
		
		int n = 0;
		for( int i = 0; i < m; i++ ) {
			cin >> n;
			buf = buf.substr( n ) + buf.substr( 0, n );
		}
		cout << buf << endl;
	}

	return 0;
}

Measured memory_bytes: 3208
'use strict'

function Main(input) {
    const tmp = input.split('\n')[0].split(' ');
    const N = Number(tmp[0]);
    const K = Number(tmp[1]);
    
    let result = K;

    if (N === 1) {
        console.log(result);
        return;
    }

    for (let i = 0; i < (N - 1); i++) {
        result *= (K - 1);
    }
    console.log(result);
    return;

}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
	#define debug(...) printf(__VA_ARGS__)
#else
	#define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

int main() {
	int x, y;
	cin >> x >> y;
	if(x < y) {
		int ans = y - x;
		if(-x <= y)
			ans = min(ans, y + x + 1);
		if(-y >= x)
			ans = min(ans, -y - x + 1);
		cout << ans << endl;
	}
	else { // x > y
		int ans = 2e9;
		if(-x <= y)
			ans = min(ans, y + x + 1);
		if(-y >= x)
			ans = min(ans, -y - x + 1);
		if(-x <= -y)
		//if(x < 0)
			ans = min(ans, -y + x + 2);
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 384
n = int(input())

l = list(map(int,input().split()))

l.reverse()

ans = [0]*n
head = 0
tail = n-1
    
for i in range(n):
    if i % 2 == 0:
        ans[head] = l[i]
        head += 1
        
    else:
        ans[tail] = l[i]
        tail -= 1


for i in range(n):
    ans[i] = str(ans[i])

print(' '.join(ans))

Measured memory_bytes: 31936
n = int(input())
reds = [tuple(map(int, input().split())) for _ in range(n)]
blues = sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda tuple_: tuple_[0])

pairs = 0
for blue in blues:
    red_max_y = -float("inf")
    arg_max = -1
    for idx, red in enumerate(reds):
        if red[0] < blue[0] and red[1] < blue[1]:
            if red[1] > red_max_y:
                red_max_y = red[1]
                arg_max = idx
    if arg_max != -1:
        del reds[arg_max]
        pairs += 1

print(pairs)


Measured memory_bytes: 3064
D,G=map(int,input().split())
pc=[list(map(int,input().split())) for i in range(D)]

ans=float('inf')
for i in range(2**D):
  score=0
  b=0
  cnt=0
  for j in range(D):
    if ((i>>j)&1):
      score+=100*(j+1)*pc[j][0]+pc[j][1]
      cnt+=pc[j][0]
    else:
      b=j
  for k in range(pc[b][0]):
    if score>=G and cnt<ans:
      ans=cnt
    score+=(b+1)*100
    cnt+=1
print(ans)

Measured memory_bytes: 3064
n, k = map(int, input().split())
ans = 0
mod = 10**9+7
for i in range(k, n+2):
    min_sum = (i-1)*i/2
    max_sum = (n+n+1-i)*i/2
    ans += max_sum - min_sum + 1
print(int(ans)%mod)

Measured memory_bytes: 9100
K, N = list(map(int,input().split()))
A = list(map(int,input().split()))

max = K - A[N-1] + A[0]

A.sort()

for i in range(N-1):
  if(max < A[i+1] - A[i]):
    max = A[i+1] - A[i]

  
print(K - max)

Measured memory_bytes: 25968