akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long lint;

int main() {
  string s;
  cin >> s;
  map<int, int> mask_result;
  mask_result[0] = 0;
  int current_mask = 0;
  int result = -1;
  for (int i = 0; i < (int)s.size(); ++i) {
    current_mask ^= 1<<(s[i] - 'a');

    int best_res = INT_MAX;
    for (int l = 0; l <= 26; ++l) {
      int cand_mask;
      if (l < 26) cand_mask = current_mask ^ (1<<l);
      else cand_mask = current_mask;
      if (mask_result.find(cand_mask) != mask_result.end())
        best_res = min(best_res, 1 + mask_result[cand_mask]);
    }

    if (mask_result.find(current_mask) != mask_result.end())
      mask_result[current_mask] = min(mask_result[current_mask], best_res);
    else
      mask_result[current_mask] = best_res;

    if (i == (int)s.size() - 1)
      result = best_res;
  }
  printf("%d\n", result);
  return 0;
}


Measured memory_bytes: 9860
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
long long int INF = 1e18;
long long int MOD = 1000000007;

#define MAX_V 200000

struct edge{
	int to;
	long long int cost;
};

// 速さはO(|E|log|V|)

void shortest_path(int s, int V, long long int d[], vector<edge> G[]){ // Vは頂点数
	
	priority_queue<P, vector<P>, greater<P> > que;
	
	for(int i = 0; i < V; i++){
		d[i] = INF;
	}
	d[s] = 0;
	
	que.push(P(0, s));
	
	while(!que.empty()){
		
		P p = que.top();
		que.pop();
		
		int v = p.second;
		
		if(d[v] < p.first){
			continue;
		}
		
		for(int i = 0; i < G[v].size(); i++){
			edge e = G[v][i];
			if(d[e.to] > e.cost + d[v]){
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		} // 頂点への最小コストを更新
	}
}

vector<edge> G1[MAX_V], G2[MAX_V];
long long int d1[MAX_V], d2[MAX_V];
int main(){
	
	long long int n, m, s, t;
	cin >> n >> m >> s >> t;
	s--;
	t--;
	
	for(int i = 0; i < m; i++){
		int u, v, a, b;
		cin >> u >> v >> a >> b;
		u--;
		v--;
		edge e;
		e.cost = a;
		e.to = u;
		G1[v].push_back(e);
		e.to = v;
		G1[u].push_back(e);
		
		e.cost = b;
		e.to = u;
		G2[v].push_back(e);
		e.to = v;
		G2[u].push_back(e);
	}
	
	shortest_path(s, n, d1, G1);
	shortest_path(t, n, d2, G2);
	
	long long int ans = 0;
	vector<long long int> v;
	
	for(int i = n - 1; i >= 0; i--){
		ans = max(ans, 1000000000000000LL - d1[i] - d2[i]);
		v.push_back(ans);
	}
	
	reverse(v.begin(), v.end());
	
	for(int i = 0; i < n; i++){
		cout << v[i] << endl;
	}
	
	return 0;
}

Measured memory_bytes: 25468
"use strict"

const Main = (input)=>{
const Array =input.split(/\n/)
const N =parseInt(Array[0],10)
const A =parseInt(Array[1],10)
const result = (N % 500) <= A
console.log(result?"Yes":"No" )

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int arr[200009];
bool _map[1000009];
map<int, int> cnt;

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	memset(_map, false, sizeof _map);
	int n;
	cin>>n;
	for(int i = 0; i < n; i++) {
		cin>>arr[i];
		cnt[arr[i]] += 1;
	} 
	if(cnt.size() == 1 && n == 1)cout<<"1\n";
	else if(cnt.size() == 1) cout<<"0\n";
	else {
		int x;
		bool flag;
		int ans = 0;
		sort(arr, arr + n);

		for(int i = 0; i < n; i++) {
			x = arr[i];
			if(cnt[x] > 1) { _map[x] = true; continue;}
			else if(x != 1 && _map[1] == true) { _map[x] = true; continue;}
			
			flag = false;
			for(int j = 2; j <= sqrt(x); j++) {
				if(x % j == 0) {
					if(_map[j] || _map[x/j]) {
						flag = true;
						break;
					}
				}
			}
			if(!flag)
				ans++;
			_map[x] = true;
		}

		cout<<ans<<endl;
	}

}

// 33 45 89 86 
// 3*11, 2*3*3, 3*3*5, 2*2*7, 2*2*2, 19, 89, 2*43, 2, 2*2

// 2, 4, 8, 18, 19, 28, 33 , 45,  
// ans = 1, 19, 33, 45, 89, 





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

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
ld EPS = 1e-12;
int INF = numeric_limits<int>::max() / 2;
ll LINF = numeric_limits<ll>::max() / 2;
int MOD = 1e9 + 7;
#define rep(i,n) for(int i = 0; i < n; i++)
#define all(obj) (obj).begin(), (obj).end()
#define debug(x) cerr << #x << ": " << x << '\n'

bool dp[1005][1005][1005];

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

    int h,w;
    cin >> h >> w;
    vector<vector<char> >area(h+2, vector<char>(w+2,'.'));
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            cin >> area[i][j];
        }
    }
    bool f = true;
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            if(area[i][j] == '#'){
                if(area[i-1][j] == '.' && area[i+1][j] == '.' && area[i][j-1] == '.' && area[i][j+1] == '.'){
                    f = false;
                }
            }
        }
    }
    cout << (f ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
int n,m;
const int maxn=5e4+1000;
const int maxv=600;
struct Edge
{
	int u,v,w,next;
	Edge(int _u=0,int _v=0,int _w=0,int _next=0)
	{
		u=_u,v=_v;w=_w;next=_next;
	}
}edge[maxn*2],tedge[maxn];
int head[maxv],ednum,idx[maxn];
void addedge(int u,int v,int w)
{
	edge[ednum]=Edge(u,v,w,head[u]);
	head[u]=ednum++;
	edge[ednum]=Edge(v,u,w,head[v]);
	head[v]=ednum++;
}
bool cmp(int a,int b)
{
	return tedge[a].w<tedge[b].w;
}
int dfn[maxv],low[maxv],idxn,stnum,sccnum,stk[maxv],scc[maxv];
bool inst[maxv];
void tarjan(int u,int pre)
{
	int i,v;
	dfn[u]=low[u]=++idxn;
	inst[u]=true;
	stk[stnum++]=u;
	for(i=head[u];i!=-1;i=edge[i].next)
	{
		v=edge[i].v;
		//cout <<u<<" "<<v<<" "<<i<<" "<<edge[i].next<<endl;getchar();
		if(v==pre)continue;
		if(!dfn[v])
		{
			tarjan(v,u);
			low[u]=min(low[u],low[v]);
		}
		else if(inst[v])low[u]=min(low[u],dfn[v]);
	}
	if(low[u]==dfn[u])
	{
		++sccnum;
		while(stk[stnum-1]!=u)
		{
			scc[stk[stnum-1]]=sccnum;
			inst[stk[stnum-1]]=false;
			stnum--;
		}
		scc[stk[stnum-1]]=sccnum;
		inst[stk[stnum-1]]=false;
		stnum--;
	}
}
bool isaim[maxn];
int main()
{
	int i,j,u,v,w;
	int num,ans;
	scanf("%d %d",&n,&m);
	for(i=0;i<m;i++)
	{
		idx[i]=i;
		scanf("%d %d %d",&u,&v,&w);
		tedge[i]=Edge(u,v,w);
	}
	num=ans=ednum=0;
	memset(head,-1,sizeof(head));
	memset(isaim,false,sizeof(isaim));
	sort(idx,idx+m,cmp);	
	for(i=0;i<m;i++)
	{
		if(i==0||tedge[idx[i]].w==tedge[idx[i-1]].w)
			addedge(tedge[idx[i]].u,tedge[idx[i]].v,tedge[idx[i]].w);
		else 
		{
			memset(dfn,0,sizeof(dfn));
			memset(scc,0,sizeof(scc));
			memset(inst,false,sizeof(inst));
			idxn=0;sccnum=0;
			for(j=1;j<=n;j++)
				if(!dfn[j])
				{
					stnum=0;
					tarjan(j,-1);
				}
			//cout <<i<<":";for(j=1;j<=n;j++)cout <<scc[j]<<" ";cout <<endl;
			for(j=0;j<i;j++)
				if(scc[tedge[idx[j]].u]!=scc[tedge[idx[j]].v])isaim[idx[j]]=true;
			addedge(tedge[idx[i]].u,tedge[idx[i]].v,tedge[idx[i]].w);
		}
	}
	memset(dfn,0,sizeof(dfn));
	memset(scc,0,sizeof(scc));
	memset(inst,false,sizeof(inst));
	idxn=0;sccnum=0;
	for(j=1;j<=n;j++)
		if(!dfn[j])
		{
			stnum=0;
			tarjan(j,-1);
		}
	//cout <<i<<":";for(j=1;j<=n;j++)cout <<scc[j]<<" ";cout <<endl;
	for(j=0;j<m;j++)
		if(scc[tedge[idx[j]].u]!=scc[tedge[idx[j]].v])isaim[idx[j]]=true;
	for(j=0;j<m;j++)
		if(isaim[j])num++,ans+=tedge[j].w;
	printf("%d %d\n",num,ans);
	return 0;
}

Measured memory_bytes: 3876
#include <stdio.h>

int main()
{
	int i, N;
	long long K, A[100001];
	scanf("%d %lld", &N, &K);
	for (i = 1; i <= N; i++) scanf("%lld", &(A[i]));
	
	int j, k, l, count[60] = {};
	long long X[60] = {}, bit[60];
	for (i = 1, bit[0] = 1; i < 60; i++) bit[i] = bit[i-1] << 1;
	for (i = 1; i <= N; i++) {
		for (j = 0; bit[j] <= K; j++) {
			if ((A[i] | bit[j]) == A[i]) count[j]--;
			else count[j]++;
		}
	}
	for (k = 0; bit[k] <= K; k++);
	for (j = --k; j >= 0; j--) if (count[j] > 0 && X[0] + bit[j] <= K) X[0] += bit[j];
	for (i = 1, l = 0; l < k; i++) {
		X[i] = X[i-1];
		for (; (X[i] | bit[l]) != X[i]; l++);
		X[i] ^= bit[l];
		for (j = l - 1; j >= 0; j--) if (count[j] > 0) X[i] |= bit[j];
	}
	
	long long ans = 0, sum;
	for (l = 0; l < i; l++) {
		sum = 0;
		for (j = 1; j <= N; j++) sum += (A[j] ^ X[l]);
		if (sum > ans) ans = sum;
	}
	printf("%lld\n", ans);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 2484
#include <bits/stdc++.h>
#include <cstdlib> // abs(x-y)
#include <iomanip> // 出力の桁数指定
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
  int n;
  cin >> n;
  
  cout << (n-1)/2 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,f,r;
    while(1){
        cin>>m>>f>>r;
        if(m==-1&&f==-1&&r==-1)break;
        if(m==-1||f==-1)cout<<"F"<<endl;
        else if(m+f>=80)cout<<"A"<<endl;
        else if(m+f>=65)cout<<"B"<<endl;
        else if(m+f>=50)cout<<"C"<<endl;
        else if(m+f>=30){
            if(r>=50)cout<<"C"<<endl;
            else cout<<"D"<<endl;
            
        }
        else cout<<"F"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3088
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  int n;
  cin >> n;
  
  vector<int> p(n);
  
  int sum = 0;
  rep(i,n){
  cin>>p[i];
  sum+=p[i];
  }
    
  int sa=1000000;
  rep(i,n){
    sa=min(sa,abs(n*p[i]-sum));
  }
  
  rep(i,n){
    if(sa==abs(n*p[i]-sum)){
    cout << i << endl;
    return 0;
    }
  }
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VL vector<long long>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int main(){
    string s;
    cin>>s;
    int n=SZ(s);
    LL an=n*(n-1LL)/2;
    int cnt[26]={};
    REP(i,n){
        an-=cnt[s[i]-'a'];
        cnt[s[i]-'a']++;
    }
    cout<<an+1<<endl;
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(x,y) for(lli i=x;i<y;i++)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli l;
    cin>>l;
    double x=(double)(l)/3;
    double ans=x*x*x;
    cout<<fixed<<setprecision(12);
    cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
 
//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//infinity
#define INTINF 2000000000
#define LONGINF 20000000000
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
int main(){
	int x1, y1, x2, y2;
	cin >> x1 >> y1 >> x2 >> y2;
	int x3 = x2 + y1 - y2;
	int y3 = y2 - x1 + x2;
	int x4 = x3 + y2 - y3;
	int y4 = y3 - x2 + x3;
	cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

int main(){
    int n;
    cin >> n;
    int ans = 0;
    while(n--){
        int l, r;
        cin >> l >> r;
        ans += (r-l+1);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
"use strict";
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});
/* 入力は 
 */

const ca = 'a'.charCodeAt(0);
const cz = 'z'.charCodeAt(0);
const chars = [...Array(cz - ca +1).keys()].map(x=>String.fromCharCode(x+ca));

reader.on('close', () => {
    var txt = lines.join('\n')

    var h = aux(txt)

    for (var c of chars) {
	console.log(c + ' : ' + h[c]);
    }
});


function aux(txt)
{
    var re=/[a-z]/;
    var h={};
    for (var c of chars) {
	h[c]=0;
    }

    for (var i=0; i<txt.length; i++) {
	var c = txt[i].toLowerCase()
	if (re.test(c)) {
	    h[c] += 1
	}
    }

    return(h);
}


Measured memory_bytes: 16588
import java.util.Arrays;
import java.util.Scanner;

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

    final int INF = 1_000_000;
    int N = scanner.nextInt();
    int[][] g = new int[N][N];
    for (int i = 0; i < N; i++) {
      char[] l = scanner.next().toCharArray();
      for (int j = 0; j < N; j++) {
        if (l[j] == '1') g[i][j] = 1;
        else if (i != j) g[i][j] = INF;
      }
    }
    int[] ids = new int[N];
    Arrays.fill(ids, -1);
    if (!dfs(N, 0, 0, ids, g)) {
      System.out.println(-1);
      return;
    }

    for (int k = 0; k < N; k++)
      for (int i = 0; i < N; i++) 
        for (int j = 0; j < N; j++) 
          if (g[i][k] + g[k][j] < g[i][j]) g[i][j] = g[i][k] + g[k][j];

    int max = 0;
    for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) max = Math.max(max, g[i][j]);
    System.out.println(max + 1);
  }

  private static boolean dfs(int N, int node, int id, int[] ids, int[][] g) {
    ids[node] = id;
    boolean result = true;
    for (int i = 0; i < N; i++) {
      if (g[node][i] == 1) {
        if (ids[i] < 0) result &= dfs(N, i, 1 - id, ids, g);
        else if (ids[i] != 1 - id) return false;
      }
    }
    return result;
  }
}


Measured memory_bytes: 27092
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int K = sc.nextInt();
        
        Set<Integer> set = new TreeSet<>();
        for(int i = 0; i < K; i++) {
            if( A + i <= B )  set.add( A + i );
            if( B - i >= A )  set.add( B - i );
        }
        
        for( int x : set ) {
            System.out.println( x );
        }
    }
}


Measured memory_bytes: 35684
/// Bismillahir Rahmanir Rahim
/* Mohammad Morsalin
   Dept of ICE, NSTU
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define pb push_back
#define mp make_pair
#define endl "\n"
#define int long long
#define f0(n) for(int i=0;i<n;i++)
#define ms(x) memset(x,0,sizeof(x))
#define ms2d(x,m,n) memset(x, 0, sizeof(x[0][0]) * m * n)
#define uniq(vec) vec.resize(distance(vec.begin(),unique(vec.begin(),vec.end())))
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define pi pair<int,int>
#define tc(t) int t;cin>>t;while(t--)
#define bits(n) __builtin_popcount(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define ins insert
#define ALL(v) v.begin(),v.end()
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define fi first
#define se second
#define PI acos(-1)
#define sz(a) (int)a.size();
#define IOS ios::sync_with_stdio(false);
using namespace std;
int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a);}
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
const long long MOD = 1000000007;
double sq(double x) {return x*x;}
template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}
signed main()
{
    IOS
    double a,b,h,m;
    cin>>a>>b>>h>>m;
    double mp,hp;
    mp=m*6;
    hp=(h*60+m)*0.5;
    double val=abs(mp-hp);
    val=(PI*val)/180;
    double ans=(a*a)+(b*b)-2*a*b*cos(val);
    cout << fixed<< setprecision(15)<< sqrt(ans) << endl;
    return 0;
}
///Alhamdulillah


Measured memory_bytes: 4216
//#include "stdafx.h"
#include<bits/stdc++.h> 
#include<iostream>
#include<queue>
#include<string>
using namespace std;
string s;
int  ans[26],f;
int main()
{
	cin>>s;
	for(int i=0;i<(int)s.size();i++){
		ans[s[i]-'a']++;
	}
		
	for(int i=0;i<26;i++){
		if(ans[i]==0){
			cout<<char('a'+i)<<"\n";
			f=1;
			break;
		}
	}
	if(f==0)
		cout<<"None\n";

	
	
	

	return 0;
}



Measured memory_bytes: 3732
#include <iostream>
#include <array>

using namespace std;

int main() {
    string S;
    cin >> S;
    int len = S.length();
    int count = 0;

    for (int i = 0; i != (len / 2); ++i) {
        if (S[i] != S[len - i - 1])
            count++;
    }

    printf("%d", count);
}



Measured memory_bytes: 256
# include <stdio.h>

int main(void)
{
  int a;
  int i;
  int m = 0;
  
  scanf("%d", &a);
  for (i = 1; i <= a; ++i)
  {
    if (i % 2 == 1)
    {
      m = m + 1;
    }
  }
  printf("%.10f", (double) m / a);
  return 0;
}

Measured memory_bytes: 128
import java.io.*;
import java.util.*;

class Main {
    static Scanner scanner = new Scanner();

    public static void main(String[]$) {
        long k = scanner.nextLong();
        long a = 49 + k / 50 - k % 50;
        System.out.println(50);
        for (int i = 0; i < 50; i++) {
            if (k % 50 > 0) {
                System.out.println(a + 51);
                k--;
            } else {
                System.out.println(a);
            }
        }
    }

    static class Scanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

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

int A = 0, B = 1, C = 2, D = 3;
int n,m,q,a,b,c,d;

int result;

// abcdを保存するリスト
vector<vector<int>> abcds;

// Aの数列を作るリスト
vector<int> vec_a(20);

// A[b] - A[a] = A[c]を満たすA[d]の合計を満たす
void resolve() {
    int tmp = 0;
    for(auto&& abcd : abcds) {
        if(vec_a[abcd[B]] - vec_a[abcd[A]] == abcd[C]) tmp += abcd[D];
    }
    if(result < tmp) result = tmp;
    return;
}

// Aの数列を作る
void dfs(int depth) {
    if(depth == n) {
        // 数列が完成した
        resolve();
        return;
    }
    for(int i = vec_a[depth]; i <= m; i++) {
        vec_a[depth + 1] = i;
        dfs(depth + 1);
    }
    return;
}
int main(){
    cin >> n >> m >> q;
    abcds.assign(q, vector<int>(4, 0));
    for(int i = 0; i < q; i++) {
        cin >> a >> b >> c >> d;
        abcds[i][A] = a;
        abcds[i][B] = b;
        abcds[i][C] = c;
        abcds[i][D] = d;
    }
    vec_a[0] = 1;
    dfs(0);
    cout << fixed << result;
}

Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>

#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define all(v) (v).begin(), (v).end()

using namespace std;


typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> P;

void pp(vi v){
	rep(i, v.size()){
		cout << v[i] << ' ';
	}
	cout << endl;
}

int getDistsq(P p1, P p2){
	return (p1.first - p2.first)*(p1.first - p2.first) + (p1.second - p2.second)*(p1.second - p2.second);
}

int main(){
	int N, Q;

	while(cin >> N >> Q){
		if(!N && !Q) break;

		vi days(101);
		int M;
		rep(i, N){
			cin >> M;
			while(M--){
				int d;
				cin >> d;
				days[d]++;
			}
		}
		int	conv = 0;
		rep(i, 101){
			if(days[i] >= Q){
				if(days[conv] < days[i]){
					conv = i;
				}
			}
		}
		cout << conv << endl;
	}

	return 0;
}

Measured memory_bytes: 1196
#include<bits/stdc++.h>
#define pb push_back 
 #define fo(i,n) for(int i=0;i<n;i++)
#define ll long long 
#define int long long 
#define Mod 1000000007 
#define maxn 200005
#define MAX 4294967296  // 2^32
const int M=1e9+7;
#define ip pair<int,int>
#define test(t) ll t;cin>>t;while(t--)
  
using namespace std;

long long power(int x,int y){
if(y==0)return 1;
long long t=power(x,y/2);
if(y%2==1)return (x*t*t)%Mod;
return (t*t)%Mod;

}
long long gcd(int x,int y){
    // if(y>x)swap(x,y);
    if(y==0)return x;
    return gcd(y,x%y);
}
int fact(int n){
    int t=1;
   for(int i=1;i<=n;i++)t=(t*i)%Mod;
}
int dp[2005];

int sol(int n){
    if(n==1||n==2)return 0;
    if(n>=3&&n<=5)return 1;
if(dp[n]!=-1)return dp[n];
int sum=0;
for(int i=3;i<=n;i++){
    if(n-i>=0)
sum=(sum+sol(n-i))%Mod;
}
dp[n]=sum%Mod;
return sum%Mod;


}
void solve(){
int n;
cin>>n;
memset(dp,-1,sizeof(dp));
dp[0]=1;
    
if(n<3){
    cout<<0;
    return ;
}
if(n>=3 && n<6){
    cout<<1;
    return ;
}
int t=sol(n);

cout<<t%1000000007;




}

signed main(){


    // std::string binary = std::bitset<8>(n).to_string();
    ios::sync_with_stdio(0);
    cin.tie(0);
  
// test(t)  
 solve();


  


}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,m;
vector<int>v[100000+1];
int parent[100000+1];
int vis[100000+1];
int32_t main()
{
   cin>>n>>m;
   memset(vis,-1,sizeof(vis));
   for(int i=0;i<m;i++)
   {
      int a,b;
      cin>>a>>b;
       v[a].push_back(b);
       v[b].push_back(a);
   }
   queue<int>q;
   q.push(1);
   int ans=0;
   vis[1]=1;
   while(!q.empty())
   {
        int x = q.front();
        q.pop();
        for(int i=0;i<v[x].size();i++)
        {  
           if(v[x][i]==1){
              ans=1;
            }
            if(vis[v[x][i]]!=1)
            {  
                q.push(v[x][i]);
                parent[v[x][i]] = x; 
                vis[v[x][i]]=1;
            }
        }
   }
   if(ans==0)
   {cout<<"No";return 0;}
    cout<<"Yes"<<endl;
    for(int i=2;i<=n;i++)
    {
       cout<<parent[i]<<endl;
    }
}

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

#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  map<int, int> mp;
  for (int aa : a) {
    mp[aa]++;
  }
  int res = 0;
  for (auto m : mp) {
    if (m.second % 2 != 0) {
      res++;
    }
  }

  cout << res << endl;

  return 0;
}


Measured memory_bytes: 5376
#include<iostream>
#include<vector>

int main(){

	int n;
	while (std::cin >> n, n){

		std::vector<int>k(n);
		std::vector<int>count(n, 0);

		for (int i = 0; i < n; i++)std::cin >> k[i];

		for (int i = 0, cnt = 0;; i++){

			if (k[i%n] >= 1){
				k[i%n]--;
				count[i%n]++;

				if (count[i%n] >= 2){
					std::cout << i + 1 - cnt << std::endl;
					break;
				}
			}
			else cnt++;
			if (cnt == n){
				std::cout << "NA" << std::endl;
				break;
			}

		}

	}

	return 0;
}

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

#define reb(i,b,n) for(int i=(int)(b); i<(int)(n); i++)
#define rep(i,n) reb(i,0,n)
#define rreb(i,b,n) for(int i = b-1; i >= n; i--)
#define rrep(i,n) reb(i,n,0)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define reach(it,v) for(__typeof((v).rbegin()) it=(v).rbegin();it!=(v).rend();it++)
#define vall(x) (x).begin(), (x).end()
#define rvall(x) (x).rbegin(), (x).rend()
#define vsort(v) sort(vall(v))
#define rvsort(v) sort(rvall(v))
#define len(array) (sizeof (array) / sizeof *(array))
#define aall(x) x, x+len(x)
#define asort(x) sort(aall(x))
#define rasort(a, type) sort(aall(a), greater<type>())
#define afill(a, v) fill(aall(a), v)
#define afill2(a, v, type) fill((type *)a, (type *)(a + len(a)), v)
#define sz(x) (int)(x).size()
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pb push_back
#define _USE_MATH_DEFINES
#define priArr(table, n) rep(i,n){cout<<table[i]<<' ';}cout<<'\n';
#define priAr2(table,W,H) rep(y,H){rep(x,W)cout<<table[y][x]<<' ';cout<<'\n';}
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = ["<<(x)<<"]"<<endl;

using namespace std;
using std::stringstream;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline std::string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class F, class T> inline void convert(const F &f, T &t){stringstream ss;ss<<f;ss>>t;}
template<class T> inline T sqr(T x) {return x*x;}

typedef long long ll; typedef unsigned long long ull;
typedef pair <int, int> P; typedef pair <int, P> PP;
typedef vector<int> vi;typedef vector<vi> vvi;typedef vector<string> vs;
typedef vector<ll> vl; typedef vector<P > vP; typedef vector<char> vc;
typedef long double ld;

const static int INF = 0x3f3f3f3f;
const static ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const static double EPS = 1e-9;
const static ll MOD = 1000000007LL;

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

int main(int argc, char *argv[])
{
    int k, n;
    cin >> k >> n;
    vi v(n);
    rep(i, n) { cin >> v[i]; }
    v.pb(k + v[0]);

    int ans = INF;

    rep(i, n) {
        ans = min(ans, (k - (v[(i+1)] - v[i])));
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1792
cards = [list(input().replace("a", "0").replace("b","1").replace("c","2")) for _ in range(3)]
next = 0
while True:
  if len(cards[next]) == 0:
    print("A" if next == 0 else ("B" if next == 1 else "C"))
    exit()
  next = int(cards[next].pop(0))

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstdlib>
#include<utility>
using namespace std;

#define N 1000009
int trie[N][5];
int nt;

void insert(string s){
	int tp = 0;
	for(int i=0; i<s.length(); i++){
		int p = 0;
		if(s.at(i)=='A') p = 1;
		if(s.at(i)=='T') p = 2;
		if(s.at(i)=='G') p = 3;
		if(s.at(i)=='C') p = 4;
		if(trie[tp][p]==-1){
			trie[tp][p] = nt;
			tp = nt;
			nt++;
		}else{
			tp = trie[tp][p];
		}
	}
//	cout << "ins " << s << " " << tp << endl;
	trie[tp][0] = -2;
}

int find(string s){
	int tp = 0;
	for(int i=0; i<s.length(); i++){
		int p = 0;
		if(s.at(i)=='A') p = 1;
		if(s.at(i)=='T') p = 2;
		if(s.at(i)=='G') p = 3;
		if(s.at(i)=='C') p = 4;
		if(trie[tp][p]==-1){
			return 0;
		}else{
			tp = trie[tp][p];
		}
	}
	if(trie[tp][0] == -2){
//	cout << "found " << s << " " << tp << endl;
		return 1;
	}
	return 0;
}

int main(){
	for(int i=0; i<N; i++){
		for(int j=0; j<5; j++){
			trie[i][j] = -1;
		}
	}
	nt = 1;
	int n;
	cin >> n;
	for(int i=0; i<n; i++){
		char s1_[10];
		char s2_[12];
		scanf("%s %s", s1_, s2_);
		string s1 = s1_;
		string s2 = s2_;
		if(s1=="insert") insert(s2);
		if(s1=="find"){
			if(find(s2)){
				cout << "yes" << endl;
			}else{
				cout << "no" << endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 20768
import sys
input = sys.stdin.readline

N, M = map(int,input().split())
mod = 1000000007
def comb(a,b):
    if b > a-b: return comb(a,a-b)
    ansMul = 1
    ansDiv = 1
    for i in range(b):
        ansMul*=a-i
        ansDiv*=i+1
        ansMul%=mod
        ansDiv%=mod
    
    return ansMul * modpow(ansDiv, mod-2) %mod

def modpow(a,p):
    if p==0: return 1
    if p%2==0:
        halfP = p//2
        half = modpow(a,halfP)
        return half*half%mod
    else:
        return a*modpow(a,p-1)

i=2
Mnokori = M
ans=1
while i*i <= Mnokori:
    if Mnokori%i==0:
        cnt=0
        while Mnokori%i==0:
            Mnokori//=i
            cnt+=1
        ans*=comb(cnt+N-1,N-1)
        ans%=mod
    i+=1
if Mnokori!=1:
    ans*=comb(N,N-1)
    ans%=mod  
print(ans%mod)




Measured memory_bytes: 38512
N,M = map(int,input().split())
L = []
for i in range(M):
  L.append(list(map(int,input().split())))
K = [0]*(10**5)
for i in range(M):
  for j in range(2):
    K[L[i][j]-1] += 1
flag = True
for i in range(10**5):
  if K[i]%2 != 0:
    flag = False
    break
if flag:
  print('YES')
else:
  print('NO')

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

int main() {
	int n,l; cin>>n>>l;
	int a[n],cnt=0,sum=0;
	for(int i=0;i<n;i++) { a[i]=l+i; sum+=a[i]; }
	if(a[0]<=0 && a[n-1]>=0) cnt=sum;
	else if(a[0]>0) cnt=sum-a[0];
	else cnt=sum-a[n-1];
	cout<<cnt<<endl;
	return 0;
}

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

int mod = 1e9 + 7;

long long modpow(long long x, long long y){
    if (y == 0) return 1;
    if (y % 2) return x * modpow(x, y - 1) % mod;
    long long res = modpow(x, y / 2);
    return res * res % mod;
}

int main(){
    long long ans = 0;
    vector<long long> fac(2e6 + 2, 1);
    for (int i = 2; i < 2e6 + 2; i++) fac[i] = fac[i - 1] * i % mod;
    vector<long long> inv(1e6 + 2, 1);
    for (int i = 2; i < 1e6 + 2; i++) inv[i] = (mod - (mod / i) * inv[mod % i] % mod) % mod;
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    long long a = (fac[r1 + c2 + 1] * modpow(fac[r1 + 1], mod - 2) % mod) * modpow(fac[c2], mod - 2) % mod;
    long long b = (fac[r1 + c1] * modpow(fac[r1 + 1], mod - 2) % mod) * modpow(fac[c1 -1], mod - 2) % mod;
    ans += (mod + a - b) % mod;
    ans %= mod;
    for (int r = r1 + 1; r <= r2; r++)
    {
        a *= r + c2 + 1;
        a %= mod;
        a *= inv[r + 1];
        a %= mod;
        b *= r + c1;
        b %= mod;
        b *= inv[r + 1];
        b %= mod;
        ans += (mod + a - b) % mod;
        ans %= mod;
    }
    cout << ans << endl;
}


Measured memory_bytes: 23680
N = int(input())
a=list(map(int,input().split()))
ans=2020202020
s=sum(a)
mae=a[0]
for i in range(1,N):
    mae+=a[i]
    ato=s-mae
    if mae-ato>0:
        ans=min(abs(sum(a[:i])-sum(a[i:])),abs(sum(a[:i+1])-sum(a[i+1:])))
        break
    else:
        ans=min(ans,abs(mae-ato))
print(ans)

Measured memory_bytes: 89932
import java.util.Scanner;

public class Main {

	final static int 	BUILDINGS = 4, // 棟数
						FLOORS = 3, // 階数
						ROOMS = 10; // 部屋数

	static int[][][] house = new int[BUILDINGS][FLOORS][ROOMS]; // 入居者を記録する

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		// 入力件数の入力
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {

			// 各情報の入力
			int b = (sc.nextInt());
			int f = (sc.nextInt());
			int r = (sc.nextInt());
			int v = (sc.nextInt());

			//入居者を変更
			ChangeTenants(b, f, r, v);
		}

		//表示
		print();
	}

	// 入居者の変更
	static void ChangeTenants(int b, int f, int r, int v) {
		// 入力データを記録用配列に合わせ、入居者を加算
		house[b - 1][f - 1][r - 1] += v;
	}

	// 表示処理
	static void print() {
		
		for (int b = 0; b < BUILDINGS; b++) {

			for (int f = 0; f < FLOORS; f++) {

				String output = "";
				for (int r = 0; r < ROOMS; r++) {

					// 数字の前にスペースを入れる
					output += " " + house[b][f][r];
				}
				// 出力
				System.out.println(output);

			}
			// 棟が変わる場合#を20個入れる(最後の行には入れないように)
			if (b < 3) {
				System.out.println("####################");
			}
		}
	}

}



Measured memory_bytes: 29672
#include<bits/stdc++.h>
using namespace std;
int GCD(int w,int h);
int r;
int main(){
    int w,h,c;
    int sum;
    cin>>w>>h>>c;
    sum=GCD(w,h);
   w=w/sum;
    h=h/sum;
    cout<<w*h*c<<"\n";
    return (0);
}
int GCD(int w,int h){
while (h!=0)
{
    r=w%h;
    w=h;
    h=r;
}
return (w);
}



Measured memory_bytes: 3132
import java.text.DecimalFormat;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        
        final long N = sc.nextLong();
        long ans = 0;
        long i = 100;
        
        while (true) {
            if (i >= N) break;
            i *= 1.01;
            ans++;
        }
        
        
        out.println(ans);

        out.flush();
    }

}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 32664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<int>>;
const int INT_INF = 1001001001;
//stoi(s) : string→int stoll(s) :string→longlong  int→string to_string(i)
const double PI = acos(-1.0);
//小数点の表し方 cout << fixed << setprecision(5);

vector<ll> p(200);

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}
void first(){
    p[0] = 0;
    for(int i=1;i<200;i++){
        p[i] = p[i-1] + i;
    }
}

int main(){
    ll n;
    cin >> n;
    vector<pair<ll,ll>> prime;
    first();
    prime = prime_factorize(n);
    if(n==1){
        cout << 0 << endl;
        return 0;
    }
    if(n==2){
        cout << 1 << endl;
    }
    ll ans = 0;
    /*
    for(auto x:p){
        cout << x << " ";
    }cout << endl;
    */
    /*
    for(auto x:prime){
        cout << x.first << " " <<  x.second << endl;
    }
    */
    
    for(int i=0;i<prime.size();i++){
        ll q = prime[i].second;
        if(q==2){
            ans += 1;
        }else{
        auto iter_lower = upper_bound(p.begin(),p.end(),q);
        ll idxA = iter_lower - p.begin() - 1;
        //cout << prime[i].first << " " << idxA << endl;
        ans += idxA;
        }
    }
    cout << ans << endl;

    /*
    for(auto x:p){
        cout << x << endl;
    }
    */

}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) xmax = x; return true;
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) xmin = x; return true;
    return false;
}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr); ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;

void solve() {
    ll a, b, c; cin >> a >> b >> c;
    auto check = [](ll i, ll j, ll k) -> bool {
        return (i%2==0) && (j%2==0) && (k%2==0);
    };

    FOR(i, 0, 1000) {
        if (!check(a,b,c)) { cout << i << endl; return; }
        int ta = (b+c)/2;
        int tb = (a+c)/2;
        int tc = (a+b)/2;
        a = ta; b = tb; c = tc;
    }
    cout << -1 << endl;
}

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

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

int main() {
  int N;
  cin >> N;
  vector<int> v(N);
  double ans = 0;

  for ( int i = 0; i < N; i++ ){
    cin >> v.at(i);
  }
  sort(v.begin(),v.end());

  ans = (double)( v.at(0) + v.at(1) ) / 2.0;

  for ( int i = 2; i < N; i++ )
    ans = (double)( ans + v.at(i) ) / 2.0;

    cout <<  ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long;
using ULL = unsigned long long;

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

    if (a == "H") {
        if (b == "H") {
            cout << "H" << endl;
        } else {
            cout << "D" << endl;
        }
    } else {
        if (b == "H") {
            cout << "D" << endl;
        } else {
            cout << "H" << endl;
        }
    }
}


Measured memory_bytes: 256
/*
    Author - Param Kothari
    Ah shit, here we go again
*/

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

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mk make_pair 
 
typedef long long ll;
typedef long double ld;

const ll MOD = 1000000007;

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

void solve(){
    ll n, k;
    cin >> n >> k;
    ll res = 0;
    ll dp[k + 1] = {0};
    for(int i = k; i >= 1; i--){
        ll temp = k / i;
        dp[i] = modp(temp, n, MOD);
        for(int j = 2; j <= temp; j++){
            dp[i] = (dp[i] - dp[j * i] + MOD) % MOD;
        }
        dp[i] %= MOD;
        res = (res + (i * dp[i]) % MOD) % MOD;
    }
    cout << res % MOD << "\n";
    return;
}
 
int main(){
    IOS;
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}



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

int main() {
  long n,m;
  string ans="Yes";
  cin >> n >> m;
  if(m%2==1) ans="No";
  if(m<n*2) ans="No";
  if(m>n*4) ans="No";
  cout << ans << endl;
}

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

public class Main {
    public static void main(String[] args)throws IOException {
        BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
        String line=br.readLine();
        String split[]=line.split(" ",0);
        int a=Integer.parseInt(split[0]);
        int b=Integer.parseInt(split[1]);
        int c=Integer.parseInt(split[2]);
        if (a<b&&b<c) {
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}

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

int main(){
  int a,b,c,d,delta;
  cin >> a >> b >> c >> d;
  delta = a+b-c-d;
  if (delta>0){
    cout << "Left" << endl;
  }else if (delta == 0){
    cout << "Balanced" << endl;
  }else{
    cout << "Right" << endl;
  }
  return  0;
}


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

int main() {
  int a, b, c, d;
  string s = "Balanced";
  cin >> a >> b >> c >> d;
  if (a + b > c + d) {
    s = "Left";
  } else if (a + b < c + d) {
    s = "Right";
  }
  cout << s << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define EPS 1e-9
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    int l,r;
    cin >> l >> r;
    int dp[70][2][2][2] = {};
    // j : L<xか？
    // k : y<Rか？
    // s : 先頭がすでに現れたか？
    dp[60][0][0][0] = 1;
    for(int i = 59; i >= 0; i--){
        int lb = (l >> i) & 1;
        int rb = (r >> i) & 1;
        rep(j,2)rep(k,2)rep(s,2){
            int now = dp[i+1][j][k][s];
            rep(x,2)rep(y,2){
                if(x == 1 && y == 0)continue;
                int nj = j, nk = k, ns = s;

                if(s == 0 && x != y)continue;//桁数が同じじゃない
                if(x && y)ns = 1;//初めて1が現れる

                if(j == 0 && x == 0 && lb)continue;//1しか選べないときに0を選ぶ(x<Lになる)
                if(x && lb == 0)nj = 1;//xが0,1どっちでもいいときに1を選ぶ

                if(k == 0 && y && rb == 0)continue;//0しか選べないときに1を選ぶ(R<yになる)
                if(y == 0 && rb)nk = 1;//yが0,1どっちでもいいときに0を選ぶ

                (dp[i][nj][nk][ns] += now) %= MOD;
            }
        }
    }
    int ans = 0;
    rep(j,2)rep(k,2)rep(s,2)(ans += dp[0][j][k][s]) %= MOD;
    cout << ans << endl;
}


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

int main(){
  int n,m;
  int field[1000];
  while(1){
    cin >> n >> m;
    if(n == 0 && m == 0) break;
    for(int i = 0;i < n;i++) cin >> field[i];
    int cnt = -1,pos = 0;
    for(int i = 0;i < m;i++){
      int t;
      cin >> t;
      if(cnt != -1) continue;
      pos += t;
      if(pos >= n - 1) cnt = i;
      pos = pos + field[pos];
      if(pos >= n - 1) cnt = i;
    }
    cout << cnt + 1 << endl;
  }
  return 0;
}

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

int main(){
    std::string in{};
    std::cin >> in;

    int price = 700;

    for(int i = 0; i < 3; ++i){
        if(in.at(i) == 'o'){
            price += 100;
        }
    }

    std::cout << price;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
  int n,m,s[100001]={0},now=0,in,ans=0;

  scanf("%d%d",&n,&m);

  for(int i=1;i<n;i++){
    scanf("%d",&s[i]);
    s[i]+=s[i-1];
  }

  for(int i=0;i<m;i++){
    scanf("%d",&in);
    if(in>0)
      ans+=s[now+in]-s[now];
    else
      ans+=s[now]-s[now+in];

    ans%=100000;
    now+=in;
  }

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

Measured memory_bytes: 1424
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

vector<int> v;

int main(){
  int N;
  cin >> N;
  for(int i=0; i<N; i++){
    int a; cin >> a;
    v.push_back(a);
  }
  sort(v.begin(),v.end());
  double ans=v[0];
  for(int i=1; i<N; i++){
    ans=(ans+v[i])/2.0;
  }
  printf("%lf\n",ans);
  return 0;
}

Measured memory_bytes: 256