akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(){
	int X; cin >> X;
	for(int i = 0; i <= 1000; i++){
		int n = X - 100 * i; 
		if(n >= 0 && n <= 5*i){
			cout << 1 << endl; return 0; 
		}
	}
	cout << 0 << endl; 
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
int tri[10][10];

int main()
{
//	cut here before submit 
//	freopen ("testcase.WB", "r", stdin );
	string str = "";
	while (cin >> str ){
		memset (tri, 0, sizeof (tri ) );		
		rep (j, 10 ){
			tri[0][j] = (int)(str[j] - '0' );
		} // end rep
		for (int i = 1; i < 10; i++ ){
			for (int j = 0; j < 10-i; j++ ){
				tri[i][j] = (tri[i-1][j] + tri[i-1][j+1] ) % 10;
			} // end for
		} // end for
/*
		rep (i, 10 ){
			rep (j, 10 ){
				cerr << setw(2) << tri[i][j];
			} // end rep
			cerr << endl;
		} // end rep
*/
		cout << tri[9][0] << endl;
	} // end loop

//	printf ("%d\n", res );
		
	return 0;
}

Measured memory_bytes: 1188
#include<iostream>
using namespace std;
int main(){
    long long x;
    cin >> x;
    int find =  1;
    long long j = x;
    while(find){
        find =0;
        for(long long i=2;i<j;i++){
            if(j%i == 0) {find =1;j++;break;}
        }
    }
    cout << j <<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {

            int N= int.Parse(Console.ReadLine());
            string[] Input_ID = Console.ReadLine().Split(' ');
            int[] ID = Input_ID.Select(int.Parse).ToArray();
            int[] Buka = new int[N];

            for (int i = 0; i < ID.Length; i++)
            {
                Buka[ID[i] - 1]+=1; 
            }
            for(int i = 0; i < Buka.Length; i++)
            {
                Console.WriteLine(Buka[i]);
            }
        }
    }
}

Measured memory_bytes: 43652
import sys
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

S = LS2()

if not (S.count('C') == 1 and S[0] == 'A' and S[1] != 'C' and S[-1] != 'C'):
    print('WA')
    exit()
else:
    for i in range(1,len(S)):
        if not (S[i] == 'C' or S[i].islower()):
            print('WA')
            exit()
print('AC')


Measured memory_bytes: 61584
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,ans=0;
    double x,y,d;
    cin>>n>>d;
    while(n--)
    {
        cin>>x>>y;
        if(sqrt(x*x+y*y)<=d)
        ans++;
    }
    cout<<ans;
}


Measured memory_bytes: 3772
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint ungigned
#define db double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define vi vector<int>
#define vpi vector<pii >
#define IT iterator

#define PB push_back
#define MK make_pair
#define LB lower_bound
#define UB upper_bound
#define BG begin
#define ED end

#define For(i,j,k) for (int i=(j);i<=(int)k;i++)
#define Rep(i,j,k) for (int i=(j);i>=(int)k;i++)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));

#define LS3 k*2,l,mid
#define RS3 k*2+1,mid+1,r
#define LS5 k*2,l,mid,x,y
#define RS5 k*2+1,mid+1,r,x,y
#define GET pushdown(k);int mid=(l+r)/2
using namespace std;

const int BAS[5]={233,666,1234,19260817,2017};
const int mo=998244353;
const int N=250005;
struct wzp{
	int a[5];
	bool operator <(const wzp &x)const{
		For(i,0,4)
			if (a[i]!=x.a[i])
				return a[i]<x.a[i];
		return 0;
	}
	bool operator ==(const wzp &x)const{
		For(i,0,4)
			if (a[i]!=x.a[i])
				return 0;
		return 1;
	}
};
int P[5][N*2];
wzp hsh[N];
int pos[N];
long long ans;
map<wzp,int> mp;
char s[N];
int power(int x,int y){
	int s=1;
	for (;y;y/=2,x=1ll*x*x%mo)
		if (y&1) s=1ll*s*x%mo;
	return s;
}
int main(){
	For(i,0,4){
		P[i][0]=1;
		For(j,1,2*N-1)
			P[i][j]=1ll*P[i][j-1]*BAS[i]%mo;
	}
	int beg=N,l; pos[0]=N;
	scanf("%d%s",&l,s+1);
	for (int i=1;i<=l;i++){
		hsh[i]=hsh[i-1];
		if (s[i]=='+') For(j,0,4) hsh[i].a[j]=(hsh[i].a[j]+P[j][beg])%mo;
		if (s[i]=='-') For(j,0,4) hsh[i].a[j]=(hsh[i].a[j]+mo-P[j][beg])%mo;
		if (s[i]=='<') beg--; if (s[i]=='>') beg++; pos[i]=beg;
	}
	for (int i=0;i<=l;i++)
		mp[hsh[i]]++;
	for (int i=0;i<l;i++){
		wzp rpos=hsh[l]; mp[hsh[i]]--;
		For(j,0,4) rpos.a[j]=1ll*rpos.a[j]*power(BAS[j],(mo-1)+pos[i]-pos[0])%mo;
		For(j,0,4) rpos.a[j]=(rpos.a[j]+hsh[i].a[j])%mo;
		ans+=mp[rpos];
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 47360
#include<iostream>
using namespace std;
int main(){
  int a,b,c,d;cin>>a>>b>>c>>d;
  while(1){
  	c-=b;if(c<=0) { cout << "Yes" <<  endl; return 0; }
    a-=d;if(a<=0) { cout << "No" << endl; return 0; }
  }
  return 0;
}  


Measured memory_bytes: 3580
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <string>
#include <tuple>
#include <vector>
#include <set>
#include <map>
#include <iterator>
#include <random>
#include <cmath>

using namespace std;
using lint = long long int;

int main() {
	lint a, b, r, x, tmp;
	cin >> a >> b;

	x = a * b;

	/* 自然数 a > b を確認・入替 */
	if (a < b) {
		tmp = a;
		a = b;
		b = tmp;
	}

	/* ユークリッドの互除法 */
	r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}

	cout << x / b;

	return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <math.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
ll n,k,ans;
int main(void){
    cin>>n>>k;
    if(k%2==0&&n>=k/2){
        ll x=(n-k/2)/k+1;
        ans+=x*x*x;
    }
    ll y=n/k;
    ans+=y*y*y;
    cout<<ans<<endl;
    
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	// TLE
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			int[] a = new int[n];
			int max = 0;
			for (int i = 0; i < n; i++) {
				a[i] = sc.nextInt();
				max = Math.max(a[i], max);
			}
			int[] cnt = new int[max + 1];
			boolean pairwise = true;
			boolean setwise = false;
			int tmpgcd = a[0];
			for (int i = 0; i < n; i++) {
				if (!setwise) {
					tmpgcd = gcd(tmpgcd, a[i]);
					if (tmpgcd == 1) {
						setwise = true;
					}
				}
				if (pairwise) {
					int tmpa = a[i];
					int tmpsq = (int) Math.sqrt((double) a[i]);
					for (int j = 2; j <= tmpsq; j++) {
						boolean ok = false;
						while (tmpa % j == 0 && pairwise) {
							ok = true;
							tmpa /= j;
						}
						if (ok) {
							cnt[j]++;
							if (cnt[j] > 1) {
								pairwise = false;
								break;
							}
						}
						if (tmpa == 1) {
							break;
						}
					}
					if (tmpa != 1) {
						cnt[tmpa]++;
						if (cnt[tmpa] > 1) {
							pairwise = false;
						}
					}
				}
			}
			if (pairwise) {
				System.out.println("pairwise coprime");
			} else {
				if (setwise) {
					System.out.println("setwise coprime");
				} else {
					System.out.println("not coprime");
				}
			}
		}
	}

	public static int gcd(int a, int b) {
		if (b == 0) {
			return a;
		} else {
			return gcd(b, a % b);
		}
	}
}

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> ii;

const int N = 2e5 + 5;

int n, cnt;
int s, a[N], bit[N];
long long sum, lmao[N];

int readInt(){
	bool minus1=false;
	int result=0;
	char ch;
	ch=getchar();
	while (true) {
		if(ch=='-') break;
		if(ch>='0'&&ch<='9') break;
		ch=getchar();
	}
	if(ch=='-') minus1=true;
	else result=ch-'0';
	while(true){
		ch=getchar();
		if(ch<'0'||ch>'9')
            break;
		result=result*10+(ch-'0');
	}
	if(minus1)
		return -result;
	else
		return result;
}

vector<long long> vec;

int mymap[N];

void update(int pos) {
    while(pos <= N) {
        bit[pos] += 1;
        pos += pos & (-pos);
    }
}

int get(int pos) {
    int ans = 0;
    while(pos > 0) {
        ans += bit[pos];
        pos -= pos & (-pos);
    }
    return ans;
}

pair<long long, int> c[N];

int main() {
    n = readInt();
    s = readInt();
    c[0].fi = 0, c[0].se = 0;
    for(int i = 1; i <= n; i++) {
        a[i] = readInt();
        lmao[i] = a[i];
        lmao[i] += lmao[i - 1];
        c[i].fi = lmao[i] - 1ll * i * s;
        c[i].se = i;
    }
    sort(c, c + 1 + n);
    mymap[c[0].se] = ++cnt;
    for(int i = 1; i <= n; i++) {
        if(c[i].fi != c[i - 1].fi)
            mymap[c[i].se] = ++cnt;
        else
            mymap[c[i].se] = cnt;
    }
    int y = mymap[0];
    update(y);
    for(int i = 1; i <= n; i++) {
        int x = mymap[i];
        sum += get(x);
        update(x);
    }
    printf("%lld\n", sum);
}


Measured memory_bytes: 7296
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    int n;cin>>n;
    if(n>=1000)cout<<"ABD"<<endl;
    else cout<<"ABC"<<endl;
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007


void update(int& l, int& r, char c, char cl, char cr, int turn, int ma) {
	if (turn == 0) {
		if (c == cl)l++;
		if (c == cr)r--;
	}
	else {
		if (c == cl)r++;
		if (c == cr)l--;
	}
	l = min(max(l, 0), ma);
	r = min(max(r, 0), ma);
}

int main() {
	int h,w, n;
	scanf("%d%d%d", &h, &w, &n);
	int y, x;
	scanf("%d%d", &y, &x);
	y--, x--;
	string s, t;
	cin >> s >> t;
	int p = 0, q = w;
	for(int i=n-1; i>=0; i--) {
		update(p, q, t[i], 'L', 'R', 1, w);
		update(p, q, s[i], 'L', 'R', 0, w);
		if (p >= q) {
			printf("NO\n");
			return 0;
		}
	}
	if (!(p <= x && x < q)) {
		printf("NO\n");
		return 0;
	}
	p = 0, q = h;
	for (int i = n - 1; i >= 0; i--) {
		update(p, q, t[i], 'U', 'D', 1, h);
		update(p, q, s[i], 'U', 'D', 0, h);
		if (p >= q) {
			printf("NO\n");
			return 0;
		}
	}
	if (!(p <= y && y < q)) {
		printf("NO\n");
		return 0;
	}
	printf("YES\n");
	return 0;
}

Measured memory_bytes: 776
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int a,b,c,f=0;
	cin>>a>>b;
	multiset<int>s[100];
	r(i,b){
		cin>>c>>f;
		s[c].insert(f);
		s[f].insert(c);
	}
	r(i,a)cout<<s[i+1].size()<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n;
long long f[87];
int main()
{
    cin>>n;
    f[0]=2;
    f[1]=1;
    for(int i=2;i<=n;i++)
        f[i]=f[i-1]+f[i-2];
    cout<<f[n];
    return 0;
}

Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
template<class T, class... U> void DEBUG(const T &head, const U &... tail) { 
#ifdef HOME
    _W('#'); _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...);
#endif
}
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int N,K; R(N,K);
    LL an=0;
    FOR(b,K+1,N){
        for(int i=0;i+K<=N;i+=b){
            an+=min(i+b-1,N)-max(1,i+K)+1;
        }
    }
    W(an);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include <cmath>
#include <limits>
#include<set>
#include <iomanip>
#include <queue>
#include <map>
#include <string>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long ll;
typedef long double ld;
const long long INF=(1LL<<62);
const double inf=pow(10,10);
double pi=3.141592653589793;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
const ll MOD = 1000000007;
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
}

class Point{
public:
	ll x,y;
};

int main(){
	init();
	ll N,K;cin>>N>>K;
	ll ans=1;
	for(int i=0;i<N;i++){
		ans=min(ans*2,ans+K);
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c, d = LI()
    print(max(a * b, c * d))
    return

#B
def B():
    _ = II()
    s = S()
    d = {}
    d["I"] = 1
    d["D"] = -1
    ans = 0
    now = 0
    for i in s:
        now += d[i]
        ans = max(ans, now)
    print(ans)
    return

#C
def C():
    def primes2(n):
        """https://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n/3035188#3035188"""
        """ Returns  a list of primes < n """
        sieve = [True] * (n//2)
        for i in range(3,int(n**0.5)+1,2):
            if sieve[i//2]:
                sieve[i*i//2::i] = [False] * ((n-i*i-1)//(2*i)+1)
        return [2] + [2*i+1 for i in range(1,n//2) if sieve[i]]
    n = II()
    prime = primes2(n+1)
    d = defaultdict(int)
    for i in prime:
        b = n
        while b:
            b = b // i
            d[i] += b
            d[i] %= mod
    ans = 1
    for i in d.values():
        ans *= (i + 1)
        ans %= mod
    print(ans)
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    C()


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

char memo[101][101];
int h,w;
void fruit(int a,int b,char c);

int main(){
  while(1){
    int t=0;/*
    for(int i=0;i<101;i++){
      for(int j=0;j<101;j++){
	memo[i][j]='Q';
      }
      }*/
    cin >> h >> w;
    if(w==0&&h==0)break;
    for(int i=0;i<h;i++){
      cin >> memo[i];
    }
    
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	if(memo[i][j]!='1'){
	  fruit(i,j,memo[i][j]);
	  t++;
	}
      }
    }
    cout << t << endl;
  }
}

void fruit(int i,int j,char c){
  if( i>=0 && j>=0 && i<h && j<w && memo[i][j]==c){
    memo[i][j]='1';
    /*if(c==memo[i+1][j])*/ fruit(i+1,j,c);
    /*if(c==memo[i-1][j])*/ fruit(i-1,j,c);
    /*if(c==memo[i][j+1])*/ fruit(i,j+1,c);
    /*if(c==memo[i][j-1])*/ fruit(i,j-1,c);
    return;
  }
  return;
}

Measured memory_bytes: 1480
#define _CRT_NONSTDC_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>
#include <set>
#include <map>
#include <numeric>
#include <deque>

#define NL << endl

using namespace std;
using ll = long long;
using ull = unsigned long long;
const int INTMAX = numeric_limits<int>::max();
const int INTMIN = numeric_limits<int>::min();
const ll LLMAX = numeric_limits<long long>::max();
const ll LLMIN = numeric_limits<long long>::min();
const int MOD = 1000000007;
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

using namespace std;



signed main() {
	vector<pair<ll, int>> v(4);
	for (int i = 0; i < 4; i++)	cin >> v[i].first;
	v[0].second = 1;
	v[1].second = 2;
	v[2].second = 4;
	v[3].second = 8;
	sort(v.begin(), v.end(), [](pair<ll, int> o1, pair<ll, int> o2) {return (double)o1.first / o1.second < (double)o2.first / o2.second; });
	ll N;
	cin >> N;
	N *= 4;

	ll ans = 0;
	for (int i = 0; i < 4; i++) {
		ans += N / v[i].second * v[i].first;
		N %= v[i].second;
	}

	cout << ans NL;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n,M,m;
    cin >> n;
    int R[n];
    cin >> R[0];
    cin >> R[1];
    if(R[0]>R[1]){
        m=R[1];
    }else{
        m=R[0];
    }
    M=R[1]-R[0];
    for(int i=2;i<n;i=i+1){
        cin >> R[i];
        if(R[i]<m){
            m=R[i];
        }
        if(R[i]-m>=R[i-1]-m&&M<=R[i]-m){
            M=R[i]-m;
        }
//        cout << R[i] <<endl;
    }
    cout << M <<endl;
    
}



Measured memory_bytes: 3864
N,X = map(int, input().split())
t = [0]*(N+1)
h = [0]*(N+1)
h[0]=1
t[0]=1
for i in range(1, N+1):
    h[i]=2*(h[i-1])+3
    t[i]=2*(t[i-1])+1
def find(n, x):
    if n==0:
        return 0 if x<=0 else 1
    elif x<=1+h[n-1]:
        return find(n-1, x-1)
    else:
        return t[n-1]+1+find(n-1, x-2-h[n-1])
print(find(N,X))


Measured memory_bytes: 3064
#include<cstdio>
#include<algorithm>
using namespace std;
#define MAXN 200010
#define LG 25
int R[LG][MAXN],L[LG][MAXN],fl[4194304],fr[4194304];
int V[LG],cnt,X[MAXN],lg,tot,n,x[MAXN];
void Min(int &x,int y)
{
	if(x>y) x=y;
}
void Max(int &x,int y)
{
	if(x<y) x=y;
}
int main()
{
	scanf("%d%d",&n,&V[0]);
	for(int i=1;i<=n;i++)
		scanf("%d",&x[i]);
	while(V[lg])
		V[++lg]=V[lg-1]/2;
	for(int i=0;i<=lg;i++)
	{
		int ls=0;
		for(int j=2;j<=n+1;j++)
			if(x[j]-x[j-1]>V[i]||j==n+1)
			{
				for(int k=ls;k<j-1;k++)
					L[i][k]=j-1;
				for(int k=ls+2;k<=j;k++)
					R[i][k]=ls+1;
				ls=j-1;
				if(i==0) X[++cnt]=j-1;
			}
	}
	if(cnt>lg+1)
	{
		for(int i=1;i<=n;i++)
			printf("Impossible\n");
		return 0;
	}
	tot=1<<(lg+1);
	for(int i=0;i<tot;i+=2)
		fr[i]=n+1;
	for(int i=0;i<tot;i+=2)
		for(int j=1;j<=lg;j++)
			if((i&(1<<j))==0)
			{
				Max(fl[i|(1<<j)],L[j][fl[i]]);
				Min(fr[i|(1<<j)],R[j][fr[i]]);
			}
	for(int i=1;i<=cnt;i++)
	{
		bool flag=0;
		for(int j=0;j<tot;j+=2)
			if(fl[j]>=X[i-1]&&fr[tot-j-2]<=X[i]+1)
			{
				flag=1;
				break;
			}
		for(int j=X[i-1]+1;j<=X[i];j++)
			if(flag) printf("Possible\n");
			else printf("Impossible\n");
	}
}

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


int main(){
    ll A, B, K; cin >> A >> B >> K;
    if(A + B <= K){
        cout << 0 << " " << 0 << endl;
    }
    else{
        if(A <= K){
            cout << 0 << " " << A + B - K << endl;
        }
        else{
            cout << A - K << " " << B << endl;
        }
    }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int A, B, K, last, i;
    cin >> A >> B >> K;
    last = 0;
    i = A;

    while (i < A + K && i <= B)
    {
        cout << i << endl;
        i++;
    }

    last = i - 1;

    i = B - K + 1;
    while (i <= B)
    {
        if (last < i)
            cout << i << endl;
        i++;
    }

    return 0;
}

Measured memory_bytes: 256
n,y = map(int,input().split())
u = [10000,5000,1000]
x = []
for i in range(0,n+1):
    for j in range(0,n-i+1):
        w = n-i-j
        if u[2]*i+u[1]*j+u[0]*w == y:
              x = [w,j,i]
              break

if len(x) == 0:
    print("-1 -1 -1")
else:
    print(" ".join(map(str,x)))


Measured memory_bytes: 3064
// 基本テンプレート
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

const int SIZE = 1010;
int N, D, cnt[SIZE][SIZE];

vector< vector<int> > get_table(int target) {
    vector< vector<int> > res(2*D+2, vector<int>(2*D+2));

    for(int i=0; i<D; i++) {
        for(int j=0; j<D; j++) {
            if(cnt[i][j] > target) {
                res[i+1  ][j+1  ]++;
                res[i+1+D][j+1+D]++;
                res[i+1  ][j+1+D]++;
                res[i+1+D][j+1  ]++;
            }
        }
    }

    for(int i=0; i<=2*D; i++) {
        for(int j=0; j<=2*D; j++) {
            res[i][j+1] += res[i][j];
        }
    }

    for(int j=0; j<=2*D; j++) {
        for(int i=0; i<=2*D; i++) {
            res[i+1][j] += res[i][j];
        }
    }

    return res;
}

int get_sum(const vector< vector<int> >& sum, int lx, int ly, int rx, int ry) {
    int res = 0;
    res += sum[rx][ry] + sum[lx][ly];
    res -= sum[lx][ry] + sum[rx][ly];
    return res;
}

signed main() {
    cin >> N >> D;

    for(int i=0; i<N; i++) {
        int x, y; cin >> x >> y;
        x %= D, y %= D;
        cnt[x][y]++;
    }

    int ansA = -1, ansB = -1;
    for(int i=0; i<D; i++) {
        for(int j=0; j<D; j++) {
            int deg = 0;
            for(; (deg+1)*(deg+1)<cnt[i][j]; ) deg++;
            ansA = max(ansA, deg);
        }
    }

    vector< vector<int> > sum1 = get_table((ansA + 1) * (ansA + 1));
    vector< vector<int> > sum2 = get_table( ansA * ansA );
    vector< vector<int> > sum3 = get_table((ansA + 1) * ansA);

    int ub = D-1, lb = -1;
    while(ub - lb > 1) {
        int b = (ub + lb) / 2;
        bool can = false;

        // (i, j) が正方形の左下
        for(int i=0; i<D; i++) {
            for(int j=0; j<D; j++) {
                bool ok = true;
                ok &= (get_sum(sum1, i    , j    , i+b+1, j+b+1) == 0);
                ok &= (get_sum(sum3, i+b+1, j    , i+D  , j+b+1) == 0);
                ok &= (get_sum(sum3, i    , j+b+1, i+b+1, j+D  ) == 0);
                ok &= (get_sum(sum2, i+b+1, j+b+1, i+D  , j+D  ) == 0); 
                
                can |= ok;
            }
        }

        if(can) ub = b;
        else lb = b;
    }
    ansB = ub;

    cout << ansA * D + ansB << endl;
    return 0;
}


Measured memory_bytes: 102272
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int x;
  cin >> x;
  if (x >= 400 && x<600)
  {
  	cout << "8\n";
  }
  else
    if (x >= 600 && x<800)
  	{
  		cout << "7\n";
  	}
  else
    if (x >= 800 && x<1000)
  	{
  		cout << "6\n";
  	}
  else
    if (x >= 1000 && x<1200)
  	{
  		cout << "5\n";
  	}
  else
    if (x >= 1200 && x<1400)
  	{
  		cout << "4\n";
  	}
  else
    if (x >= 1400 && x<1600)
  	{
  		cout << "3\n";
  	}
  else
    if (x >= 1600 && x<1800)
  	{
  		cout << "2\n";
  	}
  else
    if (x >= 1800 && x<2000)
  	{
  		cout << "1\n";
  	}
  return 0 ;
}

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

int main(){

    // 入力
    int N, K; cin>>N>>K;
    vector<long> A(N);
    for (int n=0; n<N; n++) cin>>A[n];

    // bit全探索
    long ans = 1.0e+16;
    for (int ptn=0; ptn<(1<<N); ptn++){
        
        // 1がK以下のptnを弾く
        int tmp_cnt =0;
        for (int n=0; n<N; n++){
            if ( (ptn>>n)&1 ) tmp_cnt++;
        }
        if (tmp_cnt!=K) continue;
        
        // 探索
        long tmp_cost=0;
        vector<long> A_tmp = A;
        for (int n=1; n<N; n++){
            if (A_tmp[n-1] > A_tmp[n]) A_tmp[n] = A_tmp[n-1];
            if ( !((1<<n)&ptn) ) continue;
            if (A_tmp[n-1] < A_tmp[n]) continue;
            A_tmp[n] ++;
            tmp_cost += A_tmp[n] - A[n];
        }
        ans = min(ans, tmp_cost);
    }
    cout << ans << endl;
}

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

long long f(long long n, long long x){
  if(n >= 0){
    return n / x + 1;
  }
  return 0;
}

int main(){
  long long a,b,x;
  cin >> a >> b >> x;
  cout << f(b,x) - f((a-1),x) << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
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 dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////

// o->xにした時、k日も働けなくなる日を探す

int main() {
    int n, k, c; cin >> n >> k >> c;
    string s; cin >> s;
    vector<int> left(n+1), right(n+1);
    int rev = -c-1;
    rep(i,n) {
        if (s[i]=='o' && i-rev > c) {
            left[i+1] = left[i]+1;
            rev = i;
        } else {
            left[i+1] = left[i];
        }
        // cout << left[i+1] << endl;
    }
    rev = n+c;
    repr(i,n-1) {
        if (s[i]=='o' && rev-i > c) {
            right[i] = right[i+1]+1;
            rev = i;
        } else {
            right[i] = right[i+1];
        }
        // cout << right[i] << endl;
    }

    rep(i,n) {
        if (left[i]+right[i+1] < k) {
            cout << i+1 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3332
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	ans := sum(atoi(nextLine()))
	if ans > 21 {
		fmt.Println("bust")
	} else {
		fmt.Println("win")
	}
}

func nscan(n int, val ...interface{}) {
	for _, ptr := range val {
		fmt.Scan(ptr)
	}
}

func nextLine() []string {
	sc.Scan()
	a := strings.Split(sc.Text(), " ")
	return a
}

func atoi(a []string) []int {
	b := make([]int, len(a))
	for i := range b {
		b[i], _ = strconv.Atoi(a[i])
	}
	return b
}

func atof(a []string) []float64 {
	b := make([]float64, len(a))
	for i := range b {
		b[i], _ = strconv.ParseFloat(a[i], 64)
	}
	return b
}

func scanSlice2(n int) ([]int, []int) {
	a := make([]int, n)
	b := make([]int, n)
	for i := 0; i < n; i++ {
		nscan(2, &a[i], &b[i])
	}
	return a, b
}

func scanFloatSlice2(n int) ([]float64, []float64) {
	a := make([]float64, n)
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		nscan(2, &a[i], &b[i])
	}
	return a, b
}

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

func abs(a int) int {
	if a > 0 {
		return a
	}
	return -a
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func larger(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func largest(a, b, c int) (lgst int) {
	if a > b {
		lgst = a
	} else {
		lgst = b
	}
	if c > lgst {
		lgst = c
	}
	return
}

func smaller(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func smallest(a, b, c int) (slst int) {
	if a < b {
		slst = a
	} else {
		slst = b
	}
	if c < slst {
		slst = c
	}
	return
}

func sum(a []int) int {
	var ans int
	for i := range a {
		ans += a[i]
	}
	return ans
}

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

func yesOrNo(b bool) string {
	if b {
		return "Yes"
	}
	return "No"
}

func yesorNO(b bool) string {
	if b {
		return "YES"
	}
	return "NO"
}

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

int main(){
    ll n;
    cin>>n;
    ll count=0;
    ll tmp=10;
    if(n%2!=0) count=0;
    else{
        while(n>=tmp){
            count+=n/tmp;
            tmp*=5;
        }
    }
    cout<<count<<endl;
}

Measured memory_bytes: 256
C = input()
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(len(alpha)) :
    if C == alpha[i] :
        print(alpha[i+1])
        break

Measured memory_bytes: 3060
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#include <bitset>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main(){
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	ll i, n, least = LL_INF;
	cin >> n;
	vector<ll> a(n);
	for (i = 0; i < n; i++) cin >> a[i];
	for (i = 1; i < n; i++) a[i] += a[i - 1];
	for (i = 0; i < n - 1; i++) least = min(least, abs(a[n - 1] - 2 * a[i]));
	cout << least << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
const int N = 1000000;

int main() {
    int K, X;
    cin >> K >> X;
    
    if (N - X + 1 < K) {
        for (int i = 0; i < K+N-X; ++i) {
            printf("%d\t", X-K+1+i);
        }
    } else if (X + N + 1 < K) {
        for (int i = 0; i < K+X+N; ++i) {
            printf("%d\t", -N+i);
        }
    } else {
        for (int i = 0; i < 2*K-1; ++i) {
            printf("%d\t", X-K+1+i);
        }
    }
    return 0;
}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

#include <x86intrin.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) x.begin(), x.end()

#define mp make_pair
#define in insert
#define er erase
#define con continue
#define pb push_back
#define sc scanf
#define pr printf
#define ub upper_bound
#define lb lower_bound
#define s second
#define f first
#define int long long

const long long infl = 1e18; 
const int N = 3e5 + 300, N2 = 2e3, inf = 1e9 + 200;

set <int> S;
vector <int> g;
int n, m, k;
int a[N];
string ss;

int ch(int x)
{
	int reqd = 0;
	vector<int> v;
	for(int i = 1; i <= n; i++)
	{
		int cur = a[i] % x;
		v.push_back(cur);
	}
	sort(v.begin(), v.end());
	int l = 0, r = v.size() - 1;
	int rem = 0;
	while(l <= r)
	{
		if(rem <= 0)
		{
			rem += v[l];
			reqd += v[l];
			l++;
		}
		else
		{
			rem -= (x - v[r]);
			reqd += (x - v[r]);
			r--;
		}
	}
	if(reqd > 2 * k)
		return 0;
	if(rem != 0)
		return 0;
	return 1;
}

main (){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> k;
	int sum = 0;
	for (int i = 1; i <= n; i++){
		cin >> a[i];
		sum += a[i];
	}
	sort(a + 1, a + n + 1);
	int mx = 0;
	for (int i = 1; i * i <= sum; i++){
		if(sum % i == 0 && ch(i)) mx = max(i, mx);
		if(sum % (sum / i) == 0 && ch(sum / i)) mx = max(sum / i, mx);
	}
	cout << mx;
	return 0;
}












Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
#define INF __INT32_MAX__
#define LINF __LONG_LONG_MAX__

int main() {
    int Q;
    cin >> Q;
    vi L(Q), R(Q);
    rep(i, Q) {
        cin >> L[i] >> R[i];
    }

    const int QMAX = 100001;

    vi x(QMAX);
    for (int i = 2; i < QMAX; i++) {
        x[i] += x[i - 1];

        if (i % 2 == 0) {
            continue;
        }

        bool ok = true;

        for (int j = 2; j <= sqrt(i); j++) {
            if (i % j == 0) {
                ok = false;
                break;
            }
        }
        int ii = (i + 1) / 2;
        if (((ii * 2 - 1) == i) && ok) {
            for (int j = 2; j <= sqrt(ii); j++) {
                if (ii % j == 0) {
                    ok = false;
                    break;
                }
            }
        }

        if (ok) {
            x[i]++;
        }
    }

    rep(i, Q) {
        cout << (x[R[i]] - x[L[i] - 1]) << endl;
    }
}

Measured memory_bytes: 4196
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;

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

    ll n, m;
    cin >> n >> m;
    vector<ll> h(n);
    rep(i, n) cin >> h[i];

    vector<vector<ll>> g(n);
    map<ll, ll> highest;
    rep(i, m){
        ll a, b;
        cin >> a >> b;

        --a;
        --b;
        g[a].push_back(b);
        g[b].push_back(a);
        
        highest[a] = max(highest[a], h[b]);
        highest[b] = max(highest[b], h[a]);
    }

    ll res = 0;
    rep(i, n){
        if(h[i] > highest[i]) ++res;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 16108
N,K=map(int,input().split())
X=[int(i) for i in input().split()]
ans=10**18
for i in range(N-K+1):
    ans=min(ans,abs(X[i])+abs(X[i+K-1]-X[i]))
    ans=min(ans,abs(X[i+K-1])+abs(X[i+K-1]-X[i]))
print(ans)

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

void searchCompartment(int x, int y, int h, int w, char** field) {
    char ch = field[y][x];
    field[y][x] = '0';
    for (int nx = x - 1; nx <= x + 1; nx += 2) {
        if (0 <= nx && nx < w && field[y][nx] == ch) {
            searchCompartment(nx, y, h, w, field);
        }
    }
    for (int ny = y - 1; ny <= y + 1; ny += 2) {
        if (0 <= ny && ny < h && field[ny][x] == ch) {
            searchCompartment(x, ny, h, w, field);
        }
    }
}

int main() {
    while (true) {
        int h, w;
        cin >> h >> w;
        if (h == 0 && w == 0) {
            break;
        }
        char** field = new char* [h];
        for (int i = 0; i < h; i++) {
            field[i] = new char [w + 1];
        }
        for (int i = 0; i < h; i++) {
            cin >> field[i];
        }
        int count = 0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if (field[i][j] != '0') {
                    searchCompartment(j, i, h, w, field);
                    count++;
                }
            }
        }
        cout << count << endl;
        for (int i = 0; i < h; i++) {
            delete[] field[i];
        }
        delete[] field;
    }
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <ctime>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <queue>
#include <utility>
#include <cmath>
using namespace std;

int n;
typedef pair<int, int> P;
P pole[3005];
bool field[5005][5005];

int main(){
	while(1){
		scanf("%d", &n);
		if(n == 0){
			break;
		}
		int ans = 0;
		fill(pole, pole+3005, P(0, 0));
		for(int i = 0; i < 5005; i++){
			for(int j = 0; j < 5005; j++){
				field[i][j] = false;
			}
		}
		for(int i = 0; i < n; i++){
			scanf("%d%d", &pole[i].first, &pole[i].second);
			field[pole[i].first][pole[i].second] = true;
		}
		sort(pole, pole+n);
		/*for(int i = 0 ; i < n; i++){
			printf("%d %d  ", pole[i].first, pole[i].second);
		}
		printf("\n");
		for(int y = 9; y >= 0; y--){
			for(int x = 0; x < 9; x++){
				if(field[x][y]){
					printf("P ");
				}else{
					printf(". ");
				}
			}
			printf("\n");
		}*/
		for(int i = 0; i < n; i++){
			for(int j = i+1; j < n; j++){
				if(i == j){
					continue;
				}
				P p1 = pole[i];
				P p2 = pole[j];
				P p3 = P(p1.first - (p2.second - p1.second), p1.second + (p2.first - p1.first));//3???????????????
				P p4 = P(p2.first - (p2.second - p1.second), p2.second + (p2.first - p1.first));//4???????????????
				if(p3.first >= 0 && p3.first < 5000 && p3.second >= 0 && p3.second < 5000 && p4.first >= 0 && p4.first < 5000 && p4.second >= 0 && p4.second < 5000 && field[p3.first][p3.second] && field[p4.first][p4.second]){//3, 4????????????????????????????????§??????????????¨???????????????????????§??????
					ans = max(ans, ((p2.second - p1.second) * (p2.second - p1.second) + (p2.first - p1.first) * (p2.first - p1.first)));
				}
				p3 = P(p1.first + (p2.second - p1.second), p1.second - (p2.first - p1.first));//??????(p1,p2)????????????????????´???????????????????????§???
				p4 = P(p2.first + (p2.second - p1.second), p2.second - (p2.first - p1.first));
				if(p3.first >= 0 && p3.first < 5000 && p3.second >= 0 && p3.second < 5000 && p4.first >= 0 && p4.first < 5000 && p4.second >= 0 && p4.second < 5000 && field[p3.first][p3.second] && field[p4.first][p4.second]){
					ans = max(ans, ((p2.second - p1.second) * (p2.second - p1.second) + (p2.first - p1.first) * (p2.first - p1.first)));
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 27692
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main(){
	int n;
	cin >> n;
	double x[n], y[n], r[n];
	for(int i = 0; i < n; i++){
		double x1, y1, x2, y2, x3, y3;
		double a, b, c, d, e, f;
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
		a = 2*(x1-x2);
		b = 2*(y1-y2);
		c = 2*(x2-x3);
		d = 2*(y2-y3);
		e = x1*x1-x2*x2+y1*y1-y2*y2;
		f = x2*x2-x3*x3+y2*y2-y3*y3;
		x[i] = (d*e-b*f)/(a*d-b*c);
		y[i] = (a*f-c*e)/(a*d-b*c);
		r[i] = sqrt((x[i]-x1)*(x[i]-x1)+(y[i]-y1)*(y[i]-y1));
		//if((int)floor(r[i]*10000)%10 > 4){
		//	r[i] = r[i] + 0.001;
		//}
	}
	for(int i = 0; i < n; i++){
		cout <<  fixed << setprecision(3) << x[i] << " " << y[i] << " " << r[i] << endl;
	}
}

Measured memory_bytes: 1288
import java.util.*;

public class Main {
	static int[][] paper = new int[14][14];
	static int count , max;

	static void draw ( int x , int y , int paturn ) {
		x += 2;
		y += 2;
		if ( paturn >= 1 ) {
			paper[x][y]++;
			paper[x+1][y]++;
			paper[x][y+1]++;
			paper[x-1][y]++;
			paper[x][y-1]++;
		} if ( paturn >= 2 ) {
			paper[x+1][y+1]++;
			paper[x+1][y-1]++;
			paper[x-1][y+1]++;
			paper[x-1][y-1]++;
		} if ( paturn >= 3 ) {
			paper[x+2][y]++;
			paper[x-2][y]++;
			paper[x][y+2]++;
			paper[x][y-2]++;
		}
		count = 0;
		for ( int i = 2; i < 12; i++ ) {
			for ( int j = 2; j < 12; j++ ) {
				if ( paper[i][j] == 0 ) count++;
				if ( paper[i][j] > max ) max = paper[i][j];
			}
		}
	}

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in).useDelimiter("\\D");
		while ( sc.hasNext() ) {
			try {
				int x = sc.nextInt();
				int y = sc.nextInt();
				int p = sc.nextInt();
				draw(y,x,p);
			} catch ( java.util.InputMismatchException e ) {}
		}
		System.out.println(count+"\n"+max);
	}
}

Measured memory_bytes: 0
#![allow(non_snake_case)]
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let S:Vec<char> = sc.chars();
    let T:Vec<char> = sc.chars();
    let q:usize = sc.read();
    let mut query:Vec<Vec<usize>> = vec![];
    for _ in 0..q{
        let v: Vec<usize> = sc.vec(4);
        query.push(v);
    }
    let mut Saccumurate: Vec<usize> = vec![0];
    let mut Taccumurate: Vec<usize> = vec![0];
    for i in 0..S.len(){
        if S[i] == 'A'{
            Saccumurate.push(2);
        }else{
            Saccumurate.push(1);
        }
    }
    for i in 0..T.len(){
        if T[i] == 'A'{
            Taccumurate.push(2);
        }else{
            Taccumurate.push(1);
        }
    }
    for i in 0..S.len(){
        Saccumurate[i+1] += Saccumurate[i];
    }

    for i in 0..T.len(){
        Taccumurate[i+1] += Taccumurate[i];
    }
    for i in 0..q{
        if (Saccumurate[query[i][1]] - Saccumurate[query[i][0]-1])%3 == (Taccumurate[query[i][3]] - Taccumurate[query[i][2]-1])%3{
            println!("YES");
        }else{
            println!("NO");
        }
    }
    

}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
        .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}




Measured memory_bytes: 14844
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <map>
#include <cstdio>
#include <cstdlib>

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;

int main(void){
    int n; cin >> n;
    cin.ignore();

    while(n --){
        string in; getline(cin, in);
     
        while(1){
            int diff;
            if(!~(diff = in.find("Hoshino"))) break;
            in.replace(diff, 7, "Hoshina");
        }
        cout << in << endl;
    }

    return 0;
}

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

int main(){
    
    int n, m;
    cin >> n;
    string s[n];
    for(int i = 0; i < n; i++) cin >> s[i];
    cin >> m;
    string t[m];
    for(int i = 0; i < m; i++) cin >> t[i];

    vector<int> ans(n, 0);
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(s[i] == s[j]){
                ans[i]++;
            }
        }
    }
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if(s[i] == t[j]){
                ans[i]--;
            }
        }
    }
    sort(ans.begin(), ans.end(), greater<int>());
    if(ans[0] < 0) cout << '0' << endl;
    else cout << ans[0] << endl;
    return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 0; i < n; ++i)
#define rep3(i, a, b) for (ll i = a; i < b; ++i)
#define rep4(i, a, b, c) for (ll i = a; i < b; i += c)
#define erep(n) for (ll i = 0; i <= n; ++i)
#define erep2(i, n) for (ll i = 0; i <= n; ++i)
#define erep3(i, a, b) for (ll i = a; i <= b; ++i)
#define erep4(i, a, b, c) for (ll i = a; i <= b; i += c)
#define rrep(i, a, b) for (ll i = a; i > b; --i)
#define rrep2(i, a, b, c) for (ll i = a; i > b; i -= c)
#define errep(i, a, b) for (ll i = a; i >= b; --i)
#define errep2(i, a, b, c) for (ll i = a; i >= b; i -= c)
#define print(a) cout << a << endl;
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define cin(x) cin >> x;
inline int newline() { putchar('\n'); return 0; }

int main() {
    ll n, r;
    cin(n);
    cin(r);

    if (n < 10) {
        r += 100 * (10 - n);
    }

    print(r);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  char c;
  cin >> c;
  string s = "aeiou";
  REP(i, 5){
    if(c == s[i]){
      cout << "vowel" << endl;
      return 0;
    }
  }
  cout << "consonant" << endl;
  return 0;
}

Measured memory_bytes: 256