akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int) n; i++)
#define repb(i, n) for (int i = (int) n; i >= 0; i--)
#define reps(i, m, n) for (int i = (int) m; i < (int) n; i++)
#define repsb(i, m, n) for (int i = (int) m; i >= (int) n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.begin(), v.end(),greater<int>());
#define pb(a) push_back(a)
#define ll long long int
const ll LLINF = 1e18 + 10;
int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };
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 (b < a) { a = b; return 1; } return 0; }
//vector<vector<int>> vec(n_rows, vector<int>(n_cols, value));
using namespace std;
int main(int argc, char const * argv[]){
    int n,tmp,t;
    cin>>n;
    vector<int> v(n,-1);
    rep(i,n) cin>>v[i];
    VSORTR(v)
    tmp = t = 0;
    rep(i, n)
    {
        if (i%2==0) tmp+=v[i];
        else t += v[i];
    }
    
    cout<<tmp-t<<endl;

    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <queue>
#include <cstdlib>
#define MAX 10001
using namespace std;
typedef long long lld;
unsigned GetDigit(lld num) {
    unsigned digit=0;
    while(num>0) {
        num /= 10;
        digit++;
    }
    return digit;
}

lld F_Digit(lld num) {
    while(num>=10)
        num /= 10;
    return num;
}

lld pow(lld x, lld y) {
    lld num=1;
    while(y>0) {
        num *= x;
        y--;
    }
    return num;
}

int DigitSum(lld num) {
    int sum = 0;
    while(num>0) {
        sum += num%10;
        num /= 10;
    }
    return sum;
}

int main(void) {
    lld n, tmp;
    cin >> n;
    if((n+1)%pow(10, GetDigit(n))==0)
        cout << 9 * GetDigit(n) << endl;
    else if((n+1)%pow(10, GetDigit(n)-1)==0){
        cout << DigitSum(n) << endl;
    }else {
        tmp = (F_Digit(n)-1) * pow(10, GetDigit(n)-1) + pow(10, GetDigit(n)-1) - 1;
        cout << DigitSum(tmp) << endl;
    }
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'
int main()
{
    Hello
    int n, m;
    cin >> n >> m;
    double arr[n + 5], sum = 0;
    int cntr = 0;
    for(int i = 0; i < n; i++){
        cin >> arr[i];
        sum += arr[i];
    }
    double needed = (1.0 / (4.0 * m));
    for(int i = 0; i < n; i++){
        if((arr[i] / sum) >= needed)
            cntr++;
    }
    if(cntr >= m)
        cout << "Yes";
    else
        cout << "No";
    return 0;
}

Measured memory_bytes: 256
import java.io.*;

/**
 * Created by Ayushi on 17 May 2020.
 * Problem:
 * Round:
 */

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String a = br.readLine();
        br.close();

        if (a.endsWith("0") || a.endsWith("1") || a.endsWith("6") || a.endsWith("8")) {
            System.out.println("pon");
        }
        else if (a.endsWith("3")) {
            System.out.println("bon");
        }
        else {
            System.out.println("hon");
        }
    }
}


Measured memory_bytes: 32564
// https://atcoder.jp/contests/abc120/tasks/abc120_b

#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;

typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#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; i >= 0; i--)
#define FOREACH(x, a) for (auto &(x) : (a))
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

// int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

int main() {
    int cnt = 0, pos;
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;

    int i = 0;
    while (i < s.size() - 1 && s.size() >= 2) {
        // [0, 1]か[1, 0]のデータを見つけたら削除して、前に戻る
        if (s[i] != s[i + 1]) {
            s.erase(s.begin() + i, s.begin() + i + 2);
            cnt += 2;
            if (i > 0)
                i--;
        } else {
            i++;
        }
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

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

        char[] S = scanner.next().toCharArray();

        // 真面目に書く
        int maxCount = 0;
        for (int i = 0, currentCnt = 0; i < S.length; i++) {
            if (S[i] == 'R') {
                currentCnt++;

                if (maxCount < currentCnt) {
                    maxCount = currentCnt;
                }
            } else {
                if (maxCount < currentCnt) {
                    maxCount = currentCnt;
                }
                currentCnt = 0;
            }
        }

        System.out.println(maxCount);
    }
}


Measured memory_bytes: 26916
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
int main() {
    int N, K, X, Y;
    cin >> N >> K >> X >> Y;
    int sum = 0;
    for(int i = 1; i <= N; i++){
        if(i <= K) sum += X;
        else sum += Y;
    }
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
typedef long long ll;

int main(void){
    while (1) {
        int n, q;
        cin >> n >> q;
        if (n == 0 && q == 0) return 0;
        
        vector<pair<int, string> > nengo;
        for (int i = 0; i < n; i++) {
            string s;
            int ny, wy;
            cin >> s >> ny >> wy;
            nengo.emplace_back(wy - (ny - 1), s);
            nengo.emplace_back(wy, "{");
        }
        sort(nengo.begin(), nengo.end());
        
        for (int i = 0; i < q; i++) {
            int qy, in = 0;
            bool output = false;
            cin >> qy;
            for (int j = 0; j < nengo.size(); j++) {
                if (nengo[j].first < qy) {
                    if (nengo[j].second == "{") in--;
                    else in++;
                }
                else if (nengo[j].first == qy && nengo[j].second != "{") in++;
                else {
                    if (in == 0) cout << "Unknown" << endl;
                    else cout << nengo[j - 1].second << " " << qy + 1 - nengo[j - 1].first << endl;
                    output = true;
                    break;
                }
            }
            if (!output) cout << "Unknown" << endl;
            
        }
    }
}



Measured memory_bytes: 3264
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto N = RD;
	auto AB = new long[2][](N);
	foreach (i; 0..N)
	{
		AB[i] = [RD, RD];
	}
	AB.sort!"a[1] < b[1]"();

	bool ans = true;
	long t;
	foreach (e; AB)
	{
		debug writeln(t, " ", e);
		t += e[0];
		if (t > e[1])
		{
			ans = false;
			break;
		}
	}

	writeln(ans ? "Yes" : "No");
	stdout.flush();
	debug readln();
}

Measured memory_bytes: 5884
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstring>
#include<queue>
#include<tuple>
#include<utility>
#include<map>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int N;	cin>>N;
	vector<ll> data(N);	ll A,count=0;
	FOR(i,0,N){
		cin>>A;
		data.at(i)=A;
	}


	FOR(i,0,N-2){
		FOR(j,i+1,N-1){
			FOR(k,j+1,N){
				if(data.at(i)+data.at(j)>data.at(k)&&data.at(i)+data.at(k)>data.at(j)&&data.at(k)+data.at(j)>data.at(i)&&(data.at(i)!=data.at(j)&&data.at(j)!=data.at(k)&&data.at(i)!=data.at(k)))	count++;
			}
		}
	}

	cout<<count<<endl;

    return 0;
}



Measured memory_bytes: 3572
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> P;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef __gnu_pbds::priority_queue<int,greater<int>,pairing_heap_tag> pq;
struct edge{int to,cost;};
int n;
vector<edge> G[MAXN];
int mincost[MAXN],sz[MAXN];
int id=-1;
ll ans,dp[MAXN];
ll res1=0,res2=0;
void add_edge(int u,int v,int w)
{
    G[u].push_back((edge){v,w});
    G[v].push_back((edge){u,w});
    mincost[u]=min(mincost[u],w);
    mincost[v]=min(mincost[v],w);
}
void dfs(int v,int p)
{
    sz[v]=1;
    bool f=true;
    for(auto e:G[v])
    {
        if(e.to==p) continue;
        dfs(e.to,v);
        if(sz[e.to]*2==n) res1=e.cost;
        if(sz[e.to]*2>=n) f=false; 
        sz[v]+=sz[e.to];
        dp[v]+=dp[e.to];
        dp[v]+=2LL*min(sz[e.to],(n-sz[e.to]))*e.cost;
    }
    if(2*(n-sz[v])>=n) f=false;
    if(f) res2=mincost[v];
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) mincost[i]=INF;
    for(int i=0;i<n-1;i++)
    {
        int u,v,w;
        scanf("%d%d%d",&u,&v,&w);
        add_edge(u,v,w);
    }
    dfs(1,0);
    if(res1) printf("%lld\n",dp[1]-res1); else printf("%lld\n",dp[1]-res2);
    return 0;
}



Measured memory_bytes: 13952
# import bisect
# import heapq
# import math
# import random
# from fractions import gcd
# from collections import Counter, defaultdict, deque
from decimal import Decimal
import decimal
# from functools import lru_cache, reduce
# from itertools import combinations, combinations_with_replacement, product, permutations
# from operator import add, mul, sub, itemgetter
# import numpy as np

import sys
sys.setrecursionlimit(10000)

def read_int(read=None):
	if read == None:
		read = sys.stdin.readline().strip()
	return int(read)

def read_int_n(read=None):
	if read == None:
		read = sys.stdin.readline().strip()
	return [int(x) for x in read.split()]

def read_float(read=None):
	if read == None:
		read = sys.stdin.readline().strip()
	return float(read)

def read_float_n(read=None):
	if read == None:
		read = sys.stdin.readline().strip()
	return [float(x) for x in read.split()]

def read_str(read=None):
	if read == None:
		read = sys.stdin.readline().strip()
	return str(read)

def read_str_n(read=None):
	if read == None:
		read = sys.stdin.readline().strip()
	return [str(x) for x in read.split()]	
	
def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time
	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(K, A, B):
	if B - A <= 2:
		ans = K + 1
	else:
		if (K - A + 1) % 2 ==0:
			ans = (B-A)*(Decimal(str(K-A+1))/Decimal('2'))+A
		else:
			ans = (B-A)*(Decimal(str(K-A))/Decimal('2'))+A+1
	return ans

def main():
	t = '''4 2 6'''.splitlines()
	K, A, B = read_int_n()
	print(slv(K, A, B))

if __name__ == '__main__':
	main()

Measured memory_bytes: 5536
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pb push_back
#define srt(a) sort(a.begin(),a.end())
#define rsrt(a) sort(a.rbegin(),a.rend())
#define lb(a,b) lower_bound(a.begin(),a.end(),b)
#define ub(a,b) upper_bound(a.begin(),a.end(),b)
#define MOD ((int)(1e9+7))
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define float long double
#define sqrt sqrtl
#define cbrt cbrtl
typedef vector<int> vi;
typedef vector<float> vf;
typedef pair<float,int> fi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<fi> vfi;
typedef vector<vi> vvi;
typedef vector<vf> vvf;
typedef vector<vii> vvii;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;
typedef priority_queue<fi> pqfi;
typedef priority_queue <int, vector<int>, greater<int> > rpqi; 
typedef priority_queue <ii, vector<ii>, greater<ii> > rpqii; 
typedef priority_queue <fi, vector<fi>, greater<fi> > rpqfi; 
		

int32_t main()
{
    IOS
   int n,a,b;cin>>n>>a>>b;
   cout<<min(n*a,b)<<endl;
}
			
  
	
   	
			
				


            


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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  vector<vector<int>> x(N);
  vector<vector<bitset<1>>> y(N);
  for (int i=0; i<N; i++) {
    cin >> A[i];
    for (int j=0; j<A[i]; j++) {
      int a;
      bitset<1> b;
      cin >> a >> b;
      x.at(i).emplace_back(a);
      y.at(i).emplace_back(b);
    }
  }
  bool flag = false;
  int count = 0;
  for (int tmp=0; tmp < (1 << N); tmp++) {
    flag = true;
    bitset<15> katei(tmp);
    for (int i=0; i<N; i++) {
      if (!katei[i]) continue;
      for (int j=0; j<A[i]; j++) {
        if ((y.at(i).at(j))!=(katei.test(x.at(i).at(j)-1))) flag = false;
      }
    }
    if (flag) {
      int tmp_count = 0;
      for (int i=0; i<N; i++) {
        if (katei[i]) tmp_count++;
      }
      if (tmp_count > count) count = tmp_count;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

using ll = long long;
using ull = uint64_t;
using P = pair<int, int>;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

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

    ll X, Y;
    cin >> X >> Y;
    if(abs(X - Y) <= 1) cout << "Brown\n";
    else    cout << "Alice\n";
}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

typedef long long ll;

ll dp[100001][4];

int main() {
  string S;
  cin >> S;

  const ll MOD = 1000000007;

  dp[0][0] = 1;

  for (ll i = 0; i < S.size(); i++) {
    for (ll j = 0; j < 4; j++) {
      // ABC数として基準になるABCを選ばない
      if (S[i] == '?') {
        dp[i+1][j] += dp[i][j]*3;
        dp[i+1][j] %= MOD;
      } else {
        dp[i+1][j] += dp[i][j];
        dp[i+1][j] %= MOD;
      }
    }
    // ABC数として基準になるABCを選ぶ
    if (S[i] == 'A' || S[i] == '?') {
      dp[i+1][1] += dp[i][0];
      dp[i+1][1] %= MOD;
    }
    if (S[i] == 'B' || S[i] == '?') {
      dp[i+1][2] += dp[i][1];
      dp[i+1][2] %= MOD;
    }
    if (S[i] == 'C' || S[i] == '?') {
      dp[i+1][3] += dp[i][2];
      dp[i+1][3] %= MOD;
    }
  }

  cout << dp[S.size()][3] << endl;
  return 0;
}


Measured memory_bytes: 3584
import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def prime_fact(n):
    root = int(math.sqrt(n))
    prime_dict = {}
    for i in range(2, root+1):
        cnt = 0
        while n % i == 0:
            cnt += 1
            n = n // i
        if cnt:
            prime_dict[i] = cnt
    if n != 1:
        prime_dict[n] = 1
    return prime_dict


def main():
    N = NI()
    D = defaultdict(int)
    if N == 1:
        print(1)
        exit()

    for n in range(2, N+1):
        ND = prime_fact(n)
        for p, a in list(ND.items()):
            D[p] += a

    ans = 1
    for p, a in list(D.items()):
        ans = ans * (a+1) % MOD
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 9456
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<map>
#include<string>
#include<algorithm>

using namespace std;

#define FOR(I, A, B) for (int I = int(A); I < int(B); ++I)

const int N(11), P(27);

int ans, n;
string S, T;
string A[N], B[N];

string change(string &s, int c) {
    string ret = "";
    int x = 0;
    for (; x < s.size(); ++x) 
        if (s.substr(x, A[c].size()) == A[c]) {
            ret += B[c]; x += A[c].size() - 1;
        }
        else ret += s[x];
    return ret;
}

bool dfs(int x, string s) {
    if (s == T) return true;
    if (x >= ans || s.size() >= T.size()) return false;
    FOR(i, 0, n) {
       string ss = change(s, i);
       if (ss.size() > s.size()) {
           if (dfs(x + 1, change(s, i))) return true;
       }
    }
    return false;
}

int main() {
    while (cin >> n, n) {
        FOR(i, 0, n)
            cin >> A[i] >> B[i];
        cin >> S >> T;
        for (ans = 0; ans < 10 && !dfs(0, S); ++ans);
        if (ans == 10) printf("-1\n");
        else printf("%d\n", ans);
    }
    return 0;
}

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

int main() {
  int n,x;
  cin>>n>>x;
  vector<int>m(n);
  int sum=0;
  for(int i=0;i<n;i++){
    cin>>m[i];
    sum+=m[i];
  }
  sort(m.begin(),m.end());
  int kotae=n+(x-sum)/m[0];
  cout <<kotae<<endl;
}

Measured memory_bytes: 256
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;
static import std.ascii;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long H = lread();
    long cnt;
    long ans = 1;
    while (1 < H)
    {
        H /= 2;
        cnt++;
        ans += 2 ^^ cnt;
    }
    writeln(ans);
}


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

using namespace std;

int main() {
  int A, B;
  string S;
  cin >> A >> B;
  cin >> S;

  int l = A + B + 1;
  if(S.length() != l) {
    cout << "No" << endl;
    return 0;
  }

  if(S[A] != '-') {
    cout << "No" << endl;
    return 0;
  }

  char num[10];
  for(int i=0; i<=9; i++) {
    sprintf(&num[i], "%d", i);
  }

  for(int i=0; i<l; i++) {
    if(i == A) continue;
    bool check = false;
    for(int j=0; j<=9; j++) {
      if(S[i] == num[j]) {
        check = true;
      }
    }
    if(!check) {
      cout << "No" << endl;
      return 0;
    }
  }

  cout << "Yes" << endl;

  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include<bits/stdc++.h>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#define mx 1000008

#define pii pair<int,int>
#define pi acos(-1.0)
#define pb push_back
#define ss second
#define ff first
typedef long long int ll;
///adjacent move
int fx[4]={0,+1,0,-1};
int fy[4]={+1,0,-1,0};
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
///knight
ll prime[mx];
void seive()
{
    for(int i=2;i<mx;i+=2) prime[i]=2;
    for(int i=3;i<mx;i+=2) prime[i]=i;
    ll sq=sqrt(mx);
    for(int i=3;i<=sq;i+=2){
        if(prime[i]==i){
            for(int j=i*i;j<mx;j+=i){
                if(prime[j]==j) prime[j]=i;
            }
        }
    }
}
double a[1000004];
double dp[3004][3003];
ll n;
ll mid;
double cal(ll pos,ll tails)
{
    if(pos> n + 1)return 0;
    if(pos== n + 1){
		if(tails < mid)return 1;
		else return 0;
	}
    if(dp[pos][tails]!=-1) return dp[pos][tails];
    return dp[pos][tails]=a[pos]*cal(pos+1,tails)+((1.0-a[pos])*cal(pos+1,tails+1));
}
int main()
{
    //seive();
    int t=1;
    //cin>>t;
    int c=0;
    while(t--){
        cin>>n;
        for(int i=1;i<=n;i++) cin>>a[i];
        mid=n/2+1;
        for(int i=0;i<=3000;i++) for(int j=0;j<=3000;j++) dp[i][j]=-1.0;
        cout<<setprecision(10)<<fixed;
        cout<<cal(1,0)<<endl;;
    }
}


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


int main() {
	int A,B;
	scanf("%d %d",&A,&B);
	if((A+11)%13 > (B+11)%13){
		printf("Alice\n");
	}else if((A+11)%13 < (B+11)%13){
		printf("Bob\n");
	}else{
		printf("Draw\n");
	}
}


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

int main() {
	int a, b;
	cin >> a >> b;
	int tmp_a = 0, tmp_b = 0;
	if (a == 1 || a == 3 || a == 5 || a == 7 || a == 8 || a == 10 || a == 12) {
		tmp_a = 1;
	}
	else if (a == 4 || a == 6 || a == 9 || a == 11) tmp_a = 2;
	else tmp_a = 3;

	if (a == b ||b == 3 || b == 5 || b == 7 || b == 8 || b == 10 || b == 12) {
		tmp_b = 1;
	}
	else if (b == 4 || b == 6 || b== 9 || b == 11) tmp_b = 2;
	else tmp_b = 3;

	if (tmp_a == tmp_b)  cout << "Yes" << endl;
	else cout << "No" << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int N, A, B;
  string S;
  cin >> N >> A >> B >> S;
  rep(i, N)
  {
    if (S[i] == 'a')
    {
      if (A > 0)
        cout << "Yes" << endl, A--;
      else if (B > 0)
        cout << "Yes" << endl, B--;
      else
        cout << "No" << endl;
    }

    if (S[i] == 'b')
    {
      if (B > 0)
        cout << "Yes" << endl, B--;
      else
        cout << "No" << endl;
    }

    if (S[i] == 'c')
      cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#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)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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; }

struct UnionFind {
  vector<ll> par; 
  vector<ll> siz; 

    
  UnionFind(ll sz_): par(sz_), siz(sz_, 1) {
    for (ll i = 0; i < sz_; ++i) par[i] = i; 
  }
  void init(ll sz_) {
    par.resize(sz_);
    siz.resize(sz_, 1);
    for (ll i = 0; i < sz_; ++i) par[i] = i;
  }

  ll root(ll x) { 
    while (par[x] != x) {
      x = par[x] = par[par[x]];
    }
    return x;
  }

  bool merge(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }

  bool issame(ll x, ll y) {
    return root(x) == root(y);
  }

  ll size(ll x) {
    return siz[root(x)];
  }
};

int n, m;
int h[205], a[40040], b[40040], c[40040];

void solve() {
  vector<pair<int, int>> p(n);
  rep(i, n) p[i] = {h[i], i};
  sort(p.begin(), p.end());
  vector<tuple<int, int, int>> G(m);
  rep(i, m) G[i] = make_tuple(c[i], a[i], b[i]);
  sort(G.begin(), G.end());

  UnionFind uft(n);
  rep(i, m) uft.merge(get<1>(G[i]), get<2>(G[i]));
  if (uft.size(0) != n) {
    cout << 0 << '\n';
    return;
  }

  vector<bool> ng(n, false);
  int idx = n - 1;
  rep(i, n) {
    ng[p[i].second] = true;
    if (i != n - 1 && p[i].first == p[i + 1].first) continue;
    UnionFind uf(n);
    rep(j, m) {
      if (ng[get<1>(G[j])] || ng[get<2>(G[j])]) continue;
      uf.merge(get<1>(G[j]), get<2>(G[j]));
    }
    if (uf.size(p[n - 1].second) != n - 1 - i) {
      idx = i;
      break;
    }
  }
  //cout << idx << '\n';

  UnionFind ufa(n);
  int ans = 0;
  while (idx != -1) {
    int resh = p[idx].first;
    while (idx != -1 && p[idx].first == resh) {
      ng[p[idx].second] = false;
      idx--;
    }
    rep(i, m) {
      if (ng[get<1>(G[i])] || ng[get<2>(G[i])]) continue;
      if (ufa.merge(get<1>(G[i]), get<2>(G[i]))) {
        ans += get<0>(G[i]);
      }
    }
  }
  cout << ans << '\n';
}

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

  while (cin >> n >> m, n && m) {
    rep(i, n) cin >> h[i];
    rep(i, m) {
      cin >> a[i] >> b[i] >> c[i];
      a[i]--, b[i]--;
    }

    solve();
  }



  




  
  return 0;
}


Measured memory_bytes: 3708
x,y=map(int,input().split())
if abs(x)==abs(y):#
    print(1)
elif x*y<0:
    print(abs(abs(x)-abs(y))+1)
elif x<y:
    print(abs(abs(x)-abs(y)))
elif x*y!=0:
    print(abs(abs(x)-abs(y))+2)
else:
    print(abs(abs(x)-abs(y))+1)    


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N, mod = 1000000007;
    cin >> N;
    int arr[N];
    long long sum = 0, ans = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> arr[i];
        sum += arr[i];
        sum %= mod;
    }
    for (int i=0; i<N; i++)
    {
        sum -= arr[i];
         if (sum < 0) sum += mod;
        ans += arr[i] * sum;
        ans %= mod;
    }
    cout << ans <<" \n";
    return 0;
}


Measured memory_bytes: 4344
#include <iostream>
#include <string>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	long long n;
	cin >> n;
	long long ans = 0;
	for (int i = 1; i <= n; i++) {
		ans += i * (n / i) * (n / i + 1) / 2;
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3628
class BinaryIndexTree
  def initialize(size, init: 0)
    @values = Array.new(size, init)
    @size = size
  end

  # @param idx [Integer]
  # @param x [Numeric]
  def add(idx, x)
    raise 'Out of range reference' if @size <= idx

    idx += 1

    while idx <= @size
      @values[idx - 1] += x
      idx += idx & -idx
    end
  end

  def sum(l, r)
    _sum(r) - _sum(l)
  end

  private

  def _sum(idx)
    res = 0

    while idx > 0
      res += @values[idx - 1]
      idx -= idx & -idx
    end

    res
  end
end

N, Q = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

bit = BinaryIndexTree.new(N)

A.each_with_index do |a, idx|
  bit.add(idx, a)
end

Q.times do
  query = gets.split.map(&:to_i)

  if query[0] == 0
    _, idx, x = query
    bit.add(idx, x)
  else
    _, l, r = query
    puts bit.sum(l, r)
  end
end


Measured memory_bytes: 57380
/*   _ _ _                     
    | | | | ___  ___           
    | | | || . ||  _|          
    |_____||_  ||_|  _____     
             |_|    |_____|  */
// Time : 19/10/16
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define inf 0x3f3f3f3f
const int mmax = 1e3 + 10;
int a[mmax], b[mmax];
vi c[mmax];
int main(){
#ifdef Wqr_
    freopen("in.txt","r",stdin);
#endif
    std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
        int tmp;
        for(int j = 0; j < b[i]; j++){
            cin >> tmp;
            c[i].push_back(tmp);
        }
    }
    vi dp((1 << n) + 100, inf);
    dp[0] = 0;
    for(int i = 0; i < m; i++){
        int val = 0;
        for(auto j : c[i]) val |= (1 << (j-1));
        for(int j = 0; j < (1 << n); j++){
            dp[j | val] = min(dp[j | val], a[i] + dp[j]);
        }
    }
    if(dp[(1<<n)-1] == inf) dp[(1<<n)-1] = -1;
    cout << dp[(1<<n)-1] << endl;
    return 0;
}

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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

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

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
    }
    let ans = if a+b>=c{
        "Yes"
    } else{
        "No"
    };
    println!("{}",ans);
}


Measured memory_bytes: 4352
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>

std::string x, y;
long cnt[1005][1005];//[i][j]: x[i], y[j]までの和
long q;

int main(){
	scanf("%ld", &q);
	for(int i = 0; i < q; i++){
		std::cin >> x >> y;
		for(int i = 0; i <= x.length(); i++){
			for(int j = 0; j <= y.length(); j++){
				if(i == 0 || j == 0){
					cnt[i][j] = 0;
				}else if(x[i-1] == y[j-1]){
					cnt[i][j] = cnt[i-1][j-1] + 1;
				}else{
					cnt[i][j] = std::max(cnt[i-1][j], cnt[i][j-1]);
				}
			}
		}
		printf("%ld\n", cnt[x.length()][y.length()]);
	}
	return 0;
}
			



Measured memory_bytes: 11172
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 4e5 + 5, mod = 1e9 + 7;

ll fact[N], inv[N];

int add(int a, int b){
    a = (a + mod) % mod;
    b = (b + mod) % mod;
    return (a + b) % mod;
}

int mul(int a, int b){
    a = (a + mod) % mod;
    b = (b + mod) % mod;
    return 1ll * a* b % mod;
}

ll fp(int b, int p){
    if(!p) return 1;
    ll ret = fp(b, p >> 1) % mod;
    ret = mul(ret, ret);
    if(p&1) ret = mul(ret, b);
    return ret;

}

void pre(){
    fact[0] = inv[0] = 1;
    for(int i = 1; i < N; i++){
        fact[i] = mul(fact[i - 1], i);
        inv[i] = fp(fact[i], mod - 2);
    }

}

ll ncr(ll n, ll r){
   ll ret = mul(fact[n], inv[r]);
   return mul(ret, inv[n - r]);
}



int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    pre();
    ll n, k, ans = 0;
    cin >> n >> k;
    int mx = min(n - 1, k);
    for(int i = 0; i <= mx; i++){
        ans = add(ans, mul(ncr(n, i), ncr(n - 1, i)));
    }

    cout << ans;

    return 0;
}


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

int main(){
    int N, T;
    cin >> N >> T;
    int c[101], t[101];
    for(int i = 0; i < N; i++){
        cin >> c[i] >> t[i];
    }
    int min = 1000;
    int cnt = 0; 
    for(int i = 0; i < N; i++){
        if(t[i] <= T){
            cnt++;
            if(c[i] < min){
                min = c[i];
            }
        }
    }
    if(cnt == 0){
        cout << "TLE" << endl;
    } else {
        cout << min << endl;
    }
    
    return 0;
}

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

const int N = 200005;

int i, n;
long long a[N], ans = 1e18 + 69;

int main() {
  ios_base::sync_with_stdio(0);

  cin >> n;
  for(i = 1; i <= n; ++i) cin >> a[i], a[i] += a[i - 1];

  for(i = 1; i < n; ++i) ans = min(ans, abs(a[i] - (a[n] - a[i])));

  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 1792
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static void Main()
    {
        new Magatro().Solve();
    }
}

class Magatro
{
    private int N, L;
    private int[] A;

    private void Scan()
    {
        var line = Console.ReadLine().Split(' ');
        N = int.Parse(line[0]);
        L = int.Parse(line[1]);
        A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }

    public void Solve()
    {
        Scan();

        for (int i = 1; i < N; i++)
        {

            if (A[i] + A[i - 1] >= L)
            {
                var sb = new StringBuilder();
                sb.AppendLine("Possible");
                for (int j = 1; j < i; j++)
                {
                    sb.AppendLine(j.ToString());
                }

                for (int j = N - 1; j >= i; j--)
                {
                    sb.AppendLine(j.ToString());
                }
                Console.Write(sb.ToString());
                return;
            }
        }
        Console.WriteLine("Impossible");
    }
}


Measured memory_bytes: 31452
#include <bits/stdc++.h>
using namespace std;
map<int,int> m;
int ans=0;
int main()
{
    int n;
    cin >>n;
    for(int i=0;i<n;i++)
	{
        int x;
		cin >>x;
        m[x]++;
    }
	for(map<int,int>::iterator it=m.begin();it!=m.end();it++)
	{
        if((*it).second>=(*it).first)
		ans+=(*it).second-(*it).first;
        else
		ans+=(*it).second;
    }
    cout <<ans<<endl;
    return 0;
}

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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main(){
  int n; cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  ll ans = 0;
  for(int i = 1; i < n; ++i) {
    if(a[i-1] > a[i]) {
      ans += a[i-1]-a[i];
      a[i] = a[i-1];
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 4840
#include <iostream>
#include <algorithm>
#include <string>
// #include <vector>
using namespace std;
int main()
{
  int N;
  int count = 0;
  int A[201];

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

  while(true){
    bool is_odd = false;
    for(int i = 0; i < N; i++){
      if(A[i] % 2 != 0) {
	is_odd = true;
	break;
      } else A[i] /= 2;
    }
    if(is_odd) break;
    ++count;
  }

  cout << count << endl;
  return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <cmath>
#include <map>

using namespace std;


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

	if (s[2] == s[3] && s[4] == s[5]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

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

using namespace std;

long long a, b;

inline ll gcd (ll m, ll n)
{
	return n == 0 ? m : gcd (n, m % n);
}

int main ()
{
	scanf ("%lld%lld", &a, &b);
	ll k = gcd (a, b);
	ll ans = 0;
	for (ll i = 2; i * i <= k; ++i)
	{
		if (k % i == 0)
		{
			ans++;
			while (k % i == 0) k /= i;
		}
	}
	if (k > 1) ++ans;
	printf ("%lld\n", ans + 1);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;
int N,Q;
ll q[100000];
ll ad[100010];
ll imo[100010];
vector<ll> qs;
vector<ll> _qs;
int getleq(ll x){
	int id=lower_bound(all(_qs),-x)-_qs.begin();
	return id;
}
int main(){
	cin>>N>>Q;
	if(Q==0){
		rep(i,N) cout<<1<<endl;
		return 0;
	}
	rep(i,Q) cin>>q[i];
	ll now=q[Q-1];
	qs.pb(now);
	for(int i=Q-2;i>=0;i--){
		if(now>q[i]){
			qs.pb(q[i]);
			now=q[i];
		}
	}
	if(now>N){
		qs.pb(N);
		now=N;
	}
	Q=qs.size();
	rep(i,Q) _qs.pb(-qs[i]);
	ad[0]=1;
	rep(i,Q-1){
		ll q=qs[i]/qs[i+1];
		ll r=qs[i]%qs[i+1];
		ll c=ad[i];
		while(r>0){
			int id=getleq(r);
			if(id==Q){
				imo[r-1]+=c;
				break;
			}else{
				ll rq=r/qs[id];
				r%=qs[id];
				ad[id]+=rq*c;
			}
		}
		ad[i+1]+=q*c;
	}
	for(int i=N-1;i>0;i--) imo[i-1]+=imo[i];
	rep(i,qs.back()) imo[i]+=ad[Q-1];
	rep(i,N) printf("%lld\n",imo[i]);
}


Measured memory_bytes: 5748
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    n = I()
    print(n*800-200*(n//15))

#B
def B():
    k = I()
    ans = 0
    for i in range(1,k):
        for j in range(i+1,k+1):
            if (i%2)^(j%2):
                ans += 1
    print(ans)

#C
def C():
    x,t = LI()
    print(max(0,x-t))

#D
def D():
    n = I()
    ans = 1
    for i in range(1,n+1):
        ans *= i
        ans %= mod
    print(ans)

#E
def E():
    x,y,s,t = LI()
    return

#F
def F():
    n = I()
    x = LI()
    a = sorted(x)
    for i in range(n):
        j = bisect.bisect_left(a,x[i])
        if j >= n//2:
            print(a[n//2-1])
        else:
            print(a[n//2])

#G
def G():
    return

#H
def H():
    return

def J():
    return

def K():
    return

#Solve
if __name__ == "__main__":
    F()


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

map<char, int> ctoi{
    {'S', 0},
    {'H', 1},
    {'C', 2},
    {'D', 3}
};

string itoc("SHCD");

int main() {
    int n;
    cin >> n;
    vector<vector<bool>> cards(4, vector<bool>(13, false));
    for (int i = 0; i < n; i++) {
        char c;
        int k;
        cin >> c >> k;
        cards[ctoi[c]][k - 1] = true;
    }

    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 13; j++) {
            if (cards[i][j]) {
                continue;
            }
            cout << itoc[i] << " " << j + 1 << endl;
        }
    }
}

Measured memory_bytes: 1212
#include<algorithm>
#include<string>
#include <bits/stdc++.h>
#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--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
 
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
 
int main(){
    int n,d,x;
    cin >> n;
    vector<int> a(n);
    cin >> d >> x;
    REP(i,n){
        cin >> a[i];
    }

    int ans = 0;
    REP(i,n){
        int t = (d-1)/a[i]+1;
        ans += t;
    }

    cout << ans + x << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define for(i,a,b) for(int i=a;i<=b;i++)
#define _inline __inline__ __attribute__((always_inline))
#include<math.h>
#define ll long long
using namespace std;
template<class T> _inline void read(T &x){
	T res=0,f=1;
	char c=getchar();
	if(c=='-') f=-1;
	while(c>'9'||c<'0') c=getchar();
	while(c>='0'&&c<='9'){
		res=res*10+c-'0';
		c=getchar();
	}
	x=res*f;
}
template<class T> inline void print(T x){
    if(x<0) putchar('-'),x=-x;
    if(x>9) print(x/10);
    putchar(x%10+'0');
}
ll h;
int main(){
	read<ll>(h);
	ll x=floor(log(h)/log(2));
	print<ll>(pow(2,x+1)-1);
	puts("");
	exit(0);
}

Measured memory_bytes: 384
antennas = []
distance = 0
for _ in range(5):
  antennas.append(int(input()))
distance = int(input())
for i in range(len(antennas)):
  for j in range(i+1, len(antennas)):
    if distance < abs(antennas[i] - antennas[j]):
      print(':(')
      exit()
print('Yay!')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,m,n) for(int i=m; i<n; i++)
#define co(n) cout << n << endl
using namespace std;
int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  
  if(d==1) co(1);
  else co(0);
  return 0;
  
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inputS(): return input().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

from functools import reduce

def gcd(a, b):
  while b:
    a, b = b, a%b
  return a

def lcm(a, b):
  return a*b // gcd(a, b)

def div2cnt(a):
  cnt = 0
  while a%2 == 0:
    a //= 2
    cnt += 1
  return cnt

N, M = map(int, inp().split())
A = list(map(int, inp().split()))
# 2で割ったものに置き換え a -> a'
Ad = [a//2 for a in A]

# 各要素について、2で割り切れる回数が等しいかチェック
div2 = div2cnt(Ad[0])
for a in Ad:
  if div2cnt(a) != div2:
    print(0)
    exit()
    
# LCM
_lcm = reduce(lcm, Ad)
if _lcm > M:
  print(0)
  exit()
  
print((M//_lcm + 1) // 2)   # 切り上げ



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

int main() {
  string S;
  cin >> S;
  int a=0;
  int b=0;
  for (int i = 0; i < S.size(); i++) {
    if(S.at(i)=='A'||S.at(i)=='T'||S.at(i)=='C'||S.at(i)=='G'){
      a++;
    }
    else{
      b=max(b,a);
      a=0;
    }
  }
  cout<<max(b,a)<<endl;
}

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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()



int main()
{
   int N, M, A;

   cin >> N >> M;

   rep(i, M)
   {
       cin >> A;

       N -= A;

   }

    if ( N < 0 )
    {
        cout << -1 << endl;
    }
    else
    {
        cout << N << endl;
    }
    
   
    
}

Measured memory_bytes: 3632
l, r = [int(i) for i in input().split()]

st = l % 2019

if r - l >= 3500:
    print(0)

else:
    ans = float("inf")
    amari = []
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            ans = min(ans, ((i%2019) * (j%2019)) % 2019)
    print(ans)

Measured memory_bytes: 3060