akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use itertools_num::ItertoolsNum;
#[allow(unused_imports)]
use proconio::{fastout, input, marker::Bytes, marker::Chars, marker::Isize1, marker::Usize1};
#[allow(unused_imports)]
use std::cmp;
use std::collections::BTreeSet;
#[allow(unused_imports)]
use std::iter;
#[allow(unused_imports)]
use superslice::*;

fn run() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let n: usize = sc.read();
    let xy = sc.read_pairs::<i64>(n);

    let ans = [(1, 1), (1, -1), (-1, 1), (-1, -1)]
        .iter()
        .map(|(cx, cy)| {
            let z = xy.iter().map(|&(x, y)| cx * x + cy * y).collect_vec();
            z.iter().max().unwrap() - z.iter().min().unwrap()
        })
        .max()
        .unwrap();
    println!("{}", ans);
}

fn main() {
    std::thread::Builder::new()
        .name("run".into())
        .stack_size(256 * 1024 * 1024)
        .spawn(run)
        .unwrap()
        .join()
        .unwrap();
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn read_pairs<T: std::str::FromStr>(&mut self, n: usize) -> Vec<(T, T)> {
        (0..n).map(|_| (self.read(), self.read())).collect()
    }
    pub fn read_pairs_1_indexed(&mut self, n: usize) -> Vec<(usize, usize)> {
        (0..n)
            .map(|_| (self.read::<usize>() - 1, self.read::<usize>() - 1))
            .collect()
    }
    pub fn read_chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    pub fn read_char_grid(&mut self, n: usize) -> Vec<Vec<char>> {
        (0..n).map(|_| self.read_chars()).collect()
    }
    pub fn read_matrix<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n)
            .map(|_| (0..m).map(|_| self.read()).collect())
            .collect()
    }
}


Measured memory_bytes: 5608
def Exponential(x):

    ans = 0
    if x == 1:
        ans = 1
    else:
        for i in range(1, x + 1):
            for w in range(2, x + 1):
                if i ** w > x:
                    break
                else:
                    ans = max(ans, i ** w)

    return ans

def main():
    x = int(input())
    print(Exponential(x))

if __name__ == '__main__':
    main()

Measured memory_bytes: 38896
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#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
using namespace std;
using ll = long long;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(int(a), int(b), int(c)) {
	return max(max(a, b), c);
}
int Min(int(a), int(b), int(c)) {
	return min(min(a, b), c);
}





int main() {

	ll N, M=9999999;
	cin >> N;
	vector<ll> v(N);
	rep(i, N) {
		cin >> v.at(i);
	}
	rep(l, 101) {

		ll t = 0;
		rep(j, N) {
			t += (l - v.at(j)) * (l - v.at(j));
		}
		M = min(M, t);
	}
	cout << M << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define all(vec) vec.begin(),vec.end()
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
int main() {
  map<int, int> mp;
  rep(i, 3){
    int s; cin >> s; mp[s]++;
  }
  if(mp[5]==2 && mp[7]==1) cout << "YES" << endl;
  else cout << "NO" << endl;
}


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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  int a, b; cin >> a >> b;
  cout << 6 - a - b << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
	ll n;
	cin>>n;
	ll A,B,C,A1,B1,C1;
	ll a,b,c;
	cin>>a>>b>>c;
	A1=a;
	B1=b;
	C1=c;
	for(ll i=1;i<n;i++)
	{
		cin>>a>>b>>c;
		A=a+max(B1,C1);
		B=b+max(A1,C1);
		C=c+max(A1,B1);
		A1=A;B1=B;C1=C;
	}
	ll x=max(A1,(ll)max(B1,C1));
	cout<<x<<endl;
	return 0;

}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ld long double
#define mp make_pair

void print(vector<auto> &a)
{
    for (int i = 0; i<a.size(); i++) cout<<a[i]<<' ';
    cout<<endl;
}

void get(vector<auto> &a)
{
    for (int i = 0; i<a.size(); i++) cin>>a[i];
}

const ll p = 78294349;

int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    s = s%p;
    if (s<0) s+=p; 
    return s;
}



int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    int n, k;
    cin>>n>>k;
    if (n>=2*k-1) cout<<"YES";
    else cout<<"NO";

    
    
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <iomanip>
using namespace std;
#define rep(i, N) for (ll i = 0; i < (N); i++)
typedef long long ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, k;
    cin >> n >> k;
    ll min3 = n;
    if (n >= k)
    {
        min3 = n % k;
    }
    ll min2 = min3;
    min2 = k - min2;
    min3 = min(min3, min2);
    cout << min3 << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
const int N=1e5+5;
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef map<ll,int>::iterator miter;
int n,p[N+5],pcnt;
bool vis[N+5];
map<ll,int> cnt,calc;
map<ll,ll> inver;
void Init()
{
	for(int i=2;i<=N;i++)
	{
		if(!vis[i])
            p[++pcnt]=i,calc[1ll*i*i]=i;
		for(int j=1;i*p[j]<=N;j++)
		{
			vis[i*p[j]]=true;
			if(i%p[j]==0)
                break;
		}
	}
}
int main()
{
	//freopen("anticube.in","r",stdin);
	//freopen("anticube.out","w",stdout);
	scanf("%d",&n);//
	Init();
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		ll a,tmp,h=1,inv=1;
		scanf("%lld",&a);
		tmp=a;
		for(int j=1;j<=pcnt&&1ll*p[j]*p[j]*p[j]<=a;j++)
			if(tmp%p[j]==0)
			{
				int xcnt=0;
				while(tmp%p[j]==0)
                    tmp/=p[j],xcnt++;
				xcnt%=3;
				int xxcnt=xcnt;
				while(xxcnt--)
                    h*=p[j];
				for(int i=1;i<=(3-xcnt)%3;i++)
                    inv*=p[j];
			}
		if(tmp>1)
		{
			h*=tmp;
			miter it=calc.find(h);
			if(it!=calc.end())
                inv*=it->second;
			else
                inv*=tmp*tmp;
		}
		cnt[h]++;
		inver[h]=inv,inver[inv]=h;
	}
    if(cnt.find(1)!=cnt.end()){
        ans++;
        cnt.erase(1);
    }
	for(miter it=cnt.begin();it!=cnt.end();it++)
		if(cnt.find(inver[it->first])==cnt.end())
            ans+=it->second;
		else
		{
			ans+=max(it->second,cnt[inver[it->first]]);
			it->second=cnt[inver[it->first]]=0;
		}
	printf("%d\n",ans);
}


Measured memory_bytes: 19712
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) < (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007LL
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589


#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}
pll Dir[8] = { //移動
	{ 0 ,1 },{ -1 ,0 },{ 1 ,0 },{ 0 ,-1 },
	{ 1 ,1 },{ 1 ,-1 },{ -1 ,1 },{ -1 ,-1 }
};

//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define INF 10000000000000000LL

struct Edge {
	int from, to;
	ll w;
};
typedef vector<vector<Edge>> Graph;

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



int mod_pow(int x, int n, int mod = MODU) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x %mod;
		x = (ll)x * x%mod;
		n >>= 1;
	}
	return res;
}
int divmod(int a, int b, int m = MODU) { // a/b(mod m)
								  // a/b (mod m)
								  // a*b^-1
								  // b^-1 * b = 1
								  // b^(m-1) = 1 
								  // b^(m-2) * b = 1
								  // b^-1 = b^(m-2)

								  // a/b = a * b^(m-2)

	return (a * 1LL * mod_pow(b, m - 2, m)) % m;
}

int fact[100001];

int factorial(int x) {
	if (x == 0) return fact[x] = 1;

	fact[x] = ((ll)factorial( x - 1) * x)% MODU;
	return fact[x];
}

int Comb(int n, int r) {
	if (n < r) return 0;
	return divmod(fact[n], (ll)fact[n - r] * fact[r]%MODU);
}

signed main(void) {
	int n;
	cin >> n;
	n++;
	vector<int> a(n);

	factorial(n);
	map<int, int> pos;
	int l, r;
	REP(i, n) {
		cin >> a[i];
		if (pos.count(a[i])) {
			l = pos[a[i]];
			r = i;
		}
		else
		{
			pos[a[i]] = i;
		}
	}

	rep(i,1, n + 1) {
		int aa, bb;
		printf("%d\n", ((aa = Comb(n,i)) - (bb = Comb(l + n - r - 1 , i-1)) + MODU) % MODU);
		//cout << "";
	}

	return 0;
}



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

using namespace std;

#define MAX 110
#define INF (1<<29)

int main()
{
    int M, N;
    while (cin >> M >> N, M) {
        int co[MAX][MAX];
        int ti[MAX][MAX];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                co[i][j] = ti[i][j] = INF;                
            }
            co[i][i] = ti[i][i] = 0;
        }
        int a, b, c, t;
        for (int i = 0; i < M; i++) {
            cin >> a >> b >> c >> t;
            a--; b--;
            
            co[a][b] = co[b][a] = c;
            ti[a][b] = ti[b][a] = t;            
        }

        for (int k = 0; k < N; k++) {
            for (int i = 0; i < N; i++) {
                for (int j = 0; j < N; j++) {
                    co[i][j] = min(co[i][j], co[i][k] + co[k][j]);
                    ti[i][j] = min(ti[i][j], ti[i][k] + ti[k][j]);
                }
            }
        }

        int Q, r;
        cin >> Q;
        while (Q--) {
            cin >> a >> b >> r;
            a--; b--;
            if (r == 0) {
                cout << co[a][b] << endl;
            } else {
                cout << ti[a][b] << endl;
            }
        }
    }
    return 0;
}

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

int main() {
    int n;
    cin >> n;
    int max_v = -1000000, min_v = 1000000;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        max_v = max(max_v, a);
        min_v = min(min_v, a);
        sum += a;
    }
    cout << min_v << " " << max_v << " " << sum << endl;

}


Measured memory_bytes: 3088
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

struct edge{ int from,to,cost; };
const int inf=1e9;

int V,E;
edge es[2010];

void bellman_ford(int s)
{   
    vector<int> dist(V,inf); dist[s]=0;
    REP(c,V){
        for(auto e:es){
            if(dist[e.from]==inf) continue;
            if(dist[e.to]>dist[e.from]+e.cost){
                dist[e.to]=dist[e.from]+e.cost;
                if(c==V-1){
                    cout<<"NEGATIVE CYCLE"<<endl;
                    return;
                }
            }
        }
    }
    REP(i,V){
        if(dist[i]==inf) cout<<"INF"<<endl;
        else cout<<dist[i]<<endl;
    }
}

signed main()
{
    int r; cin>>V>>E>>r;
    REP(i,E){
        int s,t,d; cin>>s>>t>>d;
        es[i]=(edge){s,t,d};
    }
    bellman_ford(r);
}



Measured memory_bytes: 3140
#include<iostream>
using namespace std;
int main(){
  long long n,a,b,c,d,e,sum=0,mi;
  cin >> n >> a >> b >> c >> d >> e;
  mi = min(a,min(b,min(c,min(d,e))));
  sum = 4 + n/mi;
  if(n%mi!=0) sum++;
  cout << sum << endl;
}

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

int main(){
	int n,m,d,h,i,j,r,s;
	string str;
	for(;cin>>n,n;cout<<r<<endl){
		vector<int>monster(n);
		for(h=i=0;i<n;i++){
			cin>>monster[i];
			if(h<monster[i])h=monster[i];
		}
		vector<pair<int,int> >_all,_single;
		vector<int>all(h+1),single(h+1);
		for(cin>>i;i--;){
			cin>>str>>m>>str>>d;
			if(d){
				if(str=="All")_all.push_back(make_pair(m,d));
				else _single.push_back(make_pair(m,d));
			}
		}
		for(i=1;i<=h;i++){
			all[i]=9999999;
			single[i]=9999999;
			for(j=0;j<_all.size();j++){
				all[i]=min(all[i],all[max(0,i-_all[j].second)]+_all[j].first);
			}
			for(j=0;j<_single.size();j++){
				single[i]=min(single[i],single[max(0,i-_single[j].second)]+_single[j].first);
			}
		}
		if(all.empty()){
			for(r=j=0;j<monster.size();j++)r+=single[monster[j]];
		//}else if(single.empty()){
		//	r=all[h];
		}else{
			r=9999999;
			for(i=0;i<=h;i++){
				s=all[i];
				for(j=0;j<monster.size();j++)s+=single[max(0,monster[j]-i)];
				if(r>s)r=s;
			}
		}
	}
}

Measured memory_bytes: 1972
using System;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{

    public class Program
    {
        const long MOD = 1000000007;
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            long L = cin.ReadLong;

            double ans = Pow(L/3.0,3);
            WriteLine(ans);
        }


        static long Gcd(long p, long q)
        {
            if (p % q == 0) return q;
            return Gcd(q, p % q);
        }

        public class ConsoleInput
        {
            private readonly System.IO.TextReader _stream;
            private char _separator = ' ';
            private Queue<string> inputStream;
            public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
            {
                this._separator = separator;
                this._stream = stream;
                inputStream = new Queue<string>();
            }
            public string Read
            {
                get
                {
                    if (inputStream.Count != 0) return inputStream.Dequeue();
                    string[] tmp = _stream.ReadLine().Split(_separator);
                    for (int i = 0; i < tmp.Length; ++i)
                        inputStream.Enqueue(tmp[i]);
                    return inputStream.Dequeue();
                }
            }
            public string ReadLine { get { return _stream.ReadLine(); } }
            public int ReadInt { get { return int.Parse(Read); } }
            public long ReadLong { get { return long.Parse(Read); } }
            public double ReadDouble { get { return double.Parse(Read); } }
            public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
            public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
            public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        }

    }
}

Measured memory_bytes: 11220
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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

#define DEBUG

#ifdef DEBUG
#define var_dump(...) fprintf(stdout, __VA_ARGS__)
#define dump(a) cout << a << "\n";
#else
#define var_dump(...) 42
#define dump(a) 42
#endif

typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://beta.atcoder.jp/contests/abc088/tasks/abc088_b

int main() {
    int N; cin >> N;
    int arr[N]; REP(i, N) cin >> arr[i];

    sort(arr, arr+N, greater<int>());

    int alice = 0;
    int bob = 0;
    REP(i, N) {
        if (i % 2 == 0) {
            alice += arr[i];
        } else {
            bob += arr[i];
        }
    }

    cout << alice - bob << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
typedef multiset<ll> S;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
void outs(ll a,ll b){if(a>=inf-100)out(b);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*modpow(a,b-1)%mod;ll k=modpow(a,b/2);return k*k%mod;}
vi dep,par;
vvi g;
vb used;
void ans(ll a,ll b){
    cout<<a+1<<' '<<b+1<<endl;
}
void dfs0(int i,int p,int d){
    par[i]=p;
    dep[i]=d;
    used[i]=true;
    for(ll x:g[i])if(!used[x])dfs0(x,i,d+1);
}
void init(ll n,ll m){
    g=vvi(n);
    dep=vi(n);
    par=vi(n);
    used=vb(n,false);
    rep(i,m){
        ll a,b;cin>>a>>b;a--;b--;
        g[a].pb(b);
        g[b].pb(a);
    }
    dfs0(0,-1,0);
}
int main(){
    ll n,m;cin>>n>>m;
    if(m&1)dame(-1);
    init(n,m);
    vp v(n);
    rep(i,n)v[i]=P(dep[i],i);
    sort(all(v));reverse(all(v));
    vb done(n,false);
    vi c(n);
    rep(i,n){
        ll k=v[i].se;
        done[k]=true;
        for(ll x:g[k])if(!done[x]&&par[k]!=x){
            c[k]++;
            ans(k,x);
        }
        if(c[k]&1)ans(k,par[k]);
        else if(k!=0){
            ans(par[k],k);
            c[par[k]]++;
        }
    }
}

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

const int modi = 998244353;

int main(){
	int n,s;
	cin >> n >> s;
	int a[n];
	for(int i =0;i<n;i++){
		cin >> a[i];
	}
	long long  dp[n+1][s+1];
	long long ans = 0;
	memset(dp,0,sizeof(dp));
	for(int i =0;i<n;i++){
		memcpy(dp[i+1],dp[i],sizeof(dp[0]));
		(dp[i+1][a[i]]+=i+1)%=modi;
		for(int j =0;j+a[i]<=s;j++)
			(dp[i+1][j+a[i]]+=dp[i][j])%=modi;
		(ans+=dp[i+1][s])%=modi;
	}
	cout << ans << endl;
}

Measured memory_bytes: 70656
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

int kitamuraeri(const void* x, const void* y) {
	int a = *(const int*)x, b = *(const int*)y;
	return a < b ? -1 : a > b;
}

int N;
int A[114514];

uint64_t matukimiyu(int sita_saki) {
	uint64_t sukoa = 0;
	int sita = -1, ue = N;
	int mae1, mae2;
	int tugi_sita;
	if (sita_saki) {
		mae1 = mae2 = A[++sita];
		tugi_sita = 0;
	} else {
		mae1 = mae2 = A[--ue];
		tugi_sita = 1;
	}
	while (sita + 2 < ue) {
		if (tugi_sita) {
			sukoa += abs(mae1 - A[sita + 1]);
			sukoa += abs(mae2 - A[sita + 2]);
			mae1 = A[sita + 1];
			mae2 = A[sita + 2];
			sita += 2;
		} else {
			sukoa += abs(mae1 - A[ue - 1]);
			sukoa += abs(mae2 - A[ue - 2]);
			mae1 = A[ue - 1];
			mae2 = A[ue - 2];
			ue -= 2;
		}
		tugi_sita = !tugi_sita;
	}
	if (sita + 1 < ue) {
		int c1 = abs(mae1 - A[sita + 1]);
		int c2 = abs(mae2 - A[sita + 1]);
		sukoa += c1 >= c2 ? c1 : c2;
	}
	return sukoa;
}

int main(void) {
	int i;
	uint64_t asumikana, kugimiyarie;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
	}
	qsort(A, N, sizeof(*A), kitamuraeri);
	asumikana = matukimiyu(0);
	kugimiyarie = matukimiyu(1);
	printf("%" PRIu64 "\n", asumikana >= kugimiyarie ? asumikana : kugimiyarie);
	return 0;
}

/*

8 1 6 2 3

7 5 4 1



4
1 3
5 4
1 4
9 8
3 6

*/

/*

3
1
1
5

*/


Measured memory_bytes: 2268
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;

#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll r;
    cin>>r;
    cout<<r*r<<endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import java.util.function.Consumer;

public class Main {

    static MyScanner sc;
    private static PrintWriter out;
    static long M = 1000000007;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
//        stringBuilder.append("T");
//        for (int i = 0 ; i < 7999  ; i++) {
//            stringBuilder.append("F");
//        }
//        stringBuilder.append(" 0 -7999 ");

        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }


        out = new PrintWriter(new OutputStreamWriter(System.out));
        long t = System.currentTimeMillis();


        solve();
        out.flush();
    }

    private static void solve() {

        out.println(48 - sc.nextInt());

    }


    private static void solveT() {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }


    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextInt();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

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

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

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


}


Measured memory_bytes: 23124
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back 
#define pf push_front 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i,n) for(int i=0;i<(n);i++)
#define All(v) v.begin(),v.end()
typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;


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

  int mi = INF;
  int ma = 0;
  Rep(i, n) {
    int a; cin >> a;
    mi = min(mi, a);
    ma = max(ma, a);
  }

  cout << ma - mi << endl;
}


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

int main() {
  int N;
  cin >> N;
if (N % 1111 < 10) {cout << "Yes" <<endl;
               }
  else if (N % 1111 % 1000 == 0){cout << "Yes" <<endl;
       }
else {cout << "No" <<endl;}
}
                             

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
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; }
using Graph = vector<vector<int>>;
signed main(){
  int a,b;
  cin>>a>>b;
  if(500*a>=b)
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
}

Measured memory_bytes: 256
/**
 *   Author: Praveen Ojha
 *   Created: 27 January 2019
 *   Time: 00:49:24
**/
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
int dp[100005],a[100005];
int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    	cin>>a[i];
    dp[n-1]=0;
    dp[n-2]=abs(a[n-1]-a[n-2]);
    for(int i=n-3;i>=0;i--){
    	dp[i]=min(abs(a[i]-a[i+1])+dp[i+1],abs(a[i]-a[i+2])+dp[i+2]);
    }
    cout<<dp[0]<<"\n";
return 0;
}

Measured memory_bytes: 1024
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		int D = sc.nextInt();
		if(D==25)
			System.out.println("Christmas");
		else if(D==24)
			System.out.println("Christmas Eve");
		else if(D==23)
			System.out.println("Christmas Eve Eve");
		else if(D==22)
			System.out.println("Christmas Eve Eve Eve");

	}
	//以下、自作ライブラリ

	//最大公約数
	public static long gcd(long a, long b) {
		if (a < b)
			return gcd(b, a);
		long c = 0;
		c = a % b;
		if (c == 0)
			return b;
		return gcd(b, c);
	}

	//最小公倍数
	public static long lcm(long m, long n) {
		return m * n / gcd(m, n);
	}

	//素数判定
	public static boolean isPrime(int n) {
		if (n < 2)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;

		for (int i = 3; i * i <= n; i += 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

//以下、高速スキャナークラス
class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

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

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

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

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

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

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

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

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


Measured memory_bytes: 20564
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>istream&operator >>(istream&is,vector<T>&vec){for(T&x:vec)is>>x;return is;}
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
template<class T>inline bool CHMIN(T&a,T b){if(a > b){a = b;return true;}return false;}
template<class T>inline bool CHMAX(T&a,T b){if(a < b){a = b;return true;}return false;}
constexpr int INF = 1e18;



signed main(){
	int A, B, C, D;
	cin >> A >> B >> C >> D;
	vector<int>a = {A, B};
	vector<int>b = {C, D};
	int ans = -INF;
	for(auto e: a) for(auto ee: b) CHMAX(ans, e * ee);
	out(ans);
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;

int main(){
    ll N, K;
    cin >> N >> K;
    ll ans = 0;
    for(ll i = K; i <= N + 1; i++){
        ll min = (i - 1) * i / 2;
        ll max = (2 * N - i + 1) * i /2;
        ll sum = ((max - min + 1) % MOD);
        ans += sum;
        ans %= MOD;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3616
/// kAAzuki Hoshino
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple

int n,a[202020],pre[202020], dp[202020], mp[202020];

signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

cin >> n;
for(int i=1;i<=n;i++){
   cin >> a[i];
   pre[i] = mp[a[i]];
   mp[a[i]]=i;
}
dp[1]=1;
for(int i=2;i<=n;i++){
   if(a[i-1]!=a[i]){
   dp[i] = (dp[i-1]+dp[pre[i]])%mod;
   }
   else dp[i] = dp[i-1]%mod;
}
cout << dp[n]%mod << endl;

return 0;
}
///....


Measured memory_bytes: 6528
#include <iostream>
#define rep(i,n)  for(int i=0; i<n; i++)
#define rrep(i,n)  for(int i=n-1; i>= 0; i--)
using namespace std;
int n;
int *c, *s, *f, *arrival;

int starts(int st, int t){
    if (st == n-1) return t;
    int leave;
    if (t <= s[st]) leave = s[st];
    else leave = s[st] + ((t-s[st])/f[st] + not not((t-s[st])%f[st])) * f[st];
    // cout << st << " " << leave << endl;
    
    if(leave + c[st] <= s[st+1]){
        return arrival[st+1];
    }
    else{
        return starts(st+1, leave + c[st]);
    }
}
        
int main(void){
    cin >> n;
    c = new int[n];
    s = new int[n];
    f = new int[n];
    arrival = new int[n];
    
    rep(i, n-1){
        cin >> c[i] >> s[i] >> f[i];
    }
    s[n-1] = 0;
    
    arrival[n-1] = 0;
    for(int i = n-2; i >= 0; i--){
        arrival[i] = starts(i, 0);
    }
    rep(i, n){
        cout << arrival[i] << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<math.h>
#include<unordered_map>
using namespace std;
typedef long long ll;
const long double pi = 3.14159265358979323846264338327950288;
int main() {
	string a, b, h = "";
	cin >> a >> b;
	for (int i = 0; i < b.size(); i++)
		h = h + a[i] + b[i];
	if (a.size() > b.size()) h += a[a.size() - 1];
	cout << h << endl;
	cin >> h;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <math.h>
#include <map>
#include <queue>
#include <set>
#include <stack>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define debug(x) cout<<x<<endl
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
typedef long long ll;
using namespace std;
const int MAXN=1e5+50;
const int inf=0x3f3f3f3f;
const int mod=1e9+7;
//::iterator it;
ll a[200];
int main()
{
    std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    int n,m;
    cin>>n>>m;
    ll sum=0;
    rep(i,1,n){
        cin>>a[i];
        sum+=a[i];
    }
    int ans=0;
    for(int i=1;i<=n;i++)if(a[i]*4*m>=sum)ans++;
        if(ans>=m)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}
/*

*/

 
 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
#define ll long long
#define mod 100000007
#define rep(i, n) for (int i = 0; i < n; ++i)
using Graph = vector<vector<int>>;
ll lcm(ll a, ll b)
{
    return a * b / __gcd(a, b);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed << setprecision(15);
    ll N;
    cin >> N;
    string S = to_string(N);
    ll digsum = 0;
    for (int i = 0; i < S.size(); i++)
    {
        ll pre = S[i] - 48;
        digsum += pre;
    }
    if(N % digsum == 0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

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

// Author - Kevin Mathew
// Birla Institute of Technology, Mesra

ll N, W, w[110], v[110], dp[110][100010];

void te(){
	cin >> N >> W;
	for(ll i=0;i<N;i++)
		cin >> w[i] >> v[i];

	for(ll i=0;i<=W;i++)
		if(i < w[0])
			dp[0][i] = 0;
		else
			dp[0][i] = v[0];

	for(ll i=1;i<N;i++){
		for(ll j=0;j<=W;j++){
			if(j < w[i])
				dp[i][j] = dp[i-1][j];
			else
				dp[i][j] = max(dp[i-1][j], v[i] + dp[i-1][j-w[i]]);
		}
	}

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

int main()
{
	//freopen("input.txt", "r", stdin);		//Comment
	//freopen("output.txt", "w", stdout);		//this out.
	ios::sync_with_stdio(false);			//Not
	cin.tie(NULL);							//this.
	cout.tie(0);							//or this.

	te();

	return 0;
}

Measured memory_bytes: 80128
#include<bits/stdc++.h>
using std::cout;
using std::cin;
using std::endl;

int main()
{
    int n, count=1, j=0;
    double m;
    std::vector<double> A(10, 0);
    cin >> n;
    while (n!=0)
    {
        int s[n];
        m=0;
        for (int i = 0; i < n; i++)
        {
            cin >> s[i];
            m += s[i];
        }

        m /= (double)n;

        for (int i = 0; i < n; i++)
            A[j] += pow((s[i] - m), 2)/n;
 
        A[j] = sqrt(A[j]);
        cin >> n;
        if (++j==count*10)
        {
            count++;
            A.resize(count*10);
        }
        
    }

    for (int i = 0; i < j; i++)
        cout << std::fixed << std::setprecision(8)
             << A[i] <<endl;

    return 0;
}


Measured memory_bytes: 3236
#include <iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[n];
  	int dp[n];
  	cin>>a[0];
  	cin>>a[1];
  	dp[0]=0;
  	dp[1]=abs(a[0]-a[1]);
  	for(int i=2;i<n;i++){
    	cin>>a[i];
      	dp[i]=min(dp[i-2]+abs(a[i-2]-a[i]),dp[i-1]+abs(a[i-1]-a[i]));
    }
  	cout<<dp[n-1];
}

Measured memory_bytes: 1024
fun main(args: Array<String>) {
    val (x1,y1,x2, y2) = readLine()!!.split(" ").map { it.toInt() }
    val dx = x2 - x1
    val dy = y2 - y1
    println("${x2 - dy} ${y2 + dx} ${x1 - dy} ${y1 + dx} ")
}


Measured memory_bytes: 35988
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    long long int a,b,now,next;
    int cnt=0;
    cin>>a>>b;
    
    now=a;next=a;
    
    while(next<=b){
        now=next;
        next *=2;
        cnt++;
    }
    
    cout<<cnt<<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;

class PathInfo
{
	int dist;
	List<int> edgeList;

	public int Dist
	{
		set {dist = value;}
		get {return dist;}
	}

	public List<int> EdgeList
	{
		get {return edgeList;}
	}

	public PathInfo()
	{
		dist = int.MaxValue;
		edgeList = new List<int>();
	}
}

class Shortest
{
	static public void Main(string[] args)
	{
		int N,M;
		string[] vals;
		vals = Console.ReadLine().Split(' ');
		N = int.Parse(vals[0]);
		M = int.Parse(vals[1]);
		PathInfo[,] pathInfo = new PathInfo[N+1,N+1];
		for(int i=1; i<=N; i++)
		{
			for(int j=1; j<=N; j++)
			{
				pathInfo[i,j] = new PathInfo();
			}
		}
		int a,b,c;
		for(int e=1; e<=M; e++)
		{
			vals = Console.ReadLine().Split(' ');	
			a = int.Parse(vals[0]);
			b = int.Parse(vals[1]);
			c = int.Parse(vals[2]);
			pathInfo[a,b].Dist = c;
			pathInfo[a,b].EdgeList.Add(e);
			pathInfo[b,a].Dist = c;
			pathInfo[b,a].EdgeList.Add(e);
		}
		
		for(int k=1; k<=N; k++)
		{
			for(int i=1; i<=N; i++)
			{
				for(int j=1; j<=N; j++)
				{
					if(pathInfo[i,k].Dist != int.MaxValue && pathInfo[k,j].Dist != int.MaxValue)
					{
						if(pathInfo[i,j].Dist > pathInfo[i,k].Dist + pathInfo[k,j].Dist)
						{
							pathInfo[i,j].Dist = pathInfo[i,k].Dist + pathInfo[k,j].Dist;
							pathInfo[i,j].EdgeList.Clear();
							pathInfo[i,j].EdgeList.AddRange(pathInfo[i,k].EdgeList);
							pathInfo[i,j].EdgeList.AddRange(pathInfo[k,j].EdgeList);
						}
					}
				}
			}
		}
		bool[] used = new bool[M+1];
		for(int i=1; i<=N; i++)
		{
			for(int j=1; j<=N; j++)
			{
				foreach(int e in pathInfo[i,j].EdgeList)
				{
					used[e] = true;
				}
			}
		}
		int notUsedCount = 0;
		for(int e = 1; e<=M; e++)
			if(!used[e])
				notUsedCount++;
		Console.WriteLine(notUsedCount);
	}
}


Measured memory_bytes: 21720
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pii;
typedef vector<pii> vii;
typedef vector<ll> vi;
typedef queue<ll> qi;
typedef queue<char> qc;
typedef queue<string> qs;
typedef vector<char> vc;
typedef vector<string> vs;
typedef map<char,ll> mpci;
typedef map<ll,ll> mpii;
typedef map<string,ll> mpsi;
typedef set<ll> sei;
typedef set<char> sec;
typedef set<string> ses;
typedef stack<ll> si;
typedef stack<char> sc;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<pll> vpll;
typedef vector<pdd> vdd;
typedef unsigned int uint;
typedef long double ld;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vii> vvii;
/*=====================================================================*/
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define sz(a) (int)(a.size())
#define len(a) (int)(a.length())
#define all(s) (s).begin(),(s).end()
#define fi first
#define se second
#define be begin
#define en end
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define forn(i,p,n) for(int i=p;i<n;i++)
#define ford(i,p,n) for(int i=n-1;i>=p;i--)
#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();++i)
#define zero(a) memset(a,0,sizeof(a))
#define number(a,num) memeset(a,num,sizeof(a))

/*=====================================================================*/
inline int read()
{
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}
inline void write(long long x) {
  static long long sta[35];
  long long top = 0;
  do {
    sta[top++] = x % 10, x /= 10;
  } while (x);
  while (top) putchar(sta[--top] + 48);
  puts("");
}
/*======================================================================*/
bool prime(int n)
{
	if(n==0||n==1)
	  return false;
	for(int i=2;i*i<=n;i++)
	  if(n%i==0)
	    return false;
	return true;
}
/*======================================================================*/
const int dx[]={-1,0,1,0};
const int dy[]={0,-1,0,1};
int ans;
/*======================================================================*/
int main()
{
  /*
	ios_base::sync_with_stdio(0);
	cin(tie);
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
  */
  /*====================================================================*/
  int n=read(),k=read();
  string s;
  cin>>s;
  for(int i=0;i<n;i++)
  {
  	if(s[i]==s[i-1])
  	  ans++;
  }
  cout<<min(ans+2*k,n-1);
  return 0;
}

Measured memory_bytes: 512
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;

bool s[200010], t[200010];
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N,a[100010],c1=0,c2= 0, c4 = 0;
	bool ans;
	scanf("%d", &N);
	REP(i, N) {
		scanf("%d", &a[i]);
		if (a[i] % 4 == 0) {
			c4++;
		}else if (a[i] % 2 == 0) {
			c2++;
		}
		else {
			c1++;
		}
	}
	if (c2 > 0) {
		if (c1 <= c4) {
			ans = true;
		}
		else {
			ans = false;
		}
	}
	else {
		if (c1 <= c4 + 1) {
			ans = true;
		}
		else {
			ans = false;
		}
	}
	if(ans)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 640
import java.math.BigDecimal;
import java.util.Scanner;

/**
 * @author yoshizaki
 * ABC 159
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);
        BigDecimal l = new BigDecimal(scanner.nextInt());
        BigDecimal edge = l.divide(new BigDecimal(3), 10, BigDecimal.ROUND_HALF_UP); 
        BigDecimal answer = edge.pow(3);
        System.out.println(answer);
    }
}

Measured memory_bytes: 21844
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	ll n = in(), x = in();
	ll sum = 0;
	vector<ll>m(n); REP(i, n) { m[i] = in(); sum += m[i]; }
	sort(ALL(m));
	cout << n + (x - sum) / m[0] << endl;
}

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

using namespace std;

#define int long long
#define ll long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl



signed main() {

	int N, w[101];
	cin >> N;
	int s = 0;
	rep(i, N) {
		cin >> w[i];
		s += w[i];
	}

	int ans = INF;
	for (int t = 0; t < N-1; t++) {
		int tmp = 0;
		for (int i = 0; i <= t; i++)
			tmp += w[i];
		ans = min(ans, abs(tmp - (s - tmp)));
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256