akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
using ll = long long;

int main() {
	string S;
	cin >> S;
	if (S[5] == '0' && (S[6] == '4' || S[6] == '3' || S[6] == '2' || S[6] == '1')) {
		cout << "Heisei" << endl;
	}
	else {
		cout << "TBD" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        final int m = scanner.nextInt();
        final int k = scanner.nextInt();

        final long[] arrayA = new long[n];
        arrayA[0] = scanner.nextInt();
        for (int i = 1; i < n; i++) {
            arrayA[i] = arrayA[i - 1] + scanner.nextInt();
        }

        final long[] arrayB = new long[m];
        arrayB[0] = scanner.nextInt();
        for (int i = 1; i < m; i++) {
            arrayB[i] = arrayB[i - 1] + scanner.nextInt();
        }

        final long result = Arrays.binarySearch(arrayB, k);
        long max = result >= 0 ? result + 1 : ~result;
        for (int i = 0; i < n; i++) {
            if (arrayA[i] > k) {
                break;
            }

            final long tmp = Arrays.binarySearch(arrayB, k - arrayA[i]);
            max = Math.max(max, i + 1 + (tmp >= 0 ? tmp + 1 : ~tmp));
        }

        System.out.println(max);
    }

    private static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

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

Measured memory_bytes: 62028
#include <bits/stdc++.h>
#include<stack>
#define MAX (ll)(8e3)
#define INF (ll)(1e18)
#define MOD (ll)(998244353)
using namespace std;
using ll = long long;
const int mx=8e3;
int n,a[1000000],d[1000000];
int f(int i ,int n)
{
    if(i==n) return 0;
    if(d[i]!=-1) return d[i];
    int cost=abs(a[i]-a[i+1])+f(i+1,n);
    if(i+2<=n)
    {
        cost=min(cost,abs(a[i]-a[i+2])+f(i+2,n));

    }
    return d[i]=cost;



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


for(int i=1;i<=n;i++)
{
    cin>>a[i];
}
memset(d,-1,sizeof(d));
cout<<f(1,n);
}













Measured memory_bytes: 11008
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 998244353;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
}

int main() {
  ll n, k, c;
  cin >> n >> k >> c;
  string s;
  cin >> s;
  vector <ll> l;
  vector <ll> r;
  rep(i, n) {
    if (s.at(i) == 'o') {
      l.push_back(i);
      i += c;
    }
    if (l.size() == k) break;
  }
  for (ll i = n-1; i >= 0; i--) {
    if (s.at(i) == 'o') {
      r.push_back(i);
      i -= c;
    }
    if (r.size() == k) break;
  }
  sort(r.begin(), r.end());
  rep(i, k) {
    if (l.at(i) == r.at(i)) cout << l.at(i)+1 << endl;
  }
}

Measured memory_bytes: 5108
package main

import (
	"fmt"
)

func main() {
	var a,b,k int
	fmt.Scan(&a,&b,&k)
	
  	ul := a
	if a < b {
		ul = b
	}
	
	dv := make([]int, ul)
  	idx := 0
	for i := 1; i <= ul; i++ {
		if a % i == 0  && b % i == 0{
			dv[idx] = i
          	idx++
		}
	}
  	
  	max := 0
    for i := 0; i < ul; i++ {
      if dv[i] == 0 {
      	max = i
        break
      }
    }

  	if ul == 1 {
      fmt.Println(1)
    } else {
  		fmt.Println(dv[max - k])
    }
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  if(a == b) cout << "Draw" << endl;
  else if(a == 1 || b == 1){
    if(a < b) cout<< "Alice" << endl;
    else cout << "Bob" << endl;
  }
  else if(a > b) cout << "Alice" << endl;
  else cout << "Bob" << endl;
}

Measured memory_bytes: 256
/*
  AUTHOR:SOURABH
  CREATED:03:04:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<pll , null_type, less< pll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 998244353
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

queue<ll> q;
vll v;
ll c,k;

void bfs()
{
    ll n,d;
    W(!q.empty())
    {
        n=q.front();
        q.pop();
        d=n%10;
        //cout<<n<<" "<<n<<endl;
        if(d==0)
        {
            v.pb(n*10);
            q.push(n*10);
            v.pb(n*10+1);
            q.push(n*10+1);
            c+=2;
        }
        else if(d==9)
        {
            v.pb(n*10+8);
            q.push(n*10+8);
            v.pb(n*10+9);
            q.push(n*10+9);
            c+=2;
        }
        else
        {
            v.pb(n*10+d-1);
            q.push(n*10+d-1);
            v.pb(n*10+d);
            q.push(n*10+d);
            v.pb(n*10+d+1);
            q.push(n*10+d+1);
            c+=3;
        }
        if(c>=k)
            return;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);

    ll t,i;
    t=1;
    //cin>>t;
    W(t--)
    {
        cin>>k;
        fs(i,1,10)
        {
            v.pb(i);
            q.push(i);
        }
        c=9;
        bfs();
        //sort(v.begin(),v.end());
        cout<<v[k-1];
    }
    return 0;
}

















Measured memory_bytes: 1656
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
ll qpow(ll a, ll b) { ll t = 1; while (b != 0) { if (b & 1)t = (t * a) % mod; a = (a * a) % mod; b >>= 1; }return t; }
ll a[2020];
bool use[2020] = { 1,1,1 };
ll find(ll n) {
	if (use[n])return a[n];
	use[n] = 1;
	a[n] = 1;
	for (int i = 3; i <= n; ++i) {
		a[n] += find(n-i);
		a[n] %= mod;
	}
	return a[n];
}
int main() {
	ll s;
	cin >> s;
	ll t = find(s);
	cout << t << endl;
	return 0;
}

Measured memory_bytes: 3660
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
const int N=2e5+2,inf=1e9;
int a[N],b[N];
int n,m,i,x,l,r,mid,c,zx,as;
inline void read(int &x)
{
    c=getchar();
    while ((c<48)||(c>57)) c=getchar();
    x=c^48;c=getchar();
    while ((c>=48)&&(c<=57))
    {
        x=x*10+(c^48);
        c=getchar();
    }
}
inline int ab(int x)
{
    if (x>=0) return x;
    return -x;
}
bool pd()
{
    for (i=1;i<=m;i++) b[i]=(a[i]>=mid);zx=inf;
    for (i=2;i<=m;i++) if (b[i]==b[i-1])
    {
        if ((i==n)||(i==n+1)) return b[i];
        x=min(ab(i-n),ab(n-(i-1)));
        if (x<zx)
        {
            zx=x;
            as=b[i];
        }
    }
    if (zx!=inf) return as;
    return b[1];
}
int main()
{
    read(n);m=(n<<1)-1;
    for (i=1;i<=m;i++) read(a[i]);
    l=1;r=m;
    while (l<r)
    {
        mid=l+r+1>>1;
        if (pd()) l=mid; else r=mid-1;
    }
    printf("%d",l);
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

mt19937 rng((int) chrono::steady_clock::now().time_since_epoch().count());

const int N = 2e5 + 5;

ll n, h[N], a[N];

struct SegmentTree {
    vector<ll> tree;
    vector<ll> lazy, l, r;
 
    SegmentTree(int size) : tree(4 * size), lazy(4 * size), l(4 * size), r(4 * size) {
        init(1, 0, size - 1);
    }
     
    // Functions to update when query changes =============================
 
    ll best(ll lCalc, ll rCalc) {
        return max(lCalc, rCalc);
    }
 
    void upd(int i) {
        tree[i] = best(tree[i << 1] + lazy[i << 1], tree[i << 1 | 1] + lazy[i << 1 | 1]);
    }
 
    void prob(int i) {
        lazy[i << 1] += lazy[i];
        lazy[i << 1 | 1] += lazy[i];
        lazy[i] = 0;
    }
 
    // ====================================================================
     
    void inc(int s, int e, ll v, int i = 1) {
        if(s > r[i] || e < l[i])
            return;
 
        if(s == l[i] && e == r[i]) {
            tree[i] = max(tree[i], v);
            return;
        }
     
        prob(i);
     
        inc(s, e, v, i << 1);
        inc(s, e, v, i << 1 | 1);
     
        upd(i);
    }
 
    ll qry(int s, int e, int i = 1) {
        if(s > r[i] || e < l[i]) // change the return value depending on the query
            return -INF;
 
        if(s <= l[i] && e >= r[i]) // may change if the query change
            return tree[i] + lazy[i];
     
        prob(i);
     
        auto lCalc = qry(s, e, i << 1);
        auto rCalc = qry(s, e, i << 1 | 1);
     
        upd(i);
     
        return best(lCalc, rCalc);
    }
     
    void init(int i, int s, int e) {
        l[i] = s;
        r[i] = e;
 
        if(s == e) {
            return;
        }
     
        int m = s + ((e - s) >> 1);
 
        init(i << 1, s, m);
        init(i << 1 | 1, m + 1, e);
 
        upd(i);
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);

    cin >> n;

    for (int i = 0; i < n; ++i) {
        cin >> h[i];
        --h[i];
    }

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

    ll ans = 0;
    SegmentTree st(n);
    for (int i = 0; i < n; ++i) {
        ll maxx = st.qry(0, h[i]);
        st.inc(h[i], h[i], maxx + a[i]);
        ans = max(ans, maxx + a[i]);
    }

    cout << ans << endl;
}

Measured memory_bytes: 28416
using System.Collections.Generic;
    using System.Collections;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System;

    namespace cysharp_test
    {
        class Program
        {
            static void Main (string[] args)
            {
                new Program ().solve ();
            }

            void solve ()
            {
                string[] nk = Console.ReadLine ().Split (' ').ToArray ();
                int N = int.Parse (nk[0]);
                ulong K = ulong.Parse (nk[1]);
                int[] goals = Console.ReadLine ().Split (' ').Select (int.Parse).ToArray ();
                int[] Count = new int[N];
                int now = 0;
                List<int> loop = new List<int> ();
                for (ulong i = 0; i < K; i++)
                {

                    if (Count[now] > 1)
                    {
                        Console.WriteLine (culc (K, i, now, loop.ToArray ()) + 1);
                        return;
                    }
                    else if (Count[now] > 0)
                    {
                        loop.Add (now);
                    }
                    Count[now]++;
                    now = goals[now] - 1;

                }
                Console.WriteLine (now + 1);
                Console.ReadKey ();
            }

            int culc (ulong k, ulong nowTime, int pos, int[] loop)
            {
                return loop[(int) ((k - nowTime) % (ulong) loop.Length)];
            }

        }
        struct Vector2
        {
            public Vector2 (long x, long y)
            {
                this.x = x;
                this.y = y;
            }

            public long x, y;

            public static Vector2 operator + (Vector2 a, Vector2 b)
            {
                return new Vector2 (a.x + b.x, a.y + b.y);
            }

            public static Vector2 operator - (Vector2 a, Vector2 b)
            {
                return new Vector2 (a.x - b.x, a.y - b.y);
            }

            public static Vector2 operator * (Vector2 a, long scala)
            {
                return new Vector2 (a.x * scala, a.y + scala);
            }

            public static bool operator == (Vector2 a, Vector2 b)
            {
                return (a.x == b.x) && (a.y == b.y);
            }

            public static bool operator != (Vector2 a, Vector2 b)
            {
                return !(a.x == b.x) && (a.y == b.y);
            }

            public override int GetHashCode ()
            {
                return (int) (x + y);
            }

            public override bool Equals (object obj)
            {
                if (!(obj == null) && obj is Vector2)
                {
                    return (this == (Vector2) obj);
                }
                else return false;
            }

            public override string ToString ()
            {
                return ("(" + x + "," + y + ")");
            }
        }
    }

Measured memory_bytes: 38704
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define set_bits(a) __builtin_popcount(a)
#define pb push_back
#define pf push_front
#define mod 1000000007
#define M 998244353
#define fi first
#define se second
#define endl '\n'
#define INF 1e18
#define PI 3.14159265358979323846
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);


int main()
{
     ll n,i,j;
     cin>>n;
     ll arr[n];
     for(i=0;i<n;i++)
     {
         cin>>arr[i];
     }

     ll suff[n];
     ll x = 0;

//     for(i=n-1; i>=0; i--)
//     {
//         x^=arr[i];
//         suff[i] = x;
//     }

     ll pre[n];
     x = 0;

     for(i=0;i<n;i++)
     {
        x^=arr[i];
        pre[i] = x;
     }

     ll ans[n];
     ans[n-1] = pre[n-2];
      x = ans[n-1];

     for(i=0;i<n;i++)
     {
         ans[i] = arr[i]^arr[n-1]^x;
     }

     for(i=0;i<n;i++)
     {
         cout<<ans[i]<<" ";
     }
}


Measured memory_bytes: 8212
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
n, k = map(int, input().split())
h = readints()
h_sort = sorted(h, reverse=True)
# print(h_sort)
# print(h_sort[k:])
h_sort2 = h_sort[k:]
if h_sort2 == []:
    print(0)
    exit()
ans = 0
for i in range(len(h_sort2)):
    ans += h_sort2[i]
print(ans)


Measured memory_bytes: 91516
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;


int main(){
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    string res = "No\n";
    ll i = 0;
    while (A>0 && C>0) {
        if (i%2 == 0) C -= B;
        else A -= D;
        i++;
    }
    if (A>0) res = "Yes\n";
    cout << res;
}


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

double distance(double *x, double *y, int n, int p){
    double sum=0;
    for(int i=0; i<n; i++){
        sum+=pow(abs(x[i]-y[i]),p);
    }
    return pow(sum,1.0/p);
}

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

    double x[n], y[n];
    for(int i=0; i<n; i++) cin >> x[i];
    for(int i=0; i<n; i++) cin >> y[i];

    double distanceInf=0;
    for(int i=0; i<n; i++){
        distanceInf=max(distanceInf, abs(x[i]-y[i]) );
        }

    cout << fixed << setprecision(6);
    cout << distance(x, y, n, 1) << endl;
    cout << distance(x, y, n, 2) << endl;
    cout << distance(x, y, n, 3) << endl;
    cout << distanceInf << endl;


    return 0;  
}


Measured memory_bytes: 3468
s = input()
V = [s[j] for j in range(0,len(s))]
countG = 0
countL = 0
for j in range(0,len(s)):
	if s[j] != 'A' and s[j] != 'T' and s[j] != 'C' and s[j] != 'G':
		countL = 0
	else:
		countL = countL + 1
	countG = max([countG,countL]) 
print(countG)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9 + 7;
int INF = 2e18;

signed main() {
    int N;
    cin >> N;
    vector<int> L(N);
    for (int i = 0; i < N; i++) cin >> L[i];
    sort(L.begin(), L.end());
    int ans = 0;
    for (int i = 0; i < N - 2; i++) {
        int j = i + 2;
        for (int k = i + 1; k < N; ++k) {
            while (j < N && L[i] + L[k] > L[j]) ++j;

            if (j > k) ans += j - k - 1;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
<?php
	list( $a, $b, $C ) = explode( " ", trim( fgets(STDIN) ) );
	
	$rC = deg2rad( $C );
	$h = sin( $rC )*$b;
	$ta = cos( $rC )*$b;
	$c = sqrt( pow( $a-$ta, 2 ) + pow( $h, 2 ) );
	$S = ($a*$h)/2;
	$L = $a+$b+$c;

	print $S.PHP_EOL.$L.PHP_EOL.$h;
?>

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-9;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cout<<setprecision(10)<<fixed;
  int n;
  ll d;
  cin>>n>>d;
  int ans=0;
  REP(i, n){
    ll x, y;
    cin>>x>>y;
    if(x*x+y*y<=d*d){
      ++ans;
    }
  }
  cout<<ans<<'\n';
  return 0;
}


Measured memory_bytes: 3644
A,B= map(int, input().split())
str1 = input()
li = list(str1)
flag = True
flag2 = False
for i in range(len(li)):
    if li[i] == '-' and i != A:
        flag = False
    elif  li[i] == '-':
        flag2 = True
if flag and flag2:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9104
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let x: i64 = input();
    let y: i64 = input();
    let z: i64 = input();
    println!("{}", (x - z) / (y + z));
}


Measured memory_bytes: 4352
<?php
fscanf(STDIN, "%d", $n);
$arr = explode(" ",trim(fgets(STDIN)));

$max = $arr[0];
$count = 1;
for($i=1; $i<$n; $i++){
    if($max <= $arr[$i]){
        $count++;
        $max = max($max,$arr[$i]);
    }
}

echo $count;
?>

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

int main() {
  int n;
  cin >> n;
  int ans = 0;;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    ans += r - l + 1;
  }
  cout << ans << endl;
  return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n, m; cin >> n >> m;
	vll cnt(m+1, 0);
	rep(i, n){
		ll k; cin >> k;
		rep(j, k){
			ll a; cin >> a;
			cnt[a]++;
		}
	}
	ll ans=0;
	rep(i, m+1){
		if (cnt[i]==n) ans++;
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
int a[5];
int jude(int x,int a,int b)
{
    if(x==0) return a+b;
    else return a-b;
}
int main()
{
    ios::sync_with_stdio(false);
    string t;cin>>t;
    int i,j,sum;
    for(i=0;i<1<<3;i++)
    {
        int k=i;
        sum=jude(k&1,0,t[3]-'0');
        k>>=1;
        for(j=2;j>=1;j--)
        {
            sum=jude(k&1,sum,t[j]-'0');
            k>>=1;
        }
        sum+=t[0]-'0';
        if(sum==7)
            break;
    }
    cout<<t[0];
    if((i>>2)&1) cout<<"-";
    else cout<<"+";
    cout<<t[1];
    if((i>>1)&1) cout<<"-";
    else cout<<"+";
    cout<<t[2];
    if((i>>0)&1) cout<<"-";
    else cout<<"+";
    cout<<t[3]<<"=7"<<endl;
}



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

// clang-format off
template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); }
template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); }
char capitalize(char c) { return static_cast<char>(std::toupper(static_cast<unsigned char>(c))); }
// template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); }
// template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); }
// clang-format on

#define int long long
#define YES "Yes"
#define NO  "No"
#define MOD 1000000000+7
#define forit(v) for(auto it = v.begin(); it != v.end(); ++it)
#define all(a) begin(a), end(a)

using namespace std;

int f(int m) {
  int tmp = 0;
  while (m >= 10) {
    tmp += m % 10;
    m /= 10;
  }
  tmp += m % 10;
  return tmp;
}

signed main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  int num = 0;
  // num = numeric_limits<int>::max();
  // num = numeric_limits<int>::min();
  bool flag = false;
  // flag = true;

  int x, y, z; cin >> x >> y >> z;
  if (x >= y + 2 * z) {
    x -= y + 2 * z;
    ++num;
    while(true) {
      if (x >= y + z) {
        x -= y + z;
        ++num;
      } else {
        break;
      }
    }
  }

  cout << num << endl;
  // cout << (flag ? YES : NO) << endl;
  
  return 0;
}


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

typedef pair <int, int> P;

const int N = 1e5 + 10;

int dp[N], p[N], deg[N];
priority_queue <P, vector <P>, greater <P> > pq;

int main(){
	int n, id;
	scanf("%d",&n);
	for (int i = 2; i <= n; i++){
		scanf("%d",&p[i]);
		deg[p[i]]++;
	}
	for (int i = 1; i <= n; i++){
		if (!deg[i]) pq.push({0, i});
	}
	while (!pq.empty()){
		id = pq.top().second; pq.pop();
		dp[p[id]] = max(dp[p[id]], dp[id]) + 1;
		if (--deg[p[id]] == 0) pq.push({dp[p[id]], p[id]});
	}
	printf("%d\n", dp[1]);
	return 0;
}

Measured memory_bytes: 1912
#include <iostream>
using namespace std;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	for (int i = 0; i <= a; ++i) {
		for (int j = 0; j <= b; ++j) {
			if (i*j + (a - i)*(b - j) == c) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}

Measured memory_bytes: 256
var
	N,i,j,tmp:Longint;
	S:array[1..100]of String[10];
	P,id:array[1..100]of Longint;
	t:String;
begin
	readln(N);
	for i:=1 to N do begin
		id[i]:=i;
		readln(t);
		j:=1;
		while t[j]<>' ' do begin
			S[i]:=S[i]+t[j];
			inc(j);
		end;
		inc(j);
		for j:=j to length(t)do begin
			P[i]:=P[i]*10+ord(t[j])-48;
		end;
		for j:=i-1 downto 1 do begin
			if(S[id[j]]>S[id[j+1]])or((S[id[j]]=S[id[j+1]])and(P[id[j]]<P[id[j+1]]))then begin
				tmp:=id[j];
				id[j]:=id[j+1];
				id[j+1]:=tmp;
			end else break;
		end;
	end;
	for i:=1 to N do writeln(id[i]);
end.

Measured memory_bytes: 128
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        for (int i = n-1; i >= 0; i--)
        {
            var t = int.Parse(line[i]);
            if (i == 0) Console.WriteLine(t);
            else Console.Write("{0} ", t);
        }
    }
}



Measured memory_bytes: 9176
N,X = map(int,input().split())
src = list(map(int,input().split()))

ans1 = 0
tmp = 0
for a in src:
    eat = max(0, tmp + a - X)
    ans1 += eat
    tmp = a - eat
ans2 = 0
tmp = 0
for a in reversed(src):
    eat = max(0, tmp + a - X)
    ans2 += eat
    tmp = a - eat
print(min(ans1,ans2))


Measured memory_bytes: 14068
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N, D;
    cin >> N >> D;
    set<int> root;
    for (int i = 1; i < 1000; i++)
    {
        root.insert(i * i);
    }
    int X[N][D];
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < D; j++)
        {
            cin >> X[i][j];
        }
    }
    int ans = 0;
    for (int i = 0; i < N - 1; i++)
    {
        for (int j = i + 1; j < N; j++)
        {
            int sum = 0;
            for (int k = 0; k < D; k++)
            {
                sum += pow(X[i][k] - X[j][k], 2);
            }
            if (root.find(sum) != root.end())
            {
                ++ans;
            }
        }
    }
    cout << ans << endl;
}

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

int main (){
    int x = 0;
    int x1;
    int x2;
    int x3;
    int x4;
    int x5;
    cin >> x1 >> x2 >> x3 >> x4 >> x5;
    if (x1 == x){
        cout << 1 << endl;
    }
    if (x2 == x){
        cout << 2 << endl;
    }
    if (x3 == x){
        cout << 3 << endl;
    }
    if (x4 == x){
        cout << 4 << endl;
    }
    if (x5 == x){
        cout << 5 << endl;
    }
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    string t,p;
    cin>>t>>p;
    int n=t.size(),m=p.size();
    int cur=0;
    rep(i,n){
        if(cur<m&&t[i]==p[cur]) ++cur;
        else if(t[i]==p[cur-1]){
            cout<<"no"<<endl;
            return 0;
        }
    }
    if(cur==m)cout<<"yes"<<endl;
    else cout<<"no"<<endl;
    return 0;
}


Measured memory_bytes: 4188
#include <bits/stdc++.h>
#define int long long int
#define ii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
#define MOD 1000000007
#define output(x) for (auto a:x) cout<<a<<" ";cout<<endl;
#define output2(x) for (auto a:x) cout<<a.fi<<" "<<a.se<<endl;
#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__) << "] "
  
int power(int x,int y,int mod = MOD) 
{ 
 	int ret = 1;
 	x = x % mod;
 	while (y){
 		if(y&1) ret = ((__int128)ret*x)%mod;
 		y = y>>1;
 		x = ((__int128)x*x)%mod;
    } 
    return ret%mod; 
}


#define PI 3.14159265
void solve()
{		
	int n;
	cin>>n;
	int g = 0;
	for (int i=0;i<n;i++){
		int x;
		cin>>x;
		g = __gcd(x,g);
	}
	cout<<g<<endl;
}


 
signed main(){
	// int t;
	// cin>>t;
	// while (t--)
	solve();
}
	

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> ans(n + 1, 0);
    for(int i = n; i > 0; i--) {
        if(i > n / 2) {
            if(a[i - 1] == 1) ans[i] = 1;
        } else {
            int cnt = 0;
            for(int j = i; j <= n; j += i) cnt += ans[j];
            cnt %= 2;
            if(a[i - 1] == 1 && cnt == 0) ans[i] = 1;
            else if(a[i - 1] == 0 && cnt == 1) ans[i] = 1;
        }
    }
    int m = 0;
    rrep(i, n) m += ans[i];
    cout << m << endl;
    rrep(i, n) {
        if(ans[i] == 1) cout << i << " ";
    } 
    cout << endl;

    return 0;
}

Measured memory_bytes: 2432
#include <iostream>
using namespace std;
typedef long long ll;
int main(void){
    int n;
    ll m=0, p=1;
    cin>>n;
    for(int i=0;i<n;i++){
        ll a;
        cin>>a;
        if(a>p){
            m+=(a-1)/p;
            if(p==1)p++;
        }else if(a==p)p++;
    }
    cout<<m<<endl;
}


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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	FOR(i,0,n)cin >> a[i];
	sort(ALL(a));
	ll w=-1,h=-1;
	int last = a[n-1];
	FORR(i,n-2,0){
		if(last == a[i]){
			if(w == -1){
				w = a[i];
				last = INF;
			}else if(h == -1){
				h = a[i];
				break;
			}
		}else{
			last = a[i];
		}
	}
	if(h == -1){
		ANS(0);
		return 0;
	}
	ANS(w * h);
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#define maxn 300010
using namespace std;
int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch-'0'<0||ch-'0'>9){if(ch=='-') f=-1;ch=getchar();}
    while(ch-'0'>=0&&ch-'0'<=9){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m;
struct P{
    int l,r;
}a[maxn];
vector<int>v[maxn];
int rt[maxn];
struct Segment_Tree{
    int t[maxn*20],ls[maxn*20],rs[maxn*20],tot;
    void update(int k)
    {
        t[k]=t[ls[k]]+t[rs[k]];
    }
    void modi(int &k1,int k2,int l,int r,int x)
    {
        k1=++tot;
        if(l==r)
        {
            t[k1]=t[k2]+1;
            return;
        }
        int mid=(l+r)/2;
        if(mid>=x)  rs[k1]=rs[k2],modi(ls[k1],ls[k2],l,mid,x);
        else        ls[k1]=ls[k2],modi(rs[k1],rs[k2],mid+1,r,x);
        update(k1);
    }
    int query(int k1,int k2,int l,int r,int x,int y)
    {
        if(l>=x&&r<=y)  return t[k1]-t[k2];
        int mid=(l+r)/2;
        int res=0;
        if(mid>=x)  res+=query(ls[k1],ls[k2],l,mid,x,y);
        if(mid<y)   res+=query(rs[k1],rs[k2],mid+1,r,x,y);
        return res;  
    }
}S;
int main()
{
    n=read();m=read();
    for(int i=1;i<=n;i++)  a[i].l=read(),a[i].r=read(); 
    for(int i=1;i<=n;i++)  v[a[i].l].push_back(a[i].r);
    for(int i=1;i<=m;i++)
    {
        if(!v[i].size())
        {
            rt[i]=rt[i-1];
            continue;
        }
        int las=rt[i-1];
        for(int j=0;j<v[i].size();j++)
        {
            S.modi(rt[i],las,1,m,v[i][j]);
            las=rt[i];
        }
    }
    for(int i=1;i<=m;i++)
    {
        int ans=0;
        for(int j=i;j<=m;j+=i)  ans+=S.query(rt[j],rt[j-i],1,m,j,m);
        printf("%d\n",ans);
    }
    return 0;
}

Measured memory_bytes: 84480
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////


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

    map<ll,ll> m;
    rep(i,2,n+1){
	ll t = 2;
	ll j = i;
	while(j >= t){
	    while(j%t == 0){
		m[t]++;
		j /= t;
	    }
	    t++;
	}
    }
    /*   for(auto i : m){
	PS(i.ft);P(i.sd);
	}*/
    
    ll ans = 1;
    for(auto i : m){
	ans *= i.sd + 1;
	ans = mod(ans);
    }
    P(ans);
    return  0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void)
{
	int a,i,n,m,x[100];
	cin>>n;
	for(i=0;i<n;i++) cin>>x[i];
	cin>>m;
	for(i=0;i<m;i++){
		cin>>a;
		if((a==n || x[a]!=x[a-1]+1) && x[a-1]<2019) x[a-1]++;
	}
	for(i=0;i<n;i++) cout<<x[i]<<endl;
	return 0;
}


Measured memory_bytes: 3120
#include<stdio.h>
int main(void)
{
    long long int n,x,k,d,i;
    scanf("%lld %lld %lld",&x,&k,&d);
    if(x != 0)
    {
        if(x < 0)
        {
            x = -1 * x;
        }
        if(x / d >= k  )
        {
            printf("%lld\n",x - d * k);
            return 0;
        }
        else
        {
            long long int a;
            a = x / d;
            x = x - d * a;
            if(x < 0)
            {
                x = -1 * x;
            }
            if((k - a) % 2 == 0)
            {
                printf("%lld\n",x);
                return 0;
            }
            else
            {
                printf("%lld\n",d - x);
                return 0;
            }
        }
    }
    else
    {
        if(k % 2 == 0)
        {
            printf("0\n");
            return 0;
        }
        else
        {
            printf("%lld\n",d);
            return 0;
        }
    }
    
    
    return 0;
}

Measured memory_bytes: 1724
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define repa(i, s, n) for(int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
int x;
bool isbeki[1010];

int main() {
    cin >> x;
    isbeki[1] = true;
    for (int i = 2;i<=1000; i++) {
        for (int j = 2; pow(i, j) <= 1000; j++) {
            isbeki[(int)pow(i, j)] = true;
        }
    }
    for (int i=x; i >= 0; i--) {
        if (isbeki[i]) {
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 4064
#include<stdio.h>
int main(){
    int a,b,x,y;
    while(1){
        scanf("%d %d",&x,&y);
        if(x==0&&y==0)break;
        for(b=1;b<=x;b++){
            for(a=1;a<=y;a++){
            	if(b%2==1){
            	    if(a%2==1){
                        printf("#");
            	    }
            	    else{
            		    printf(".");
            	    }
            	}
            	else{
            		if(a%2==0){
            			printf("#");
            		}
            		else{
            			printf(".");
            		}
            	}
            }
            printf("\n");
        }
        printf("\n");
    }
             
    return 0;
}

Measured memory_bytes: 2520
#include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,C,D;
cin >> A >> B >> C >> D;
int M,N;
if(A%D==0){
  M = A/D;
}
else{
  M= A/D +1;
}
if(C%B==0){
  N = C/B;
}
else{
  N = C/B + 1;
}
if(M >= N){
  cout << "Yes" << endl;
}
else{
  cout << "No" << endl;
}
}


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

bool jou(int a,int b,int c) {
	if(a<b&&b<c) return true;
	else return false;
}
int main() {
	int a,b,c,k; cin >> a >> b >> c >> k;
	for(int tata=0;tata<=k;tata++) {
		int i= 1 << tata;
		int j= 1 << (k-tata);
		int A=a,B=b*i,C=c*j;
		if(jou(A,B,C)) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  int m, d;
  cin >> m >> d;

  int ans = 0;
  rep(i, m) {
    rep(j, d) {
      int a = (j+1)%10;
      int b = (j+1)/10;
      if (a >= 2 && b >= 2 && a*b == i+1) {
        ans++;
      }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
  int N,l;
  cin >> N >> l;
  vector<string> data(N);
  for(int i = 0; i < N; i++){
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  for(int i = 0; i < N; i++){
    cout << data.at(i);
  }
  return 0;
}


Measured memory_bytes: 256
s=input()
rev=s[::-1]
can='YES'
while(len(rev)!=0):
    if(rev[:3]=='rem'):
        if(rev[:7]=='remaerd'):
            rev=rev[7:]

        else:
            can='NO'
            break
    
    elif(rev[:3]=='res'):
        if(rev[:6]=='resare'):
            rev=rev[6:]

        else:
            can='NO'
            break
    
    elif(rev[0]=='e'):
        if(rev[:5]=='esare'):
            rev=rev[5:]

        else:
            can='NO'
            break
    elif(rev[0]=='m'):
        if(rev[:5]=='maerd'):
            rev=rev[5:]

        else:
            can='NO'
            break
    else:
        can='NO'
        break

print(can)

Measured memory_bytes: 9300
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>

using namespace std;

void Show(vector<vector<bool>> S) {
	for (int i = 0; i < S.size(); i++) {
		for (int j = 0; j < S[i].size(); j++) {
			if ((S[i][j])) {
				cout << '.';
			} else {
				cout << '#';
			}
		}
		cout << endl;
	}
}
int main() {
	int a, b;
	cin >> a >> b;
	cout << ((a > b) ? a - 1 : a) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

#define MOD 1000000007

ll extgcd(ll a, ll b, ll& x, ll& y) {
    if(b==0){
        x=(a>=0)?1:-1;
        y=0;
        return abs(a);
    }else{
        ll res=extgcd(b,a%b,y,x);
        y-=(a/b)*x;
        return res;
    }
}

ll mod_inverse(ll a, ll m) {
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

ll c(ll n, ll k) {
    ll res=1;
    for(ll i=0;i<k;i++)res=(res*((n-i)%MOD))%MOD;
    for(ll i=1;i<=k;i++)res=(res*mod_inverse(i,MOD))%MOD;
    return res;
}

ll fact[200010];
ll inv[200010];

int main(){
    
    ll H,W,A,B;
    cin>>H>>W>>A>>B;
    
    ll fa=1,in=1;
    REP(i,200010){
        fact[i]=fa;
        inv[i]=in;
        fa*=(i+1); fa%=MOD;
        in=mod_inverse(fa,MOD); in%=MOD;
    }
    
    ll ans=0;
    for(ll i=B+1;i<=W;i++){
        ll size1=(H-A-1)+i-1;
        ll size2=(W-i)+(A-1);
        ll tt=(((fact[size1]*inv[size1-(i-1)])%MOD)*inv[i-1])%MOD;
        tt*=(((fact[size2]*inv[size2-(A-1)])%MOD)*inv[A-1])%MOD;
        ans+=tt%MOD;
        ans%=MOD;
    }
    
    cout<<ans<<endl;
    
    
    return 0;
}

Measured memory_bytes: 3456
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const ll mod=1e9+7;

int main(){
  string s;
  cin >> s;
  cout << string(s.length(),'x') << endl;
  return 0;
}


Measured memory_bytes: 256
a=tuple(input())
len_a=len(a)
b=tuple(input())
len_b=len(b)
c=tuple(input())
len_c=len(c)
flag_ab=[True]*20000
for i in range(len_a):
  for j in range(len_b):
    if a[i]!=b[j] and a[i]!='?' and b[j]!='?':
      flag_ab[i-j+10000]=False
flag_ac=[True]*20000
for i in range(len_a):
  for j in range(len_c):
    if a[i]!=c[j] and a[i]!='?' and c[j]!='?':
      flag_ac[i-j+10000]=False
flag_bc=[True]*20000
for i in range(len_b):
  for j in range(len_c):
    if b[i]!=c[j] and b[i]!='?' and c[j]!='?':
      flag_bc[i-j+10000]=False
ans=len_a+len_b+len_c
left_a=0
for left_b in range(-(len_b+len_c),len_b+len_c+1):
  for left_c in range(-(len_b+len_c),len_b+len_c+1):
    if flag_ab[left_b-left_a+10000] and flag_ac[left_c-left_a+10000] and flag_bc[left_c-left_b+10000]:
      right_a=left_a+len_a
      right_b=left_b+len_b
      right_c=left_c+len_c
      left=min(left_a,left_b,left_c)
      right=max(right_a,right_b,right_c)
      ans=min(ans,right-left)
print(ans)

Measured memory_bytes: 51020
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define sp ' '
#define f first
#define s second
#define boost() cin.tie(0); cin.sync_with_stdio(0)
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 102, MAXK = 1e5+2, MOD = 1e9+7;
int N, K, cur, dp[MAXK], diff[MAXK];
int main(){
	boost();
	cin >> N >> K;
	dp[0] = 1;
	for(int i = 0, a;i<N;i++){
		memset(diff, 0, sizeof(diff));
		cin >> a;
		for(int j = 0;j<=min(cur, K-1);j++){
			int l = j+1, r = min(K+1, j+a+1);
			diff[l]=(diff[l]+dp[j])%MOD;
			diff[r]-=dp[j];
			if(diff[r]<0)diff[r]+=MOD;
		}
		int pre = 0;
		for(int j = 0;j<=K;j++){
			pre=(pre+diff[j])%MOD;;
			dp[j]=(dp[j]+pre)%MOD;
		}
		cur = min(K, cur+a);
	}
	cout << dp[K] << nl;
	return 0;
}

Measured memory_bytes: 1024