akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
 
 
using namespace std;
 
double EPS = 1e-10;
 
 
double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}
 
struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}
 
  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }
 
  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  bool operator == ( const point &p ) const {
    return abs(x-p.x) < EPS && abs(y-p.y) < EPS;
  }
};
 
bool cmp_x(const point& p, const point& q){
  if(p.x != q.x)return p.x<q.x;
  return p.y < q.y;
}

vector<point> normal_vector(point a){
  vector<point>res; 
  point b(-a.y, a.x);
  res.push_back(b);

  point c(a.y, -a.x);
  res.push_back(c);
  return res;
}

double areaPol(vector<point> t){
  t.push_back(t[0]);
  int tsz=t.size();
  double area=0;
  for(int i=0;i<tsz-1;i++){
    area+=(t[i].x-t[i+1].x)*(t[i].y+t[i+1].y);
  }
  return abs(area)/2.0;
}

vector<point>N;

bool Binary_search(point x){
  int l=0,r=N.size(),mid=(l+r)/2;
 
  while(r-l>1){
    if(N[mid]==x)return true;
 
    if(x.x < N[mid].x ||(N[mid].x==x.x && x.y < N[mid].y))r=mid;
    else l=mid;
 
    mid=(l+r)/2;
  }
 
  if(N[mid]==x)return true;
  return false;
}

double solve(void){

  double res=0;

  for(int i=0;i<N.size();i++){
    for(int j=i+1;j<N.size();j++){

      vector<point> nv=normal_vector(N[j]-N[i]);
      point a=N[i]+nv[0],b=N[j]+nv[0];

      if(Binary_search(a) && Binary_search(b)){
	vector<point>c;
	c.push_back(N[i]);
	c.push_back(N[j]);
	c.push_back(b);
	c.push_back(a);
	res=max(res,areaPol(c));
      
      }
    }
  }
 return res;
}
 
int main(void){
  int n;
  point in;
 
  while(cin >> n){
    if(n==0)break;

    N.clear();   

    for(int i=0; i<n; i++){
      cin >> in.x >> in.y;
      N.push_back(in);
    }

    sort(N.begin(),N.end(),cmp_x);
    cout << (int)solve() << endl;
  }
 
  return 0;
}

Measured memory_bytes: 1348
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

struct Node {
    int key;
    Node* prev;
    Node* next;
};

Node* nil;

void Init() {
    nil = (Node*)malloc(sizeof(Node));
    nil->next = nil;
    nil->prev = nil; 
}

void Insert(int key) {
    Node* x = (Node*)malloc(sizeof(Node));
    x->key = key;
    x->next = nil->next; //xのnextに挿入前の先頭のアドレスを書き込む
    nil->next->prev = x; //挿入前の先頭のprevをxに書き換える
    nil->next = x; //nilのnextをxに書き換える
    x->prev = nil; //xのprevにnilを書き込む
}

Node* ListSearch(int key) {
    Node *cur = nil->next;
    while (cur != nil && cur->key !=key) {
        cur = cur->next;
    }
    return cur;
}

void DeleteNode(Node* t) {
    if (t == nil) {
        return;
    }
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}

void DeleteKey(int key) {
    DeleteNode(ListSearch(key));
}

void DeleteFirst(){
    DeleteNode(nil->next);
}

void DeleteLast(){
    DeleteNode(nil->prev);
}

int main() {
    Init();

    int n;

    cin >> n;

    char c[20];
    int key;

    for (int i=0; i<n; i++) {
        scanf("%s%d", c, &key);
        if (c[0] == 'i') {
            Insert(key);
        }
        else if (c[0] == 'd') {
            if (strlen(c) > 6) {
                if (c[6] == 'F') {
                    DeleteFirst();
                }
                else if (c[6] == 'L') {
                    DeleteLast();
                }
            }
            else {
                DeleteKey(key);
            }
        }
    }

    Node* cur = nil->next; 
    int i = 0;
    while (true) {
        if (cur == nil) { 
            break; 
        }
        if (i > 0) { 
            cout << " "; 
        }
        cout << cur->key;
        cur = cur->next;
        i++;
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 34304
#include <iostream>

#define limit(A,X,C) ((X<A)?A:(C<X)?C:X)

char map[8+1][8]={'0'};

int pget(int x,int y)
{
	if(limit(0,x,7)==x && limit(0,y,7)==y)
		return map[y][x]-'0';
	return 0;
}

char check(int x, int y)
{
//	std::cout << ":" << x << y << std::endl;
	if(pget(x+1,y))
	{
		if(pget(x+2,y))
			return 'C';
		if(!pget(x,y+1))
			return 'E';
		if(pget(x+1,y+1))
			return 'A';
		return 'G';
	}
	if(pget(x,y+2))
		return 'B';
	if(pget(x+1,y+2))
		return 'F';
	return 'D';
}

int main(void)
{
	do
	{
		for(int i=0; i<8; i++)
			if(!(std::cin >> map[i]))
				return 0;
		int x,y;
		bool end=false;
		for(y=0; y<8; y++)
		{
			for(x=0; x<8; x++)
				if(map[y][x] == '1')
				{
					end=true;
					break;
				}
			if(end)
				break;
		}

		std::cout << check(x,y) << std::endl;
	}while(std::cin.getline(map[0],sizeof(map[0])));
	
	return 0;
}

Measured memory_bytes: 1132
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }

int main(){
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> roads;
    for(int i = 0; i < N - 1; i++){
        roads.push_back({i, N - 1});
    }
    int cnt = (N - 1) * (N - 2) / 2;
    if(cnt < K){
        cout << -1 << endl;
        return 0;
    }
    for(int i = 0; i < N - 1; i++){
        for(int j = i + 1; j < N - 1; j++){
            if(cnt == K){
                goto output;
            }
            cnt--;
            roads.push_back({i, j});
        }
    }
output:
    cout << roads.size() << endl;
    for(auto i: roads){
        cout << i.first + 1 << " " << i.second + 1 << endl;
    }
}


Measured memory_bytes: 384
main(){
	int n,m,i,j;
	scanf("%d%d",&n,&m);
	m/=1000;
	for(i=0;i<=n;i++)for(j=0;i+j<=n;j++)if((m-i-j*5)==(n-i-j)*10){printf("%d %d %d",n-i-j,j,i);return 0;}
	printf("-1 -1 -1");
}


Measured memory_bytes: 1728
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll h,w,count=0;
    cin >> h >> w;
    string a[h];
    for (ll i=0;i<h;i++)cin >> a[i];
    for (ll i=0;i<h;i++){
        for (ll j=0;j<w;j++){
            if (a[i][j]=='#')count++;
        }
    }
    if (count==h+w-1){
        cout << "Possible" << endl;
    }else{
        cout << "Impossible" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <inttypes.h>

int main(void){
	int x,y;

	scanf("%d %d",&x,&y);
	if(y%2==1){
		printf("No");
		return 0;
	}else{
		if(x*2>y){
			printf("No");
			return 0;
		}else if(x*4<y){
			printf("No");
			return 0;
		}
		printf("Yes");
	}
	return 0;
}


Measured memory_bytes: 1736
#include "bits/stdc++.h"

#define REP(i,x,y) for(int i=(x);i<(y);i++)
#define RREP(i,x,y) for(int i=(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
// #define int long long

using namespace std;

// conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define eprintf(...) 42
#define dump(x) 42
#define debug(x) 42
#endif

typedef long long ll;

const ll MOD = 1e9 + 7;

void solve(int N, int W,vector<int>& w, vector<int>& v) {
    vector<vector<ll>> dp(N+1, vector<ll>(W+1, 0));

    REP(i,1,N+1) {
        REP(j,1,W+1) {
            dp[i][j] = j >= w[i-1] ? max(dp[i-1][j-w[i-1]] + v[i-1], dp[i-1][j]) : dp[i-1][j];
//            cout << i << " " << j << " " << dp[i][j] << '\n';
        }
    }

	stringstream ss;
    ss << dp[N][W];
	cout << ss.str() << '\n';

    return;
}

signed main() {
    int N, W;
    cin >> N >> W;
    
    vector<int> w(N);
    vector<int> v(N);
    REP(i,0,N) {
        cin >> w[i];
        cin >> v[i];
    }

    solve(N, W, w, v);
    
    return 0;
}



Measured memory_bytes: 80256
#include <cstdio>
#include <cstring>
#include <queue>
#include <iostream>
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main()
{

    int m,n;
    cin>>m>>n;
    int con=0;
    int t=m;
    while(m--)
    {//printf("%d\n",n);
        ll t1,t2;
        cin>>t1>>t2;
        double f=sqrt(t1*t1*1.0+t2*t2*1.0);
        //printf("%lf\n",f);
        if(f>n){con++;}
    }
    printf("%d\n",t-con);
    return 0;
}


Measured memory_bytes: 3740
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
using namespace std;
long long MOD = 1e9 + 7;
typedef pair<long long,long long> pii;

int K;
template< typename T >
struct edge {
	int src, to;
	T cost;

	edge(int to, T cost) : src(-1), to(to), cost(cost) {}

	edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}

	edge& operator=(const int& x) {
		to = x;
		return *this;
	}

	operator int() const { return to; }
};

template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< Edges< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;
template< typename T >
vector< T > dijkstra(WeightedGraph< T >& g, int s) {
	const auto INF = numeric_limits< T >::max();
	vector< T > dist(g.size(), INF);

	using Pi = pair< T, int >;
	priority_queue< Pi, vector< Pi >, greater< Pi > > que;
	dist[s] = 0;
	que.emplace(dist[s], s);
	while (!que.empty()) {
		T cost;
		int idx;
		tie(cost, idx) = que.top();
		que.pop();
		if (dist[idx] < cost) continue;
		for (auto& e : g[idx]) {
			auto next_cost = cost + e.cost;
			if (dist[e.to] <= next_cost) continue;
			dist[e.to] = next_cost;
			que.emplace(dist[e.to], e.to);
		}
	}
	return dist;
}

int main() {
	cin >> K;
	WeightedGraph<long long> G(K+1);
	for (int k = 1; k <= K; k++) {
		G[k].push_back({ k,k%K+1,1 });
		G[k].push_back({ k,(10*k - 1) % K + 1,0 });
	}
	auto ans = dijkstra(G, 1);
	cout << ans[K]+1 << endl;
}

Measured memory_bytes: 9208
import std.stdio;
import std.string;
import std.format;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.concurrency;
import std.traits;
import std.uni;
import std.regex;
import core.bitop : popcnt;
alias Generator = std.concurrency.Generator;

enum long INF = long.max/5;

void main() {
  long A, B, C, D;
  scanln(A, B, C, D);

  foreach(i; 0..long.max) {
    if (i%2 == 0) {
      C -= B;
      if (C<=0) {
        "Yes".writeln;
        return;
      }
    } else {
      A -= D;
      if (A <= 0) {
        "No".writeln;
        return;
      }
    }
  }
}

// ----------------------------------------------


void times(alias fun)(long n) {
  // n.iota.each!(i => fun());
  foreach(i; 0..n) fun();
}
auto rep(alias fun, T = typeof(fun()))(long n) {
  // return n.iota.map!(i => fun()).array;
  T[] res = new T[n];
  foreach(ref e; res) e = fun();
  return res;
}

T ceil(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  // `(x+y-1)/y` will only work for positive numbers ...
  T t = x / y;
  if (y > 0 && t * y < x) t++;
  if (y < 0 && t * y > x) t++;
  return t;
}

T floor(T)(T x, T y) if (isIntegral!T || is(T == BigInt)) {
  T t = x / y;
  if (y > 0 && t * y > x) t--;
  if (y < 0 && t * y < x) t--;
  return t;
}

ref T ch(alias fun, T, S...)(ref T lhs, S rhs) {
  return lhs = fun(lhs, rhs);
}
unittest {
  long x = 1000;
  x.ch!min(2000);
  assert(x == 1000);
  x.ch!min(3, 2, 1);
  assert(x == 1);
  x.ch!max(100).ch!min(1000); // clamp
  assert(x == 100);
  x.ch!max(0).ch!min(10); // clamp
  assert(x == 10);
}

mixin template Constructor() {
  import std.traits : FieldNameTuple;
  this(Args...)(Args args) {
    // static foreach(i, v; args) {
    foreach(i, v; args) {
      mixin("this." ~ FieldNameTuple!(typeof(this))[i]) = v;
    }
  }
}

void scanln(Args...)(auto ref Args args) {
  enum sep = " ";
  enum n = Args.length;
  enum fmt = n.rep!(()=>"%s").join(sep);

  string line = readln.chomp;
  static if (__VERSION__ >= 2074) {
    line.formattedRead!fmt(args);
  } else {
    enum argsTemp = n.iota.map!(
      i => "&args[%d]".format(i)
    ).join(", ");
    mixin(
      "line.formattedRead(fmt, " ~ argsTemp ~ ");"
    );
  }
}

// fold was added in D 2.071.0
static if (__VERSION__ < 2071) {
  template fold(fun...) if (fun.length >= 1) {
    auto fold(R, S...)(R r, S seed) {
      static if (S.length < 2) {
        return reduce!fun(seed, r);
      } else {
        return reduce!fun(tuple(seed), r);
      }
    }
  }
}

// popcnt with ulongs was added in D 2.071.0
static if (__VERSION__ < 2071) {
  ulong popcnt(ulong x) {
    x = (x & 0x5555555555555555L) + (x>> 1 & 0x5555555555555555L);
    x = (x & 0x3333333333333333L) + (x>> 2 & 0x3333333333333333L);
    x = (x & 0x0f0f0f0f0f0f0f0fL) + (x>> 4 & 0x0f0f0f0f0f0f0f0fL);
    x = (x & 0x00ff00ff00ff00ffL) + (x>> 8 & 0x00ff00ff00ff00ffL);
    x = (x & 0x0000ffff0000ffffL) + (x>>16 & 0x0000ffff0000ffffL);
    x = (x & 0x00000000ffffffffL) + (x>>32 & 0x00000000ffffffffL);
    return x;
  }
}


Measured memory_bytes: 2904
function main(input) {
  const arg = input.split('\n')
  const t = arg[0].split(' ')
  var h = t[0], n = t[1]
  var a = arg[1].split(' ').map(x => parseInt(x, 10))
  var s = 0
  for(var i=0;i<n;i++) s += a[i]
  console.log(h<=s?'Yes':'No')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 20556
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;


#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}

void solve(){


}
vi ans;
vector<pii> v;
int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();
	int n;cin>>n;
	rep(i,n){
		int x;cin>>x;
		v.pb(mp(i,x));
	}
	while(sz(v)){
		bool fg=0;
		repD(i,sz(v)-1,0){
			if(v[i].snd==i+1) {
				ans.pb(v[i].snd);
				v.erase(v.begin()+i);
				fg=1;
				break;
			}
		}
		if(!fg) {
			cout<<-1;
			exit(0);
		}
		
	}
	while(sz(ans)){
		cout<<ans.back()<<'\n';
		ans.pop_back();
	}
	
	
	
	
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int t = 0;
    vector<int> k;
    reps(i, 1, n + 1) {
        k.push_back(i);
        t += i;
        if (t > n) break;
    }
    int r = t - n;
    rrep(i, sz(k)) {
        if (k[i] <= r) {
            r -= k[i];
            k[i] = 0;
            if (r == 0) break;
        }
    }
    rep(i, sz(k)) {
        if (k[i] > 0) printf("%d\n", k[i]);
    }
    return 0;
}

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

int main(){
  int N;
  cin>>N;
  int x,y;
  int z[200100];
  int w[200100];
  for(int i=0;i<N;i++){
    cin>>x>>y;
    z[i]=x+y;
    w[i]=x-y;
  }
  int maxz=z[0];
  int minz=z[0];
  int maxw=w[0];
  int minw=w[0];

  for(int i=1;i<N;i++){ 
    maxz=max(maxz,z[i]);
    minz=min(minz,z[i]);
    maxw=max(maxw,w[i]);
    minw=min(minw,w[i]);    
  }
  int ans=0;
  ans=max(maxz-minz,maxw-minw);
  cout<<ans<<endl;
  return 0;
}

  

Measured memory_bytes: 5168
#include<bits/stdc++.h>
#define watch(x) cout<<(#x)<<" is "<<(x)<<endl
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define pb push_back
#define pq priority_queue
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define elif else if

using namespace std;
using ll=long long;
using ull=unsigned long long;
using ld=long double;
using pll=pair<ll,ll>;
using pss=pair<string,string>;
using pdd=pair<ld,ld>;
using graph=vector<vector<int>>;
using wgraph=vector<vector<pll>>;

const ll MOD=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ex[8]={1,1,0,-1,-1,-1,0,1};
const int ey[8]={0,1,1,1,0,-1,-1,-1};
const ld E=1e-9;

template<class T> void chmin(T &a, T b){a=min(a, b);}
template<class T> void chmax(T &a, T b){a=max(a, b);}

ll abs1(ll a){if(a>=0)return a;else return -a;}
ll pow1(ll a,ll b,ll p=LLONG_MAX){
  ll ret=1;
  while(b!=0){
    if((b&1)==1)ret*=a;a*=a;
    if(a>=p)a%=p;if(ret>=p)ret%=p;
    b=b>>1;
  }
  return ret;
}
int digit(ll a,ll b=10){int i=0;while(a!=0){a/=b;i++;}return i;}
ll gcd1(ll a,ll b){
  if(a==0 || b==0)return 0;
  ll n;while(a%b!=0){n=a%b;a=b;b=n;}return b;
}
ll solveLinear(ll n,ll m,ll c){
  if(n==0 && m==0)return 0;
  ll a[100],b[100];a[0]=n;b[0]=m;int i=1;
  while(b[i-1]!=0){a[i]=b[i-1];b[i]=a[i-1]%b[i-1];i++;}
  n=i;if(c%a[n-1]!=0)return 0;
  ll x=c/a[n-1],y=0;
  for(i=1;i<n;i++){ll cnt=x;x=y;y=cnt-(a[n-i-1]/b[n-i-1])*y;}
  return x;
}
ll modRev(ll a,ll p=MOD){
  a%=p;ll n=solveLinear(a,p,1);
  n%=p;if(n<0)return n+p;
  return n;
}
ll fact(ll n,ll p=MOD){
  if(n<0)return 0;
  ll ret=1;for(int i=1;i<=n;i++){ret=ret*i;if(ret>=p)ret%=p;}
  return ret;
}
ll perm(ll n,ll k,ll p=MOD){
  if(n<0 || k<0 || n<k)return 0;
  ll ret=1;rep(i,k){ret=ret*(n-i);if(ret>=p)ret%=p;}
  return ret;
}
ll binom(ll n,ll k,ll p=MOD){
  return (perm(n,k,p)*modRev(fact(k)))%p;
}
int bis(vector<int> v,int key){
  int left=-1,right=v.size();
  while(abs1(right-left)>1){
    int mid=left+(right-left)/2;
    if(v[mid]<=key)left=mid;
    else right=mid;
  }
  return left;
}

int main(){
  ll i,j,cnt=0;
  int n;
  cin>>n;
  string s[n];
  int t[n];
  for(i=0;i<n;i++)cin>>s[i]>>t[i];
  string x;
  cin>>x;
  for(i=0;i<n;i++){
    if(s[i]==x)break;
  }
  cnt=i;
  ll ans=0;
  for(i=cnt+1;i<n;i++){
    ans+=t[i];
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
a, b = input().split()

if a == "A":
    aa = 11
elif a == "B":
    aa = 12
elif a == "C":
    aa = 13
elif a == "D":
    aa = 14
elif a == "E":
    aa = 15
elif a == "F":
    aa = 16

if b == "A":
    bb = 11
elif b == "B":
    bb = 12
elif b == "C":
    bb = 13
elif b == "D":
    bb = 14
elif b == "E":
    bb = 15
elif b == "F":
    bb = 16

if aa < bb:
    print("<")
elif aa > bb:
    print(">")
else:
    print("=")

Measured memory_bytes: 3064
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <random>
#include <chrono>
using namespace std;

int H, W, K;

char s[15][1005];

int sum[15][1005];

int main(){
    cin >> H >> W >> K;
    for(int i = 1;i <= H;i++){
        scanf("%s", s[i] + 1);
    }
    for(int i = 1;i <= H;i++){
        sum[i][0] = 0;
        for(int j = 1;j <= W;j++){
            sum[i][j] = sum[i][j - 1] + sum[i - 1][j] + (s[i][j] == '1') - sum[i - 1][j - 1];
        }
    }
    int ans = 1e9;
    for(int mask = 0;mask < (1 << (H - 1));mask++){
        int tmp = __builtin_popcount(mask);
        int precol = 0, prerow = 0; 
        vector<int> row;
        for(int j = 0;j < (H - 1);j++){
            if(mask & (1 << j)){
                row.push_back(j + 1);
            }
        }
        row.push_back(H);
        for(int col = 1;col <= W;col++){
            bool flag = false;
            prerow = 0;
            for(int j = 0;j < row.size();j++){
                int r = row[j], c = col;
                int r1 = prerow, c1 = precol;
                int val = sum[r][c] + sum[r1][c1] - sum[r][c1] - sum[r1][c];
                //cout << r << " " << c << " " << r1 << " " << c1 << " " << val << endl;
                
                //cout << val << endl;
                if(val > K){
                    flag = true;
                }
                prerow = r;
            }
            if(flag){
                precol = col - 1;
                tmp++;
            }
        }
        bool flag = false;
        prerow = 0;
        for(int j = 0;j < row.size();j++){
                int r = row[j], c = W;
                int r1 = prerow, c1 = precol;
                int val = sum[r][c] + sum[r1][c1] - sum[r][c1] - sum[r1][c];
                //cout << r << " " << c << " " << r1 << " " << c1 << " " << val << endl;
                
                //cout << val << endl;
                if(val > K){
                    flag = true;
                }
                prerow = r;
        }
        if(!flag){
            ans = min(ans, tmp);
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    string s[]={
        "AKIHABARA",
        "KIHABARA",
        "AKIHBARA",
        "AKIHABRA",
        "AKIHABAR",
        "KIHBARA",
        "KIHABRA",
        "KIHABAR",
        "AKIHBRA",
        "AKIHBAR",
        "AKIHABR",
        "KIHBRA",
        "KIHABR",
        "AKIHBR",
        "KIHBAR",
        "KIHBR",
    };

    string t;cin>>t;
    rep(i,0,16){
        if(t==s[i]){
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
}

/*

*/


Measured memory_bytes: 256
n, k = map(int, input().split())
p = list(map(int, input().split()))
ex = [0 for _ in range(n)]
for i in range(n):
    ex[i] = (p[i]+1)/2

sumex = sum(ex[:k])
tmp = sum(ex[:k])
for i in range(n-k):
    tmp = tmp + (ex[i+k] - ex[i])
    sumex = max(sumex, tmp)
print(sumex)

Measured memory_bytes: 25604
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<cmath>
#include<limits>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define ll_INF 	9223372036854775807
#define MOD 100000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
using namespace std;
int cnt = 0;
int N, M;
vvi  bulb;
vector<int> p;

bool Determiner(string s) {

    bool flag = true;
    for (int i = 0; i < M; i++) {
        int sw = 0;
        for (int j = 0; j < bulb[i].size(); j++) {
            if (s[bulb[i][j]] == '1') sw++;
        }

        if (sw % 2 == p[i]) {
            continue;
        }
        else {
            flag = false;
            break;
        }
    }

    return flag;
}

void AllLit(int digit, string s) {
    //cout << s << endl;
    if (digit == 0) {
        s.replace(digit, 1, "0");
        //s[digit] = NULL;
        if (Determiner(s)) {
            cnt++;
        }
        s.replace(digit, 1, "1");
        //s[digit] = '1';
        if (Determiner(s)) {
            cnt++;
        }
    }
    else {
        s.replace(digit, 1, "0"); AllLit(digit - 1, s);
        s.replace(digit, 1, "1"); AllLit(digit - 1, s);
    }
}

int main() {
    cin >> N >> M;
    vvi  bulb_temp(M);
    vector<int>p_temp(M);
    for (int i = 0; i < M; i++) {
        int k; cin >> k;
        for (int j = 0; j < k; j++) {
            int s; cin >> s; s--;
            bulb_temp[i].push_back(s);
        }
    }
    string s = "";
    rep(i, N) s += "0";
    rep(i, M) {
        cin >> p_temp[i];
    }
    bulb = bulb_temp;
    p = p_temp;

    AllLit(N - 1, s);
    cout << cnt << endl;
}


Measured memory_bytes: 764
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())
lst1 = list(map(int,readline().split()))

dp = [0 for _ in range(n)]

dp[1] = abs(lst1[1]-lst1[0])

for i in range(2,n):
	dp[i] = min(abs(lst1[i]-lst1[i-1])+dp[i-1],abs(lst1[i]-lst1[i-2])+dp[i-2])

print(dp[-1])

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

using namespace std;

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

    if ((abs(a - b) - 1) % 2 == 0)
        cout << "Borys" << endl;
    else
        cout << "Alice" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

//Dominoes Arrangement
public class Main{

	void f(int k){
		u[k] = true;
		for(int i=0;i<7;i++){
			if(!u[i]&&r[k][i])f(i);
		}
	}
	
	boolean[][] r;
	boolean[] u;
	
	void run(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			int[] c = new int[7];
			r = new boolean[7][7];
			for(int i=0;i<n;i++){
				char[] s = sc.next().toCharArray();
				int a = s[0]-'0';
				int b = s[1]-'0';
//				if(a==b)continue;
				c[a]++;
				c[b]++;
				r[a][b] = r[b][a] = true;
			}
			u = new boolean[7];
			for(int i=0;i<7;i++){
				if(c[i]>0){
					f(i);
					break;
				}
			}
			boolean ok = true;
			for(int i=0;i<7;i++)if(!u[i]&&c[i]>0)ok = false;
			int o = 0;
			for(int i=0;i<7;i++)if(c[i]%2==1)o++;
			System.out.println((o==0||o==2)&&ok?"Yes":"No");
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;

int main() {
  string s,t;
  cin >> s >> t;
  for(int i=0;i<(int)s.size();i++){
    if(s[i] != t[i]){cout << "No" << endl; return 0;}
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 3620
#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <numeric>
#include <list>
#include <bitset>
#include <fstream>

using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<LL, LL> PP;
#define REP(i,a,n) for(LL i = (a); i < (LL)(n); ++i)
#define REM(i,a,n) for(LL i = (LL(n) - 1); i >= (a); --i)
#define EPS 1e-11
#define INF 0x3FFFFFFF
#define INFLL 0x3FFFFFFF3FFFFFFF
#define INFD 1.0e+308
#define FLOAT fixed << setprecision(16)
const double PI = 3.1415926535897932;

template <class T, class U>
istream& operator >> (istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U>
ostream& operator<<(ostream& ost, pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N>
void Fill(T(&dest)[N], const TCompatible& val) { fill(begin(dest), end(dest), val); }
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
//sum, 累積和
// 負のときの割り算に注意
#if 1
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>
template<class T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;	// コスト小を優先
#endif

#ifdef ONLY_MY_ENVIR
#include "IntMod.h"
#include "Union_Find.h"
#include "Graph.h"
#include "Suffix_Array.h"
#include "Matrix.h"
#endif

#ifdef __GNUC__
typedef __int128 LLL;
istream& operator >> (istream& ist, __int128& val) { LL tmp;  ist >> tmp; val = tmp; return ist; }
ostream& operator<< (ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#endif

int main() {
	int n, m, d;
	cin >> n >> m >> d;
	
	double ans;
	if (d == 0) {
		ans = 1.0 / n;
	} else {
		ans = 2.0 * (n - d) / n / n;
	}
	cout << FLOAT << ans * (m - 1) << endl;
	return 0;
}


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

using namespace std;
using ll = long long;
using ul = unsigned long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;

int DIGIT = 64;

int count(ul state) {
    int cnt = 0;
    rep(i, DIGIT) {
        if (state & 1ul) cnt++;
        state = state>>1;
    }
    return cnt;
}

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

    int q;
    cin>>q;
    ul state = 0;
    rep(i, q) {
        int c, n;
        cin>>c;
        if (c == 0) {
            cin>>n;
            cout<<((state&(1ll<<n)) != 0)<<endl;
        }
        else if (c == 1) {
            cin>>n;
            state |= (1ul<<n);
        }
        else if (c == 2) {
            cin>>n;
            state &= ~(1ul<<n);
        }
        else if (c == 3) {
            cin>>n;
            state ^= (1ul<<n);
        }
        else if (c == 4) {
            cout<<(count(state)==DIGIT)<<endl;
        }
        else if (c == 5) {
            cout<<(count(state)>0)<<endl;
        }
        else if (c == 6) {
            cout<<(count(state)==0)<<endl;
        }
        else if (c == 7) {
            cout<<count(state)<<endl;
        }
        else {
            cout<<state<<endl;
        }
    }
}


Measured memory_bytes: 3168
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin>>s;
	set<char>st;
	int flag = 0;
	for(auto it:s)
		if(st.count(it))
			flag = 1;
		else
			st.insert(it);
	if(flag ) cout<<"no"<<endl;
	else
		cout<<"yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
 
using namespace std;
typedef long long ll;

const int MOD=1000000007;

int main(){
  int N,K;
  cin >> N >> K;
  vector<ll> a(N+1);
  for (int i = 1; i <= N; i++){
    cin >> a[i];
  }
  
  vector<vector<ll>> dp(N+1,vector<ll>(K+1));
  dp[0][0]=1;
  for (int i = 1; i <= N; i++){
    dp[i][0]=1;
    for (int j = 1; j <= a[i]; j++){
      dp[i][j]=dp[i][j-1]+dp[i-1][j];
      dp[i][j]%=MOD;
      //cout << dp[i][j] << " " << endl;
    }
    for (int j = a[i]+1; j <= K; j++){
      dp[i][j]=dp[i][j-1]+dp[i-1][j]-dp[i-1][j-a[i]-1];
      dp[i][j]%=MOD;
      //cout << dp[i][j] << " " << endl;
    }
    //cout << endl;
  }

  cout << (dp[N][K]+MOD)%MOD << endl;  


}


Measured memory_bytes: 80256
n,*l=map(int,open(0).read().split())
for i in range(2,n*2,2):
	m=max(0-l[i-2]//-l[i],0-l[i-1]//-l[i+1]);l[i]*=m;l[i+1]*=m
print(l[-1]+l[-2])

Measured memory_bytes: 3188
#include <stdio.h>
#include <math.h>
#define N 10000

int isPrime(int n);

int main()
{

  int number[N],i,a,n=0,flag;

  scanf("%d",&a);

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

    flag = isPrime(number[i]);

    if(flag == 1)n++;
  }

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

  return 0;

}
      
int isPrime(int n)
{
  int i,max;
  max = (int)sqrt(n) + 1;

  if(n <= 1)return 0;

  for(i = 2; i < max;i++)
  {
    if(n % i == 0)return 0;
  }

  return 1;
}

Measured memory_bytes: 628
#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() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<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 = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int N, Q;
ll M;
int A[MAX_N], B[MAX_N], C[MAX_N];
vi G[MAX_N];
int used[MAX_N];

void loop(int v, int k) {
	used[v] = k;
	rep(i, 0, sz(G[v])) {
		int n = G[v][i];
		if(used[n] == -1) loop(n, k);
	}
}

void solve() {
	cin >> N >> M >> Q;
	rep(i, 0, Q) {
		cin >> A[i] >> B[i] >> C[i];
		if(C[i] == 0) {
			G[A[i]].pb(B[i]);
			G[B[i]].pb(A[i]);
		}
	}
	memset(used, -1, sizeof(used));
	ll k = 0;
	rep(i, 0, N) {
		if(used[i] == -1) loop(i, k++);
	}
	bool noloop = true;
	rep(i, 0, Q) {
		if(C[i] == 1) {
			if(used[A[i]] == used[B[i]]) {
				cout << "No\n";
				return;
			}
			noloop = false;
		}
	}
	if(k <= 2) {
		if(M == N - 1 && noloop) cout << "Yes\n";
		else cout << "No\n";
	}
	else if(N - noloop <= M && M <= N + k * (k - 3) / 2) {
		cout << "Yes\n";
	}
	else cout << "No\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

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



Measured memory_bytes: 22656
#include <bits/stdc++.h> 
using namespace std;
#define ll long long 
#define mod 998244353
#define MOD 998244353
ll fact[1000001];
void fast(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
inline ll mul(ll a,ll b){
  a=(a+MOD)%MOD;
  b=(b+MOD)%MOD;
  ll c=a*b;
  c=(c+MOD)%MOD;
  return c;
}
inline ll add(ll a,ll b){
  a=(a+MOD)%MOD;
  b=(b+MOD)%MOD;
  ll ans=(a+b);
  ans=(ans+MOD)%MOD;
  return ans;
}

ll power(ll a,ll b,ll c){
  ll ans=1;
  while(b){
    if(b&1){
      ans=mul(ans,a);
    }
    a=mul(a,a);
    b=b/2;
  }
  return ans;
}
ll ncr(ll n,ll r){
    if(r>n)return 0;
    if(r==n)return 1;
    ll xx=fact[n];
    xx=xx*power(fact[r],mod-2,mod)%mod;
    xx=xx*power(fact[n-r],mod-2,mod)%mod;
    return xx;
}
int main() 
{ 
    fast();
    string s; cin>>s;
    string z="";
    int n=s.length();
    if(s[0]=='?')z.push_back('D');
    else z.push_back(s[0]);
    for(int i=1;i<n;++i){
        if(s[i]=='?'){
            z.push_back('D');
        }
        else z.push_back(s[i]);
    }
    cout<<z;
    return 0; 
} 


Measured memory_bytes: 3892
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
        cout.precision(20);
    }
} fast;

/* define */
#define FOR(I, X, Y) for(long long(I) = (X); (I) < (Y); (I)++)
#define REP(I, X, Y) for(long long(I) = (Y)-1; (I) >= (X); (I)--)
#define ALL(X) (X).begin(), (X).end()
#define pb push_back
#define COUNT(V, X)                                                            \
    (upper_bound((V).begin(), (V).end(), X) -                                  \
     lower_bound((V).begin(), (V).end(), X))
#define debug(x) cerr << #x << ':' << x << endl;
#define DEBUG(v)                                                               \
    {                                                                          \
        cerr << #v << ':';                                                     \
        for(auto xv : v) cerr << xv << ' ';                                    \
        cerr << endl;                                                          \
    }
#define Yes(X) cout << (X ? "Yes" : "No") << endl;
#define YES(X) cout << (X ? "YES" : "NO") << endl;
#define ctoi(C) (C - '0')
#define pow2(x) ((long long)((long long)1 << x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1, 0, -1, 0};
const long long dy[] = {0, 1, 0, -1};
const long long dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long dx9[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
const long long dy9[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T1, typename T2> inline bool chmin(T1 &a, const T2 &b) {
    if(a > b) a = b;
    return a > b;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, const T2 &b) {
    if(a < b) a = b;
    return a < b;
}
long long max(long long x, int y) {
    return max(x, (long long)y);
}
long long max(int x, long long y) {
    return max((long long)x, y);
}
long long min(long long x, int y) {
    return min(x, (long long)y);
}
long long min(int x, long long y) {
    return min((long long)x, y);
}

/* liblary */

/* main */

signed main() {
    ll A, B;
    cin >> A >> B;
    if(A >= 13)
        cout << B << endl;
    else if(6 <= A)
        cout << B / 2 << endl;
    else
        cout << 0 << endl;
}

Measured memory_bytes: 764
/*
** author:mahmoud magdy
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define endl "\n"

inline int D()
{
    int m ;
    cin>>m;
    return m ;
}
inline ll lD()
{
    ll m ;
    cin>>m;
    return m ;
}
inline double dD()
{
    double m;
    cin>>m;
    return m;
}
void fast()
{
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}
int main()
{
    fast();
    string s[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
    string s1;
    cin>>s1;
    int day;
    for(int i=0;i<7;i++){
        if(s[i]==s1){
            day=i+1;
            break;
        }
    }
    cout<<7-(day-1)<<endl;
}


Measured memory_bytes: 3540
import Control.Applicative
import Control.Monad
import System.IO.Unsafe
import Control.Monad.ST
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import Data.Foldable (foldMap)
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
 
readInt = read :: String -> Int
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getDouble = readLn :: IO Double
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
fnBin :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
fnBin op f g x = op (f x) $ g x
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
modifyArray :: (Ix i, MArray a e m) => a i e -> i -> (e -> e) -> m ()
modifyArray arr ix f = readArray arr ix >>= writeArray arr ix . f
-- end of templete



main = replicateM 28 getInt >>= \s -> mapM_ print [x | x <- [1..30], not (x `elem` s)]

Measured memory_bytes: 3808
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();

    boolean takahashi = true;

    while (a > 0 && c > 0) {
      if (takahashi) {
        c -= b;
      } else {
        a -= d;
      }
      takahashi = !takahashi;
    }

    if (c <= 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  } 
}


Measured memory_bytes: 35716
from collections import defaultdict, deque

N = int(input())
abList = [list(map(int, input().split())) for _ in range(N-1)]
cList = sorted(list(map(int, input().split())), reverse=True)

dd = defaultdict(list)
for ab in abList:
    a, b = ab
    dd[a].append(b)
    dd[b].append(a)

nodeDict = defaultdict(int)
treeQ = deque()
nodeDict[1] = cList[0]
treeQ.append(1)
ci = 1
while(treeQ):
    node = treeQ.popleft()
    for nextNode in dd[node]:
        if not nodeDict[nextNode]:
            treeQ.append(nextNode)
            nodeDict[nextNode] = cList[ci]
            ci += 1

ans1 = sum(cList[1:])
ans2 = ""
for node in nodeDict:
    ans2 += str(nodeDict[node]) + " "

print(ans1)
print(ans2)



Measured memory_bytes: 140324
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if x - 500 * i - 100 * j - 50 * k == 0:
        cnt += 1
print(cnt)

Measured memory_bytes: 3060