akhauriyash/Code-Regression huggingface dataset:
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

// #include <iomanip>
//  cout << fixed << setprecision(15) << y << endl;

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;
ll M;
ll K;

ll ltmp;
string stmp;
double dtmp;

//vector<string> key;

/*
max 448,000,000
*/

int main(){

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

    cin >> N;
    char S[N];
    map<string,ll> count_map;

    rep(ni,N){
        cin >> S;
        ll count[30]={};

        rep(si,10){
            ll ind = S[si] - 'a';
            count[ind]++;
        }
        string SS = "";
        rep(ci,30) SS = SS + to_string(count[ci]);
        //key.push_back(SS);
        count_map[SS]++;
    }

    ll ans=0;
    for(auto x : count_map) {
        string key = x.first;
        ll value = x.second;
        if(value>=2){
            ans += (value * (value-1) /2);
        }
    }
    cout << ans << endl;
    

    

}

Measured memory_bytes: 16076
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

int n, m, x;
bool a[101];
int main()
{
	cin >> n >> m >> x;
	REP(i, 0, m) {
		int aa;
		cin >> aa;
		a[aa] = true;
	}

	int l = 0, r = 0;
	REP(i, 0, x) {
		if(a[i]) l += a[i];
	}
	REP(j, x + 1, n + 1) {
		if (a[j]) r += a[j];
	}
	cout << min(l, r) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> pll;
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define call(x) (x).cbegin(), (x).cend()
#define pb push_back
const double PI = acos(-1);
const long long INF = (1LL << 60);
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 stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}
ll ceil(const ll a, const ll b){return ((a)+(b)-1)/b;}

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

  ll n;
  cin >> n;
  vector<ll> a;
  ll sum = 0;
  for(ll i = 1; i <= n+1; i++){
    sum += i;
    a.pb(i);
    if(sum > n){
      break;
    }
  }

  ll dec = 0;
  for(ll i = 0; i < a.size(); i++){
    if(sum - a[i] == n) dec = max(dec, i);
  }

  for(ll i = 0; i < a.size(); i++){
    if(i == dec) continue;
    else cout << a[i] << endl;
  }
  return 0;
}

Measured memory_bytes: 384
import java.util.*;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        long X = sc.nextLong();

        long[] layers = new long[100];
        long[] paties = new long[100];
        layers[0] = 1;
        paties[0] = 1;
        for (int i = 1; i <= N; i++) {
            layers[i] = layers[i-1] * 2L + 3;
            paties[i] = paties[i-1] * 2L + 1;
        }
        System.out.println(paty(N, X, layers, paties));
    }

    private static long paty(int N, long X, long[] layers, long[] paties) {
        if (X == 0) {
            return 0;
        }
        if (N == 0) {
            return 1;
        }
        if (X < layers[N - 1] + 2) {
            return paty(N - 1, X - 1, layers, paties);
        } else {
            return paties[N - 1] + 1 + paty(N - 1, X - layers[N - 1] - 2, layers, paties);
        }
    }
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2017/12/16  Problem: ARC 087 C / Link: http://arc087.contest.atcoder.jp/tasks/arc087_c  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----

完全二分木の値がわかると深いとこから値を取ってくるだけで、それのXORの値がゲーム値

----解説ここまで---- */

LL N, L;

LL ans = 0LL;
LL gameval(LL x) {
	//FOR(i, 0, 65) {
	//	if (x &(1LL << i))return 1LL << i;
	//}
	//assert(0);
	return x & -x;
}

int tr[1000006][2];


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

	cin >> N >> L;
	// 0, 1 graph
	fill(*tr, *tr + 1000006 * 2, -1);
	VL h(2*1000006, 0);
	int nsize = 0;
	FOR(kim, 0, N) {
		int cnt = 0;
		string s; cin >> s;

		FOR(i, 0, SZ(s)) {
			int to = s[i] - '0';
			if (tr[cnt][to] == -1) {
				tr[cnt][to] = ++nsize,
				h[nsize] = h[cnt] + 1;
			}
			cnt = tr[cnt][to];
		}
	}
	VL subg;
	for (int i = 0; i <= nsize; ++i){
		int xx = min(tr[i][0], tr[i][1]);
		int yy = max(tr[i][0], tr[i][1]);
		if (xx == -1 && yy > -1) {
			subg.push_back(gameval(L - h[i]));
		}
	}

	FOR(i, 0, SZ(subg)) {
		ans ^= subg[i];
	}
	cout << (ans ? "Alice" : "Bob") << "\n";

	return 0;
}


Measured memory_bytes: 24816
#include<iostream>

using namespace std;

int main()
{
  int a, b, c, d, e, result;
  while(cin>>a>>b>>c>>d>>e) {
    result = 0;
    if(a < 0){
      result += c*(-a);
      a = 0;
    }
    if (a == 0) {
      result += d;
    }
    result += (b-a)*e;
    cout << result << endl;
  }
  return 0;
}


Measured memory_bytes: 3104
/*Arnab's Code
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define vll vector<ll>
#define vii vector<int>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define take(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define takes(a,n,st) for(ll i=st;i<n+st;i++)cin>>a[i]
ll sum(ll a[],ll n,ll s){ for(ll i=0;i<n;i++)s+=a[i]; return s;}
#define mod 1000000009
ll power(ll x, ll y, ll p)  {  
    ll res = 1;  
    x = x % p;   
    if (x == 0) return 0;  
    while (y > 0){  
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1;
        x = (x*x) % p;  
    }  
    return res;  
}
ll cone[200017];
ll ctwo[200017];
char s[200017];
void solve(){
	ll n,i,tone,ttwo,cr,cw,mini,tot;
	cin>>n;
	cin>>s;
	mini=n+1;
	cone[0]=0;
	ctwo[0]=0;
	for(i=0;i<n;i++){
		if(s[i]=='R'){
			cone[i+1]=cone[i]+1;
			ctwo[i+1]=ctwo[i];
		}
		else{
			cone[i+1]=cone[i];
			ctwo[i+1]=ctwo[i]+1;
		}
	}
	tone=cone[n];
	ttwo=ctwo[n];
	for(i=0;i<=n;i++){
		cr=ctwo[i];
		cw=tone-cone[i];
		tot=cr+cw;
		tot-=min(ctwo[i],tone-cone[i]);
//		cout<<cr<<" "<<cw<<endl;
		if(mini > tot)
			mini=tot;;
	}
	cout<<mini;
	return;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	ll t,T;
//	cin>>T;
	T=1;
	for(t=1;t<=T;t++){
//		cout<<"Case #"<<t<<": ";
		solve();
	}
	return 0;
}

Measured memory_bytes: 6960
// g++ -std=c++14 -O2 -Wall qa.cpp
#include <bits/stdc++.h>
using namespace std;

typedef long long 		ll;
typedef vector<int>		VI;
typedef vector<bool>  	VB;
typedef vector<ll>  	VLL;
typedef pair<int, int>  PII;
typedef pair <ll, ll>  	PLL;
typedef vector<PII>  	VPII;
typedef tuple<int,int,int>  TI;

typedef unordered_set<int> USI;
typedef set<int> SI;

typedef unordered_map<int, int> UMP;
typedef map<int, int> MP;

typedef queue<int> QI;
typedef queue<PII> QP;

typedef priority_queue<int> PQI;
typedef priority_queue<PII> PQP;

#define sc(n)		scanf("%d",&n)
#define sc2(i,j)	scanf("%d%d",&i,&j)
#define sc3(i,j,k)	scanf("%d%d%d",&i,&j,&k)
#define scl(n) 		scanf("%lld",&n)
#define scf(n) 		scanf("%lf",&n)
#define scs(n)  	scanf("%s",n)

#define FOR(i,x,y) 	for(int i=(x); i<=(y); i++)
#define REV(i,x,y) 	for(int i=(x); i>=(y); i--)
#define ALL(v) 		(v).begin(),(v).end()
#define SZ(v) 		(int)v.size()

#define PR(i)		printf("%d\n", (i))
#define PRL(i)		printf("%lld\n", (i))
#define PRA(arr)	FOR(i,0,(arr.size()-1)){ cout << arr[i] << " ";} cout << "\n"
#define PRV(v)		for(auto i : v) { cout << i << " ";} cout << "\n"

#define DBG2(i,j)	cout <<"DBG: "<< i << " " << j << endl
#define DBG3(i,j,k)	cout <<"DBG: "<< i << " " << j << " " << k << endl

#define bit(x,i) (x&(1<<i)) //ith bit of x;
#define ceilint(a,k) ((a-1)/k + 1) // round up a/k
#define min3(x,y,z) min(x,min(y,z))
#define max3(x,y,z) max(x,max(y,z))

#define mt make_tuple
#define pb push_back
#define fi first
#define se second
#define mod 1000000007
    int a,w,t,r;
int main() {
	ios::sync_with_stdio(false);
    int n;
    cin >> n;
    string s;

    getline(cin, s);
    FOR(i,1,n){
        getline(cin, s);
        if(s == "AC") a++;
        else if(s == "WA") w++;
        else if(s == "TLE") t++;
        else if (s == "RE") r++;
        else assert(false);
    }

    printf("AC x %d\n", a);
    printf("WA x %d\n", w);
    printf("TLE x %d\n", t);
    printf("RE x %d\n", r);

	return 0;
}


Measured memory_bytes: 3752
package main

import (
	"fmt"
)

func main() {
	for {
		var a, b int
		var op string
		fmt.Scan(&a)
		fmt.Scan(&op)
		fmt.Scan(&b)

		if op == "?" {
			break
		}

		var ans int
		switch op {
		case "+":
			ans = a + b
		case "-":
			ans = a - b
		case "*":
			ans = a * b
		case "/":
			ans = a / b
		}
		fmt.Println(ans)
	}
}



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


typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(v) (v).rbegin(),(v).rend()
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define PB push


#define MOD 1000000007LL
#define EPS 1e-10

struct UnionFind
{
  vector< int > data;

  UnionFind(int sz)
  {
    data.assign(sz, -1);
  }

  bool unite(int x, int y)
  {
    x = find(x), y = find(y);
    if(x == y) return(false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return(true);
  }

  int find(int k)
  {
    if(data[k] < 0) return(k);
    return(data[k] = find(data[k]));
  }

  int size(int k)
  {
    return(-data[find(k)]);
  }

  bool same(int x, int y)
  {
      return find(x) == find(y);
  }
};

int main()
{
    int N;
    cin >> N;
    vector<vector<int> > A(2);
    REP(i, 2) A[i].resize(N);
    REP(i, 2) REP(j, N) cin >> A[i][j];
    int ans = 0;
    REP(i, N)
    {
        int score = 0;
        REP(j, N)
        {
            if (j <= i)
            {
                score += A[0][j];
            }
            if (j >= i)
            {
                score += A[1][j];
            }
        }
        ans = max(ans, score);
    }
    cout << ans << endl;
    return 0;
}


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

int main(){
    int A1,A2,A3;
    cin >> A1 >> A2 >> A3 ;
    if(A1 + A2 + A3 >= 22){
        cout << "bust" << endl;
    }
    else cout << "win" << endl;
    return 0;
}

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

using namespace std;

int main() {
	long long N;
	cin >> N;
	N *= 3;
	long long a[1000000];
	long long sum = 0;
	long long cnt = 1;

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

	sort(a+1, a+1+N);

	for (int i = N - 1; i >= cnt; i-=2) {
		sum += a[i];
		cnt++;
	}

	cout << sum << endl;
	return 0;
}

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

#define int long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
 
#if 1
//-------------
// DUMPマクロ
// https://www.creativ.xyz/dump-cpp-652/
 
// vector
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    for (T& x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&& ... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}
#ifdef DEBUG
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
#endif


signed main() {
    string s;
    cin>>s;
    
    int ans=0;
    rep(i,s.size()){
        if(s[i]=='1') ans++;
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
char in[110];
long long x[60];
long long y[60];
set<pair<long long,long long> > S;
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++){
		scanf("%lld%lld",x+i,y+i);
		S.insert(make_pair(x[i],y[i]));
	}
	if(a==1){
		printf("1\n");return 0;
	}
	int ret=mod;
	for(int i=0;i<a;i++)for(int j=0;j<a;j++){
		if(i==j)continue;
		int tmp=0;
		for(int k=0;k<a;k++){
			if(S.count(make_pair(x[k]+(x[i]-x[j]),y[k]+(y[i]-y[j])))==0){
				tmp++;
			}
		}
		ret=min(ret,tmp);
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
void f(string s,int n,char c) {
  char b;
  if (n==0) cout<<s<<endl;
  else {
    for (b='a';b<=c;b++) {
      if (b==c) f(s+b,n-1,c+1);
      else f(s+b,n-1,c);
    }
  }
}
int main() {
  int n;
  cin>>n;
  f("",n,'a');
}

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

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


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0;i < n;i++)
const long long INF = 1LL << 60;

int MOD = 1000000007;

int main(){
    std::ios_base::sync_with_stdio(false);

    string s; cin >> s;
    int n = s.size();

    if(n%2==0){
        int left = n/2-1;
        int right = n/2;
        int k=0;

        if(s[left] != s[right]){
            cout << n/2 << endl;
            return 0;
        }

        while(true){
            if(right+k >= n || s[right+k] != s[right] || s[left-k] != s[left]){
                break;
            }
            k++;
        }

        cout << right+k << endl;
    }else{
        int mid = n/2;
        int k=0;

        while(true){
            if(mid+k >= n || s[mid+k] != s[mid] || s[mid-k] != s[mid]){
                break;
            }
            k++;
        }

        cout << mid+k << endl;

    }


    return 0;
}


Measured memory_bytes: 512
// Problem : D - Maximum Average Sets
// Contest : AtCoder - AtCoder Beginner Contest 057
// URL : https://atcoder.jp/contests/abc057/tasks/abc057_d
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#define eb emplace_back
#define pb push_back
#define size(s) (int)s.size()
#define int long long
#define vi vector<int>
#define vs vector<string>
#define vv vector<vector<int>>
#define pii pair<int,int>
#define m_p(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define inc(v,n,x) v.assign(n,x)
#define incd(v,n) v.resize(n)
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inimi(n) memset(n,0xc0,sizeof(n))
#define inima(n) memset(n,0x3f,sizeof(n))
#define all(v) (v).begin(),(v).end()

using namespace std;

template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }

double pi=acos(-1.0);
const int md=1e9+7;
const int INF=1e17;
int dx1[]={0,0,-1,1};
int dy1[]={1,-1,0,0};

template<class T>
T abst(T a)
{return a<0?-a:a;}

template<class T>
T max2(T a,T b){return a>b?a:b;}
template<class T>
T min2(T a,T b){return a<b?a:b;}
int n,a,b;
vi v;
int ncr(int x,int y)
{
	int ans=1;
	for(int i=x;i>=x-y+1;i--)
	{
		ans*=i;
		ans/=(x-i+1);
	}
	return ans;
}
void solve()
{
cin>>n>>a>>b;
incd(v,n);cin>>v;
sort(all(v),greater<int>());
map<int,int> par;
for(int i:v)
par[i]++;
map<long double,int> cntf;
for(int i=a;i<=b;i++)
{
	long double sum=0;
	map<int,int> ch;
	for(int j=0;j<i;j++)
	ch[v[j]]++,sum+=v[j];
	int cnt=1;
	sum/=double(i);
	for(pii p:ch)
	{
		cnt*=ncr(par[p.f],p.se);
	}
	cntf[sum]+=cnt;
}
auto it=cntf.end();it--;
cout<<fixed<<setprecision(9)<<it->f;
cout<<"\n"<<it->se;
}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
for(int i=1;i<=t;i++)
{
    solve();
}
return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v, w, c; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
int INF = INT_MAX / 100;

int main() {
	for (;;) {
		int N, M; cin >> N >> M;
		if (N == 0) break;
		vector< vector< edge> > G(N);
		while (M--) {
			int u, v, w, c;
			cin >> u >> v >> w >> c;
			u--; v--;
			edge e = {u, v, w, c};
			G[u].push_back(e);
			edge _e = {v, u, w, c};
			G[v].push_back(_e);
		}
		vector<int> d(N, INT_MAX), c(N, INT_MAX);
		d[0] = c[0] = 0;
		priority_queue<i_i, vector<i_i>, greater<i_i> > pq;
		pq.push(i_i(0, 0));
		int ans = 0;
		while (!pq.empty()) {
			i_i p = pq.top(); pq.pop();
			int u = p.second;
			if (p.first > d[u]) continue;
			ans += c[u];
			for (int i = 0; i < G[u].size(); i++) {
				edge e = G[u][i];
				if (d[u] + e.w < d[e.v]) {
					d[e.v] = d[u] + e.w;
					c[e.v] = e.c;
					pq.push(i_i(d[e.v], e.v));
				}
				else if (d[u] + e.w == d[e.v] && e.c < c[e.v])
					c[e.v] = e.c;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 2580
#include <stdio.h>
#include <stdlib.h>

int main() {
    int n; scanf("%d", &n);

    int G[n+1];

    for (int j = 0; j < n; j++) {
        for (int i = 0; i <= n; i++) G[i] = 0;

        int l, cnt;
        scanf("%d %d", &l, &cnt);

        for (int i = 0; i < cnt; i++) {
            int v; scanf("%d", &v);
            G[v] = 1;
        }

        for (int i = 1; i <= n; i++) {
            printf("%d", G[i]);
            if (i == n) printf("\n");
            else printf(" ");
        }
    }

    return 0;
}



Measured memory_bytes: 2108
#include<bits/stdc++.h>
#define pi 3.1415926535897932384626
using namespace std;
      
struct P{
  int x,y,z;
  bool operator < (const P &a )const{
    //if(y!=a.y)
    return y>a.y;
  };
};

int a,b,c,d,i,k,n,m,e[333],dx[10]={1,0,-1,0,1,1,-1,-1},dy[10]={0,1,0,-1,1,-1,1,-1};
int o[331];
int l[331];
int j[331];

long long x,y,z,mod=1000000007;
//string r;
char r[332][333];

P u[1];
queue<int> q;
stack<int> s;
//set<int> s;
map<int,int> p;

vector<P> v[333];


bool as(P a,P b)
{
  if(a.x!=b.x)
  return a.x<b.x;
  return a.y>b.y;
}

void add(int n,int m,int k)
{
  v[n].push_back({m,k,(int)v[m].size()});
  v[m].push_back({n,k,(int)v[n].size()-1});
}

void dfs()
{
  memset(l,0,sizeof(l));
  l[d]=1;
  q.push(d);
  for(;q.size();q.pop())
  for(int h=0;h<v[q.front()].size();h++)
  if(v[q.front()][h].y&&l[v[q.front()][h].x]==0)
  {
    l[v[q.front()][h].x]=l[q.front()]+1;
    q.push(v[q.front()][h].x);
  }
}

int f(int n,int m,int k)
{
  if(n==m) return k;
  for(;e[n]<v[n].size();e[n]++)
  if(v[n][e[n]].y&&l[n]+1==l[v[n][e[n]].x])
  {
    int p=f(v[n][e[n]].x,m,min(k,v[n][e[n]].y));
    if(p)
    {
      v[n][e[n]].y-=p;
      v[v[n][e[n]].x][v[n][e[n]].z].y+=p;
      return p;
    }
  }
  return 0;
}

int main()
{
  scanf("%d %d",&a,&b);
  iota(j+1,j+310,1);
  for(int t=1;t<=a;t++)
  {
    scanf("%s",r[t]+1);
    for(int w=1;w<=b;w++)
    {
      if(r[t][w]=='S')
      j[w+100]=t,d=t,n=w;
      else if(r[t][w]=='T')
      j[w+100]=t,c=t,m=w;
    }
  }
  if(d==c||n==m)
  {
    puts("-1");
    return 0;
  }
  for(int t=1;t<=a;t++)
  for(int w=1;w<=b;w++)
  if(r[t][w]=='o')
    add(j[t],j[w+100],1);
  for(;;)
  {
    dfs();
    if(!l[c]) break;
    memset(e,0,sizeof(e));
    int p=f(d,c,mod);
    if(p)
    {
      k+=p;
      
    }
    else break;
  }
  printf("%d",k);
  
}
//6




Measured memory_bytes: 640
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define C 0.5772156649
#define pi acos(-1.0)
#define ll long long
#define mod 1000000007
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1

using namespace std;

const double g=10.0,eps=1e-12;
const int N=100+10,maxn=90000+10,inf=0x3f3f3f3f;

ll a[N];
pii ans[N];
int main()
{
    int n;
    scanf("%d",&n);
    ll maxx=-1e6-10,maxxid,minn=1e6+10,minnid;
    for(int i=1;i<=n;i++)
    {
        scanf("%lld",&a[i]);
        if(maxx<a[i])
        {
            maxx=a[i];
            maxxid=i;
        }
        if(minn>a[i])
        {
            minn=a[i];
            minnid=i;
        }
    }
    int sz=0;
    if(abs(maxx)>abs(minn))
    {
        a[1]+=a[maxxid];
        a[1]+=a[maxxid];
        ans[sz++]=mp(maxxid,1);
        ans[sz++]=mp(maxxid,1);
        for(int i=2;i<=n;i++)
        {
            ans[sz++]=mp(i-1,i);
            ans[sz++]=mp(i-1,i);
            a[i]+=a[i-1];
            a[i]+=a[i-1];
        }
    }
    else
    {
        a[n]+=a[minnid];
        a[n]+=a[minnid];
        ans[sz++]=mp(minnid,n);
        ans[sz++]=mp(minnid,n);
        for(int i=n-1;i>=1;i--)
        {
            ans[sz++]=mp(i+1,i);
            ans[sz++]=mp(i+1,i);
            a[i]+=a[i+1];
            a[i]+=a[i+1];
        }
    }
    printf("%d\n",sz);
    for(int i=0;i<sz;i++)
        printf("%d %d\n",ans[i].fi,ans[i].se);
    return 0;
}
/********************

********************/


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<list>

using namespace std;

int  main(int arg,char** argc)
{
    long long int sum=0,n,a;
  	cin>>n>>a;
  	vector<int> ar(a,0);
  for(int i=0;i<a;i++)
  {
    cin>>ar[i];
    sum+=ar[i];
  }
  if(sum>=n)
  {
    cout<<"Yes\n";
  }
  else
    cout<<"No\n";
    return 0;
}


Measured memory_bytes: 640
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

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

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

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

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

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

fn main() {
    input! {
        n: i32, m: i32,
        mut list: [(i32, i32); m]
    }
    let mut count = 0;
    list.sort_by_key(|&(_, y)| y);
    while !list.is_empty() {
        let (_, by) = list[0];
        let mut rem: Vec<usize> = Vec::new();
        list.remove(0);
        for (i, &(tx, ty)) in list.iter().enumerate() {
            if tx < by && by <= ty {
                rem.push(i);
            }
        }
        rem.reverse();
        for i in rem {
            list.remove(i);
        }
        count += 1;
    }

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


Measured memory_bytes: 6396
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n; cin >> n;
	map<int,int> occ;
	for(int i = 0; i < n; i++){
		int x; cin >> x;
		if(i == 0){
			if(x){
				cout << 0 << endl;
				return 0;
			}
		}
		occ[x]++;
	}
	int last = -1, vlas = 1;
        long long ans = 1;
	if(occ[0] != 1) ans = 0;
	for(auto it : occ){
		if(it.first != last + 1){
			ans = 0;	
		} else {
			for(int j = 0; j < it.second; j++)
			ans *= vlas,
			ans %= 998244353;
			last = it.first;
			vlas = it.second;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4992
#include<iostream>
using namespace std;
int main()
{int j;
 cin>>j;
 cout<<"\n";
 float a[j];
 for (int i=0;i<j;i++)
 {cin>>a[i];
  
 }
float sum=0.0;
 float p;
for (int f=0;f<j;f++)
     { p=1/a[f];
     
       sum=sum+p;
     }
float v=1/sum;
 cout<<v;
 return 0;
}

Measured memory_bytes: 888
a=0
lists=[0]
minb = 0
for _ in range(5):
    b=input()
    if b[-1]!='0':
        lists.append(10-int(b[-1]))
        if len(b) != 1:
            a=a+(int(b[:-1])+1)*10
        else:
            a=a+10
    else:
        a=a+int(b)
print(a-max(lists))

Measured memory_bytes: 3060
fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    val h = readLine()!!.split(" ").map { it.toInt() }
    var maxH = 0
    var ans = 0
    for(i in h) {
        if(i >= maxH) {
            ans++
            maxH = i
        }
    }
    println(ans)
}


Measured memory_bytes: 36544
#![allow(non_snake_case)]

use std::io::{stdin, Read};
use std::str::FromStr;
fn read_option<T: FromStr>() -> Option<T> {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok()
}
fn read<T: FromStr>() -> T {
    let opt = read_option();
    opt.expect("failed to parse token")
}

fn main() {
    let _: usize = read();
    let S: String = read();
    // "(" は左から、")"は右から埋めることで辞書順最小を実現
    let mut stack: Vec<char> = vec![];
    for c in S.chars() {
        if stack.is_empty() {
            stack.push(c);
            continue;
        }
        let last = stack.pop().unwrap();
        if last == c || (last == ')' && c == '(') {
            stack.push(last);
            stack.push(c);
        }
    }
    let left_count = stack
        .iter()
        .fold(0, |acc, &x| if x == ')' { acc + 1 } else { acc });
    let right_count = stack.len() - left_count;
    println!(
        "{}",
        (0..left_count).map(|_| '(').collect::<String>()
            + &S
            + &(0..right_count).map(|_| ')').collect::<String>()
    );
}


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

int main() {
    int a, b, c;
    cin >> a >> b >>c;
    while(!(a==-1&&b==-1 && c==-1)) {
        int sum = a+b;
        if (a==-1 || b==-1 || sum <30) {
            cout << "F" <<endl;
        } else if (sum >=80) {
            cout << "A" <<endl;
        } else if (sum>=65 && sum <80) {
            cout << "B" <<endl;
        } else if (sum>=50 && sum <65) {
            cout << "C" <<endl;
        } else if (sum>=30 && sum <50) {
            if (c>=50) {
                cout << "C" <<endl;
            } else {
                cout << "D" <<endl;
            }
        }

        cin >> a >> b >>c;
    }
    return 0;
}



Measured memory_bytes: 3096
#include <cstdio>

int main()
{
    int n;
    scanf("%d", &n);

    const int MAX = 3500;

    for(int i = 1; i <= MAX; i++)
    {
        for(int j = i + 1; j <= MAX; j++)
        {
            long long numerator = n*1LL*i*j;
            long long denominator = 4LL*i*j - (i + j)*1LL*n;

            if(denominator > 0 && numerator%denominator == 0)
            {
                long long k = numerator/denominator;

                printf("%d %d %lld\n", i, j, k);

                return 0;
            }
        }
    }
    return 0;
}


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

int main(){
	int a,b,c,n,r,R;
	while( cin >> a >> b >> c , a || b || c ){
		cin >> n;
		for(int i=0 ; i < n ; i++ ){
			bool ans = true;
			cin >> r;
			R = min( min( sqrt(a*a+b*b),sqrt(b*b+c*c) ),sqrt(c*c+a*a) );
			if( 2*r <= R ) ans = false;
			cout << (ans?"OK":"NA") << endl;
		}
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool compare(const pair<int,int> &a,const pair<int,int> &b){
	return a.first < b.first;
}



int main(void){
	int n,m;
	cin >> n >> m;
	vector<pair<int,int>> arr(n);
	for(int i=0; i<n; ++i){
		int a,b;
		cin >> a >> b;
		arr[i] = make_pair(a,b);
	}

    sort(arr.begin(), arr.end(), compare);

	int count = 0;
	long long price = 0;
	for(int i=0; i<n; ++i){
		if( count + arr[i].second < m ){
			count += arr[i].second;
			price += (long long)arr[i].first * arr[i].second;
		}
		else {
			int remain = m - count;
			count += remain;
			price += (long long)arr[i].first * remain;
			break;
		}
	}
	cout << price << endl;

	return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>

int main(){
  int n,i,j,k,a[16][16];
  while(1)
    {
      scanf("%d",&n);
      if(n != 0)
	{
	  for(i=0;i<n+1;i++)
	    {
	      for(j=0;j<n+1;j++)
		{
		  a[i][j] = 0;
		}
	    }

	  for(i=0;i<n;i++)
	    {
	      for(j=0;j<n;j++)
		{
		  scanf("%d",&a[i][j]);
		}
	    }

	  for(i=0;i<n;i++)
	    {
	      for(j=0;j<n;j++)
		{
		  a[i][n] += a[i][j];
		}
	    }

	  for(i=0;i<n;i++)
	    {
	      for(j=0;j<n+1;j++)
		{
		  a[n][j] += a[i][j];
		}
	    }

	  for(i=0;i<n+1;i++)
	    {
	      for(j=0;j<n+1;j++)
		{
		  if(j<n)
		    printf("%5d",a[i][j]);
		  else
		    printf("%5d\n",a[i][j]);
		}
	    }
	}
      else
	break;
    }
  return 0;
}

Measured memory_bytes: 612
import heapq
from collections import defaultdict, deque
from math import ceil, factorial, gcd
from itertools import accumulate, permutations
import sys
import bisect


sys.setrecursionlimit(10 ** 7)
INF = float("inf")
MOD = 10 ** 9 + 7

si = lambda: input().strip()
ii = lambda: int(input())
mii = lambda: map(int, input().split())
msi = lambda: map(str, input().split())
lmii = lambda: list(map(int, input().split()))
lmsi = lambda: list(map(str, input().split()))
smii = lambda: sorted(map(int, input().split()))


# ----------

N, K = mii()
snuke = set()
for i in range(K):
    d = ii()
    A = lmii()
    for a in A:
        snuke.add(a)
ans = 0
for i in range(1, N+1):
    if i not in snuke:
        ans += 1
print(ans)



Measured memory_bytes: 68024
#include<cstdio>
int l, r;
bool ans = true;
int main()
{
	scanf("%d%d",&l, &r);
	for(int i = l;i <= r;i++){
		if(i == 0){
			printf("Zero");
			return 0;
		}else if(i < 0){
			ans = !ans;
		}
	}
	if(ans > 0) printf("Positive");
	else printf("Negative");
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<string>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int cont=0;
    int b[105];
    memset(b,0,sizeof(b));
    for(int i=0;i<n;i++)
    {
        int a;
        cin>>a;
        if(a>=1&&a<=399) b[0]=1;
        else if(a>=400&&a<=799)b[1]=1;
        else if(a>=800&&a<=1199)b[2]=1;
        else if(a>=1200&&a<=1599)b[3]=1;
        else if(a>=1600&&a<=1999)b[4]=1;
        else if(a>=2000&&a<=2399)b[5]=1;
        else if(a>=2400&&a<=2799)b[6]=1;
        else if(a>=2800&&a<=3199)b[7]=1;
        else cont++;
    }
    int re=0;
    for(int i=0;i<8;i++)
        re+=b[i];
    if(re==0)cout<<1<<" "<<cont<<endl;
    else
    cout<<re<<" "<<cont+re<<endl;
}


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

using namespace std;

vector<vector<int>> dp;  
vector<int> w;

int rec(int l,int r){
  if(dp[l][r]!=-1)return dp[l][r];
  if(abs(r-l)<=1)return 0;
  int res=0;
  if(abs(w[l]-w[r-1])<=1 && rec(l+1,r-1)==r-l-2)res=r-l;

  for(int mid=l+1;mid<r;mid++){
    res=max(res,rec(l,mid)+rec(mid,r));
  }

  return dp[l][r]=res;

}

int main(){

  int n;
  cin >> n;

  while(n!=0){
    w.resize(n);
    for(int i=0;i<n;i++)cin >> w[i];

    dp.resize(n+1);
    for(int i=0;i<n+1;i++){
      dp[i].resize(n+1);
      for(int j=0;j<n+1;j++){
        dp[i][j]=-1;
      }
    }

    cout << rec(0,n) << endl;

    cin >> n;
  }

}


Measured memory_bytes: 3216
p = 10**9+7
def pow(x,m):
    if m==0:
        return 1
    if m==1:
        return x
    if m%2==0:
        return (pow(x,m//2)**2)%p
    else:
        return (x*(pow(x,(m-1)//2)**2)%p)%p
    
n,k = map(int,input().split())
A = [1 for _ in range(n+1)]
for i in range(2,n+1):
    A[i] = (i*A[i-1])%p
B = [1 for _ in range(n+1)]
B[n] = pow(A[n],p-2)
for i in range(n-1,1,-1):
    B[i] = (B[i+1]*(i+1))%p

cnt = 0
for i in range(min(k,n-1)+1):
    a = (A[n]*B[n-i]*B[i])%p
    b = (A[n-1]*B[n-1-i]*B[i])%p
    cnt = (cnt+a*b)%p
print(cnt)

Measured memory_bytes: 67148
import sys
sys.setrecursionlimit(10**8)

n=int(input())
a=list(map(float,input().split()))
dp=[[0.0 for _ in range(n+1)] for _ in range(n+1)]
dp[1][1]=a[0]
dp[1][0]=1-a[0]
 
for i in range(2, n+1):
    for j in range(i+1):
        dp[i][j]=a[i - 1] * dp[i - 1][j - 1]+(1 - a[i - 1])*dp[i - 1][j]
 
print(sum(dp[n][n // 2 + 1:]))

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

int main() {
  int n;
  cin >> n;
  string s = to_string(n);
  int S=0;
  for(int i=0;i<s.size();i++){
    string tmp = "";
    tmp += s.at(i);
    S += stoi(tmp);
  }
  if( n%S == 0 ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  return 0;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int n, mod, a;
	string s;
	cin>>n>>s;

	for(int i=0; i<s.length();++i){
		a = (s[i] - 'A' + n)%26;
		cout<<char('A'+a);
	}
	return 0;
}

Measured memory_bytes: 256
using System;

namespace csharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string str = Console.ReadLine();

            string[] vals = str.Split(' ');

            int k = int.Parse(vals[0]);
            int x = int.Parse(vals[1]);

            for( int i = x - k + 1; i < x + k; i++)
            {
                Console.Write(i);
                Console.Write(" ");
            }

            return;

        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
template <class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
struct io { io() { ios::sync_with_stdio(false); cin.tie(0); } };
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;


signed main(void) 
{
    ll n;
    cin >>n;
    vll a(n);
    double r = 0.0;
    rep(i, n) {
        cin >>a[i];
    }
    Sort(a);
    
    r = a[0];
    rrep(i, n-1) {
        r += (double)a[i];
        r = (double)r / 2;
    }
    
    mes(r);

    
    
    
    
    
    

}


Measured memory_bytes: 3812
#include <cstdint>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <utility>

constexpr long double pi = std::acos(-1.0L);

int main() {
  int r;
  scanf("%d", &r);

  printf("%.20Lf\n", 2.0L*r*pi);
}


Measured memory_bytes: 1720
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int k;
  string s;
  cin >> k >> s;
  if (s.size() <= k)
    cout << s << endl;
  else
    cout << s.substr(0, k) << "..." << endl;
}


Measured memory_bytes: 3620
n, k = map(int, input().split())
p_list = list(map(int, input().split()))
tmp = sum(p_list[:k])
max_num = sum(p_list[:k])
for i in range(len(p_list)-k):
  tmp = tmp - p_list[i] + p_list[i+k]
  if tmp >= max_num:
    max_num = tmp
print((max_num+k)/2)

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

int main()
{
    int n, q, x;

    set<int> a;

    cin >> n;

    for( int i = 0; i < n; i++ )
    {
        cin >> q >> x;
        if( q == 0 )
        {
            a.insert(x);
            cout << a.size() << endl;
        }
        else if( q == 1 )
        {    
            if( a.find(x) != a.end() )              //findは戻り値として値が格納されている場所のイテレータを返す。値が存在しない場合end()の位置を返す。
                cout << 1 << endl;
            else
                cout << 0 << endl;
        }
        else
            a.erase(x);
    }
    return 0;
}


Measured memory_bytes: 12464
# dpE
import sys
input = sys.stdin.readline

def main():
    N, W = tuple(map(int, input().split()))
    A = tuple(tuple(map(int, input().split())) for _ in range(N))
    lim = 10 ** 5
    dp = [0] + [float("inf")] * lim
    for i in range(N):
        for j in range(lim, A[i][1] - 1, -1):
            dp[j] = min(dp[j], dp[j - A[i][1]] + A[i][0])
    ans = [i for i, j in enumerate(dp) if j <= W]
    print(max(ans))


if __name__ == "__main__":
    main()


Measured memory_bytes: 72636
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int A,B;
		do {
			A = stdIn.nextInt();
			B = stdIn.nextInt();
	}while((A<1||A>3)&&(B<1||B>3));
		int x = 0;
		switch(A) {
		case 1: if(B==2) {
			x = 3;
			break;
		}else {
			x = 2;
			break;
		}
		case 2 : if(B == 1) {
			x = 3;
			break;
		}else {
			x = 1;
			break;
		}
		case 3 : if(B==1) {
			x = 2;
			break;
		}else {
			x = 1;
			break;
		}
		}
		System.out.println(x);
	}
}


Measured memory_bytes: 21076
import java.util.Scanner;

public class Main {
//  private static boolean isOverlapped(int al, int ar, int bl, int br) {
//      return al < br && ar > bl;
//  }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
//      if (isOverlapped(a, a+w, b, b+w)) {
//          System.out.println(0);
//      } else {
            System.out.println(Math.max(0, Math.abs(a - b) - w));
//      }
    }
}

Measured memory_bytes: 22484
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int a, b, c, d, e, f, g, h, i;
  a = N / 100000000;
  b = N % 100000000 / 10000000;
  c = N % 100000000 % 10000000 / 1000000;
  d = N % 100000000 % 10000000 % 1000000 / 100000;
  e = N % 100000000 % 10000000 % 1000000 % 100000 / 10000;
  f = N % 100000000 % 10000000 % 1000000 % 100000 % 10000 / 1000;
  g = N % 100000000 % 10000000 % 1000000 % 100000 % 10000 % 1000 / 100;
  h = N % 100000000 % 10000000 % 1000000 % 100000 % 10000 % 1000 % 100 / 10;
  i = N % 100000000 % 10000000 % 1000000 % 100000 % 10000 % 1000 % 100 % 10;
  int M = a + b + c + d + e + f + g + h + i;
  if (N % M == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

using namespace std;

int main()
{
	string s;
	cin >> s;
	bool ans[3] = { false };
	for (int i = 0; i < 3; i++) {
		ans[s[i] - 'a'] = true;
	}
	cout << (ans[0] && ans[1] && ans[2] ? "Yes" : "No") << endl;

	return 0;
}

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

int main() {
    ll n,z,w;
    std::cin >> n>>z>>w;
    vector<ll> a(n);
    for (int i = 0; i < n; i++) {
        std::cin >> a[i];
    }
    if(n==1){
        std::cout << abs(a[0]-w) << std::endl;
    }else{
        std::cout << max(abs(a[n-1]-w),abs(a[n-2]-a[n-1])) << std::endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    vector<int> A(n+1, 0);
    ll ans = 0;
    for(int i=1;i<=n;i++){
        cin>>A[i];
    }
    for(int i=1; i<=n-1; i++){
        if(A[i]%2==1){
            if(A[i+1]!=0){
                A[i]--;
                A[i+1]--;
                ans++;
            }
        }
    }
    for(int i=1; i<=n; i++){
        ans += A[i]/2;
    }
    cout<<ans<<endl;
}

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

int main(void){
    vector<int> S(3);
    for(int i=0;i<3;i++) cin>>S[i];
    
    sort(S.begin(),S.end());
    int A=S[0];
    int B=S[1];
    int C=S[2];
    
    int count=0;
    if((B-A)%2!=0){
        A++;
        C++;
        count++;
        count+=(B-A)/2;
    }else{
        count+=(B-A)/2;
    }
    
    count+=(C-B);    
    
    cout<<count<<endl;
}

Measured memory_bytes: 256
using System;
class ProgramB
    {
        static void Main(string[] args)
        {
            
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);


            //hとwの大小を比較して、おおきい方で塗っていく。割り切れるときと割り切れないときで回数が違うので場合分け
            if(a >= b)
            {
                for(int i = 0;i < a;i++)
                    Console.Write(b);
                
            }
            else
            {
                for(int i = 0;i < b;i++)
                    Console.Write(a);
            }
    
        }
    }

Measured memory_bytes: 11092