akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstdint>
#include <unordered_map>
#include <sstream>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define pb push_back
#define pf push_front

namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

ll M = 1000000007;

typedef pair<int, int> P;
bool sr(int a, int b)
{
	return a > b;
}
bool ps1(const P &element1, const P &element2)
{ //first昇順
	return element1.first < element2.first;
}
bool ps2(const P &element1, const P &element2)
{ //first降順
	return element1.first > element2.first;
}
bool ps3(const P &element1, const P &element2)
{ //second昇順
	return element1.second < element2.second;
}
bool ps4(const P &element1, const P &element2)
{ //second降順
	return element1.second > element2.second;
}
int digits(ll n)
{
	int count = 0;
	while (n > 0)
	{
		n /= 10;
		count++;
	}
	return count;
}
template <class T>
void print(const T &value)
{
	std::cout << value << std::endl;
}
cpp_int combination(cpp_int n, cpp_int r) {
	if (r * 2 > n) r = n - r;
	cpp_int dividend = 1;
    cpp_int divisor = 1;
	for (unsigned int i = 1; i <= r; ++i) {
		dividend *= (n - i + 1);
		divisor *= i;
	}
	return dividend / divisor;
}
int main()
{
	int n;
	cin>>n;
	vector<int>a(n);
	rep(i,n)cin>>a[i];
	sort(all(a),sr);
	int m=a[0];
	int ans=0;
	int m2=0;
	rep(i,n){
		int c= min(m-a[i],a[i]);
		if(c>ans){
			ans=c;
			m2=a[i];
		}
	}
	cout<<m<<" "<<m2<<endl;
}

Measured memory_bytes: 640
import java.util.*;
import java.io.*;
import java.math.*;


import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;


public class Main{ 


    static long mod=1000000007;
     static int dx[]={1,-1,0,0};
       static int dy[]={0,0,1,-1};
    // static int dx[]={1,-1,0,0,1,1,-1,-1};
    // static int dy[]={0,0,1,-1,1,-1,1,-1};
    // PriorityQueue<Integer> que = new PriorityQueue<Integer>(); 
    //HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();

public  static void main(String[] args)   throws Exception, IOException{

    
    Reader sc = new Reader(System.in);
    PrintWriter out=new PrintWriter(System.out);

    //  int n=sc.nextInt();  
    int n=sc.nextInt();
    // int k=sc.nextInt();
    String s=sc.nextString(), l="";
    char c[] = s.toCharArray();
    int balance=0;

    for( int i=0; i<n; i++ ){
        if(c[i]==')' ){
            balance--;
        }
        else balance++;
        if(balance < 0){
            balance = 0;
            l+="(";
        }
    }

    for( int i=0; i<balance; i++ ){
        s=s+")";
    }

    out.println(l+s);
    out.flush();
}

static void db(Object... os){

    System.err.println(Arrays.deepToString(os));

}

static boolean validpos(int x,int y,int r, int c){
    
    return x<r && 0<=x && y<c && 0<=y;
    
}
 
static boolean bit(long x,int k){
    // weather k-th bit (from right) be one or zero
    return  ( 0 < ( (x>>k) & 1 )  )  ? true:false;
}

}


class XY {
    int x,y,d;
    XY(int x, int y, int d) {
        this.x=x;
        this.y=y;
        this.d=d;
    } 
}

class P implements Comparable<P>{
    int x,y;
    P(int x, int y) {
        this.x=x;
        this.y=y;
    } 
      
    public int compareTo(P p){
        return x - p.x;
    } 
}



class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}



Measured memory_bytes: 21332
n = int(input())
d = [list(map(int,input().split())) for i in range(n)]
count = 0

# [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5], [6, 6]]

for i in d:
  if i[0] == i[1]:
    count += 1
  else:
    count = 0
  if count == 3:
    print('Yes')
    exit()
print('No')

Measured memory_bytes: 9152
#include <bits/stdc++.h>
#define endl        '\n'
#define db          double
#define ld          long double
#define ll          long long
#define ull         unsigned long long
#define sqr(x)      (x) * (x)
#define gcd(a, b)   __gcd(a, b)
#define lcm(a, b)   ((a/gcd(a,b)) * b)
#define pf(x) 		push_front(x)
#define pb(x)       push_back(x)
#define eb(x)		emplace_back(x)
#define all(x)      (x).begin(), (x).end()
#define rall(x) 	(x).rbegin(), (x).rend()
#define sz(x) 		(int)x.size()
#define debug(x) 	cerr << #x << " = " << (x) <<endl
#define unsyncIO    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

const ld PI = acos((ld)-1);
const int MOD = 1e9+7;
const ll INF = 1e18; 

using namespace std;

int main()
{
    //freopen("/home/taalpatar_shepai/Documents/my_codes/out.txt", "w", stdout);
    int x, y;
    cin >> x >> y;
    if(y <= (x*4) && y >= (x*2) && y % 2 == 0) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3600
package main

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

func main() {
	var n int
	fmt.Scan(&n)
	var k int
	fmt.Scan(&k)

	p := readLineInts()

	sort.Ints(p)

	var ans int
	for i := 0; i < k; i++ {
		ans += p[i]
	}
	fmt.Println(ans)
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func readLineStrs() []string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	str := string(buf)
	return strings.Split(str, " ")
}

func readLineInts() []int {
	list := readLineStrs()
	res := make([]int, len(list))
	for i, v := range list {
		pi, _ := strconv.ParseInt(v, 10, 64)
		res[i] = int(pi)
	}
	return res
}


Measured memory_bytes: 2320
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

#define _USE_MATH_DEFINES
#include <math.h>


int main(void) {

	int a = 0;
	int b = 0;
	int C = 0;

	double C_rad = 0;

	scanf("%d %d %d", &a, &b, &C);

	double S = 0;
	double L = 0;
	double h = 0;

	// 面積の公式
	// S = 0.5 * a * b * sin(C)
	// 周の長さ
	// L = a + b + c    <=   c^2 = a^2 + b^2 - 2ab* cos(C)

	// S = teihene * takasa /2 => h = 2S / a

	C_rad = C * M_PI / 180;

	S = 0.5 * a * b* sin(C_rad);

	double c = sqrt(pow(a, 2) + pow(b, 2) - 2 * a* b* cos(C_rad));
	L = a + b + c;

	h = 2 * S / a;


	printf("%lf\n", S);
	printf("%lf\n", L);
	printf("%lf\n", h);



	return 0;
}



Measured memory_bytes: 2104
/// meowa 

#pragma GCC optimize("O3")
//#pragma comment(linker, "/STACK:36777216")

#include<bits/stdc++.h>

#define x first
#define y second
#define pb push_back
#define sz(x) (int) x.size()
 
using namespace std;

using ll = long long;
using pii = pair<int, int>;                                   

const int MOD = 1e9 + 7;
const int INF = 1e9 + 1e2;

void stndrtn() {
#ifdef AM
    freopen(".in", "r", stdin);
#endif        
}                   

const bool flag = 0;

void ma1n() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int& x : a) {
        cin >> x;
    }
    for (int i = k; i < n; ++i) {
        if (a[i] > a[i-k]) {
            cout << "Yes\n";
        } else {
            cout << "No\n";
        }
    }           
} 

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr), stndrtn();
    int ts = 1;
    if (flag) {
        cin >> ts;
    }
    while (ts--) {
        ma1n(); 
    }
    return 0;
}

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

using namespace std;

int main(){

  int n;

  cin>>n;

  for(int i=0;i<n;++i){

	int x,y,b,p;

	cin>>x>>y>>b>>p;

	if(b>=5 && p>=2)
	  cout<<(x*b+y*p)*0.8<<endl;
	
	else if(b>=5 && p<2){
	  if((x*b+y*2)*0.8<x*b+y*p)
		cout<<(x*b+y*2)*0.8<<endl;
	  else
		cout<<x*b+y*p<<endl;
	}
	
	else if(b<5 && p>=2){
	  if((x*5+y*p)*0.8<x*b+y*p)
		cout<<(x*5+y*p)*0.8<<endl;
	  else
		cout<<x*b+y*p<<endl;
	}

	else
	  cout<<x*b+y*p<<endl;
	
  }
  
}



Measured memory_bytes: 3268
use std::io::stdin;
use std::str::FromStr;

fn read_line<T>() -> Vec<T>
where
    T: FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect()
}

fn read_str_as_char_vec() -> Vec<char> {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().chars().collect()
}

fn read_str_as_T<T>() -> T
where
    T: FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().parse().unwrap()
}

fn main() {
    let in_vec: Vec<i64> = read_line();
    let a = in_vec[0];
    let b = in_vec[1];
    let _c = in_vec[2];
    let k = in_vec[3];

    let res: i64;

    if k <= a {
        res = k;
    } else if k <= a + b {
        res = a;
    } else {
        res = a - (k - a - b);
    }

    println!("{}", res);
}


Measured memory_bytes: 2104
#include<bits/stdc++.h>
using namespace std;
#define MOD (long long)(1e9+7)
typedef long long int ll;
typedef unsigned long long int ull;

ll modularExponentiation(ll x, ll y, ll  p){
  ll res = 1;
  x = x % p;
  while (y > 0){
      if (y & 1) res = (res*x) % p;
      y = y>>1;
      x = (x*x) % p;
  }
  return res;
}

bool isPrime(ll n){
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;
    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
    return true;
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T=1;
  // cin>>T;
  for(int t=0;t<T;t++){
    ll x, y, z;
    cin>>x>>y>>z;
    swap(x, y);
    swap(x, z);
    cout<<x<<" "<<y<<" "<<z<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iomanip>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf 1000000000
#define mod 1000000007
#define N 1000000
using namespace std;
char ch;
int n,k,i,t;
char a[N];
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9') {if (ch=='-') f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int main()
{
	ch = getchar();
	while (ch>='a' && ch<='z')
		{
			n++; a[n] = ch; ch = getchar();
		}
	k = read();
	for (i = 1;i <= n; i++)
		{
			if (a[i] == 'a') continue;
			t = 26 - (a[i] - 'a');
			if (t > k) continue;
			k = k - t; a[i] = 'a';
		}
	k = k % 26;
	for (i = n;i >= 1; i--)
		{
			if (a[i] + k <= 'z') {a[i] = a[i] + k; break;}
			t = 26 - ('z' - a[i]); k = k - t; a[i] = 'z';
		}
	for (i = 1;i <= n; i++) cout<<a[i]; cout<<endl;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {
	static int cnt, pos;
	static int[] pre, in, post;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		pre = new int[n];
		in = new int[n];
		post = new int[n];
		for(int i = 0; i < n; i++) {
			pre[i] = scan.nextInt();
		}
		for(int i = 0; i < n; i++) {
			in[i] = scan.nextInt();
		}
		scan.close();
		cnt = 0;
		pos = 0;
		rec(0, n);
		for(int i = 0; i < n; i++) {
			if(i == n - 1) {
				System.out.println(post[i]);
			}else {
				System.out.print(post[i] +" ");
			}
		}
	}
	// 二分木の復元
	static void rec(int l, int r) {
		if(l >= r) return;
		int root = pre[pos++];
		int mid = 0;
		while(in[mid] != root) {
			mid++;
		}
		rec(l, mid);
		rec(mid + 1, r);
		post[cnt++] = root;
	}
}


Measured memory_bytes: 26284
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*
cout<<setprecision(20)
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1000000007LL;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
llint LBI(vector<int>&ar,int in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
llint UBI(vector<int>&ar,int in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,i;cin>>n;
	vector<int>dp(n+1,mod);
	dp[0]=0;
	vector<int>hyo={1,6,36,216,1296,7776,46656,9,81,729,6561,59049};
	for(i=0;i<n;i++){
		for(auto it:hyo){
			if(i+it<=n){mineq(dp[i+it],dp[i]+1);}
		}
	}
	cout<<dp[n]<<endl;
	return 0;
}

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

using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    int A, B, C;
    cin >> A >> B >> C;
    cout << B + C - min (A, B + C) << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define rt return
#define dll(x) scanf("%I64d",&x)
#define xll(x) printf("%I64d\n",x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout<<"== [ "<<x<<" ] =="<<endl;
using namespace std;
typedef long long ll;
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;}
ll powmod(ll a,ll b,ll MOD){ll ans=1;while(b){if(b%2)ans=ans*a%MOD;a=a*a%MOD;b/=2;}return ans;}
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
int a[maxn];
int n;
int main()
{
    //freopen("D:\\common_text\\code_stream\\in.txt","r",stdin);
	//freopen("D:\\common_text\\code_stream\\out.txt","w",stdout);
	gbtb;
	cin>>n;
	repd(i,1,n)
	{
		cin>>a[i];
	}
	int ans=1;
	repd(i,2,n)
	{
		if(a[i]>=a[1])
		{
			ans++;
			a[1]=max(a[1],a[i]);
		}
	}
	cout<<ans<<endl;
	
	
	
    return 0;
}

inline void getInt(int* p) {
    char ch;
    do {
        ch = getchar();
    } while (ch == ' ' || ch == '\n');
    if (ch == '-') {
        *p = -(getchar() - '0');
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 - ch + '0';
        }
    }
    else {
        *p = ch - '0';
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 + ch - '0';
        }
    }
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
const double pi = 3.14159265358979323846;
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
int main()
{
  ull n;
  string s;

  cin>>n;

  while(n)
  {
      s+=(((n%26-1)+26)%26+'a');

      n--;
      n/=26;
  }

  reverse(s.begin(),s.end());

  cout<<s;
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1<<18,INF=1<<30;
int n;
ll dat[2*MAX-1];

void init(int n_){
    n=1;
    while(n<n_) n*=2;
    for(int i=0;i<2*n-1;i++){
        dat[i]=0;
    }
}

void update(int k,ll a){
    k+=n-1;
    dat[k]=a;
    
    while(k>0){
        k=(k-1)/2;
        dat[k]=max(dat[k*2+1],dat[k*2+2]);
    }
}

ll query(int a,int b,int k,int l,int r){
    
    if(r<=a||b<=l) return 0;
    if(a<=l&&r<=b) return dat[k];
    else{
        ll vl=query(a,b,2*k+1,l,(l+r)/2);
        ll vr=query(a,b,2*k+2,(l+r)/2,r);
        return max(vl,vr);
    }
}


int main(){
    
    int N;cin>>N;
    vector<pair<int,int>> S(N);
    vector<ll> A(N);
    for(int i=0;i<N;i++){
        cin>>S[i].first;
        S[i].second=i;
    }
    
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    
    sort(S.rbegin(),S.rend());
    
    init(N);
    
    for(int i=0;i<N;i++){
        int a=S[i].second;
        update(a,A[a]+query(a,N,0,0,n));
    }
    
    cout<<query(0,N,0,0,n)<<endl;
    
}



Measured memory_bytes: 7424
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);



int main()
{
	
	fastio;
		
	
	ll n;
	cin>>n;
	ll a[n];
	vector<int> freq(1000005);
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
		freq[a[i]]++;
	}
	vector<int> vis(1000005,0);
	ll res=0;
	for (int i = 1;i<=1000000; ++i)
	{
		if(freq[i]==0 || vis[i]==1)
			continue;
		if(freq[i]==1 && vis[i]==0)
			res++;
		for (int j=i;j<=1000000;j+=i)
		{
			vis[j]=1;		
		}
	}

	cout<<res;
	

	return 0;
}







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

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

  int ans = 0;
  while (n) {
    if (n > 1000) {
      n -= 1000;
    } else {
      ans = abs(n - 1000);
      break;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

			String in = br.readLine();
			String chr[] = in.split(" ");
			String a = chr[0].substring(0,1);
			String b = chr[1].substring(0,1);
			String c = chr[2].substring(0,1);
			String ans =a+ b+ c;
			System.out.println(ans.toUpperCase());

		}
	}
}


Measured memory_bytes: 25352
#include <iostream>
#include <cmath>
#include <cstring> 
#include <vector>
#include <algorithm>

using namespace std;

int vertices,edges;
vector<int> grp[100005];
vector<int> dp(100005,-1);
vector<int> visited(100005,-1);

int findMaxAns(int src){
    if(dp[src]!=-1){
        return dp[src];
    }
    
    visited[src] = 1;
    int maxPath = 0;
    
    for(auto m:grp[src]){
        maxPath = max(maxPath,1 + findMaxAns(m));
    }
    dp[src] = maxPath;
    return dp[src];
}

void solve(){
    cin>>vertices>>edges;
    for(int i=0;i<edges;i++){
        int a,b;
        cin>>a>>b;
        grp[a].push_back(b);
    }
    
    int ans = 0;
    for(int i=1;i<=vertices;i++){
        ans = max(ans,findMaxAns(i));
    }
    cout<<ans;
    
}

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


Measured memory_bytes: 11232
import Data.List
import Data.Char
import qualified Data.ByteString.Char8 as BS8

main :: IO ()
main = do
    n <- readLn
    d <- unfoldr (BS8.readInt . BS8.dropWhile isSpace) <$> BS8.getLine
    let sd = sort d
    
    print $ (sd !! (n `div` 2)) - sd !! (n `div` 2 - 1)


Measured memory_bytes: 17788
#include <iostream>
using namespace std;
int main()
{
	int N = 0, K = 0, X = 0, Y = 0;
	cin >> N >> K >> X >> Y;
	long long cost = 0;
	for(int i = 0; i < N; i++){
		if(i < K){
			cost += X;
		}else{
			cost += Y;
		}
	}
	cout << cost << endl;

	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long N = in.nextLong();
		long sum = 0;
		
		for(int i=1; i<=N; i++) {
			if(i%3 != 0 && i%5 != 0) {
				sum = sum + i;
			}
		}
		
		System.out.println(sum);
		
	}
}


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

using namespace std;
#define int1(a) scanf("%d",&a)
#define int2(a,b) scanf("%d %d",&a,&b)
#define int3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define int4(a,b,c,d) scanf("%d %d %d %d",&a,&b,&c,&d)
#define lint1(a) scanf("%lld",&a)
#define lint2(a,b) scanf("%lld %lld",&a,&b)
#define lint3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define lint4(a,b,c,d) scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define lli long long int
#define pint(x) printf("%d",x)
#define ps printf(" "); 
#define plint(x) printf("%lld",x)
//#define sort(a,n) qsort(a,n,sizeof(int),cmpfunc)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define bg begin()
#define ed end()
#define Set(a, s) memset(a, s, sizeof (a))
#define mod 1000000007
#define tmod(k) if ((k) >= mod) k %= mod;
#define endl '\n'
#define nl printf("\n");
#define fors(i,n) for(int i=0; i<n; i++)
#define fore(i,n) for(int i=n-1; i>=0; i--)
#define forv(i,a,n) for(int i=a; i<n; i++)
#define fora(i,ele) for(auto i: ele)
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
typedef string st;
typedef vector<int> vi;
typedef vector<st> vs;
const int INF = 0x3f3f3f3f;
int cmpfunc (const void * a, const void * b)
{
   return ( *(int*)a - *(int*)b );
}

bool cmpf(int a, int b){
    return a>b?true:false;
}

class node{
public:
	int id;
	int prio;
	int prd;
};

class compare{
public:
	bool operator()(node &n1, node &n2){
		if(n1.prio>n2.prio)//descend
			return true;
		else if(n1.prio==n2.prio){
			return n1.id>n2.id;
		}
		return false;
	}
};
//priority_queue<node, vector<node>, compare> pq;

int n , k;
const int N = 100005;
    int arr[N];
    int g , m;
   int main(){
	scanf("%d %d" , &n , &k);
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , arr + i);
	}
	g = arr[1];
	m = arr[1];
	for(int i = 2 ; i <= n ; ++i){
		g = __gcd(g , arr[i]);
		m = max(m , arr[i]);
	}
	if(k <= m && k % g == 0){
		printf("POSSIBLE\n");
	}
	else{
		printf("IMPOSSIBLE\n");
	}
}
    




Measured memory_bytes: 640
#include <iostream>
#include <array>
#include <algorithm>

int main(){
	std::array<int, 5> num;
	
	while(std::cin >> num[0] >> num[1] >> num[2] >> num[3] >> num[4]){
		sort(num.begin(), num.end(), std::greater<int>());
		std::cout << num[0] <<" "<< num[1] << " " << num[2] <<" "<< num[3] << " " << num[4] << std::endl;
		}
	return 0;
}

Measured memory_bytes: 1176
h, w = gets.split.map(&:to_i)
a = []
h.times do |i|
  s = gets.chomp
  a.push(s) if s.count('.') != w
end
(w - 1).downto(0) do |i|
  if a.all?{|x| x[i] == '.'}
    a.each do |x|
      x[i] = ''
    end
  end
end
puts a

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
using lld = int64_t;
const int N = 100000 + 5;

lld a[ N ], b[ N ];

int main() {
	int n; scanf( "%d", &n );
	for ( int i = 0 ; i < n ; ++ i )
		scanf( "%" PRId64, a + i );
	for ( int i = 0 ; i < n ; ++ i )
		scanf( "%" PRId64, b + i );
	lld sum = 0; int ans = 0;
	priority_queue< lld > avail;
	for ( int i = 0 ; i < n ; ++ i )
		if ( a[ i ] > b[ i ] )
			avail.push( a[ i ] - b[ i ] );
	for ( int i = 0 ; i < n ; ++ i ) {
		if ( a[ i ] >= b[ i ] )
			continue;
		while ( a[ i ] + sum < b[ i ] ) {
			if ( avail.empty() ) {
				puts( "-1" );
				return 0;
			}
			sum += avail.top();
			avail.pop();
			ans++;
		}
		sum -= b[ i ] - a[ i ]; ans++;
	}
	printf( "%d\n", ans );
	return 0;
}

Measured memory_bytes: 2428
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);


//Inputdata
static const int D = 365;
vector<int> c(D);
int s[D][26];
ll ans[D];
int last[26];  //コンテストが最後に行われた日
vector<int> t(D);

int checkScore(int d, int t){
 int score = 0;
 score += s[d][t];
 last[t] = d;
 REP(i,26){
   score -= c[i] * (d - last[i]);
 }
 return score;
}

void input(){
  //input data
  int _;
  cin >> _;

  REP(i,26) cin >> c[i];
  REP(d,D){
    REP(i,26){
      int x;
      cin >> x;
      s[d][i] = x;
    }
  }

}

void initial(){
  REP(i,26) last[i] = -1;
  REP(d, D) ans[d] = 0;
  //ans = 0;
}




int main(){
  input();

  initial();


  //cout << endl << "==ans==" << endl;

  // REP(d,D){
  //   int t;
  //   int score;
  //   cin >> t;
  //   --t;
  //   score = checkScore(d,t);
  //   cout << score << endl;
  // }


  int MX_score = 0;
  int MX_i = 0;

  //maxscore
  REP(d,D){
    MX_score = 0;
    REP(i,26){
      int score = 0;
      ans[d] = 0;
      score = checkScore(d, i);
      if(score > MX_score){
        MX_score = max(MX_score, score);
        ans[d] = score;
        t[d] = i + 1;
        MX_i = i;
        last[i] = 0;
      }
    }
    last[MX_i] = d;
    //cout << d   << " "<< MX_score << endl;
  }

  REP(d,D) cout << t[d] <<  endl;


  return 0;
}


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

using namespace std;

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

	if (K > N) {
		cout << 1 << endl;
		return 0;
	}

	int ans = ceil((double)(N - 1) / (double)(K - 1));

	cout << ans << endl;

	return 0;
}


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

const int MAX = 101;
int top = 0;
int S[MAX];

void initialize();
bool isEmpty();
bool isFull();
void push(int);
int pop();

int main() {
  char s[10];
  while (scanf("%s", s) != EOF) {
    if (s[0] == '+') {
      push(pop() + pop());
    } else if (s[0] == '-') {
      int a = pop();
      push(pop() - a);
    } else if (s[0] == '*') {
      push(pop() * pop());
    } else {
      push(atoi(s));
    }
  }
  cout << pop() << endl;
}

void initialize() {
  top = 0;
}
bool isEmpty() {
  return top == 0;
}
bool isFull() {
  return top >= MAX - 1;
}
void push(int x) {
  if (isFull()) cout << "Error: Stack overflow" << endl;
  S[++top] = x;
}
int pop() {
  if (isEmpty()) cout << "Error: Stack underflow" << endl;
  return S[top--];
}


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

using namespace std;

int main() {
   priority_queue<int>num;
   string command;

   int n;

   while(1){
    cin>>command;
    if(command.compare("insert") == 0){
        cin>>n;
        num.push(n);
    }
    if(command.compare("extract") == 0){
        cout<<num.top()<<endl;
        num.pop();
    }
    if(command.compare("end") == 0){
        break;
    }
   }
   return 0;
}



Measured memory_bytes: 7040
#include<stdio.h>

int main(void){
	int a,b;
	char x;
	while(1){
	scanf("%d %c %d",&a,&x,&b);
	if(x=='?')break;
	else if(x=='+')printf("%d\n",a+b);
	else if(x=='-')printf("%d\n",a-b);
	else if(x=='*')printf("%d\n",a*b);
	else if(x=='/')printf("%d\n",a/b);
	}
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll mod = 1000000007;

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

  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;

  int ans = 1000000007;
  for (int i = 0; i <= max(x, y); i++) {
    int cost = (a * max(0, x - i)) + (b * max(0, y - i)) + (c * 2 * i);
    if (cost < ans) ans = cost;
  }

  cout << ans << endl;

  return 0;
}


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

using namespace std;

int m, k, n;

int main() {
  cin >> m >> k;
  
  if (m == 0) {
    cout << (k ? "-1" : "0 0") << endl;
    return 0;
  }
  if (m == 1) {
    cout << (k ? "-1" : "0 0 1 1") << endl;
    return 0;
  }
  
  n = round(pow(2, m));
  if (k >= n) {
    cout << -1 << endl;
    return 0;
  }
  
  for (int i = 0; i < n; i++) {
    if (i == k) continue;
    cout << i << " ";
  }
  cout << k << " ";
  for (int i = n-1; i >= 0; i--) {
    if (i == k) continue;
    cout << i << " ";
  }
  cout << k << endl;
  return 0;
}

Measured memory_bytes: 1792
using System;

namespace ConsoleApp6
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] NL = Console.ReadLine().Split(' ');
            ulong A = ulong.Parse(NL[0]);
            ulong B = ulong.Parse(NL[1]);

            ulong C = ulong.Parse(NL[2]);
            ulong D = ulong.Parse(NL[3]);

            ulong CD = Lcm(C, D);

            ulong NOC = B / C - (A-1) / C;
            ulong NOD = B / D - (A-1) / D;
            ulong NOCD = B / (CD) - (A-1) / (CD);

           // Console.WriteLine("{0},{1},{2}",NOC,NOD,NOCD);

            Console.WriteLine((B - A + 1) - NOC - NOD + NOCD);

        }
        public static ulong Lcm(ulong a, ulong b)
        {
            return a * b / Gcd(a, b);
        }

        // ユークリッドの互除法 
        public static ulong Gcd(ulong a, ulong b)
        {
            if (a < b)
                // 引数を入替えて自分を呼び出す
                return Gcd(b, a);
            while (b != 0)
            {
                var remainder = a % b;
                a = b;
                b = remainder;
            }
            return a;
        }

    }
}


Measured memory_bytes: 11092
#include<stdio.h>
int main(){

  int n,q,count=0,i,j;
  int S[100000];
  int T[100000];

  scanf("%d",&n);
  for(i=0; i<n; i++)
    scanf("%d",&S[i]);

  scanf("%d",&q);
  for(i=0; i<q; i++)
    scanf("%d",&T[i]);

  for(i=0; i<q; i++){
    for(j=0; j<n; j++){
      if(T[i] == S[j]){
	count++;
	break;
      }
    }
  }

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



Measured memory_bytes: 2144
line = list(map(int,input().split(" ")))
A,B,C,X,Y = line[0],line[1],line[2],line[3],line[4]

payment = 0
min_AB = min(X,Y)
if(A+B< 2 * C):
    payment += (A+B) * min_AB
else:
    payment += 2 * C * min_AB

if(X == max(X,Y)):
    if(A > 2 * C ):
        payment += 2*C*(max(X,Y)-min(X,Y))
    else:
        payment += A*(max(X,Y)-min(X,Y))
else:
    if(B > 2*C):
        payment += 2*C*(max(X,Y)-min(X,Y))
    else:
        payment += B*(max(X,Y)-min(X,Y))
print(payment)


Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(void){
  long int a,b,c,d;
  cin >> a >> b >> c >> d;
  long int w,x,y,z;
  w = a*c;
  x = a*d;
  y = b*c;
  z = b*d;
  long int  ans = max(w,max(x,max(y,z)));
  cout << ans << endl;
}

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

//vector毎回出力
void trace(vector<int> v, int N) {
	for (int i = 0; i < N; i++) {
		printf("%d", v.at(i));
		if (i < N - 1) printf(" ");
	}
	printf("\n");
	return;
}

//insertionsort
void insertionsort(vector<int> v, int N) {
	for (int i = 1; i < N; i++) {
		int x = v.at(i);
		int j = i - 1;
		while (j >= 0 && x <  v.at(j)) {
			v.at(j + 1) = v.at(j);
			j--;
		}
		v.at(j + 1) = x;
		trace(v, N);
	}
	return;
}

//main
int main() {
	int N; scanf("%d", &N);
	vector<int> v(N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &v.at(i));
	}
	trace(v, N);
	insertionsort(v, N);
	return 0;
}


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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n,z,w;
  cin >> n >> z >> w;
  vll a(n+1);
  a[0] = w;
  REP(i, n)
    cin >> a[i+1];

  ll x[n+1][n+1],y[n+1][n+1];
  REP(i, n+1){
    REP(j, n+1)
      x[i][j] = y[i][j] = 0;
  }


  REP(i, n)
    y[n][i] = x[n][i] = abs(a[n]-a[i]);

  for(ll j = n-1; j>=0; j--){
    ll newx,newy;
    newx = LLINF;
    newy = 0;

    //jを選んだときのスコア
    for(ll i=j+1; i<=n; i++){
      newx = min(newx, y[i][j]);
      newy = max(newy, x[i][j]);
    }

    for(ll i=0; i<j || (i==0&&j==0); i++){
      x[j][i] = newx;
      y[j][i] = newy;
    }
  }

  //0を選んだ時=開始時点
  cout << y[0][0] << endl;
}


Measured memory_bytes: 62848
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long sum = 0;

    for(int i = 1;i <= n-1;i++) {
      sum += i;
    }

    System.out.println(sum);

  }

}


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

int main(){
  int a, b, x, y, q, r=1;
  while (cin >> a >> b){
    x=a; y=b;
    while (r>0){
      q=x/y; r=x%y;
      if (r>0){
	x=y; y=r;
      }
    }

    cout << y << " " << a/y*b << endl;
    r=1;
  }
  return 0;
}

Measured memory_bytes: 3052
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
      
int main(){
  int n,id=1,nv,ch,index,syuryo=1;
        
  scanf("%d\n",&n);
    
  int *A = new int[100040];
  bool *B = new bool[100040];
  int *C = new int[100040];
  string *D = new string[100040];
  int st,ed;
  for(int i=0;i<=100040;i++){
    A[i]=0; // hukasa
    C[i]=-1; // oya
    B[i]=false; //false nara ko wo motte inai
  }
  for(int i=0;i<n;i++){
    scanf("%d",&id);
       
    getline(cin,D[id]);
    
    syuryo=1;
    for(int r=1;r<=D[id].length();r++){
      if(D[id][r] == ' '){
    syuryo = r-1; // String no iti gime
    break;
      }
    }
      
    index = atoi(D[id].substr(1,syuryo).c_str());
   
    if(index != 0)B[id]=true;
          
   
    if(index != 0){
      st = syuryo+2; 
      for(int d = syuryo+2;d<=D[id].length();d++){
    if(D[id][d] == ' ' || d == D[id].length()){
      A[atoi(D[id].substr(st,d-st).c_str())]=A[id]+1;
      C[atoi(D[id].substr(st,d-st).c_str())]=id;
      if(B[atoi(D[id].substr(st,d-st).c_str())]){
        int st2=3;
           
        for(int j = syuryo+2;j<=D[atoi(D[id].substr(st,d-st).c_str())].length();j++){
             
          if(D[atoi(D[id].substr(st,d-st).c_str())][j] == ' ' || j == D[atoi(D[id].substr(st,d-st).c_str())].length()){
        A[atoi(D[atoi(D[id].substr(st,d-st).c_str())].substr(st2,j-st2).c_str())]=A[atoi(D[id].substr(st,d-st).c_str())]+1;
        st2=j+1;
          }
        }
      }
      st = d+1;
    }
      }
         
    }
       
  }
        
    
        
  for(int i=0;i<n;i++){
    printf("node %d: parent = %d, depth = %d, ",i,C[i],A[i]);
    int cou=0;
    if(C[i] == -1){printf("root, [");}
    else if(!B[i])printf("leaf, [");
    else printf("internal node, [");
       
   
    syuryo=1;
    for(int r=1;r<=D[i].length();r++){
      if(D[i][r] == ' '){
    syuryo = r-1;
    break;
      }
    }
    index = atoi(D[i].substr(1,syuryo).c_str());
       
    st=syuryo+2;
    if(index != 0){   
      for(int j=syuryo+2;j<=D[i].length();j++){
    if(D[i][j] == ' ' || D[i].length() == j ){
      printf("%d",atoi(D[i].substr(st,j-st).c_str()));
      if(j != D[i].length())printf(", ");
      st=j+1;
    }
      }
    }
    printf("]\n");
  }
        
  delete [] A;
  delete [] B;
  delete [] C;
  delete [] D;
  return 0;
}

Measured memory_bytes: 5212
#include <iostream>
#include <iomanip>
int main()
{
  int a, b, c, d, e, f;
  while (std::cin >> a >> b >> c >> d >> e >> f) {
    double x, y, r;
    r = static_cast<double>(a * e - b * d);
    x = static_cast<double>(c * e - b * f) / r;
    y = static_cast<double>(a * f - c * d) / r;
    if (x * x < 0.0001) x = 0;
    if (y * y < 0.0001) y = 0;
    std::cout << std::fixed << std::setprecision(3) << x << " " << y << std::endl;
  }
  return 0;
}

Measured memory_bytes: 1232
#include <iostream>

int main(){
    int n;
    std::cin >> n;

    float val, sum = 0;
    for(int i = 0; i < n; ++i){
        std::cin >> val;
        sum += 1.0 / val;
    }

    std::cout << 1.0 / sum << std::endl;

    return 0;
}

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

int main() {
    char E;
    cin >> E;
    
    if (E == 'a' || E == 'i' || E == 'u' || E == 'e' || E == 'o') {
        cout << "vowel" << endl;
    }
    else {
        cout << "consonant" << endl;
    }
        
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int s = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++){
		    a[i] = sc.nextInt();
		}
		
		// 計算
		long result = 0;
		long[][] dp = new long[3001][3001];
		int MOD = 998244353;
		dp[0][0] = 1;
		for(int i = 0; i < n; i++){
		    for(int j = 0; j < dp[0].length; j++){
		        if(j+a[i] < 3001){
		            dp[i+1][j+a[i]] += dp[i][j];
		            dp[i+1][j+a[i]] %= MOD;
		        }
		        dp[i+1][j] += dp[i][j]*2%MOD;
		        dp[i+1][j] %= MOD;
		    }
		}
		result = dp[n][s];
		
		// 出力
		System.out.println(result);
	}

	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}


Measured memory_bytes: 96956
import sys
f = sys.stdin

for line in f:
    line = list(map(int, line.split(',')))
    l = line[:10]
    v1, v2 = line[10:]
    for i in range(1, len(l)):
        l[i] += l[i - 1]
    t = l[-1] / (v1 + v2)
    dist = v1 * t
    for i in range(len(l)):
        if l[i] >= dist:
            print(i + 1)
            break

Measured memory_bytes: 6732
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);

using namespace std;

const int N = 1e6+7;
int n,d[N];

int32_t main()
{
	fast;

	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>d[i];
	sort(d+1,d+1+n);
	int a = d[n/2];
	int b = d[n/2+1];
	cout<<b-a;
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>

// 入力受付用の変数
#define BUF 200002
char str[BUF];

// 入力された値
#define LIM_A 100001
int A;
char S[LIM_A];

void receive_input() {
	fgets(str, sizeof(str), stdin);
	sscanf(str, "%d", &A);

	fgets(str, sizeof(str), stdin);
	sscanf(str, "%s", S);
}

void solve() {
	if (3200 > A) {
		printf("%s\n", "red");
	} else {
		printf("%s\n", S);
	}
}

int main(void) {
	receive_input();

	solve();

	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define FOR(i,a,b) for (int i = (a) ; i <= (b); ++i)
#define all(x) (x).begin(), (x).end()
//#define repitr(itr, st) for(auto itr = st.begin(); itr != st.end(); ++itr)
#define P_B push_back
#define PO_B pop_back
#define E_B emplace_back
#define M_P make_pair
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << endl
//#define print(x) printf("%d\n", x)

using namespace std;
using ll = long long;
using Pii = pair<int,int>;
using Pll = pair<ll,ll>;
using VI = vector<int>;
using VL = vector<ll>;
using VVI = vector<vector<int> >;
using VVL = vector<vector<ll> >;
//int dx[4] = {1, 0, -1, 0};
//int dy[4] = {0, 1, 0, -1};
//const ll LINF = (ll)1e18 - 1;
//const int INF = 1e9 - 1;
//int:±2*10^9くらい　ll:±9*10^18くらい

void Main(){
	int H, W;
	cin >> H >> W;
	vector<string> S(H+2);
	VVI hl(H, VI (W,0)), vl(H, VI (W,0));
	FOR(i, 1, H){
		string s;
		cin >> s;
		S[i] = '#' + s + '#';
	}
	rep(i, W+2){
		S[0] += '#';
		S[H+1] += '#';
	}


	//horizontal length
	FOR(i, 1, H){
		int pl = 0;
		stack<int> st;
		FOR(j, 1, W+1){
			if(S[i][j] == '.'){
				pl++;
				st.push(j);
			}else{
				while(!st.empty()){
					int x;
					x = st.top();
					st.pop();
					hl[i-1][x-1] = pl;
				}
				pl = 0;
			}
		}
	}

	FOR(j, 1, W){
		int pl = 0;
		stack<int> st;
		FOR(i, 1, H+1){
			if(S[i][j] == '.'){
				pl++;
				st.push(i);
			}else{
				while(!st.empty()){
					int x;
					x = st.top();
					st.pop();
					vl[x-1][j-1] = pl;
				}
				pl = 0;
			}
		}
	}

	int ans = 0;

	rep(i, H){
		rep(j, W){
			int sum = 0;
			sum = hl[i][j] + vl[i][j] - 1;
			ans = max(ans, sum);
		}
	}


	cout << ans << endl;


}

int main()
{
	cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();

  return 0;
}


Measured memory_bytes: 42520
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
 
#define pll              pair <long long,long long>
#define pb               push_back
#define ll               long long
#define ff               first
#define ss               second
#define D(x)             cerr<<#x " = "<<(x)<<endl
#define vll              vector <ll>
#define IOS              ios_base::sync_with_stdio(0); cin.tie(NULL);
#define endl             '\n'   
using namespace std;
int main()
{
    IOS
 	// freopen("input.txt","r",stdin);
 	// freopen("output.txt","w",stdout);
 	// freopen("error.txt","w",stderr);
 	ll a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
 	ll k;
 	cin>>k;
 	cout<<a[k-1]<<endl;	
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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; }

int main(){
    map<ll,ll> x,y;
    ll h,w,d;
    cin>>h>>w>>d;
    for(ll i=0ll;i<h;i++){
        for(ll j=0ll;j<w;j++){
            ll tmp;
            cin>>tmp;
            x[tmp]=j;y[tmp]=i;
        }
    }
    vector<ll> sum(h*w+d,0ll);
    for(ll i=d+1;i<=h*w;i++){
        sum[i]=sum[i-d]+abs(x[i-d]-x[i])+abs(y[i-d]-y[i]);
    }
    ll q;cin>>q;
    vector<ll> ans;
    for(ll i=0ll;i<q;i++){
        ll l,r;
        cin>>l>>r;
        ans.push_back(sum[r]-sum[l]);
    }
    rep(i,q){
        cout<<ans[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 14076
n = int(input())
a = list(map(int, input().split()))

a = sorted(a, reverse=True)
alice = 0
bob = 0
for i in range(len(a)):
    if i%2==0:
        alice += a[i]
    if i%2==1:
        bob += a[i]
print(alice-bob)

Measured memory_bytes: 9060
(let* ((n (read))
       (r (make-sequence `(vector (integer 0 ,(* 2 (expt 10 5)))) n :initial-element 0)))
  (loop repeat (1- n) for a = (read) do (incf (elt r (1- a))))
  (loop for x across r do (format t "~d~%" x)))

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

int main(void){
    // Your code here!
   int N,Q;
   cin >> N >> Q;
   string S;
   cin >> S;
   
   
   vector<char> t(Q);
   vector<char> d(Q);
   for(int i = 0; i < Q; i++){
       cin >> t.at(i) >> d.at(i);
   }
   
   //右に消えない一番右のもの
   int left = -1,right = N,mid;
   while(right - left > 1){
       mid = (left + right) / 2;
       int mid_now = mid;
       bool l = 0;
       for(int i = 0; i < Q; i++){
           if(0 <= mid_now && mid_now < N && S.at(mid_now) == t.at(i)){
               if(d.at(i) == 'L'){
                   mid_now--;
               }
               else{
                   mid_now++;
               }
           }
           if(mid_now >= N){
               l = 1;
               break;
           }
       }
       if(l == 1){
           right = mid;
       }
       else{
           left = mid;
       }
   }
   
   
   
   int left_2 = -1,right_2 = N,mid_2;
   while(right_2 - left_2 > 1){
       mid_2 = (left_2 + right_2) / 2;
       
       int mid_now_2 = mid_2;
       bool l = 0;
       for(int i = 0; i < Q; i++){
           if(0 <= mid_now_2 && mid_now_2 < N && S.at(mid_now_2) == t.at(i)){
               if(d.at(i) == 'L'){
                   mid_now_2--;
               }
               else{
                   mid_now_2++;
               }
           }
           if(mid_now_2 < 0){
               l = 1;
               break;
           }
       }
       if(l == 1){
           left_2 = mid_2;
       }
       else{
           right_2 = mid_2;
       }
       
       
   }
   
   
   
   cout << max(0,left - left_2) << endl;
   
}


Measured memory_bytes: 900
#include <bits/stdc++.h>
using namespace std;
 
#define sws ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define INFINITO 1000000000
#define ll long long
#define vi vector<int>
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define fo(i, n) for( int i = 0; i < n; i++ )


int main() {

    int n;
    cin >> n;

    int menor = INFINITO;
    fo(i, n) {
        int a;
        cin >> a;
        int cont = 0;
        while ( !(a & 1) ) {
            a /= 2;
            cont++;
        }
        menor = min(cont , menor);
    }

    cout << menor << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
	int S,h,m,s;
	scanf("%d",&S);
	h=S/3600;
	m=(S-3600*h)/60;
	s=(S-3600*h)-60*m;
	printf("%d:%d:%d\n",h,m,s);
	
	return 0;
} 


Measured memory_bytes: 2112
#include<iostream>
using namespace std;
 
class Dice{
		int _num[6];
		
	public:
        void set(int num[6]){
            for(int i = 0; i < 6; i++) _num[i] = num[i];
        }
		int Get(int n){
			return _num[n];
		}
		void N(){
			swap(_num[0],_num[4]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[1]);
		}
		void S(){
			swap(_num[0],_num[1]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[4]);			
		}
		void W(){
			swap(_num[0],_num[3]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[2]);			
		}
		void E(){
			swap(_num[0],_num[2]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[3]);			
		}
		void SetTop(int n){
			if(_num[2] == n) 
				W();
			else if(_num[3] == n)
				E();
			else{
				for(int i = 0; i < 4; i++){
					if(_num[0] == n) break;
					S();
				}
			}
		}
		void SetFront(int n){
			for(int i = 0; i < 4; i++){
				if(_num[1] == n) break;
				S(); W(); N();
			}
		}

		bool SameAs(Dice other){
			other.SetTop(this->Get(0));
			other.SetFront(this->Get(1));
			
			bool same = true;
			for(int i = 0; i < 6; i++){
				if(other.Get(i) != this->Get(i)){
					same = false;
					break;
				}
			}
			return same;
		}
};
 
int main(){
	int n;
	cin >> n;
	
	Dice dice[n];
	for(int i = 0; i < n; i++){
		int num[6];
		for(int j = 0; j < 6; j++){
				cin >> num[j];
		}
		dice[i].set(num);
	}
	
	for(int i = 0; i < n; i++){
		for(int j = i + 1; j < n; j++){
			if(dice[i].SameAs(dice[j])){
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;
}

Measured memory_bytes: 1160