akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>


#define base 1000000007LL
#define ll long long
// unsigned long long int t = 10000000000000000003ULL;
#define ulint unsigned long long int
#define ld long double
#define X first
#define Y second
#define pb push_back
#define EPS 1e-15
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())

#define ms(s, n) memset(s, n, sizeof(s))

#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define sqr(a) (a)*(a)

#define foru(i,a,b) for (ll i = (a); i <= (b); i++)
#define ford(i,a,b) for (ll i = (a); i >= (b); i--)
#define cbit(a) __builtin_popcount(a)
#define uni(a) (a).resize(unique(all(a)) - (a).begin())
#define cprint(n) printf("%.6lf + %.6lfi\n", (n).real(), (n).imag())

#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it !=(a).end(); it++)


using namespace std;
typedef pair<ll, ll> II;
typedef pair<int, int> ii;



struct Edge{
    ll u,v,w;
    Edge(ll u=0, ll v=0, ll w=0): u(u),v(v),w(w) {}
    bool operator < (Edge a){return w<a.w;}
};

const int M=1e5+7;
const int MM=4*M;
const ll MOD=base;
const int MAX=1e9;


inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll power(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1LL) {if (k & 1LL) r = r * n % p; n = n * n % p;} return r;}
inline ll inverse(ll n, ll p=MOD){return power(n,p-2);}
ll search(ll a[], ll N, ll x){ ll l = 0, r = N - 1; while (l <= r){ ll mid = (l + r) / 2; if (x == a[mid]){ return 1; } else if (x < a[mid]){ r = mid - 1; } else if (x > a[mid]){ l = mid + 1; } } return -1; }

map<string, int> m;
string s;
ll n;

int main(){
    ios::sync_with_stdio(0);
	cin >> n;
	bool ok = true, ok1 = true;
	cin >> s;
	m[s]++;
	
	string temp = s;
	for (int i = 1; i < n; i++){
		cin >> s;
		m[s]++;
		if(s[0] != temp[temp.size() - 1]){
			ok1 = false;
		}
		
		if(m[s] >= 2){
			ok = false;
		}
		
		temp = s;
	}	    
	//cout << ok << "->" << ok1 << endl;
	if(!ok || !ok1){
		cout << "No"; return 0;
	}
	cout << "Yes";
    return 0;
}





Measured memory_bytes: 384
#include <iostream>
using namespace std;
int main() {
    int N, a, cnt = 0, tmp = 0;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a;
        if (a % 4 == 0) cnt++;
        else if (a % 2 == 0) tmp++;
        if (tmp == 2) {
            cnt++;
            tmp = 0;
        }
    }
    cout << (N / 2 <= cnt ? "Yes" : "No") << endl;
}

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

#define MAX 200000

int max(int a,int b) { return a>b ? a: b;}
int min(int a,int b) { return a<b ? a: b;}

int main(void) {
	int R[MAX], i, n;
	
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%d",&R[i]);
	
	int maxv = -2000000000;
	int minv = R[0];
	
	for(int i=1; i<n; i++) {
		maxv = max(maxv, R[i] - minv);
		minv = min(minv, R[i]);
	}
	
	printf("%d\n",maxv);

	return 0;
}


Measured memory_bytes: 2640
#include<bits/stdc++.h>
using namespace std;
const int nmax = 2e5+10;
const int INF = 0x3f3f3f3f;
typedef long long ll;
typedef double db;
map<ll,ll> mpall;
map<ll,ll> mpfront;
int n;
ll a[nmax];
ll prefix[nmax];
int main(){
    scanf("%d",&n);
    for(int i = 1;i<=n;++i){
        scanf("%lld",&a[i]);
        if(i == 1) prefix[i] = a[i];
        else {
            prefix[i] = prefix[i-1] + a[i];
        }
        mpall[prefix[i]] ++;
    }
    ll sum = 0;
    ll cnt = 0;
    for(int i = 1;i<=n;++i){
        cnt += mpall[sum] - mpfront[sum];
        mpfront[prefix[i]] ++;
        sum += a[i];
    }
    printf("%lld\n",cnt);
    return 0;
}


Measured memory_bytes: 28416
#include<cstdio>
#include<map>
#include<cstring>
#include<iomanip>
#include<iostream>
#include<algorithm>
#define MAXN 46
using namespace std;
int n;
long long ans;
char a[MAXN];
//map<pair<unsigned int,unsigned int>,int> ma;
map<pair<string,string>,long long> ma;
int main()
{
	scanf("%d",&n);
	scanf("%s",a);
	int Max=1<<n;
	for(int s=0;s<Max;s++)
	{
		//unsigned int p=0,q=0;
		string p,q;
		for(int i=0;i<n;i++)
		{
			if(s&(1<<i)) /*p=p*131+a[i]-'a'+1;*/p=p+a[i];
			else /*q=q*131+a[i]-'a'+1;*/q=q+a[i];
		}
		ma[make_pair(p,q)]++;
	}
	for(int s=0;s<Max;s++)
	{
		//unsigned int p=0,q=0;
		string p,q;
		for(int i=n*2-1;i>=n;i--)
		{
			if(s&(1<<(n*2-i-1))) /*p=p*131+a[i]-'a'+1;*/p=p+a[i];
			else /*q=q*131+a[i]-'a'+1;*/q=q+a[i];
		}
		ans+=ma[make_pair(q,p)];
	}
	printf("%lld",ans);
}

Measured memory_bytes: 87808
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#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>

using namespace std;

#define ll long long
#define vi vector<int>
#define FOR(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 pb push_back
#define pi 3.14159265359


int main() {
	ll X,Y;
	cin >> X >> Y;
	if (X == 1 || X == 3 || X == 5 || X == 7 || X == 8 || X == 10) {
		if (Y == 1 || Y == 3 || Y == 5 || Y == 7 || Y == 8 || Y == 10) {
			cout << "Yes";
		}
		else {
			cout << "No";
		}
	}
	else if (X == 4 || X == 6 || X == 9 || X == 11) {
		if (Y == 4 || Y == 6 || Y == 9 || Y == 11) {
			cout << "Yes";
		}
		else {
			cout << "No";
		}
	}
	else {
		cout << "No";
	}

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define deb(x) cout << #x << "=" << x << endl
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
int M=1e9+7,N=205001;

int mm(int x,int y){x%=M,y%=M;return (x*y)%M;}//Modular Multiply
int po(int x,int y){ if(!y)return 1;int a=po(x,y/2)%M;if(y%2)return mm(a,mm(a,x));return mm(a,a);}//(x**y)%M



void solve() {
	int n;
	cin>>n;
	int ans=((po(10,n)-mm(2,po(9,n))+po(8,n))%M+M)%M;
	cout<<ans;
}


signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}





Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
typedef long long ll;

int main() {
    string ch;
    cin >> ch;
    char c[10];
    if(ch.length() >= 4 && ch[0] == 'Y' && ch[1] == 'A' && ch[2] == 'K' &&ch[3] == 'I') {
        printf("Yes");
    }
    else printf("No");

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>

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

using namespace std;
typedef long long int ll;
const ll INF = 1000000000;

int main()
{
    ll h, w;
    cin >> h >> w;

    if (h == 1 || w == 1) {
        cout << 1 << endl;
    }
    else {
        cout << (h * w + 1) / 2 << endl;
    }
    return 0;
}


Measured memory_bytes: 256
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("fma,avx")

#include <bits/stdc++.h>

using namespace std;

#define int long long
#define sz(a) (int) (a).size()
#define all(a) (a).begin(), (a).end()
#define x first
#define y second

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int p = 1e9 + 7;

int bin_pow(int x, int m) {
    int res = 1;
    while (m) {
        if (m & 1) {
            res = (res * x) % p;
            res = (res + p) % p;
        }
        x = (x * x) % p;
        x = (x + p) % p;
        m >>= 1;
    }
    return res;
}

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

    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(all(a), [&] (const int a, const int b) {
        return abs(a) > abs(b);
    });
    int sgn = 1;
    int ans = 1;
    int last1 = -1, last2 = -1;
    for (int i = 0; i < k; i++) {
        if (a[i] < 0) {
            sgn *= -1;
            last1 = i;
        } else {
            last2 = i;
        }
        ans = ((ans * a[i]) % p + p) % p;
    }
    if (ans == 0 || sgn == 1) {
        cout << ans << "\n";
        return 0;
    }
    if (last2 == -1) {
        int pos = -1;
        for (int i = k; i < n; i++) {
            if (a[i] >= 0) {
                pos = i;
                break;
            }
        }
        if (pos != -1) {
            ans = ans * (bin_pow(a[last1], p - 2)) % p;
            ans = ans * a[pos] % p;
        } else {
            ans = 1;
            reverse(all(a));
            for (int i = 0; i < k; i++) {
                ans = ((ans * a[i]) % p + p) % p;
            }
        }
    } else {
        int pos1 = -1, pos2 = -1;
        for (int i = k; i < n; i++) {
            if (a[i] < 0) {
                if (pos1 == -1)pos1 = i;
            } else {
                if (pos2 == -1) pos2 = i;
            }
        }
        if (pos1 == -1 && pos2 == -1) {
        } else if (pos1 == -1) {
            ans = (ans * bin_pow(a[last1], p - 2)) % p;
            ans = (ans * a[pos2]) % p;
        } else if (pos2 == -1) {
            ans = (ans * bin_pow(a[last2], p - 2)) % p;
            ans = (ans * a[pos1]) % p;
        } else {
            if (a[pos2] * a[last2] > a[pos1] * a[last1]) {
                ans = (ans * bin_pow(a[last1], p - 2)) % p;
                ans = (ans * a[pos2]) % p;
            } else {
                ans = (ans * bin_pow(a[last2], p - 2)) % p;
                ans = (ans * a[pos1]) % p;
            }
        }
    }
    cout << (ans + p) % p << '\n';

    return 0;
}

Measured memory_bytes: 4776
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1 << 17;
typedef long long LL;
const int INF = (1LL << 31LL) - 1;
int n, q;
int dat[2 * N - 1];

void init()
{
	int a = n;
	n = 1;
	while(n < a) n *= 2;
	for(int i = 0; i != n * 2 - 1; ++i)
		dat[i] = INF;
}

void update(int k, int a)
{
	k += n - 1;
	dat[k] = a;
	while(k > 0){
		k = (k - 1) / 2;
		dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
	}
}

int query(int a, int b, int k, int l, int r){
	if(r <= a || b <= l) return INF;
	
	if(a <= l && r <= b) return dat[k];
	else {
		int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		
		return min(vl, vr);
	}
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	cin >> n >> q;
	init();
	
	int c, x, y;
	for(int i = 0; i < q; ++i){
		cin >> c >> x >> y;
		if(c == 0)
			update(x, y);
		else {
			++y;
			cout << query(x, y, 0, 0, n) << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 2220
#include<bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int (i)=0;(i) < (N); (i)++)
#define all(V) V.begin(), V.end()
using i64 = int_fast64_t;
using P = pair<i64,i64>;

int main(){
    int x, y;
    cin >> x >> y;
    cout << abs(x - y) << endl;
}



Measured memory_bytes: 3100
n = int(input())
l = list(map(int,input().split()))
err = 0
total = 0

while err == 0:
    count = 0
    for nom in l:
        if nom % 2 == 1:
            err = 1
            count += 1
        else:
            l[count] = nom / 2
            count += 1
    if err == 0:
        total += 1
print(total)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
using namespace std;

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  char k;
  cin >> k;
  if(k == 'a' || k == 'e' || k == 'i' || k == 'o' || k == 'u'){
    cout << "vowel" << endl;
  }else{
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define  all(v)     (v).begin(),(v).end()
#define  rall(v)    (v).rbegin(),(v).rend()
#define  pb         push_back
#define  eb         emplace_back
#define  mp         make_pair
#define  ff         first
#define  ss         second
#define  pf         push_front
#define  bs         binary_search
#define  lb         lower_bound
#define  ub         upper_bound
#define  dec(x)   fixed<<setprecision(x)
#define  lcm(a,b)   (a*b/__gcd(a,b))
const ll inf=LLONG_MAX;
const ll mod=1e9+7;
const ld pi=acos(-1);
                    
void solution(){
    string s,t;
    cin>>s>>t;
    ll tot=t.size();
    for(int i=0;i<=(s.size()-t.size());i++){
        string sub=s.substr(i,t.size());
        ll ans=0;
        for(int j=0;j<t.size();j++){
            if(t[j]!=sub[j]) ans++;
        }
        tot=min(tot,ans);
    }
    cout<<tot;
    
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll t;
    t=1;
   // cin>>t;
    while(t--){
        solution();
        cout<<"\n";
    }
    return 0;
}


Measured memory_bytes: 3652
h, n = map(int, input().split())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

dp = [h * 10 ** 4] * (h + 1)
dp[0] = 0
for i in range(n):
    for j in range(min(a[i], h+1)):
        dp[j] = min(dp[j], b[i])
    for j in range(a[i], h + 1):
        dp[j] = min(dp[j], dp[j - a[i]] + b[i])
print(dp[-1])

Measured memory_bytes: 73852
#include <iostream>

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

const int SIZE = 101;
int d[SIZE], f[SIZE], a[SIZE][SIZE];
int t = 1;

void dfs(int u, int n) {
  d[u] = t;
  t++;
  rep(i, n) {
    if (a[u][i] && d[i] == 0 && f[i] == 0) dfs(i, n);
  }
  f[u] = t;
  t++;
}

int main() {
  int n;
  std::cin >> n;

  rep(i, n) rep(j, n) a[i][j] = 0;

  rep(i, n) {
    int u, k, v;
    std::cin >> u >> k;
    rep(j, k) {
      std::cin >> v;
      a[u - 1][v - 1] = 1;
    }
  }

  rep(i, n) if (d[i] == 0 && f[i] == 0) dfs(i, n);

  rep(i, n) { std::cout << i + 1 << ' ' << d[i] << ' ' << f[i] << '\n'; }

  return 0;
}



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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

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

  SCIN(S);
  deque< int > ans;
  REP(i, S.size()) {
    if (S[i] == '0') {
      ans.push_back(0);
    } else if (S[i] == '1') {
      ans.push_back(1);
    } else {
      if (ans.size() > 0)
	ans.pop_back();
    }
  }

  EACH(i, ans) {
    cout << i;
  }
  cout << endl;
  
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n;i>=0;i--)
#define For(i,m,n) for(int i=m;i<n;i++)
#define Forr(i,m,n) for(int i=m;i>n;i--)
#define Sort(a) sort(a.begin(),a.end())
#define pb push_back
#define vl vector<ll>
#define vll vector<vector<ll>>
#define INF 999999999999

int main(){
  int N,d[50],sum=0;
  cin>>N;
  rep(i,N){
    cin>>d[i];
  }

  rep(i,N-1){
    For(j,i+1,N){
      sum+=d[i]*d[j];
    }
  }
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define inf (int)(3e18)
#define mod (int)(1e9+7)
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int n;
P p[114514];
signed main(){
	cin>>n;
	rep(i,n){
		cin>>p[i].first;
		p[i].second=i;
	}
	sort(p,p+n);
	int sum=0;
	rep(i,n){
		if(abs(i-p[i].second)%2)sum++;
	}
	cout<<sum/2<<endl;
}


Measured memory_bytes: 1792
def main():
    """"ここに今までのコード"""
    import sys
    input = sys.stdin.readline
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    A.sort()
    if n==1:
        ans=(m//(A[0]//2)+1)//2
        print(int(ans))
        exit()
    from fractions import gcd
    kou=A[0]*A[1]//gcd(A[0],A[1])
    for a in A:
        kou=a*kou//gcd(a,kou)
        if (kou//a)%2==0:
            print(0)
            exit()
    kou//=2
    #print(kou)
    ans=(m//kou+1)//2
    print(int(ans))
if __name__ == '__main__':
    main()


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

int main(){
    int x,y,t;
    while(1){
    cin >> x >> y;
    if(x == 0 && y == 0) break;
    if(x > y){
        t = x;
        x = y;
        y = t;
        
        cout << x << " " << y << endl;
    } else {
        cout << x << " " << y << endl;
    }
    }
    return 0;
}


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

#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int n;
int m;
int q;
int res;
int a[N];
int b[N];
int c[N];
int d[N];
int idx[N];
map<vector<int>, int> used;
int check(vector<int> p){
    int ans = 0;
    for(int i = 1; i <= q; i ++){
        if(p[b[i] - 1] - p[a[i] - 1] == c[i]){
            ans += d[i];
        }
    }
    return ans;
}
void rec(vector<int> a){
    if(used.count(a)){
        return;
    }
    used[a] = 1;
    res = max(res, check(a));
    for(int i = n; i > 0; i --){
        if(a[i] > a[i - 1]){
            vector<int> t = a;
            t[i - 1] ++;
            rec(t);
        }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);

    cin >> n >> m >> q;
    for(int i = 1; i <= q; i ++){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
    }
    vector<int> p(n, 1);
    p.push_back(m);
    rec(p);
    cout << res << "\n";
}



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

  if ((character == 'a') || (character == 'e') || (character == 'i') || (character == 'o') || (character == 'u')) {
    cout << "vowel" << endl;
  } else {
  cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Set;
import java.util.HashMap;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DisjointSetofCommonDivisors solver = new DisjointSetofCommonDivisors();
        solver.solve(1, in, out);
        out.close();
    }

    static class DisjointSetofCommonDivisors {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long a = in.nextLong();
            long b = in.nextLong();
            long g = gcd(a, b);
            HashMap<Long, Long> gmap = primeFactorize(g);
            out.println(gmap.keySet().size() + 1);
        }

        static long gcd(long a, long b) {
            return b == 0 ? a : gcd(b, a % b);
        }

        static HashMap<Long, Long> primeFactorize(long x) {
            HashMap<Long, Long> result = new HashMap<>();
            for (long i = 2; i * i <= x; i++) {
                if (x % i != 0) {
                    continue;
                }
                long ex = 0;
                while (x % i == 0) {
                    ex++;
                    x /= i;
                }
                result.put(i, ex);
            }
            if (x != 1) {
                result.put(x, 1L);
            }
            return result;
        }

    }
}



Measured memory_bytes: 35788
// #define USE_CPP11
// #define USE_PRINTF

#include <iostream>
#include <iomanip>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <complex>
#include <memory>
#include <sstream>

#ifdef USE_CPP11
#include <unordered_map>
#include <unordered_set>
#include <functional>
#endif

#define PRINT(obj) cout << obj << endl
#define REP(i, n) for(int (i) = 0; (i) < (n); i++)
#define SPACE ' '

typedef long long ll;

using namespace std;

namespace Scanner {
#ifdef USE_PRINTF
  int    nextInt()    { int    d; scanf("%d" , &d); return d; }
  float  nextFloat()  { float  f; scanf("%f" , &f); return f; }
  double nextDouble() { double f; scanf("%lf", &f); return f; }  
  string nextString() { string s; scanf("%s" , &s); return s; }
  ll     nextll()     { ll     l; scanf("%ll", &l); return l; }
#else
  int    nextInt()    { int    d; cin >> d; return d; }
  float  nextFloat()  { float  f; cin >> f; return f; }
  double nextDouble() { double f; cin >> f; return f; }  
  string nextString() { string s; cin >> s; return s; }
  ll     nextll()     { ll     l; cin >> l; return l; }
#endif

  string getLine() { 
    string input;
    getline(cin, input);
    return input;
  }
};

namespace myLibrary {
  vector<string> split(const string& str, char delim) {
    vector<string> ret;
    size_t current = 0, found;
    while ((found = str.find_first_of(delim, current)) != string::npos) {
      ret.push_back(string(str, current, found - current));
      current = found + 1;
    }
    ret.push_back(string(str, current, str.size() - current));
    return ret;
  }
  
#ifdef USE_CPP11
  ///
  /// higher-order functional
  /// This is like map in haskell, python, etc.
  /// Sample usage:
  ///   vector<int> a = {1, 2, 3, 4, 5};
  ///   vector<int> b = myLibrary::_Map<int, int>(a, [](int n){
  ///     return n * n;
  ///   });
  /// Result:
  ///   b = 1, 4, 9, 16, 25
  ///
  template<typename T_IN, typename T_OUT, class Functor>
  vector<T_OUT> _Map(vector<T_IN> src, Functor func) {
    vector<T_OUT> ret;
    for (int i = 0; i < src.size(); i++) {
      ret.push_back(func(src[i]));
    }
    return ret;
  }
#endif
};

int main() {
  while (true) {
    int a = Scanner::nextInt();
    int d = Scanner::nextInt();
    int n = Scanner::nextInt();
    if (a + d + n == 0) {
      break;
    }
    int count = 0;
    for (int i = a; ; i += d) {
      if (i == 1) continue;
      bool flag = true;
      for (int j = 2; j * j <= i; j++) {
        if (i % j == 0) {
          flag = false;
          break;
        }
      }
      if (flag) {
        count++;
      }
      if (count == n) {
        PRINT(i);
        break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX_N = 201010;

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
char notes[110][10];
ll treasure[3030][3030];
ll dp[3030][3030][4];

//long longしか使わない
//素数は1より大きい
//lower_boundは指定したkey以上の要素の一番左のイテレータをかえす
//upper_boundは指定したkeyより大きい要素の一番左のイテレータをかえす
int main() {
	ll n;
	cin >> n;
	vector<ll>a(n);
	bool flag = false;
	rep(i, n) {
		cin >> a[i];
		if (a[i] % 2) {
			puts("first");
			return 0;
		}
	}
	puts("second");
	return 0;
}


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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = (ll)1e9 + 7;

int main()
{
  int A, B, C, D; scanf("%d %d %d %d", &A, &B, &C, &D);
  vector<int> V(105, 0);
  ++V[A]; --V[B];
  ++V[C]; --V[D];

  int ans = 0;
  for (int i = 1; i <= 100; ++i) {
    V[i] += V[i - 1];
  }
  for (int i = 0; i <= 100; ++i) {
    if (V[i] == 2) { ++ans; }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using UL = unsigned int;
using ULL = unsigned long long;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

int main() {
 UL N; scanf("%u",&N);
 UL A[100000]; rep(i,N) scanf("%u",&A[i]);
 UL Q; scanf("%u",&Q);
 rep(q,Q){
  UL k; scanf("%u",&k);
  UL l=0,r=N+1;
  while(l+1!=r){
   UL m=(l+r)>>1;
   if(A[m-1]<k) l=m;
   else r=m;
  }
  if(A[l]==k)printf("1\n");
  else printf("0\n");
 }
 return 0;
}




Measured memory_bytes: 3508
N = int(input())
W = [tuple(input()) for _ in range(N)]

now = W[0][-1]
said = [W[0]]

for w in W[1:]:
    if not w in said and w[0] == now:
        now = w[-1]
        said.append(w)
        continue
    print("No")
    exit()

print("Yes")

Measured memory_bytes: 3060
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;


#define REP(i, n) for(ll i = 0; i < n; i++)


























int main(){
    ll n, d;
    cin >> n >> d;
    ll ans = 0;
    REP(i, n){
        ll x, y;
        cin >> x >> y;
        if(x * x + y * y <= d * d){
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3532
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M = MAP()
dp = [INF]*(1<<N)
dp[0] = 0

for _ in range(M):
	a, b = MAP()
	c = LIST()
	d = 0
	for x in c:
		d += 1<<(x-1)

	for j in range(1<<N):
		tmp = j|d
		dp[tmp] = min(dp[tmp], dp[j]+a)

if dp[-1] == INF:
	print(-1)
else:
	print(dp[-1])


Measured memory_bytes: 44892
//2018年  3月 22日 木曜日 04:47:53 JST
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 200010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 29;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N, K, L;
vi G[MAX_N];
bool used[MAX_N];

int red[MAX_N], black[MAX_N];

void loop(int v, int k, int group[MAX_N]) {
	used[v] = true;
	group[v] = k;
	rep(i, 0, sz(G[v])) {
		int n = G[v][i];
		if(!used[n]) loop(n, k, group);
	}
}

map<pi, int> cnt;
	
void solve() {
	cin >> N >> K >> L;
	rep(i, 0, K) {
		int a, b;
		cin >> a >> b; a--; b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	int k = 0;
	rep(i, 0, N) {
		if(used[i]) continue;
		loop(i, k++, red);
	}
	rep(i, 0, N) {
		G[i].clear();
	}
	rep(i, 0, L) {
		int a, b;
		cin >> a >> b; a--; b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	k = 0;
	memset(used, 0, sizeof(used));
	rep(i, 0, N) {
		if(used[i]) continue;
		loop(i, k++, black);
	}
	rep(i, 0, N) {
		cnt[pi(red[i], black[i])]++;
	}
	rep(i, 0, N) {
		cout << cnt[pi(red[i], black[i])] << " ";
	}
	cout << "\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



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

using namespace std;
typedef long long ll;

int main() {
	int k;
	int n;
	cin >> n >> k;
	
	vector<int> vals(n);
	for(int i=0; i < n; i++) cin >> vals[i];
	
	vector<int> dp(n, numeric_limits<int>::max());
	dp[0] = 0;
	
	for(int i=0; i < n-1; i++) {
		for(int j=1; j <= k; j++) {
			if(i+j < n) {
				dp[i+j] = min(dp[i+j], dp[i] + abs(vals[i] - vals[i+j]));
			}
		}
	}
	
	cout << dp[n-1];

	return 0;
}

Measured memory_bytes: 1024
n = gets.to_i
arr = gets.split.map(&:to_i)


flag = true
cnt = 0
while flag do
	flag = false
		(n-1).downto(1) do |i|
			if arr[i-1] > arr[i]  
					buf = arr[i]
					arr[i] = arr[i-1]
					arr[i-1] = buf
					cnt += 1
					flag = true
			end
		end
end

puts arr.join(" ")
puts cnt 

Measured memory_bytes: 8656
n, a, b = map(int, input().split())

ans = 0
if n >= 2 and a <= b:
    lst_min = a * (n - 1) + b
    lst_max = a + b * (n - 1)
    
    ans = lst_max - lst_min + 1

elif n == 1 and a == b:
    ans = 1

print(ans)

Measured memory_bytes: 3060
using System;
using System.Linq;
using static System.Console;

namespace AtCoder1
{
	class Program
	{
		static int[] dp;
		static void Main(string[] args)
		{
			int N = int.Parse(ReadLine());
			int[] H = ReadLine().Split().Select(s => int.Parse(s)).ToArray();

			dp = Enumerable.Repeat(-1, N).ToArray();

			dp[0] = 0;
			dp[1] = Math.Abs(H[0] - H[1]);

			for(int i=2; i<N; ++i)
			{
				int a = dp[i - 1] + Math.Abs(H[i] - H[i - 1]);
				int b = dp[i - 2] + Math.Abs(H[i] - H[i - 2]);
				dp[i] = Math.Min(a, b);
			}

			WriteLine(dp[N-1]);
		}
    }
}

Measured memory_bytes: 21088
import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B

main = do
    n<-readLn::IO Int
    as<-replicateM n $ fst.fromJust.B.readInt <$> B.getLine ::IO[Int]
    print $ sol n $ sort as
--
sol n as
    | even n = sum e4*2+e3-e2-sum e1*2
    | odd n = max (sum oa4*2+oa3+oa2-sum oa1*2) (sum ob4*2-ob3-ob2-sum ob1*2)
    where
        (e1,e2:e3:e4) = splitAt ((n-2)`div`2) as
        (oa1,oa2:oa3:oa4) = splitAt ((n-1)`div`2) as
        (ob1,ob2:ob3:ob4) = splitAt ((n-2)`div`2) as

Measured memory_bytes: 30972
import sys

# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    n = ni()

    a = []

    ans = 0
    flg = True
    for _ in range(n):
        tmp = ni()
        if tmp % 2:
            flg = False
    
    print("second" if flg else "first")


if __name__ == '__main__':
    main()


Measured memory_bytes: 5200
#include <iostream>
#include <sstream>
#include <string>
int main(){
	std::string s,x;
	std::stringstream ss;
	int a=0,b;
	while(std::cin>>s){
		int i=0,n=s.size();
		x="";
		for (;i<n;i++)ss<<((isdigit(s[i]))?s[i]:' ');
		while(ss>>b)a+=b;
		ss.clear();
	}
	std::cout<<a<<"\n";
}

Measured memory_bytes: 1228
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <list>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <iomanip>
#define INF 1050000000
 
using namespace std;

#define MAX_V 101

int d[MAX_V][MAX_V];  // d[u][v]は辺e=(u,v)のコスト(存在しない場合はINF、ただしd[i][i]=0とする)
int V;                // 頂点数
void warshall_floyd(int n) {
	V = n;

	for (int i = 0; i < V; i++)
		for (int j = 0; j < V; j++) 
			for (int k = 0; k < V; k++)
				d[0][j] = min(d[0][j], d[0][k] + d[k][j]);
}

int main(void)
{
	int n, u, v, k, c;

	cin >> n;

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (i == j) d[i][j] = 0; 
			else d[i][j] = INF;
		}
	}

	for (int i = 0; i < n; i++) {
		cin >> u >> k;
		for (int j = 0; j < k; j++) {
			cin >> v >> c;
			d[u][v] = c;
		}
	}
	
	warshall_floyd(n);

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


	return (0);
}

Measured memory_bytes: 1200
#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define F first
#define S second
#define pss pair<string,string>
#define pcc pair<char,char>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define piii pair<int,pii>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define vs vector<string>
#define vl vector<ll>
#define vs vector<string>
#define vll vector<pll>
#define vss vector<pss>
#define vcc vector<pcc>
#define MP make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=n-1;i>=0;i--)
using namespace std;
const int N = 1e5+5;
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
int main()
{
	int x,y,z;
	cin>>x>>y>>z;
	cout<<(x/y+(x%y!=0))*z<<"\n";
	return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
#define f first
#define s second
int main()
{
	ll n;
	cin>>n;
	vector<int> s;
	while(n)
	{
		s.push_back(n%10);
		n=n/10;
	}
    reverse(s.begin(),s.end());
    ll sum=0;
    ll pow[11]={0};
    pow[0]=1;
    pow[1]=1;
    for(int i=2;i<11;i++)
    pow[i]=pow[i-1]*2;
    for(int i=0;i<s.size();i++)
    {
    	ll p=0;
    	for(int j=i;j<s.size();j++)
    	{
    		p=p*(ll)10+s[j];
    	//	cout<<p<<"\n";
    		sum+=p*pow[i]*pow[s.size()-j-1];
		}
	}
	cout<<sum<<endl;
	return 0;
}

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

int main(){
    int N;
    double M,X,Z,C;
    cin >> N >> M;
    double D = 0.0;
    int A[N];
    Z = 0.0;
    C = 0.0;
    for (int i = 0;i < N;i++) {
        cin >> X;
        A[i] = X;
        Z += X;
    }
    D = Z / (4.0*M);
    for (int i = 0;i < N;i++) {
        if (A[i] >= D) {
            C++;
        }
        if (C == M) {
            break;
        }
    }

    if (M <= C) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


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

int a,b;

int main()
{
	cin >> a >> b;
	for(int i=1;i<10000;i++)
	{
		if(i*8/100 == a && i/10 == b)
		{
			cout << i;
			return 0;	
		}	
	}	
	puts("-1");
	return 0;
}

Measured memory_bytes: 256
//IncubatorMan
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
char gap = 32;
template<typename T> 
ostream& operator<<(ostream &os, const vector<T> &v) { 
    os << '{'; 
    for (const auto &x : v) os << gap << x;
        return os << '}'; 
}
template<typename A, typename B> 
ostream& operator<<(ostream &os, const pair<A, B> &p) {
        return os << '(' << p.first << gap << p.second << ')';
}

template <class T>
void read(T &x) {
    char c;
    for (c = getchar(); c < '0' || c > '9'; c = getchar())
        ;
    for (x = 0; c <= '9' && c >= '0'; c = getchar()) x = x * 10 + (c & 15);
}
#define ll long long 
#define lll __int128_t
#define pb push_back
#define mp make_pair
typedef pair < int,int> ii;
typedef vector<ii> vii;
typedef vector<ll>vl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
double PI = 2*acos(0.0);
void solve(){
    double ans;
    cin>>ans;
    ans = ans*2*PI;
    cout<<ans<<endl;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
        int test=1;
        //read(test);
        while(test--){
            solve();
        }
    return 0;
}

Measured memory_bytes: 3804
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
using namespace std;
#define INF 110000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,int> P;

int dp[11000];

int main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(a+b+c==max(a,max(b,c))*2) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 504
#include <stdio.h>
#define N 100

int main(){

  int a[N],i,j,count=0,min,nagasa,tmp,tmp2,k;

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

  for(j=0;j<nagasa-1;j++){
    /*    printf("j=%d\n",j);*/
  min=a[j];
  /*  printf("min=%d\n",min);*/
  for(i=j;i<nagasa;i++){

    if(min>a[i]){
      /*      printf("mae min=%d\n",min);*/
      min=a[i];
      tmp2=i;
      /*      printf("atomin=%d %d\n",min,tmp2);*/
    }

  }

    if(min!=a[j]){

      tmp=a[j];
      a[j]=min;
      a[tmp2]=tmp;
      count++;
      /*      printf("henka %d %d %d\n",a[j],a[tmp2],count);
      for(k=0;k<nagasa;k++) printf("%d ",a[k]);
	printf("\n");
      */
}

  }

  for(i=0;i<nagasa-1;i++) printf("%d ",a[i]);
  printf("%d",a[i]);
  printf("\n%d\n",count);

  return 0;
  
}

Measured memory_bytes: 600
#include <iostream>
#include <utility>
#include <string>
#include <vector>

int main(int, char**) {
  int n, K;
  std::string s;
  std::cin >> n >> K >> s;

  std::vector<int> is;
  char pre{};
  for(int i{}; i < n; ++i) {
    if(pre != s[i]) is.push_back(i);

    pre = s[i];
  }

  int ans{-1};
  size_t r{is.size()};
  for(int k{}; k < r; ++k) {
    int x;
    if(s[is[k]] == '0') {
      x = ((k + 2 * K >= r) ? n : is[k + 2 * K]) - is[k];
    } else {
      x = ((k + 2 * K + 1 >= r) ? n : is[k + 2 * K + 1]) - is[k];
    }

    ans = std::max(x, ans);
  }

  std::cout << ans << std::endl;

  return 0;
}


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

int main() {
    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    int total = 0;
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
        total += a.at(i);
    }

    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    
    if (a.at(m-1) * 4 * m >= total) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3560
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)

int main(){

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

    ll n; cin >> n;
    ll a[n + 1] = {};

    reps(i, 2, n + 1){
        cin >> a[i];   
    }

    ll b[n + 1] = {};

    reps(i, 2, n + 1){
        b[a[i]]++;
    }

    reps(i, 1, n + 1){
        cout << b[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 6720
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
void Main()
{
    string S;
    cin >> S;

    reverse(all(S));

    ll pow10 = 1;
    vector<int> C(2020);
    C[0]++;
    ll v = 0;
    rep (i, S.size()) {
        v += pow10 * (S[i] - '0') % 2019;
        v = v % 2019;
        C[v]++;
        pow10 = ((pow10 * 10) % 2019);
    }

    ll res = 0;
    rep(i, C.size()) {
        res += C[i] * (C[i] - 1) / 2;
    }

    put(res);
}
signed main(){ Main();return 0;}

Measured memory_bytes: 3728
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007; // 998244353
using ll = long long;
using namespace std;

ll dp[200010][2][3];

int main(){
	int n; cin >> n;
	vector<int> a(n);
	for( auto &k : a ) cin >> k;
	/*
	for( int x = 0; x <= n; ++x ){
		for( int y = 0; y < 2; ++y ){
			for( int z = 0; z < 3; ++z ){
				dp[x][y][z] = -(1ll<60);
			}
		}
	}
	*/
	dp[0][1][0] = a[0];
	dp[0][0][0] = 0;
	for( int i = 1; i < n; ++i ){
		dp[i][1][0] = dp[i-1][0][0] + a[i];
		dp[i][1][1] = dp[i-1][0][1] + a[i];
		dp[i][1][2] = dp[i-1][0][2] + a[i];
		dp[i][0][0] = dp[i-1][1][0];
		dp[i][0][1] = max(dp[i-1][0][0], dp[i-1][1][1]);
		dp[i][0][2] = max(dp[i-1][0][1], dp[i-1][1][2]);
	}
	if( n%2 == 0 ) cout << max(dp[n-1][1][1], dp[n-1][0][0]) << endl;
	else cout << max(dp[n-1][0][1], dp[n-1][1][2]) << endl;
}

Measured memory_bytes: 13496
#include <bits/stdc++.h>
using namespace std;
#define lowbit(x) (x & (-x))
#define mp(a, b) make_pair(a, b)
const int maxn = 2000 + 10;
typedef pair<int, int> pii;
int n, k, q, ans = 2e9;
vector<pii> b;
int a[maxn], C[maxn];
void add(int x)
{
	for(int i = x; i < maxn; i += lowbit(i))
		++C[i];
}
int sum(int x)
{
	int ret = 0;
	for(int i = x; i; i -= lowbit(i))
		ret += C[i];
	return ret;
}
bool solve(int now)
{
	memset(C, 0, sizeof(C));
	pii x = b[now];
	int val = x.first, pos = x.second;
	set<int> S;
	S.insert(0); S.insert(n + 1);
	for(int i = 1; i <= n; ++i)
		if(a[i] < val)
			S.insert(i);
	int cnt = 0;
	while(cnt < q && now < n)
	{
		auto it = S.upper_bound(pos);
		int r = *it;
		int l = *(--it);
		//	if(now == 0) cout << pos << ' ' << l << ' ' << r << endl;
		if(r - 1 - l - (sum(r - 1) - sum(l)) >= k)
		{
			++cnt;
			add(pos);
		}
		++now;
		val = b[now].first, pos = b[now].second;
	}
	if(cnt == q)
	{
		ans = min(ans, b[now - 1].first - x.first);
		return 1;
	}
	else
		return 0;
}
int main()
{
	scanf("%d%d%d", &n, &k, &q);
	for(int i = 1; i <= n; ++i)
	{
		scanf("%d", &a[i]);
		b.push_back(mp(a[i], i));
	}
	sort(b.begin(), b.end());
	for(int i = 0; i < n; ++i)
		if(!solve(i))
			break;
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 384
import java.io.*;
import java.io.IOException;

class Main{
	public static void main(String args[]){
		String[] inp = new String[100];
		String ans = "";
		int sum=0;
		int r,c;
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try{
		inp = br.readLine().split("[\\s]+");
		r = Integer.parseInt(inp[0]);
		c = Integer.parseInt(inp[1]);
		
		
		int table[][] = new int[r+1][c+1];
		
		for(int i=0;i<r;i++){
			inp = br.readLine().split("[\\s]+");
			
			for(int j=0;j<c;j++){
				table[i][j] = Integer.parseInt(inp[j]);
				sum += table[i][j];
			}
			table[i][c]=sum;
			sum=0;
		}
		
		
		
		for(int j=0;j<c+1;j++){
			sum=0;
			for(int i=0;i<r+1;i++){
				sum += table[i][j];
				
			}
			table[r][j] = sum;
			
		}
		
		for(int i=0;i<r+1;i++){
			for(int j=0;j<c+1;j++){
				ans +=table[i][j] + " ";
			}
			System.out.println(ans.substring(0, ans.length()-1));
			ans="";
		}
		}catch(IOException e){
			System.out.println(e);
			return;
		}
	}
}



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

using namespace std;

int main(){
        int a[3];
        cin>>a[0]>>a[1]>>a[2];
        sort(a, a+3);
        if(a[0]==a[1]){
                cout<<a[2]<<endl;
        }
        else{
                cout<<a[0]<<endl;
        }
        return 0;
}


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

void solve(int a,int b){
    int c=a*a+b*b;
    bool s=false;
    while(1){
        for(int i=1;i<=150;i++){
            for(int j=i+1;j<=150;j++){
                if((s||i>a)&&i*i+j*j==c){
                    cout << i << " " << j << endl;
                    return;
                }
            }
        }
        c++;
        s=true;
    }
}


int main(void){
    int a,b;
    while(cin >> a >> b){
        if(a==0) break;
        solve(a,b);
    }
}


Measured memory_bytes: 3068