akhauriyash/Code-Regression huggingface dataset:
paper = Array.new(16,0)
0.upto(15) {|x| paper[x] = Array.new(16,0) }
while gets
  data = $_.chomp.split(',').map {|x| x.to_i}
  x,y,size = data[0], data[1], data[2]
  case size
  when 1
    (x+2).upto(x+4) {|i| paper[i][y+3] += 1}
    paper[x+3][y+2] += 1; paper[x+3][y+4] += 1
  when 2
    (x+2).upto(x+4) {|j| (y+2).upto(y+4) {|k| paper[j][k] += 1}}
  when 3
    (x+2).upto(x+4) {|j| (y+2).upto(y+4) {|k| paper[j][k] += 1}}
    paper[x+1][y+3] += 1
    paper[x+5][y+3] += 1
    paper[x+3][y+1] += 1
    paper[x+3][y+5] += 1
  end  
end

max = paper.flatten.max
tile_num = 0
3.upto(12) {|p| 3.upto(12) {|q| tile_num += 1 if paper[p][q] == 0}}

puts tile_num,max

Measured memory_bytes: 6136
#include <bits/stdc++.h>
using namespace std;
#define arep(i, x, n) for (int i = int(x); i < (int)(n); i++)
#define rep(i, n) for (long long i = 0; i < n; ++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9 + 7
using ll = long long;

int main(){
    ll n;
    ll x;

    cin >> n >> x;

    vector<ll> a(n);
    rep(i, n){
        cin >> a[i];
    }

    sort(a.begin(), a.end());

    ll cnt = 0;
    rep(i, n){
        x -= a[i];

        if(x < 0){
            break;
        }else{
            cnt++;
        }
    }

    if(x > 0){
        cnt = cnt - 1;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 3616
import java.util.*;

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

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


		if(a <= 8 && b <= 8){
			System.out.println("Yay!");
		} else {
			System.out.println(":(");
		}

	}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
  int x;
  cin >> x;
  if(x>=30){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3596
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#define rep(index,num) for(int index=0;index<num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-15
typedef long long ll;
using namespace std;
typedef pair<int,int> pint;
int main(){
	int N,A[200000];
	ll Asum[200001];
	ll xorsum[200001];
	ll kosusum=0;
	int lnow=0,rnow=1;
	scan(N);
	Asum[0]=0;
	xorsum[0]=0;
	rep(i,N){
		scan(A[i]);
		Asum[i+1]=Asum[i]+A[i];
		xorsum[i+1]=(xorsum[i]^A[i]);
	}
	while(lnow<N){
		if(rnow<N&&Asum[rnow+1]-Asum[lnow]==(xorsum[rnow+1]^xorsum[lnow])){
			rnow++;
		}
		else{
			kosusum+=rnow-lnow;
			lnow++;
		}
	}
	prin(kosusum);
	return 0;
}


Measured memory_bytes: 4224
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)

	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	im := IntMap{}
	for i := 0; i < n; i++ {
		a := getNextInt(scanner)
		im.increment(a % 4)
	}

	ans := "No"
	if im.get(0) >= im.get(1)+im.get(3) {
		ans = "Yes"
	}

	if im.get(0)+1 == im.get(1)+im.get(3) && im.get(2) == 0 {
		ans = "Yes"
	}

	fmt.Fprintln(writer, ans)

	writer.Flush()
}

// IntMap ...
type IntMap map[int]int

func (m IntMap) get(key int) int {
	if _, ok := m[key]; ok {
		return m[key]
	}
	return 0
}
func (m IntMap) increment(key int) {
	if _, ok := m[key]; ok == false {
		m[key] = 0
	}
	m[key]++
}


Measured memory_bytes: 2688
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include<cstdint>
#include<unordered_map>
//#include<boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < ( int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define F first
#define S second


//namespace mp = boost::multiprecision;

//using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;


int main() {
	vector<int>an(5);
	rep(i, 5) {
		cin >> an[i];
	}
	int k; cin >> k;
	bool ans = true;
	rep(i, 5) {
		rep(j, 5) {
			if (abs(an[i] - an[j]) > k) {
				ans = false;
			}
		}
	}
	if (ans) {
		cout << "Yay!" << endl;
	}
	else {
		cout << ":(" << endl;
	}
}


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

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    int answer = 0;
    for (;; ++answer)
    {
        for (int j = 0; j < n; ++j)
        {
            if (a[j] % 2 != 0)
            {
                cout << answer << endl;
                return 0;
            }
            else
            {
                a[j] /= 2;
            }
        }
    }
    return 1;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
char s[MAXN], t[MAXN];
map<char, int> mapping = {{'L', 0}, {'R', 1}, {'U', 2}, {'D', 3}};
int cntS[MAXN][4], cntT[MAXN][4];
pair<int, int> intersect(pair<int, int> a, pair<int, int> b){
	return {max(a.first, b.first), min(a.second, b.second)};
}
int h, w, n;
bool ok(vector<pair<int, int>> intervals, int st, bool lr, int c){
	/*printf("n = %d\n", n);
	printf("intervals = ");
	for(auto &x : intervals) printf("(%d, %d) ", x.first, x.second);
	printf("\n");
	printf("st = %d\n", st);
	printf("lr = %d\n", lr);*/
	if(st < intervals[0].first || st > intervals[0].second) return false;
	pair<int, int> nx = {st, st};
	for(int i = 1; i <= n - 1; i += 1){
		int d = 0;
		if(lr){
			if(t[i] == 'L') d = -1;
			else if(t[i] == 'R') d = 1;
		} else {
			if(t[i] == 'D') d = 1;
			else if(t[i] == 'U') d = -1;
		}
		pair<int, int> pos_nx;
		if(d == -1) pos_nx = {nx.first - 1, nx.second};
		else if(d == 1) pos_nx = {nx.first, nx.second + 1};
		else pos_nx = nx;
		pair<int, int> should = intersect({1, c}, intersect(intervals[i], pos_nx));
		if(should.second < should.first) return false;
		nx = should;
	}
	return true;
}
int val[MAXN];
int lr_itrv[MAXN], rl_itrv[MAXN], ud_itrv[MAXN], du_itrv[MAXN];	
int lr_val(char c){
	if(c == 'L') return -1;
	else if(c == 'R') return 1;
	else return 0;
}
int ud_val(char c){
	if(c == 'U') return -1;
	else if(c == 'D') return 1;
	else return 0;
}
int main(){
	scanf("%d %d %d", &h, &w, &n);
	int r, c;
	scanf("%d %d", &r, &c);
	scanf("%s", s + 1);
	scanf("%s", t + 1);
	vector<pair<int, int>> intervals;
	int total = 0, mn = 0;
	for(int i = 1; i <= n; i += 1){
		val[i] = (s[i] == 'L') - (t[i - 1] == 'R');
	}
	for(int i = n; i >= 1; i -= 1){
		lr_itrv[i] = (s[i] == 'L') + total - mn;
		total += val[i];
		mn = min(mn, total);
	}
	for(int i = 1; i <= n; i += 1){
		val[i] = (s[i] == 'R') - (t[i - 1] == 'L');
	}
	total = 0, mn = 0;
	for(int i = n; i >= 1; i -= 1){
		rl_itrv[i] = (s[i] == 'R') + total - mn;
		total += val[i];
		mn = min(mn, total);
	}
	for(int i = 1; i <= n; i += 1){
		intervals.push_back({1 + lr_itrv[i], w - rl_itrv[i]});
	}
	if(!ok(intervals, c, true, w)) return 0 * puts("NO");
	intervals.clear();
	total = 0, mn = 0;
	for(int i = 1; i <= n; i += 1){
		val[i] = (s[i] == 'U') - (t[i - 1] == 'D');
	}
	for(int i = n; i >= 1; i -= 1){
		ud_itrv[i] = (s[i] == 'U') + total - mn;
		total += val[i];
		mn = min(mn, total);
	}
	for(int i = 1; i <= n; i += 1){
		val[i] = (s[i] == 'D') - (t[i - 1] == 'U');
	}
	total = 0, mn = 0;
	for(int i = n; i >= 1; i -= 1){
		du_itrv[i] = (s[i] == 'D') + total - mn;
		total += val[i];
		mn = min(mn, total);
	}
	for(int i = 1; i <= n; i += 1){
		intervals.push_back({1 + ud_itrv[i], h - du_itrv[i]});
	}
	if(!ok(intervals, r, false, h)) return 0 * puts("NO");
	return 0 * puts("YES");
}

Measured memory_bytes: 9812
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define _GLIBCXX_DEBUG
static const int MAX = 100000;
double x[10][10];

int main(){
  int N, D, count = 0;
  double d = 0;
  cin >> N >> D;
  rep(i, N){
    rep(j, D){
      cin >> x[i][j];
    }
  }
  for(int i = 0; i < N; i++){
    for(int j = i+1; j < N; j++){
      double d = 0;
      rep(k, D){
        d += (x[i][k] - x[j][k])*(x[i][k]- x[j][k]);
      }
      d = sqrt(d);
      if((int)d == d) count++;
    }
  }

  cout << count << endl;
}

Measured memory_bytes: 256
let () =
  let n = read_int () in
  let ans = ref min_int in
  let m = ref (read_int ()) in
  for _ = 1 to n - 1 do
    let r = read_int () in
    if !ans < (r - !m) then ans := r - !m;
    if r < !m then m := r;
  done;
  Printf.printf "%d\n" !ans

Measured memory_bytes: 4452
#include<stdio.h>
#include<algorithm>
using namespace std;
long long ans=1,n,cnt=0;
int main()
{
    scanf("%lld",&n);
    if(n&1||n<10)
    {
        printf("0");
        return 0;
    }
    while(n>=10)
    {
        cnt+=n/10;
        n/=5;
    }
    printf("%lld",cnt);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <chrono> 
 
using namespace std;
using namespace std::chrono; 
 
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")
// #pragma optimization_level 3
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define f0r(a, b) for (long long a = 0; a < (b); ++a)
#define f1r(a, b, c) for (long long a = (b); a < (c); ++a)
#define f0rd(a, b) for (long long a = (b); a >= 0; --a)
#define f1rd(a, b, c) for (long long a = (b); a >= (c); --a)
#define ms(arr, v) memset(arr, v, sizeof(arr))
#define pb push_back
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define fix(prec) {cout << setprecision(prec) << fixed;}
#define mp make_pair
#define f first
#define s second
#define all(v) v.begin(), v.end()
#define getunique(v) {sort(all(v)); v.erase(unique(all(v)), v.end());}
#define readgraph(list, edges) for (int i = 0; i < edges; i++) {int a, b; cin >> a >> b; a--; b--; list[a].pb(b); list[b].pb(a);}
#define ai(a, n) for (int ele = 0; ele < n; ele++) cin >> a[ele];
#define ain(a, lb, rb) for (int ele = lb; ele <= rb; ele++) cin >> a[ele];
#define ao(a, n) {for (int ele = 0; ele < (n); ele++) { if (ele) cout << " "; cout << a[ele]; } cout << '\n';}
#define aout(a, lb, rb) {for (int ele = (lb); ele <= (rb); ele++) { if (ele > (lb)) cout << " "; cout << a[ele]; } cout << '\n';}
#define vsz(x) ((long long) x.size())
typedef long long ll;
typedef double ld;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
 
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
  cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
 
mt19937 rng(steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */
 
void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
 
const lld pi = 3.14159265358979323846;
// const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;
 

 
ll n, m, k, q, l, r, x, y, z;
ll a[1000005];
ll b[1000005];
ll c[1000005];
string s, t;
ll ans = 0;


 
void solve(int tc) {
  cin >> n;
  cout << 10 - (n / 200) << '\n';
}
 
int main() {
  send help
 
  // usaco("cowland");
 
  int tc = 1;
  // cin >> tc;
  for (int t = 0; t < tc; t++) solve(t);
} 

Measured memory_bytes: 3664
#include<iostream>
#include<string>

using namespace std;

int main() {
	int M;
	cin >> M;
	int D;
	cin >> D;
	int ans = 0;
	for (int i = 1; i <= M; i++)
	{
		int D1 = 0;
		int D2 = 0;
		for (int j = 1; j <= D; j++) {
			D1 = j / 10;
			D2 = j % 10;
			if (D1 * D2 == i && D1 >=2 && D2 >= 2) {
				ans++;
			}
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl;
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)
#define INF INT_MAX/2


ll dist[303030];
int main() {
	memset(dist, -1, sizeof(dist));
	int n, m;
	cin >> n >> m;
	vector<int>e[101010];
	rep(i, 0, m) {
		int u, v;
		cin >> u >> v;
		u--, v--;
		e[u].pb(v);
	}
	int s, t;
	cin >> s >> t;
	s--, t--;

	queue<int>q;
	q.push(3 * s);
	dist[3 * s] = 0;
	while (q.size()) {
		int tp = q.front();
		q.pop();
		int now = tp / 3;
		int curl = tp % 3;
		fore(x, e[now]) {
			int to = 3 * x + ((curl+1) % 3);
			if (dist[to] == -1) {
				q.push(to);
				dist[to] = dist[tp] + 1;
 			}
		}
	}

	if (dist[3 * t] == -1) {
		puts(-1);
	}
	else {
		puts(dist[3*t]/3);
	}


	return 0;
}


Measured memory_bytes: 8064
#define _CRT_SECURE_NO_WARNINGS
 
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
 
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? (-(a)) : (a))
 
typedef long long ll;
 
using namespace std;
 
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
 
	bool contain = false;
 
	int N;
	ll sum = 0;
 
	scanf("%d", &N);
	
	for (int i = 1; i <= N; ++i)
	{
		if (i % 3 && i % 5) sum += i;
	}
 
	printf("%lld\n", sum);
 
	return 0;
}

Measured memory_bytes: 3848
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x ,n) for(int i = x; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main(){
    int n,l;
    int ap=INF;
    int ans=0;
    cin >> n >> l;
    rep2(i,l,n+l){
        ans+=i;
        if(abs(ap)>abs(i))ap=i;
    }

    cout << ans-ap;


	return 0;
}

Measured memory_bytes: 3636
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] array = splitInt(sc.nextLine(), " ");
		int[] result = new int[10];
		result[0] = array[0]*array[2]-array[1];
		for(int i=1; i<10; i++) {
			result[i] = result[i-1]*array[0]-array[1];
		}
		for(int a:result) {
			System.out.println(a);
		}
		
	}
	public static int[] splitInt(String str, String split) {
		String[] array = str.split(split);
		int[] array2 = new int[array.length];
	
		for(int i=0; i<array.length; i++) {
				array2[i] = Integer.parseInt(array[i]);
		}
		return array2;
	}
}

Measured memory_bytes: 22100
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const ll INF = LLONG_MAX/3;

/*-----Library-----*/

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; }

struct UnionFind {
    vector<int> par; // 親ノード
    vector<int> rank; // ランク
    vector<int> sizeuf; //要素数
    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n); rank.resize(n); sizeuf.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
            sizeuf[i]=1;
        }
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        sizeuf[x]+=sizeuf[y];
        return true;
    }

    int size(int x){
        return sizeuf[root(x)];
    }
};

long long gcd(long long a,long long b){
    if(b==0)return a;
    return gcd(b,a%b);
}

long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}
//コンビネーション
/*
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 */
/*-----Library-----*/
const int MOD=1234567;
signed main(){
	int n,a,b;
	cin>>n>>a>>b;
	int s=n/6;
	if(s%2==1){
		a=-a;
		b=-b;
	}
	int t=n%6;
	rep(i,t){
		if((i+1)%2==1){
			a=a-b;
		}else{
			b=a+b;
		}
	}
	cout<<a<<" "<<b<<endl;
}



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

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)


int N;
string s;

int dp[5005][5005];

int rec(int l, int r) {
    if (s[l] != s[r]) return 0;
    if (dp[l][r] != -1) return dp[l][r];
    return dp[l][r] = min({r - l, 1 + rec(l - 1, r - 1)});
}


int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    cin >> N >> s;
    memset(dp, -1, sizeof dp);
    int ans = 0;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            ans = max(ans, rec(i, j));
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 98176
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cstring>
#include <cmath>
#include <climits>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define io() ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define fi first
#define se second
#define IN(i,l,r) (l<i&&i<r)
#define LINR(i,l,r) (l<=i&&i<=r)
#define LIN(i,l,r) (l<=i&&i<r)
#define INR(i,l,r) (l<i&&i<=r)
#define v(T) vector<T>
#define p(T, N) pair<T, N>
#define tp(A, B, C) tuple<A, B, C>
#define ii p(int, int)
#define vi v(int)
#define vii v(p(int, int))
#define vvi v(v(int))
#define vl v(long long)
#define vll v(p(long long, long long))
#define si set<int>
#define msi map<string, int>
#define rsz(a) resize(a)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define qsort(a) sort(all(a))
#define qsortd(a) sort(all(a), greater<>())
#define qsortf(a, f) sort(all(a), f)
#define qsortsi(v) sort(v.begin(), v.end(), [](pair<int, int> a, pair<int, int> b){return a.se < b.se;})
#define pb(n) push_back(n)
#define eb(n) emplace_back(n)
#define pp(a, b) emplace_back(make_pair(a, b))
#define pt(a, b, c) emplace_back(make_tuple(a, b, c))
#define elif else if
#define fori(i, n) for(ll i = 0; i < n; ++i)
#define foris(i, a, b) for(ll i = a; i < b; ++i)
#define forise(i, a, b) for(ll i = a; i <= b; ++i)
#define ford(i, n) for(ll i = n; i >= 0; --i)
#define fords(i, a, b) for(ll i = a; i >= b; --i)
#define fordse(i, a, b) for(ll i = a; i > b; --i)
#define fora(i, a) for (auto &i: a)
#define rev(a) reverse(a.begin(), a.end())
#define revf(a, b, c) (reverse(a.begin() + b, a.begin() + c))
#define umap unordered_map
#define uset unordered_set
#define pq(T) priority_queue<T>
#define rpq(T) priority_queue<T, vector<T>, greater<T> >
#define nl '\n'
#define fileio(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
const int mod = 1000000007;
int digits(int n) {
  n = abs(n);
  if(n < 10) return 1;
  elif(n < 100) return 2;
  elif(n < 1000) return 3;
  elif(n < 10000) return 4;
  elif(n < 100000) return 5;
  elif(n < 1000000) return 6;
  elif(n < 10000000) return 7;
  elif(n < 100000000) return 8;
  elif(n < 1000000000) return 9;
  else return 10;
}

double exval(int n) {
  double ret = (double)(n);
  ret -= 1.0;
  ret /= 2;
  ret += 1.0;
  return ret;
}

int main() {
  io();
  
  int n, k;
  cin >> n >> k;
  v(double) arr;
  
  double total = 0;
  double maxtotal = 0;
  
  fori(i, n) {
    int a;
    cin >> a;
    double val = exval(a);
    arr.pb(val);
    total += val;
    if(i - k >= 0) total -= arr[i-k];
    maxtotal = max(maxtotal, total);
  }
  
  cout << fixed << setprecision(10) << maxtotal;
  
  return 0;
}

Measured memory_bytes: 2420
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

const int MOD = 1e9+7;

const int MAX = 100010;
int a[MAX], b[MAX];
int h[MAX];
int N;


int main() {
    cin >> N; 
    for (int i = 0; i < N; ++i) cin >> a[i];
    for (int i = 0; i < N; ++i) cin >> b[i];
    if (N == 1) {
        if (a[0] != b[0])
            cout << 0 << endl;
        else cout << 1 << endl;
        return 0;
    }
    long long result = 1;

    for (int i = 1; i < N; ++i) {
        if (a[i] > a[i-1]) {
            h[i] = a[i];
            if (b[i] < a[i]) { cout << 0 << endl; return 0;}
        }
    }

    for (int i = N-2; i >= 0; --i) {
        if (b[i] > b[i+1]) {
            h[i] = b[i];
            if (a[i] < b[i]) { cout << 0 << endl; return 0;}
        }
    }

    for (int i = 1; i < N-1; ++i) {
        if (!h[i]) {
            result = (result * min(a[i], b[i])) % MOD;
        }
    }

    cout << result << endl;
    return 0;
}


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

#define pb push_back
#define fi first
#define se second
#define ll long long
#define pq priority_queue
#define mp make_pair
#define pii pair<int,int>

const int mod=1e9+7;
const int N=100010;
int lowbit(int x) {return x&(-x);}

ll dp[N][5] ;
int flag[N] ;
vector <int> e[N] ;
int n ;
ll ans ;

void dfs(int k, int fat) {
	if (e[k].size()== 1 && e[k][0] == fat) { // leaves
		dp[k][0] = dp[k][1] = 1 ;
		return ;
	}
	ll x = 1, y = 1 ;
	for (int i = 0; i < e[k].size(); i++) {
		int to = e[k][i] ; if (to == fat) continue ;
		dfs(to, k) ;
		x = (x * (dp[to][0] + dp[to][1]) % mod) % mod ;
		y = y * dp[to][0] % mod;
	}
	dp[k][0] = x, dp[k][1] = y ;
}


signed main(){
	scanf("%d", &n) ;
	for (int i = 1, x, y; i < n; i++) {
		scanf("%d%d", &x, &y) ;
		e[x].pb(y) ; e[y].pb(x) ;
		flag[y] = 1 ;
	}
	int root = 0 ;
	for (int i = 1; i <= n; i++) if (!flag[i]) {
		root = i ;
		break ;
	}
	dfs(root, -1) ;
	ans = (dp[root][0] + dp[root][1]) % mod ;
	printf("%lld\n", ans) ;
}

Measured memory_bytes: 15360
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int main(){
	int a,b;cin>>a>>b;
	if(a>=13){
		cout<<b<<endl;
	}
	else if(a>=6){
		cout<<b/2<<endl;
	}
	else puts("0");
}

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

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

  cin >> n >> x;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  sort(a.begin(), a.end());
  vector<int> b(n);

  for (int i = 0; i < n; i++) {
    b[i] = min(x, a[i]);
    x -= b[i];
  }

  b.back() += x;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += (a[i] == b[i]);
  }
  cout << ans << '\n';
  return 0;
}


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

int main() {
    int n;
    cin >> n;
    set<string> s;
    for (int i = 0; i < n; i++) {
        char com[12];
        scanf("%s", com);
        string key;
        cin >> key;
        if (com[0] == 'i'){
            s.insert(key);
        } else {
            if (s.count(key)) {
                cout << "yes" << endl;
            } else {
                cout << "no" << endl;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 32212
import sys

class Card:
    def __init__(self, s, n, i):
        self.suit = s
        self.num = n
        self.ini_ord = i

def is_stable(A, n):
    for i in range(n - 1):
        if A[i].num == A[i + 1].num:
            if A[i].ini_ord > A[i + 1].ini_ord:
                return False

    return True

def partition(A, p, r):
    x = A[r].num
    i = p - 1

    for j in range(p, r):
        if A[j].num <= x:
            i += 1
            A[j], A[i] = A[i], A[j]

    A[i + 1] , A[r] = A[r], A[i + 1]

    return i + 1

def quickSort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quickSort(A, p, q - 1)
        quickSort(A, q + 1, r)

n = int(sys.stdin.readline().rstrip())
cards = []

for i in range(n):
    line = sys.stdin.readline().split()
    cards.append(Card(line[0], int(line[1]), i))

quickSort(cards, 0, n - 1)

if is_stable(cards, n):
    print("Stable")
else:
    print("Not stable")

for i in range(n):
    print(cards[i].suit,str(cards[i].num))

Measured memory_bytes: 31836
# D - Transit Tree Path
# https://atcoder.jp/contests/abc070/tasks/abc070_d

from heapq import heappop, heappush

INF = float("inf")

def dijkstra(n, G, s):
    dist = [INF] * n
    dist[s] = 0
    hq = [(0, s)]
    while hq:
        d, v = heappop(hq)
        if dist[v] < d:
            continue
        for child, child_d in G[v]:
            if dist[child] > dist[v] + child_d:
                dist[child] = dist[v] + child_d
                heappush(hq, (dist[child], child))
    return dist

n = int(input())
edge = [list(map(int, input().split())) for _ in range(n - 1)]
graph = [[] for _ in range(n)]

for a, b, c in edge:
    graph[a - 1].append((b - 1, c))
    graph[b - 1].append((a - 1, c))

q, k = map(int, input().split())

d = dijkstra(n, graph, k - 1)

for _ in range(q):
  x, y = map(int, input().split())
  ans = d[x - 1] + d[y - 1]
  print(ans)


Measured memory_bytes: 64148
#include <iostream>
#include <queue>

using namespace std;

int main() {
    int n;
    cin >> n;
    
    if (n <= 12) cout << n;
    else {
        //n -= 9;
        queue<long long> nums;
        for (int i = 0; i < 10; i++) nums.push(i);

        while (n > 0) {
            n--;
            long long front = nums.front();
            nums.pop();
            if (front == 0) continue;
            int ones = front % 10;
            front *= 10;
            if (ones - 1 >= 0) nums.push(front + (ones - 1));
            nums.push(front + ones);
            if (ones + 1 < 10) nums.push(front + (ones + 1));
        }
        cout << nums.front() << endl;
    }
}

Measured memory_bytes: 1792
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
    char s[51],t[16][10];
    int n;
    strcpy(t[0],"KIHBR");
    strcpy(t[1],"KIHBRA");
    strcpy(t[2],"KIHBAR");
    strcpy(t[3],"KIHBARA");
    strcpy(t[4],"KIHABR");
    strcpy(t[5],"KIHABRA");
    strcpy(t[6],"KIHABAR");
    strcpy(t[7],"KIHABARA");
    strcpy(t[8],"AKIHBR");
    strcpy(t[9],"AKIHBRA");
    strcpy(t[10],"AKIHBAR");
    strcpy(t[11],"AKIHBARA");
    strcpy(t[12],"AKIHABR");
    strcpy(t[13],"AKIHABRA");
    strcpy(t[14],"AKIHABAR");
    strcpy(t[15],"AKIHABARA");
    scanf("%s",s);
    n=strlen(s);
    if(n>9){
        printf("NO\n");
        return 0;
    }
    for(int i=0;i<16;i++){
        if(strcmp(s,t[i])==0){
            printf("YES\n");
            return 0;
        }
    }
    printf("NO\n");
}

Measured memory_bytes: 128
N, K = gets.strip.split(/ /).collect(&:to_i)

def count(n)
	c = 0
	while n < K
		c += 1
		n *= 2
	end
	c
end

result = 0
(1..N).each{|n|
	c = count(n)
	result += (0.5 ** c) / N
}
puts result


Measured memory_bytes: 1788
#include <bits/stdc++.h>
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;
using usize = ::std::size_t;
using u64 = ::std::int_least64_t;
//using u64 = long long;
static constexpr u64 Inf = ::std::numeric_limits<u64>::max() / 2;


int main(int argc, char *argv[])
{
    //std::ifstream in("in.txt");
    //std::cin.rdbuf(in.rdbuf());
    
    cin.tie(0) ;
    ios::sync_with_stdio(false) ;
    
    int N;
    cin >> N;
    vector<int> X(N), Y(N);
    
    for (int i = 0; i < N; i++) {
        cin >> X[i] >> Y[i];
        int x, y;
        x = X[i] + Y[i];
        y = X[i] - Y[i];
        X[i] = x;
        Y[i] = y;
    }
    
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());
    
    u64 ans = 0;
    
    ans = abs((u64) X[N - 1] - X[0]);
    ans = max(ans, abs((u64) Y[N - 1] - Y[0]));
    
    cout << ans << endl;
    
    return 0;
    
}


Measured memory_bytes: 4772
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
using namespace std;
int n;
main()
{
    cin>>n;
    vector<int>a(n);
    iota(a.begin(),a.end(),1);
    do{
        for(int i=0;i<n;i++)cout<<(i?" ":"")<<a[i];
        cout<<endl;
    }while(next_permutation(a.begin(),a.end()));
}


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

using namespace std;

long long n, r, g, b, m;
string s;

int main(){
	cin >> n >> s;
	for(int i = 0; i < s.size(); ++i){
		if(s[i] == 'R') r++;
		else if(s[i] == 'G') g++;
		else b++;
	}
	m = r*g*b;
	for(int i = 0; i < n; ++i){
		for(int j = 1; i+j+j < n; ++j){
			if(s[i]!=s[i+j]&&s[i]!=s[i+j+j]&&s[i+j]!=s[i+j+j]) m--;
		}
	}
	cout << m << endl;
}

Measured memory_bytes: 3636
#from math import gcd
from fractions import gcd

a, b, c, d = map(int, input().split())

# step 1
aa = a // c
if (a % c == 0):
    aa -= 1
bb = b // c
ans = bb - aa

# step 2
aa = a // d
if (a % d == 0):
    aa -= 1
bb = b // d
ans += bb - aa

'''
Python3.5
>>
最大公約数
import math
z = math.gcd(a,b)
最小公倍数
z = (a * b)//math.gcd(a,b)

Python3.4
from fractions import gcd
'''
# step 3
z = (c * d) // gcd(c, d)

aa = a // z
if (a % z == 0):
    aa -= 1
bb = b // z
ans -= bb - aa

tar = b - a + 1 - ans
print(tar)


Measured memory_bytes: 5052
#include <stdio.h>
#include <string.h>
typedef long long ll;

int main(void) {
  ll i, j, k, n, ans = 0;
  char s[20];
  scanf("%s", s);
  for(i = 0; i < 1 << (strlen(s) - 1); ++i) {
    ll now = 0;
    for(j = 0; j < strlen(s); ++j) {
      if(i && i & 1 << (j - 1)) ans += now, now = s[j] - '0';
      else now *= 10, now += s[j] - '0';
    }
    ans += now;
  }
  printf("%lld", ans);
  return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <cmath>
#include <string>
#include <iomanip>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define inf 1013161010
#define ninf -1013161010
#define mod 1000000007
#define ll long long
#define lf long double
#define in(x) scanf("%d",&x);
#define sz(x) ((int)x.size())
#define lld l64d
#define rep(i,n) for(i=0;i<n;i++)
#define rrep(i,n) for(i=n-1;i>=0;i--)
#define rep1(i,a,b) for(i=a;i<=b;i++)
#define rrep1(i,a,b) for(i=a;i>=b;i--)
#define stlfor(i,t) for(auto i =t.begin();i!=t.end();i++)
#define fr freopen("x.txt","r",stdin)
#define frc freopen("y.txt","w",stdout)
#define all(x) x.begin(),x.end()
#define set0(x) memset(x,0,sizeof(x))
#define dbg cout<<"yo "<<endl;
#define pset(n) fixed<<showpoint<<setprecision(n)

#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpii vector<pair<int,int> >
#define vpll vector<pair<ll,ll> >
#define si set<int>
#define mii map<int,int>
#define umii unordered_map<int,int>
#define vi vector<int>
#define pb push_back
#define ff first
#define ss second
#define mp make_pair

typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> OST;

ll toint(const string &s) { stringstream ss; ss << s; ll x; ss >> x; return x; }
string tostring ( ll number ){  stringstream ss; ss<< number; return ss.str();}

const lf pi = 2*acos(0);
const int nn = 2000006;

ll gcd(ll a,ll b){return (b==0)? a:gcd(b,a%b); }
void nope(int num = 0){ if(num==0) cout<<"NO"; else cout<<"-1"; exit(0); }

int a[100],k;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll i,j,n,tt;
    tt=1;
    //cin>>tt;
    while(tt--)
    {
        cin>>n>>k;
        a[0]=1;
        for(i=1;i<=10;i++)
            a[i]=min(2*a[i-1], a[i-1]+k);

        cout<<a[n]<<endl;


    }
    return 0;
}



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

#define MOD 1000000007;

int main(){
    while(1){
    int n,x; cin >> n >> x;
    if(n==0&&x==0) return 0;
    int ans = 0;
    for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) for(int k=j+1;k<=n;k++) if(i+j+k == x) ans++;
    cout << ans << endl;
    }
    return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  if (N >= M) {
    cout <<"0" <<endl;
    return 0;
  }
  if (M==1) {
    cout <<"0" << endl;
    return 0;
  }
  vector<int> X(M);
  for (int i=0; i<M; i++) {
    cin >> X.at(i);
  }
  sort(X.begin(), X.end());
  int D=X.at(M-1)-X.at(0);
  for (int i=0; i<M-1; i++) {
    X.at(i)=X.at(i+1)-X.at(i);
  }
  X.at(M-1)=0;
  sort(X.begin(), X.end());
  reverse(X.begin(), X.end());
  int ii=0;
  while (ii < N-1) {
    D -= X.at(ii);
    ii++;
  }
  cout << D << endl;
  return 0;
}


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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

int N,A,B;

int main(){
	cin >> N >> A >> B;
	if(A+B-1>N || (LL)A*B<(LL)N){
		cout << -1 << endl;
	} else {
		int x = N - A;
		int m = 0;
		while(m<N){
			int y = 0;
			if(x>=B-1){
				y = B;
			} else {
				y = x+1;
			}
			repm(i,m+y,m) cout << i << ' ';
			m += y;
			x -= y-1;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 2176
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long int llint;
llint dp[200005],t[600005],h[200005],v[200005],off=1,n;
void update(int x,llint v) {
	t[off+x]=v;
	x=(off+x)/2;
	for(x;x>=1;x/=2) {
		t[x]=max(t[x*2],t[x*2+1]);
	}
}
llint query(int x,int l,int r,int lo,int hi) {
	if(lo>r or hi<l) return 0;
	if(lo>=l && hi<=r) return t[x];
	return max(query(x*2,l,r,lo,(lo+hi)/2),query(x*2+1,l,r,(lo+hi)/2+1,hi));
}
void print() {
	int b=1;
	for(int i=1;i<off+n;i++) {
		for(int j=0;j<b;j++) {
			cout << t[i] << " ";
			i+=1;
		}
		cout << endl;
		i-=1;
		b*=2;
	}
}
int main()
{
	cin >> n;
	while(off<=n) off*=2;
	for(int i=0;i<n;i++) {
		cin >> h[i];
	}
	for(int i=0;i<n;i++) {
		cin >> v[i];
	}
	dp[0]=v[0];
	update(h[0],dp[0]);
	for(int i=1;i<n;i++) {
		//print();
		dp[i]=query(1,0,h[i],0,off-1)+v[i];
		update(h[i],dp[i]);
		//print();
	}
	/*for(int i=0;i<n;i++) {
		cout << dp[i] << " ";
	}
	cout << endl;*/
	llint sol=0;
	for(int i=0;i<n;i++) {
		sol=max(sol,dp[i]);
	}
	cout << sol;
	return 0;
}


Measured memory_bytes: 9600
#include <iostream>
using namespace std;
int main() 
{
    int x;
    cin>>x;
    if(x>=400&&x<=599)
    cout<<"8";
    else if(x>=600&&x<=799)
    cout<<"7";
     else if(x>=800&&x<=999)
    cout<<"6";
     else if(x>=1000&&x<=1199)
    cout<<"5";
    else if(x>=1200&&x<=1399)
    cout<<"4";
   else if(x>=1400&&x<=1599)
    cout<<"3";
    else if(x>=1600&&x<=1799)
    cout<<"2";
    else if(x>=1800&&x<=1999)
    cout<<"1";
    return 0;
}


Measured memory_bytes: 3632
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.util.*;

/**
 *
 * @author Admin
 */
 class Main {
    
    
    public static void main(String args[])
    {
    Scanner s=new Scanner(System.in);
    
    int a=s.nextInt();
    
    int b=s.nextInt();
 
       int c=s.nextInt();
 
    int d=s.nextInt();
    
         
    while(a>0 && c>0)
    {
    
        c=c-b;
        if(c<=0)
            break;
        
       a=a-d;
      
    }
    
    if(a>0 && c<=0)
       System.out.println("Yes");
    else
           System.out.println("No");
    
    
    
    }
    
    
}


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

int main() {
	string s;
	cin >> s;

	s.pop_back();
	while (true) {
		int len = s.length();
		if (s.length() % 2) {
			s.pop_back();
			continue;
		}

		int i = 0;
		int j = len / 2;
		while(j < len && s[i++] == s[j++]) {
			//
		}
		if (j == len && i == len/2) {
			cout << len << "\n";
			break;
		}
		s.pop_back();
	}
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  while (true) {
    C -= B;
    if (C <= 0) {
      cout << "Yes" << endl;
      break;
    }
    
    A -= D;
    if (A <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

Measured memory_bytes: 3624
<?php

const DEBT = 100000;
const INTEREST = 0.05;

$targetWeek=trim(fgets(STDIN));

if ($targetWeek < 0 || 100 < $targetWeek) {
    echo 'out of range';
    exit(1);
}

$nowDebt = DEBT;

for ($week=0; $week < $targetWeek; $week++) {
    $nowDebt = ceil(($nowDebt * (1+INTEREST))/ 1000) * 1000;
}

echo $nowDebt . "\n";



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

int main(){
    int n;
    cin >> n;
    int c[4] = {0};
    for(int i = 0;i < n;i++){
        string s;
        cin >> s;
        if(s == "AC") c[0]++;
        else if(s == "WA") c[1]++;
        else if(s == "TLE") c[2]++;
        else if(s == "RE") c[3]++;
    }

    printf("AC x %d\n",c[0]);
    printf("WA x %d\n",c[1]);
    printf("TLE x %d\n",c[2]);
    printf("RE x %d\n",c[3]);
    
    return 0;
}

Measured memory_bytes: 3720
#include<stdio.h>
int main(void)
{
	int h[101][101]={0},r,c,i,j;
	scanf("%d %d", &r, &c);
	for(i=0; i<r; i++)
	{
		for(j=0; j<c; j++)
		{
			scanf("%d", &h[i][j]);
			h[i][c]+=h[i][j];
			h[r][j]+=h[i][j];
		}
	}
	for(i=0; i<r; i++)
	h[r][c]+=h[i][c];
	for(i=0; i<=r; i++)
	{
		for(j=0; j<=c; j++)
		{
			printf("%d", h[i][j]);
			if(j<c)
			printf(" ");
		}
		printf("\n");
	}
	
	return 0;
}


Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define RFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,n-1,-1)
#define ALL(obj) (obj).begin(), (obj).end()

int main() {
	ll n, d, a, x, h;
	cin >> n >> d >> a;
	vector<pll> v;
	vll vv;
	REP(i, n) {
		cin >> x >> h;
		v.push_back(pll(x, (h + a - 1) / a)); //round up
		vv.push_back(x);
	}
	sort(v.begin(), v.end());
	sort(vv.begin(), vv.end());
	map<ll, ll> mp; // border of attack area : damage
	ll res = 0;
	ll dmg = 0;
	REP(i, n) {
		if (mp.count(i)) dmg -= mp[i];
		if (v[i].second - dmg > 0) {
			res += v[i].second - dmg;
			ll index = upper_bound(vv.begin(), vv.end(), v[i].first + d * 2) - vv.begin();
			if (!mp.count(index)) mp[index] = v[i].second - dmg;
			else mp[index] += v[i].second - dmg;
			dmg += v[i].second - dmg;
		}
	}
	cout << res;
	return 0;
}

Measured memory_bytes: 17388
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define ll long long int

void Swap(ll x[], ll i, ll j)
{
  int temp;

  temp = x[i];
  x[i] = x[j];
  x[j] = temp;
}

void QSort(ll x[], ll left, ll right)
{
  ll i, j;
  ll pivot;

  i = left;  /* ソートする配列の一番小さい要素の添字 */
  j = right; /* ソートする配列の一番大きい要素の添字 */

  pivot = x[(left + right) / 2]; /* 基準値を配列の中央付近にとる */

  while (1)
  { /* 無限ループ */

    while (x[i] < pivot) /* pivot より大きい値が */
      i++;               /* 出るまで i を増加させる */

    while (pivot < x[j]) /* pivot より小さい値が */
      j--;               /*  出るまで j を減少させる */
    if (i >= j)          /* i >= j なら */
      break;             /* 無限ループから抜ける */

    Swap(x, i, j); /* x[i] と x[j]を交換 */
    i++;           /* 次のデータ */
    j--;
  }

  if (left < i - 1)         /* 基準値の左に 2 以上要素があれば */
    QSort(x, left, i - 1);  /* 左の配列を Q ソートする */
  if (j + 1 < right)        /* 基準値の右に 2 以上要素があれば */
    QSort(x, j + 1, right); /* 右の配列を Q ソートする */
}

/* 配列の要素を交換する */

int main(void)
{
  ll a, c;
  ll *b;
  ll i, j;
  ll f;
  int t = 1;
  scanf("%lld", &a);
  b = (ll *)malloc(sizeof(ll) * a);

  for (i = 0; i < a; i++)
  {
    scanf("%lld", &c);
    b[i] = c;
  }

  QSort(b, 0, a - 1);

  for (i = 0; i < a - 1; i++)
  {
    if (b[i] == b[i + 1])
    {
      t = 0;
      break;
    }
  }

  if (t == 0)
  {
    printf("NO\n");
  }
  else
  {
    printf("YES\n");
  }
  return 0;
}

Measured memory_bytes: 1664
#include "bits/stdc++.h"
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define setp(x) setprecision(x)
#define nep(x) next_permutation(x);
using namespace std;
using ull = unsigned long long;
using ll = long long;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;

int N;
int x[10], y[10];

double dist(int i, int j) {
    double dx = x[i] - x[j];
    double dy = y[i] - y[j];
    return pow(dx * dx + dy * dy, 0.5);
}

void solve() {
    cin >> N;
    for(int i = 1; i <= N; i++) cin >> x[i] >> y[i];
    double sum = 0.0;
    vector<int> v(N);
    for(int i = 0; i < N; i++) v[i] = i + 1;
    do {
        for(int i = 0; i < N - 1; i++) sum += dist(v[i], v[i+1]);
    } while(next_permutation(v.begin(), v.end()));
    int Factorial = 1;
    for(int i = 2; i <= N; i++) Factorial *= i;
    cout << fixed << setprecision(10) << sum / Factorial << endl;
    return;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define F first
#define S second
//cout<<fixed<<setprecision(11);
const string nl="\n";
const ll MOD=1e9+7;
const ll ARR_MAX = 1e5+1;
const ll VAL_MAX = 103;
const ll INF=1e14;


ll dp[VAL_MAX][2],previ[VAL_MAX][2];
//dp[i][j] = number of numbers so far with sum of digits having modulo i,with j being a bool representing if digits chosen are identical to k.
//1 represents identical digits so far.

void add_mod(ll &x,ll y){
	x+=y;
	if(x>=MOD){
		x-=MOD;
	}
}

void solve(){
    string k;cin>>k;
    int d;cin>>d;
    int n=k.size();
    dp[0][1]=1;
    // for(int x=0;x<d;x++){
   	// 	cout<<-1<<" . "<<x<<" "<<dp[x][0]<<" "<<dp[x][1]<<nl;
   	// }

    for(int i=0;i<n;i++){
    	int dig=k[i]-'0';
    	for(int x=0;x<d;x++){
    		previ[x][0]=dp[x][0];
    		previ[x][1]=dp[x][1];
    		dp[x][0]=0;
    		dp[x][1]=0;
    	}
    	for(int j=0;j<10;j++){
    		for(int x=0;x<d;x++){
    			if(j<dig){
    				add_mod(dp[(x+j)%d][0],previ[x][1]);
    				add_mod(dp[(x+j)%d][0],previ[x][0]);
    			}
    			else if(j==dig){
    				add_mod(dp[(x+j)%d][0],previ[x][0]);
    				add_mod(dp[(x+j)%d][1],previ[x][1]);    				
    			}
    			else{
    				add_mod(dp[(x+j)%d][0],previ[x][0]);    				
    			}
    		}
    	}
    	// for(int x=0;x<d;x++){
    	// 	cout<<i<<" . "<<x<<" "<<dp[x][0]<<" "<<dp[x][1]<<nl;
    	// }
    }
    cout<<(dp[0][0]+dp[0][1]+MOD-1)%MOD<<nl;
}

int main(){
    fastio();
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy


def main():
	count = 0
	num = int(input())
	strings = input()
	
	for i in range(0,num-2,1):
		if strings[i] == "A" and strings[i+1] == "B" and strings[i+2] == "C":	
			count += 1
	print(count)

if __name__ == '__main__':
	main()


Measured memory_bytes: 9620