akhauriyash/Code-Regression huggingface dataset:
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

using ll = long long;
using ull = unsigned long long;

int main() {
    string s, t, u;
    int a, b;
    cin >> s >> t >> a >> b >> u;
    if (u == s)
        a--;
    if (u == t)
        b--;
    cout << a << " " << b << endl;

    return 0;
}

Measured memory_bytes: 256
x,y = map(int,input().split())
p = list(map(int,input().split()))

i = 0
while True:

    a = (x + i) in p
    b = (x - i) in p

    if a == False:
        if b == False:
            print(x - i)
            break
        else:
            print(x + i)
            break

    elif b == False:
        if a == False:
            print(x + i)
            break
        else:
            print(x - i)
            break

    i += 1

Measured memory_bytes: 9204
#include<iostream>
#include<string.h>
using namespace std;
int main(){
  int X;
  cin >> X;
  int a,b,c,d;
  a = int(X/1000);
  b = int(X/100)-a*10;
  c = int(X/10)-a*100-b*10;
  d = X-a*1000-b*100-c*10;
  
  for(int i=0; i<(1<<3) ; i++){
    int ope[3];
    for(int j=0; j<3; j++){
      if(i & (1<<j)){
        ope[j]=-1;
      }else{
        ope[j]=1;
      }
    }
    if(a+ope[0]*b+ope[1]*c+ope[2]*d==7){
      string ope2[3];
      for(int i=0; i<3; i++){
        if(ope[i]==-1){
          ope2[i]="-";
        }else{
          ope2[i]="+";
        }
      }
      cout << a<<ope2[0]<<b<<ope2[1]<<c<<ope2[2] <<d<< "=7"<<endl;
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <limits.h>
#include <math.h>

int main(int argc, char *argv[])
{
    int a, b;
    int ans;

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

    ans = 0;
    if (a >= 13) {
        ans = b;
    } else if (a >= 6) {
        ans = b/2;
    }

    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 128
h,w=map(int,input().split())
l=[list(map(str, input())) for i in range(h)]
for i in range(h):
    l[i]=['.']+l[i]+['.']
l=[['.']*(w+2)]+l+[['.']*(w+2)]
for i in range(1,h+1):
    for j in range(1,w+1):
        if l[i][j]=='#' and l[i-1][j]!='#' and l[i+1][j]!='#' and l[i][j-1]!='#' and l[i][j+1]!='#':
            print('No')
            break
    else:
        continue
    break
else:
    print('Yes')

Measured memory_bytes: 3064
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=15;
int n,d,ans;
int x[N][N];
bool Check(int i,int j) {
	int ret=0;
	for(int k=0;k<d;k++)
		ret+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
	for(int k=1;k<=400;k++)
		if(ret==k*k)
			return true;
	return false;
}
int main() {
	scanf("%d %d",&n,&d);
	for(int i=0;i<n;i++) {
		for(int j=0;j<d;j++)
			scanf("%d",&x[i][j]);
		for(int j=0;j<i;j++)
			ans+=Check(i,j);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let input: Vec<i32> = s.split_whitespace().map(|x| x.parse::<i32>().unwrap()).collect();

    let mut state = 1;
    if input[0] >8 || input[1]> 8{
        state = 0;
    }
    let ans = vec![":(","Yay!"];
    println!("{}", ans[state]);
}


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

int main() {
  int s, ret = 0;
  cin >> s;
  
  ret += s / 100;
  s -= s / 100 * 100;
  ret += s / 10;
  s -= s / 10 * 10;
  ret += s / 1;
  
  cout << ret << endl;
}


Measured memory_bytes: 3564
// 129_D_Lamp.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

//回答方針
//hw個のマスを全探索
//ただし、各マスを探索するたびに障害物のない区間の長さを計算するのは無駄なので、先に計算


#include <iostream>
#include <vector>

using namespace std;

struct range
{
	int start = -1;
	int end = -1;
};

int main()
{
	int h, w = 0;
	cin >> h >> w;

	string* table = new string[h];
	for (int i = 0; i < h; i++)
	{
		cin >> table[i];
	}

	//水平方向の区間
	vector<range> *rangesH = new vector<range>[h]();
	for (int i = 0; i < h; i++)
	{
		vector<range> ranges;

		string row = table[i];
		for (int j = 0; j < row.size(); j++)
		{
			//区間の開始
			char startC = row[j];
			if (startC == '#') continue;

			//区間の終了を探索
			int k = 0;
			for (k = j+1; k < row.size(); k++)
			{
				char endC = row[k];
				if (endC == '#')
				{
					break;
				}
			}

			//範囲の作成
			range r;
			r.start = j;
			r.end = k - 1;
			ranges.push_back(r);

			//探索開始位置をずらす
			j = k;
		}

		rangesH[i] = ranges;
	}

	//鉛直方向の区間
	vector<range>* rangesV = new vector<range>[w]();
	for (int i = 0; i < w; i++)
	{
		vector<range> ranges;

		for (int j = 0; j < h; j++)
		{
			//区間の開始
			char startC = table[j][i];
			if (startC == '#') continue;

			//区間の終了を探索
			int k = 0;
			for (k = j + 1; k < h; k++)
			{
				char endC = table[k][i];
				if (endC == '#')
				{
					break;
				}
			}

			//範囲の作成
			range r;
			r.start = j;
			r.end = k - 1;
			ranges.push_back(r);

			//探索開始位置をずらす
			j = k;
		}

		rangesV[i] = (ranges);
	}

	//各区間の範囲内のマスの数を更新
	int** counts = new int* [h];
	for (int i = 0; i < h; i++)
	{
		counts[i] = new int[w]();
	}

	//水平方向の更新
	for (int i = 0; i < h; i++)
	{
		for (range r : rangesH[i])
		{
			for (int j = r.start; j <= r.end; j++)
			{
				counts[i][j] += r.end - r.start + 1;
			}
		}
	}

	//垂直方向の更新
	for (int i = 0; i < w; i++)
	{
		for (range r : rangesV[i])
		{
			for (int j = r.start; j <= r.end; j++)
			{
				//水平方向ですでに更新している場合は、交点が重複するので1引く
				if (counts[j][i] > 0) counts[j][i]--;

				counts[j][i] += r.end - r.start + 1;
			}
		}
	}


	//最大値の検索
	int countMax = 0;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			if (counts[i][j] > countMax) countMax = counts[i][j];
		}
	}

	cout << countMax << endl;

	return 0;
}

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

ll extGcd(ll a, ll b, ll &x, ll &y) {
    if (b == 0) {
        x = 1; y = 0;
        return a;
    }
    ll s, t;
    ll d = extGcd(b, a % b, s, t);
    x = t;
    y = s - a / b * x;
    return d;
}

ll modinv(ll a, ll p) {
    ll x, y;
    extGcd(a, p, x, y);
    if (x < 0) x += p;
    return x;
}

const ll MOD = 1000000007;
const ll MAX = 510000;
vector<ll> fac(MAX), inv(MAX), finv(MAX);

void COMinit() {
    fac[0] = fac[1] = 1;
    inv[1] = 1;
    finv[0] = finv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = modinv(i, MOD) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(ll n, ll k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[n - k] * finv[k] % MOD) % MOD;
}

int main() {
    COMinit();

    int n, m;
    cin >> n >> m;

    map<int, int> primes;
    for (int i = 2; i <= sqrt(m); i++) {
        int ext = 0;
        if (m % i != 0) continue;
        while (m > 0) {
            if (m % i != 0) break;
            ext++;
            m /= i;
        }
        primes[i] = ext;
    }
    if (m != 1) primes[m] = 1;

    ll ans = 1;
    for (auto x : primes) {
        ans = ans * COM(x.second + n - 1, n - 1) % MOD;
    }


    cout << ans << endl;

}

Measured memory_bytes: 14968
#include <bits/stdc++.h>
using namespace std;
int read()
{
	int x = 0, op = 1; char ch = 0;
	while(not isdigit(ch = getchar())) if(ch == '-') op = -op;
	do x = x * 10 + (ch - '0'); while(isdigit(ch = getchar()));
	return op * x;
}
int n = 0, fa[1050], need[1050], ans[1050], sum[1050];
bool mid[1050][50050];
signed main()
{
	n = read(), mid[1][0] = true;
	for(int i = 2; i <= n; i++) fa[i] = read(), mid[i][0] = true;
	for(int i = 1; i <= n; i++) need[i] = read();
	for(int i = n; i >= 1; i--)
	{
		ans[i] = -1;
		for(int j = min(50000, sum[i] - need[i]); j <= 50000; j++)
			if(mid[i][j]) { ans[i] = j; break; }
		if(ans[i] < 0 || sum[i] - ans[i] > need[i]) return (puts("IMPOSSIBLE"), 0);
		if(i == 1) break;
		for(int j = 50000; j >= 0; j--)
			if(mid[fa[i]][j])
			{
				mid[fa[i]][j] = false;
				mid[fa[i]][min(50000, j + ans[i])] = true;
				mid[fa[i]][min(50000, j + need[i])] = true;
			}
		sum[fa[i]] += ans[i] + need[i];
	}
	puts("POSSIBLE");
	return 0;
}

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

int main()
{
    long long int temp,n,sum=0,r=0;
    cin>>n;
    temp=n;
    while(temp!=0)
    {
        r=temp%10;
        sum+=r;
        temp=temp/10;
    }
    if(n%sum == 0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3604
using System;
using System.Linq;

class Program
{
    static void Main(string[] args) {
        string s = Console.ReadLine();
        int l = 0;
        int r = 0;
        for(int i = 0; i < s.Length; i ++) {
            if(s[i]=='A') {
                l = i;
                break;
            }
        }
        for(int i = s.Length-1; i >= 0; i --) {
            if(s[i]=='Z') {
                r = i;
                break;
            }
        }
        Console.WriteLine(r-l+1);
    }
}

Measured memory_bytes: 13144
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
int main(){
	int x[5],m;
  rep(i, 5){
    cin >> x[i];
    if (x[i]==0) m=i+1;
  }
  cout << m << endl;
}


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

#define int long long
#define ll long long
#define f1(i,a,b) for(int i=a;i<b;i++)
#define f2(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod=1000000007;
ll temp;

int n;
int a[1001];
int b[1001];
int dp[10001];

int solve(int h)
{
	if(h<=0)
		return 0;
	if(dp[h]!=-1)
		return dp[h];

	int num=mod;
	f1(i,0,n)
	{
		num=min(num,solve(h-a[i])+b[i]);
	}
	dp[h]=num;
	return num;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // #ifndef ONLINE_JUDGE
    // 	freopen("/home/akmittal/Desktop/Competitive Programming/in.txt","r",stdin);
    // 	freopen("/home/akmittal/Desktop/Competitive Programming/out.txt","w",stdout);
    // #endif

    int h;
    cin>>h>>n;
    f1(i,0,n)
    {
    	cin>>a[i]>>b[i];
    }

    memset(dp,-1,sizeof(dp));
    cout<<solve(h);


    return 0;
}

Measured memory_bytes: 640
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)x.size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

int N,t[10010],dp[2][2][5010];

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	cin>>N;
	rep2(i,1,N)cin>>t[i];
	rep(i,2)rep(j,2)rep(k,N/2+1)dp[i][j][k]=INF;
	dp[0][0][1]=0;
	int cur=1,pre=0;
	rep2(i,1,N){
		rep2(k,1,min(N/2,i+1)+1){
			dp[cur][0][k]=min(dp[pre][0][k-1],dp[pre][1][k-1]+t[i]);
		}
		rep(k,min(N/2,i)+1){
			dp[cur][1][k]=min(dp[pre][0][k]+t[i],dp[pre][1][k]);
		}
		cur^=1,pre^=1;
	}
	cout<<min(dp[pre][0][N/2],dp[pre][1][N/2])<<endl;
}

Measured memory_bytes: 1312
#pragma target("avx")
#pragma optimize("O3")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using PP = std::pair<ll,P>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;

#define REP(i,b,e) for(ll i=b; i<e; i++)
#define ALL(vec) vec.begin(),vec.end()
#define PRINT(vec) printf("[ ");for(auto &i:vec)printf("%ld ",i);puts("]");
#define SCAN(vec) for(auto &i:vec)scanf("%ld",&i)
#define fi first
#define se second

const int MOD = 1e9+7;
const ll INF = 1e18;
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

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

	int ans = 0;
	REP(i, 0, n){
		int a, b;
		scanf("%d %d", &a, &b);
		if(a>=h && b>=w) ans++;
	}
	printf("%d\n", ans);
	return 0;
}



Measured memory_bytes: 3848
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
 
typedef vector<int> vi;;
typedef vector<ll> vll;

#define l() length()
#define sz() size()
 
#define b() begin()
#define e() end()
#define all(x) x.begin(), x.end()
 
#define pb(i) push_back(i)
#define PB() pop_back()
 
 
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
#define mp make_pair
#define Fi first
#define Se second
 
const int maxx=1e6+9;
 
// Happy Coding!

struct Point{
public:
    int x,y;
    Point(int x,int y){
        this->x=x;
        this->y=y;
    }
};

double square(double x){return x*x;}
double distance(Point p1,Point p2){return sqrt( square(p1.x-p2.x) + square(p1.y-p2.y) );}

int factorial(int n){
    int f=1;
    for(int i=1;i<=n;i++){f*=i;}
    return f;
}
void solve(){
    int n;
    cin>>n;
    
    vi arr(n);
    for(int i=0;i<n;i++){cin>>arr[i];}
    
    int num=1;
    int cnt=0;
    int curr=0;
    for(int i=0;i<n;i++){
        if(arr[i]==num){
            cnt+=curr;
            curr=0;
            num++;
        }
        else{
            curr++;
        }
    }
    cnt+=curr;
    cout<<((num>1)?cnt:-1)<<endl;
}

int main() {
    faster;
    int t=1;
    // cin>>t;
    while(t-->0){
        solve();
    }
	return 0;
}

Measured memory_bytes: 3956
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")
#define FOR(i,j,n) for (int i=(j);i<(n);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define REPN(i,n) for (int i=(n);i>=0;i--)
#define I(n) scanf("%d", &(n))
#define pb(n) push_back((n))
#define mp(i,j) make_pair((i),(j))
#include <bits/stdc++.h>
using namespace std;

//------------------------------typedef集
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
typedef vector<vpi> vvpi;
typedef vector<vvi> vvvi;
typedef long long ll;

struct max_flow {
    struct edge { int to, cap, rev; };
    int V;
    vector<vector<edge>> G;
    vi itr, level;

    max_flow(int V) : V(V) { G.assign(V,vector<edge>()); }

    void add_edge(int from, int to, int cap) {
        G[from].push_back((edge) {to, cap, (int) G[to].size()});
        G[to].push_back((edge) {from, 0, (int) G[from].size()-1});
    }

    void bfs(int s) {
        level.assign(V,-1);
        queue<int> q;
        level[s] = 0; q.push(s);
        while (!q.empty()) {
            int v = q.front(); q.pop();
            for(auto &e: G[v]){
                if (e.cap > 0 and level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    q.push(e.to);
                }
            }
        }
    }

    int dfs(int v, int t, int f) {
        if (v == t) return f;
        for (int& i = itr[v]; i < (int) G[v].size(); ++i) {
            edge& e = G[v][i];
            if (e.cap > 0 and level[v] < level[e.to]) {
                int d = dfs(e.to, t, min(f, e.cap));
                if (d > 0) {
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

    int run(int s, int t) {
        int ret = 0, f;
        while (bfs(s), level[t] >= 0) {
            itr.assign(V,0);
            while ((f = dfs(s, t, INT_MAX)) > 0) ret += f;
        }
        return ret;
    }
};

int n,x,y;
vpi red,blue;

int main(){
    I(n);
    REP(i,n){
        I(x); I(y);
        red.pb(mp(x,y));
    }
    REP(i,n){
        I(x); I(y);
        blue.pb(mp(x,y));
    }

    max_flow pts = max_flow(2*n+2);
    //0 1-n n+1-2n 2n+1
    REP(i,n) pts.add_edge(0,i+1,1);
    REP(i,n) {
        REP(j,n){
            if (red[i].first < blue[j].first && red[i].second < blue[j].second)
                pts.add_edge(i+1,j+1+n,1);
        }
    }
    REP(i,n) pts.add_edge(i+1+n, 2*n+1, 1);
    cout << pts.run(0, 2*n+1) << endl;
}


Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main()
{
  unsigned A,B,C,D,E,F;

  cin >> A >> B >> C >> D >> E >> F;

  float max_concentration = -1;
  unsigned max_water = 0, max_sugar = 0;
  
  for (unsigned a=0; ; ++a) {
	if (a * A * 100 > F)
	  break;
	for (unsigned b=0; ; ++b) {
	  unsigned water = (A*a + B*b);
	  if (water*100 > F)
		break;
	  for (unsigned c=0; ; ++c) {
		if (c*C > water*E || water*100 + c*C > F)
		  break;
		for (unsigned d=0; ; ++d) {
		  unsigned sugar = c*C + d*D;
		  if (sugar > water*E)
			break;
		  unsigned weight = water*100 + sugar;
		  if (weight > F)
			break;
		  float concentration = (100.0*sugar)/weight;
		  if (concentration > max_concentration) {
			max_concentration = concentration;
			max_water = water;
			max_sugar = sugar;
		  }
		}
	  }
	}
  }
  cout << max_water*100 + max_sugar << ' ' << max_sugar << endl;
  return 0;
}


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

int main() {
  int N;
  int d[100];
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  
  int num[100] = {0};
  for (int i = 0; i < N; i++) {
    num[d[i]]++;
  }
  
  int count = 0;
  for (int i = 1; i <= 100; i++) {
    if (num[i]) {
      count++;
    }
  }
  cout << count << endl;
}


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

using namespace std;
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;

int MOD = 1000000007;

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

    int k,x; cin >> k >> x;

    int mi = -1000000;

    for(int i=max(mi, x-k+1); i<min(mi*-1, x+k); i++){
        cout << i << " ";
    }
    cout << '\n';
    

    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))

def sort():
    flag = 1
    swap = 0
    while flag:
        flag = 0
        for j in range(N-1,0,-1):
            if A[j] < A [j-1]:
                temp = A[j]
                A[j] = A[j-1]
                A[j-1] = temp
                swap += 1
                flag = 1
    pr(A)
    print(swap)

def pr(list):
    n = len(list)
    for i in range(n):
        if i < n-1:
            print(list[i],end=" ")
        else:
            print(list[i],end="\n")

sort()



Measured memory_bytes: 5616
n, x = map(int, input().split())
a, p = [1], [1]
for i in range(n):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)


def f(N, X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X - 2 - a[N-1])


print(f(N=n, X=x))


Measured memory_bytes: 3064
//
//  main.cpp
//  MST2ND
//
//  Created by Dong Truong on 7/13/19.
//  Copyright © 2019 Dong Truong. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <iomanip>

using namespace std;
#define long long long

const long maxn = 1e6+2 , cm=1e9+7 , ba=31;
struct elem
{
    long id,gt;
};

long n,a[maxn];
void nhap()
{
    cin>>n;
    for (int i=1;i<=n;++i) cin>>a[i];
    sort(a+1,a+n+1);
    double kq=a[1];
    for (int i=2;i<=n;++i)
        kq=(kq+a[i])/2;
    cout<<kq;
}
int main(int argc, const char * argv[]) {
   // freopen("a.inp","r",stdin);
    nhap();
    return 0;
}


Measured memory_bytes: 256
#D問題
mod = 1000000007
S = str(input())
N = len(S)


dp = [[0 for i in range(13)] for j in range(N+1)]
dp[0][0] = 1
for i,s in enumerate(S):
    if s == "?":
        for j in range(10):
            for k in range(13):
                ind = (10*k+j)%13
                dp[i+1][ind] += dp[i][k]
    else:
        j = int(s)
        for k in range(13):
            ind = (10*k+j)%13
            dp[i+1][ind] += dp[i][k]

    for k in range(13):
        dp[i+1][k]%=mod
            
print(dp[N][5]%mod)

Measured memory_bytes: 66140
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <functional>

using namespace std;


void solve(long long S, long long W){

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long S;
    scanf("%lld",&S);
    long long W;
    scanf("%lld",&W);
    
    if(W>=S){
        cout<<"unsafe"<<endl;
    }else{
        cout<<"safe"<<endl;
    }

    return 0;
}


Measured memory_bytes: 3764
#include<bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    int maxK = (N-1)*(N-2)/2;
    if (K > maxK) {
        puts("-1");
        return 0;
    }
    int M = N-1+maxK-K;
    printf("%d\n", M);
    int i = 0;
    for (; i < N-1; ++i) {
        printf("1 %d\n", i+2);
    }
    for (int j = 2; j <= N-1; ++j) {
        for (int k = j+1; k <= N; ++k) {
            if (++i > M) return 0;
            printf("%d %d\n", j, k);
        }
    }
    return 0;
}


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

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

int main()
{
  double q, x, cx;

  while (scanf("%lf", &q), q != -1){
    x = q * 0.5;
    while (abs(x * x * x - q) >= (0.00001 * q)){
      x = x - (x * x * x - q) / (3 * x * x);
    }
    printf("%.6f\n", x);
  }
}

Measured memory_bytes: 1236
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <queue>
#include <set>

using namespace std;

typedef unsigned long long int ULL;
typedef long long LL;
typedef long double LD;


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

	vector<LL> h(n);

	for (auto &e : h) {
		cin >> e;
	}

	vector<LL> dp(n);
	dp[0] = 0;
	dp[1] = abs(h[1]-h[0]);
	for (int i = 2; i < n; ++i) {
		dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i-2] + abs(h[i]-h[i-2]));
	}

	cout << dp[n-1] << "\n";
	 
}

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

long long N, K;
vector<long long> sumV(100001);

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

  int N, K;
  string S;
  cin >> N >> K >> S;
  S[K-1] += 32;
  cout << S <<endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i,s,e) for(int i=(s); i<(e);i++)
#define rep(i,n) REP(i,0,n)
#define rep1(i,n) REP(i,1,n)
#define repe(i,n) for(auto &&i:n)
#define all(v) (v).begin(),(v).end()
#define decimal fixed<<setprecision(20)
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
using LL = long long;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1e9;
const LL LLINF = 1e16;

int main(){
    fastcin();

    int n;
    cin >>n;
    string s;
    cin >> s;
    s = '-'+s;
    int ans = 0;
    rep(i, n){
        if(s[i] != s[i+1]) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
<?php
$n = trim(fgets(STDIN));
$a = explode(" ", trim(fgets(STDIN)));
foreach($a as $num){
    @$map[$num]++;
}
$max = 0;
for($i = 0; $i < 10**5; $i++){
    @$c = $map[$i - 1] + $map[$i] + $map[$i + 1];
    $max = max($max, $c);
}
echo $max;



Measured memory_bytes: 16884
#!/usr/bin/env python3
#  = input()
#a  = int(input())
n, a, b = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

if a == 0:
  print(0)
elif n < (a + b):
  print(min(n, a))
else:
  nab = n // (a + b)
  ans = nab * a
  mod = n % (nab * (a + b))
  ans += min(mod, a)
  print(ans)


Measured memory_bytes: 3060
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    AB = sorted([list(map(int, input().split())) for _ in range(n)], key = lambda x:x[1])

    total = 0
    for a, b in AB:
        total += a
        if total > b:
            print("No")
            break
    else:
        print("Yes")


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 55212
#include<cstdio>
#include<cstring>
#include<string>

using namespace std;

int N;
string str;

bool check(string str){
	for(int i = 1; i < str.size(); ++i) if(str[i] != str[0]) return false;
	return true;
}

int simulate(char c){
	string tmp = str;
	for(int i = 0; ; ++i){
		if(check(tmp)) return i;
		//printf("%s\n", tmp.c_str());
		char ch[110];
		for(int j = 0; j + 1 < tmp.size(); ++j){
			if(tmp[j] == c || tmp[j + 1] == c) ch[j] = c;
			else ch[j] = tmp[j];
		}
		ch[tmp.size() - 1] = '\0';
		tmp = ch;
	}
	return -1;
}

char ch[110];

int main(){
	scanf("%s", ch);
	str = ch;
	int ans = -1;
	for(char ch = 'a'; ch <= 'z'; ++ch){
		int tmp = simulate(ch);
		if(ans == -1 || ans > tmp) ans = tmp;
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
#define rep_down(i,n) for (int i=n-1; i>=0;--i)
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; }
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;
int N;
int H[100005];

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

  cin >> N;
  rep(i,N) cin >> H[i];
  
  bool flag = true;
  bool checked = false;
  H[N] = 1e9;
  rep(i, N){
    if (H[i+1] - H[i] < -1){
      flag = false;
      break;
    };
    if (H[i+1] - H[i] == -1) {
      if (!checked){
        flag = false;
        break;
      } else checked = false;
    }
    if (H[i+1] - H[i] > 0) checked = true;
  }

  string ans = flag?"Yes":"No";

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

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
#define eps 1e-8
using namespace std;
const ll maxn = 1e6 + 5;
ll a,b,c,n,t,m,num[maxn] = {0,1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
string str;
int main()
{
    cin >> a;
    cout << num[a] << endl;
    return 0;
}


Measured memory_bytes: 256
A,B = map(int,input().split())

S = input()

Ans = 0

for i in range(A):
	if S[i].isdigit() == False:
		Ans = 1

if S[A] != "-":
	Ans = 1

for i in range(A+1,len(S)):
	if S[i].isdigit() == False:
		Ans = 1
		
if Ans == 0:
	print("Yes")
	
if Ans == 1:
	print("No")

Measured memory_bytes: 3064
/*                         _
                        _ooOoo_
                       o8888888o
                       88" . "88
                       (| -_- |)
                       O\  =  /O
                    ____/`---'\____
                  .'  \\|     |//  `.
                 /  \\|||  :  |||//  \
                /  _||||| -:- |||||_  \
                |   | \\\  -  /'| |   |
                | \_|  `\`---'//  |_/ |
                \  .-\__ `-. -'__/-.  /
              ___`. .'  /--.--\  `. .'___
           ."" '<  `.___\_<|>_/___.' _> \"".
          | | :  `- \`. ;`. _/; .'/ /  .' ; |
          \  \ `-.   \_\_`. _.'_/_/  -' _.' /
===========`-.`___`-.__\ \___  /__.-'_.'_.-'================

                  Please give me AC.
*/

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>

using namespace std;

using int64 = long long;
using uint64 = unsigned long long;
using vi = vector<int>;
using vl = vector<int64>;
using pii = pair<int, int>;
using pll = pair<int64, int64>;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define print(x) cout << (x) << '\n'
#define print2(x, y) cout << (x) << ' ' << (y) << '\n'
#define print3(x, y, z) cout << (x) << ' ' << (y) << ' ' << (z) << '\n'
#define printn(v) rep(i, (v).size() - 1) cout << (v)[i] << ' '; cout << (v)[n - 1] << '\n';
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define debug2(x, y) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v) for (size_t _ = 0; _ < v.size(); ++_){cerr << #v << "[" << _ << "] : " << v[_] << '\n';}
// constant
const int INF = (1<<30) - 1;
const int64 INF64 = (1LL<<62) - 1;

// End of template.


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

    int n, k;
    string s;
    cin  >> n >> k >> s;

    s = "R" + s + "L";
    int c = 0;
    for(int i = 1; i <= n; ++i) {
        if (s[i] == 'L' && s[i - 1] == 'L') c++;
        if (s[i] == 'R' && s[i + 1] == 'R') c++;
    }
    debug(c);

    print(min(n - 1, c + 2 * k));

    return 0;
}



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

#include <boost/multiprecision/cpp_int.hpp>

#define whole(f, x, ...)                                 \
  ([&](decltype((x)) whole) {                            \
    return (f)(begin(whole), end(whole), ##__VA_ARGS__); \
  })(x)

using namespace std;
using ll = long long;

namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;

void solve() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 0) {
      cout << 0 << endl;
      return;
    }
  }

  Bint sum = 1;
  for (int i = 0; i < n; i++) {
    sum *= a[i];
    if (sum < 0 || sum > 1000000000000000000) {
      cout << -1 << endl;
      return;
    }
  }

  cout << sum << endl;
}

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

  solve();
  return 0;
}


Measured memory_bytes: 4020
# include <stdio.h>
# include <bits/stdc++.h>
using namespace std;
# define fi cin
# define fo cout
# define x first
# define y second
# define ll long long
# define IOS ios_base :: sync_with_stdio(0);cin.tie(0)
# define p(v) cerr << #v << " = " << v << '\n'
# define p2(v) cerr << #v << " = " << (complex < int > (v.x,v.y)) << '\n'
# define vi vector < int >
# define vl vector < ll >
# define pii pair < int , int >
# define mp make_pair
# define db long double
# define pb push_back
# define pdd pair < db , db >
int main(void)
{
    #ifdef CF
    freopen("input","r",stdin);
    #endif // CF
    srand(time(0));
    fo << fixed << setprecision(7);
    cerr << fixed << setprecision(7);
    ll a,b,c,d,e,f,g;
    fi>>a>>b>>c>>d>>e>>f>>g;
    ll ans = (a / 2) * 2 + (d / 2) * 2 + (e / 2) * 2;
    if (min({a,d,e}) >= 1)
        ans = max(ans,3 + ((a - 1) / 2) * 2 + ((d - 1) / 2) * 2 + ((e - 1) / 2) * 2);
    ans += b;
    fo << ans << '\n';
    cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

using ll = long long;

template <typename T>
vector<size_t> argsort(const vector<T> &target) {
    vector<size_t> idx(target.size());
    iota(idx.begin(), idx.end(), 0);
    sort(idx.begin(), idx.end(), [&target](size_t i1, size_t i2) {return target[i1] < target[i2];});
    return idx;
}

struct Edge{
    ll from, to, cost;
    bool operator > (const Edge & e){
        return cost > e.cost;
    }
};

struct UnionFind {
    vector<ll> data;

    UnionFind(int size) : data(size, -1) {}

    bool unionSet(int x, int y) {
        x = root(x);
        y = root(y);
        if (x != y) {
            if (data.at(y) < data.at(x)) swap(x, y);
            data.at(x) += data.at(y);
            data.at(y) = x;
        }
        return x != y;
    }

    bool findSet(int x, int y) {
        return root(x) == root(y);
    }

    int root(int x) {
        return data.at(x) < 0 ? x : data.at(x) = root(data.at(x));
    }

    int size(int x) {
        return -data.at(root(x));
    }
};


int main() {
    ll N;
    cin >> N;
    vector<ll> xs(N);
    vector<ll> ys(N);
    for (auto && i: irange(0LL, N)){
        cin >> xs.at(i) >> ys.at(i);
    }
    vector<size_t> x_sort_idx = argsort(xs);
    vector<size_t> y_sort_idx = argsort(ys);


    // あとは普通にクラスカル法を適用するだけ
    vector<Edge> edges{};
    for (auto && i: irange(0LL, N-1)){
        size_t x1{x_sort_idx.at(i)}, x2{x_sort_idx.at(i+1)};
        size_t y1{y_sort_idx.at(i)}, y2{y_sort_idx.at(i+1)};
        edges.emplace_back(Edge{x1, x2, xs.at(x2)-xs.at(x1)});
        edges.emplace_back(Edge{y1, y2, ys.at(y2)-ys.at(y1)});
    }
    sort(edges.begin(), edges.end(), greater<>());
    UnionFind u(N);
    ll cost{0};
    while(!edges.empty()){
        Edge e = edges.back();
        edges.pop_back();
        if (!u.findSet(e.from, e.to)){
            cost += e.cost;
            u.unionSet(e.from, e.to);
        }
    }
    cout << cost;




    return 0;
}

Measured memory_bytes: 11632
#include <stdio.h>

#define index_max 250

int main(){
  int i;
  int n,a[index_max];
  int left_search,right_search;

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

  for(i = 0 ; i < n ; i++){
    printf("node %d: key = %d, " ,i+1 ,a[i]);

    if(i){
      printf("parent key = %d, " ,a[(i+1)/2-1]);
    }
    left_search=2*i+1;
    if(left_search < n){
      printf("left key = %d, " ,a[2*i+1]);
    }
    right_search=2*i+2;
    if(right_search < n){
      printf("right key = %d, " ,a[2*i+2]);
    }
    printf("\n");
  }

  return 0;
}



Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
#define ll long long
 
int main() {
    
    //ifstream cin("input.txt");
    //ofstream cout("output.txt");
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
    /*-----------------Code Begins Here------------------*/
    
    ll n; cin>>n;
    vector<char> v;
    while(n>0){
        n--;
        ll x=n%26;
        v.push_back('a'+x);
        n/=26;
    }
    for(auto it=v.end()-1;it!=v.begin()-1;it--) cout<<*it;
    
    /*------------------Code Ends Here-------------------*/
    
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main()
{
    long long n,m,i,k,s;
    cin>>n>>m;
    long long a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    multiset<long long>l;
    for(i=0;i<n;i++)
    {
        l.insert(a[i]);
    }
    while(m--)
    {
        k=*l.rbegin();
        l.erase(--l.end());
        l.insert(k/2);
    }
    s=0;
    for(auto i:l)
    {
        s+=i;
    }
    cout<<s<<"\n";
    return 0;
}

Measured memory_bytes: 9096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
void rcmb(ll *x,ll s,ll r,function<void(ll *)>f){if(r==0){f(x);}else{if(s<0)return;rcmb(x,s-1,r,f);x[r-1]=s;rcmb(x,s-1,r-1,f);}}
void cmb(ll n,ll k,function<void(ll *)>f){ll x[k];rcmb(x,n-1,k,f);}
void prm(ll n,function<void(ll *)>f){ll x[n];for(ll i=0;i<n;i++)x[i]=i;do{f(x);}while(next_permutation(x,x+n));}
void prm(ll n,ll k,function<void(ll *)>f){cmb(n,k,[&](ll *c){prm(k,[&](ll *p){ll x[k];for(ll i=0;i<k;i++){x[i]=c[p[i]];}f(x);});});}
// prm(4, 2, [](ll *x){ cout << x[0] << "," << x[1] << "\n"; });


void solve(std::string b){
	string res;
	if (b=="A") res = "T";
	else if (b=="T") res = "A";
	else if (b=="C") res = "G";
	else if (b=="G") res = "C";
	cout << res << "\n";
}

int main(){
    std::string b;
    std::cin >> b;
    solve(b);
    return 0;
}


Measured memory_bytes: 256
import string

n = int(input())
f = []

if n > 26:
	while n:
		n -= 1
		n, r = divmod(n, 26)
		f += [r]
else:
	f += [n-1]

g = ''
s = string. ascii_lowercase
f.reverse()
for i in f:
	g += s[i]

print(g)

Measured memory_bytes: 9944
#include <iostream>
#include <vector>
#include <complex>
#include <utility>
using namespace std;

using W = double;
using P = complex<W>;
using L = pair<P,P>;
using Poly = vector<P>;

#define X real()
#define Y imag()

const W EPS = 1e-10;

W dot(const P&a, const P&b){ return a.X*b.X + a.Y*b.Y; }
W cross(const P&a, const P&b){ return a.X*b.Y - a.Y*b.X; }

P intersection(L a, L b){
  P af = a.first, as = a.second, bf = b.first, bs = b.second;
  return af + cross(bs-bf,af-bf)/(-cross(bs-bf,as-bf)+cross(bs-bf,af-bf))*(as-af);
}

int ccw(P a, P b, P c){
  b -= a, c -= a;
  if(cross(b,c) > +EPS) return +1;
  if(cross(b,c) < -EPS) return -1;
  if(dot(b,c) < -EPS) return +2;
  if(norm(b) < norm(c) - EPS) return -2;
  return 0;
}

Poly convex_cut(const Poly &p, L l){
  Poly ret;
  int n = p.size();
  for(int i = 0; i < n; ++i){
    P cur = p[i], nex = p[(i+1)%n], lf = l.first, ls = l.second;
    if(ccw(lf,ls,cur) != -1)
      ret.push_back(cur);
    if((ccw(lf,ls,cur) != -1) ^ (ccw(lf,ls,nex) != -1))
      ret.push_back(intersection(L(cur,nex),l));
  }
  return ret;
}

W area(const Poly &p){
  int n = p.size();
  W ret = 0;
  for(int i = 0; i < n; ++i){
    P cur = p[i], nex = p[(i+1)%n];
    ret += cross(cur,nex)/2;
  }
  return abs(ret);
}

W solve(const Poly &p, L l, W s){
  W ok = 0, ng = 1e9;
  P d = (l.first-l.second)*P(0,1);
  d /= abs(d);
  //cerr << l.first << " " << l.second << endl;
  for(int i = 0; i < 100; ++i){
    W h = (ok+ng)/2;
    L l_ = l;
    l_.first += d*h;
    l_.second += d*h;
    W s_ = area(convex_cut(p,l_));
    if(s_ < s) ok = h;
    else ng = h;
    if(i+1 == 100){
      Poly q = convex_cut(p,l_);
      // cerr << "Polygon" << endl;
      // for(auto a : q)
      //   cerr << a << endl;
      // fprintf(stderr,"ok = %.12f, ng = %.12f, h = %.12f\n", ok,ng,h);
      // cerr << endl;
    }
  }
  return (ok+ng)/2;
}

int main(){
  int n;
  W d, v;
  while(cin >> n >> d >> v, n){
    Poly p;
    v /= d;
    for(int i = 0; i < n; ++i){
      W x, y;
      cin >> x >> y;
      p.emplace_back(x,y);
    }
    W ans = 0;
    for(int i = 0; i < n; ++i){
      P cur = p[i], nex = p[(i+1)%n];
      L l(nex,cur);
      ans = max(ans,solve(p,l,v));
    }
    printf("%.12f\n",ans);
  }
}



Measured memory_bytes: 3272
#include <iostream>

using namespace std;

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

  int ans = 0;
  int s = a - 1;
  int plugnum = 1;
  while(plugnum<b){
      ans += 1;
      plugnum += s;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
icase=0
if icase==0:
    n=int(input())
    h=list(map(int,input().split()))
    hh=h[0]
    icnt=1
    for i in range(1,n):
        if hh<=h[i]:
            icnt+=1
        hh=max(hh,h[i])
    print(icnt) 
      

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin>>n;
    unordered_map<string,long long> mp;
    for(int i=0;i<n;i++){
        string s;
        cin>>s;
        sort(s.begin(),s.end());
        mp[s]++;
    }
    long long ans=0;
    for(auto ch:mp){
        if(ch.second>1){
            long long s = ch.second;
            long long val = (s*(s-1))/2;
            ans+=val;
        }
    }
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 10660
using System;
using System.Collections.Generic;
using System.Linq;

public class Solution
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var a = vals[0];
        var b = vals[1];
        var problems = Console.ReadLine().Split(' ').Select(int.Parse).OrderBy(v => v).ToList();

        int count = 0;
        while (problems.Count > 0)
        {
            var p0 = problems.Find(p => p <= a);
            if (p0 == 0)
            {
                break;
            }
            problems.Remove(p0);

            var p1 = problems.Find(p => a + 1 <= p && p <= b);
            if (p1 == 0)
            {
                break;
            }
            problems.Remove(p1);

            var p2 = problems.Find(p => b + 1 <= p);
            if (p2 == 0)
            {
                break;
            }
            problems.Remove(p2);
            count++;
        }

        Console.WriteLine(count);
    }
}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;


signed main(){
  int N;cin>>N;
  vector<int> arr(3*N);
  REP(i,0,3*N)cin>>arr[i];
  sort(ALL(arr));
  int ans=0;
  //debug(arr);
  for(int i=3*N-2;N-1<i;i-=2){
    ans+=arr[i];
  }
  print(ans);

}


Measured memory_bytes: 2560
#include <iostream>

using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	int count = 0;
	for (int i = 0; i < n; i++)
	{
		int tmp;
		cin >> tmp;
		if (tmp >= k)
			count++;
	}
	cout << count << endl;
	return 0;
}

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

const int N = 2e5 + 10, mod = 1e9 + 7;

int arr[N];

int main() {
    // ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n, m;
    int tot = 0;
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; i++) {
        scanf("%d" ,&arr[i]);
        tot += arr[i];
    }
    sort(arr, arr + n);
    for(int i = n - 1, j = 1; i >= 0; i--, j++) {
        if(arr[i] < (long double)tot / (4 * m)) break;
        if(j == m) return puts("Yes"), 0;
    }
    puts("No");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()

int main(){
	int N, ans = 0;
	cin >> N;
	string S;
	for (int i = 1;i <= N;i++) {
		S = to_string(i);
		if (S.size() % 2 == 1)ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
/**
 *    Author:  Oak_limy
 *    Created: 2020-09-13 20:01:47
**/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define il inline
#define sz(x) x.size()
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define up upper_bound
using namespace std;
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll min(ll a,ll b){if(a<b)return a;else return b;}
ll lowbit(ll x){return x&(-x);}
ll prime(ll x){
   if(x<=1)return false;
   for(int i=2;i<=int(sqrt(x));i++){
       if(x%i==0)return false;
   }return true;
}bool cmp(ll a,ll b){return a>b;}
ll gcd(ll a,ll b){ll r;while(b>0){r=a%b;a=b;b=r;}return a;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod;for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
inline int readint() {
    char c = getchar(); int w = 1; int x = 0;
    while (!isdigit(c))
        (c == '-') && (w = -w), c = getchar();
    while (isdigit(c))
        x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
    x *= w;
    return x;
}
inline ll readll() {
    char c = getchar(); ll w = 1; ll x = 0;
    while (!isdigit(c))
        (c == '-') && (w = -w), c = getchar();
    while (isdigit(c))
        x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
    x *= w;
    return x;
}
void fl(string name){
    freopen((name+".in").c_str(),"r",stdin);
    freopen((name+".out").c_str(),"w",stdout);
}
const int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1},
          dy[8] = {0, 0, -1, 1, -1, -1, 1, 1};

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<max(max(a*c,a*d),max(b*c,b*d))<<endl;
    return 0;
}
/* stuff to remember
    * int overflow, array bounds
    * special cases (n=1? n=0?)
    * do something instead of nothing and stay organized
    * USE STATIC ARRAYS
    * DEFINING ARRAYS BEFORE main()
    * DO NOT DEFINE ARRAYS IN main()
    * USE INT INSTEAD OF LL,NOTICE THE MLE
*/

Measured memory_bytes: 3720