akhauriyash/Code-Regression huggingface dataset:
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

int N,cnt,ans,i,j;
inline void solve(){
  IN(N);
  for(i=1;i<=N;i+=2){
    cnt=0;
    for(j=1;j<=i;j++){
      if(i%j==0)cnt++;
    }
    if(cnt==8)ans++;
  }
  OUT(ans);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


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

using ll =  long long;
using pint =  pair<int,int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vpint = vector<pint>;

#define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x,v) for(auto& (x) : (v))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fsort(v,lambda) sort(all((v)),(lambda))
#define vin(v) rep(i,(v).size())cin >> (v)[i];
#define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second
//最終奥義 #define int long long
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; }
//lambda: [](int x, int y){return x<y;}

signed main(void){
    int n,m;cin>>n>>m;
    vpint sc(m);
    rep(i,m)cin>>sc[i].first>>sc[i].second;
    char ans[n+1];
    rep(i,n)ans[i]='-';
    ans[n]='\0';
    rfor(p,sc){
        int k=p.first-1;
        if(ans[k]!='-'&&ans[k]!='0'+p.second){
            cout << -1 << endl;
            return 0;
        }
        if(n!=1&&k==0&&p.second==0){
            cout << -1 << endl;
            return 0;
        }
        ans[k]='0'+p.second;
    }
    
    rep(i,n)if(ans[i]=='-')ans[i]='0';
    if(n!=1&&ans[0]=='0')ans[0]='1';
    if(n==1&&ans[0]=='-')ans[0]='0';
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using  namespace std;
int main(){
    long long n, a, check, ans=-1;
    cin >> n;
    map<long long, long long> A;
    for(long long i=0;i<n;i++){
        cin >> a;
        A[a]++;
    }
    for(auto itr=A.begin();itr!=A.end();itr++){
        check = itr->second;
      	if(A.find(itr->first+1)!=A.end()){
          check += A[itr->first+1];
        }
      	if(A.find(itr->first-1)!=A.end()){
          check += A[itr->first-1];
        }
        ans = max(ans, check);
    }
    
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4224
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const int maxn = 1e2 + 5;
const int mod = 1e9+7;
int n, m;
int mp[maxn][maxn];
int dis[maxn][maxn];
int main()
{
    scanf("%d %d", &n, &m);
    int ans = sqrt(m), maxs = 0;
    for(int i=1; i<=ans; i++)
    {
        if(m%i!=0)
            continue;
        if(i<n&&m/i>=n)
            maxs = max(maxs, i);
        else if(i>=n)
            maxs = max(maxs, m/i);
    }
    printf("%d\n", maxs);
    return 0;
}

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

int n, h;
typedef pair<long long, long long> P;
vector<P> v;
int a, ans;

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	cin >> n >> h;
	for(int i=0; i<n; ++i){
		int s, t;
		cin >> s >> t;
		v.push_back(P(s, 0));
		v.push_back(P(t, 1));
	}
	sort(v.begin(), v.end(), greater<P>());
	int p = 0;
	while(a < h){
		if(v[p].second == 1){
			a += v[p].first;
			++ans;
		}else{
			ans += (h - a + v[p].first - 1) / v[p].first;
			break;
		}
		++p;
	}
	cout << ans << "\n";
}

Measured memory_bytes: 6384
// -*- coding:utf-8-unix -*-

use proconio::input;
extern crate num;

fn calclate_score(D: usize, s: &Vec<Vec<isize>>, c: &Vec<isize>, out: &Vec<isize>) -> isize {
    let mut sat = 0;
    let mut last = vec![0; 26];
    for d in 0..D {
        assert!(1 <= out[d as usize] && out[d as usize] <= 26);
        let j = out[d as usize] - 1;
        last[j as usize] = d + 1;
        for i in 0..26 {
            sat -= ((d + 1 - last[i]) as isize) * c[i as usize];
        }
        sat += s[d][j as usize];
    }
    sat
}

fn main() {
    input! {
        D: usize,
        c: [isize; 26],
        s: [[isize; 26]; D],
        mut out: [isize; D],
        M: isize,
        dqv: [(isize,isize); M]
    }
    for (d, q) in dqv {
        out[(d - 1) as usize] = q;
        print!("{}\n", calclate_score(D, &s, &c, &out));
    }
}


Measured memory_bytes: 4424
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long ll;
#define MAX 1000000000000;
int main() {
    int n, k; cin >> n >> k;
    ll x[n];
    for (int i = 0; i < n; i++) {
        cin >> x[i];
    }
    ll time = MAX;
    for (int i = 0; i < n - k + 1; i++) {
        ll lb = x[i];
        ll ub = x[k+i-1];
        if (ub <= 0) {
            time = min(time, -lb);
        }
        else if (lb > 0) {
            time = min(time, ub);
        }
        else {
            if (abs(lb) <= ub) {
                time = min(time, abs(lb) * 2 + ub);
            }
            else {
                time = min(time, ub * 2 + abs(lb));
            }
        }
    }
    cout << time << endl;
    return 0;
}


Measured memory_bytes: 1024
'use strict';

const inputs = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n');

const input = inputs[0].split(' ').map(v => parseInt(v, 10));

let a = 0;
for (let i = 1 ; i <= input[0] ; ++i) {
  a += i
}
a -= input[0];

let b = 0;
for (let i = 1 ; i <= input[1] ; ++i) {
  b = b + i;
}
b -= input[1];

console.log(a + b);


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

//.define
//#define FILE_IN_OUT
#define RET(_x)                       return std::cout << (_x), 0;
#define all(_obj)                     (_obj).begin(), (_obj).end()
#define nfirst(_obj, _n)              (_obj).begin(), (_obj).begin() + (_n)
#define fori(_iterator, _begin, _end) for (int _iterator = (_begin); _iterator < (_end); ++_iterator)
#define forr(_iterator, _begin, _end) for (int _iterator = (_begin); _iterator >= (_end); --_iterator)
#define loop(_n)                      for (int i = 0; i < (_n); ++i)
#define div_ceil(_dividend, _divider) ((_dividend) - 1LL + (_divider)) / (_divider)
#define sz(_obj)                      static_cast<int>((_obj).size())
template<typename Tp>
inline void outarr(Tp _array, const std::size_t _N, const char* _delim = " ") {
    Tp end = _array + _N;
    for (Tp current = _array; current != end; ++current) {
        std::cout << *current << _delim;
    }
    std::cout << '\n';
}

//.constant
using ll  = std::int64_t;
using pii = std::pair<int, int>;
constexpr int INF = INT_MAX;
constexpr int MOD = 1e9 + 7;

//.data
char gr[55][55];

//.code
int main() {
#ifdef FILE_IN_OUT
    std::ifstream сin  ("input.txt",  std::ios::in);
    std::ofstream сout ("output.txt", std::ios::out);
#else
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif

    int h, w;
    cin >> h >> w;
    fori(i, 1, h + 1) {
        fori(j, 1, w + 1) {
            cin >> gr[i][j];
        }
    }

    fori(i, 1, h + 1) {
        fori(j, 1, w + 1) {
            if (gr[i][j] == '#') {
                cout << '#';
                continue;
            }
            cout << (gr[i - 1][j - 1] == '#')
                    + (gr[i - 1][j] == '#')
                    + (gr[i - 1][j + 1] == '#')
                    + (gr[i][j - 1] == '#')
                    + (gr[i][j] == '#')
                    + (gr[i][j + 1] == '#')
                    + (gr[i + 1][j - 1] == '#')
                    + (gr[i + 1][j] == '#')
                    + (gr[i + 1][j + 1] == '#');
        }
        cout << '\n';
    }

#ifdef FILE_IN_OUT
    cin.close();
    cout.close();
#endif
    return 0;
}


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

template <typename T> void chmin(T&x,const T &y)
{
	if(x>y)x=y;
}
template <typename T> void chmax(T &x,const T &y)
{
	if(x<y)x=y;
}
typedef long long s64;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef pair<int,int> pii;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i)
#define gc (c=getchar())
int read()
{
	char c;
	while(gc<'-');
	if(c=='-')
	{
		int x=gc-'0';
		while(gc>='0')x=x*10+c-'0';
		return -x;
	}
	int x=c-'0';
	while(gc>='0')x=x*10+c-'0';
	return x;
}
#undef gc

const int N=300+5,D=1e9+7;
int c[N*2];
s64 dp[N*2][N][N],jie[N*2];

int main()
{
#ifdef kcz
	freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
#endif
	int n;
	cin>>n;
	jie[0]=1;
	rep(i,1,n*2)jie[i]=jie[i-1]*i%D; 
	int c0=0;
	rep(i,1,n)
	{
		int x=read(),y=read();
		c0+=x==-1&&y==-1;
		if(x!=-1)c[x]=1+(y!=-1);
		if(y!=-1)c[y]=1+(x!=-1);
	}
	dp[2*n][0][0]=1;
	per(i,2*n,1)
	rep(c0,0,2*n-i)
	rep(c1,0,min(2*n-i,i-c0))
	{
		s64 x=dp[i][c0][c1]%D;
		if(!x)continue;
		if(c[i]==2)dp[i-1][c0][c1]+=x; else
		{
			if(c0)dp[i-1][c0-1][c1]+=x;
			if(c1&&c[i]==0)dp[i-1][c0][c1-1]+=x*c1;
			dp[i-1][c0+(c[i]==0)][c1+(c[i]==1)]+=x;
		}
	}
	cout<<dp[0][0][0]*jie[c0]%D;
}


Measured memory_bytes: 434432
N = int(input())
S = input().split()

color_dict = {}

for i in S:
  if i in color_dict:
    color_dict[i] += 1
  else:
    color_dict[i] = 1

if len(color_dict.keys()) == 4:
  ans = "Four"
else:
  ans = "Three"
print(ans)

        

Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define PB push_back
#define MP make_pair
#define all(x) x.begin(),x.end()
#define pri 1000000007
#define nonod numberofnodes
#define pr pair <ll,ll>
#define mx 1000001
#define max 1001
#define prin(x) cout<<setprecision(7)<<fixed<<x<<endl;
using namespace std;


void masterstroke(){
string a;
cin>>a;
ll n=a.length();
ll ans=0;
for(ll i=0;i<n;i++){
	if(a[i]=='o')ans++;
}
if(ans+(15-n)>=8)cout<<"YES";
else cout<<"NO";

}
int main(){
	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	ll t=1;
	//cin>>t;
	for(ll i=0;i<t;i++)masterstroke();
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=300005;
int read(){
	int f=1,g=0;
	char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-1;
	for (;isdigit(ch);ch=getchar()) g=g*10+ch-'0';
	return f*g;
}
int n,L,a[N],b[N],h[N];
ll ans;
int main(){
	n=read();L=read();
	for (int i=1;i<=n;i++) a[i]=read();
	for (int i=1;i<=n;i++){
		b[i]=read();
		ans+=b[i]/(L*2);
		b[i]%=(L*2);
		if (b[i]){
			ans++;
			h[i]=(b[i]<=a[i]*2)+2*(b[i]<=(L-a[i])*2);
		}
	}
	int x=0,y=0,z=0;
	for (int i=1;i<n;i++)
	if (h[i]==1) z++;
	else if (h[i]==2){
		if (z) {z--;ans--;}
		else if (y){y--;ans--;}
		else if (x){x--;y++;}
	}
	else if (h[i]==3){
		if (z){z--;ans--;x++;}
		else if (y){y--;ans--;x++;}
		else y++;
	}
	if (!(h[n]&2)) ans++;
	printf("%lld\n",ans*2*L);
	return 0;
}

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

	int a, b, c, d, k;
	cin >> a >> b >> c >> d >> k;
	cout << c * 60 + d - a * 60 - b - k << endl;
	return 0;
}

Measured memory_bytes: 3672
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	string s;
	cin>>s;
	int a,b,c,d;
	a = s[0]-'0';
	b = s[1]-'0';
	c = s[2]-'0';
	d = s[3]-'0';
	if(a+b+c+d==7){printf("%d+%d+%d+%d=7\n",a,b,c,d); return 0;}
	if(a+b+c-d==7){printf("%d+%d+%d-%d=7\n",a,b,c,d); return 0;}
	if(a+b-c+d==7){printf("%d+%d-%d+%d=7\n",a,b,c,d); return 0;}
	if(a+b-c-d==7){printf("%d+%d-%d-%d=7\n",a,b,c,d); return 0;}
	if(a-b+c+d==7){printf("%d-%d+%d+%d=7\n",a,b,c,d); return 0;}
	if(a-b+c-d==7){printf("%d-%d+%d-%d=7\n",a,b,c,d); return 0;}
	if(a-b-c+d==7){printf("%d-%d-%d+%d=7\n",a,b,c,d); return 0;}
	if(a-b-c-d==7){printf("%d-%d-%d-%d=7\n",a,b,c,d); return 0;}
	return 0;
}

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

int main(){

	int answer;
	int A,B,C,D,L;
	int math, Japanese;

	cin >> L >> A >> B >> C >> D;
	
	math = (B - 1) / D + 1;
	Japanese = (A - 1) / C + 1;

	cout << L - max(math, Japanese) << endl;


	/*
	int datanum = 0;
	for(int dataset = 0; dataset < 1; dataset++){
		if(input == 0) break;


		answer[dataset] = sum;

		datanum++;
	}

	for(int dataset = 0; dataset < datanum; dataset++){
		cout << answer[dataset] << endl;
	}
	*/

	

	return 0;
}


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

#define ll long long int
#define mp make_pair
#define ff first
#define ss second
#define fr(i,l,r) for (long long int i = l; i < r; ++i)
#define frr(i,l,r) for (long long int i = r; i >= l; --i) 
#define sortarr sort(arr,arr+n) //sorts array in asc order
#define sortarr_r sort(arr, arr+n, greater<long long int>()) //sorts array in desc order
#define make_set set<long long int>s //Set arranges in asc order
#define make_set_r set<long long int, greater <long long int>>s ////Set arranges in desc order
#define make_vector vector<long long int>v; 
#define max_heap priority_queue <int> pq; // max heap 
#define min_heap priority_queue <int, vector<int>, greater<int> > pq;  //min heap
#define make_pairVector vector<pair<long long int,long long int> > pairVector // vector of pairs
#define hashmap unordered_map<long long int, long long int>hashmap;
#define pb push_back


//map<pair<ll,ll>, ll > hash;          // pair,value hashmap where key is a pair
//hash[make_pair(i,j)] = 0;
//if(hash.find(make_pair(i,j)) == hash.end())


//map<ll,ll>::iterator itr;           // iterating a map
//for (itr = hash.begin();itr != hash.end(); itr++)
//{
//   itr->first = key  
//   itr->second = value
//}


// vector<string> v; //to convert vector to a set
// set<string> s(v.begin(), v.end());


// set<string>s;     // to convert set to a vector
// vector<string> v(s.begin(),s.end());


// cin >> x >> y;
// pairVector.pb(mp(x,y));


// string size = str.size()


// stack <int> s; 


// queue <int> gquiz; 


// __gcd(m, n) 

// ll arr[10e5 + 5];


// char arr[10e5 + 5];


// printf ("%.9f\n",x);


bool sortbysec(const pair<long long int,long long int> &a, const pair<long long int,long long int> &b) 
{ 
    return (a.second < b.second); 
}
bool compare(string &s1,string &s2) 
{ 
    return s1.size() < s2.size(); 
} 
int check_key(map<long long int, long long int> m, long long int key) 
{ 
    // Key is not present 
    if (m.find(key) == m.end()) 
        return 0; 
  
    return 1; 
} 

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

int main(void)
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll x,y;
    cin >> x >> y;
    string ans = "No";
    for(ll t = 0; t<x+1; t++)
    {
        ll c = x - t;
        if(4*t + 2*c == y)
        {
            ans = "Yes";
            break;
        }
    }
    cout << ans << endl;
    return 0;
}   

Measured memory_bytes: 3660
import java.util.*
fun main(args: Array<String>){
    val scanner = Scanner(System.`in`)
    var num = scanner.nextInt()
  	if(num == 25){
    	println("Christmas")
    }
  	else if(num == 24){
      	println("Christmas Eve")
    }
  	else if(num == 23){
    	println("Christmas Eve Eve")
    }
    else if(num == 22){
        println("Christmas Eve Eve Eve")
    }
}


Measured memory_bytes: 29344
#include <bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 114514810;
const ll MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
  int to, cost;
  bool operator < (const edge& e) const { return cost < e.cost; }
  bool operator >(const edge& e) const { return cost > e.cost; }
};
int dx[] = { -1, 0, 0, 1 }; int dy[] = { 0, -1, 1, 0 };
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
bool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

bool eq(double a, double b) { return fabs(a - b) < EPS; }
typedef complex<double> Point;
typedef vector<Point> Polygon;

namespace std
{
  bool operator < (const Point& a, const Point& b)
  {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}

struct Line
{
  Point a, b;
  Line(Point p, Point q) :a(p), b(q) {};
};

struct Circle
{
  Point p; double r;
  Circle(Point a, double b) :p(a), r(b) {};
};

double dot(Point a, Point b)
{
  return real(conj(a)*b);
}

double cross(Point a, Point b)
{
  return imag(conj(a)*b);
}

int ccw(Point a, Point b, Point c)
{
  b -= a; c -= a;
  if (cross(b, c) > EPS) return 1;	//counter cloclwise
  if (cross(b, c) < -EPS) return -1;  //cloclwise
  if (dot(b, c) < 0) return 2;		//c--a--b on line 
  if (norm(b) < norm(c)) return -2;   //a--b--c on line
  return 0;							//a--c--b on line
}

vector<Point> is_cc(Circle c1, Circle c2)
{
  vector<Point> res;
  double d = abs(c1.p - c2.p);
  double rc = (d*d + pow(c1.r, 2) - pow(c2.r, 2)) / (2 * d);
  double dfr = pow(c1.r, 2) - rc*rc;
  if (abs(dfr) < EPS) dfr = 0;
  if (dfr < 0.0) return res;
  double rs = sqrt(dfr);
  Point diff = (c2.p - c1.p) / d;
  res.push_back(c1.p + diff*Point(rc, rs));
  if (dfr != 0.0) res.push_back(c1.p + diff*Point(rc, -rs));
  return res;
}




int main()
{
  int n;
  while (cin >> n, n)
  {
    int ans = 1;
    vector<Point> v;
    REP(i, n)
    {
      double x, y;
      cin >> x >> y;
      v.push_back(Point(x, y));
    }
    REP(i, n - 1)
    {
      FOR(j, 1 + 1, n)
      {
        Circle c1(v[i], 1), c2(v[j], 1);
        auto vp = is_cc(c1, c2);

        REP(k, vp.size())
        {
          int cnt = 0;
          Point tmp = vp[k];
          REP(l, n)
          {
            if (abs(tmp - v[l])-1<= EPS) cnt++;
          }
          chmax(ans, cnt);
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

typedef long long ll;
typedef string st;
typedef vector<int> vi;
typedef vector<st> vs;
#define rep(i, n) for(int i = 0; i < n; i++)
#define fogg(i,a,b) for(int i = (a); i <= (b); i++)
#define ford(i,a,b) for(int i = (a); i >= (b); i--)
#define test int t; cin >> t; while(t--)
#define debug(x) cout << '>' << #x << ':' << x << "\n";
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair
#define MAXN 200010



int main() {
	
	int n;
	cin >> n;
	ll a[n];
	map<int,int> mp;
	for(int i=0;i<n;i++) {
		cin >> a[i];
		mp[a[i]]++;
	}
	for(int i=1;i<=n;i++) {
		cout << mp[i]<<endl;
	}


	return 0;
}

Measured memory_bytes: 14568
//%std
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;
const int N = 53;
vector<int> G[N];
int n, x, d;
long long c[N], v[N], a[N], dp[N * N * N], id[N], ans;
void dfs (int u) {
	v[u] = 1;
	rep(i, 0, (signed)G[u].size() - 1) {
		dfs (G[u][i]);
		c[u] += c[G[u][i]], v[u] += v[G[u][i]];
	}
} 
void DP(long long x, long long y) { /*debug ("%lld %lld\n", x, y);*/ per(i, 125000, y) dp[i] = min (dp[i], dp[i - y] + x); }
int main ()
{
	scanf ("%d%d%d%lld", &n, &x, &d, &c[1]);
	rep (i, 2, n) { int p; scanf("%lld%d", &c[i], &p); G[p].push_back(i); }
	dfs (1);
	memset (dp, 0x3f, sizeof dp); dp[0] = 0;
	rep (i, 1, n) {
		id[i] = i;
		int lef = i == 1 ? 50 : min (50, d);
		for (int k = 1; k <= lef; lef -= k, k <<= 1) DP (1LL * c[i] * k, 1LL * v[i] * k);
		if (lef) DP (1LL * c[i] * lef, 1LL * v[i] * lef);
	}
	sort (id + 1, id + n + 1, [](int x, int y) { return 1LL * v[x] * c[y] > 1LL * v[y] * c[x]; });
	rep (p, 0, 125000) {
		if(dp[p] > x) break;
		long long tans = p, tx = x - dp[p];
		rep (j, 1, n) { int i = id[j];
			long long cnt = min (1LL * tx / c[i], i == 1 ? 1000000000LL : (max (0LL, d - 50LL)));
			tx -= 1LL * cnt * c[i], tans += 1LL * cnt * v[i];
		}
		ans = max (ans, tans);
	}
	printf ("%lld\n", ans);
	return 0;
}













Measured memory_bytes: 1408
import java.util.Scanner;

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

        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int point = A + B + C;

        if (point >= 22) {
            System.out.println("bust");
        } else {
            System.out.println("win");
        }
    }
}

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

int main(void){
  int A[3];
  int i, j, k;
  int min = 1000;
  int cost;
  for(i = 0; i < 3; i++){
    scanf("%d", &A[i]);
  }
  for(i = 0; i < 3; i++){
    for(j = 0; j < 3; j++){
      for(k = 0; k < 3; k++){
        if(i != j && j != k && k != i){
          cost = 0 + abs(A[j] - A[i]) + abs(A[k] - A[j]);
          if(cost < min){
            min = cost;
          }
        }
      }
    }
  }
  printf("%d\n", min);
  return 0;
}


Measured memory_bytes: 128
/*!enjoy karo yaar!*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

#include<bits/stdc++.h>
using namespace std;

#define     int             long long int
#define     fast()          ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)          begin(x),end(x)
#define     rz(x)           resize(x)
#define     asn(x,y)        assign(x,y)
#define     mem(a,b)        memset(a,b,sizeof(a))
#define     sz(x)           ((int)size(x))
#define     eb              emplace_back
#define     pb              push_back
#define     pf              push_front
#define     pob             pop_back
#define     pof             pop_front
#define     ins             insert
#define     vi              vector<int>
#define     pii             pair<int,int>
#define     mii             map<int,int>
#define     F               first
#define     S               second
#define     remax(a,b)      a=max(a,b)
#define     remin(a,b)      a=min(a,b)
#define     bitcount(x)     __builtin_popcountll(x)
#define     iceil(n,x)      (((n)-1)/(x)+1)
#define     dbug(x)         cout<<#x<<": "<<(x)<<"\n"
#define     flush           fflush(stdout)
#define     show(x)         for(auto zz:x)cout<<zz<<" ";cout<<"\n";
#define     show2(x)        for(auto zz:x)cout<<zz.F<<" "<<zz.S<<"\n";

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;

const ld pi=acos(-1);
const ll inf=1e18,M=1e9+7;
const int N=1;

int arr[105];

void solve()
{
    int x,n;
    cin>>x>>n;

    if(n==0)
    {
        cout<<x;
        return;
    }

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

        arr[x]=1;
    }

    int mn=inf,ans=0;
    for(int i=0;i<=101;++i)
    {
        if(arr[i])
            continue;

        int diff=abs(x-i);

        if(diff<mn)
        {
            mn=diff;
            ans=i;
        }
    }

    cout<<ans;
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    for(int z=1;z<=t;++z)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}



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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")
int table[365][26];
int main()
{	
int D;
	cin >> D;
	vec(C);
	vec(Las);
	fx(26) {
		vecp(C);
		Las.push_back(0);
	}

	fx(D) {
		fy(26) {
			cin >> table[x][y];
		}
	}
	vector<int> T(D);
	int k = 0;
	fx(26) {
		if (k < table[0][x]) {
			T[0] = x+1;
			k = table[0][x];
		}
	}
	fx(D-1) {
		ll res = -LLONG_MAX;
		int las = 0;
		fy(26) {
			ll sum = 0;
			sum += table[x + 1][y];
			fz(26){
				if (y == z) { continue; }
				sum -= C[z] * (x + 1 - Las[z]);
			}

			if (res<sum) {
				res = sum;
				T[x + 1] = y+1;
				las = y;
			}
		}
		Las[las] = x + 1;
	}

	ll sum = -INT_MAX;
	srand(time(NULL));
	fx(15000) {
		int d, q;
		d = rand() % D + 1;
		q = rand() % 26 + 1;
		if (x%2==0) {
			int d2 = rand() % D + 1;
			while (d2==d) {
				d2 = rand() % D + 1;
			}
			T[d - 1] ^= T[d2 - 1];
			T[d2 - 1] ^= T[d - 1];
			T[d - 1] ^= T[d2 - 1];
			continue;
		}
		int pre = T[d - 1];

		T[d - 1] = q;
		ll ans = 0;

		fy(26) {
			Las[y] = 0;
		}
		fw(D) {

			ans += table[w][T[w] - 1];
			Las[T[w] - 1] = w + 1;
			fz(26) {
				ans -= C[z] * (w + 1 - Las[z]);
			}

		}
		if (ans > sum) {
			sum = ans;
		}
		else {
			T[d - 1] = pre;

		}
	}


	fx(D) {
		ce(T[x])
	}
    return 0;
}



Measured memory_bytes: 3648
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int main()
{
	lint a,b,n,ma,mi;
	cin>>n>>a>>b;
	if(a>b){
		cout<<0<<endl;return 0;
	}
	if(n==1){
		if(a==b) cout<<1<<endl;
		else cout<<0<<endl;
		return 0;
	}
	ma=a+(n-1)*b;mi=b+(n-1)*a;
	cout<<(ma-mi+1)<<endl;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> r,g,b;

    for(int i = 0; i < n; i++) {
        char x;
        cin >> x;
        if(x=='R') r.push_back(i+1);
        if(x=='G') g.push_back(i+1);
        if(x=='B') b.push_back(i+1);
    }

    ll ans = r.size()*g.size()*b.size();
    if(ans==0){
        cout << 0 << endl;
        return 0;
    }

    for(int i = 0; i < r.size(); i++) {
        for(int j = 0; j < g.size(); j++) {
            int y=lower_bound(b.begin(),b.end(),g[j]+g[j]-r[i])-b.begin();
            if(y!=b.size()){
                if(b[y]==g[j]+g[j]-r[i]) ans--;
            }
            y=lower_bound(b.begin(),b.end(),r[i]+r[i]-g[j])-b.begin();
            if(y!=b.size()){
                if(b[y]==r[i]+r[i]-g[j]) ans--;
            }

            if((r[i]+g[j])%2==0){
                y=lower_bound(b.begin(),b.end(),(r[i]+g[j])/2)-b.begin();
                if(y!=b.size()){
                if(b[y]==(r[i]+g[j])/2) ans--;
                }
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
A = [int(input()) for _ in range(5)]

x = 10
ans = 0
for a in A:
    if a % 10 == 0:
        ans += a
    else:
        ans += (a // 10 + 1) * 10
        x = min(x, a % 10)

if x == 10:
    x = 0
else:
    x -= 10
print(ans + x)


Measured memory_bytes: 2940
def dist(x0, y0, x1, y1)
  (x0 - x1).abs + (y0 - y1).abs
end

# 中心点ならその高さを返す。違うならnilを返す
def judge(cx, cy, ch, points)
  points.each do |(h, x, y)|
    d = dist(cx, cy, x, y)
    if ch.nil?
      ch = h + d
    elsif 0 < h
      if ch != h + d
        return nil
      end
    else
      if d < ch
        return nil
      end
    end
  end
  ch
end

def puts_ans(x, y, h)
  puts "#{x} #{y} #{h}"
end
MAX_INDEX = 100

def main
  n = gets.chomp.to_i

  grid = Array.new(MAX_INDEX+1) {Array.new(MAX_INDEX+1)}

  points = []
  n.times do |i|
    x, y, h = gets.split.map(&:to_i)
    grid[x][y] = h

    # 調査点情報は配列に入れておく
    points << [h, x, y]
  end
  # h=0 を後ろに追いやっておく
  points.sort!
  points.reverse!

  # グリッドの全セルをなめて、中心条件を満たすものを探す
  0.upto(MAX_INDEX) do |x|
    line = grid[x]
    0.upto(MAX_INDEX) do |y|
      h = line[y]
      next if h == 0

      ch = judge(x, y, h, points)
      if !ch.nil?
        puts_ans(x, y, ch)
        return
      end

    end

  end
  puts "ERROR"
end

if __FILE__ == $0
  main
end


Measured memory_bytes: 1916
#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;
typedef long long ll;




int main()
{
    
    int A, B;
    cin >> A >> B;
    if (A<=8&&B<=8) {
        cout << "Yay!" << endl;
    }else{
        cout << ":(" << endl;
    }
    
    
    return 0;
}




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

int main(void){
    string s;
    cin >> s;
    int d_sum = 0;
    for (char c : s) {
        d_sum += c-'0';
    }
    cout<<((stoi(s)%d_sum == 0) ? "Yes" : "No")<<endl;
    return 0;
}


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

using namespace std;
int main() {
	char k[1200];
	int n;
	scanf("%s", &k);
	char o[] = {'T','L','U','R','D'};
	char p[] = {'w',' ','k','s','t','n','h','m','y','r'};
	char q[] = {'a','i','u','e','o'};

	for (int i = 0; i < 1200; i++) {
		if (k[i] == '\0') {
			n = i;
			break;
		}
	}

	for (int i = 0; i < n/2; i++) {
		if (k[i*2] == '1') {
			for (int j = 0; j < 5; j++) {
				if (k[i*2+1] == o[j]) {
					cout << q[j];
					break;
				}
			}
		} else {
			if (k[i*2]-'0' == 0 && k[i*2+1] == 'U') {
				cout << "nn";
				continue;
			}
			cout << p[k[i*2]-'0'];
			for (int j = 0; j < 5; j++) {
				if (k[i*2+1] == o[j]) {
					cout << q[j];
					break;
				}
			}
		}
	}

	cout << endl;
	return 0;
}

Measured memory_bytes: 1144
#include<bits/stdc++.h>
using namespace std;
int main()
{

    string a;
    cin>>a;
    if(a=="Sunny")
        cout<<"Cloudy"<<endl;
    else if(a=="Rainy")
        cout<<"Sunny"<<endl;
    else
        cout<<"Rainy"<<endl;


    return 0;
}


Measured memory_bytes: 256
class UF
attr_reader :cnt
def initialize(n)
    @root=Array.new(n+1)   #@root[i]==nil でiはroot
    @root[0]=nil
    @root_cnt=Hash.new{|h,k|h[k]=1}
    @cnt=nc2(n)
  end
  def union(a,b)
    unite(find(a),find(b))
  end
  def find(a)
    @root[a]==nil ? a : @root[a]=find(@root[a])
  end
  def unite(r1,r2)
    return 0 if r1==r2
    r1,r2=r2,r1 if r2<r1
    @cnt-=@root_cnt[r1]*@root_cnt[r2]
    @root[r2]=r1
    @root_cnt[r1]+=@root_cnt[r2]
    @root_cnt.delete(r2)
  end
  def nc2(n)
    n*(n-1)/2
  end
end
io = STDIN
n,m=io.gets.split.map(&:to_i)
uf=UF.new(n)
ab=m.times.map{io.gets.split.map(&:to_i)}
ar=ab.reverse_each.map do |a,b|
  cnt=uf.cnt
  uf.union(a,b)
  cnt
end
puts ar.reverse

Measured memory_bytes: 14460
#include<bits/stdc++.h>
using namespace std;
int height(int a, int b){
    return abs(a-b);
}
void p_a(vector<int> a, int x, int y){
    for(int i = x; i <= y; i++){
        cout << a[i] << " ";
    }
    cout << endl;
}
const int INF = 1e9 + 5;
void solve(){
    int n, k; cin >> n >> k;
    int h[n+1];
    for(int i = 1; i <= n; i++){
        cin >> h[i];
    }
    vector<int> dp(n+1, INF);
    dp[1] = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i+1; j <=i+k; j++){
            if(j <= n){
                dp[j] = min(dp[j], dp[i]+height(h[i], h[j]));
            }
        }
        // p_a(dp, 1, n);
    }
    cout << dp[n] << endl;
}

int main(){
    solve();
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#define debug(x) cerr << #x << ':' << x << endl
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
using namespace std;
typedef long long ll;

int main(){
    int n;
    cin >> n;
    vector<vector<int>> A(2, vector<int>(n,0) );
    REP(i,2)
        REP(j,n) cin >> A[i][j];

    for(int j=0; j<n-1; j++)
        A[0][j+1]+=A[0][j];
    for(int j=n-1; 0<j; j--)
        A[1][j-1]+=A[1][j];

    int ma = -1;
    REP(j,n){
        ma=max(ma, A[0][j]+A[1][j]);
    }
    cout << ma << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

#define CHMIN(a, b) a=min((a), (b))
#define CHMAX(a, b) a=max((a), (b))

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m, k;
	cin>>n>>m>>k;
	REP(i, n+1){
		REP(j, m+1){
			if(i*m+j*(n-2*i)==k){
				cout<<"Yes"<<'\n';
				return 0;
			}
		}
	}
	cout<<"No"<<'\n';
	return 0;
}


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

#define N 2500000

void CountingSort(int *A, int *B, int k, int n );



int main(void)
{
	int max_order	= 0;
	int Arr[N]		= {};
	int Out[N]		= {};
	char str[4*N]	= {};
	int i			= 0;
	int maximum		= 0;
	
	fgets(str, 4*N, stdin);
	max_order = atoi(str);
	
	scanf( "%d*", &Arr[0] );
	maximum = Arr[0];
	for ( i = 1; i < max_order; i++ ) {
		scanf( "%d*", &Arr[i] );
		if ( maximum < Arr[i] ) {
			maximum = Arr[i];
		}
	}
	
	
	
	CountingSort(Arr, Out, maximum+1, max_order );
	
	for ( i = 0; i < max_order - 1; i++ ) {
		printf( "%d ", Out[i]);
	}
	
	printf("%d\n", Out[i]);
	
	return 0;
}

void CountingSort(int *A, int *B, int k, int n )
{
	int C[10001] = {};
	int i = 0;
	
	for ( i = 0; i < k; i++ ) {
		C[i] = 0;
	}
	
	for ( i = 0; i < n; i++ ) {
		C[A[i]]++;
	}

	for ( i = 1; i < k; i++ ) {
		C[i] = C[i] + C[i-1];
	}
	
	for ( i = n-1; i >=0 ; i-- ) {
		B[C[A[i]]-1] = A[i];
		C[A[i]]--;
	}
	
	return;
}
	



Measured memory_bytes: 31128
use std::io::*;
use std::str::FromStr;

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: usize = sc.next();
    let ps: Vec<(f64, f64)> = (0..n).map(|_| (sc.next(), sc.next())).collect();

    let mut sum: f64 = 0.;
    for &(x1, y1) in &ps {
        for &(x2, y2) in &ps {
            sum += (x1 - x2).hypot(y1 - y2);
        }
    }

    println!("{:.10}", sum / n as f64);
}

/* ========== Scanner ========== */

struct Scanner<R: Read> {
    reader: R,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self
            .reader
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            token.parse::<T>().ok()
        }
    }

    fn next<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.read() {
            s
        } else {
            writeln!(stderr(), "Terminated with EOF").unwrap();
            std::process::exit(0);
        }
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next()).collect()
    }

    fn char(&mut self) -> char {
        self.next::<String>().chars().next().unwrap()
    }
}


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

int main() {
  int N,K;
  cin >> N >> K;
  vector<int> sum(N);
  double ans = 0;
  vector<int> sai(N);
  
  for(int i = 0; i < N; ++i){
    int sainome = i+1;
    while(sainome < K){
      sainome *= 2;
      sai.at(i)++;//さいころ振る
    }
  }
  /*
  for(int i = 0; i< N; i++){
  cout << endl << sai.at(i) << endl;
  }
  */
  for(int i = 0; i < N; i++){
    double waru = 1;
    for(int j = 0; j < sai.at(i); ++j){
      waru = waru*2;
    }
    ans = ans + (1.0/N) * (1.0/waru);
  }
  cout << setprecision(13) << ans << endl;
}


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define MAX 100050

#define ll long long
#define ld long double
#define lli long long int

#define pb emplace_back
#define INF 1000000000000

#define mod 1000000007

// trignometric function always give value in Radians only
#define PI acos(-1) //3.1415926535897932384626433832795028
#define dsin(degree) sin(degree*(PI/180.0))
#define dcos(degree) cos(degree*(PI/180.0))
#define dtan(degree) tan(degree*(PI/180.0))

#define rsin(radian) sin(radian)
#define rcos(radian) cos(radian)
#define rtan(radian) tan(radian)

#define loop(i,n) for (lli i = 0; i < n; i++)
#define loopitr(xt,vec) for (auto xt : vec)
#define FOR(i,a,b) for (lli i = a; i < b; i+=1)
#define loop_rev(i,n) for (lli i = n-1; i >= 0; i--)
#define FOR_REV(i,a,b) for (lli i = a; i >= b; i--)
#define itr :: iterator it
#define WL(t) while(t --)

#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(x) int(x.size())
#define F first
#define S second

#define mii map<lli,lli>
#define vi vector<lli>
#define vvi vector<vector<lli>>
#define vbool vector<bool>
#define seti set<lli>
#define pii pair<lli,lli>
#define pcc pair<char , char>

#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) (a/gcd(a,b))*b
#define abs(x) ((x < 0)?-(x):x)

#define endl '\n'

template <typename T>
void print(T x){cout<<x<<endl;}
template <typename T1, typename T2>
void print2(T1 x,T2 y){cout<<x<<" "<<y<<endl;}
template <typename T1, typename T2,typename T3>
void print3(T1 x, T2 y,T3 z){cout<<x<<" "<<y<<" "<<z<<endl;}

#define scanarr(a,n) for(lli i=0;i<n;i++)    cin>>a[i];
#define scanvector(a,n) for(lli i=0;i<n;i++){ lli x ; cin>>x; a.pb(x);}

#define printarr(a,n) for(lli i=0;i<n;i++)   cout<<a[i]<<" "; cout<<endl;
#define printvector(vec) for(auto xt : vec) cout<<xt<<" ";    cout<<"\n";

#define FD(N) fixed<<setprecision(N)

#define deb(x) cout<<#x<<" "<<x<<endl;


void solve(){
    lli n; cin>>n;
    string str = "ACL";
    while(n--){
        cout<<str;
    }
}
int main(){
	fastio
	lli t=1;
	while(t--){
		solve();
		
	}
	return 0;
}

Measured memory_bytes: 3608
n=int(input())
a=sorted([int(i) for i in input().split()])
N=a[n-1]
Kindex=0
K=a[Kindex]
M=10**9
for i in range(n-2):
    if abs(2*a[i]-N)<=M:
        Kindex=i
        M=abs(2*a[i]-N)
print(N,a[Kindex])


Measured memory_bytes: 14052
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int H,W;
string s[100];
int used[100][100];

inline bool valid(int x,int y){
    return (0<=x and x<H and 0<=y and y<W);
}

int main(){
    cin >> H >> W;
    rep(i,H) cin >> s[i];
    rep(i,H) rep(j,W) used[i][j] = INF;

    queue<pii> que;
    que.push(mp(0,0));
    used[0][0] = 0;
    while(!que.empty()){
        auto p = que.front();
        que.pop();
        int x = p.fi;
        int y = p.se;
        for(int i=0;i<4;i++){
            int nx = x+dx[i];
            int ny = y+dy[i];
            if(!valid(nx,ny)) continue;
            if(s[nx][ny] == '#') continue;
            if(used[nx][ny]<INF) continue;
            used[nx][ny] = used[x][y] + 1;
            que.push(mp(nx,ny));
        }
    }

    if(used[H-1][W-1]==INF){
        cout << -1 << endl;
        return 0;
    }

    int cnt = 0;
    rep(i,H) rep(j,W) if(s[i][j]=='#') cnt++;

    cout << H*W - used[H-1][W-1] - 1 - cnt<< endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lowb lower_bound
#define upb upper_bound
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};



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

	int n;
	int a[10010];
	a[1] = 2;
	REP(i, 2, 10010) a[i] = a[i-1] + i;

	while(cin >> n) {
		cout << a[n] << endl;
	}
	return 0;
}


Measured memory_bytes: 3256
n = int(input())
house = [[[0] * 10 for i in range(3)] for j in range(4)]
count = 0
while count != n:
    b, f, r, v = map(int, input().split())
    house[b-1][f-1][r-1] += v
    count += 1
for b_num in range(4):
    for f_num in range(3):
        for r_num in range(10):
            print(" " + str(house[b_num][f_num][r_num]),end="")
        print()
    if b_num != 3: 
        print("#" * 20)


Measured memory_bytes: 5620
#include<stdio.h>
#include<iostream>
using namespace std;

int main(){
  long long n,mi=10000000000,ma=-10000000000,r;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>>r;
    ma=max(ma,r-mi);
    mi=min(mi,r);
  }
  cout << ma << endl;
  return 0;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

const ll INF = 1e18;

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

int main() {
  ll n;
  cin >> n;
  vector<ll> a(3 * n);
  REP(i, 3 * n) { cin >> a[i]; }
  // a[0] -- a[n+i-1]からn個選んだ和の最大値
  vector<ll> l(n + 1, 0);
  ll sum = 0;
  priority_queue<ll, vector<ll>, greater<ll>> pq;
  REP(i, n) {
    sum += a[i];
    pq.push(a[i]);
  }
  l[0] = sum;
  FOR(i, n, 2 * n) {
    ll x = pq.top();
    pq.pop();
    if (x < a[i]) {
      sum -= x;
      sum += a[i];
      pq.push(a[i]);
    } else {
      pq.push(x);
    }
    l[i - n + 1] = sum;
  }

  while (!pq.empty()) {
    pq.pop();
  }

  REP(i, 3 * n) { a[i] *= -1; }
  reverse(ALL(a));
  sum = 0;
  REP(i, n) {
    sum += a[i];
    pq.push(a[i]);
  }
  vector<ll> r(n + 1, 0);
  r[0] = sum;
  FOR(i, n, 2 * n) {
    ll x = pq.top();
    pq.pop();
    if (x < a[i]) {
      sum -= x;
      sum += a[i];
      pq.push(a[i]);
    } else {
      pq.push(x);
    }
    r[i - n + 1] = sum;
  }

  ll ans = -1e18;
  REP(i, n + 1) { ans = max(ans, l[i] + r[n - i]); }
  cout << ans << endl;
}

Measured memory_bytes: 5108
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      String s = sc.next();
      String pattern = "[0-9]{"+a+"}-[0-9]{"+b+"}";
      if( s.matches(pattern) ) System.out.println("Yes");
      else System.out.println("No");
    }
}

Measured memory_bytes: 21972
from collections import defaultdict, deque

N, M = map(int, input().split())
E = defaultdict(list)
for i in range(M):
    x, y, z = map(int, input().split())
    E[x - 1].append(y - 1)
    E[y - 1].append(x - 1)
visited = [False] * N
ans = 0
q = deque()
for i in range(N):
    if not visited[i]:
        ans += 1
        visited[i] = True
        q.append(i)
        while q:
            nxt = q.pop()
            for j in E[nxt]:
                if not visited[j]:
                    visited[j] = True
                    q.append(j)
print(ans)

Measured memory_bytes: 32376