akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <new>
#include <typeinfo>
#include <iterator>
#include <cassert>

typedef long long ll;
typedef unsigned long long ull;
constexpr ll mop = 1000000007;
constexpr ll mop2 = 998244353;

using namespace std;

int main() {
	ll h, w;
	cin >> h >> w;
	vector<vector<bool>> grid(h + 1);
	vector<vector<ll>> rowObstacleList(h + 1), colObstacleList(w + 1);
	for (ll i = 1; i <= h; i++) {
		rowObstacleList[i].push_back(0);
	}
	for (ll i = 1; i <= w; i++) {
		colObstacleList[i].push_back(0);
	}
	for (ll i = 1; i <= h; i++) {
		grid[i].resize(w + 1);
		string s;
		cin >> s;
		for (ll j = 1; j <= w; j++) {
			if (s[j - 1] == '#') {
				grid[i][j] = false;
				rowObstacleList[i].push_back(j);
				colObstacleList[j].push_back(i);
			}
			else {
				grid[i][j] = true;
			}
		}
	}
	for (ll i = 1; i <= h; i++) {
		rowObstacleList[i].push_back(w+1);
	}
	for (ll i = 1; i <= w; i++) {
		colObstacleList[i].push_back(h+1);
	}

	ll ans = 0;
	for (ll i = 1; i <= h; i++) {
		for (ll j = 1; j <= w; j++) {
			if (grid[i][j]) {
				ll l, r, u, d;
				auto itr = lower_bound(rowObstacleList[i].begin(), rowObstacleList[i].end(), j);
				r = *itr;
				l = *(--itr);
				itr = lower_bound(colObstacleList[j].begin(), colObstacleList[j].end(), i);
				d = *itr;
				u = *(--itr);
				ll tmp = (r - l - 1) + (d - u - 1) - 1;
				
				if (ans < tmp) {
					ans = tmp;
				}
			}
		}
	}
	cout << ans << endl;

}



Measured memory_bytes: 71324
import java.io.*;
import java.util.*;
 
public class Main {
 
	void submit() {

        int a = nextInt();
        int b = nextInt();
        
        int sum_a=a;
        int sum_b=b;
        int kaijo = 1;


        for(int i=0; i<b-1; i++){
            kaijo *= 10;
            sum_a += a * kaijo;
        }

        kaijo = 1;

        for(int i=0; i<a-1; i++){
            kaijo *= 10;
            sum_b += b * kaijo;
        }

        if(sum_a>sum_b){
    	    out.println(sum_a);
        }else{
    	    out.println(sum_b);            
        }
	    
	}

	void preCalc() {
 
	}
 
	void stress() {
 
	}
 
	void test() {
 
	}
 
	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		//stress();
		//test();
		out.close();
	}
 
	static final Random rng = new Random();
 
	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}
 
	public static void main(String[] args) throws IOException {
		new Main();
	}
 
	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
 
	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return st.nextToken();
	}
 
	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}
 
	int nextInt() {
		return Integer.parseInt(nextToken());
	}
 
	long nextLong() {
		return Long.parseLong(nextToken());
	}
 
	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}

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

int main() {
    char c;
    cin >> c;
    if ( c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' )
        cout << "vowel"s;
    else
        cout << "consonant"s;
}

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

using i64 = int64_t;

using Graph = vector<vector<pair<int,int>>>;

void dfs(int node, int pc, Graph &tree, vector<int> &ans){
    int color = 1;
    for(auto e: tree[node]){
        if(ans[e.second] > 0)continue;
        if(color == pc)color++;
        ans[e.second] = color;
        dfs(e.first, color, tree, ans);
        color++;
    }
}

int main(){
    int n;
    cin >> n;
    Graph tree(n+1, vector<pair<int,int>>());
    vector<int> degree(n+1);
    for(int i=0;i<n-1;++i){
        int a, b;
        cin >> a >> b;
        tree[a].push_back({b, i+1});
        tree[b].push_back({a, i+1});
        degree[a]++;
        degree[b]++;
    }
    int dmax = 0, node = 0;
    for(int i=1;i<=n;++i){
        if(degree[i] > dmax){
            dmax = degree[i];
            node = i;
        }
    }

    int ans_k = dmax;
    vector<int> ans(n);
    dfs(node, 0, tree, ans);
    cout << ans_k << endl;
    for(int i=1;i<n;++i){
        cout << ans[i] << endl;
    }

    return 0;
}


Measured memory_bytes: 8576
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define uniq(v) v.erase(unique(v.begin(),v.end()),v.end())
#define lb(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define ub(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
using Pair = pair<ll,pair<int,int>>;
#define pq priority_queue<Pair, vector<Pair>, greater<Pair>> 
const ll mod=1000000007;
//const ll mod=998244353;
const ld pi=acos(-1.0);
const ll INF = 1LL<<61;
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 (b<a) { a=b; return 1; } return 0; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'大文字'+=32;    で小文字に
//  cout << fixed << setprecision (20);   小数点以下2０桁まで
//実行時間制約2秒では２×10^8回くらいまで計算できる



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

  int n;
  cin>>n;

  int a=0;
  int b=0;
  int c=0;
  int d=0;
  rep(i,n){
    string s;
    cin>>s;
    if(s[0]=='A') a++;
    if(s[0]=='W') b++;
    if(s[0]=='T') c++;
    if(s[0]=='R') d++;
  }

  cout << "AC x " << a << endl;
  cout << "WA x " << b << endl;
  cout << "TLE x " << c << endl;
  cout << "RE x " << d << endl;

}

Measured memory_bytes: 3656
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>
using ll = long long;

#define rep(i, n) for(ll i = 0; i < (int)(n); i++)
#define reps(i,x) for(ll i=1;i<=(int)(x);i++)
#define rrep(i,x) for(ll i=((int)(x)-1);i>=0;i--)
#define rreps(i,x) for(ll i=((int)(x) - 1 * 100);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define mp make_pair
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
using namespace std;
ll n,k;
ll a[100000];
int main() {
	cin >> n >> k;
	map<ll, ll> mp;
	ll t1, t2;
	rep(i, n) {
		cin >> t1 >> t2;
		mp[t1] += t2;
	}
	ll sum = 0;
	for (auto kv : mp) {
		sum += kv.second;
		if (sum >= k) {
			cout << kv.first << endl;
			return 0;
		}
	}
	return 0;
}

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

using namespace std;

int main() {
	while (true) {
		int n, m, t, p;
		cin >> n >> m >> t >> p;
		if (n == 0) break;

		vector<vector<int>> card(500, vector<int>(500, 0));
		for(int x = 0; x < n; ++x) {
			for(int y = 0; y < m; ++y) {
				card[x][y] = 1;
			}
		}

		int l = 0, u = 0;
		for(int q = 0; q < t; ++q) {
			int d, c;
			cin>>d>>c;

			if (d == 1) {
				for(int x = 0; x < c; ++x) {
					for(int y = 0; y < m; ++y) {
						card[l + c * 2 - x - 1][u + y] += card[l + x][u + y];
						card[l + x][u + y] = 0;
					}
				}
				l += c;
				n = max(c, n - c);
			} else {
				for(int x = 0; x < n; ++x) {
					for(int y = 0; y < c; ++y) {
						card[l + x][u + c * 2 - 1 - y] += card[l + x][u + y];
						card[l + x][u + y] = 0; 
					}
				}
				u += c;
				m = max(c, m - c);
			}
		}

		for(int q = 0; q < p; ++q) {
			int x, y;
			cin >> x >> y;
			cout << card[l + x][u + y] << endl;
		}
	}
	return 0;
}


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

int main()
{
	int n, k, q;
	cin >> n >> k >> q;
	int usr[n] = {};
	for (int i = 0; i < q; i++){
		int a;
		cin >> a;
		usr[a-1]++;
	}
	for (int i = 0; i < n; i++){
		if (k-(q-usr[i]) > 0) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}



Measured memory_bytes: 1024
#include<stdio.h>
int main()
{
    int sum=0,a,b,c,x,i,j,l,q;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    scanf("%d",&x);
    for(i=0;i<=a;i++)
    {
        for(j=0;j<=b;j++)
        {
            for(l=0;l<=c;l++)
            {
                q=500*i+100*j+50*l;
                if(q==x)
                {
                    sum++;
                }
            }
        }
    }
    printf("%d",sum);
}


Measured memory_bytes: 128
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
#include <bits/stdc++.h>
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb(X) push_back(X)
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
typedef long long ll;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef pair<int, int> pii;
//ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}


const int INF = 1e9 + 7;
int _;

int main() {
	double l;
	scanf("%lf", &l);
	double sum = (l / 3.0) * (l / 3.0) * (l / 3.0);
	printf("%.8lf", sum);
	

	return 0;
}
/*
rep (i, 0, n) {
		if (i) cout << ' ';
		cout << A[i];
	}
*/

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b))<EPS)

typedef complex<double> P;

struct Rect{
	double minx;
	double miny;
	double maxx;
	double maxy;
};

int main(){
	Rect r[2];
	while(cin>>r[0].minx>>r[0].miny>>r[0].maxx>>r[0].maxy>>r[1].minx>>r[1].miny>>r[1].maxx>>r[1].maxy){
		P a[4];
		P b[4];
		a[0]=P(r[0].minx,r[0].miny);
		a[1]=P(r[0].minx,r[0].maxy);
		a[2]=P(r[0].maxx,r[0].miny);
		a[3]=P(r[0].maxx,r[0].maxy);

		b[0]=P(r[1].minx,r[1].miny);
		b[1]=P(r[1].minx,r[1].maxy);
		b[2]=P(r[1].maxx,r[1].miny);
		b[3]=P(r[1].maxx,r[1].maxy);



		bool f=false;
		if(r[0].maxx<r[1].minx||r[1].maxx<r[0].minx){
				cout<<"NO"<<endl;
		}
		else if(r[0].maxy<r[1].miny||r[1].maxy<r[0].miny){
				cout<<"NO"<<endl;
		}
		else
			cout<<"YES"<<endl;


		//for(int i = 0; i < 4; i++){
		//	if(
		//		(EQ(a[i].real(),r[1].minx)||a[i].real()>r[1].minx)
		//		&&(EQ(a[i].real(),r[1].maxx)||a[i].real()<r[1].maxx)
		//		&&(EQ(a[i].imag(),r[1].miny)||a[i].imag()>r[1].miny)
		//		&&(EQ(a[i].imag(),r[1].maxy)||a[i].imag()<r[1].maxy)
		//		){
		//			cout<<"YES"<<endl;
		//			f=true;
		//			break;
		//	}
		//}
		//if(!f){
		//	for(int i = 0; i < 4; i++){
		//		if(
		//			(EQ(b[i].real(),r[0].minx)||b[i].real()>r[0].minx)
		//			&&(EQ(b[i].real(),r[0].maxx)||b[i].real()<r[0].maxx)
		//			&&(EQ(b[i].imag(),r[0].miny)||b[i].imag()>r[0].miny)
		//			&&(EQ(b[i].imag(),r[0].maxy)||b[i].imag()<r[0].maxy)
		//			){
		//				cout<<"YES"<<endl;
		//				f=true;
		//				break;
		//		}
		//	}
		//	if(!f)
		//		cout<<"NO"<<endl;
		//}
	}
	return 0;
}

Measured memory_bytes: 0
//16
#include<iostream>

using namespace std;

int main(){
  int n,t,e;
  cin>>n>>t>>e;
  for(int i=1;i<=n;i++){
    int x;
    cin>>x;
    int s=t/x;
    if(t-s*x<=e||(s+1)*x-t<=e){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<-1<<endl;
  return 0;
}

Measured memory_bytes: 1164
package main

import(
    "fmt"
    "strings"
)



func main() {
    var s string
    fmt.Scan(&s)
    fmt.Println(strings.Replace(s,","," ",-1))
}





func abs32(a int) int {
    if a<0{
        return -a
    }
    return a
}

func abs64(a int64) int64 {
    if a<0{
        return -a
    }
    return a
}

func min32(a, b int) int {
    if a >= b {
        return b
    }
    return a
}

func max32(a, b int) int {
    if a >= b {
        return a
    }
    return b
}

func min64(a, b int64) int64 {
    if a >= b {
        return b
    }
    return a
}

func max64(a, b int64) int64 {
    if a >= b {
        return a
    }
    return b
}

func gcd(a, b int64) int64 {
    if a % b == 0 {
        return b
    } else {
        return gcd(b, a%b)
    }
}

func lcm(a, b int64) int64 {
    return a / gcd(a, b) * b
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
    using namespace std;
    #define fs first
    #define sc second
    #define MOD 1000000007
    #define pb push_back
    #define mp make_pair
    typedef int Int;
    typedef pair<Int,Int> pii;
    typedef vector<Int> vi;
    typedef vector<pii> vii;
     
    int main()
    {
    	string S;
    	cin>>S;
    	for(Int i=0;i<=3;i++)
    	{
    		cout<<S[i];
    	}
    	cout<<" ";
    	for(Int i=4;i<12;i++)
    		cout<<S[i];
    		cout<<endl;
     
     
    	return 0;
    }

Measured memory_bytes: 256
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 + 1];
        int[] B = new int[N + 1];
        int[] C = new int[N + 1];
 
        for (int i = 1 ; i <= N ; i++) {
            A[i] = sc.nextInt();
        }
 
        for (int i = 1 ; i <= N ; i++) {
            B[i] = sc.nextInt();
        }
 
        for (int i = 1 ; i < N ; i++) {
            C[i] = sc.nextInt();
        }
 
      	int sum = 0;
      	for(int i=1;i<=N;i++){
          sum += B[A[i]];
          if(A[i-1] == A[i] - 1){
          	sum += C[A[i-1]];
          }
        } 
      System.out.println(sum);
      	
    }       
}

Measured memory_bytes: 35756
#include"bits/stdc++.h"
using namespace std;

int main() {
    int N;
    cin >> N;
    map<char, long long> mp;
    for (int i = 0; i < N; i++) {
        string s;
        cin >> s;
        mp[s[0]]++;
    }

    long long ans = 0;
    ans += mp['M'] * mp['A'] * mp['R'];
    ans += mp['M'] * mp['A'] * mp['C'];
    ans += mp['M'] * mp['A'] * mp['H'];
    ans += mp['M'] * mp['R'] * mp['C'];
    ans += mp['M'] * mp['R'] * mp['H'];
    ans += mp['M'] * mp['C'] * mp['H'];
    ans += mp['A'] * mp['R'] * mp['C'];
    ans += mp['A'] * mp['R'] * mp['H'];
    ans += mp['A'] * mp['C'] * mp['H'];
    ans += mp['R'] * mp['C'] * mp['H'];
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <cassert>
using namespace std;
using ll = long long;

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

int main() {
	int n; cin >> n;
	vector<ll> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	ll sum = 0;
	for (int i = 0; i < n; i++) sum += abs(a[i]);
	int cnt = 0;
	for (int i = 0; i < n; i++) cnt += a[i] < 0;
	if (cnt & 1) {
		ll mi = 1e18;
		for (int i = 0; i < n; i++) {
			mi = min(mi, abs(a[i]));
		}
		cout << sum - 2 * mi << endl;
	}
	else cout << sum << endl;
	return 0;
}

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

int main() {
    long long A, B;
    cin >> A >> B;
    if(A % 2) {
        if(B % 2) cout << ((((B - A) / 2) % 2) ^ A) << endl;
        else cout << ((((B - A - 1) / 2) % 2) ^ A ^ B) << endl;
    } else {
        if(B % 2) cout << (((B - A + 1) / 2) % 2) << endl;
        else cout << ((((B - A) / 2) % 2) ^ B) << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template <typename T> T gcd(T x, T y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}
template <typename T> T lcm(T x, T y) {
  if (x == 0 || y == 0)
    return 0;
  return x / gcd(x, y) * y;
}
int main() {
  int A, B, K;
  cin >> A >> B >> K;
  set<int> st;
  for (int i = 0; i < K; i++) {
    if (i + A <= B)
      st.insert(A + i);
    if (A <= B - i)
      st.insert(B - i);
  }
  for (auto x : st)
    cout << x << endl;
}

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

using namespace std;

void c()
{

}

void d()
{

}

int main() {
    int n, k;
    cin >> n >> k;
    int min_count = 1000000000;
    for(int i = 0; i <= n; i++)
    {
        vector<int> op;
        for(int j = 0; j < n; j++)
        {
            if(j < i)
            {
                op.push_back(0);
            }else{
                op.push_back(1);
            }
        }
        sort(op.begin(), op.end());
        do{
            int count = 1;
            for(auto e : op)
            {
                if(e == 0)
                {
                   count *= 2;
                }else{
                   count += k;
                }
            }
            if(min_count > count) {
                min_count = count;
            }
        }while(next_permutation(op.begin(), op.end()));
    }
    cout << min_count << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int i;
	int N;
	int sum=0;
	
	scanf("%d", &N);
	
	for(i = 0; i < N; i++){
		sum += 800;
	}
	
	for(i = 15; i <= N; i=i+15){
		sum = sum - 200;
	}
	
	printf("%d\n", sum);
	return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

int main(){
    ll N;
    string s;
    cin >> N >> s;
    ll a = 0,b = 0;
    for(ll i = 0; i < N; i++){
        if(s[i] == 'R')
            a++;
        else 
            b++;
    }
    if(a > b)
        cout << "Yes" << "\n";
    else
        cout << "No" << "\n";
    return 0; 
} 


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let n:Vec<u32> = (0..4).map(|_| read()).collect();

    let mut f = vec![false,false,false,false];
    for i in 0..4 {
        if n[i]==1 {f[0]=true}
        if n[i]==9 {f[1]=true}
        if n[i]==7 {f[2]=true}
        if n[i]==4 {f[3]=true}
    }

    println!("{}",
        if f.iter().filter(|&x| *x).count() == 4 {"YES"}
        else {"NO"}
    )

}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int a[206]={};
int main(){
    int x,y;
    cin>>x>>y;
    a[1]=300000,a[2]=200000,a[3]=100000;
    int ans=0;
    ans=a[x]+a[y];
    if(x==y && x==1){
        ans+=400000;
    }
    cout<<ans<<endl;
}

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

long long rng(long long l, long long r) {
  static mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
  return uniform_int_distribution<long long>(l, r - 1)(mt);
}

struct rolling_hash {
  static constexpr uint64_t mod = 2e9 + 33;
  static long long base[2];
  static vector<int> powb[2];
  vector<int> h[2];
  rolling_hash(const string& s) : h{{0}, {0}} {
    for (int k : {0, 1}) {
      for (auto c : s) h[k].push_back((h[k].back() * base[k] + c) % mod);
      while (powb[k].size() <= s.size())
        powb[k].push_back(powb[k].back() * base[k] % mod);
    }
  }
  int get(int l, int r, int k) const {
    return (h[k][r] + (mod - h[k][l]) * powb[k][r - l]) % mod;
  }
  auto get(int l, int r) const { return make_pair(get(l, r, 0), get(l, r, 1)); }
  int size() const { return h[0].size() - 1; }
};
long long rolling_hash::base[2] = {rng(1e9, 2e9), rng(1e9, 2e9)};
vector<int> rolling_hash::powb[2] = {{1}, {1}};

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  rolling_hash rh(s);
  int l = 0, r = 1;
  set<pair<int, int>> se;
  while (m--) {
    string t;
    cin >> t;
    if (t == "L++") {
      ++l;
    } else if (t == "L--") {
      --l;
    } else if (t == "R++") {
      ++r;
    } else if (t == "R--") {
      --r;
    } else {
      assert(false);
    }
    se.insert(rh.get(l, r));
  }
  cout << se.size() << '\n';
}



Measured memory_bytes: 21960
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX;
#define INFL LLONG_MAX;
typedef long long ll;
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  int x = max(a,b);
  int y = min(a,b);
  rep(i,x) cout << y;
  cout << endl;
}


Measured memory_bytes: 3600
import java.io.*;
import java.util.*;

public class Main{
    
    public static void main(String args[]) throws IOException{
	BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	
	int n=Integer.parseInt(br.readLine());
	int r[]=new int[n];
	int ans=0;
	int max=Integer.MIN_VALUE;
	
	for(int i=0;i<n;i++){
	    r[i]=Integer.parseInt(br.readLine());	  
	}

	int min=r[0];
	
	for(int i=1;i<n;i++){
	    max=Math.max(max,r[i]-min);
	    min=Math.min(min,r[i]);
	}

	
	System.out.println(max);	
    }
}



Measured memory_bytes: 42792
fun main(args: Array<String>) {
    val (X, Y) = readLine()!!.split(" ").map(String::toInt)

    for (tsuruCount in 0..X) {
        val kameCount = X - tsuruCount
        val tsuruLegCount = 2 * tsuruCount
        val kameLegCount = 4 * kameCount

        if ((tsuruLegCount + kameLegCount) == Y) {
            println("Yes")
            return
        }
    }

    println("No")
}


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


using namespace std;


void sieve_of_eratosthenes(vector<bool> &is_prime) {
    long long N = is_prime.size() - 1;
    for (long long i = 2; i * i <= N; i++) {
        if (!is_prime[i])
            continue;
        for (long long j = i + i; j <= N; j += i) {
            is_prime[j] = false;
        }
    }
}


void list_prime_factors(vector<long long> &prime_factors, long long N) {
    // Sieve of eratosthenes but record the prime factor for each number.
    // eg, `prime_factors[4] == 2`, `prime_factors[9] == 3`
    prime_factors.resize(N + 1, 1);
    for (long long i = 2; i * i <= N; i++) {
        if (prime_factors[i] > 1)
            continue;
        for (long long j = i + i; j <= N; j += i) {
            if (prime_factors[j] == 1)
                prime_factors[j] = i;
        }
    }
}


void fast_prime_factorization(long long x, vector<pair<long long, long long>> &res, vector<long long> &prime_factors) {
    while (prime_factors[x] != 1) {
        long long pf = prime_factors[x];
        long long num = 1;
        x /= pf;
        while (pf == prime_factors[x]) {
            num++;
            x /= pf;
        }
        res.push_back(make_pair(pf, num));
    }
    if (res.size() > 0 && res.rbegin()->first == x) {
        res.rbegin()->second++;
    } else {
        res.push_back(make_pair(x, 1));
    }
}


using ll = long long;


int main(void) {
    vector<long long> prime_factors;
    list_prime_factors(prime_factors, 1000000);
    ll N;
    cin >> N;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<bool> used(1000000, false);
    bool flag = false;
    for (auto e : A) {
        vector<pair<ll, ll>> res;
        fast_prime_factorization(e, res, prime_factors);
        for (auto p : res) {
            ll prime = p.first;
            if (p.first == 1)
                continue;
            if (used[prime]) {
                flag = true;
                break;
            }
            used[prime] = true;
        }
        if (flag)
            break;
    }
    if (!flag) {
        cout << "pairwise coprime" << endl;
        return 0;
    }

    ll g = gcd(A[0], A[1]);
    for (ll i = 1; i < N; i++) {
        g = gcd(A[i], g);
    }
    if (g == 1) {
        cout << "setwise coprime" << endl;
    } else {
        cout << "not coprime" << endl;
    }
}


Measured memory_bytes: 18940
import Data.Bifunctor (bimap)
import Data.Function  (on)
import Data.Ratio

import Control.Monad

main :: IO ()
main = do
    n  <- read <$> getLine
    rs <- replicateM n getPair
    print $ solve rs

getPair = (\(x:y:_) -> (x, y)) . fmap read . words <$> getLine

solve :: [(Int, Int)] -> Int
solve = inner (1, 1)
  where
    inner (a, b)           []  = a + b
    inner (a, b) ((x, y) : rs) = go (a % x) (b % y) (x, y) rs
    go p q = (.) inner $ bimap <*> id $ (on max ceiling p q *)


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

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


int main() {
  int K;
  cin >> K;
  int result = 0;
  for (int i = 1; i <= K; ++i) {
    for (int j = 1; j <= K; ++j) {
      for (int k = 1; k <= K; ++k) {
        result += gcd(gcd(i, j), k);
      }
    }
  }
  cout << result << endl;
}

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

public class Main  {
	public static void main (String[] args) {
		Scanner s=new Scanner(System.in);    
		int N=s.nextInt();		
		long A[][]=new long[N][3];
      for(int i=0;i<N;i++)
      {
         for(int j=0;j<3;j++)
         {
           A[i][j]=s.nextLong();
         }
      }
      long a=A[N-1][0],b=A[N-1][1],c=A[N-1][2];
     // System.out.println(a+" "+b+" "+c);
      for(int i=N-2;i>=0;i--)
      {
    	long p=a,q=b,r=c;  
        a=(long)Math.max(q+A[i][0],r+A[i][0]);
        b=(long)Math.max(p+A[i][1],r+A[i][1]);
        c=(long)Math.max(p+A[i][2],q+A[i][2]);
      //  System.out.println(a+" "+b+" "+c);
      }
      long m=(long)Math.max(a,(long)Math.max(b,c));
      System.out.println(m);
	}
}


Measured memory_bytes: 97740
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace std;

int n, a[10000];
long long ta = 0;

int main(){
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	sort(a, a + n);
	for (int i = 0; i < n; i++) {
		ta += a[i];
	}
	cout << a[0] << " " << a[n - 1] << " " << ta << endl;
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
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 / gcd(a, b) * b; }

// ---- ----

int a, b, c, d;

int main() {
	cin >> a >> b >> c >> d;
	
	cout << max(min(b, d) - max(a, c), 0) << endl;
	
	return 0;
}


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

int main() {
  string S;
  cin >> S;
  vector<string> week= {"SUN","MON","TUE","WED", "THU", "FRI", "SAT"};
  int ans;
  for (int i=0; i < 7; ++i){
    if(week[i] == S) ans = i;
  }
  cout << 7 - ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(a,b,n) for(int a=b;a<=b;a++)
#define sc(a) scanf("%d",&a)
#define scc(a,b) scanf("d",&a,&b)
#define sccc(a,b,c) scanf("d%d",&a,&b,&c)
#define sccs(s) scanf("%s",s)
#define pccs(s) printf("%s",s)
#define debug printf("---debug---");
#define pcc(a,b) printf("d",a,b)
#define pccc(a,b,c) printf("d%d",a,b,c)
#define pb push_back
typedef long long ll;
const int MAXN_1e5=1e6;
const int MAXN_2e5=2e5+5;
const int MAXN_3e5=3e5+5;
const int MAXN_4e5=4e5+5;
const int MAXN_5e5=5e5+5;
const int INF_INT=0x3f3f3f3f;
const long long INT_LL=2e18;
ll prime[MAXN_1e5];
ll visit[MAXN_1e5];
void Prime(){
    for (ll i = 2;i <MAXN_1e5; i++) {
        if (!visit[i]) {
            prime[++prime[0]] = i;      //记录素数， 这个prime[0] 相当于 cnt，用来计数
        }
        for (ll j = 1; j <=prime[0] && i*prime[j] <MAXN_1e5; j++) {
            visit[i*prime[j]] = 1;
            if (i % prime[j] == 0) {
                break;
            }
        }
    }
}
int main()
{
    ll a,b;
    Prime();
    while(cin>>a>>b)
    {
        ll g=__gcd(a,b);
        ll cnt=1;
        int i;
        for(i=1;i<=prime[0]&&prime[i]<=g;i++)
        {
            if(g%prime[i]==0)
            {
                cnt++;
                while(g%prime[i]==0)g/=prime[i];
            }
        }
        if(g!=1)cnt++;
        cout<<cnt<<endl;
    }
    return 0;
}


Measured memory_bytes: 10496
using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var raw1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var raw2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();


            var H = raw1[0];
            var W = raw1[1];

            var h = raw2[0];
            var w = raw2[1];

            Console.WriteLine((H-h)*(W-w));
        }
    }
}


Measured memory_bytes: 13396
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*
 * Aizu - ALDS1_9_C - Priority Queue
 *
 * https://vjudge.net/contest/296407#problem/A
 * https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_9_C
 */

struct heap {
    int capacity;
    int size;
    int *elems;
};

static struct heap *new_heap(int N) {
    struct heap *heap = malloc(sizeof(struct heap));

    heap->capacity = N;
    heap->size = 0;
    heap->elems = malloc(sizeof(int) * N);

    return heap;
}

static int pop(struct heap *heap) {
    int i, s = 0, l, r, v;

    if (heap->size == 0)
        return -1;

    --heap->size;
    v = heap->elems[0];
    heap->elems[0] = heap->elems[heap->size];
    heap->elems[heap->size] = v;

    do {
        i = s;

        if ((l = i * 2 + 1) < heap->size && heap->elems[l] > heap->elems[s])
            s = l;
        if ((r = l + 1) < heap->size && heap->elems[r] > heap->elems[s])
            s = r;

        if (s != i) {
            v = heap->elems[i];
            heap->elems[i] = heap->elems[s];
            heap->elems[s] = v;
        }
    } while (s != i);

    return heap->elems[heap->size];
}

static void push(struct heap *heap, int elem) {
    int i, p, v;

    if (heap->capacity < heap->size + 1) {
        heap->capacity *= 2;
        heap->elems = realloc(heap->elems, sizeof(int) * heap->capacity);
    }

    heap->elems[heap->size++] = elem;

    i = heap->size - 1;

    while (i != 0 && heap->elems[i] > heap->elems[(p = (i - 1) / 2)]) {
        v = heap->elems[i];
        heap->elems[i] = heap->elems[p];
        heap->elems[p] = v;
        i = p;
    }
}

int main() {
    char *op = malloc(8);
    int k;

    struct heap *S = new_heap(2);

    while (scanf("%s", op) == 1 && strcmp("end", op) != 0) {
        if (op[0] == 'i') {
            scanf("%d", &k);
            push(S, k);
        } else {
            printf("%d\n", pop(S));
        }
    }

    return 0;
}



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

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

int main(void){
    int n;
    cin >> n;
    vector<int> p(n);
    for(auto& i : p) cin >> i;
    int c = 0;
    for(int i = 1; i < n-1; i++){
        int mi = min({p.at(i-1), p.at(i), p.at(i+1)});
        int ma = max({p.at(i-1), p.at(i), p.at(i+1)});
        if(p.at(i) != mi && p.at(i) != ma) c++;
    }
    cout << c << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;

int main(){
    int N, M, A, B, C;
    string s1, s2;
    cin >> N >> M >> A;
    cout << (N + M - 1) / M * A << endl;
}


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

#define ll long long
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    string S;
    cin>>S;
    for(char &a : S)
        if(a=='?')
            a='D';
    cout<<S<<endl;
	return 0;
}

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

int main(){
  int T; cin >> T;
  rep(query, T) {
    int N, M, A, B; cin >> N >> M >> A >> B;
    cout << floor_sum(N, M, A, B) << endl;
  }
}

Measured memory_bytes: 3584
#include<stdio.h>

#define N 100

int main(){
  int A[N],i,j,v,b,k;

  scanf("%d",&b);
  
  for(i=0;i<b;i++){
    scanf("%d",&A[i]);
  }
  
  printf("%d",A[0]);
  for(i=1;i<b;i++){
    printf(" %d",A[i]);
  }
  printf("\n");

  for(i=1;i<=b-1;i++){
    v=A[i];
    j=i-1;
    while(j>=0 && A[j]>v){
      A[j+1]=A[j];
      j--;
    }
    A[j+1]=v;
    
    printf("%d",A[0]);
    for(k=1;k<b;k++){
      printf(" %d",A[k]);
    }
    printf("\n");
  }

  return 0;
}



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

using namespace std;

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

template<typename Container>
bool include(const Container& c, const typename Container::value_type& v) {
  return ( c.end() != std::find(c.begin(),c.end(),v) );
}

template<class T>
vector<T> unique_vec(const vector<T> &v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  return v;
}

int main() {
  char S;
  cin >> S;
  if (isupper(S)) {
    cout << "A" << endl;
  } else {
    cout << "a" << endl;
  }

  return 0;
}


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

int main(){
      int n;cin >> n;
      int sum = 0;
      int no = 0;
      int ans = INT_MAX;
      int arr[n + 10];
      for(int i = 0;i < n;i++){
            cin >> arr[i];
            sum += arr[i];
      }
      for(int i = 0;i < n;i++){
            no += arr[i];
            sum -= arr[i];
            ans = min(ans, abs(sum - no));
      }
      cout << ans;
}

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

int main() {
    int n;
    cin >> n;
    vector<pair<int, int>> graph[n];
    array<int, 3> points[n];
    int cost[n];
    for (int i = 0; cin >> points[i][0] >> points[i][1]; i++) {
        points[i][2] = i;
        cost[i] = INT_MAX;
    }
    sort(points, points + n, [](const array<int, 3>& left, const array<int, 3>& right) {
        return left[0] < right[0];
    });
    for (int i = 1; i < n; i++) {
        auto dist = min(abs(points[i - 1][0] - points[i][0]), abs(points[i - 1][1] - points[i][1]));
        graph[points[i - 1][2]].emplace_back(points[i][2], dist);
        graph[points[i][2]].emplace_back(points[i - 1][2], dist);
    }
    sort(points, points + n, [](const array<int, 3>& left, const array<int, 3>& right) {
        return left[1] < right[1];
    });
    for (int i = 1; i < n; i++) {
        auto dist = min(abs(points[i - 1][0] - points[i][0]), abs(points[i - 1][1] - points[i][1]));
        graph[points[i - 1][2]].emplace_back(points[i][2], dist);
        graph[points[i][2]].emplace_back(points[i - 1][2], dist);
    }
    long long result = 0;
    set<int> mst = {0};
    set<pair<int, int>> set;
    auto update = [&](const vector<pair<int, int>>& nodes) {
        for (auto& p : nodes) {
            if (mst.find(p.first) != end(mst)) {
                continue;
            }
            if (cost[p.first] > p.second) {
                set.erase({cost[p.first], p.first});
                cost[p.first] = p.second;
                set.emplace(p.second, p.first);
            }
        }
    };
    update(graph[0]);
    do {
        auto current = set.begin()->second;
        auto weight = set.begin()->first;
        set.erase(set.begin());
        mst.emplace(current);
        result += weight;
        update(graph[current]);
    } while (!set.empty());
    cout << result;
    return 0;
}


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

int main()
{
  int N;
  int min;
  int input;
  bool flag=false;
  cin >> N;
  
  for(int i=0; i<N; i++)
  {
    cin >> input;
    if(input % 2 == 0)
    {
      	int cnt = 0;
    	while(true)
    	{
          if(input % 2 != 0)
          {
            break;
          }
          cnt += 1;
          input /= 2;
    	}
      	if(min > cnt || i == 0)
        {
          min = cnt;
        }
    }
    else
    {
      flag = true;
    }
  }
  if(flag)
  {
    cout << 0 << endl;
  }
  else
  {
    cout << min << endl;
  }
}


Measured memory_bytes: 3572
a,op,b=input().split()
a,b=int(a),int(b)
t = 0
ans = 0
while op != "?":

	if op == "+":
		ans = a+b
	elif op == "-":
		ans = a-b
	elif op == "*":
		ans = a*b
	elif op == "/":
		ans = a//b

	print("{}".format( ans ))
	t+=1
	a,op,b=input().split()
	a,b=int(a),int(b)




Measured memory_bytes: 5600
n=int(input())
l=[]
for _ in range(n):
  l.append(list(map(int, input().split())))
#print(l)
import itertools
d=len(list(itertools.permutations(l)))
cnt=0
fin=0
for v in itertools.permutations(l):
  chk=0
  for z in range(len(v)-1):
    chk+=((v[z][0]-v[z+1][0])**2+(v[z][1]-v[z+1][1])**2)**0.5
  fin+=chk
print(fin/d)

Measured memory_bytes: 74444
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

Xs = [A, B, C, D, E]
Xs = sorted(Xs, key = lambda x: - x % 10)
ans = 0
for X in Xs[:-1]:
    ans += (X + 9) // 10 * 10
ans += Xs[-1]

print(ans)


Measured memory_bytes: 3060
def r(x1, y1, x2, y2, x3, y3):
    return x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2) > 0

while True:
    try:
        line = input()
    except:
        break

    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.strip().split())

    abc = r(x1, y1, x2, y2, x3, y3)
    pab = r(xp, yp, x1, y1, x2, y2)
    pbc = r(xp, yp, x2, y2, x3, y3)
    pca = r(xp, yp, x3, y3, x1, y1)

    print('YES' if abc == pab == pbc == pca else 'NO')

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int W, a, b;
  cin >> W >> a >> b;
  if(abs(a - b) <= W) {
    cout << 0 << endl;
  } else {
    cout << abs(a - b) - W;
  }
  return 0;
}

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

int main() {
    int64_t A, B, C, K;
    std::cin >> A >> B >> C >> K;

    int64_t max = 0;
    if (K <= A) {
        max += K;
    } else {
        max += A;
        K -= A;

        if (K > B) {
            K -= B;
            max -= K;
        }
   }

    std::cout << max << std::endl; 

    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define cina(a, n) for (int i = 0; i < n; ++i){ cin >> a[i]; }
#define ll long long

using namespace std;

int main () {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int t = 1;
	while (a > 0 && c > 0) {
		if (t) {
			c -= b;
		} else {
			a -= d;
		}
		t = 1 - t;
	}
	if (a <= 0) {
		cout << "No";
	} else {
		cout << "Yes";
	}

	return 0;
}

Measured memory_bytes: 3652
using System;

namespace ABC128_A
{
    class Program
    {
        static void Main(string[] args)
        {
            var ap = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            var za = ap[0] * 3;
            Console.WriteLine((za + ap[1]) / 2);
        }
    }
}


Measured memory_bytes: 11092
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define yorn(f) puts((f)?"safe":"unsafe")
#define YORN(f) puts((f)?"YES":"NO")
ll s,w;
//ld ;
//string s;
// char c;

int main() {
  cin >> s >> w;
  yorn(s>w);
  return 0;
}

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

int main(){
    int n,k; cin>>n>>k;
    vector<ll> h(n);
    rep(0,i,n){
        cin >> h.at(i);
    }
    sort(h.begin(),h.end());
    reverse(h.begin(),h.end());
    
    ll sum = 0;
    rep(k,i,n){
        sum += h.at(i);
    }

    cout << sum << endl;
}


Measured memory_bytes: 1792
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    scanf("%d", &n);
    vector<int> via(n),vib(n);
    for(int i = 0; i < n; i++){
        scanf("%d", &via[i]);
    }
    for(int i = 0; i < n; i++){
        scanf("%d", &vib[n-i-1]);
    }
    
    int k = -1;
    int kCount = 0;
    for(int i = 0; i < n; i++){
        if(via[i] == vib[i]){
            k = via[i];
            kCount++;
        }
    }
    if(kCount > 0){
        int iaNotEqual_k, ibNotEqual_k, iabEqual_k;
        for(int i = 0; i < n; i++){
            if(via[i] == k){
                iaNotEqual_k = i;
                break;
            }        
        }
        for(int i = 0; i < n; i++){
            if(vib[i] == k){
                ibNotEqual_k = i;
                break;
            }        
        }
        for(int i = n - 1; i >= 0; i--){
            if(via[i] == vib[i]){
                iabEqual_k = i;
                iabEqual_k++;
                break;
            }        
        }
        int iRev = min(iaNotEqual_k + ibNotEqual_k, iabEqual_k);
        reverse(vib.begin(), vib.begin()+iRev);
        reverse(vib.begin()+iRev, vib.end());
    }
        
    for(int i = 0; i < n; i++){
        if(via[i] == vib[i]){
            printf("No");
            return 0;
        }
    }
    
    printf("Yes\n");
    for(int i = 0; i < n; i++){
        printf("%d ", vib[i]);
    }
    return 0;
}


Measured memory_bytes: 4444
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <functional>
#include <climits>
#include <cstring>
#include <cmath>

using namespace std;

#define int long long

#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 unless(a) if(!(a))
#define all(a) begin(a),end(a)
#define fst first
#define scd second
#define PB emplace_back
#define PPB pop_back

using ll=long long;
using vi=vector<int>;
using pii=pair<int, int>;

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); };

bool chmin(int&a,int b){return a>b?(a=b,true):false;}
bool chmax(int&a,int b){return a<b?(a=b,true):false;}
int read(){int a;scanf("%lld",&a);return a;}

const int inf = TEN(9) + 10;
const int mod = TEN(9) + 7;

struct edge {
	int to, cost;
	edge(int to, int cost) : to(to), cost(cost) {}
};

int Q;

signed main()
{
	string s; cin >> s;
	int n = s.size();
	s += "??";

	string t = "";

	rep(i, n) {
		if (s[i] == 'A') {
			t += 'A';
		} else if (s[i] == 'B') {
			if (s[i + 1] == 'C') {
				t += 'X';
				i++;
			} else {
				t += '/';
			}
		} else {
			t += '/';
		}
	}

	int ans = 0;
	int a = 0, x = 0;
	t += '/';

	rep(i, t.size() - 1) {
		if (t[i] == 'A') {
			a++;
		} else if (t[i] == 'X') {
			ans += a;
			x++;
		} else {
			a = x = 0;
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 776
#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int a,b;
    cin>>a>>b;
    if(a>b)cout<<a-1<<endl;
    else cout<<a<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include<map>
#include<algorithm>
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> p(n),q(n);
    for(int i = 0;i < n;i++){
        cin >> p[i];
    }
    for(int i = 0;i < n;i++){
        cin >> q[i];
    }
    vector<int> a(n);
    for(int i = 0;i < n;i++){
        a[i] = i + 1;
    }
   
   map<vector<int>,int> mp;//数列、長さ（辞書順の番号）
   
   do{
       mp[a] = mp.size();
   }while(next_permutation(a.begin(),a.end()));
   int ans = abs(mp[p] - mp[q]);
   cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5248