akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <math.h> 
#include <vector>
#include <algorithm>
#include <iomanip>      // std::setprecision


using namespace std;
int main()
{
	double N, K;
	std::vector<int> H;
	std::cin >> N;

	if (N == 0)
		return 0;
	double power = floor(log2(N));
	double sol = pow(2, power+1)-1;
	std::cout << fixed << std::setprecision(0) << sol << std::endl;
}

Measured memory_bytes: 384
import math
N = int(input())

result = [10**13]
cnt = []
for i in range(1,int(math.sqrt(N))+1) :
    if N % i == 0 :
        buf = min(result[-1],i+(N//i))
        result.append(buf)
        if result[-1] != result[-2] :
            cnt.append([i,N//i])


print(cnt[-1][0]-1+cnt[-1][1]-1)

Measured memory_bytes: 9232
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define PI acos(-1)
#define ld long double
const int MAXN = 500005, MAXLGN = 20;
int N, Q;
map<int, int> pos;
int tree[MAXN];
int cant;
struct node {
	int val, L, R, size;
}buff[2*MAXN*MAXLGN];
 
int build(int l, int r) {
	if (l > r) return 0;
 
	int idx = ++cant;
	
	int mid = (l + r)/2;
	buff[idx] = (node){ mid, build(l, mid - 1), build(mid + 1, r), 0 };
	return idx;
}
 
int update(int x, int val, int amount ) {
	if (x == 0) return 0;
	int idx = ++cant;
	int L = buff[x].L;
	int R = buff[x].R;
	if ( val < buff[x].val ) L = update( L, val, amount );
	if ( val > buff[x].val ) R = update( R, val, amount );
	buff[idx] = (node){ buff[x].val, L, R, buff[x].size + amount };
	return idx;
}
 
int query( int x, int val ) {
	if ( val < buff[x].val )
		return query( buff[x].L, val ) + buff[x].size -	buff[ buff[x].L ].size;
	if ( val > buff[x].val )
		return query( buff[x].R, val );
	return buff[x].size - buff[ buff[x].L ].size;
}

void solve(int test_case){
	cin >> N >> Q;
	tree[0] = build( 1, N );
	for ( int i = 1; i <= N; i++ ) {
		int x, posx;
		cin >> x; posx = pos[x];
		if (posx != 0)tree[i] = update( update( tree[i - 1], posx, -1 ), i, +1 );
		else tree[i] = update( tree[i - 1], i, +1 );
		pos[x] = i;
	}
	while ( Q-- ) {
		int lo, hi;
		cin >> lo >> hi;
		cout << query(tree[hi], lo) << '\n';
	}
	return;
}

signed main() {
	FASTIO;
#define MULTITEST 0
#if MULTITEST
	int ___T;
	cin >> ___T;
	for(int T_CASE = 1; T_CASE <= ___T; T_CASE++)
		solve(T_CASE);
#else
	solve(1);
#endif
	return 0;
}

Measured memory_bytes: 584968
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
constexpr ll MOD = 1e9 + 7;

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

	vector<vector<ll>> dp(s.size(), vector<ll>(13, 0));
	if (s[0] == '?') {
		rep(i, 10)dp[0][i]++;
	}
	else {
		dp[0][s[0] - '0']++;
	}

	REP(i, 1, s.size()) {
		if (s[i] == '?') {
			rep(bef, 13)rep(add, 10) {
				(dp[i][(bef * 10 + add) % 13] += dp[i - 1][bef]) %= MOD;
			}
		}
		else {
			ll add = s[i] - '0';
			rep(bef, 13) {
				(dp[i][(bef * 10 + add) % 13] += dp[i - 1][bef]) %= MOD;
			}
		}
	}
	cout << dp.back()[5] << endl;
	return 0;
}


Measured memory_bytes: 13696
dataset = []

while True:
    h, w = map(int, input().split())
    if (h >= 1 and h <= 300) and (w >= 1 and w <= 300):
        listed = []
        listed.append(h)
        listed.append(w)
        dataset.append(listed)
    elif h != 0 and w != 0:
        break
    else:
        break

for listed in dataset:
    h = listed[0]
    w = listed[1]

    for i in range(h):
        if i % 2 == 0:
            for j in range(w):
                if j % 2 == 0:
                    print("#", end="")
                elif j % 2 == 1:
                    print(".", end="")
            print()
        elif i % 2 == 1:
            for j in range(w):
                if j % 2 == 0:
                    print(".", end="")
                elif j % 2 == 1:
                    print("#", end="")
            print()
    print()

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

int main() {
    int cnt = 0;
    int keep_begin_i;
    int keep_end_i;
    int n;
    cin >> n;
    int mini = INT_MAX;
    vector <int> h(n);
    rep(i, n){
        cin >> h[i];
    }
    // ゼロじゃないとこから、最後かゼロを探して最小値を引いていく
    while(*max_element(ALL(h))){
        //search non-zero
        for (int i = 0; i < n; i++){
            if(h[i] != 0){
                keep_begin_i = i;
                break;
            }
        }
        //search zero or end
        keep_end_i = keep_begin_i;
        for (int i = keep_begin_i; i < n; i++){
            if(h[i] == 0){
                break;
            }
            keep_end_i = i;
            mini = min(mini, h[i]);
        }
        // 最小値を引いていく
        for(int j = keep_begin_i; j <= keep_end_i; j++){
            h[j] -= mini;
        }
        // for(auto a: h){
        //     cout << a << endl;
        // }
        cnt += mini;
        // mini = *max_element(&h[0],&h[keep_begin_i]);
        // rep(i, keep_begin_i){
        //     h[i] -= mini;
        // }
        // cnt += mini;
        // for(auto a: h){
        //     cout << a << endl;
        // }
    }
    cout << cnt << endl;
    // for(auto a: h){
    //     cout << a << endl;
    // }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cstdio>
#include <cstring>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define DEB 1
#define all(x) x.begin(), x.end()
#define mp make_pair
#define pb push_back

pair<string,string> pss[12];
map<string,int> msi;

string subplace(string &s, int i){
  int p = 0;
  string ret = s;
  while( (p=ret.find(pss[i].first,p))!=string::npos ){
    ret.replace(p, pss[i].first.length(), pss[i].second);
    p += pss[i].second.size();
  }
  return ret;
}

int main(){
  int n;
  while(cin>>n,n){
    msi.clear();
    rep(i,n){
      cin >> pss[i].first >> pss[i].second;
    }
    string a,b;
    cin>>a>>b;
    
    int ans = -1;
    queue<pair<string,int> > q;
    q.push(mp(a,0));
    msi[a] = 0;
    while( !q.empty() ){
      string s = q.front().first;
      int c = q.front().second;
      q.pop();
      if( s.length() > 1000 )break;
      if( s==b ){
	ans = c;
	break;
      }
      rep(i,n){
	string tmp = subplace(s,i);
	if( msi.find(tmp)==msi.end() ){
	  q.push(mp(tmp,c+1));
	  msi[tmp] = c+1;
	}
      }
    }
    
    printf("%d\n",ans);
  }
  return 0;
}

Measured memory_bytes: 23000
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(void) {
	int n;
	int tan[5] = {5,7,5,7,7};
	cin >> n;
	while (n != 0) {
		vector<string> str(n);
		for (int i = 0; i < n; ++i) {
			cin >> str[i];
		}
		bool find = false;
		bool over = false;
		int ind = 0;
		int ln = 0;
		int ret;
		for (int i = 0; !find && i < n; ++i) {
			over = false;
			ind = 0;
			ln = 0;
			for (int j = i; !over && j < n; ++j) {
				if (ln + str[j].length() == tan[ind]) {
					if (ind == 4) {
						find = true;
						ret = i+1;
					}
					else {
						++ind;
						ln = 0;
					}
				}
				else if (ln + str[j].length() < tan[ind]) {
					ln += str[j].length();
				}
				else {
					over = true;
				}
			}
		}
		cout << ret << endl;
		cin >> n;
	}
	return 0;
}

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

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define MOD 1000000007
// #define MOD 998244353
// #define MOD LLONG_MAX
const double PI=3.14159265358979323846;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

// 繰り返し二乗法
ll power(ll a, ll b){
    if(a==1)return a;
    // if(a==0)re
    ll res=1;
    while(b>0){
        if(b&1) res=res*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return res;
}

const int MAX=2100000;

ll fact[MAX], fact_inv[MAX];

void init_fact(ll n){
    fact[0]=1;
    // 階乗の計算
    for(ll i=0; i<n; i++) fact[i+1]=fact[i]*(i+1)%MOD;
    fact_inv[n]=power(fact[n], MOD-2);
    // 逆元の計算
    for(ll i=n-1;i>=0;i--) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;
}

ll comb(ll n, ll r){
    return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}

ll perm(ll n, ll r){
    return (fact[n]*fact_inv[n-r])%MOD;
}

int main() {
    cout<<fixed<<setprecision(10);

    string s; cin>>s;

    if(s.front() == s.back()){
        if(s.size()%2==0){
            puts("First");
        }else{
            puts("Second");
        }

    }else{
        if(s.size()%2==1){
            puts("First");
        }else{
            puts("Second");
        }

    }



    return 0;

}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define ll long long
#define INF 1e9
#define maxn 100010
using namespace std;
template <typename T> void read(T &x){
	x=0;char c=getchar();int fh=1;
	while (!isdigit(c)){if (c=='-')fh=-1;c=getchar();}
	while (isdigit(c))x=x*10+c-'0',c=getchar();
	x*=fh;
}
struct Info{int x,y,di;}t;
int m,n,q,xl,yl,xr,yr,a[20],b[20],na,nb,nc,c[20],di[12][12];
string s1,s2;
set<int> W,E,N,S;
bool operator <(Info x,Info y){return x.di<y.di;}
int main(){
	read(n);read(m);read(q);
	cin>>s1;cin>>s2;
	for (int i=0;i<n;i++) if (s1[i]=='W')W.insert(i+1);else E.insert(i+1);
	for (int i=0;i<m;i++) if (s2[i]=='N')N.insert(i+1);else S.insert(i+1);
	while (q--){
		read(xl);read(yl);read(xr);read(yr);
		memset(a,0,sizeof(a));memset(b,0,sizeof(b));na=nb=0;
		set<int>::iterator p;
		p=W.lower_bound(xl);
		if (p!=W.end())a[++na]=*p;
		if (p!=W.begin()&&(*p!=xl)){p--;a[++na]=*p;}
		p=W.lower_bound(xr);
		if (p!=W.end())a[++na]=*p;
		if (p!=W.begin()&&(*p!=xr)){p--;a[++na]=*p;}
		p=E.lower_bound(xl);
		if (p!=E.end())a[++na]=*p;
		if (p!=E.begin()&&(*p!=xl)){p--;a[++na]=*p;}
		p=E.lower_bound(xr);
		if (p!=E.end())a[++na]=*p;
		if (p!=E.begin()&&(*p!=xr)){p--;a[++na]=*p;}
		p=S.lower_bound(yl);
		if (p!=S.end())b[++nb]=*p;
		if (p!=S.begin()&&(*p!=yl)){p--;b[++nb]=*p;}
		p=S.lower_bound(yr);
		if (p!=S.end())b[++nb]=*p;
		if (p!=S.begin()&&(*p!=yr)){p--;b[++nb]=*p;}
		p=N.lower_bound(yl);
		if (p!=N.end())b[++nb]=*p;
		if (p!=N.begin()&&(*p!=yl)){p--;b[++nb]=*p;}
		p=N.lower_bound(yr);
		if (p!=N.end())b[++nb]=*p;
		if (p!=N.begin()&&(*p!=yr)){p--;b[++nb]=*p;}
		sort(a+1,a+na+1);
		sort(b+1,b+nb+1);
		for (int i=1;i<=na;i++)c[i]=a[i];
		nc=na;na=0;
		for (int i=1;i<=nc;i++)if (i==1||c[i]!=c[i-1]) a[++na]=c[i];
		for (int i=1;i<=nb;i++)c[i]=b[i];
		nc=nb;nb=0;
		for (int i=1;i<=nc;i++)if (i==1||c[i]!=c[i-1]) b[++nb]=c[i];
		for (int i=1;i<=na;i++)
			for (int j=1;j<=nb;j++)di[i][j]=INF;
		priority_queue<Info> s;while (!s.empty()) s.pop();
		for (int i=1;i<=na;i++)
			for (int j=1;j<=nb;j++)
				if (a[i]==xl&&b[j]==yl){di[i][j]=0;s.push((Info){i,j,0});}
//		cout<<na<<' '<<nb<<endl;
//		for (int i=1;i<=na;i++) cout<<a[i]<<' ';cout<<endl;
//		for (int i=1;i<=nb;i++) cout<<b[i]<<' ';cout<<endl;
		while (!s.empty()){
			t=s.top();s.pop();
//			cout<<t.x<<' '<<t.y<<' '<<t.di<<endl;
			int nx=t.x,ny=t.y;
			if (s2[b[ny]-1]=='N')nx--;else nx++;
			if (nx>0&&nx<=na){
				if (di[nx][ny]>t.di+abs(a[nx]-a[t.x])){
					di[nx][ny]=t.di+abs(a[nx]-a[t.x]);
					s.push((Info){nx,ny,di[nx][ny]});
				}
			}
			nx=t.x,ny=t.y;
			if (s1[a[nx]-1]=='W')ny--;else ny++;
			if (ny>0&&ny<=nb){
				if (di[nx][ny]>t.di+abs(b[ny]-b[t.y])){
					di[nx][ny]=t.di+abs(b[ny]-b[t.y]);
					s.push((Info){nx,ny,di[nx][ny]});
				}
			}
		}
		for (int i=1;i<=na;i++)
			for (int j=1;j<=nb;j++)
				if (a[i]==xr&&b[j]==yr){if (di[i][j]==INF) puts("-1");else printf("%d\n",di[i][j]);}
	}
	return 0;
}

Measured memory_bytes: 13056
#include<stdio.h>

int main(){
  int a[3],N,ans=0;
  scanf("%d%d%d%d",&a[0],&a[1],&a[2],&N);

  for (int i = 0; i < 2; i++)
  {
    int temp;
    if(a[i]>a[i+1]){
      temp=a[i];
      a[i]=a[i+1];
      a[i+1]=temp;
    }
  }

  if (a[0]==1&&a[1]==1&&a[2]==1)
  {
    ans=(N+1)*(N+2)/2;
  }else{
    for (int i = 0; i <= N/a[0]; i++){
      for (int j = 0; j <= (N-i*a[0])/a[1]; j++){
        for (int k = 0; k <= (N-i*a[0]-j*a[1])/a[2]; k++){
          if ((i*a[0]+j*a[1]+k*a[2])==N)
          {
            ans++;
          }
        }
      }
    }
  }

  printf("%d",ans);

  return 0;
}

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


int main()
{
	string s;
	cin >> s;
	sort(s.begin(), s.end());
	if (s[0] == s[2])
	{
		cout << "No";
	}
	else
	{
		cout << "Yes";
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)

using namespace std;
typedef complex<double> Point;
struct Line : public vector<Point> {
    Line(const Point& a, const Point& b) {
        push_back(a); push_back(b);
    }
    Point vector() const {
        return back() - front();
    }
};
const double EPS = 1e-8;
int sign(double a){
    if(a > EPS) return +1;
    if(a < -EPS) return -1;
    return 0;
}
double dot(Point a, Point b){
    return real(conj(a) * b);
}
double cross(Point a, Point b){
    return imag(conj(a) * b);
}
Point projection(Line l, Point p){
    double t = dot(p - l[0], l.vector()) / norm(l.vector());
    return l[0] + t * l.vector();
}
Point crosspointLL(Line l, Line m){
    double A = cross(l.vector(), m.vector());
    double B = cross(l.vector(), l[1] - m[0]);
    if(sign(A) == 0 && sign(B) == 0) return m[0]; // 二直線が重なっている
    if(sign(A) == 0) assert(false); // 直線が交わらない
    return m[0] + m.vector() * B / A;
}

// 点pの直線lに関する反射
Point reflection(Line l, Point p){
    return 2.0 * projection(l, p) - p;
}
string s;
struct Result{
    int idx;
    vector<Point> val;
};

void skip(int& k, char c) {
    if(s[k] != c) {
        printf("expect s[%d] is %c but %c\n", k, c, s[k]);
        assert(false);
    }
    k++;
}

vector<Point> ope(vector<Point> v, vector<Point> w) {
    if(v.size() > w.size()) swap(v, w);
    if(v.size() == 1 && w.size() == 1) {
        //cout << v[0] << "@" << w[0] << endl;
        return {v[0], w[0]};
    } else if(v.size() == 1 && w.size() == 2) {
        //cout << v[0] << "@" << "(" << w[0] << ", " << w[1] << ")" << endl;
        return {reflection({w[0], w[1]}, v[0])};
    } else if(v.size() == 2 && w.size() == 2) {
        //cout << "(" << v[0] << ", " << v[1] << ") " << "@" << "(" << w[0] << ", " << w[1] << ")" << endl;
        return {crosspointLL({w[0], w[1]}, {v[0], v[1]})};
    }
}

Result term(int k);
Result expr(int k) {
    Result r = term(k);
    while(r.idx < s.size() && s[r.idx] == '@') {
        skip(r.idx, '@');
        Result t = term(r.idx);
        r.val = ope(r.val, t.val);
        r.idx = t.idx;
    }
    return r;
}

int number(int& k) {
    int sign = 1;
    if(s[k] == '-') {
        skip(k, '-');
        sign = -1;
    }
    int p = 0;
    while(isdigit(s[k])) {
        p = p * 10 + (s[k++] - '0');
    }
    return p * sign;
}

Result term(int k) {
    if(k + 1 < s.size() && s[k] == '(' && (isdigit(s[k + 1]) || s[k + 1] == '-')) {
        skip(k, '(');
        int p = number(k);
        skip(k, ',');
        int q = number(k);
        skip(k, ')');
        return {k, {Point(p, q)}};
    } else {
        Result r = expr(k + 1);
        skip(r.idx, ')');
        return {r.idx, {r.val}};
    }
}

int main(){
    while(cin >> s && s != "#") {
        Result res = expr(0);
        assert(res.val.size() == 1);
        printf("%.12f %.12f\n", res.val[0].real(), res.val[0].imag());
    }
    return 0;
}

Measured memory_bytes: 1256
#include<bits/stdc++.h>
using namespace std;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define F first
#define S second
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define forit(it,cont) for(auto it=cont.begin();it!=cont.end();it++)
#define forv(v,cont) for(auto v:cont)
#define for0(i,n) for(i=0;i<n;i++)
#define for1(i,n) for(i=1;i<=n;i++)
#define for0r(i,n) for(i=n-1;i>=0;i--)
#define for1r(i,n) for(i=n;i>=1;i--)
#define ll long long 
const ll inf=1e16;
const ll _inf=-1e16;
ll dx[]={1,-1,0,0};
ll dy[]={0,0,1,-1};
#define mod 1000000007
vector<bool> d(100010);
ll a[100010];
int main()
{
	ll n,k,i,j;
	cin>>n>>k;
	for1(i,n)
	cin>>a[i];
	for(i=0;i<=k;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(a[j]<=i&&!d[i-a[j]])
				d[i]=true;
		}
	}
	(d[k]==true)?(cout<<"First\n"):(cout<<"Second\n");
	return 0;	
}


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

int main(){
    int n,m,a;
    cin >> n>>m;
    int ans = n;
    rep(i,m){
        cin >>a;
        ans -=a;
    }
    cout<< max(ans,-1)<<endl;
}

Measured memory_bytes: 3184
N = int(input())

amount = 0
result = False

i_max = int(N/4) + 1
y_max = int(N/7) + 1


for i in range(0, i_max) :
    for j in range(0, y_max) :
        cake   = 4 * i
        donuts = 7 * j
        amount = cake + donuts

        if amount == N:
            result = True
            break

    else:
        continue
    break

    
if result == True :
    print('Yes')
else :
    print('No')
    
    

Measured memory_bytes: 3060
#include <bits//stdc++.h>
using namespace std;
int in(void){int x;cin>>x;return x;}
#define ll long long int
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
long long int dx[4]={1,0,-1,0};
long long int dy[4]={0,1,0,-1};
int main() {
	int x,y,z;
	cin>>x;
	char s;
	cin>>s;
	cin>>y>>s>>z;
  string S;
	int ans=10000*x+100*y+z;
	if(ans<=20190430)S="Heisei";
	else S="TBD";
	cout<<S;
	return 0;
}



Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
             PrintWriter out = new PrintWriter(System.out)) {
            int n = Integer.parseInt(in.readLine());

            int[][] G = new int[n][n];

            for (int i = 0; i < n; i++) {
                String[] line = in.readLine().split(" ");
                int u = Integer.parseInt(line[0]) - 1;
                int k = Integer.parseInt(line[1]);
                for (int j = 0; j < k; j++) {
                    int v = Integer.parseInt(line[2 + j]) - 1;
                    G[u][v] = 1;
                }
            }

            for (int i = 0; i < n; i++) {
                out.println(Arrays.stream(G[i]).mapToObj(String::valueOf).collect(Collectors.joining(" ")));
            }
            out.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}



Measured memory_bytes: 31852
#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N;cin>>N;
  vector<int> H(N);  
  for (int i=0;i<N;++i) cin>>H[i];
  int tmp=0;
  int ans=0;
  for (int i=0;i<N;++i){
    if (H[i]>=tmp){
      tmp=H[i];
      ans++;
    }
  }
  cout<<ans<<endl;
}
        
        
      

Measured memory_bytes: 256
(defun minnum (a b) (if (< a b) a b))
(defun maxnum (a b) (if (> a b) a b))

(defun calc (n k x y) (+ (* (minnum n k) x)
                         (* (maxnum 0 (- n k)) y )))

(defun main () (write (calc (read) (read) (read) (read))))
(main)

Measured memory_bytes: 24264
import java.util.*;
public class Main {
	
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        long sumA = 0;
        long[] mapA = new long[N];
        for (int i = 0; i < N; i++) {
        	mapA[i] = sc.nextLong();
        	sumA += mapA[i];
        }
        long sumB = 0;
        long[] mapB = new long[N];
        for (int i = 0; i < N; i++) {
        	mapB[i] = sc.nextLong();
        	sumB += mapB[i];
        }
        
        if (sumA < sumB) {
        	System.out.println(-1);
        	return;
        }
        
        List<C> upper = new ArrayList<>(N);
        List<C> lower = new ArrayList<>(N);
        for (int i = 0; i < N; i++) {
        	C c = new C(mapA[i], mapB[i]);
        	upper.add(c);
        	lower.add(c);
        }
        
        Collections.sort(upper);
        Collections.sort(lower);
        Collections.reverse(lower);
        
        long ans = 0;
        int targetIndex = 0;
        C target = lower.get(targetIndex);
        int reIndex = 0;
        C re = upper.get(reIndex);
        while(target.sa < 0) {
        	long sa = re.sa;
        	long plus = sa + target.sa;
        	if (!re.use) {
        		ans++;
        		re.use = true;
        	}
        	
        	if (plus > 0) {
        		re.sa = plus;
        		
        		target.sa = 0;
        		targetIndex++;
        		target = lower.get(targetIndex);
        		
        		ans++;
        	} else if (plus == 0) {
        		re.sa = 0;
        		target.sa = 0;
        		
        		reIndex++;
        		re = upper.get(reIndex);
        		
        		targetIndex++;
        		target = lower.get(targetIndex);
        		
        		ans++;
        	} else {
        		target.sa = plus;
        		
        		re.sa = 0;
        		reIndex++;
        		re = upper.get(reIndex);
        	}
        }
        
        System.out.println(ans);
    }
    
    static class C implements Comparable<C>{
    	long sa;
    	long a;
    	long b;
    	boolean use;
    	
    	C(long a, long b) {
    		this.a = a;
    		this.b = b;
    		this.sa = a - b;
    	}
    	
		@Override
		public int compareTo(C o) {
			return (int) (o.sa - this.sa);
		}
    }
}

Measured memory_bytes: 92188
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int gcd(int a,int b){
    int tmp;
    if(a<b){tmp=b;
    b=a;
    a=tmp;}
    if(b<1){return -1;}
    if(a%b==0){return b;}else
    return gcd(b,a%b);
        
     
}

int main()
{
    int n;
    int i;
    int s,x[100000],ans;
    
    scanf("%d %d",&n,&s);
    for(i=0;i<n;i++){
        scanf("%d",&x[i]);
    }
    ans=abs(x[0]-s);
    for(i=0;i<n;i++){
        ans=gcd(abs(x[i]-s),ans);
    }
    printf("%d",ans);
    return 0;
    
}




Measured memory_bytes: 512
import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[N];
        Arrays.fill(a, 0);
        for(int i = 0; i < M; i++){
            int n = sc.nextInt();
            a[n-1] = -1;
        }
        long[] dp = new long[N+1];
        long mod = 1000000007;
        dp[0] = 1;
        if(a[0] == 0)
            dp[1] = 1;
        for(int i = 1; i < N; i++){
            dp[i+1] = (dp[i] + dp[i-1]) % mod;
            if(a[i] == -1)
                dp[i+1] = 0;
        }
        System.out.println(dp[N]);
        sc.close();
    }
}


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

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

    if (S[0] == 'S') {
        cout << "Cloudy" << endl;
    }
    else if (S[0] == 'C') {
        cout << "Rainy" << endl;
    }
    else {
        cout << "Sunny" << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, k;
  cin >> n >> k;
  int s = 1;
  for(int i = 0; i < n; i++){
    if(s * 2 < s + k){
      s *= 2;
    }else {
      s += k;
    }
  }
  cout << s;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long mod=1000000000+7;
const long long INF=-mod;

//マクロ
//型エイリアス
using ll = long long;
using P=pair<long long,long long>;
using vl=vector<long long>;
//ショートカット
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,k,n) for(int i=k;i<n;i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
//入力
#define vin(v,N) for(long long i=0;i<N;i++) cin>>v.at(i)
#define lin(n) long long n;cin>>n
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)

#define max(a,b) max((ll)a,(ll)b)
#define min(a,b) min((ll)a,(ll)b)

//関数
//最大公約数
long long gcd(long long m, long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m, long long n){
  return m*n/gcd(m,n);
}
//xのn乗
long long power(long long x, long long N){
  long long ret=1;
  for(long long i=0;i<N;i++)   
    ret*=x;
  return ret;
}
//nCr
long long Comb (long long n, long long r);
//nCr (mod)
long long modC(long long n, long long r) {
    vector<long long> f(n+1),inv(n+1),invf(n+1);
    f[0]=f[1]=1;
    invf[0]=invf[1]=1;
    inv[1]=1;
    for (long long i=2;i<n+1;i++) {
        f[i]=(i*f[i-1])%mod;
        inv[i]=mod-((mod/i)*inv[mod%i])%mod;
        invf[i]=(inv[i]*invf[i-1])%mod;
    }
    long long cmb=f[n]*(invf[r]*invf[n-r]%mod)%mod;
    if (n>=r) return cmb;
    else return 0;
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//メイン関数
int main(){
  //doubleの桁数
  cout<<fixed<<setprecision(10);
  
  lin(N);lin(a);lin(b);
  if(N==1)
    cout<<"Hello World";
  else
    cout<<a+b;
}

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

using namespace std;

double dp[3010][3010], p[3010], ans;
int n;

int main(){
    cin >> n;
    for(int i = 0; i < n; i++) cin >> p[i];
    dp[0][0] = 1;
    for(int i = 0; i < n; i++){
        for(int j = 0; j <= i; j++){
            dp[i + 1][j + 1] += dp[i][j] * p[i];
            dp[i + 1][j] += dp[i][j] * (1 - p[i]);
        }
    }
    ans = 0;
    for(int j = (n + 1) / 2; j <= n; j++) ans += dp[n][j];
    cout << fixed << setprecision(10) << ans << '\n';
}

Measured memory_bytes: 69120
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>

using namespace std;

int main()
{
	
	string big[26] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};

	string small[26] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};

	string alpha;
	cin >> alpha;
	
	for(int i = 0; i < 26; i++){
		if(alpha == big[i]){
			cout << "A" << endl;
			return 0;
		}	
		else if(alpha == small[i]){
			cout << "a" << endl;
			return 0;
		}
		
	}
 

}

Measured memory_bytes: 3624
#include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <iterator>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>

using namespace std::literals;
#ifndef ENABLE_ASSERT
#undef assert
#define assert(...) static_cast<void>(0)
#else
#endif

constexpr int N_max = 100'000;
constexpr int M_max = 100'000;

struct Continuity {
  int length;
  bool gameover;
};

std::vector<int> solve(const int N, const int M, const std::string S_reverse) {
  const auto &S = S_reverse;
  auto steps = std::vector<int>{};
  steps.reserve(N);

  {
    auto cont = std::vector<Continuity>{};
    cont.reserve(N + 1);

    for (auto i = 0; i < N + 1;) {
      auto i0 = i;
      auto first = S[i];
      for (; i < N + 1 && S[i] == first; ++i)
        ;
      auto c = Continuity{i0 - i, first == '1'};
      cont.emplace_back(c);
    }

    auto cpos = 0;
    auto pos = 0;
    for (;;) {
      auto move = N - pos;
      if (move <= M) {
        steps.emplace_back(move);
        pos += move;
        break;
      }

      move = M;
      for (; move >= 1; --move) {
        if (S[pos + move] == '0') {
          steps.emplace_back(move);
          pos += move;
          break;
        }
      }
      if (move) {
        continue;
      }

      if (steps.empty())
        return {-1};

      move = steps.back();
      steps.pop_back();
      pos -= move;

      for (--move; move >= 1; --move) {
        if (S[pos + move] == '0') {
          steps.emplace_back(move);
          pos += move;
          break;
        }
      }
      if (move)
        continue;

      return {-1};
    }
  }

  std::reverse(std::begin(steps), std::end(steps));
  return steps;
}

int main() {
  auto N = 0, M = 0;
  auto S = ""s;
  std::cin >> N >> M >> S;
  std::reverse(std::begin(S), std::end(S));
  auto steps = solve(N, M, S);

  for (auto i = 0; i < steps.size(); ++i) {
    if (i > 0)
      std::cout << " ";
    std::cout << steps[i];
  }

  return 0;
}


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

using namespace std;
#define ll long long int
int const mod=1000000007;

int main()
{
    ll n;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(a[i]!=a[j])
            for(int k=j+1;k<n;k++)
            {
                if(a[i]+a[j]>a[k] && a[i]+a[k]>a[j] && a[j]+a[k]>a[i] && (a[i]!=a[j] && a[i]!=a[k] && a[j]!=a[k]))
                    ans++;
            }
        }
    }
    cout<<ans;
}


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

int main() {
  int x;
  cin >> x;
  int happiness = 0;
  while (x >= 500) {
    happiness += 1000;
    x -= 500;
  }

  while (x >= 5) {
    happiness += 5;
    x -= 5;
  }

  cout << happiness << endl;
}


Measured memory_bytes: 256
S=input()
if len(S)<26:
    print(S+sorted(list({chr(i+97) for i in range(26)}-set(S)))[0])
else:
    tmp = [S[25]]
    for i in range(25):
        tmp.append(S[24-i])
        if S[24-i] < S[25-i]:
            tmp =sorted(tmp)
            print(S[:26-len(tmp)]+tmp[tmp.index(S[24-i])+1])
            exit()
    print(-1)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;
const ll mod = 1e9+7;
const int MAX = 3e5;
vector<vector<int>> g(MAX);
vector<ll> dp1(MAX,0);
vector<ll> dp2(MAX,0);
vector<ll> ans(MAX,0);
vector<ll> per(MAX,1);
int n;

void extgcd(ll a, ll b, ll &x, ll &y) {
  if(b == 0) {
    x = 1;
    y = 0;
    return;
  }
  extgcd(b, a%b, y, x);
  y -= a/b*x;
  return; 
}

ll mod_inverse(ll a, ll m = mod) {
  ll x, y;
  extgcd(a,m,x,y);
  return (m + x % m) % m;
}

ll dfs1(int u, int p) {
  ll res = 1;
  for(auto e : g[u]) {
    if(e != p) res += dfs1(e,u);
  }
  return dp1[u] = res;
}

ll dfs2(int u, int p) {
  ll res = 1;
  for(auto e : g[u]) {
    if(e != p) {
      (res *= dfs2(e,u)) %= mod;
      (res *= mod_inverse(per[dp1[e]])) %= mod;
    }
  }
  return dp2[u] = (res * per[dp1[u]-1]) % mod;
}

void dfs3(int u, int p, int q, ll r) {
  ll res = r;
  (res *= mod_inverse(per[q])) %= mod;
  for(auto e : g[u]) {
    if(e != p) {
      (res *= dp2[e]) %= mod; 
      (res *= mod_inverse(per[dp1[e]])) %= mod; 
    } 
  }
  ans[u] = (per[n-1] * res) % mod;
  for(auto e : g[u]) {
    if(e != p) {
      ll a = ans[u];
      (a *= per[dp1[e]]) %= mod;
      (a *= mod_inverse(per[n-1])) %= mod;
      (a *= per[n-1-dp1[e]]) %= mod;
      (a *= mod_inverse(dp2[e])) %= mod;
      dfs3(e,u,n-dp1[e],a);
    }
  }
}

int main(){
  cin >> n;
  rep(i,n-1) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for(ll i = 1; i < MAX; i++) per[i] = (per[i-1] * i) % mod; 
  dfs1(0,-1);
  dfs2(0,-1);
  dfs3(0,-1,0,1);
  rep(i,n) cout << ans[i] << endl;
  return 0;
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}


ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}

int main2() {
  int N = nextInt();
  int X = nextInt();
  vector<ll> v;
  v.push_back(X);
  REP(i, N) v.push_back(nextInt());
  sort(ALL(v));
  ll g = v[1] - v[0];
  for (int i = 1; i < (int)v.size(); i++) {
    g = gcd(g, v[i] - v[i-1]);
  }
  cout << g << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


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

int main() {
    int a, b;
    cin >> a >> b;

    int price = -1;
    for (int x = b * 10; x < (b + 1) * 10; x++) {
        int xa = (x * 8) / 100;
        if (xa == a) {
            price = x;
            break;
        }
    }

    cout << price;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < static_cast<int>(n); i++)

using namespace std;
using ll = int64_t;

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

  ll x, ans = 0;
  cin >> x;
  if (x & 1) {
    cout << 0 << endl;
    return 0;
  }
  ans = x / 10;
  x /= 10;

  while (x > 0) {
    ans += x / 5;
    x /= 5;
  }

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


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
   int i, h, m, s;
   cin >> i >> h >> m >> s;
   h = i / 3600;
   m = i / 60 % 60;
   s = i % 60;
   cout << h << ":" << m << ":" << s << endl;

    return 0;
}



Measured memory_bytes: 3064
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from math import floor, sqrt

def digit_sum(num:int, base:int) -> int:

    if num < base:
        return num
    else:
        return digit_sum(int(num/base), base) + (num % base)
    
n = ni()
s = ni()

root = floor(sqrt(n))
ans = float("inf")

# 3桁以上
for p in range(2, root+1):
    ds = digit_sum(n,p)
    if ds == s:
        ans = min(ans, p)
        

# 2桁
for a in range(1,root+2):
    p = (n-s+a) / a
    b = s - a
    if p == int(p) and 0 < a < p and 0 <= b < p:
        ans = min(ans, int(p))

# 1桁
if n == s:
    ans = min(ans, n+1)
    
print(-1) if ans == float("inf") else print(ans)

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

const int mod=998244353;

long C[2001][4001];

long comb(int n){
	for(int i=0;i<=n;i++){
		C[i][0]=1;
		for(int j=1;j<i;j++){
			C[i][j]=C[i-1][j-1]+C[i-1][j];
			C[i][j]%=mod;
		}
		C[i][i]=1;
	}
}

int main(){
	string s;
	cin >> s;
	int n=s.length();
	int red[n]={};
	red[0]=(s[0]=='0'?2:s[0]=='1'?1:0);
	for(int i=1;i<n;i++) red[i]+=red[i-1]+(s[i]=='0'?2:s[i]=='1'?1:0);
	
	long dp[n+1][2*n+1]={};
	dp[1][0]=(s[0]!='0'?1:0);
	dp[1][1]=(s[0]!='2'?1:0);
	for(int i=2;i<=n;i++){
		for(int j=max(0,red[i-1]-i);j<=min(i,red[i-1]);j++){
			dp[i][j]=(dp[i-1][j]+(j!=0?dp[i-1][j-1]:0))%mod;
		}
	}
	comb(n);
	long ans=0;
	for(int i=0;i<=min(n,red[n-1]);i++){
		if(i<=red[n-1]) ans+=dp[n][i]*C[n][red[n-1]-i]%mod;
		ans%=mod;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 123136
#include <iostream>
#include <stdio.h>       // printf,scanf
#include <stdlib.h>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>  //sort,binarySearch
#include <functional> 
#include <iomanip>    // setprecision
#include <utility>    // c+11 Array
#include <set>
#include <sstream>
#include <map>
#include <bits/stdc++.h>
#define MOD (1e+9)+7
#define PI 3.141592653589793238462643383279
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define pb(x) push_back(x)
#define debug(x) cout << #x << " = " << x << endl;
#define debret(x) debug(x) ; return 0;

using namespace std;

int main(void){

    int a,b,h;

    cin >> a >> b >> h;

    cout << (a+b) * h / 2 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define REPS(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
using ll = long long;
using ld = long double;

int main(void) {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    while(true) {
        C -= B;
        if (C <= 0) {
            cout << "Yes" << endl;
            break;
        }
        A -= D;
        if (A <= 0) {
            cout << "No" << endl;
            break;
        }
    }
}

Measured memory_bytes: 3636
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>

using namespace std;
typedef long long int LL;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)





int main()
{
	int hh, ww;
	int H, W;
	cin >> H >> W;
	REP(i, H) {
		REP(j, W) {
			string s;
			cin >> s;
			if (s == "snuke") {
				hh = i;
				ww = j;
			}
		}
	}
	cout << (char)(ww + 'A') << hh+1 << endl;

}

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

int main(){
  int h,w,n;
  cin >> h >> w >> n;
  for(int i=0;i<=h;i++){
    for(int j=0;j<=w;j++){
      if(w*i+h*j-2*i*j==n){
        cout << "Yes\n";
        return 0;
      }
    }
  }
  cout << "No\n";
  return 0;
}

Measured memory_bytes: 3588
#include<iostream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef long double ld;
int main(){
  ll n;
  cin>>n;
  vector<P> vec;
  for(int i=0;i<n;i++){
    ll x,y;
    cin>>x>>y;
    vec.push_back(P(x,y));
  }
  ld lb=0,rb=1001;
  for(int m=0;m<200;m++){
    ld mid=(lb+rb)/2;
    bool f=false;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        if(i==j) continue;
        ld x1=vec[i].first,x2=vec[j].first;
        ld y1=vec[i].second,y2=vec[j].second;
        ld dis=(x1-x2)*(x1-x2);
        dis+=(y1-y2)*(y1-y2);
        ld dis_=sqrt(dis);

        if(mid*mid-dis/4<0) continue;

        ld h=sqrt(mid*mid-dis/4);
        ld a=h/dis_;

        ld nx=(x1+x2)/2+a*(y1-y2);
        ld ny=(y1+y2)/2+a*(x2-x1);
        bool kf=true;
        for(int k=0;k<n;k++){
          if(i==k||j==k) continue;
          ld x3=vec[k].first,y3=vec[k].second;
          if(sqrt((x3-nx)*(x3-nx)+(y3-ny)*(y3-ny))>mid) kf=false;
        }
        if(kf) f=true;

        nx=(x1+x2)/2+a*(y2-y1);
        ny=(y1+y2)/2+a*(x1-x2);
        kf=true;
        for(int k=0;k<n;k++){
          if(i==k||j==k) continue;
          ld x3=vec[k].first,y3=vec[k].second;
          if(sqrt((x3-nx)*(x3-nx)+(y3-ny)*(y3-ny))>mid) kf=false;
        }
        if(kf) f=true;
      }
    }
    if(f) rb=mid;
    else lb=mid;
  //  cout<<mid<<" "<<(f?"O":"X")<<endl;
  }
  cout<<fixed<<setprecision(10)<<rb<<endl;
}


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

int main(){
  int n;
  int S[5] = {0};
  cin >> n;
  string str = "MARCH",input;
  for(int i = 0; i < n; i++){
    cin >> input;
    auto p = str.find(input[0]);
    if( string::npos == p) continue;
    else S[p]++;
  }

  long long sum = 0;
  for(int i = 0; i < 5; i++) {
    for(int j = i + 1; j < 5; j++) {
      for(int k = j + 1; k < 5; k++) {
        sum +=  (long long)S[i] * S[j] * S[k];
      }
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
/*input
a
z
*/

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

int main()
{
	string s1,s2;
	cin>>s1>>s2;

	int n = s1.length();
	int m = s2.length();
	int l[n+1][m+1];

	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=m;j++)
		{
			if(i==0||j==0)
				l[i][j]=0;

			else if(s1[i-1]==s2[j-1])
			{
				l[i][j]=l[i-1][j-1] + 1;
			}
			else
			{
				l[i][j]=max(l[i-1][j],l[i][j-1]);
			}
		}
	}

	int index = l[n][m];
	//cout<<index<<endl;

	string s="";
	int i=n, j=m;

	while(i>0&&j>0)
	{
		if(s1[i-1]==s2[j-1]){
			s+= s1[i-1];
			i--;j--; index--;
		}
		else if(l[i-1][j]>l[i][j-1])
		{
			i--;
		}
		else 
			j--;
	}

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

	cout<<s<<endl;
}

Measured memory_bytes: 35456
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);


int main(){fastio
    ll a,b,c,d;cin>>a>>b>>c>>d;
    while(true){
        c-=b;
        if(c<=0){
            cout<<"Yes"<<endl;
            return 0;
        }
        a-=d;
        if(a<=0){
            cout<<"No"<<endl;
            return 0;
        }
    }
    
    
    
}


Measured memory_bytes: 3652
import std.stdio;

void main() {
    long n, k;
    long ans = 1;
    readf(" %s", &n);
    readf(" %s", &k);

    foreach (i; 0..n) {
        if (ans > k){
            ans +=k;
        } else {
            ans *= 2;
        }
    }

    writeln(ans);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
	string s;
	int n,i;
	int flg;
	cin>>n;
	cin>>s;
	flg=0;
	if(n%2==1)	flg=1;
	else{
		for(i=0;i<n/2;i++){
			if(s[i]!=s[i+n/2]){
				flg=1;
				break;
			}
		}
	}
	if(flg)	cout<<"No"<<endl;
	else	cout<<"Yes"<<endl;
	return 0;
}

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

int main()
{
    int n;
    cin >> n;
    int d = n % 10;
    if (d == 2 || d == 5 || d == 4 || d == 7 || d == 9)
    {
        cout << "hon";
        return 0;
    }
    if (d == 0 || d == 1 || d == 6 || d == 8)
    {
        cout << "pon";
        return 0;
    }
    if (d == 3)
    {
        cout << "bon";
        return 0;
    }
}

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

int main() {
  int n, m, a, b;
  cin >> n >> m;
  int c[n] = {};

  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    c[a - 1] += 1;
    c[b - 1] += 1;
  }

  for (int i = 0; i < n; i++) {
    cout << c[i] << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
  int q,a,b;
  char S1[1001],S2[1001];
  
  scanf("%d",&q);
  for(a=0;a<q;a++){
    scanf("%s",S1);
    scanf("%s",S2);
    printf("%d\n",LCS(S1,S2));
  }
  
  return 0;
}

int LCS(char *S1,char *S2)
{
  int c[1001][1001],a,b,m,n;
  m=strlen(S1)+1;
  n=strlen(S2)+1;
  
  for(a=1;a<m;a++)c[0][a]=0;
  for(a=0;a<n;a++)c[a][0]=0;
  
  for(a=1;a<m;a++){
    for(b=1;b<n;b++){
      if(S1[a-1]==S2[b-1])c[a][b]=c[a-1][b-1]+1;
      else if(c[a-1][b]>=c[a][b-1])c[a][b]=c[a-1][b];
      else c[a][b]=c[a][b-1];
    }
  }
  
  return c[m-1][n-1];
}



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

int main() {
    char str[11];
    int flag = 0;
    int counter = 0;
    int res = 0;

    cin >> str;

    for(int i=0; str[i] != '\0'; i++){

        if (str[i] == 'A' || str[i] == 'G' || str[i] == 'C' || str[i] == 'T'){
            flag = 0;
            counter++;
        }
        else{
            flag = 1;
            counter = 0;
        }

        if(flag == 0 && counter > res){
            res = counter;
        }
    }

    cout << res;
    return 0;
}


Measured memory_bytes: 256
#include "iostream"
#include <string>
using namespace std;
 
int main(){
  int N;
  int i;
  
  cin >> N;
  
  for(i=1; i<=N; i++){
   
    if((int)((double)i*1.08) == N){
      cout << i;
      break;
    }
        
  }
  
  if(i == N+1) cout << ":(";
  
 return 0;
  
}

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

using namespace std;
typedef long long ll;


int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);	
	int n, h, w;
	cin >> h >> w >> n;
	int v = max(h, w);
	int total = n/v;
	if (n % v) {
		total += 1;	
	}
	cout << total << "\n";
}



Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}
int read() {
	int tmp;
	cin >> tmp;
	return tmp;
}
int xor128() {
	static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	int t = (x xor (x << 11));
	x = y; y = z; z = w;
	return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}

signed main() {
	int n, a, b;
	cin >> n >> a >> b;
	if ((b - a) % 2 == 0) {
		cout << "Alice" << endl;
	}
	else {
		cout << "Borys" << endl;
	}
		
	return 0;
}


Measured memory_bytes: 256