akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;

int main(){
        int n;
        char s[101];
        cin >> n >> s;

        int ans=0,one=0;
        for(int i=1; i<n; i++){
                if(s[i]==s[0]){
                        ans=1;
                        one=1;
                }
        }

        int count=one;
        for(int i=1; i<n-1; i++){
                for(int j=0; j<i; j++){
                        if(s[i]==s[j]){
                                count--;
                                break;
                        }
                }
                for(int j=i+1; j<n; j++){
                        if(s[i]==s[j]){
                                count++;
                                break;
                        }
                }
                if(count>ans) ans=count;
        }

        cout << ans << endl;
        return 0;
}

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

ll extend_gcd(ll a,ll b,ll &x,ll &y){
	if(b==0){
		x = 1;
		y = 0;
		return a;
	}
	ll d = extend_gcd(b,a%b,y,x);
	y -= a/b * x;
	return d;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	auto A=in(),B=in();
	ll X,Y;
	auto G=extend_gcd(A,B,X,Y);

	out(X,Y);
	return 0;
}


Measured memory_bytes: 3192
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define INF int(1e9)
#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define REPONE(i, n) for(int i = 1; i <= (int)(n); i++)
#define EACH(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(int i = m;i < n;i++)
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};


const int MAX_N = 1000;
int N;
ll T[MAX_N], A[MAX_N];
ll lcmT = 1, lcmA = 1;

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

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

void solve() {
    ll t = 1, a = 1;
    REP(i, N) {
        if (i == 0) {
            t = T[i], a = A[i];
            continue;
        }
        if (t < T[i]) t = T[i];
        if (a < A[i]) a = A[i];
        if (t > T[i] && t % T[i] != 0) t += (T[i] - t % T[i]);
        if (a > A[i] && a % A[i] != 0) a += (A[i] - a % A[i]);
        if (t / T[i] > a / A[i]) {
            a = t / T[i] * A[i];
        } else if (a / A[i] > t / T[i]) {
            t = a / A[i] * T[i];
        }
    }
    cout << t + a << endl;
}

int main() {
    cin >> N;
    REP(i, N) {
        cin >> T[i] >> A[i];
        lcmT = lcm(T[i], lcmT);
        lcmA = lcm(A[i], lcmA);
    }
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<int> enum_div(int n) {
    std::vector<int> ret;
    for (int i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i != 1 && i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

template <typename T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;
    vector<int> A(N);
    cin >> A;

    double ave = 0.0;
    REP(i, N) {
        ave += A[i];
    }
    ave /= N;
    int ans = -1;
    double sub = INF;
    REP(i, N) {
        if (abs(A[i] - ave) < sub) {
            sub = abs(A[i] - ave);
            ans = i;
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 892
//C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

//Hang in there!

using namespace std;


int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if (abs(c - a) <= d) {
		cout << "Yes" << endl;
		return 0;
	}
	if (abs(b - a) <= d && abs(c - b) <= d) {
		cout << "Yes" << endl;
		return 0;
	}
	cout << "No" << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
int main(){
    string s;
    int ans=0;
    cin>>s;
    int i=s.length()-1,j;
    while(i>=0){

        if(s[i]-'5'>0||(i>0&&s[i]-'5'==0&&s[i-1]-'5'>=0)){
            ans+=(10-(s[i]-'0'));
            j=i-1;
            s[i]='x';
            while(j>=0&&s[j]-'9'==0){
                s[j]='0';
                j--;
            }

            if(j==-1){
                s.insert(0,"1");

                i++;
            }
            else s[j]++;
        }
        else{
            ans+=s[i]-'0';

        }
        i--;

    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1412
#include <iostream>

using namespace std;

int main()
{
	int N, D;
	cin >> N >> D;

	int n = N / (D * 2 + 1);
	int c = N % (D * 2 + 1) == 0 ? 0 : 1;

	cout << n+c << endl;

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <tuple>
#include <algorithm>
#include <set>
#include <queue>

using namespace std;

int x, y, z, k;
long long a[1111], b[1111], c[1111];

using T = tuple<long long, int, int, int>;
set<T> s;

int main(void) {
  scanf("%d%d%d%d", &x, &y, &z, &k);
  for (int i = 0; i < x; i++) {
    scanf("%lld", a + i);
  }
  for (int i = 0; i < y; i++) {
    scanf("%lld", b + i);
  }
  for (int i = 0; i < z; i++) {
    scanf("%lld", c + i);
  }
  sort(a, a + x, greater<long long>());
  sort(b, b + y, greater<long long>());
  sort(c, c + z, greater<long long>());

  priority_queue<T> q;
  q.emplace(a[0] + b[0] + c[0], 0, 0, 0);
  s.emplace(a[0] + b[0] + c[0], 0, 0, 0);

  for (int i = 0; i < k; i++) {
    T p = q.top(); q.pop();

    printf("%lld\n", get<0>(p));

    for (int j = 0; j < 3; j++) {
      int ai = get<1>(p) + (j == 0 ? 1 : 0);
      int bi = get<2>(p) + (j == 1 ? 1 : 0);
      int ci = get<3>(p) + (j == 2 ? 1 : 0);
      if (ai >= x || bi >= y || ci >= z) continue;
      T pp{a[ai] + b[bi] + c[ci], ai, bi, ci};
      if (s.count(pp) == 0) {
        s.insert(pp);
        q.push(pp);
      }
    }
  }
  
  return 0;
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)
#define lowbit(x) ((x)&(-(x)))
#define sqr(a) ((a)*(a))
#define clr(a) (memset((a),0,sizeof(a)))
#define ls ((x)<<1)
#define rs (((x)<<1)|1)
#define mid (((l)+(r))>>1)
#define pb push_back
#define w1 first
#define w2 second
inline void read(int &x){
	x=0;int f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
inline void judge(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
}
/*******************************head*******************************/
const int maxn=200005;
const int mod=1e9+7;
int n;
inline void addd(int &x,int y){
	x=((x+y)>=mod?(x+y-mod):(x+y));
}
struct szsz{
	int sum[maxn];
	inline void add(int x,int v){
		for(;x<=n;x+=lowbit(x))addd(sum[x],v);
		// cerr<<"ok\n";
	}
	inline int query(int x){
		int res=0;for(;x>0;x-=lowbit(x))addd(res,sum[x]);return res;
	}
}bit;
pin a[maxn],range[maxn];
int w[maxn];
int main(){
	read(n);cerr<<bit.query(-1)<<endl;
	rep(i,1,n){
		read(a[i].w1),read(a[i].w2);
		w[i]=a[i].w2;
	}sort(w+1,w+1+n);
	rep(i,1,n)a[i].w2=lower_bound(w+1,w+1+n,a[i].w2)-w;
	sort(a+1,a+1+n);
	int maxi=0,mini=n+1;
	rep(i,1,n){
		maxi=max(maxi,a[i].w2);
		range[i].w2=maxi;
	}
	per(i,n,1){
		mini=min(mini,a[i].w2);
		range[i].w1=mini;
	}
	sort(range+1,range+1+n);
	rep(i,1,n){
		int l=range[i].w1,r=range[i].w2;
		// cerr<<l<<' '<<r<<endl;
		bit.add(r,(bit.query(r)-bit.query(l-2)+(l==1)+mod)%mod);
	}
	printf("%d\n",(bit.query(n)-bit.query(n-1)+mod)%mod);
	return 0;
}


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

int main() {
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    int a,b,k;
    cin>>a>>b>>k;
    vector<int> ans;
    for(int i = 1;i <= min(a,b);i++) {
        if(a%i == 0 && b%i == 0) ans.push_back(i);
    }
    cout<<ans[ans.size()-k];
}

Measured memory_bytes: 256
#include<stdio.h> 
int main()
{
	int n,l,i;
	while (~scanf("%d %d",&n,&l))
	{
		int a[n+10];
		for(i=1;i<=n;i++)
		a[i]=l+i-1;
		int sum=0,g=0;
		for(i=1;i<=n;i++)
		{
			if(a[i]==0)
			{
				g=1;
				break;
			}
		}
		if(g==1)
		{
			for(i=1;i<=n;i++)
			{
				sum+=a[i];
			}
		}
		else{
		if(l>0)
		{
			for(i=2;i<=n;i++)
			sum+=a[i];
		}
		else if((l*l)>=0)
		{
			for(i=1;i<n;i++)
			{
				sum+=a[i] ;
			}
		}
		}
		printf("%d",sum);
	}
}

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

#define vec(v) vector<int>(v)
#define be(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define mapci(mp) map<char*,int>(mp)
#define mapcc(mp) map<char*,char*>(mp)
typedef long long ll;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s,t;
    cin>>s;
    ll n=s.length();
    t[0]=s[0];
    for(int i=1;i<n;i++){
        if(s[i-1]!=s[i]){
            t+=s[i];
        }
    }
    ll m=t.length();
    cout <<m<<endl;
    return 0;
}


Measured memory_bytes: 592
N = int(input())
arr = [int(input()) for _ in range(N)]
dic = {}
for i in arr:
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
a = 0
for value in dic.values():
    if value % 2 == 1:
        a += 1
print(a)

Measured memory_bytes: 16268
#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int i, n;
    while(cin >> n, n){
        int m[10000] = {'\0'};
        for(i = 0; i < n; i++){
            cin >> m[i];
        }
        long long ans = 0;
        int j = 0, sum = 0;
        sort(m, m+n);
        for(int j = 0; j < i-1; j++){
            sum += m[j];
            ans += sum;
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 1212
n = int(input())

blist = list(map(int, input().split()))

cnt = 0

for i in range(n):
    for j in range(n-1, i, -1):
        if blist[j] < blist[j-1]:
            cnt += 1
            blist[j], blist[j-1] = blist[j-1], blist[j]

for i in range(n):
    if i == n-1:
        print(blist[i])
    else:
        print(str(blist[i]) + " ", end="")

print(cnt)



Measured memory_bytes: 5612
#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<map>
#include<vector>

using namespace std;


#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long
#define MOD 1000000007

#define IMIN INT_MIN;
#define IMAX INT_MAX;

bool sort1(const pair<int, pair<ll, int> > a, const pair<int, pair<ll, int> > b) {
	if (a.second.first == b.second.first) return a.second.second > b.second.second;
	else return a.second.first < b.second.first;
}


int main(){
	int N;
	cin >> N;
	vector< pair<int, pair<ll, int> > > S(N);
	string s;
	int p;
	ll tmp;
	ll base;
	rep(i, N) {
		tmp = 0;
		cin >> s >> p;
		base = pow(26, 10);
		rep(i, s.size()) {
			tmp += base * (ll)(s[i] - 'a');
			base /= 26;
		}
		auto pa = make_pair(tmp, p);
		S[i].first = i+1;
		S[i].second = pa;
	}
	sort(S.begin(), S.end(), sort1);
	rep(i, N) cout << S[i].first << endl;


	return 0;
}



Measured memory_bytes: 256
import std.stdio;

void main() {
	uint vertex, side;
	readf(" %s %s", &vertex, &side);

	auto direction = new uint[][vertex];

	foreach (i;0..side) {
		uint v0, v1;
		readf(" %s %s", &v0, &v1);
		--v0;
		--v1;
		direction[v0] ~= v1;
	}

	auto dp = new int[vertex];
	dp[] = -1;

	int maxPath(uint v) {
		auto dir = direction[v];

		if (dp[v] != -1) {
			return dp[v];
		}

		if (dir.length == 0) {
			dp[v] = 0;
			return 0;
		}

		uint m;
		foreach (d;dir) {
			auto t = maxPath(d);
			if (m < t) {
				m = t;
			}
		}
		++m;
		dp[v] = m;
		return m;
	}

	int m;
	foreach (i;0..vertex) {
		int t = maxPath(i);
		if (m < t) {
			m = t;
		}
	}
	writeln(m);
}


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

void Chessboard(int W,int H){
    for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
            if(i%2==0){
                if(j%2==0){
                    cout<<"#";
                }
                else{
                    cout<<".";
                }
            }
            else{
                if(j%2==0){
                    cout<<".";
                }
                else{
                    cout<<"#";
                }
            }
        }
        cout<<endl;
    }
    cout<<endl;
}

int main(){
    int W,H;
    while(true){
        cin>>H>>W;
        if(W==0&&H==0){
            break;
        }
        Chessboard(W,H);
    }
    return 0;
}


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

namespace abc139_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int A = Convert.ToInt32(input[0]);
            int B = Convert.ToInt32(input[1]);
            int cnt = 1;
            int ans = 0;
            while (cnt < B)
            {
                cnt = cnt - 1 + A;
                ans++;
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11220
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define mod 1000000007
#define exp pow(10,-9)
#define F first
#define S second
#define PB push_back 
#define MP make_pair
#define daman ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define lowercase(str) transform(str.begin(), str.end(), str.begin(), ::tolower);
#define uppercase(str) transform(str.begin(), str.end(), str.begin(), ::toupper);
main(){
    daman
	
	string s1,s2;
	cin>>s1>>s2;
	
	int count = 0;
	for(int i=0;i<s1.length();i++)
	{
		if(s1[i] != s2[i])
			count++;
	}
	cout<<count<<"\n";
}

Measured memory_bytes: 3800
#include<stdio.h>
#include<bits/stdc++.h>
#include<string>
#include<string.h>
using namespace std;
int main ()
{
    int s,a,b;
    while(cin>>a>>b)
    {

    int i,l,p,k;
    i=1*a*b;
    l=2*a*b;
    p=3*a*b;
    if(i%2!=0||l%2!=0||p%2!=0)
        printf("Yes\n");
    else
        printf("No\n");
    }
    return 0;
}


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

int main(int argc, char const *argv[]) {
    int n, m;
    cin >> n >> m;
    int sum = 0;
    vector<int> A(n);
    for (size_t i = 0; i < n; i++) {
        cin >> A[i];
        sum += A[i];
    }

    int ans = 0;
    for (size_t i = 0; i < n; i++) {
        if (A[i] >= (double)sum/(4*m)) ++ans;
    }
    if (ans >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define pll pair<ll, ll> 
#define vl vector<ll> 
#define vvl vector< vector<ll> > 
#define vlp vector< pair<ll, ll> >
#define vllp vector<pair<pll, ll> > 
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i=0; i< a; i++)
#define rep1(i,a)   for(ll i = 1; i< a; i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define mp make_pair
#define all(v)  (v).begin(), (v).end()
#define fst first
#define sec second
#define ff first.first
#define fs first.second
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000001
#define MOD 1000000007
// #define MOD 998244353
#define endl "\n"
#define INF (ll)1e18
#define s(v) (ll)v.size()
#define e(v) v.empty()
#define bscount(x) __builtin_popcountll(x)
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
// using namespace __gnu_pbds;

ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%MOD; b/=2;a=a*a%MOD;}return ans;}
ll inverse(ll a, ll p){return fexp(a, p-2);} 
void ingraph(vvl& graph, ll m){ll x, y;rep(i, m){cin>>x>>y;x--, y--;graph[x].pb(y);graph[y].pb(x);}}
ll modify(ll n){ll res = n;res%=MOD;res+=MOD;res%=MOD;return res;}

int main(){
    // #ifndef ONLINE_JUDGE
    //     freopen("../input.txt", "r", stdin);
    //     freopen("../output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll t;
    // cin>>t;
    t = 1;
    while(t--){
    	ll x, y;
    	cin>>x>>y;
    	if(2*x <= y && 4*x >= y && y % 2 == 0)	cout<<"Yes";
    	else cout<<"No";
    }
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
// clang-format off
#define FOR(i, n) for (int i=0; i<(int)n; ++i)
#define RFOR(i, n) for (int i=n-1; i>=0; --i)
#define OUTV(x) FOR(j,x.size()) cout<<x[j]<<(x.size()-j-1?' ':'\n');
#define OUTM(x) FOR(i,x.size()) {OUTV(x[i])}
#define BLE cerr<<"BLE"<<endl;
#define DEBUG(x) cerr<<"DEBUG: "<<#x<<" = "<<x<<endl;
#define PB push_back
#define MP make_pair
// clang-format on
using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  //  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

  int A, B, C;
  cin >> A >> B >> C;
  cout << min(C, B / A) << endl;

  return 0;
}

Measured memory_bytes: 256
#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 pb push_back
#define ll long long int
#define db double
#define SORTA(v) sort(v.begin(),v.end())
#define SORTD(v) sort(v.begin(),v.end(),greater<>())
#define endl '\n'
#define nod(N) floor(log10(N)) + 1
#define LB(a) lower_bound(a)
#define UB(a) upper_bound(a)
#define F first
#define S second
#define FOR(i,n) for(long long int i = 0;i<n;i++)
#define FOR1(i,n) for(long long int i=1;i<=n;i++)
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define REVERSE(s) reverse(s.begin(),s.end())
#define LBV(v,a) lower_bound(v.begin(),v.end(),a)
#define UBV(v,a) upper_bound(v.begin(),v.end(),a)
#define GCD(a,b) __gcd(a,b)
#define MAX pow((ll)2,63) - 999;
#define ITX(it,x1) for(auto it = x1.begin();it!=x1.end();it++)
#define I insert
#define stll(x) stoll(x, nullptr, 10);
#define VFIND(v1,val) find(v1.begin() , v1.end() , val )
#define VFILL(v1 , val)   std::fill(v1.begin(), v1.end(), val);
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define all(x) x.begin() , x.end() 

// typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef tree<int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ll mxm() {return LLONG_MIN;}
template<typename... Args>
ll mxm(ll a, Args... args) { return max(a,mxm(args...)); }
ll mnm() {return LLONG_MAX;}
template<typename... Args>
ll mnm(ll a, Args... args) { return min(a,mnm(args...)); }
ll cl(ll a, ll b){if(a%b == 0)return a/b;else return a/b + 1;}
const int MOD = 1e9 + 7;

long long int powxy(long long int x, long long int y) 
{
    if (y == 0) return 1;
    if (y%2 == 1) return (x*powxy(x, y-1))%MOD;
    long long int t = powxy(x, y/2);
    return (t*t)%MOD;
}
void DPM(map<ll,ll>m1)
{
    for(auto it = m1.begin();it!=m1.end();it++)
    {
        cout<<it->first<<" "<<it->second<<endl;
    }
    cout<<endl;
}
void DPV(vector<ll>v)
{
    FOR(i,v.size())cout<<v[i]<<" ";cout<<endl;
}
void DPS(set<ll>s1)
{
    for(auto it =s1.begin();it!=s1.end();it++)cout<<*it<<" ";cout<<endl;
}
void DPA(ll arr[],ll n)
{
    FOR(i,n)cout<<arr[i]<<" ";cout<<endl;
}

ll dx[4] = { 0,0,1,-1 };
ll dy[4] = { 1,-1,0,0 };
string pos = "RLDU";


int main()
{
    FAST;
    ll i ,j , T = 1;
    // cin>>T;
    while(T--)
    {
        i=0;j=0;

        ll n; cin>>n;

        vector<ll>v1(n);

        FOR(i,n)cin>>v1[i];

        int ans = 0 ;

        for(i=0;i<n;i++)
        {
            for(j=i+1;j<n;j++)
            {
                for(int k=j+1;k<n;k++)
                {
                    if( v1[i] < v1[j] + v1[k] && v1[j] < v1[i] + v1[k] && v1[k] < v1[i] + v1[j] )
                    {
                        
                        if(v1[i] == v1[j] || v1[i] == v1[k] || v1[j] == v1[k])continue;
                        // cout<<i<<" "<<j<<" "<<k<<endl; ans++;
                        ans++;
                    }
                }
            }
        }
        
        cout<<ans;
        
    }
}  



Measured memory_bytes: 3648
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskA {
		public void solve(int testNumber, FastScanner in, PrintWriter out) {
			char[] s = in.next().toCharArray();
			int ans = 0;
			for (int eq = 0; eq <= s.length; eq++) {
				int cur = 0;
				for (int i = 0; i < eq; i++) {
					cur += s[i] - '0';
				}
				if (eq < s.length && s[eq] != '0') {
					cur += s[eq] - '1';
				}
				for (int i = eq + 1; i < s.length; i++) {
					cur += 9;
				}
				ans = Math.max(ans, cur);
			}
			out.println(ans);
		}

	}

	static class FastScanner {
		private BufferedReader in;
		private StringTokenizer st;

		public FastScanner(InputStream stream) {
			in = new BufferedReader(new InputStreamReader(stream));
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					String rl = in.readLine();
					if (rl == null) {
						return null;
					}
					st = new StringTokenizer(rl);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return st.nextToken();
		}

	}
}



Measured memory_bytes: 21460
n, m = map(int, input().split())
l = []
for i in range(m):
  a, b = map(int, input().split())
  l.append(a)
  l.append(b)
for i in range(n):
  x = len(l)
  z = 0
  for y in range(x):
    if i+1 == l[y]:
      z += 1
  print(z)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 int a,m,n,b,kt[100009],dem=0;
 vector<int> a1[100009];
void bfs(int a)
{
    kt[a]=dem;
    for (int i:a1[a])
    {
        if (kt[i]==0) bfs(i);
    }
}
int main()
{
//freopen("tplt.inp","r",stdin);
//freopen("tplt.out","w",stdout);
    cin>>n>>m;
    for (int i=1;i<=100009;i++)
        kt[i]=0;
    for (int i=1;i<=m;i++)
    {
        cin>>a>>b;
        a1[a].push_back(b);
        a1[b].push_back(a);
    }
    for (int i=1;i<=n;i++)
    {
        if (kt[i]==0) {dem++;bfs(i);}
    }
    cout<<dem-1;
    return 0;
}

Measured memory_bytes: 9988
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<set>
#include<vector>

using namespace std;

int main(){
    double w,h,x,y,x_x,y_y,ans;
    int judge;
	cin >> w >> h >> x >> y;
    ans = w*h/2.0;
    x_x = w/2.0;
    y_y = h/2.0;
    if(x_x == x && y_y == y){
        judge = 1;
    }else{
        judge = 0;
    }

	cout << ans << " " << judge << endl;
}


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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

int main(){
  int n,m;
  while(cin >> n >> m, n|m ){
    vector<int> arr(n); 
    rep(i,n) { cin >> arr[i]; arr[i] %= m; }
    int maxi = 0;
    rep(i,n) {
      int sum = 0;
      REP(j,i,n){
        ( sum += arr[j] ) %= m;
        maxi = max(maxi,sum);
      }
      if( maxi == m-1 ) break;
    }
    cout << maxi << endl;
  }
  return 0;
}

Measured memory_bytes: 1312
#include <bits/stdc++.h>
using namespace std;
const int NMAX = 200000 + 10;
const int MOD = 2019;
char str[NMAX];

typedef long long ll;
ll num[2019];
int main(int argc, char const *argv[])
{
	scanf("%s",str+1);
	int len = strlen(str+1);
	ll ans = 0;
	int index = 0,ten = 1;
	num[0]++;
	for(register int i = len;i >= 1;i--)
	{
		index = (index + (str[i] - '0')*ten)%MOD;
		ten = ten*10%MOD;
		ans += num[index];
		num[index]++;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 4032
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<utility>
#include<list>
using namespace std;
int main(){
	int n; cin>>n;
	int cnt=0;
	int arr[4]; for(int i=0;i<4;i++)arr[i]=0;
	char str[2];
	//cin>>S;

	for(int i=0;i<n;i++){
		cin>>str[0];
		if(str[0] == 'P')arr[0] = 1;
		if(str[0] == 'W')arr[1] = 1;
		if(str[0] == 'G')arr[2] = 1;
		if(str[0] == 'Y')arr[3] = 1;
	}

	for(int i=0;i<4;i++){
		if(arr[i] == 1)cnt++;
	}
	if(cnt == 3)cout<< "Three" <<endl;
	if(cnt == 4)cout<< "Four" <<endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define U [7<<15]={}
#define G )+((c=A[a]+A[P[a]]+C[a])%k?c:0)-M(
typedef long long L;using namespace std;map<L,L>T U;L P U,Z U,H U,C U,A U,O U,X U,B U,k,n,a,b,c;char s U;L M(L f){return f?B[f]+M(f^f&-f):0;}L S(L a,L i){for(a=M(i++G i);i<2e5;i+=i&-i)B[i]+=a;}L D(L f){L d;for(map<L,L>::iterator I=T[f].begin();I!=T[f].end();I++)d=I->first,d-P[f]?P[d]=f,C[d]=I->second,D(d),Z[f]+=++Z[d],Z[H[f]]<Z[d]?H[f]=d:0:0;}L K(L f){a=X[f];n=X[b];return a-n?Z[a]>Z[n]?n=b,b=f,K(n):M(O[f]G O[a])+K(P[a]):abs(M(O[f])-M(O[b]));}main(){for(cin>>n>>k;--*Z+n;T[a][b]=T[b][a]=c)cin>>a>>b>>c;for(D(n=0);Z[a=H[P[n]]-n?n:0];*Z=++n)for(;!O[a];S(a=H[a],O[a]=++b))X[a]=n;for(cin>>a;cin>>s>>a>>b;S(H[a],O[a]),S(a,O[a]-1))*s&2?cout<<K(a)<<endl,0:A[a]+=b;}

Measured memory_bytes: 37312
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;

int main()
{
    ll n, k;
    cin >> n >> k;
    vector<ll> h(n, 0);
    vector<ll> dp(n, numeric_limits<ll>::max());
    for (ll i = 0; (i < n); ++i) {
        cin >> h[i];
    }
    dp[0] = 0;
    for (ll i = 1; (i < n); ++i) {
        for (ll j = 1; (j <= k); ++j) {
            ll prev = i - j;
            if (prev < 0) continue;
            dp[i] = min(dp[i], dp[prev] + abs(h[i] - h[prev]));
        }
    }
    cout << dp[n-1] << endl;
    return 0;
}


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

int main(){
    ll x, y;
    cin >> x >> y;

    ll cou = 0;
    ll s = x;
    while(1){
        if(s > y){
            break;
        }
        s *= 2;
        cou++;
        //cout << s << " " << cou << endl;
    }

    cout << cou << endl;
}

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

string S;



string dfs(int &cur,int v){
    if(v==0){
        if(S[cur]=='['){
            cur++;
            string ret=dfs(cur,1);
            cur++;
            reverse(all(ret));
            return ret;
        }
        string ret="A";
        int d=0;
        while(true){
            if(S[cur]=='+'){
                cur++;
                d++;
                continue;
            }
            if(S[cur]=='-'){
                cur++;
                d--;
                continue;
            }
            if(S[cur]=='?'){
                cur++;
                ret[0]='?';
                break;
            }
            ret[0]=(S[cur]-'A'+d+114514*26)%26+'A';
            cur++;
            break;
        }
        return ret;
    }
    else{
        string ret=dfs(cur,0);
        while(S[cur]!=']'&&S[cur]!='='){
            ret+=dfs(cur,0);
        }
        return ret;
    }
}

void solve(){
    S+="=";
    int cur=0;
    S=dfs(cur,1);
    rep(i,S.size())if(S[i]=='?')S[i]='A';
    cout<<S<<endl;
}

signed main(){
    while(cin>>S,S!=".")solve();
    return 0;
}

Measured memory_bytes: 3088
void main()
{
    int n = readln.chomp.to!int;
    int[] a = readln.split.to!(int[]);

    int cnt;
    foreach (x; a)
    {
        while (x % 2 == 0)
        {
            x /= 2;
            ++cnt;
        }
    }

    cnt.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 2684
//http://blog.livedoor.jp/misteer/archives/9017497.html めちゃめちゃ勉強になりました！
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll max(ll a,ll b){return a<b ? b:a;}
int main(void){
    ll n,c; cin>>n>>c;
    vector <ll> x(n+2), v(n+2);
    for(int i=1;i<=n;i++){
        cin>>x[i]>>v[i];
    }
    x[0] = 0;
    x[n+1] = c;
    
    ll cal = 0;
    vector <vector<ll>> dp(2 ,vector <ll>(1000010,0 ));
    
    for(int i=1;i<=n;i++){
        cal -= x[i] - x[i-1];
        cal += v[i];
        dp[0][i] = max(dp[0][i-1], cal);
    }
    
    cal = 0;
    for(int i=n;i>=1;i--){
        cal -= x[i+1] - x[i];
        cal += v[i];
        dp[1][i] = max(dp[1][i+1], cal);
    }
    
    ll ans = 0;
    for(int i=0;i<=n;i++){
        cal = dp[0][i] + dp[1][i+1] - x[i];
        ans = max(ans, cal);
        
        cal = dp[0][i] + dp[1][i+1] - c + x[i+1];
        ans = max(ans, cal);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 25216
#include <iostream>
using namespace std;
typedef long long ll;
int main() {
    ll W, H, x, y;
    cin >> W >> H >> x >> y;
    ll t(W * H);
    cout << t / 2 << (t % 2 ? ".5 " : " ") << (2 * x == W && 2 * y == H) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
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<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

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

//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);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

int main() {
  int n,m;
  cin >> n >> m;
  cout << (n-1)*(m-1) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define MAX 100
#define INF 1000000000
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n,G[MAX][MAX];

int prim(void){
  int i,u,v,min,sum;
  int d[MAX],p[MAX],color[MAX];

  for(i=0;i<n;i++){
    d[i] = INF;
    p[i] = -1;
    color[i] = WHITE;
  }
  d[0] = 0;

  while(1){
    min = INF;
    u = -1;
    for(i=0;i<n;i++){
      if((min>d[i])&&(color[i]!=BLACK)){
        u = i;
        min = d[i];
      }
    }
    
    if(u==-1){
      break;
    }
    color[u] = BLACK;
    for(v=0;v<n;v++){
      if((color[v]!=BLACK)&&(G[u][v]!=INF)){
        if(d[v]>G[u][v]){
            d[v] = G[u][v];
            p[v] = u;
            color[v] = GRAY;
        }
      }
    }
  }

  sum = 0;
  for(i=0;i<n;i++){
    if(p[i]!=-1){
      sum = sum+G[i][p[i]];
    }
  }

  return sum;
}

int main(){
  int i,j,cost;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&cost);
      if(cost==-1){
        G[i][j] = INF;
      }else{
        G[i][j] = cost;
      }
    }
  }

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



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

#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl
#define rep(i, n) for (int i = (int)(0); i < (int)(n); i++)
#define repp(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define all(v) v.begin(), v.end()
#define dump(v)                  \
    cerr << #v ":[ ";            \
    for (auto macro_vi : v) {    \
        cerr << macro_vi << " "; \
    }                            \
    cerr << "]" << endl;
#define ddump(v)                           \
    cerr << #v ":" << endl;                \
    for (auto macro_row : v) {             \
        cerr << "[";                       \
        for (auto macro__vi : macro_row) { \
            cerr << macro__vi << " ";      \
        }                                  \
        cerr << "]" << endl;               \
    }
using lint       = long long;
const int INF    = 1e9;
const lint LINF  = 1e18;
const lint MOD   = 1e9 + 7;
const double EPS = 1e-10;

int main() {
    lint A;
    long double B;
    cin >> A >> B;

    lint tmp = (A * B);

    cout << tmp << endl;

    return 0;
}


Measured memory_bytes: 3728
#include <bits/stdc++.h>
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll div_ceil(ll, ll);

int dx[4] = {0, 0, -1, 1};
int dy[4] = {-1, 1, 0, 0};

int main() {
  ll N, a, b, c, d;
  std::cin >> N >> a >> b >> c >> d;
  string S;
  std::cin >> S;
  bool ans = true;
  if (c < d) {
    for (int i = a - 1; i < d - 1; i++) {
      if (S[i] == '#' && S[i + 1] == '#') {
        ans = false;
      }
    }
  } else {
    ans = false;
    for (int i = b - 2; i < d - 1; i++) {
      if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {
        ans = true;
      }
    }
    for (int i = a - 1; i < c - 1; i++) {
      if (S[i] == '#' && S[i + 1] == '#') {
        ans = false;
      }
    }
  }
  if (ans) {
    std::cout << "Yes" << '\n';
  } else {
    std::cout << "No" << '\n';
  }
}

ll div_ceil(ll a, ll b) {
  ll quotient = a / b;
  ll remainder = a % b;
  if (remainder == 0) {
    return quotient;
  } else {
    return quotient + 1;
  }
}


Measured memory_bytes: 640
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    string T;
    cin >> T;
    rep(i, T.size()) {
        if(T[i] == '?') {
            T[i] = 'D';
        }
    }
    cout << T << endl;
    return 0;
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
using namespace std;
 
signed main () {
    string s;
    cin >> s;
    for (int i = 0; i < int(s.size()); ++i) {
        if (s[i] == '1')
          	cout << '9';
        else if (s[i] == '9')
          	cout << '1';
        else 
          	cout << s[i];
    }
    cout << '\n';
}

Measured memory_bytes: 3620
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<deque>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;


int main() {
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> s(h);
    for (int i = 0; i < h; i++)
    {
        cin >> s[i];
    }

    vector<vector<int>> ans(h, vector<int>(w, -1));
    vector<bool> ok(h, false);
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (s[i][j] == '#') {
                ok[i] = true;
            }
        }
    }

    int now = 1;
    for (int i = 0; i < h; i++)
    {
        if (ok[i]) {
            ans[i][0] = now;
            bool f = true;
            for (int j = 0; j < w; j++)
            {
                if (f && s[i][j]=='#') {
                    f = false;
                }
                else if (!f && s[i][j] == '#') {
                    now++;
                }
                ans[i][j] = now;
            }
            now++;
        }
    }

    if (!ok[0]) {
        for (int j = 0; j < w; j++)
        {
            ans[0][j] = ans[1][j];
        }
        
    }
    
    
    for (int i = 1; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (!ok[i]) {
                ans[i][j] = ans[i-1][j];
            }
        }
        
    }
    
    if (!ok[h-1]) {
        for (int j = 0; j < w; j++)
        {
            if (ans[h-1][j] == -1)
                ans[h-1][j] = ans[h-2][j];
        }
    }
    
    for (int i = h-2; i >= 0; i--)
    {
        for (int j = 0; j < w; j++)
        {
            if (ans[i][j] == -1 && !ok[i])
                ans[i][j] = ans[i+1][j];
        }
        
    }
    
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (j == w-1) {
                printf("%d\n", ans[i][j]);
            }
            else {
                printf("%d ", ans[i][j]);
            }
        }
        
    }
    

    return 0;
}

Measured memory_bytes: 1280
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int n;
ll m;
vector<int> g[100000];
ll dp[100000];
bool used[100000];
void dfs(int x){
	used[x]=1;
	dp[x]=1;
	for(auto y:g[x]){
		if(!used[y]){
			dfs(y);
			dp[x]*=(1+dp[y]);
			dp[x]%=m;
		}
	}
}
ll ans[100000];
ll dp2[100000];
void dfs2(int x){
	used[x]=1;
	vector<int> child;
	for(auto y:g[x]){
		if(used[y]) continue;
		child.push_back(y);
	}
	vector<ll> c, c2;
	c.push_back(1); c2.push_back(1);
	for(int i=0; i<child.size(); i++){
		c.push_back(c[i]*(1+dp[child[i]])%m);
	}
	for(int i=0; i<child.size(); i++){
		c2.push_back(c2[i]*(1+dp[child[(int)child.size()-1-i]])%m);
	}
	for(int i=0; i<child.size(); i++){
		dp2[child[i]]=c[i]*c2[(int)child.size()-i-1]%m*(1+dp2[x])%m;
	}
	ans[x]=1;
	for(auto y:g[x]){
		if(used[y]){
			ans[x]*=(1+dp2[x]);
			ans[x]%=m;
		}else{
			ans[x]*=(1+dp[y]);
			ans[x]%=m;
		}
	}
	for(auto y:g[x]){
		if(!used[y]) dfs2(y);
	}
}
int main()
{
	cin>>n>>m;
	for(int i=0; i<n-1; i++){
		int x, y;
		cin>>x>>y;
		x--; y--;
		g[x].push_back(y); g[y].push_back(x);
	}
	dfs(0);
	fill(used, used+n, 0);
	dp2[0]=0;
	dfs2(0);
	for(int i=0; i<n; i++){
		cout<<ans[i]<<endl;
	}
	return 0;
}

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

using namespace std;


#ifdef zxc

#include <sys/resource.h>
#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ll = int64_t;
using ld = long double;
const ld EPS = 1e-9;
//const ll MOD = 924844033;
const ld PI = 3.141592653589793;
const int maxn = 300001;
const ll MOD = 1e9 + 7;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

ll pw(ll a, ll b) {
    ll res = 1;
    for (; b; b >>= 1) {
        if (b & 1) {
            res = res * a % MOD;
        }
        a = a * a % MOD;
    }
    return res;
}

template<typename Cont>
vector<vector<int>> accum2d(Cont a, int n, int m) {
    vector<vector<int>> res(n, vector<int>(m));

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            res[i][j] = a[i][j];
            if (i > 0) {
                res[i][j] += res[i - 1][j];
            }
            if (j > 0) {
                res[i][j] += res[i][j - 1];
            }
            if (i > 0 && j > 0) {
                res[i][j] -= res[i - 1][j - 1];
            }
        }
    }
    return res;
}

vector<vector<int>> resize2d(vector<vector<int>> a, int n, int m) {
    a.resize(n);
    for (auto &x:a) {
        x.resize(m);
    }
    return a;
}

int up[1030][1030];
int down[1030][1030];
int lft[1030][1030];
int rght[1030][1030];
int ans[1030][1030];
int pref[1030][1030];
int arifm[1030][1030];
int dp1[1030][1030];
int dp2[1030][1030];

signed main() {
#ifdef zxc
    struct rlimit rl;
    const rlim_t kStackSize = 512L * 1024L * 1024L;
    assert(!getrlimit(RLIMIT_STACK, &rl));
    rl.rlim_cur = kStackSize;
    assert(!setrlimit(RLIMIT_STACK, &rl));
    freopen("../kolya_input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    //    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    //            freopen("", "r", stdin);
    //        freopen("hack.out", "w", stdout);
#endif
    auto solve = [](int _) {
        int m, d;
        cin >> m >> d;
        int ans = 0;
        for (int i = 1; i <= m; ++i) {
            for (int j = 1; j <= d; ++j) {
                int x, y;
                x = j % 10;
                y = j / 10;
                if (x >= 2 && y >= 2 && x*y==i) {
                    ++ans;
                }
            }
        }
        cout << ans;
    };


    fast_io();
    cout.precision(9);
    cout << fixed;
    auto start = chrono::steady_clock::now();
    for (int i = 1; i <= 1; ++i)solve(i);
    auto end = chrono::steady_clock::now();

    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}


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

int a, b, c;

int main(void){
	cin >> a >> b >> c;
	if(b - a == c - b) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}


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

using namespace std;

int main() {

	long n = 0, Ai = 0;
	cin >> n;
	multiset<int> mset;

	for (int i = 1; i < n; i++) {
		cin >> Ai;
		mset.insert(Ai);
	}

	for (int i = 1; i <= n; i++) {
		cout << mset.count(i) << "\n";
	}



	return 0;
}

Measured memory_bytes: 12972