akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

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

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

    int ans=0;

    while(true){
        bool existOdd=false;
        for (int i=0; i<N; i++){
            if (A[i]%2==1){
                existOdd=true;
            }
        }

        if (existOdd) break;
                       
        for (int i=0; i<N; i++){
            A[i]/=2;
        }
            
        ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#define debug(x) cout << #x " => " << (x) << endl
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
#endif
using lint = long long;
constexpr int MOD = (int)1e9 + 7;
constexpr double EPS = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> p(m);
  vector<string> s(m);
  rep (i, m) cin >> p[i] >> s[i];
  unordered_map<int, bool> check;
  rep (i, m) {
    if (s[i] == "AC") check[p[i]];
  }
  int cnt = 0;
  rep (i, m) {
    if (s[i] == "WA" && check.find(p[i]) != check.end() && !check[p[i]]) ++cnt;
    if (s[i] == "AC") check[p[i]] = true;
  }
  cout << check.size() << " " << cnt << endl;
  return 0;
}

Measured memory_bytes: 10276
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;
int n, tmp, dp[5001];
const int INF = 10000;

struct node {
  //  struct node* parent;                                                                           
  struct node* child;
  struct node* next;
  //  int depth;                                                                                     
  int x;
  int y;
};

void sum(struct node* p, int x){
  int tmp;
  if(!p->next){
    if(p->x <= x) dp[p->x] = p->y;
    if(p->y <= x) dp[p->y] = p->x;
  }
  else{
    sum(p->next, x);
    for(int i=x;i>=0;i--){
      if(dp[i] != INF){
        tmp = dp[i];
        dp[i] = INF;
        if(i + p->x <= x && dp[i + p->x] == INF) dp[i + p->x] = min(tmp + p->y, 5001);
        if(i + p->y <= x && dp[i + p->y] == INF) dp[i + p->y] = min(tmp + p->x, 5001);
      }
    }
  }
}


int main(void) {
  struct node* p[1001];
  struct node* p_tmp;

  scanf("%d",&n);
  for(int i=0;i<=n;i++) p[i] = new struct node;
  //  p[1]->parent = NULL;                                                                           
  p[1]->child = NULL;
  p[1]->next = NULL;
  for(int i=2;i<=n;i++){
    scanf("%d",&tmp);
    //    p[i]->parent = p[tmp];                                                                     
    if(!p[tmp]->child) p[tmp]->child = p[i];
    else{
      p_tmp = p[tmp]->child;
      while(p_tmp->next) p_tmp = p_tmp->next;
      p_tmp->next = p[i];
    }
    p[i]->next = NULL;
    p[i]->child = NULL;
  }
  for(int i=1;i<=n;i++){
    scanf("%d",&p[i]->x);
  }
  /*                                                                                                 
  printf("\n");                                                                                      
  for(int i=1;i<=n;i++){                                                                             
    printf("%d %d %d %d %d\n", i, p[i], p[i]->x, p[i]->child, p[i]->next);                           
  }                                                                                                  
  printf("\n");                                                                                      
  */

  for(int i=n;i>0;i--){
    for(int k=p[i]->x;k>=0;k--) dp[k] = INF;
    if(!p[i]->child){
      p[i]->y = 0;
      continue;
    }
    sum(p[i]->child, p[i]->x);
    p[i]->y = INF;
    for(int k=p[i]->x;k>=0;k--) if(dp[k] < p[i]->y) p[i]->y = dp[k];
    if(p[i]->y == INF){
      printf("IMPOSSIBLE\n");
      return 0;
    }
  }

  printf("POSSIBLE\n");
  return 0;

}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
    int X[2];
    cin >> X[0] >> X[1];
    int ans = (X[0] == 1 & X[1] == 1) ? 400000 : 0;
    for (int i = 0; i < 2; i++) {
        if (X[i] == 1) ans += 300000;
        else if (X[i] == 2) ans += 200000;
        else if (X[i] == 3) ans += 100000;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define x first
#define y second

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef tree <int, null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int white[4005][2005], black[4005][2005];
pair <int, int> a[4005];
int wh[2005], bl[2005], dp[2005][2005];

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= 2 * n; i++)
    {
        char c;
        int p;
        cin >> c >> p;
        if (c == 'W') a[i] = mp(1, p), wh[p] = i;
        else a[i] = mp(2, p), bl[p] = i;
    }

    for (int i = 2 * n; i > 0; i--)
    {
        for (int j = 1; j <= n; j++) black[i][j] = black[i + 1][j];
        for (int j = 1; j <= n; j++) white[i][j] = white[i + 1][j];
        if (a[i].x == 1) white[i][a[i].y] = 1;
        else black[i][a[i].y] = 1;
    }
    for (int i = 1; i <= 2 * n; i++)
    {
        for (int j = 1; j <= n; j++)
            white[i][j] += white[i][j - 1], black[i][j] += black[i][j - 1];
    }

    dp[0][0] = 0;
    for (int i = 1; i <= n; i++)
    {
        int k1 = wh[i];
        int kol1 = white[k1][i - 1];
        dp[i][0] = kol1 + dp[i - 1][0];
    }
    for (int i = 1; i <= n; i++)
    {
        int k2 = bl[i];
        int kol2 = black[k2][i - 1];
        dp[0][i] = kol2 + dp[0][i - 1];
    }

    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
        {
            int k1 = wh[i], k2 = bl[j];
            int kol1 = white[k1][i - 1] + black[k1][j];
            int kol2 = white[k2][i] + black[k2][j - 1];
            dp[i][j] = min(dp[i - 1][j] + kol1, dp[i][j - 1] + kol2);
        }
    /*for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= n; j++)
            cout << dp[i][j] << ' ';
        cout << '\n';
    }*/
    cout << dp[n][n];
    return 0;
}



Measured memory_bytes: 78720
#include <cstdio>  //{{{
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>

#define ALL(c) (c).begin(), (c).end()
#define DUMP(x) std::cerr << #x << ':' << x << '\n';

typedef long long ll;
// clang-format off
template<typename T,typename U>inline bool chmax(T&x,U a){if(x>=a)return 0;x=a;return 1;}
template<typename T,typename U>inline bool chmin(T&x,U a){if(x<=a)return 0;x=a;return 1;}
inline int in(){int x;scanf("%d", &x);return x;}
// clang-format on
// }}}
//{{{ graph.hpp
#ifndef INCLUDE_GRAPH_HPP
#define INCLUDE_GRAPH_HPP
#include <vector>
#include <climits>
namespace orliv {
namespace graph {
struct Edge {
  typedef int weight_type;
  static constexpr weight_type INF =
      std::numeric_limits<weight_type>::max() - 100;

  int from, to;
  weight_type w;
  Edge(int from, int to, weight_type w = 1) : from(from), to(to), w(w) {}
  bool operator<(const Edge& rhs) const {
    if (w != rhs.w) return w > rhs.w;
    if (from != rhs.from) return from < rhs.from;
    return to < rhs.to;
  }
};

typedef Edge::weight_type Weight;
typedef std::vector<Edge> Edges;
typedef std::vector<Weight> Weights;
typedef std::vector<int> Path;
}
typedef std::vector<graph::Edges> Graph;
}
#endif
//}}}
//{{{ prim.cc
#ifndef INCLUDE_GRAPH_HPP
#include "graph.hpp"
#endif
#include <queue>

namespace orliv {
namespace graph {

Edges prim(const Graph& g, int s = 0) {
  const int V = g.size();
  Edges spanning_tree;
  spanning_tree.reserve(V - 1);

  std::vector<bool> visited(V, false);
  std::priority_queue<Edge> pq;
  for (pq.emplace(-2, s, 0); !pq.empty();) {
    auto e = pq.top();
    pq.pop();
    if (visited[e.to]) continue;
    visited[e.to] = true;
    if (e.from >= 0) spanning_tree.emplace_back(e);
    for (const auto& f : g[e.to]) pq.emplace(f);
  }
  return std::move(spanning_tree);
}
}
}
//}}}

using namespace std;

int main() {
  int V = in(), E = in();
  orliv::Graph g(V);
  for (int i = 0; i < E; i++) {
    int s = in(), t = in(), w = in();
    g[s].emplace_back(s, t, w);
    g[t].emplace_back(t, s, w);
  }
  auto es = orliv::graph::prim(g);
  ll tot = 0;
  for (const auto& e : es) {
    tot += e.w;
  }
  cout << tot << endl;
  return 0;
}

Measured memory_bytes: 9088
#include <bits/stdc++.h>
//#include "debug.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
double startTime;
double getCurrentTime() {
return ((double)clock() - startTime) / CLOCKS_PER_SEC;
}
//freopen("input.in", "r", stdin);
//freopen("output.out", "w", stdout);

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin>>s;
  int n = s.size();
  if(s[n-1]=='3')cout<<"bon\n";
  else if(s[n-1]=='0'||s[n-1]=='1'||s[n-1]=='6'||s[n-1]=='8')cout<<"pon\n";
  else cout<<"hon\n";
}

Measured memory_bytes: 3652
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T> using vv=vector<vector<T>>;
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"{"; rep(i,t.size()) {os<<t[i]<<",";} os<<"}"<<endl; return os;}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
const ll MOD=1e9+7;

int main(){
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(0);
  string s;
  cin>>s;
  int a=0;
  for(char c:s){
    if(a==0 && c=='C') ++a;
    if(a==1 && c=='F') ++a;
  }
  cout<<(a==2?"Yes":"No")<<endl;
  return 0;
}


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

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

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m, p; cin >> n >> m >> p;
  vector<int> us, vs, ws;
  rep(i, m) {
    int a, b, c; cin >> a >> b >> c; a--; b--;
    us.push_back(a);
    vs.push_back(b);
    ws.push_back(c - p);
  }
  const ll inf = 1e18;
  vector<ll> dist(n, -inf);
  vector<int> from_s(n);
  vector<int> from_t(n);
  dist[0] = 0;
  from_s[0] = true;
  from_t[n - 1] = true;
  rep(_, n) rep(i, m) {
    dist[vs[i]] = max(dist[vs[i]], dist[us[i]] + ws[i]);
    from_s[vs[i]] |= from_s[us[i]];
    from_t[us[i]] |= from_t[vs[i]];
  }
  vector<ll> tmp = dist;
  rep(_, n) rep(i, m) {
    dist[vs[i]] = max(dist[vs[i]], dist[us[i]] + ws[i]);
  }
  rep(i, n) {
    if (from_s[i] && from_t[i] && dist[i] != tmp[i]) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << max(0LL, dist[n - 1]) << endl;
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
string s;
int i;
vector<int> v(3);
int add(int a, int b) {
	if (a == 2 || b == 2)return 2;
	if (a == 1 || b == 1)return 1;
	return 0;
}
int mult(int a, int b) {
	if (a == 0 || b == 0)return 0;
	if (a == 1 || b == 1)return 1;
	return 2;
}
int nt(int a) {
	return 2 - a;
}
int form() {
	if (isdigit(s[i]))return s[i++] - '0';
	else if (isalpha(s[i]))return v[s[i++] - 'P'];
	else if (s[i] == '(') {
		++i;
		int a = form();
		char c = s[i];
		++i;
		int b = form();
		++i;
		if (c == '+') {
			return add(a, b);
		}
		else if (c == '*') {
			return mult(a, b);
		}
	}
	else {
		++i;
		int a = form();
		return nt(a);
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	while (cin >> s) {
		if (s == ".")break;
		
		int cnt = 0;
		REP(j, 27) {
			i = 0;
			v[0] = j / 9;
			v[1] = j % 9 / 3;
			v[2] = j % 3;
			if (form() == 2)cnt++;
		}
	
	
		cout << cnt << endl;
	}
}


Measured memory_bytes: 3208
import java.util.*
 
fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val tList = mutableListOf<Int>()
    for (i in 0 until n) {
        tList.add(sc.nextInt())
    }
    val m = sc.nextInt()
    val pxList = mutableListOf<Pair<Int, Int>>()
    for (i in 0 until m) {
        pxList.add((sc.nextInt() to sc.nextInt()))
    }
 
    pxList.forEach { pair ->
        var sum = 0
        tList.forEachIndexed { i, it ->
            sum += if (i + 1 == pair.first) {
                pair.second
            } else {
                it
            }
        }
        println(sum)
    }
}

Measured memory_bytes: 31260
#include<bits/stdc++.h>
using namespace std;
char x[110000];
int main()
{
	cin>>x;
	int l=strlen(x),ans=0;
	for(int i=0;i<l-1;i++)
	{
		if(x[i]!=x[i+1])ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define int long long
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define td(v) v.begin(),v.end()
#define MAXN 300100
typedef long long ll;
using namespace std;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
inline ll mod(ll n, ll m){ll ret = n%m; if(ret < 0) ret += m; return ret;}
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
ll exp(ll a,ll b,ll m){
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    ll k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }    else return mod(k*k,m);
}

struct cx{
    int w,r,v;
    void read(){
        cin >> w >> r >> v;
    }
    bool operator<(const cx& b)const{
        return (w + r < b.w + b.r);
    }
};

int32_t main(){
    int n;
    fastio;
    cin >> n;
    vector<cx> v(n);
    for(int i=0;i<n;i++){
        v[i].read();        
    }
    sort(td(v));
    int maxr = 1e4 * 3;
    vector<int> dp(maxr);
    for(int i=0;i<n;i++){
        for(int j=min(v[i].r,maxr - v[i].w);j>=0;j--){
            dp[j+v[i].w] = max(dp[j+v[i].w],dp[j] + v[i].v);
        }
    }
    cout << *max_element(td(dp)) << endl;
    

	// Math -> gcd it all
	//did you check N=1? Did you mix up N,M?
}


Measured memory_bytes: 512
import sys
def main():
    x = input()
    x = int(x)

    ans = 0

#    x = x - 5
#    ans += 1

    ans += (x // 11) *2
    x = x % 11
    if x == 0:
        print(ans)
        exit()

    ans += x//6
    x = x % 6
    if x == 0:
        print(ans)
    else:
        ans += 1
        print(ans)

if __name__ == "__main__":
        main()


Measured memory_bytes: 3060
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


a, b = inpl()

if a > 0 and b > 0:
    print('Positive')
elif a <= 0 and b >= 0:
    print('Zero')
else:
    if a % 2 + b % 2 == 1:
        print('Positive')
    else:
        print('Negative')


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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); i++)
#define FI first
#define SE second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define TS to_string
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define SP(x) setprecision((ll)x)


ll INF = 1e9;
ll NIL = -1;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "yes" << endl;}
void no(){ cout << "no" << endl;}

//-----------------------------------------
int n;
int A[20 + 10];

bool p(int x,int pos = 0){
  if(pos == n) return false;
  if(x-A[pos]==0) return true;

  return p(x,pos+1) || p(x-A[pos],pos+1);
}

//-----------------------------------------
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  REP(i,n) cin >> A[i];
  ll m ;
  cin >> m ;
  REP(i,m){
    int a;
    cin >> a;
    if(p(a)) yes();
    else no();
  }



    
  return 0;
}




Measured memory_bytes: 3180
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n) for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
 
int f(int n,int s,int i){
	if(i==10&&s==0&&n==0)
		return 1;
	if(i==10&&(s!=0||n!=0))
		return 0;
	return f(n,s,i+1)+f(n-1,s-i,i+1);
}

int main(){
	int n,s,i;
	while(1){
		cin >> n >> s;
		if(n==0&&s==0)
			break;
		cout << f(n,s,0) << endl;
	}
	return 0;  
}  

Measured memory_bytes: 1160
n = gets.to_i
t, a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)

for i in 0..n-1
    b[i] = (t * 1000 - b[i] * 6 - 1000 * a).abs
end

puts b.index(b.min) + 1


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
long long m=1e9+7;
long long fact[1000001],inv[1000001];

long long modRecursive(long long a,long long b,long long c)
{
	if(b == 0) return 1;
	if(b%2 ==0) return modRecursive((a*a)%c,b/2,c);
	else return ((a%c)*(modRecursive((a*a)%c,b/2,c)))%c;
}

int main()
{
    long long n,k,x,y;
    cin>>n>>k>>x>>y;
    if(n>=k) cout<<k*x + (n-k)*y<<endl;
    else cout<<n*x<<endl;
}


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

using namespace std;

typedef long long ll;

ll n,m;
vector<pair<ll,ll>> ab;

int main(int argc,char** argv) {
	cin >> n >> m;
	for(int i = 0;i < m;i++) {
		ll a,b;
		cin >> a >> b;
		ab.push_back(make_pair(min(a,b),max(a,b)));
	}
	sort(ab.begin(),ab.end(),std::greater<pair<ll,ll>>());
	ll last = n+1000;
	ll res = 0;
	for(auto itr = ab.begin();itr != ab.end();itr++) {
		if(itr->second > last) continue;
		last = itr->first;
		res++;
	}
	cout << res;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

signed main()
{
    int x,y,z;
    cin>>x>>y>>z;
    cout<<z<<" "<<x<<" "<<y<<endl;
    
    return 0;
}

Measured memory_bytes: 256
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
static immutable MOD=10^^9+7;alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std;
// dfmt on

void main()
{
    long N = lread();
    auto A = aryread();

    A.sort!"b<a"();

    alias T = Tuple!(long, long, long);
    PQueue!(T, "a<b") Q;
    Q.insert(T(A[0], A[0], A[0]));
    long ans;
    foreach (i; 1 .. N)
    {
        auto t = Q.front;
        Q.removeFront();
        ans += t[0];
        Q.insert(T(min(t[1], A[i]), t[1], A[i]));
        Q.insert(T(min(t[2], A[i]), t[2], A[i]));
    }
    writeln(ans);
}


Measured memory_bytes: 20316
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	m := getNextInt64(scanner)
	aa := make([]int64, n)
	tt := make([]int, n)

	for i := 0; i < n; i++ {
		aa[i] = getNextInt64(scanner)
		for aa[i]%2 == 0 {
			aa[i] >>= 1
			tt[i]++
		}
	}

	for i := 1; i < n; i++ {
		if tt[i] != tt[i-1] {
			fmt.Fprintln(writer, 0)
			return
		}
	}
	l := aa[0]
	for i := 1; i < n; i++ {
		l = l / gcd(l, aa[i]) * aa[i]
		if l > m {
			fmt.Fprintln(writer, 0)
			return
		}
	}
	ans := m / (l << uint(tt[0]-1))

	ans = ans>>1 + ans%2
	fmt.Fprintln(writer, ans)
}

func gcd(m, n int64) int64 {
	if n == 0 {
		return m
	}
	return gcd(n, m%n)
}


Measured memory_bytes: 4352
#include<iostream>
#include<array>
#include<string>
#include<algorithm>
using namespace std;

int main() {
	int a;
	cin >> a;
	if (a%2==0) {
		cout << (a / 2) * (a / 2) << endl;
	}
	else {
		cout << (a / 2) * ((a +1)/ 2) << endl;
	}
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c,d,e;
		c=a+b;
		d=a-b;
		e=a*b;
		int x=0;
		if(c>=d &&c>=e){
			x=c;
		}
		if(d>=c &&d>=e){
			x=d;
		}
		if(e>=d &&e>=c){
			x=e;
		}
		System.out.print(x);
	}
}

Measured memory_bytes: 21844
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
struct _IO { _IO() { ios::sync_with_stdio(false); cin.tie(nullptr); } }_io;
typedef long long ll; typedef long double db;

ll exgcd(ll a, ll b, ll& x, ll& y)
{
	if (!b)
	{
		x = 1;
		y = 0;
		return a;
	}
	ll d = exgcd(b, a % b, x, y);
	ll t = x;
	x = y;
	y = t - (a / b) * y;
	return d;
}
ll getInv(ll a, ll mod)
{
	ll x, y;
	return exgcd(a, mod, x, y) == 1 ? (x % mod + mod) % mod : -1;
}

const ll maxn = 2e5 + 5, mod = 998244353;
ll dp[maxn], sum[maxn];
bool used[maxn];

int main()
{
	ll n, k;
	vector<ll> s;
	vector<pair<ll, ll>> seg;
	cin >> n >> k;
	while (k--)
	{
		ll a, b;
		cin >> a >> b;
		seg.push_back({ a,b });
	}
	sort(seg.begin(), seg.end());
	dp[1] = 1;
	sum[1] = 1;
	for (ll i = 1; i <= n; ++i)
	{
		for (pair<ll, ll>& j : seg)
		{
			if (i - j.second - 1 >= 0)
				dp[i] = (dp[i] + sum[i - j.first] - sum[i - j.second - 1]) % mod;
			else if (i - j.first >= 0)
				dp[i] = (dp[i] + sum[i - j.first] - sum[0]) % mod;
		}
		sum[i] = sum[i - 1] + dp[i];
	}
	cout << dp[n] % mod << endl;
	return 0;
}

Measured memory_bytes: 6712
#include <iostream>

using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(a==b && b!=c)
        cout<<c;
    else if(a==c && b!=c)
        cout<<b;
    else if(c==b && b!=a)
        cout<<a;
    return 0;
}


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

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPP(i, n) for(int i = 1; i <= n; ++i)
#define REPR(i, n) for(int i = n-1; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;

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

template<typename T>
map<T, T> primeFactor(T n) {
    map<T,T> res;
    for(T i = 2; i*i<=n; ++i) {
        while(n%i==0) {
            res[i] ++;
            n /= i;
        }
    }
    if(n != 1) res[n] = 1;
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b; cin >> a >> b;
    map<int,int> m;
    for(auto x : primeFactor(a)) {
        ++ m[x.first];
    }
    for(auto x : primeFactor(b)) {
        ++ m[x.first];
    }
    int ans = 1;
    for(auto x : m) {
        if(x.second > 1) {
            ++ ans;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using ll = long long;
using ull = unsigned long long;

#define MOD 1000000007

int main(void) {
    ll A, B;
    string S;
    cin >> A >> B >> S;
    cout << (regex_match(S, regex("\\d{" + to_string(A) + "}-\\d{" + to_string(B) + "}")) ? "Yes" : "No") << endl;
    return 0;
}


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

int main()
{
  int n,a,max,nex;
  int p=0;
  cin >> n >> a;
  max=a;
  nex=0;
  for(int i=1;i<n;++i){
    cin >> a;
    if(max<=a){
      nex=max;
      max=a;
      p=i;
    }else if(nex<=a){
      nex=a;
    }
  }
  
  for(int i=0;i<n;++i){
    if(i==p){
      cout << nex << endl;
    }else{
      cout << max << endl;
    }
  }
  return 0;
}

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

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (min(b, d) - max(a, c) >= 0) cout << min(b, d) - max(a, c) << endl;
    else cout << 0 << endl;
}

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

int main(){
  int A,B,C;
  cin >> A >> B >> C;
  if(C - B <= 0){
 cout << "delicious" << endl;
}
  else if(C - B > A){
    cout << "dangerous" << endl;
  }

  else{
 cout << "safe" << endl;
  }

}


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

int main(){
    int n; cin >> n;
    vector<int> a(n), b(n), c(n);
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for(int i = 0; i < n; i++)
    {
        cin >> b[i];
    }
    for(int i = 0; i < n; i++)
    {
        cin >> c[i];
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());

    ll ans = 0;

    for(int i = 0; i < n; i++)
    {
        auto itr_a = lower_bound(a.begin(), a.end(), b[i]);
        auto itr_c = upper_bound(c.begin(), c.end(), b[i]);
        ans += (itr_a - a.begin()) * (n - (itr_c - c.begin()));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int p, q, r;
  cin >> p >> q >> r;
  vector <int> t;
  t={p,q,r};
  
  sort (t.begin(),t.end());
  
  cout << t.at(0) + t.at(1) << endl;
}
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
int main()
{
    // freopen("B.01.in","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,t;
    int dsm=0;
    cin >> n;
    t=n;
    while (t>0){
        dsm += t % 10;
        t /= 10;
    }
    if (n % dsm == 0){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}

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

int main(){
    int h, w;
    while(true){
        cin >> h >> w;
        if (h==0 && w==0) break;
        for (int i=1; i<=h; i++){
            for (int j=1; j<=w; j++){
                if ((i+j)%2==0) cout << "#";
                else cout << ".";
            }
            cout << endl;
        }
        cout << endl;
    }
}


Measured memory_bytes: 3080
import sys
import math
sys.setrecursionlimit(500000)
INF = float('inf')

def solve(h, water):
    left = 0
    while left < len(h) - 1 and h[left] == 0:
        left += 1
    right = left
    while right < len(h) and h[right] != 0:
        right += 1

    if left < right:
        h[left:right] = [i - 1 for i in h[left:right]]
    elif left == right and h[left] > 0:
        h[left] = h[left] - 1
    else:
        return water
        
    water = solve(h, water + 1)
    return water

def main():
    n = int(input())
    h = list(map(int, input().split()))
    return solve(h, 0)

if __name__ == '__main__':
    print(main())


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

int main(){
  ll n=0;
  string s;
  cin >> s;
  for(ll i=0;i<s.size();i++){
    if(s.at(i) == '0') n += 0;
    else if(s.at(i) == '1') n+= 1;
    else if(s.at(i) == '2') n+= 2;
    else if(s.at(i) == '3') n+= 3;
    else if(s.at(i) == '4') n+= 4;
    else if(s.at(i) == '5') n+= 5;
    else if(s.at(i) == '6') n+= 6;
    else if(s.at(i) == '7') n+= 7;
    else if(s.at(i) == '8') n+= 8;
    else n += 9;
  }
  
  if(n%9 == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}


Measured memory_bytes: 3756
#include <bits/stdc++.h>
using namespace std; using ll=int_fast64_t; using ld=long double; using pll=pair<ll,ll>; using pld=pair<ld,ld>;
void solve(); int main(){cin.tie(0); ios::sync_with_stdio(false); cout<<fixed<<setprecision(10); solve();}
#define fi first
#define se second
#define SELECTOR(_1,_2,_3,SELECT,...) SELECT
#define rep(...) SELECTOR(__VA_ARGS__,_rep1,_rep0)(__VA_ARGS__)
#define _rep0(i,n) for(ll i=0;i<n;++i)
#define _rep1(i,k,n) for(ll i=k;i<n;++i)
template<class T> void contout(const T &v){for(auto it=v.begin();it!=v.end();++it,cout<<(it!=v.end()?" ":"\n"))cout<<*it;}
template<class T> vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b; return 1;} return 0;}
template<class... Ts> auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}

void solve(){
  ll n,m; cin>>n>>m;
  const ll INF=1LL<<60;
  auto A=make_v(n,n,INF);
  // input
  rep(_,m){
    ll a,b; cin>>a>>b;
    --a;--b;
    A[a][b]=1;
  }
  auto next=make_v(n,n,0);
  rep(i,n)rep(j,n) next[i][j]=j;
  // Warshall-Floyd
  rep(k,n)rep(i,n)rep(j,n){
    if(chmin(A[i][j],A[i][k]+A[k][j])){
      next[i][j]=next[i][k];
    }
  }
  // output
  ll len=n+1;
  ll v=-1;
  rep(i,n){
    if(chmin(len,A[i][i])) v=i;
  }
  if(v==-1){
    cout<<-1<<"\n";
    return;
  }
  // path restoration
  cout<<len<<"\n";
  cout<<v+1<<"\n";
  ll u=next[v][v];
  while(u!=v){
    cout<<u+1<<"\n";
    u=next[u][v];
  }
}

Measured memory_bytes: 14080
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

using namespace std;

long min(long long a,long long b){
    if (a >= b){
        return b;
    }
    else {
        return a;
    }
}

int main()
{
    long long n;
    long long k;
    
    cin >> n >> k;
    long long  amari;
    
    amari = n%k;

    if (n != 0){
        cout << min(amari,k-amari) << endl;
    }
    else {
        cout << 0 << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

struct point{
	double x,y;
//	typedef pair<point,point> pp;
	point operator+(point p){
		return point{x+p.x,y+p.y};
	}
	point operator-(point p){
		return point{x-p.x,y-p.y};
	}
	point operator*(double p){
	return point{x*p,y*p};
	}
	point operator/(double p){
		if(!p) return point{0,0}; 
		return point{x/p,y/p};
	}
	bool operator==(point p){
		return fabs(x-p.x)<eps&&fabs(y-p.y)<eps;
	}
};

typedef pair<point,point> pp;
const point O{0,0};

class Geom{
	public:
	double Length(point x,point y){
		point z=y-x;
		return sqrt(z.x*z.x+z.y*z.y);
	}
	double IP(point x,point y){
		return x.x*y.x+x.y*y.y;
	}
	point Projection(pp a,point x){
		point A=x-a.first,B=a.second-a.first;
		double l=Length(O,B);
		return B*IP(A,B)/(l*l)+a.first;
	}
};

int Q;
double x,y,X1,Y1,X2,Y2;

int main(){
	cout<<syosu(10);
	Geom geo;
	cin>>X1>>Y1>>X2>>Y2>>Q;
	for(int i=0;i<Q;i++){
		cin>>x>>y;
		point ans=geo.Projection(pp(point{X1,Y1},point{X2,Y2}),point{x,y});
		cout<<ans.x<<' '<<ans.y<<endl;
	}
}

Measured memory_bytes: 1292
J(y,m){if(m<3)y--,m+=12;return(m-2)*3059/100+1461*y/4+y/400-y/100;}M,D,y,m,d;main(Y){for(;~scanf("%d%d%d%d%d%d",&Y,&M,&D,&y,&m,&d);)~Y&&printf("%d\n",J(y,m)-J(Y,M)+d-D);}

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

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REP1(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREP1(i, x) for (int i = ((int)(x)); i > 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
const int MOD = (int)1e9 + 7;
const int INF = 1145141919;
using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using l_l = pair<ll, ll>;
using d_d = pair<double, double>;
using vint = vector<int>;
using vbool = vector<bool>;

int main() {
    int k, x;
    cin >> k >> x;
    // bool fi = true;
    // for (int i = x - (k - 1); i < k; i++) {
    //     if (!fi) {
    //         cout << " ";
    //     }
    //     fi = false;
    //     cout << i;
    // }
    // if (!fi) {
    //     cout << " ";
    // }
    // cout << x;

    // for (int i = x + 1; i <= x + (k - 1); i++) {
    //     cout << " ";
    //     cout << i;
    // }
    bool fi = true;
    for (int i = x - (k - 1); i <= x + (k - 1); i++) {
        if (!fi) {
            cout << " ";
        }
        fi = false;
        cout << i;
    }
}

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		if(C - A - B < 0){
			Console.WriteLine("No");
			return;
		}
		long l = 4 * A * B;
		long r = (C - (A + B)) * (C - (A + B));
		Console.WriteLine(l < r ? "Yes" : "No");
		
	}
	long A, B, C;
	public Sol(){
		var d = rla();
		A = d[0]; B = d[1]; C = d[2];
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 13140
#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>

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

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

    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i, 0, N) cin >> A[i];

    Combination comb(N + 1);

    ll base = 0ll;
    for (int i = 1; i <= N; ++i) {
        base += comb.inv(i);
        base %= MOD;
    }

    ll ans = 0ll;

    //ansに加算していく
    for (int i = 0; i < N; ++i) {
        ans += (A[i] % MOD) * base;
        ans %= MOD;
        //baseを更新
        base += comb.inv(i + 2);
        base %= MOD;
        base -= comb.inv(N - i);
        base %= MOD;
        if (base < 0) base += MOD;
    }

    //とどめ
    ans *= comb.fact[N];
    ans %= MOD;

    cout << ans << endl;


    return 0;
}


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

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define P pair<int , int>
#define V vector<int>
#define VLL vector<long long>
#define M map<int, int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};

int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
    int H, W;  cin >> H >> W;
    int ans_field[1000][1000];
    char field[1000][1000];
    queue<pair<int,int>> que;
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < W ; j++){
        cin >> field[i][j];
        if(field[i][j] == '#'){
          ans_field[i][j] = 0;
          que.push(make_pair(j, i));
        }else{
          ans_field[i][j] = INF;
        }
      }
    }

    while(!que.empty()){
      int x = que.front().first, y = que.front().second;
      for(int i = 0 ; i < 4 ; i++){
        int nx = x + dx[i], ny = y + dy[i];
        if(0<=nx && nx<W && 0<=ny && ny<H && ans_field[ny][nx]==INF){
          que.push(make_pair(nx,ny));
          ans_field[ny][nx] = ans_field[y][x] + 1;
        }
      }
      que.pop();
    }

    int ans = -1;
    REP(i, H)  REP(j, W)  ans = max(ans, ans_field[i][j]);
    cout << ans << endl;
	return 0;
}

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

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

#define F first
#define S second
#define PB push_back
#define MP make_pair

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

int main(){
	int n;
	cin >> n;
	int a[n];
	std::vector<int> sol(n) ;
	for (int i = 1; i < n; ++i)
	{
		cin >> a[i];
		sol[a[i]-1]++;
	}
	for (int i = 0; i < n; ++i)
	{
		cout << sol[i] <<"\n";
	}

	return 0;
}

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

# define F first
# define S second
# define mp make_pair
// everything go according to my plan
# define pb push_back
# define sz(a) (int)(a.size())
# define vec vector
// shimkenttin kyzdary, dzyn, dzyn, dzyn...
# define y1    Y_U_NO_y1
# define left  Y_U_NO_left
# define right Y_U_NO_right

using namespace std;

typedef pair <int, int> pii;
typedef long long ll;
typedef long double ld;

const int Mod = (int)1e9 + 7;
const int MX = 1073741822;
const ll MXLL = 4e18;
const int Sz = 1110111;
// a pinch of soul
inline void Read_rap () {
  ios_base :: sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}
inline void randomizer3000 () {
  unsigned int seed;
  asm ("rdtsc" : "=A"(seed));
  srand (seed);
}
void files (string problem) {
  if (fopen ((problem + ".in").c_str(),"r")) {
    freopen ((problem + ".in").c_str(),"r",stdin);
    freopen ((problem + ".out").c_str(),"w",stdout);
  }
}
void localInput (string in = "s") {
  if (fopen (in.c_str(), "r"))
    freopen (in.c_str(), "r", stdin);
  else
    cerr << "Input file not found" << endl;
}                
const int N = 1e3 + 1;
int n;

ll a[4][N];

ll V;

int main()
{                
  //localInput();
  Read_rap ();
  cin >> n >> V;
  for (int i = 0; i < 4; i++)
  	for (int j = 1; j <= n; j++)
  		cin >> a[i][j];

 	vec<ll> s;       
  for (int i = 1; i <= n; i++)
  	for (int j = 1; j <= n; j++)
  		s.pb (a[0][i] + a[1][j]);

  sort (s.begin(), s.end());
  ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			ll rem = V - (a[2][i] + a[3][j]);
			ans += upper_bound (s.begin(), s.end(), rem) - lower_bound (s.begin(), s.end(), rem);
		}
	}	
		

	cout << ans; 
	cout << endl;

  return 0;
}










// Coded by Z..



Measured memory_bytes: 11344