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

using namespace std;

#define countof(a) (sizeof(a)/sizeof(*a))

#define vi vector<int>
#define vvi vector<vector<int> >
#define vpi vector<pi >
#define pi pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define all(n) n.begin(), n.end()

#define FROMTO(var, from, to) for (register int var = (from), var##down = ((int)(to)) < ((int)(from));var##down ? (var >= (int)(to)) : (var <= (int)(to));var##down ? var-- : var++)
#define UPTO(var, from, to)   for (register int var = (from); var <= ((int)to); var++)
#define DOWNTO(var, from, to) for (register int var = (from); var >= ((int)to); var--)
#define FOR(var, to)          UPTO(var, 0, (to)-1)
#define DOWN(var, from)       DOWNTO(var, (from)-1, 0) 

#define INIT(var, val) FOR(i,countof(var)) var[i] = val
#define INPUT(var) FOR(i,countof(var)) cin >> var[i]
#define INPUT1(var) FOR(i,countof(var)) cin >> var[i], var[i]--

#define SORT(v) qsort(v,countof(v),sizeof(*v),int_less)
#define SORTT(v) qsort(v,countof(v),sizeof(*v),int_greater)
#define QSORT(v,b) qsort(v,countof(v),sizeof(*v),b)

#define MOD 1000000007
#define INF ((1 << 30)-1)
#define LINF ((1LL << 62)-1)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

struct Comb {
    vector<vector<s64> > data;
    Comb(int n) { // O(n^2)
        data = vector<vector<s64> >(n+1,vector<s64>(n+1,1));
        UPTO(i,1,n) {
            FOR(j,i+1) {
                if (!j || j == i) data[i][j] = 1;
                else data[i][j] = data[i-1][j-1] + data[i-1][j];
            }
        }
    }
    
    s64 ncr(int n, int r) {
        return data[n][r];
    }
};

static inline int ri() {
  int a;
  scanf("%d", &a);
  return a;
}

int int_less(const void *a, const void *b) {
  return (*((const int*)a) - *((const int*)b));
}
int int_greater(const void *a, const void *b) {
  return (*((const int*)b) - *((const int*)a));
}

int main() {
    int h = ri();
	int w = ri();
	int n = ri();
	set<pi > xy;
	vector<set<int> > xy_(w);
	int x[n];
	int y[n];
	FOR(i,n) x[i] = ri()-1, y[i] = ri()-1, xy.insert({x[i],y[i]}), xy_[y[i]].insert(x[i]);
	int res = h;
	int cur_j = 0;
	FOR(i,h) {
		// cout << "i:" << i << " cur_j:" << cur_j << endl;
		auto j  = xy_[cur_j].upper_bound(i);
		if (j != xy_[cur_j].end()) {
			res = min(res,*j);
			if (*j == i+1)
				break;
		}
		if (!xy.count({i+1, cur_j+1}))
			cur_j++;
		if (cur_j >= w) cur_j = w-1;
	}
	cout << res << endl;
    return 0;
}


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


int main() {
    ll n; cin>>n;
    vector<ll> a(n);
    ll max=1e18;
    ll ans=1;
    rep(i,n){
        cin>>a.at(i);
        if(a.at(i)==0){
            puts("0");
            return 0;
        }
    }
    rep(i,n){
        if(a.at(i)>max/ans){
            cout<<-1<<endl;
            return 0;
        }
        else{
            ans*=a.at(i);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 4024
#include<stdio.h>
int main(){
  int i,j,k;
  int d;	//365
  int c[26];
  int score[9490];
  int t[365] = {0};
  int day1[26] = {0};
  double x = 0.36787944117;
  int tmp1=-999999,tmp2=-999999;
  int tmpi = 0;
  
  scanf("%d",&d);
  for(i=0;i<26;i++){
      scanf("%d ",&c[i]);
  }
  for(i=0;i<d*26;i++){
      scanf("%d ",&score[i]);
  }
  //st
  
  for(i=0;i<26;i++){
    if(c[i]>tmp1){
     tmp1 = c[i];
    }
    tmpi = i;
  }
  tmp1 = -999999;/*
  for(i=0;i<d;i++){
    for(j=0;j<26;j++){
      if(score[i*26+j]-c[j]*(1+day1[j])>tmp1){
       	t[i] = j;
      }
    }
  }
  */
  //en
  int sp[26]={0};
  int pp=-999999;
  int pp2 = 0;
  for(i=0;i<d;i++){
    
    
    
    pp2=0;
    for(k=0;k<26;k++){  
    if(sp[k]<=1&&score[k]+c[k]*(1+day1[k])>=pp){	
      pp=score[k];
      pp2 = k;
    }}
    pp=-999999;
    sp[pp2]+=1;
    printf("%d\n",pp2+1);
    //printf("%d\n",(tmpi+i)%26+1);
    if(i%26==25){
    	for(k=0;k<26;k++){
         sp[k]--;
          if(sp[k]<0){
           sp[k]=0; 
          }
        }
    }  
    
    
    for(k=0;k<26;k++){
      day1[k] += 1;
    }
    day1[pp2]=0;
  }
 return 0; 
}







Measured memory_bytes: 2192
#include <iostream>
#include <cstdio>
#include <cmath>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
#define INF 1e15
using namespace std;
typedef long long ll;

int N, M, L, P[100], T[100], V[100];
double p[100][51];

ll combination(ll n, ll r) {
  static ll comb[51][51];
  ll &ret = comb[n][r];
  if(ret != 0) return ret;
  if(n == 0 || r == 0) return ret = 1;
  if(n == r) return ret = 1;
  if(r == 1) return ret = n;
  return ret = combination(n - 1, r - 1) + combination(n - 1, r);
}

bool ok(int ai, int aj, int bi, int bj) {
  double ta = V[ai] > 0 ? (double) L / V[ai] + T[ai] * aj : INF;
  double tb = V[bi] > 0 ? (double) L / V[bi] + T[bi] * bj : INF;
  return ta < tb;
}

int main(void) {
  cin >> N >> M >> L;
  REP(i, 0, N) cin >> P[i] >> T[i] >> V[i];

  REP(i, 0, N) REP(j, 0, M + 1) {
    p[i][j] = combination(M, j) * pow(P[i] / 100.0, j) * pow(1 - P[i] / 100.0, M - j);
  }

  REP(i, 0, N) {
    double ans = 0;
    double pi = 0;
    REP(j, 0, M + 1) {
      pi = p[i][j];
      double pij = pi;
      REP(k, 0, N) if(i != k) {
        double pk = 0;
        REP(l, 0, M + 1) if(ok(i, j, k, l)) pk += p[k][l];
        pij *= pk;
      }
      ans += pij;
    }
    printf("%.8lf\n", ans);
  }


  return 0;
}

Measured memory_bytes: 3484
import sys
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N, K = rl()
P = rl()

sums = [0]
s = 0
for i in range(N):
	s += P[i]
	sums.append(s)
max_ksum = 0
max_i = -1
for i in range(N-K+1):
	ksum = sums[i+K]-sums[i]
	if max_ksum < ksum:
		max_ksum = ksum
		max_i = i

ans = 0
for i in range(max_i, max_i+K):
	ans += P[i]+1
print(ans/2)


Measured memory_bytes: 72200
#include <bits/stdc++.h>
#include <iostream>
#include <string.h>
#include <math.h>

using namespace std;
const int maxn = 1e6 + 5;
int head[maxn], tot, in[maxn];
struct Edge {
    int u, v, next;
}edge[maxn];

int dis[maxn];

void init() {
    memset(head, -1, sizeof(head)); tot = 1;
}
void add(int u, int v) {
    edge[++tot].u = u; edge[tot].v = v;
    edge[tot].next = head[u]; head[u] = tot;
}



int main() {
//    freopen("in.in", "r", stdin);
    int n, m, u, v;
    init();
    cin >> n >> m;
    for (int i = 1; i <= m; i++) {
        cin >> u >> v; in[v]++;
        add(u, v);
    }
    queue<int> q;
    for (int i = 1; i <= n; i++) {
        if (!in[i]) {
            q.push(i);
        }
    }
    while (!q.empty()) {
        int u = q.front(); q.pop();
        for (int i = head[u]; i != -1; i = edge[i].next) {
            int to = edge[i].v;
            dis[to] = max(dis[to], dis[u] + 1);
            in[to]--;
            if (!in[to]) {
                q.push(to);
            }
        }
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        ans = max(ans, dis[i]);
    }
    cout << ans << endl;
    return 0;
}

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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1)/b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }

int nmax=200000; // 2*(10^5)
vvec g(nmax);



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int n,m,k;
    cin>>n>>m>>k;
    for(int i=0;i<=n;i++){
        for(int j=0;j<=m;j++){
            if(i*m+j*n-i*j*2==k){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
    
}

Measured memory_bytes: 4992
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

pub trait InputValue {
    fn parse(s: &str) -> Self;
}

pub fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

pub fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B);
parse_tuple!(A, B, C);
parse_tuple!(A, B, C, D);
parse_tuple!(A, B, C, D, E);

// ===

fn main() {
    let n: usize = read();
    if isgood(n) {
      println!("Yes");
    } else {
      println!("No");
    }
}

fn isgood(n: usize) -> bool {
  let s = format!("{}", n).into_bytes();
  return (s[0] == s[1] && s[1] == s[2]) || (s[1] == s[2] && s[2] == s[3]);
}


Measured memory_bytes: 4352
/*
  Vivek Rathi
  CSE 2nd Year
  MNNIT
*/
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long int
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define present(c,x) ((c).find(x) != (c).end())
#define null NULL
#define mp make_pair
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define inf 1e18
#define flush fflush(stdout);
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}
//-------------------------------Template--Above------------------------------------------------


int main()
{
	boost
	string s;
	cin>>s;
	ll co=0;
	string prev;
	for(ll i=0;i<s.length();i++)
	{
		string temp;
		temp.pb(s[i]);
		if(temp==prev)
		{
			i++;
			if(i<s.length())
				temp.pb(s[i]);
			else
				break;
		}
		co++;
		prev=temp;
	}
	cout<<co<<endl;
	return 0;
}


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

typedef long long ll;
typedef pair<ll, ll> P;


#define rep(i,n) for(ll i=0; i < ll(n); i++)
#define frep(i,m,n) for(ll i=m; i <= ll(n); i++)

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    ll n; cin >> n;
    vector<P> a, ans;

    // nが偶数
    if((n%2) == 0) {
        frep(i, 1, n/2) {
            a.push_back(make_pair(i, n+1-i));
        }
        rep(i, n/2-1) {
            frep(j, i+1, n/2-1) {
                ans.push_back(make_pair(a[i].first, a[j].first));
                ans.push_back(make_pair(a[i].first, a[j].second));
                ans.push_back(make_pair(a[i].second, a[j].first));
                ans.push_back(make_pair(a[i].second, a[j].second));
            }
        }
    }
    else {
        frep(i, 1, (n-1)/2) {
            a.push_back(make_pair(i, n-i));
        }
        rep(i, (n-1)/2-1) {
            frep(j, i+1, (n-1)/2-1) {
                ans.push_back(make_pair(a[i].first, a[j].first));
                ans.push_back(make_pair(a[i].first, a[j].second));
                ans.push_back(make_pair(a[i].second, a[j].first));
                ans.push_back(make_pair(a[i].second, a[j].second));
            }
        }
        frep(i, 1, (n-1)/2) {
            ans.push_back(make_pair(n, i));
            ans.push_back(make_pair(n, n-i));
        }
    }
    cout << ans.size() << endl;
    rep(i, ans.size()) {
        cout << ans[i].first << ' ' << ans[i].second << endl;
    }
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

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

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


Measured memory_bytes: 3728
#include <iostream>
#include <cstdlib>
#include <list>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
 
int main(void)
{
    int x[5];
    cin >> x[0] >> x[1] >> x[2] >> x[3] >> x[4];

    for (int i = 0; i < 5; ++i)
    {
        if (x[i] == 0)
        {
            cout << (i+1) << endl;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 3096
#include <string>
#include <bits/stdc++.h>
#include <stdio.h>
#include<math.h>
#include <ctype.h>

using namespace std;

int main() {
 vector<int> ans(4);
  vector<int> vec(6);
  for(int i=0;i<6;i++){
    cin >> vec.at(i);
  }
  for(int i=0;i<6;i++){
    if(vec.at(i)==1){
      ans.at(0)++;
    }
     if(vec.at(i)==2){
      ans.at(1)++;
    }
     if(vec.at(i)==3){
      ans.at(2)++;
    }
     if(vec.at(i)==4){
      ans.at(3)++;
    }
  }
    bool vio=true;
    for(int i=0;i<4;i++){
      if(ans.at(i)>=3){
        vio=false;
        break;
      }
      if(ans.at(i)=0){
        vio=false;
        break;
      }
    }
    if(vio){
      cout << "YES" << endl;
    }
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

//#define debug
using namespace std;
int n, m, i, a[200005];
int main() {
#ifdef debug
	freopen("1.in", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	while (cin >> n) {
		int res = 0;
		int min = (1 << 30);
		for (i = 0; i < n; i++) {
			cin >> a[i];
			if (a[i] <= min) {
				res++;
			}
			if (min > a[i]) {
				min = a[i];
			}
		}
		cout << res << endl;
	}
	return 0;
}


Measured memory_bytes: 1024
N  = int(input())
dp = [[0]*3 for _ in range(N+1)]

for n in range(1,N+1):
  a, b, c = map(int,input().split())
  dp[n][0] = max(dp[n-1][1], dp[n-1][2]) + a
  dp[n][1] = max(dp[n-1][0], dp[n-1][2]) + b
  dp[n][2] = max(dp[n-1][0], dp[n-1][1]) + c
print(max(dp[N]))
  

Measured memory_bytes: 22772
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Diagnostics.Tracing;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            //ここから
            //int n=ReadInt();
            //string[] str = Console.ReadLine().Split(' ');
            long n = ReadLong();
            long[] a = ReadArray(n);

            long waru = (long)Math.Pow(10, 9) + 7;

            long sum = a.Sum();

            long ans = 0;

            for (long i = 0; i < n - 1; i++)
            {
                sum -= a[i];
                if (sum > waru) sum %= waru;
                if (sum < 0) sum += waru;
                ans += a[i] * sum;
                ans %= waru;
            }

            Cout(ans);


            //ここまで
        }


        static void Cout(string s)
        {
            Console.WriteLine(s);
            return;
        }

        static void Cout(int n)
        {
            Console.WriteLine(n);
            return;
        }

        static void Cout(long n)
        {
            Console.WriteLine(n);
            return;
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static int[] ReadArray(int n)
        {
            string[] str = Console.ReadLine().Split(' ');
            int[] a = new int[n];
            for (int i = 0; i < n; i++) { a[i] = int.Parse(str[i]); }
            return a;
        }
        static long[] ReadArray(long n)
        {
            string[] str = Console.ReadLine().Split(' ');
            long[] a = new long[n];
            for (long i = 0; i < n; i++) { a[i] = long.Parse(str[i]); }
            return a;
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int Min(int a, int b)
        {
            if (a < b) return a;
            return b;
        }

        static int Max(int a, int b)
        {
            if (a > b) return a;
            return b;
        }


    }

}


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

int main(){
    int n;
    cin>>n;
    if(n%2==0)cout<<"0.5"<<endl;
    else{
        int b=n/2+1;
        cout<<setprecision(10);
        cout<<(double)b/(double)n<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main() {
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    sort(v.begin(), v.end());
    double ans = v[0];
    for (int i = 1; i < n; i++) ans = (double) (ans+v[i])/2;
    cout << setprecision(12) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(2 * m);
  for (int i = 0; i < 2 * m; i++) {
    int tmp;
    cin >> tmp;
    a[i] = tmp;
  }
  sort(a.begin(), a.end());
  bool flag = false;
  int tmp = 0;
  int crr = 0;
  for (int i = 0; i < 2 * m; i++) {
    int nxt = a[i];
    if (crr == nxt) {
      tmp++;
    } else {
      if (tmp & 1) {
        flag = true;
        break;
      }
      tmp = 1;
    }
    crr = nxt;
  }
  if (!flag) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
  return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        int[] sortedInput = Stream.of(new Scanner(System.in).nextLine().split(" ")).mapToInt(Integer::parseInt).sorted().toArray();

        int result = IntStream.rangeClosed(1,2).map(i -> {
            return sortedInput[i] - sortedInput[i-1];
        }).sum();
        System.out.println(result);
    }
}

Measured memory_bytes: 27092
#include <bits/stdc++.h>
using namespace std;
typedef  long long ll;
//double pi=3.1415926535898;
//double pi=acos(-1.0);
#define scarr(a,s,e) for(int i=s;i<=int(e);i++) scanf("%d ",&a[i]);
#define prarr(a,s,e) for(int i=s;i<=int(e);i++) printf("%d ",a[i]);
#define speed      ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define rng(i,a,b) for(int i=a;i>=int(b);i--)
#define rep(i,a,b) for(int i=a;i<=int(b);++i)
#define lop(i,n)   for(int i=0;i<int(n);i++)
#define ms(x,a)    memset(x,a,sizeof(x))
#define all(x)     (x).begin(),(x).end()
#define sz(x)      int(x.size())
#define pb         push_back
#define mkp        make_pair
#define sc(x)      scanf("%d",&x)
#define scl(x)     scanf("%lld",&x)
#define pr(x)      printf("%d ",x)
#define prl(x)     printf("%lld ",x)
#define prln(x)    printf("%d\n",x)
#define prlln(x)   printf("%lld\n",x)
#define r0         return 0;
#define CC         continue;
#define scd(x)     scanf("%lf",&x)
#define prd(x)     printf("%.10f\n",x)
#define bb(x)      cerr<< x <<endl;
#define pii        pair<int,int>
#define vi         vector<int>
#define fr         first
#define se         second
//#define max(a,b) a<b?b:a
//#define min(a,b) a<b?a:b
const ll M  = 1e9+7 ;
const ll inf = 1e18 ;
const int si = 1e6+9;
const int N = 3e4+1 ;
//////////////////////    Hi    ^_^  hack me if you can :P

int main()
{
    speed;
    int t;
    t=1;
    for(int T=1; T<=t; T++)
    {
        string s , t = "CODEFESTIVAL2016";
        cin>>s;
        int c=0;
        lop(i,sz(s)){
        c+=s[i]!=t[i];
        }
    cout<<c;
    }

    r0;
}

/*

ll pwmod(ll a, ll n, ll mod) {
    ll ret = 1;
    while (n) {
        if (n & 1) ret = ret * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return ret;
}

*/
/*
freopen("output.txt","w",stdout);
freopen("input.txt","r",stdin);
for (int i=0;i<n;i++)            Hi    ^_^  hack me if you can :P
int mx[]= {0,0,1,-1, 1,1,-1,-1};
int my[]= {1,-1,0,0, 1,-1,1,-1};
bool inside (int i,int j) {return (i>=0 && i<n && j>=0 && j<m);}

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void gcd(LL n,LL m,LL &d,LL &xx,LL &yy){
    if(!m) {d=n; xx=1; yy=0;}
    else {gcd(m,n%m,d,yy,xx); yy-=xx*(n/m);}
}

int getm(int l,int r)
{
    if(l>r)
        return N;
    if(l==r)
        return 0;
    if(l==r-1)
        return s[l] != s[r];
    if(s[l]==s[r])
        return getm(l+1,r-1);
    else
        return 1+min(getm(l+1,r),getm(l,r-1));
}


*/


Measured memory_bytes: 256
#define _DEBUG
#include "bits/stdc++.h"
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef _DEBUG
#define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define debug(...)
#endif
#define rep(index,num) for(int index=0;index<(int)num;index++)
#define rep1(index,num) for(int index=1;index<=(int)num;index++)
#define brep(index,num) for(int index=(int)num-1;index>=0;index--)
#define brep1(index,num) for(int index=(int)num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=(ll)1e+18+1;
int INF=1e+9+1;
int main(){
	int N,M,X;
	int C[100],A[16][16];
	scan(N>>M>>X);
	rep(i,N){
		scan(C[i]);
		rep(j,M){
			scan(A[i][j]);
		}
	}
	int bitall=(1<<N);
	int costmin=INF;
	rep(bit,bitall){
		int cost=0;
		int abi[16]={};
		rep(i,N){
			if((bit>>i)&1){
				cost+=C[i];
				rep(j,M){
					abi[j]+=A[i][j];
				}
			}
		}
		int flag=1;
		rep(j,M){
			if(abi[j]<X) flag=0;
		}
		if(flag){
			costmin=min(costmin,cost);
		}
	}
	if(costmin==INF){
		prin(-1);
	}
	else prin(costmin);
	return 0;
}


Measured memory_bytes: 3676
#include<stdio.h>

int main(void) {
	int a[10];
	int copy = 0;
	for (int i = 0; i < 10; i++) {
		scanf("%d", &a[i]);
	}
	for (int x = 0; x < 10; x++) {
		for (int y = x; y < 10; y++) {
			if (a[x] > a[y]) {
				copy = a[x];
				a[x] = a[y];
				a[y] = copy;
			}
		}
	}
		printf("%d\n%d\n%d\n", a[9], a[8], a[7]);
	}


Measured memory_bytes: 2044
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <complex>
#include <vector>
using namespace std;

const double PI = 3.14159265358979;
typedef complex<double> P;
double cross(P a, P b) { return (conj(a)*b).imag(); }

double dp[40][40][40];

double Area(P a, P b, P c)
{
	double res = 0;
	res = (cross(a,b) + cross(b,c) + cross(c,a)) /2.0;

	return res;
}

int main() {
	int N,M;
	while(cin >> N >> M, (N||M)) {
		vector<P> v;
		for(int i=0; i<N; i++) {
			double x;
			cin >> x;

			v.push_back(P(cos(2*x*PI), sin(2*x*PI)));
		}
		memset(dp, 0, sizeof(dp));
		for(int i=2; i<=M; i++) 
		for(int j=0; j<N; j++) 
		for(int k=j+1; k<N; k++) 
		for(int l=k+1; l<N; l++) {
			dp[j][l][i+1] = max(dp[j][l][i+1], dp[j][k][i]+Area(v[j], v[k], v[l]));
		}

		double res = 0;
		for(int i=0; i<N; i++)
		for(int j=i+1; j<N; j++) 
			res = max(res, dp[i][j][M]);

		cout.setf(ios::fixed);
		cout.precision(6);
		cout << res << endl;
	}
}

		

Measured memory_bytes: 1508
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
  char W[11],T[1001];
  int sum = 0;
  scanf("%s",W);
  REP(i,strlen(W)) W[i]=tolower(W[i]);

  while(1) {
    scanf("%s",T);
    if( strcmp("END_OF_TEXT", T) == 0 ) break;
    REP(i,strlen(T)) T[i] = tolower(T[i]);
    if(strcmp(W,T) == 0) sum++;
  }
  printf("%d\n",sum);
  return 0;
}



Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define RFOR(i,a,b) for(int i=(b-1); i>=(a); i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
using ll = long long;
using D = double;
using LD = long double;
using P = pair<int, int>;
const int mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    string s; cin >> s;
    if(s == "AAA" ||  s == "BBB") cout << "No" << endl;
    else cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
//container util
//------------------------------------------
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
 
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define REACH(i,c) for(typeof((c).end()) i=(c).end(); i!=(c).begin(); --i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).begin(),(c).end(),greater<int>())
 
#define PB(a) push_back(a)
#define PF(a) pop_front(a)
 
#define MP(a,b) make_pair(a,b)
 
#define FS first
#define SE second
 
#define ALL(x) (x).begin(),(x).end()
#define MAX_EL(c) *max_element((c).begin(),(c).end())
#define MIN_EL(c) *min_element((c).begin(),(c).end())
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef string str;
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
//grobal var
//------------------------------------------
const int MAX = 10000;
const LL MOD = 1e9+7;
bool visited[MAX];
VI graph[MAX];
priority_queue<int> q;
int ans;
VI a;




int main(){
// magic spell------------------------------
  cin.tie(0);
  ios::sync_with_stdio(false);
//------------------------------------------
  int N;
  while(cin >> N){
    ans=0;
    int c[N];

    REP(i,N-1){
      int a,b;
      cin >> a >> b;
      a--;
      b--;
      graph[a].PB(b);
      graph[b].PB(a);
    }
    REP(i,N){
      int ci;
      cin >> ci;
      ci--;
      q.push(ci);
    }
    a.resize(N);
    deque<int> q2;
    q2.PB(0);
    a[0]=q.top()+1;
    q.pop();
    debug(q.top())
    visited[0]=true;
    while(!q2.empty()){
      int tmp2 = q2.front();
      visited[tmp2]=true;
      q2.pop_front();
      EACH(i,graph[tmp2]){
        if(!visited[*i]){
          q2.PB(*i);
          int tmp = q.top();
          ans += tmp+1;
          debug(ans)
          q.pop();
          a[*i]=tmp+1;
        }
      }
    }
    cout << ans << endl;
    EACH(i,a){
      cout << (*i) <<" ";
    }
    cout << endl;

  }

  return 0;
}

Measured memory_bytes: 1024
import java.util.*;
public class Main {

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

        int a[]=new int[3];
        for(int i=0;i<3;i++){
            a[i]=scan.nextInt();

        }
        Arrays.sort(a);

        System.out.println(a[0]+a[1]);


    }
}


Measured memory_bytes: 21076
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    Map<Integer, Integer> seen = new HashMap<>();
    for (int ix = 0; ix < 3; ix++) {
      int value = scanner.nextInt();
      seen.put(value, seen.getOrDefault(value, 0) + 1);
    }

    boolean result = seen.containsKey(5)
      && seen.containsKey(7)
      && seen.get(5) == 2
      && seen.get(7) == 1;
    
    System.out.println(result ? "YES" : "NO");
  }
}


Measured memory_bytes: 21588
import java.util.Scanner;

public class Main {

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



       int a=scan.nextInt();
       int b=scan.nextInt();

       if ((a*b)%2==0){System.out.println("Even");}
       else{System.out.println("Odd");}

	// write your code here

    }
}


Measured memory_bytes: 20948
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

var sc *bufio.Scanner

const BufferSize = 1024

func nextInt() int {
	if !sc.Scan() {
		panic(nil)
	}
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

var production bool

func debugf(format string, v ...interface{}) {
	if !production {
		fmt.Printf(format, v...)
	}
}

func answer(reader io.Reader, writer io.Writer) {
	sc = bufio.NewScanner(reader)
	buf := make([]byte, BufferSize)
	sc.Buffer(buf, 1e+6)
	sc.Split(bufio.ScanWords)
	n := nextInt()
	k := nextInt()

	d := (n-1)*(n-2)/2 - k
	if d < 0 {
		_, _ = fmt.Fprint(writer, "-1")
		return
	}

	g := map[int]map[int]struct{}{}

	count := 0
	for i := 1; i < n; i++ {
		if _, ok := g[0]; !ok {
			g[0] = map[int]struct{}{}
		}
		g[0][i] = struct{}{}
		count++
	}

	idx1 := 1
	idx2 := idx1 + 1
	for d > 0 {
		if idx2 < n {
			if _, ok := g[idx1]; !ok {
				g[idx1] = map[int]struct{}{}
			}
			g[idx1][idx2] = struct{}{}
			count++
			idx2++
		} else {
			idx1++
			idx2 = idx1 + 1
			if _, ok := g[idx1]; !ok {
				g[idx1] = map[int]struct{}{}
			}
			g[idx1][idx2] = struct{}{}
			count++
			idx2++
		}
		d--
	}

	_, _ = fmt.Fprintf(writer, "%d\n", count)
	for i := range g {
		for j := range g[i] {
			_, _ = fmt.Fprintf(writer, "%d %d\n", i+1, j+1)
		}
	}
}

func main() {
	production = true
	answer(os.Stdin, os.Stdout)
}


Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
using namespace std;
#define MAX 100000

int A[MAX],n;

int partition(int p,int r){
	int x=A[r];
	int i=p-1;
	for(int j=p;j<r;j++){
		if(A[j]<=x){
			i++;
			swap(A[j],A[i]);
		}
	}
	swap(A[i+1],A[r]);
	return i+1;
}

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&A[i]);
	}
	int q=partition(0,n-1);
	for(int i=0;i<n;i++){
		if(i)printf(" ");
		if(i==q)printf("[");
		printf("%d",A[i]);
		if(i==q)printf("]");
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 1420
import java.util.*;
import static java.lang.System.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(in);
        int n=sc.nextInt();
        int[] a=new int[n+2];
        a[0]=0;a[n+1]=1000000001;
        int[] b=new int[n];
        int[] c=new int[n+2];
        a[0]=0;c[n+1]=1000000001;
        for (int i = 1; i <= n; i++) {
            a[i]=sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            b[i]=sc.nextInt();
        }
        for (int i = 1; i <= n; i++) {
            c[i]=sc.nextInt();
        }
        Arrays.sort(a);
        Arrays.sort(b);
        Arrays.sort(c);
        long ans=0;
        for (int i = 0; i < n; i++) {
            int l=0,r=n+1;
            int t=b[i];
            int m=(l+r)/2;
            long tempA=0,tempC=0;
            while (true) {
                if(a[m]<t&&t<=a[m+1]){
                    tempA=m;
                    break;
                }else if(a[m]>=t){
                    r=m-1;
                    m=(l+r)/2;
                }else if(a[m]<t){
                    l=m+1;
                    m=(l+r)/2;
                }
            }
            l=0;r=n+1;m=(l+r)/2;
            while (true) {
                if(c[m]<=t&&t<c[m+1]){
                    tempC=n-m;
                    break;
                }else if(c[m]>t){
                    r=m-1;
                    m=(l+r)/2;
                }else if(c[m]<=t){
                    l=m+1;
                    m=(l+r)/2;
                }
            }
            ans+=tempA*tempC;
        }
        out.println(ans);
    }
}

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

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;

int main() {
  ll H, W;
  cin >> H >> W;

  vector<vector<ll>> board(H, vector<ll>(W, 0));

  ll cnt = 0;
  vector<string> ans(250000);

  for (int h = 0; h < H; h++) {
    for (int w = 0; w < W; w++) {
      ll temp;
      cin >> temp;
      board[h][w] = (board[h][w] + temp) & 1;
      if (board[h][w]) {
        ans[cnt] = to_string(h + 1) + SP + to_string(w + 1) + SP;
        if (h < H - 1) {
          ans[cnt] = ans[cnt] + to_string(h + 1 + 1) + SP + to_string(w + 1) + BR;
          board[h + 1][w]++;
          cnt++;
        } else if (w < W - 1) {
          ans[cnt] = ans[cnt] + to_string(h + 1) + SP + to_string(w + 1 + 1) + BR;
          board[h][w + 1]++;
          cnt++;
        }
      }
    }
  }

cout << cnt << "\n";
  for (int i = 0; i < cnt; i++) {
    cout << ans[i];
  }
  
  return 0;
}

Measured memory_bytes: 13824
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<long long> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	long long ans = 0;
	if (n == 1) {
		cout << a[0] / 2 << endl;
		return 0;
	}
	for (int i = 1; i < n; i++) {
		long long x = a[i - 1] + a[i];
		ans += x / 2;
		if (a[i] != 0) a[i] = x % 2;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#pragma GCC optimize(2)
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<cstring>
#include<bitset>
#include<stack>
#include<time.h>



#define X first
#define Y second
#define PB push_back
#define MP make_pair
#define scd(a) scanf("%d",&a)
#define scdd(a,b) scanf("%d%d",&a,&b)
#define scddd(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define ALL(x) x.begin(),x.end()
#define sz(a) ((int)a.size())
#define getmid ((l+r)>>1)
#define mst(var,val) memset(var,val,sizeof(var))
#define IOS ios::sync_with_stdio(false);cin.tie(0)
#define lowbit(x) x&(-x)
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ls rt<<1
#define rs rt<<1|1
using namespace std;
#ifdef local
#define dbg(args...) cout << #args << " -> ", err(args);
void err(){ cout << endl; }
template<typename T, typename... Args>
void err(T a, Args... args){ cout << a << ' '; err(args...); }
#else
#define dbg(args...)
#endif // local

typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <double, double> pdd;
const int inf=0x3f3f3f3f;
const long long INF=0x3f3f3f3f3f3f3f3fLL;
const double PI=acos(-1.0);
const long double eps=1e-8;
const int mod=1e9+7;
const int MAXN=2e3+100;
const int N=1e6+1000;
const int M=500+10;
const ll mm=(1LL<<32);

template <class T>
inline void read(T &x)
{
    x = 0;
    char c = getchar();
    bool f = 0;
    for (; !isdigit(c); c = getchar())
        f ^= c == '-';
    for (; isdigit(c); c = getchar())
        x = x * 10 + (c ^ 48);
    x = f ? -x : x;
}

template <class T>
inline void write(T x)
{
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    T y = 1;
    int len = 1;
    for (; y <= x / 10; y *= 10)
        ++len;
    for (; len; --len, x %= y, y /= 10)
        putchar(x / y + 48);
}
ll qpow(ll a,ll b,ll mod)
{
    ll ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%mod;
        b>>=1;
        a=(a*a)%mod;
    }
    return ans;
}

ll a[N];
int main()
{
#ifdef local
    freopen("in.txt","r",stdin);
#endif // local
    IOS;cout.tie(0);
    int n,k;cin>>n>>k;
    rep1(i,n) cin>>a[i];

    for(int i=k+1;i<=n;++i)
    {
        if(a[i]>a[i-k]) cout<<"Yes\n";
        else cout<<"No\n";
    }
    return 0;
}


Measured memory_bytes: 5172
#include <stdio.h>
#include <string.h>

int main(){
    int m, h;
    char cards[256], temp[256], result[256];
    int i, j=0, len;

    while(1){
        scanf("%s", cards);
        len=strlen(cards);
        if(strcmp(cards, "-")==0&&len==1)break;
        scanf("%d", &m);
        for(;m>0;m--){
            scanf("%d", &h);
            strcpy(temp, cards);
            for(i=0;i<h;i++){
                cards[len-h+i]=temp[i];
            }
            for(i=0;i<len-h;i++){
                cards[i]=temp[i+h];
            }
        }
        for(i=0;i<len;i++){
            result[j++]=cards[i];
        }
        result[j++]='\n';
    }
    result[j]='\0';
    printf("%s", result);

    return 0;
}


Measured memory_bytes: 2104
object Main {
  def main(args: Array[String]): Unit = {
    val values = io.StdIn.readLine().split(" ").map(_.toInt)
    val w = values(0)
    val h = values(1)
    val x = values(2)
    val y = values(3)
    val r = values(4)

    val answer =
      if (r <= x && x <= w - r && r <= y && y <= h - r) {
        "Yes"
      } else {
        "No"
      }
    println(answer)
  }
}

Measured memory_bytes: 43740
<?php
  list($H, $W) = explode(" ", trim(fgets(STDIN)));

  $x = [];
  for ($i=0; $i<$H; $i++) {
    $x[] = explode(" ", trim(fgets(STDIN)));
  }

  $isL = true;
  $ans = [];

  for ($i=0; $i<$H; $i++) {
    if($isL){
      for ($j=0; $j<$W; $j++) {
        if($x[$i][$j] % 2 == 1){
          if($j != $W-1){
            $x[$i][$j+1]++;
            $ans[] = ($i+1)." ".($j+1)." ".($i+1)." ".($j+2);
          }else{
            if($i != $H-1){
              $x[$i+1][$W-1]++;
              $ans[] = ($i+1)." ".($j+1)." ".($i+2)." ".($j+1);
            }
          }
        }
      }
      $isL = false;
    }else{
      for ($j=0; $j<$W; $j++) {
        if($x[$i][$W-$j-1] % 2 == 1){
          if($j != $W-1){
            $x[$i][$W-$j-2]++;
            $ans[] = ($i+1)." ".($W-$j)." ".($i+1)." ".($W-$j-1);
          }else{
            if($i != $H-1){
              $x[$i+1][0]++;
              $ans[] = ($i+1)." 1 ".($i+2)." 1";
            }
          }
        }
      }
      $isL = true;      
    }
  }

  echo count($ans);
  echo PHP_EOL;
  for ($i=0; $i<count($ans); $i++) {
    echo $ans[$i].PHP_EOL;
  }

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

int main(){
    int a,b,c,t;
    cin >> a >> b >> c;
    if (a < b){
        t = a;
        a = b;
        b = t;
    }
    if (b < c){
        t = b;
        b = c;
        c = t;
    }
    if (a < b){
        t = a;
        a = b;
        b = t;
    }
    cout << b+c;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    string s;
    cin >> s;
    int n = s.length();
    if(s[n-1] == 's') cout << s << "es" << endl;
    else cout << s << "s" << endl;
    return 0;
}

Measured memory_bytes: 3720
#include <bits/stdc++.h>
#define LL long long
#define ULL unsigned long long
#define UI unsigned int
#define mem(i, j) memset(i, j, sizeof(i))
#define rep(i, j, k) for(int i = j; i <= k; i++)
#define dep(i, j, k) for(int i = k; i >= j; i--)
#define pb push_back
#define make make_pair
#define INF 0x3f3f3f3f
#define inf LLONG_MAX
#define PI acos(-1)
#define fir first
#define sec second
#define lb(x) ((x) & (-(x)))
#define dbg(x) cout<<#x<<" = "<<x<<endl;
using namespace std;
const int N = 1e6 + 5;
int n, m, l[N], r[N], cnt[N];
map < int, int > mp;
void solve() {
    scanf("%d %d", &n, &m);
    rep(i, 1, n) scanf("%d %d", &l[i], &r[i]);
    rep(i, 0, m - 1) mp[i] = i;
    cnt[0] = m;
    int ans = 0;
    rep(i, 1, n) {
        l[i]--; r[i]--;
        auto it = mp.lower_bound(l[i]);
        int pos = -1;
        while(it != mp.end() && it->fir <= r[i] + 1) {
            pos = max(pos, it->sec);
            cnt[it->fir - it->sec]--;
            it = mp.erase(it);
        }
        if(pos >= 0 && r[i] + 1 < m) {
            mp[r[i] + 1] = pos; 
            cnt[r[i] + 1 - pos]++;
        }
        while(!cnt[ans] && ans < m) ans++;
        if(ans == m) puts("-1");
        else printf("%d\n", i + ans);
    }
}
int main() {
//    int _; scanf("%d", &_);
//    while(_--) solve();
    solve();
    return 0;
}

Measured memory_bytes: 15180
c = list(input())
ans = []
for i in range(len(c)):
    if c[i] == '0':
        ans.append('0')
    elif c[i] == '1':
        ans.append('1')
    elif len(ans) != 0:
        del ans[-1]
    else:
        continue

print (''.join(ans))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vvi= vector<vi>;
using vs = vector<string>;
using pl = pair<ll,ll>;
#define  rep(i,n) for(ll i = 0; i < (n); ++i)
#define  red(i,n) for(ll i = (n)-1; i >= 0; --i)
#define  all(a)   begin(a),end(a)
#define  pb(a)    push_back(a)
#define  mp(a,b)  make_pair(a,b)
#define  yn(a)    cout << ( (a)?"Yes\n":"No\n" )
inline ll gcd(ll a,ll b) { return b?gcd(b,a%b):a; }
ll INF = 1e9+9, LINF = 1e18;

const int M=10000;

int main(int argc,char* argv[])
{
    int n,sum=0;
    cin>>n;
    int l[n];
    rep(i,n)cin>>l[i],sum+=l[i];
    rep(i,n)if(sum-l[i]<=l[i]) cout<<"No\n",exit(0);
    cout<<"Yes\n";
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  int ans = 0;
  
  for (int i = n;i <= 100003;i++){
    if (i == 2){
      ans = 2;
      break;
    }
    else if (i % 2 == 0){
      continue;
    }
    else{
      bool p = true;
      for (int j = 3;j*j <= i;j += 2){
        if (i % j == 0){
          p = false;
        }
      }
      if (p){
        ans = i;
        break;
      }
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3644
import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt(), b = sc.nextInt();
		
		int ans = a - 1;
		
		System.out.println((b >= a) ? ++ans : ans);
	}

}


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

#define REP(i, start, count) for(int i=(start); i<(int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;

int N, M;
vector<int> A;

int main(void) {
    cin >> N >> M;
    A.assign(M, 0);

    ll sum = 0;
    rep(i, M) {
        cin >> A[i];
        sum += A[i];
    }

    if (sum > N) {
        cout << -1 << endl;
        return 0;
    }

    cout << N - sum << endl;

    return 0;
}

Measured memory_bytes: 3660
a, b, q = gets.chomp.split.map(&:to_i)
s = []
t = []

a.times do |i|
  s[i+1] = gets.to_i
end

b.times do |i|
  t[i+1] = gets.to_i
end

s[0] = -1e18
t[0] = -1e18
s[a+1] = 1e18
t[b+1] = 1e18

s.sort!
t.sort!

q.times do |i|
  x = gets.to_i
  
  b = s.bsearch_index{|z|x<z}
  d = t.bsearch_index{|z|x<z}
  puts [(s[b-1] - x).abs + (s[b-1] - t[d-1]).abs,
   (s[b-1] - x).abs + (s[b-1] - t[d]).abs,
   (s[b] - x).abs + (s[b] - t[d-1]).abs,
   (s[b] - x).abs + (s[b] - t[d]).abs,
   (t[d-1] - x).abs + (s[b-1] - t[d-1]).abs,
   (t[d-1] - x).abs + (s[b] - t[d-1]).abs,
   (t[d] - x).abs + (s[b-1] - t[d]).abs,
   (t[d] - x).abs + (s[b] - t[d]).abs].min
end



Measured memory_bytes: 5820
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main()
{
  int i,j,k;
  int d,D;
  cin >> D;
  ll c[27];
  ll s[D+1][27];
  ll t[27];
  ll sum=0;
  int last[27];
  for(i=0;i<27;i++){
    last[i] = -1;
  }
  
  vector<int> vec;
  for(i=0;i<26;i++){
    cin >> c[i]; 
  }
  for(i=0;i<D;i++){
    for(j=0;j<26;j++){
      cin >> k;
      vec.push_back(k);
      vec[j] -= c[j];
      //cout << vec[j] << endl;
    }
    auto itr = max_element(vec.begin(), vec.end());
    size_t index = std::distance(vec.begin(), itr);
    cout << index+1 << endl;
    vec.clear();
  }
  /*for(i=0;i<D;i++){
    cin >> t[i];
  }*/
  
  for(i=0;i<D;i++){
    d = t[i]-1;
    last[d] = i;
    sum += s[i][d];
    for(j=0;j<26;j++){
      sum -= c[j]*( i-last[j] );
    }
    //cout << sum << endl;
  }
  
  
  return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>


using namespace std;

int main(){
    int A,B,N;
    cin>>N>>A>>B;
    int ans=0;
    for(int i=0;i<N;i++){
        int t;
        cin>>t;
        if(t<A||B<=t)ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){
	int N,K,C; string S;
	cin>>N>>K>>C>>S;

	vector<int> R(N,-1);

	int r_c = 0,  r_pos = 0;
	for(int r=N-1; r>=0; --r){
		if(r_c > 0) r_c--;
		else{
			if(S[r] == 'o'){
				R[r_pos++] = r;
				r_c = C;
			}
		}
	}

	reverse(R.begin(), R.begin() + r_pos);

	if(r_pos > K) return 0; // 働ける日に余裕があると、その日に必ず働く必要がない

	int l_c = 0,  l_pos = 0;
	for(int l=0; l<N; ++l){
		if(l_c > 0) l_c--;
		else{
			if(S[l] == 'o'){
				if(R[l_pos++] == l) cout<< l + 1 <<endl;
				l_c = C;
			}
		}
	}

}

Measured memory_bytes: 2564
N = int(input())
A,B = map(int,input().split())
p = list(map(int,input().split()))
cntA = 0
cntB = 0
cntC = 0

for i in range(N):
    if int(p[i]) <= int(A):
        cntA += 1
    if int(p[i]) >= int(B)+1:
        cntB += 1
    if int(p[i]) >= int(A)+1 and int(p[i]) <= int(B):
        cntC += 1

print(min(cntA,cntB,cntC))


Measured memory_bytes: 3064