akhauriyash/Code-Regression huggingface dataset:
<?php
fscanf(STDIN, "%d %d", $a, $b);

$sum = sum($a, $b);
$sub = sub($a, $b);
$multi = multi($a, $b);

$result = calculation($sum, $sub, $multi);

echo $result, PHP_EOL;

function sum(int $a, int $b): int
{
    return $a + $b;
}

function sub(int $a, int $b): int
{
    return $a - $b;
}

function multi(int $a, int $b): int
{
    return $a * $b;
}

function calculation(int $sum, int $sub, int $multi): int
{
    $result = $sum > $sub ? ($sum > $multi ? $sum : $multi) : ($sub > $multi ? $sub : $multi);
    return $result;
}

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

int main(){
    int a;
    int b;
    
    cin>>a>>b;
    if (1<=a && a<=9 && 1<=b && b<=9){
        cout<<a*b<<endl;
    }else{
        cout<<"-1"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

def solve_m(S, T, K):
    def count(x):
        ret, ti = 0, 0
        for s in S:
            # 積がxを初めて下回るtiを求める。なければlen(T)
            while ti < len(T) and s * T[ti] > x:
                ti += 1
            if ti == len(T):
                break
            ret += len(T) - ti
        return ret
    left, right = -(10**18)-1, 10**18+1
    while abs(right - left) > 1:
        mid = (left + right) // 2
        if count(mid) < K:
            left = mid
        else:
            right = mid
    return right

def solve(S, mS, K):
    def count(x, T):
        ret, j = 0, len(T) - 1
        for i, t in enumerate(T):
            while j >= 0 and t * T[j] > x:
                j -= 1
            if j == -1:
                break
            ret += j + 1 - (1 if i <= j else 0)
        return ret // 2
    left, right = -(10**18)-1, 10**18+1
    while abs(right - left) > 1:
        mid = (left + right) // 2
        if count(mid, S) + count(mid, mS) < K:
            left = mid
        else:
            right = mid
    return right

def main():
    N, K = list(map(int, input().split()))
    A = sorted(map(int, input().split()), reverse=True)
    B = {-1:[], 0:[], 1:[]}
    for a in A:
        if a == 0:
            B[0].append(0)
        else:
            B[a//abs(a)].append(a)
    m = len(B[-1]) * len(B[1])
    z = len(B[0]) * (N-len(B[0])) + len(B[0]) * (len(B[0])-1) // 2
    if K <= m:
        print(solve_m(B[1], B[-1], K))
    elif K <= m + z:
        print(0)
    else:
        print(solve(sorted(B[1]), B[-1], K - m - z))


if __name__ == '__main__':
    main()


Measured memory_bytes: 95572
#include<stdio.h>

int main(){
  long int i,N,ans;
  scanf("%ld",&N);
  if(N%2==1)
    printf("0\n");
  else{
    ans=0;
    for(i=10;i<1000000000000000000;i=i*5){
      ans=ans+N/i;
    }
    printf("%ld\n",ans);
  }
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<sstream>
#include<iomanip>
#include<stdlib.h>
#include<string>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<set>
#include<queue>
#include<stack>
#include<map>
#include<utility>
#include<algorithm>
#include<complex>
using namespace std;
#define loop(i,l,r) for(int (i)=(int)(l);(i)<(int)(r);(i)++)
#define rloop(i,l,r) for(int (i)=(int)(l);(i)>(int)(r);(i)--)
#define rep(i,n) loop(i,0,n)
#define rrep(i,n) rloop(i,n-1,-1)
#define INF 0x3f3f3f3f
#define mod 1000000007LL
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef complex<double> C;

int main(){
	int n,d,a[100001]={},res=0;
	cin>>n;
	rep(i,n){
			cin>>d;
			a[i+1]=d;
			if(a[d]==i+1)res++;
	}
	cout<<res<<endl;
}


Measured memory_bytes: 640
#include<stdio.h>
#define ll long long int 
int main(){
	ll h,m;
	scanf("%lld%lld",&h,&m);
	ll s;
	if(h==1||m==1){
		printf("%d",1);
	}
	else
	{
		s=h*m;
		if(s%2!=0){
			s+=1;
		}
		ll k;
		k=s/2;
		printf("%lld",k);
	}
}

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

int main() {
  int n;
  ll x = 1000;
  cin >> n;
  vector<int>a(n);
  rep(i,0,n) cin >> a[i];
  rep(i,0,n-1) if(a[i] < a[i+1]) x = x%a[i]+(x/a[i])*a[i+1];
  cout << x << endl;
}

Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    while(cin >> n, n){
        for (int i = 0; i < n; ++i) {
            int a, b, c, d, e, f, g, h;
            cin >> a >> b >> c >> d >> e >> f >> g >> h;
            printf("%d %d %d %d\n",
                   a*e-b*f-c*g-d*h,
                   a*f+b*e+c*h-d*g,
                   a*g-b*h+c*e+d*f,
                   a*h+b*g-c*f+d*e
            );
        }
    }
    return 0;
}


Measured memory_bytes: 3200
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>

using namespace std;

// マクロ&定数 ============================================================
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;
typedef vector<string> vstring;

typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<bool>> vvbool;

const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;４近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:８近傍 9:(0,0)を含む
const ll MOD = 1e9 + 7; //10^9 + 7
const double PI = 3.14159265358979323846264338327950288;
//========================================================================


int main() {

	//==================================
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(30);
	//==================================

	string X;
	cin >> X;


	stack<char> S;

	for (int i = 0; i < X.length(); i++) {
		if (X[i] == 'S') {
			S.push(X[i]);
		}
		else if (!S.empty() && S.top() == 'S') {
			S.pop();
		}
		else {
			S.push(X[i]);
		}
	}

	cout << S.size();

}


Measured memory_bytes: 720
def main(input = STDIN)
  a = (1..30).to_a.inject{|sum, i|sum + i}
  b = (1..30).to_a.inject{|sum, i|sum * i}
  28.times do
    n = input.gets.to_i
    a -= n
    b /= n
  end
  d = ((a ** 2 - 4 * b) ** 0.5).round
  puts (a - d) / 2, (a + d) / 2
end
main

Measured memory_bytes: 6160
#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vl  = vector<ll>;
using vi  = vector<int>;
#define _GLIBCXX_DEBUG
#define IO_STREAM cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(int i=sta;i<end;++i)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll INF = 1000000000000000;
const ll MOD = 1000000007;
const double PI = acos(-1);
//||
#define DBG(a,b,c,d) //cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<endl
//DBG("","","","");

signed main(){
	IO_STREAM;
	int A,B,C;
	cin>>A>>B>>C;
	if(A==B&&B!=C) cout<<"Yes"<<endl;
	else if(A==C&&B!=C) cout<<"Yes"<<endl;
	else if(B==C&&A!=C) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


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

using _i64 = int64_t;
using _u64 = uint64_t;
using _f64 = double;

#define _for(i, start, end) for(_i64 i = (_i64)start; i < (_i64)end; ++i)
#define _rep(i, number) _for(i, 0, number)
#define _foreach(e, data) for(auto& e : data)
#define _all(data) data.begin(), data.end()

template<typename type>
_i64 _size(const type& data) { return static_cast<_i64>(data.size()); }
template<typename type, size_t size>
_i64 _size(const type (&)[size]) { return static_cast<_i64>(size); }

enum _flag : bool { able = true, disable = false };

struct _time {
    _time(_flag flag) { check = flag; if(!check) { return; } gettime(start); }
    ~_time() {
        if(!check) { return; }; gettime(end);
        _i64 elapse = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cout << endl << "Time: " << elapse << " ms" << endl;
    }
    private:
    using _timer = chrono::time_point<chrono::system_clock>;
    _timer start, end; bool check;
    void gettime(_timer& time) { time = chrono::system_clock::now(); }
};

struct _ini { _ini() { ios::sync_with_stdio(false); cin.tie(nullptr); } } _ini;

int main() {
    {
        _time time(disable);
        _f64 n, x1, y1, x2, y2, x3, y3, px, py, r, a, b, c, d, e, f;
        cin >> n;
        _rep(i, n) {
            cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
            a = x1 * 2 - x2 * 2;
            b = y1 * 2 - y2 * 2;
            c = pow(x1, 2) + pow(y1, 2) - pow(x2, 2) - pow(y2, 2);
            d = x2 * 2 - x3 * 2;
            e = y2 * 2 - y3 * 2;
            f = pow(x2, 2) + pow(y2, 2) - pow(x3, 2) - pow(y3, 2);
            px = (c * e - f * b) / (a * e - d * b) + DBL_EPSILON;
            py = (c * d - f * a) / (b * d - e * a) + DBL_EPSILON;
            r = sqrt(pow((px - x1), 2) + pow((py - y1), 2)) + DBL_EPSILON;
            cout << fixed << setprecision(3) << px << " " << py << " " << r << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3232
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
long long b[4010],c[4010][4010];
int main()
{
	long long ans=1e18;
	int n;long long x;scanf("%d%lld",&n,&x);
	for(int i=1;i<=n;i++)scanf("%lld",&b[i]),c[i][0]=b[i];
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n-1;j++)
		{
			int k=i-j;if(k<=0)k+=n;
			c[i][j]=min(c[i][j-1],b[k]);
		}
	}
	for(int i=0;i<n;i++){long long sum=0;for(int j=1;j<=n;j++)sum+=c[j][i];ans=min(ans,sum+x*i);}
	printf("%lld",ans);return 0;
 } 

Measured memory_bytes: 62976
x = int(input())
ANS = "Yes"
s = []

for i in range(x):
	s.append(input())
for i in range(x-1):
	if s[i+1][0] != s[i][-1]:
		ANS = "No"
		break
if len(s) == len(set(s)):
	print(ANS)
else:
	print("No")

Measured memory_bytes: 3060
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyStore.Entry;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.NoSuchElementException;

public class Main {
	HashMap<Long, Long> map = new HashMap<>();

	void put(long key) {
		if (map.containsKey(key)) {
			map.put(key, map.get(key) + 1);
		} else {
			map.put(key, 1L);
		}
	}

	void run() {
		Scanner sc = new Scanner();
		long n = sc.nextLong();
		ArrayList<Long> sum = new ArrayList<>();
		long cur = 0;
		put(0);
		for (int i = 0; i < n; ++i) {
			cur += sc.nextLong();
			put(cur);
		}
		long ans = 0;
		for (java.util.Map.Entry<Long, Long> e : map.entrySet()) {
			ans+=e.getValue()*(e.getValue()-1)/2;
		}
		System.out.println(ans);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	class Scanner {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;

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

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

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

		private void skipUnprintable() {
			while (hasNextByte() && !isPrintableChar(buffer[ptr]))
				ptr++;
		}

		public boolean hasNext() {
			skipUnprintable();
			return hasNextByte();
		}

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

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

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


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

#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, s, e) for (ll i = s; i < e; i++)
#define Forr(i, s, e) for (ll i = s; i > e; i--)
#define pb push_back
#define ll long long
#define mp make_pair
ll mod = 1000000007;
ll *height;
ll *below;
ll *a;
ll maxheight;
ll dfs(vector<vector<ll>> &v, ll index, ll prev)
{
    ll bemax = 0;
    for (auto &itr : v[index])
    {
        if (below[itr] == -1)
            bemax = max(bemax, dfs(v, itr, index));
        else
            bemax = max(bemax, below[itr]);
    }
    if (v[index].size() == 0)
        below[index] = 0;
    else
        below[index] = bemax + 1;
    maxheight = max(maxheight, below[index]);
    return below[index];
};
int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(8);
    ll n, m;
    cin >> n >> m;
    a = new ll[n];
    For(i, 0, n)
    {
        a[i] = -1;
    }
    vector<vector<ll>> g(n, vector<ll>());
    For(i, 0, m)
    {
        ll x, y;
        cin >> x >> y;
        a[y - 1] = x - 1;
        g[x - 1].push_back(y - 1);
    }
    height = new ll[n];
    below = new ll[n];
    For(i, 0, n)
    {
        height[i] = 0;
        below[i] = -1;
    }
    maxheight = 0;
    For(i, 0, n)
    {
        if (a[i] == -1)
        {
            dfs(g, i, -1);
        }
    }
    cout << maxheight << endl;
    return 0;
}

Measured memory_bytes: 18812
#include <stdio.h>

int main() {
    int a, b;

    scanf("%d %d", &a, &b);

    if (a == 1) {
        a += 13;
    }
    if (b == 1) {
        b += 13;
    }

    if (a > b) {
        printf("Alice\n");
    } else if (a < b) {
        printf("Bob\n");
    } else {
        printf("Draw\n");
    }
    return 0;
}


Measured memory_bytes: 128
/*input
4
3 8 5 1
*/
#include<bits/stdc++.h>
using namespace std;

#define int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define RE(i,n) for (int i = 1; i <= n; i++)
#define RED(i,n) for (int i = n; i > 0; i--)
#define REPS(i,n) for(int i = 1; (i*i) <= n; i++)
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define mii map<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define WL(t) while(t --)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;
const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int fast_ex(int a,int n,int m){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= fast_ex(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}


void solve(){
     int n;cin >> n;
     int sum  = 0;
     int a[n];
     REP(i,n){cin >> a[i];sum += a[i];}
     sort(a,a+n);
     if(sum > 2*a[n-1])cout << "Yes";
     else cout << "No";
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  //freopen(".in","r",stdin);freopen(".out","w",stdout);
  int t = 1;//cin >> t;
  WL(t)solve();
  return 0;
}

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

struct point{
	double x, y, z;
	point(){}
	point(double _x, double _y, double _z):
		x(_x), y(_y), z(_z){}
		
	point operator + (const point &p) const{
		return point(x + p.x, y + p.y, z + p.z);
	}
	point operator - (const point &p) const{
		return point(x - p.x, y - p.y, z - p.z);
	}
	point operator / (const double &r) const{
		return point(x / r, y / r, z / r);
	}
	double operator * (const point &p) const{
		return x * p.x + y * p.y + z * p.z;
	}
	double length(){
		return sqrt(x * x + y * y + z * z);
	}
};

struct vect{
	point pos, dir;
} ray;

struct circle{
	point o;
	double r;
} c[200];

int n;

bool check(int v, point &p, double &d, point &dir){
	point tmp = c[v].o - ray.pos;
	double arc = tmp * ray.dir / tmp.length() / ray.dir.length();
	double dis = sin(acos(arc)) * tmp.length();
	if(arc < 0 || dis > c[v].r)
		return 0;
	dis = tmp.length() * arc - sqrt(c[v].r * c[v].r - dis * dis);
	d = dis;
	p = ray.dir / (ray.dir.length() / d) + ray.pos;
	point N = p - c[v].o;
	arc = d * fabs(ray.dir * N / ray.dir.length() / N.length());
	N = N / (N.length() / arc);
	dir = ray.dir / (ray.dir.length() / d) + N / .5;
	return 1;
}

void solve(){
	double dis = 1e20, d;
	int m = 0;
	point p, nextp, dir, nextdir;
	for(int i = 1; i <= n; ++i)
		if(check(i, p, d, dir))
			if(d < dis){
				dis = d;
				nextp = p;
				nextdir = dir;
				m = i;
			}
	if(m){
		ray.pos = nextp;
		ray.dir = nextdir;
		solve();
	}
}

int main(){
	while(scanf("%d", &n), n){
		scanf("%lf%lf%lf", &ray.dir.x, &ray.dir.y, &ray.dir.z);
		ray.pos = point(0, 0, 0);
		for(int i = 1; i <= n; ++i)
			scanf("%lf%lf%lf%lf", &c[i].o.x, &c[i].o.y, &c[i].o.z, &c[i].r);
		solve();
		printf("%.3lf %.3lf %.3lf\n", ray.pos.x, ray.pos.y, ray.pos.z);
	}
	return 0;
}

Measured memory_bytes: 1348
#include <iostream>
using namespace std;
 
int main(void){
  int N;
  cin >> N;
  int ans = 0;
  for(int i = 1; i <= N; i+=2){
    	int count = 0;
        for(int j=1; j <= i; j++ ){
           if( i%j == 0 ) count++;
        }
        if( count == 8 ) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds; 
  
#define ll long long
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
	enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int mod = (int)1e9 + 7;
const int MX = (int)1e5 + 10;

void add_self(int &x, int y){x += y; if(x >= mod) x -= mod;}
void sub_self(int &x, int y){x -= y; if(x < 0) x += mod;}
void mul(int &x, int y){x = x * 1LL * y % mod;}

int main(){

	cin.tie(0); cout.tie(0);
	ios_base::sync_with_stdio(0);

	int a, b;
	cin >> a >> b;

	for(int x = max(a, b); x <= max(a, b) * 100; ++x){
		int i = x * 8 / 100;
		int j = x * 10 / 100;
		if(i == a && j == b){
			cout << x << endl;
			return 0;
		}
	}

	cout << -1 << endl;
	
	return 0;
}

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

int gcd(int x, int y){
  while(y>0){
    int tmp;
    tmp = y;
    y = x % y;
    x = tmp;
  }
  return x;
}

int main(){
  int n; cin >> n;
  vector<int> v(n);
  for(int i=0;i<n;i++) cin >> v[i];
  
  int ans = v[0];
  for(int i=0;i<n-1;i++) ans = gcd(ans, v[i+1]);
  
  cout << ans << endl;
  return 0;
}

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

int main() {
	int A,B;
	char code[20];
	int aaa, counts = 0;
	scanf("%d %d", &A, &B);
	scanf("%s", code);
	aaa = strlen(code);
	
	if(!(code[A] == '-')){
		printf("No");
		return 0;
	}
	for(int i=0;i<aaa;i++){
		if(code[i] == '-'){
			counts++;
		}
	}
	if(counts > 1){
		printf("No");
		return 0;
	}
	
	printf("Yes");
			
return 0;
}

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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  int x, a, b;
  cin >> x >> a >> b;
  cout << (abs(x - a) < abs(x - b) ? 'A' : 'B') << endl;
}



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

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = numeric_limits<int>::max() / 2;
const int NEG_INF = numeric_limits<int>::min() / 2;
const int MOD = 1e9 + 7;

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

	ll n, a, b, c, d;
	cin >> n >> a >> b >> c >> d;
	ll sa = abs(a - b);
	b = a + sa;
	bool flag = false;
	for (int i = 0; i < n - 1; i++) {
		ll  mi = (n - 1 - i)*c - i*d, ma =  (n - 1 - i)*d-i*c;
		ll high = max(mi, ma), low = min(mi, ma);
        //cout<<low<<" "<<high<<endl;
		if (low <= sa && sa <= high) flag = true;
	}
	if (flag) cout << "YES" << endl;
	else cout << "NO" << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){

 int a,b;
 int d;
 int r;
 double f;

 scanf("%d%d",&a,&b);
 d=a/b;
 r=a%b;
 f=(double)a/b;
 

 printf("%d %d %f\n",d,r,f);
 return 0;
 }



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

int main() {
	int a, b, c; cin >> a >> b >> c;
	for (int i = 1; i * a < b * a; i++) {
		if (a * i % b == c) { cout << "YES" << endl; return 0; }
	}
	cout << "NO" << endl;

	return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE BlockArguments #-}
import Control.Monad
import Data.Maybe
import Data.Char (isSpace)
import Data.List (unfoldr)
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import qualified Data.ByteString.Char8 as BS

tuplify2 (x:y:_) = (x,y)
tuplify2 _ = undefined

--Input functions with ByteString
readInt = fst . fromJust . BS.readInt
readIntTuple = tuplify2 . map readInt . BS.words
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntNList n = map readIntList <$> replicateM (fromIntegral n) BS.getLine
getIntMatrix = map readIntList . BS.lines <$> BS.getContents
getIntTuple = readIntTuple <$> BS.getLine
getIntNTuples n = map readIntTuple <$> replicateM (fromIntegral n) BS.getLine
getIntTuples = map readIntTuple . BS.lines <$> BS.getContents


main = do
  -- n <- readLn @Int
  -- as <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
  n <- getInt
  as <- getIntList

  let v :: U.Vector Int
      v = U.create do
        v <- UM.replicate n 0
        forM_ as \a -> UM.modify v (+ 1) (a - 1)
        return v
  U.forM_ v \n -> print n

Measured memory_bytes: 9780
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

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

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//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 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,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
    int A,B,C;
    cin >> A >> B >> C;
    bool act=false;
    if(A==5 && B==5 && C==7){
        act=true;
    }
    if(A==5 && B==7 && C==5){
        act=true;
    }
    if(A==7 && B==5 && C==5){
        act=true;
    }
    if(act){
        cout << "YES";
    }
    else{
        cout << "NO";
    }
}

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

int h,w;
int a[82][82], b[82][82], c[82][82];
int dp[82][82][16000];
int ans = 100000;

int slv(int nh,int nw,int nd){

	if(h<=nh || w<=nw)return(0);
	if(dp[nh][nw][nd] != -1)return(0);
	
	dp[nh][nw][nd] = 1;
	if(nh==h-1 && nw==w-1){
		ans = min(ans,nd);
		return(0);
	}

	slv(nh+1,nw,abs(nd+c[nh+1][nw]));
	slv(nh+1,nw,abs(nd-c[nh+1][nw]));
	slv(nh,nw+1,abs(nd+c[nh][nw+1]));
	slv(nh,nw+1,abs(nd-c[nh][nw+1]));

	return(0);
}

int main(){

	// Init
	for(int i=0;i<81;i++){
		for(int j=0;j<81;j++){
			for(int k=0;k<16000;k++)dp[i][j][k]=-1;
		}
	}

	// Input
	cin>>h>>w;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>a[i][j];
		}
	}
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>b[i][j];
			c[i][j] = abs(a[i][j]-b[i][j]);
		}
	}

	// slv
	slv(0,0,c[0][0]);
	cout<<ans<<endl;

	return(0);
}

Measured memory_bytes: 416128
def resolve():
    N = int(input())
    ans = ""
    while N > 0:
        rem = N % 26
        rem = 25 if rem == 0 else rem - 1
        ans = chr(ord("a")+rem) + ans
        N = (N-1) // 26
    print(ans)


if '__main__' == __name__:
    resolve()

Measured memory_bytes: 61828
N = int(input())
dp = [[0,0,0]]
for i in range(N):
    a, b, c = map(int, input().split())
    dp.append([a + max(dp[i][1], dp[i][2]), b + max(dp[i][2], dp[i][0]), c + max(dp[i][0], dp[i][1])])
print(max(dp[N]))

Measured memory_bytes: 22796
import scala.io.StdIn.{readLine,readInt}
 
object Main extends App {
  val seq1 = for(i<-1 to 9) yield List(i,i,i)
  val seq2 = for(i<-1 to 7) yield List(i,i+1,i+2)
 
  def check(m:List[Int], count:Int,u:Int,v:Int):Boolean =  {
    if(m.length != count) false
    else if(count==2) {
      val List(x,y) = m
      if(x==y) true else false
    } else {
      if((u to 8).exists( i=> check(m diff seq1(i),count-3,i+1,v))) {
        true
      } else {
        (v to 6).exists(i=> check(m diff seq2(i),count-3,u,i) )
      }
    }
  }
 
  Iterator.continually(readLine).takeWhile ( _!=null ).foreach { line =>
    val l = line.map(_.asDigit).toList
    val m = (1 to 9).filter { i=> if(l.count( _==i ) >= 4) false else check(i::l,14,0,0) }
    if(m.length>0) println(m.mkString(" ")) else println(0)
  }
}

Measured memory_bytes: 67796
# -*- coding: utf-8 -*-
import numpy as np

iNum = int(input())
naXY = np.zeros((iNum,2))
for iI in range(iNum):
  x, y = map(int, input().split())
  naXY[iI] = [x,y]
naXY0 = np.average(naXY, axis = 0) + np.random.rand(2) * 1e-3
fA = 1.0e-1
while fA > 1.0e-10:
  naP  = naXY - naXY0
  naR = np.einsum("ij, ij -> i", naP,naP)
  iImax = np.argmax(naR)
  #fR  = naR[iImax]**0.5
  naE = naP[iImax]
  #naE/= np.dot(naE,naE)**0.5
  #print(iImax, naXY0, fR)
  #naB = np.einsum("ij, j->i", naP, naE)*2
  #naA = (naR - fR**2 ) / (naB - 1.0e-10 - fR)
  #fA  = np.min(naA[naB< - 1.0e-20])
  #print(iImax, fA, fR)
  #naXY0+=naE*fA
  naXY0+=naE*fA
  fA*=0.9998
print(naR[iImax]**0.5)


Measured memory_bytes: 12508
mod = 1000000007
n = int(input())
s = input()
s2 = input()
a = [] if n > 1 else [1]
for i in range(n-1):
  if i != 0 and s[i-1] == s[i]:
    continue
  if s[i] == s[i+1]:
    a.append(2)
    if i == n-3:
      a.append(1)
  else:
    a.append(1)
    if i == n-2:
      a.append(1)
ans = 3 if a[0] == 1 else 6
for i in range(len(a)-1):
  b,c = a[i:i+2]
  if b == 1:
    ans = (ans * 2) % mod
  else:
    if c == 2:
      ans = (ans * 3) % mod
print(ans)

Measured memory_bytes: 9132
#include <iostream>
#include <vector>

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define IN(v) int v;cin>>v;
#define OUT(v) cout<<v<<"\n"

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

  vvi h(N, vi(3, 0));
  REP(i, N)
    cin >> h[i][0] >> h[i][1] >> h[i][2];

  int dp[N+1][3];
  REP(i, N+1) REP(j, 3) dp[i][j] = 0;

  REP(i, N) {
    REP(j1, 3) {
      REP(j2, 3) {
        if (j1 == j2)
          continue;
        dp[i+1][j2] = max(dp[i+1][j2], dp[i][j1] + h[i][j2]);
      }
    }
  }
  OUT(max(dp[N][0], max(dp[N][1], dp[N][2])));

  return 0;
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
#define INF 1e9
#define all(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define max(v) *max_element(v.begin(), v.end())
#define min(v) *min_element(v.begin(), v.end())
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
using namespace std;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    int d[n];
    rep(i, n){
        cin>>d[i];
    }
    long long sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            sum += d[i]*d[j];
        }
    }
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

        int N = sc.nextInt();
        int M = sc.nextInt();

        while(M != 0 || N != 0) {
            int[] inst = new int[N + 1];
            int[] nums = new int[M];

            for (int i = 0; i < N; i++)
                inst[i + 1] = sc.nextInt();
            for(int i = 0; i < M; i++)
                nums[i] = sc.nextInt();

            int nowPos = 1;
            int i = 0;
            for (i = 0; nowPos < N; i++) {
                nowPos += nums[i];
                if(nowPos <= N)
                    nowPos += inst[nowPos];
                //System.out.println(nowPos);
            }

            System.out.println(i);
            N = sc.nextInt();
            M = sc.nextInt();
        }

        sc.close();
    }
}



Measured memory_bytes: 36000
#include<iostream>

using namespace std;

void swapp(int a[],int i,int j);
bool sorted(int a[],int s);

int main()
{
    int n;
    bool x = false;
    cin>>n;
    int arr[n];
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
    }
    if(sorted(arr,n))
    {
        cout<<"YES";
    }
    else
    {
        for(int i=0; i<n-1; i++)
        {
            for(int j=i+1; j<n; j++)
            {
                if(arr[j]<arr[i])
                {
                    swapp(arr,i,j);
                    if(sorted(arr,n))
                    {
                        x = true;
                        break;
                    }
                    swapp(arr,j,i);
                }
            }
        }
        if(x)
        {
            cout<<"YES";
        }
        else
        {
            cout<<"NO";
        }
    }
}

void swapp(int a[],int i,int j)
{
    int temp = a[j];
    a[j] = a[i];
    a[i] = temp;
}

bool sorted(int a[],int s)
{
    bool x = true;
    for(int i=1; i<s; i++)
    {
        if(a[i]<a[i-1])
        {
            x = false;
            break;
        }
    }
    return x;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
long long n,a;
int main(){
    cin>>n;
    for(long long i=1;i<=n;i++){
        if(i%3!=0){
            if(i%5!=0){
                a+=i;
            }
        }
    }cout<<a<<endl;
}


Measured memory_bytes: 3592
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<cstdint>
using namespace std;

const uint64_t kMax = UINT64_MAX;

int main()
{
  uint64_t n, m, s, t;
  vector<uint64_t> sp[3];
  vector<vector<uint64_t> > g;

  cin >> n >> m;
  g.resize(n);
  for (uint64_t i = 0; i < m; ++i) {
    uint64_t u, v;
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
  }
  cin >> s >> t;
  --s;
  --t;

  for (int kkp = 0; kkp < 3; ++kkp) {
    sp[kkp].resize(n);
    for (uint64_t i = 0; i < n; ++i) {
      sp[kkp][i] = kMax;
    }
  }
  sp[0][s] = 0;

  queue<pair<uint64_t, uint64_t> > q;
  q.push(make_pair(s, 0));
  while (!q.empty()) {
    auto upair = q.front();
    auto u = upair.first;
    auto kkp = upair.second;
    auto next = (kkp+1)%3;
    q.pop();
    for (uint64_t i = 0; i < g[u].size(); ++i) {
      auto v = g[u][i];
      if (sp[next][v] == kMax) {
        sp[next][v] = sp[kkp][u] + 1;
        if (v == t && next == 0) {
          cout << sp[next][v] / 3;
          return 0;
        }
        q.push(make_pair(v, next));
      }
    }
  }
  cout << "-1";

  return 0;
}



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

const int N=200;
int lri[N][N][N],ri[N][N][N],ldn[N][N][N],dn[N][N][N],n,m,a[N][N];
char s[N];
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>m;
	for(int i=1;i<=n;++i){
		cin>>s;
		for(int j=1;j<=m;++j)a[i][j]=s[j-1];
	}
	for(int i=1;i<=n;++i)
		for(int j=m;j;--j){
			ri[i][i][j]=a[i][j]==a[i][j+1]?ri[i][i][j+1]:j+1;
			for(int k=i-1;k;--k)
				ri[k][i][j]=a[i][j]==a[k][j]?min(ri[k][k][j],ri[k+1][i][j]):j;
		}
	for(int i=1;i<=m;++i)
		for(int j=n;j;--j){
			dn[i][i][j]=a[j][i]==a[j+1][i]?dn[i][i][j+1]:j+1;
			for(int k=i-1;k;--k)
				dn[k][i][j]=a[j][i]==a[j][k]?min(dn[k][k][j],dn[k+1][i][j]):j;
		}
	for(int i=1;i<=n;++i)for(int j=i;j<=n;++j)ri[i][j][m+1]=m+1;
	for(int i=1;i<=m;++i)for(int j=i;j<=m;++j)dn[i][j][n+1]=n+1;
	for(int ans=0;;++ans){
		if(ri[1][n][1]==m+1){cout<<ans<<'\n';return 0;}
		memcpy(lri,ri,sizeof ri);memcpy(ldn,dn,sizeof dn);
		for(int i=1;i<=n;++i)
			for(int j=i;j<=n;++j)
				for(int k=1;k<=m;++k){
					int u=lri[i][j][lri[i][j][k]];
					for(;ldn[k][u][ldn[k][u][i]]>j;++u);
					ri[i][j][k]=u;
				}
		for(int i=1;i<=m;++i)
			for(int j=i;j<=m;++j)
				for(int k=1;k<=n;++k){
					int u=ldn[i][j][ldn[i][j][k]];
					for(;lri[k][u][lri[k][u][i]]>j;++u);
					dn[i][j][k]=u;
				}
	}
	return 0;
}


Measured memory_bytes: 125184
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap};

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;

fn main() {
    input! {
        n: usize
    }

    for i in 1..1002 {
        if i * (i + 1) / 2 == n {
            println!("Yes");
            println!("{}", i + 1);
            print!("{} ", i);
            for j in 0..i {
                print!("{} ", j + 1);
            }
            println!("");
            let mut gap = vec![1; i];
            gap[0] = i;
            for j in 1..i + 1 {
                print!("{} ", i);
                let mut v = j;
                for k in 0..i {
                    print!("{} ", v);
                    v += gap[k];
                }
                println!("");
                for k in 0..i {
                    if gap[k] == 1 && k > 0 {
                        gap[k] = gap[k - 1] - 1;
                        gap[k - 1] = gap[k];
                        break;
                    }
                }
            }
            return;
        }
    }
    println!("No");
}


Measured memory_bytes: 5500
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <utility>
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n) for(int i=1;i<=(n);i++)
#define lol long long
#define SUM(n) ((n)+1)*(n)/2
#define mp make_pair
#define fi first
#define se second
#define pu push_back
#define SYOU(x) setprecision(x+1)
#define abs(x,y) (max(x,y)-min(x,y))
#define all(v) v.begin(),v.end()
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int MOD=int(1e9)+7; 
using namespace std;
using pii = pair<int,int>;
  
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    int a[n + 5];
    rep(i,n){
      cin >> a[i];
    }
    sort(a,a +n);
    int ans = 0, maxv = min(a[n - 1] - a[0] , a[0]);
    reps(i,n - 1){
      if(maxv < min(a[n - 1] - a[i] , a[i])){
	ans = i;
	maxv = min(a[n - 1] - a[i] , a[i]);
      }
    }
    cout << a[n - 1] << " " << a[ans] << '\n';
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
const ll INF = 1LL<<60;
const ll mod=1e9+7;
using namespace std;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll aa=ceil((ld)a/d);
    ll bb=ceil((ld)c/b);
    if(aa==bb)cout<<"Yes";
    else if(aa>bb)cout<<"Yes";
    else cout<<"No";
    
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mk make_pair
typedef pair<int, int> pii;

int N, X;
int len[55];
int dp[55];

int dfs(int L, int l, int r)
{
    int R = l - 1 + len[L] / 2;
    if(L == 1){
        if(r - 1 <= X){
            //printf("L:%lld l:%lld r:%lld res:%lld\n", L, l, r, 3ll);
            return 3ll;
        }
        else{
            //printf("L:%lld l:%lld r:%lld res:%lld\n", L, l, r, ((X - l >= 0) ? (X - l) : 0ll));
            return ((X - l >= 0) ? (X - l) : 0ll);
        }
    }
    int res = 0ll;
    if(r <= X){
        if(~dp[L]){
            //printf("L:%lld l:%lld r:%lld res:%lld\n", L, l, r, dp[L]);
            return dp[L];
        }
        res = 1ll;
        res += dfs(L - 1, l + 1ll, R);
        res += dfs(L - 1, R + 2ll, r - 1ll);
        //printf("L:%lld l:%lld r:%lld res:%lld\n", L, l, r, res);
        return dp[L] = res;
    }
    if(l + 1 <= X){
        res += dfs(L - 1, l + 1ll, R);
    }
    if(R + 2ll <= X){
        res += dfs(L - 1, R + 2ll, r - 1ll);
    }
    if(R + 1ll <= X){
        res += 1ll;
    }
    //printf("L:%lld l:%lld r:%lld res:%lld\n", L, l, r, res);
    return res;
}

signed main()
{
    cin >> N >> X;
    len[0] = 1ll;
    for(int i = 1; i <= N; i++){
        len[i] = len[i - 1] * 2ll + 3ll;
    }
    /*for(int i = 0; i <= N; i++){
        printf("len[%lld] = %lld\n", i, len[i]);
    }*/
    memset(dp, -1, sizeof(dp));
    cout << dfs(N, 1ll, len[N]) << endl;

    return 0;
}
/*


*/


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

int main(){
  int N;
  cin >>N;
  vector<int> A(N,0);
  for(int i=0;i<N;i++){
    int x;
    cin >>x;
    A[i] = x;
  }
  
  vector<int> count(N,0);
  for(int i=0;i<N;i++){
    count[A[i]-1] = i+1;
  }
  
  for(int i=0;i<N;i++){
    cout << count[i] << " ";
  }
  
  cout << endl;
}

Measured memory_bytes: 1664
//C - Next Prime
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
typedef long long ll;

bool isPrime(ll x){
    if(x < 2) return false;
    else if(x == 2) return true;
    else if(x%2 == 0) return false;
    for(ll i=3; i<=sqrt(x); i+=2){
        if(x%i == 0) return false;
    }
    return true;
}
int main(void){
    ll x;
    bool flag;
    scanf("%lld", &x);
    while(1){
        flag = isPrime(x);
        if(flag) break;
        x++;
    }
    printf("%lld\n", x);
    return 0;
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline
def main():
    n = int(input())
    a = list(map(int, input().split()))
    maxnum = [0] * (n + 1)
    num = [0] * (n + 1)
    maxnum[0] = 1
    num[0] = 1
    if n > 0:
        num[-1] = a[-1]

    if n == 0 and a[0] == 1:
        print(1)
    elif n == 0 and a[0] == 0:
        print(-1)
    elif n == 0 and a[0] > 1:
        print(-1)
    elif n >= 1 and a[0] > 0:
        print(-1)
    elif n == 1 and a[1] == 1:
        print(2)
    elif n == 1 and a[1] == 2:
        print(3)
    else:
        for i1 in range(1, n + 1):
            if maxnum[i1-1] * 2 < a[i1]:
                print(-1)
                sys.exit()
            else:
                maxnum[i1] = maxnum[i1-1] * 2 - a[i1]

        for j1 in range(n-1, 0, -1):
            numt = a[j1] + min(num[j1 + 1], maxnum[j1-1]*2 - a[j1])
            num[j1] = numt
        r = sum(num)
        print(r)

if __name__ == '__main__':
    main()



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

int main(){
  int a,b;
  cin >> a >> b;
  if (a == b){
    cout << "Draw" << endl;
  }
  else if (a == 1){
    cout << "Alice" << endl;
  }
  else if (b == 1){
    cout << "Bob" << endl;
  }
  else if (a > b){
    cout << "Alice" << endl;
  }
  else {
    cout << "Bob" << endl;
  }
}

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

int main(void){
  char S[15] = {};
  int len;//Sの長さ
  int i, j, k;
  int count = 0;
  int flag;
  scanf("%s", S);
  len = strlen(S);
  if(S[0] != 'A'){
    printf("WA\n");
    return 0;
  }else{
    for(i = 2; i < len-1; i++){
      if(S[i] == 'C'){
        count++;
      }
    }
    if(count != 1){
      printf("WA\n");
      return 0;
    }else{
      for(i = 0; i < len; i++){
        if(S[i] != 'A' && S[i] != 'C'){
          if(S[i] < 'a' || S[i] > 'z'){
            printf("WA\n");
            return 0;
          }
        }
      }
      printf("AC\n");
      return 0;
    }
  }
}


Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int W, H, i, j;

	while (1)
	{
		scanf("%d %d", &H, &W);

		if ((H == 0) && (W == 0))
		{
			break;
		}

		for (i = 0; i < H; i++)
		{
			for (j = 0; j < W; j++)
			{
				printf("#");
			}

			printf("\n");
		}

		printf("\n");
	}

	return 0;
}


Measured memory_bytes: 2112
//package ABC171;
import java.util.*;
import java.io.*;
class Main {
	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		
		char ch=sc.next().charAt(0);
		if(Character.isUpperCase(ch))
		{
			System.out.println('A');
		}
		else
		{
			System.out.println('a');
		}
		
		
		

	}

}


Measured memory_bytes: 35764
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
char a[1010010];
int main()
{
	int len,i,now;
	long long ans=0;
	scanf("%s",a+1);
	len=strlen(a+1);
	for(i=1;i<=len;i++)
	{
		if(a[i]=='B')
			break;
	}
	now=i;
//	printf("%d\n",i);
	for(i=now;i<=len;i++)
	{
		if(a[i]=='W') 
			ans=ans-now+i,now++;
//		printf("%d %d %lld\n",now,i,ans);
	}
	printf("%lld\n",ans);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
 	return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main(void) {
    int pointN, scanNumber;
    int result = 0;
    
    if(scanf("%d", &pointN)==1 && pointN<=100 && pointN>=1){
        for(int i=0; i<pointN; i++){
            if(scanf("%d", &scanNumber)==1 && scanNumber<=1000 && scanNumber>=1){
                if(scanNumber%2==0){
                    if(scanNumber%3!=0 && scanNumber%5!=0){
                        result = 1;                    }
                }
            }else{
                result = 1;
            }
        }
    }else{
        result = 1;
    }
    
    if(result==0){
        printf("APPROVED");
    }else{
        printf("DENIED");
    }

    return 0;
    
}


Measured memory_bytes: 128