akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    a();
  }

  public static void a() {
    try (Scanner sc = new Scanner(System.in)) {
      int totalnum = Integer.parseInt(sc.next());
      int al = Integer.parseInt(sc.next());

      System.out.println(totalnum * al);
    }
  }
}

Measured memory_bytes: 35728
#include<stdio.h>
int main()
{
    int A=500,B=100,C=50;
    int a,b,c,x,way=0,i,j,k;
    scanf("%d %d %d %d",&a,&b,&c,&x);
    for(i=0;i<=a;i++)
    {
        for(j=0;j<=b;j++)
        {
            for(k=0;k<=c;k++)
            {
                if(A*i+B*j+C*k==x)
                {
                    way+=1;
                    continue;
                }
            }
        }
    }
    printf("%d\n",way);
    return 0;
}


Measured memory_bytes: 128
N,A,B,C = int(input()),input(),input(),input()
r = 0

for i in range(N):
	if not(A[i]==B[i]) and not(B[i]==C[i]) and not(C[i]==A[i]):
		r += 2
	elif not(A[i]==B[i] and B[i]==C[i]):
		r += 1
print(r)

Measured memory_bytes: 61944
from collections import defaultdict, deque

N, u, v = map(int, input().split())
G = defaultdict(lambda: [])

for _ in range(N-1):
    a,b=map(int,input().split())
    G[a].append(b)
    G[b].append(a)


if G[u] == [v]:
    print(0)
    exit()


def bfs(v):
    seen = [0]*(N+1)
    queue = deque()
    dist = [-1]*(N+1)
    dist[v] = 0
    seen[v] = 1
    queue.append(v)
    while queue:
        q = queue.popleft()
        for nx in G[q]:
            if seen[nx]:
                continue
            dist[nx] = dist[q] + 1
            seen[nx] = 1
            queue.append(nx)
    return dist

d_u = bfs(u)
d_v = bfs(v)
ans = 0
for node in range(1, N+1):
    if d_u[node] < d_v[node] and len(G[node]) == 1:
        ans = max(ans, d_v[node]-1)
print(ans)

Measured memory_bytes: 96920
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
 
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;
 
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
 
#define F first
#define S second
#define mp make_pair
#define append push_back
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long int
#define pb push_back
#define print(a) cout<<a<<endl
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define all(x) x.begin(), x.end()
#define loop(i,n) for(int i = 0; i < n; i++)
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>void __f(const char* name, Arg1&& arg1){cout<<name<<" : "<<arg1<<"\n";}
template <typename Arg1, typename... Args>void __f(const char* names, Arg1&& arg1, Args&&... args)
{const char* comma=strchr(names+1,',');cout.write(names,comma-names)<<" : "<<arg1<<" , ";__f(comma+1, args...);} 
#define debugfor(x,a) { cerr<<#a<<": "; for(auto u : a) cerr<<u<<" "; cerr<<endl; }
//#define int long long int
 
const int MOD = 13;
 
int fastexpo(int x, int y) 
{ 
    int res = 1;
    x = x % MOD;
    while (y) 
    { 
        if (y & 1) res = (res*x) % MOD; 
        y = y>>1;
        x = (x*x) % MOD;   
    } 
    return res; 
}
 
void solve();
 
signed main(){
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
 
	int t = 1;
	//cin>> t;
	while(t--){
		solve();
	}
 
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}
const int modd=1e9+7;
void solve()
{
	string s;
	cin>>s;
	int l=s.length(),xyz,last[13],curr[13];
	mem(last,0);
	last[0]=1;
	for(int i=l-1;i>=0;i--)
	{
		mem(curr,0);
		if(s[i]=='?')
		{
			for(int j=0;j<13;j++)
			{
				if(last[j]>0)
				{
					loop(k,10)
					{
						xyz=(j+(k*fastexpo(10,l-i-1)))%13;
						curr[xyz]+=last[j];
						curr[xyz]%=modd;
					}
				}
			}
		}
		else
		{
			loop(k,13)
			{
				xyz=(k+((s[i]-'0')*fastexpo(10,l-i-1)))%13;
				curr[xyz]+=last[k];
				curr[xyz]%=modd;
			}
		}
		loop(i,13)
			last[i]=curr[i];
	}
	cout<<last[5];
}

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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO  cout << "NO"  << endl
#define No  cout << "No"  << endl

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int H; cin >> H;
    int A; cin >> A;
    cout << (H+A-1) / A << endl;
}
    
int main() 
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


typedef long double D;
const D PI = acos(-1.0);
const D EPS = 1e-10;
class P { public:
  D x, y;
  P(D x=0, D y=0) : x(x), y(y) {}

  P& operator+=(const P& o) { x += o.x; y += o.y; return *this; }
  P& operator-=(const P& o) { x -= o.x; y -= o.y; return *this; }
  P& operator*=(const P& o) { return *this = {x*o.x - y*o.y, x*o.y + y*o.x}; }
  P& operator*=(const D& r) { x *= r; y *= r; return *this; }
  P& operator/=(const D& r) { x /= r; y /= r; return *this; }
  P operator-() const { return {-x, -y}; }

  D norm() const { return x*x + y*y; }
  D abs() const { return sqrt(norm()); }
  D arg() const { return atan2(y, x); }
  bool isZero() const { return std::abs(x) < EPS && std::abs(y) < EPS; }
  /** 象限 */
  int orth() const { return y >= 0 ? (x >= 0 ? 1 : 2) : (x < 0 ? 3 : 4); }
  static P polar(const D& rho, const D& theta = 0) { return {rho * cos(theta), rho * sin(theta)}; }
};
std::ostream &operator<<(std::ostream &os, P const &p) { return os << "(" << p.x << ", " << p.y << ")"; }
std::istream &operator>>(std::istream &is, P &p) { D a, b; is >> a >> b; p = P(a, b); return is; }
P operator+(const P& p, const P& q) { return P(p) += q; }
P operator-(const P& p, const P& q) { return P(p) -= q; }
P operator*(const P& p, const P& q) { return P(p) *= q; }
P operator*(const P& p, const D& r) { return P(p) *= r; }
P operator/(const P& p, const D& r) { return P(p) /= r; }
P operator*(const D& r, const P& p) { return P(p) *= r; }
P operator/(const D& r, const P& p) { return P(p) /= r; }
D crs(const P& a, const P& b){ return a.x*b.y - a.y*b.x; }
D dot(const P& a, const P& b){ return a.x*b.x + a.y*b.y; }
int signum(D x) {return x > EPS ? +1 : x < -EPS ? -1 : 0;}


// 凸包の直径
D convexDiamiter(const vector<P>& ps){
  int N = (int)ps.size();
  int i = 0, j = 0;
  for (int k = 1; k < N; k++) {
    if (ps[k].y > ps[i].y) i = k;
    if (ps[k].y < ps[j].y) j = k;
  }
  int si = i, sj = j;
  D max_dist = (ps[i] - ps[j]).norm();
  do {
    if (crs(ps[(i+1)%N] - ps[i], ps[(j+1)%N] - ps[j]) >= 0) j = (j+1) % N;
    else i = (i+1) % N;
    if ((ps[i] - ps[j]).norm() > max_dist) {
      max_dist = (ps[i] - ps[j]).norm();
    }
  } while( si != i || sj != j );
  return sqrt(max_dist);
}


int main2() {
  int N; cin >> N;
  vector<P> ps(N);
  REP(i, N) cin >> ps[i];
  double ans = (double)convexDiamiter(ps);
  printf("%.10f\n", ans);
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}



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

int a[3][100000];
int x[100000];
int inv[100000];
int BIT[100001];

void init(){
	for(int i=1;i<=100000;i++)
		BIT[i]=0;
}

void add(int x){
	for(;x<=100000;x+=x&-x)
		BIT[x]++;
}

int query(int x){
	int res=0;
	for(;x>0;x-=x&-x)
		res+=BIT[x];
	return res;
}

void fail(){
	cout<<"No"<<endl;
	exit(0);
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	for(int i=0;i<3;i++)
		for(int j=0;j<n;j++)
			cin>>a[i][j];
	vector<pair<int,int> > v0,v1;
	long long int cnt0=0,cnt1=0,inv0=0,inv1=0;
	for(int i=0;i<n;i++){
		if(abs(a[0][i]-a[1][i])!=1||abs(a[1][i]-a[2][i])!=1)
			fail();
		x[i]=a[1][i]/3;
		if((x[i]&1)^(i&1))
			fail();
		inv[i]=a[0][i]>a[1][i];
		if(i&1)
			v1.emplace_back(x[i],i),inv1+=inv[i];
		else
			v0.emplace_back(x[i],i),inv0+=inv[i];
	}
	sort(v1.begin(),v1.end(),greater<pair<int,int> >());
	sort(v0.begin(),v0.end(),greater<pair<int,int> >());
	for(auto it:v0){
		cnt0+=query(it.second+1);
		add(it.second+1);
	}	
	init();
	for(auto it:v1){
		cnt1+=query(it.second+1);
		add(it.second+1);
	}
	if((inv1+cnt0)&1)
		fail();
	if((inv0+cnt1)&1)
		fail();
	cout<<"Yes"<<endl;
}


Measured memory_bytes: 3572
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int N=200005;
int n,m,ans,res,l,r,mid,a[N],b[N];
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=2*n;i++){
		scanf("%d",&a[i]);
	}
	sort(a+1,a+2*n+1);
	l=0,res=r=n;
	while(l<=r){
		mid=(l+r)/2;
		int t=2*mid;
		bool flag=true;
		b[0]=0;
		for(int i=t+1;i<=2*n;i++){
			b[++b[0]]=a[i];
		}
		for(int i=1;2*i<=b[0];i++){
			if(b[i]+b[b[0]-i+1]<m){
				flag=false;
				break;
			}
		}
		if(flag){
			res=mid;
			r=mid-1;
		}else{
			l=mid+1;
		}
	}
	b[0]=0;
	for(int i=1;i<=2*res;i++){
		b[++b[0]]=a[i];
	}
	for(int i=1;2*i<=b[0];i++){
		ans=max(ans,(b[i]+b[b[0]-i+1])%m);
	}
	b[0]=0;
	for(int i=2*res+1;i<=2*n;i++){
		b[++b[0]]=a[i];
	}
	for(int i=1;2*i<=b[0];i++){
		ans=max(ans,(b[i]+b[b[0]-i+1])%m);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3260
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){

    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

bool IsPrime(ll num){
    if(num < 2) return false;
    else if(num == 2) return true;
    else if(num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for(ll i = 3; i <= sqrtNum; i += 2){
        if(num%i==0){
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}

signed main(){
  int n; cin>>n;
  VI v(n); rep(i,n) cin>>v[i]; sort(ALL(v));
  ll ans = 0;
  for(int m=n-1;m>=0;m--){
    for(int l=m-1;l>=0;l--){
      auto itr = lower_bound(ALL(v), v[m]+v[l]);
      int ng = distance(itr, v.end());
      ans += (n-1-m) - ng;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import random as rng
import itertools as it
import collections as col
import heapq as hq
import sys
import copy as cp
sys.setrecursionlimit(10**9)


def dump_impl(*objects):
    print(*objects, file=sys.stderr)


def dump_dummy(*objects):
    pass


dump = dump_impl if "DEBUG" in sys.argv else dump_dummy

N = int(input())
S = input()
K = int(input())
ans = []
SK = S[K-1]
for si in S:
    ans.append(si if si == SK else '*')
print(''.join(ans))


Measured memory_bytes: 4976
#include <stdio.h>
  int main(){
  int a,b;
  scanf("%d %d",&a,&b);
  if(a < b){
    printf("a < b\n");	
	}else if(a > b){
    printf("a > b\n");
	}else if(a == b){
    printf("a == b\n");
}
  return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
 
using namespace std;
 
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}
typedef long long ll;
#define int ll
 
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
vi dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
// vi dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
// #define mp make_pair
//#define endl '\n'


signed main() {
    fio();

    string s, t;
    cin >> s >> t;
    int n = s.size(), m = t.size();
    int ans = inf;
    rep (i, n) {
        int cnt = 0;
        if (i + m - 1 >= n) break;
        rep (j, m) {
            if (s[i + j] != t[j]) cnt++;
        }
        chmin(ans, cnt);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3660
import java.util.*;

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

        int n = sc.nextInt();
        int[] a = new int[n];
        for(int i = 0;i < n;i++){
            a[i] = sc.nextInt();
        }

        int q = sc.nextInt();
        for(int i = 0;i < q;i++){
            int b = sc.nextInt();
            int e = sc.nextInt();
            int k = sc.nextInt();
            int count = 0;
            for(int j = b;j < e;j++){
                if(a[j] == k)   count++;
            }
            System.out.println(count);
        }
    }
}


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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

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

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

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    ll n; cin >> n;
    vector<ll> alis(n);
    REP(i, 0, n){cin >> alis[i];}
    sort(ALL(alis), greater<>());
    ll ans = 0, count = 1;
    int i = 0;
    while(n != 1){
        count++;
        ans += alis[i];
        if(count == 2){
            i++;
            count = 0;
        }
        n -= 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4828
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define INF 9223372036854775807
const ll mod=998244353;


int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    string s,t;
    cin>>s>>t;
    ll ans=0;
    for(ll i=0;i<s.size();i++)
        if(s[i]!=t[i])
            ans++;
    cout<<ans;

    
    return 0;
}

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


int main(){
	int N;
    int A=0, B=0;
    cin >> N;
    std::vector<int> v(N);

    for(int i=0;i<N;i++){
        cin >> v[i];
    }

    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());

    for(int i=0;i<N;i++){
        if(i%2==0) A = A + v[i];
        else       B = B + v[i];
    }
    printf("%d\n", A-B);

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  int a,b;
  cin>>a>>b;
  if((a+b)/2*2==(a+b)){
    cout<<(a+b)/2<<endl;
  }else{
    cout<<(a+b)/2+1<<endl;
  }
  return 0;
}


Measured memory_bytes: 764
/*----------------by syr----------------*/
/*

         iii                  ii
     rBQBBBBBBE       BBR iBBBBQBBL     XBBBBBBQBBBBB
   iBBQJ    7BBB      BBsSBBr   BBQ      i      cBBB
  rBBU       iBBw     BBBQi     HBBi           KBBi
  BBH         BB5    iBBB       isL          wBB5
 GBB         iBBi    6BB                   iBBB
 BBQ         BQB     BBD                  QBBi
 BBB        BQB     iQBi                1BBv
 sBBg     wBBB      QBB               iBBB
  7BBBBBBBBBi       BBR              wBBBBBBBBBBBBB
     irvi           ii               ii    i i iii
                i5U
               BBB
               BB7
              1BB
      iPBBBBBKBBR    JBR1       rQBO   BR  UBQP  iBBQi
    7BBBGs7sXBBBi     QBBr     gBBE   rBB BB2BB7HBZQBB
   QBBi      sBQ       BBB   iBBB     SQBBR  BBBB  cBQ
  gBQ        BBg        BBB KBBi      MBBH   BBB   BBs
 iBBv       iBBi         QBBBL        BBR   pBB   iBB
 pBB        BBB         iBBBB        iBB    BBL   KBB
 MBB       BBBR        BBB JBBi      DBR   iBQ    BBL
 GBB     7BBBB2      PBBH   BBBi     BQr   DBB   iBB
  BQBXwgBBP BB7    1BBB      BBQ7   1BB    BBc   BBB
   2BBBBw   BB    EBBS        QBBi  HBa   iBB    BB7
*/
#include<bits/stdc++.h>

using namespace std;

#define PH push
#define MP make_pair
#define PB push_back
#define fst first
#define snd second
#define FOR(i, x, y) for(int i = (x); i < (y); ++i)
#define REP(i, x, y) for(int i = (x); i <= (y); ++i)
#define x0 x0123456789
#define y0 y0123456789
#define x1 x1234567890
#define y1 y1234567890
#define x2 x2345678901
#define y2 y2345678901
typedef double db;
typedef long long ll;
typedef long double ldb;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1e9 + 7;

int r, g, b, n, ans;

int main(){
	scanf("%d%d%d%d", &r, &g, &b, &n);
	for(int i = 0; i * r <= n; ++i) for(int j = 0; j * g + i * r <= n; ++j){
		int k = i * r + j * g;
		k = n - k;
		if(!(k % b) && k >= 0)
			++ans;
	}
	printf("%d\n", ans);
	return 0;
}



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

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

    cout << m.size() << endl;
    return 0;
}



Measured memory_bytes: 19124
#include<cstdio>
#include<iostream>
using namespace std;
int i,n,m;
long long ans;
int main()
{
	scanf("%d%d",&n,&m);
	for(i=m+1;i<=n;i++)
		if(m)ans+=1ll*(n/i)*(i-m)+max((n%i-m+1),0);else
		ans+=1ll*(n/i)*(i-m)+max((n%i-m),0);
	printf("%lld\n",ans);
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 2e2 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int a, b;
	cin >> a >> b;
	int ans = a + b;
	if (ans & 1) puts("IMPOSSIBLE");
	else printf("%d\n", ans / 2);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define p pair<ll,ll>
#define pp pair<pair<ll,ll>,ll>
#define fi first
#define se second
#define opti ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
const ll N = 1e6+6;
ll t,i,j,k,n,m,q;
int main()
{
    opti

        ll a,b;
        cin>>a>>b;
        ll ans = 0;
        ans = max(a+b,max(a,b)+max(a,b)-1);
        cout<<ans;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define range(i,s,n) for(int i=(s);i<(n);i++)
using namespace std;
int main(void){
    int n;
    cin>>n;
    vector<vector<int>> dp(n,vector<int>(3,0));
    rep(i,n)rep(j,3){
        cin>>dp[i][j];
        if(i==0){
            continue;
        }
        dp[i][j]=max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3])+dp[i][j];
    }
    cout<<*max_element(dp[n-1].begin(),dp[n-1].end())<<endl;;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

/**
 * Library
 * --------------------------------------------------------
 */
template<class Monoid>
class SegmentTree {

public:
    /**
     * @param N size
     * @param e identity element
     * @param operation operation to merge `data`
     * @param updater operation to update `data`
     */
    SegmentTree(size_t N, Monoid e, function<Monoid(Monoid, Monoid)> operation,
                function<Monoid(Monoid, Monoid)> updater)
            : e(e), operation(operation), updater(move(updater)) {
        n = 1;
        while (n < N) {
            n *= 2;
        }
        data = vector<Monoid>(2 * n - 1, e);
        for (int i = n - 2; i >= 0; i--) {
            data[i] = operation(data[2 * i + 1], data[2 * i + 2]);
        }
    }

    /**
     * iの値をxに更新 ( 0-indexed )
     */
    void update(int i, Monoid x) {
        i += n - 1;
        data[i] = updater(data[i], x);
        while (i > 0) {
            i = (i - 1) / 2;
            data[i] = operation(data[i * 2 + 1], data[i * 2 + 2]);
        }
    }

    /**
     * [a, b)の区間でクエリを実行
     */
    Monoid query(int a, int b) {
        return query(a, b, 0, 0, n);
    }

    /**
     * 添字でアクセス( 0-indexed )
     */
    Monoid operator[](int i) {
        return data[i + n - 1];
    }

private:
    int n;
    vector<Monoid> data;
    Monoid e;
    function<Monoid(Monoid, Monoid)> operation;
    function<Monoid(Monoid, Monoid)> updater;

    Monoid query(int a, int b, int k, int l, int r) {
        // 交差しない
        if (r <= a || b <= l) return e;
        // 区間 [a, b) に l, r が含まれる
        if (a <= l && r <= b) return data[k];
        // 左の子
        Monoid c1 = query(a, b, 2 * k + 1, l, (l + r) / 2);
        // 右の子
        Monoid c2 = query(a, b, 2 * k + 2, (l + r) / 2, r);
        return operation(c1, c2);
    }
};


void Main() {
    ll N;
    cin >> N;
    vector<ll> P(N);
    rep(i, N) cin >> P[i];
    vector<ll> A(N);
    rep(i, N) {
        ll p = P[i];
        A[p - 1] = i + 1;
    }
    ll k = 0;
    ll prev = -1;
    ll cnt = 0;
    rep(i, N) {
        ll a = A[i];
        if (a > prev) {
            cnt++;
            k = max(k, cnt);
        }else {
            cnt = 1;
        }
        prev = a;
    }
    cout << N - k << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 3456
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Gosu_Hiroo
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define intv(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, _begin, _end) for (__typeof(_end) end = _end, begin = _begin,  i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0, _len = (end); i < (_len); i += 1)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define F first
#define S second
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define readint ({int t;cin >> t;t;})
const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
void _mod(ll &x){x = mod(x, MOD);}
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *) array, (T *) (array + N), val);
}

template <typename T>
ostream& operator << (ostream& os, const vector<T> V) {
    for(auto v : V)os << v << " ";
    return os;
}

template <typename T>
ostream& operator << (ostream& os, const set<T> V) {
    for(auto v : V)os << v << " ";
    return os;
}

//#define int ll

class CBugged {
public:
    int dp[10005];
void solve(std::istream& cin, std::ostream& cout) {
    int N;
    cin >> N;
    Fill(dp, 0);
    dp[0] = 1;
    _for(i,N){
        int s;
        cin >> s;
        rep(j,10005,s)dp[j] |= dp[j-s];
    }
    rep(j,10001,0)if(dp[j] && j % 10){
        cout << j << endl;
        return;
    }
    cout << 0 << endl;
}


};


#undef int
int main() {


	CBugged solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	in.tie(0); ios::sync_with_stdio(0); out<<fixed<<setprecision(20);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
N = int(input())
data_ls = list()
memo_ls = [{} for i in range(N)]
for i in range(N):
    data_ls.append([int(i) for i in input().split()])
def dfs(ind, last, cnt):
    if ind == N:
        memo_ls[ind][last] = cnt
        return cnt
    if memo_ls[ind].get(last) is not None:
        return memo_ls[ind][last]
    for i in range(3):
        if i != last:
            res = max(cnt,
                      dfs(ind+1, i, cnt + data_ls[ind][i]))
    memo_ls[ind][i] = res
    return res

for i in range(3):
    memo_ls[-1][i] = data_ls[-1][i]
for ind in range(N-2,-1,-1):
    for i in range(3):
        memo_ls[ind][i] = data_ls[ind][i] + max([memo_ls[ind+1][k] for k in range(3) if i != k])
print(max(memo_ls[0].values()))

Measured memory_bytes: 64372
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> P;
typedef pair<P,int> PP;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
int n,m,k[100005];
PP o[100005];
P ans[100005];
int main(void){
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>o[i].F.S>>o[i].F.F;
        o[i].S=i;
    }
    sort(o,o+m);
    for(int i=0;i<m;i++){
        ans[o[i].S]=P(o[i].F.S,++k[o[i].F.S]);
    }
    for(int i=0;i<m;i++){
        printf("%06d%06d\n",ans[i].F,ans[i].S);
    }
}


Measured memory_bytes: 3840
import sys

S=input()
T=input()

DICT=dict()
L=len(S)

for i in range(L):
    if DICT.get(S[i])!=None and DICT.get(S[i])!=T[i]:
        print("No")
        sys.exit()
    else:
        DICT[S[i]]=T[i]


INVDICT=dict()

for d in DICT:
    if INVDICT.get(DICT[d])!=None and INVDICT.get(DICT[d])!=d:
        print("No")
        sys.exit()
    else:
        INVDICT[DICT[d]]=d

else:
    print("Yes")

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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            int N;
            List<int> P = new List<int>();
            List<string[]> S = new List<string[]>();
            N = int.Parse(Console.ReadLine());
            string[] str;

            for(int i = 0; i < N; i++)
            {
                str = Console.ReadLine().Split(' ');
                Array.Resize(ref str, 3);
                str[2] = (i + 1).ToString();
                S.Add(str);
            }
            S.Sort((a, b) => a[0].CompareTo(b[0]) != 0 ? a[0].CompareTo(b[0]) : int.Parse(b[1]) - int.Parse(a[1]));
            for(int i = 0; i < N; i++)
            {
                Console.WriteLine(int.Parse(S[i][2]));
            }
        }

    }
}

Measured memory_bytes: 13268
N = int(input())

S = []
for i in range(N):
    S.append(str(input()))

S.sort()

before = S[0]
num = 0
tmp = 0
R = []
for i in range(1, N):
    if S[i] == before:
        tmp += 1
    else:
        if tmp == num:
            R.append(before)
        elif tmp > num:
            R.clear()
            R.append(before)
            num = tmp
        before = S[i]
        tmp = 0

if tmp == num:
    R.append(S[N-1])
elif tmp > num:
    R.clear()
    R.append(S[N-1])
    num = tmp

for i in range(len(R)):
    print(R[i])

Measured memory_bytes: 20680
n   = gets.to_s.to_i
ary = gets.to_s.split.map{|i|i.to_i}

dp_not  = Hash.new(-10**18)
dp_take = Hash.new(-10**18)
dp_not[[0,0]] = 0

ary.each_with_index do |a,i|
  j = i / 2
  (j..j+1).each do |n|
    d = dp_not[[i,n]]
    d1 = dp_take[[i,n]]
    d = d1 if d < d1
    dp_not[[i+1,n]] = d
    dp_take[[i+1,n]] = dp_not[[i,n-1]] + a
  end
end

ans = dp_not[[n,n/2]]
ans1 = dp_take[[n,n/2]]
ans = ans1 if ans < ans1
puts ans

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

int main()
{
  int n;
  cin >> n;
  int num,count=0;
  for(int i=0;i<n;++i){
    cin >> num;
    while(num%2==0){
      num/=2;
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


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

vector<int> z_algorithm(const string &s)
{
    vector<int> prefix(s.size());
    for (int i = 1, j = 0; i < s.size(); i++) {
        if (i + prefix[i - j] < j + prefix[j]) {
            prefix[i] = prefix[i - j];
        } else {
            int k = max(0, j + prefix[j] - i);
            while (i + k < s.size() && s[k] == s[i + k])
                ++k;
            prefix[i] = k;
            j = i;
        }
    }
    prefix[0] = (int)s.size();
    return prefix;
}

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

    string S;
    cin >> S;

    int ans = 0;
    for (int j = 0; j < S.size(); j++) {
        string T = S.substr(j);
        vector<int> v = z_algorithm(T);
        for (int i = 0; i < v.size(); i++) {
            if (v[i] <= i) {
                ans = max(ans, v[i]);
            }
        }
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
#include <stdio.h>

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int l[ 11 ];
  int v1, v2;
  int i;

  while (
    scanf ( "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
      l + 1, l + 2, l + 3, l + 4, l + 5, l + 6,
      l + 7, l + 8, l + 9, l + 10, &v1, &v2 ) == 12 )
  {
    const int len = l[ 1 ] + l[ 2 ] + l[ 3 ] + l[ 4 ]
      + l[ 5 ] + l[ 6 ] + l[ 7 ] + l[ 8 ] + l[ 9 ] + l[ 10 ];
    const int pos = v1 * len / ( v1 + v2 )
      + !!( v1 * len % ( v1 + v2 ) );
    int sum = 0;

    for ( i = 1; i <= 10; ++i )
    {
      sum += l[ i ];
      if ( pos <= sum ) break ;
    }

    printf ( "%d\n", i );
  }

  return ( 0 );
}

Measured memory_bytes: 0
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
//?¶????????????????????????????????????§??????????????????????¢????????????????
constexpr int INF = 2000000000;
const double PI = acos(-1);

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int y, m, d;
		cin >> y >> m >> d;
		int ans = 196471;
		int count = 0;
		for (int j = 1; j < y;j++) {
			if (j % 3 == 0)count += 200;
			else count += 195;
		}
		for (int j = 1; j < m; j++) {
			if (y % 3 == 0)count += 20;
			else {
				if (j % 2 == 0)count += 19;
				else count += 20;
			}
		}
		count += d;
		cout << ans - count << endl;
	}
}

Measured memory_bytes: 3088
# %% constants or libraries
# -------------------------

# %% body
# -------

function main(io = stdin)
    readto(target = '\n') = readuntil(io, target)
    readnum(T::Type{<:Number} = Int; dlm = isspace, kwargs...) =
        parse.(T, split(readto(), dlm; kwargs...))

    # handle IO and and stuff
    N, K = readnum()
    A = readnum()
    println(solve(N, K, A))
end

function solve(N, K, A)
    function lt(a, b)
        # `b` is always identical to `K`
        k = sum(ceil.(Int, A ./ a) .- 1)
        return isless(b, k) # revert the arguments because `k` decreases as `a` gets bigger
    end
    return searchsortedfirst(1:maximum(A), K; lt = lt)
end

@static if @isdefined(Juno) || @isdefined(VSCodeServer)
    main(open(replace(@__FILE__, r"(.+)\.jl" => s"\1.in")))
else
    main()
end


Measured memory_bytes: 252284
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>

typedef long long ll;
#define fi first
#define se second

using namespace std;

ll T[112345];

int main(){
  
  int N;
  int C;
  int K;
  
  cin>>N>>C>>K;
  
  int ans = 1;
  
  int i;
  for( i = 0; i < N; i++ ){
    scanf("%lld", &T[i]);
  }
  
  sort( T, T + N );
  
  /*for( i = 0; i < N; i++ ){
    printf("%d\n", T[i]);
  }*/
  
  int base = T[0];
  int cnt = 0;
  int jdg;
  
  for( i = 0; i < N; i++ ){
    cnt++;
    jdg = 1;
    if( base+K < T[i] ){
      ans++;
      base = T[i];
      jdg = 0;
      cnt = 1;
      //printf("%d\n", i);
    }
    if( cnt > C && jdg ){
      ans++;
      base = T[i];
      cnt = 1;
      //printf("%d\n", i);
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

class Main {
    
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] output = new int[n];
        long totalXOR = 0;
        for (int i = 0; i < n; i++) {
            output[i] = s.nextInt();
            totalXOR = totalXOR ^ output[i];
        }
        for (int i = 0; i < n; i++) {
            if (i != 0) {
                System.out.print(" " + (output[i] ^ totalXOR));
            } else {
                System.out.print(output[i] ^ totalXOR);
            }
        }
    }
}

Measured memory_bytes: 53816
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<eps)
int N,x,y,b,p;
int cost(int s,int t)
{
	if(s>=5&&t>=2)return (x*s+y*t)/5*4;
	else return x*s+y*t;
}
int main()
{
	scanf("%d",&N);
	for(int i=0;i<N;i++)
	{
		scanf("%d %d %d %d",&x,&y,&b,&p);
		printf("%d\n",min(cost(max(5,b),max(2,p)),cost(b,p)));
	}
	return 0;
}

Measured memory_bytes: 1188
a,b,c,d = list(map(int,input().split()))
m1 = min(a,b)
m2 = min(c,d) 
m3 = max(a,b)
m4 = max(c,d) 

x = m1 if m1 > m2 else m2
y = m3 if m3 < m4 else m4
print(y-x if y-x > 0 else 0)

Measured memory_bytes: 3060
/*
Input:      int:a   int:b,c   string:s
Conditions: 1<=a<=1000; 1<=(b,c)<=1000; 1<=s.length<=100
Output:     a,b,cの総和の後に空白を入れ,s
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Template
{
    class Program
    {
        static void Main(string[] args)
        {
            // 文字列の入力
            string s = Console.ReadLine();
            // 整数の入力
            int k = int.Parse(Console.ReadLine());
            int i = 0;
            string a = "a";

            while (i != k)
            {
                if (s.Contains(a)) { i++; if (i != k) { a += "a"; } }
                else
                {
                    if (a[a.Length-1]=='z') { a = a.Substring(0, a.Length - 1); }
                    a = a.Substring(0, a.Length - 1) + (char)(a[a.Length - 1] + 1);
                }
            }

            //出力
            Console.WriteLine(a);
        }
    }
}


Measured memory_bytes: 13140
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
if a<b:
  l1 = a+v*t
  l2 = b+w*t
  if l1>=l2:
    print('YES')
  else:
    print('NO')
else:
  l1 = a-v*t
  l2 = b-w*t
  if l1<=l2:
    print('YES')
  else:
    print('NO')

Measured memory_bytes: 9224
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
char a[3][105];
bool s[26];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<=2;i++) scanf("%s",a[i]);
	int ans=0;
	for(int i=0;i<n;i++)
	{
		ans+=2;
		memset(s,0,sizeof(s));
		for(int j=0;j<3;j++)
		{
			if(s[a[j][i]-'a']) ans--;
			s[a[j][i]-'a']=1;
		}
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define bitrep(X,N) for(ll X = 0; X < (1 << (N)); X++)
#define PI (acos(-1.0))
#define sorta(V) sort(V.begin(), V.end())
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end() 
#define CERR if(false) cerr

using namespace std;


int main(){

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

    bool ans = a <= x && x <= a + b;

    cout << (ans ? "YES" : "NO") << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    IN1 = [int(_) for _ in input().split()]
    N = IN1[0]
    M = IN1[1]
    X = IN1[2]
    AC = [[int(_) for _ in input().split()] for i in range(N)]

    minSum = 1200001
    for i in range(2 ** N):
        tmpSum = 0
        tmpA = [0] * M
        for j in range(N):
            if ((i >> j) & 1):
                tmpSum = tmpSum + AC[j][0]
                for k in range(1, M + 1):
                    tmpA[k-1] = tmpA[k-1] + AC[j][k]

        result = True
        for a in tmpA:
            if a < X:
                result = False
        if result:
            if minSum >= tmpSum:
                minSum = tmpSum

    if minSum != 1200001:
        print(minSum)
        return
    print(-1)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9228
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n, x = LI()
candy = LI()
S = sum(candy)
candy[0] = min(candy[0], x)

for i in range(1, n):
    candy[i] -= max(candy[i] + candy[i-1] - x, 0)



print(S - sum(candy))

Measured memory_bytes: 60400
import std.stdio;
import std.algorithm;
import std.range;
import std.conv;
import std.string;

int f(int a, int k) {
    if (a < k) return 0;
    if (a%k == 0) return a/k;
    int c = a/k+1;
    int l = a/k*k;
    a -= ((a-l-1)/c+1)*c;
    return f(a, k);
}

void main() {
    int n = to!int(chomp(readln()));
    //int m = 100;
    //int[] dp = new int[m+1];
    //foreach (i; 0..m+1) {
    //    int[] s = new int[m+1];
    //    foreach (j; 1..i/n+1) {
    //        s[dp[i-j]] = 1;
    //    }
    //    foreach (j; 0..m) {
    //        if (s[j] == 1) continue;
    //        dp[i] = j;
    //        break;
    //    }
    //    writefln("%2d : %2d - %2d", i, dp[i], f(i,n));
    //}
    //return;
    int x = 0;
    foreach (i; 0..n) {
        string[] input = split(readln());
        int a = to!int(input[0]);
        int k = to!int(input[1]);
        x ^= f(a,k);
    }
    writeln(x ? "Takahashi" : "Aoki");
}

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

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

const int B = 500;
int color[100010], par[100010], depth[100010];
int depthTop[100010];
int goUp[100010];
int vis[100010];
int n;
vector<vector<int>> g;

void decomp(int root){
    rep(i,n) vis[i] = false, par[i] = -1;
    vector<int> q(n+1); int l = 0, r = 0;
    q[r++] = root;
    vector<int> tord;
    while(l != r){
        int v = q[l++]; vis[v] = true;
        tord.push_back(v);
        for(int c : g[v]){
            if(vis[c]) continue;
            q[r++] = c;
            par[c] = v; depth[c] = depth[v] + 1;
        }
    }
    rep(i,n) vis[i] = false;
    int c = 0;
    for(int u : tord){
        if(vis[u]) continue;
        l = 0, r = 0;
        q[r++] = u;
        for(int i = 0; i < B && l != r; i++){
            int v = q[l++];
            vis[v] = true; color[v] = c; goUp[v] = par[u]; depthTop[v] = depth[u];
            for(int c : g[v]) if(!vis[c]) q[r++] = c;
        }
        c++;
    }
}

int solve(int u, int v){
    while(color[u] != color[v]){
        if(depthTop[u] > depthTop[v]) u = goUp[u];
        else v = goUp[v];
    }
    while(u != v){
        if(depth[u] > depth[v]) u = par[u];
        else v = par[v];
    }
    return u;
}

int main(){
    cin >> n;
    g.assign(n,{});
    rep(i,n){
        int k;
        cin >> k;
        rep(j,k){
            int c;
            cin >> c;
            g[i].push_back(c);
            par[c] = i;
        }
    }
    decomp(0);
    int q;
    cin >> q;
    rep(i,q){
        int u,v;
        cin >> u >> v;
        cout << solve(u,v) << endl;
    }
}

Measured memory_bytes: 9760
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
	int n; cin >> n;
	vector<int> a(n), p(n), q(n);
	for (int i = 1; i <= n; ++i) a[i - 1] = i;
	for (auto& e : p) cin >> e;
	for (auto& e : q) cin >> e;
	int x, y;
	for (x = 1;; ++x) {
		if (a == p) break;
		next_permutation(a.begin(), a.end());
	}
	for (int i = 1; i <= n; ++i) a[i - 1] = i;
	for (y = 1;; ++y) {
		if (a == q) break;
		next_permutation(a.begin(), a.end());
	}
	cout << abs(x - y) << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    vector<vector<ll>> a(n, vector<ll>(3));
    rep(i, n) {
        rep(j, 3) {
            cin >> a[i][j];
        }
    }


    ll res = -1 * LINF;
    rep(i, 8) {
        vector<ll> vec;
        for (int j = 0; j < n; ++j) {
            ll s = 0;
            rep(k, 3) {
                if ((i / (1 << k)) % 2 == 0) s += a[j][k];
                else s -= a[j][k];
            }
            vec.push_back(s);
        }
        sort(vec.begin(), vec.end(), greater<ll>());
        ll sum = 0;
        rep(j, m) sum += vec[j];
        chmax(res, sum);
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <bitset>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};

int main(void){
    ll a, b;
    cin >> a >> b;
    ll ans = 0;
    ll check = 1;
    while(check < b){
        check--;
        check+=a;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

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

    if(K==1)
        cout << 0 << endl;
    else
        cout << N - K << endl;
    
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if(n % 2 == 0){
      System.out.println(n / 2);
    }else{
      n++;
      System.out.println(n / 2);
    }
  }
}


Measured memory_bytes: 23124