akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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; }

//計算量->期待値O(n)
using ld=long double;
using Pld=pair<ld,ld>;
ld EPS=1e-10;

ld dis(Pld a,Pld b){
    return sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}

//三角形の面積，サラスの公式
ld area_triangle(Pld a,Pld b,Pld c){
    Pld x={b.first-a.first,b.second-a.second},
        y={c.first-a.first,c.second-a.second};
    return abs(x.first*y.second-x.second*y.first)/2;
}

bool eq(ld a,ld b){
    return (abs(a-b)<EPS);
}

auto MinimumBoundingCircle(vector<Pld> v){
    int n=v.size();
    
    //ランダムシャッフル．いぢわるされたくないもんだ
    mt19937 mt(time(0));
    shuffle(v.begin(),v.end(),mt);

    long double r,cx,cy;

    //3点で円を作る
    auto make_circle2=[&](Pld a,Pld b){
        cx=(a.first+b.first)/2;
        cy=(a.second+b.second)/2;
        r=dis(a,b)/2;
    };

    //3点で円を作る
    auto make_circle3=[&](Pld A,Pld B,Pld C){
        //wikiの公式
        ld S=area_triangle(A,B,C);
        ld a=dis(B,C),b=dis(A,C),c=dis(A,B);
        cx=A.first*a*a*(b*b+c*c-a*a)+B.first*b*b*(c*c+a*a-b*b)+C.first*c*c*(a*a+b*b-c*c);
        cx/=16*S*S;
        cy=A.second*a*a*(b*b+c*c-a*a)+B.second*b*b*(c*c+a*a-b*b)+C.second*c*c*(a*a+b*b-c*c);
        cy/=16*S*S;
        r=dis({cx,cy},A);
    };

    auto isIn=[&](Pld a){
        return dis({cx,cy},a)<r+EPS;
    };

    make_circle2(v[0],v[1]);
    for(int i=2;i<n;i++){
        //v[i]が円に入っていないなら
        if(!isIn(v[i])){
            //円内にないなら点v[i]は必ず円周上に来る
            make_circle2(v[0],v[i]);
            for(int j=1;j<i;j++){
                if(!isIn(v[j])){
                    //この時iとjが円周上を考える
                    make_circle2(v[i],v[j]);
                    //最後の1点の決定
                    for(int k=0;k<j;k++){
                        if(!isIn(v[k])){
                            make_circle3(v[i],v[j],v[k]);
                        }
                    }
                }
            }
        }
    }
    //返すのは場合によって中心なりrなりにする
    return r;
}



signed main(){
    cout<<fixed<<setprecision(12);
    int n;cin>>n;
    vector<Pld> v(n);
    rep(i,n) cin>>v[i].first>>v[i].second;
    cout<<(MinimumBoundingCircle(v))<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=200010;
const ll mod=1e9+7;


int main(){
  int n,m;
  cin >> n >> m;
  vector<ll> a(n);
  vector<ll> b(n);
  vector<ll> c(m);
  vector<ll> d(m);
  rep(i,n){cin>>a[i]>>b[i];}
  rep(i,m){cin>>c[i]>>d[i];}
  
  rep(i,n){
    ll cnt=longinf;
    int ans=-1;
    rep(j,m){
      ll tmp=abs(a[i]-c[j])+abs(b[i]-d[j]);
      if(cnt>tmp){cnt=tmp; ans=j;}
    }
    cout << ans+1 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
 
using namespace std;
 
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
 
    if (b < a) swap(a, b);
    if (c < b) swap(b, c);
    if (b < a) swap(a, b);
 
    cout << a << " " << b << " " << c << endl;
}

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

LL n;

int main() {
	cin>>n;
	LL N=n-1;
	int sq=sqrt(n-1);
	int faktor=1;
	for (int i=2; i<=sq; i++) {
		int p=0;
		while (N%i==0) {
			N/=i;
			p++;
		}
		if (p!=0) faktor*=(p+1);
	}
	if (N!=1) faktor*=2;
	faktor--;
	sq=sqrt(n);
	LL ans=0;
	for (int i=2; i<=sq; i++) {
		LL en1=n, en2=n, bagi;
		if (n%i==0) {
			bagi=n/i;
			while (en1%i==0) {
				en1/=i;
			}
			if (en1%i==1) ans++;
			if (bagi!=i) {
				while (en2%bagi==0) en2/=bagi;
				if (en2%bagi==1) ans++;
			}
		}
	}
	//cout<<"faktor: "<<faktor<<endl;
	cout<<ans+faktor+1<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(stderr,args)
#else
#define debug(args...)
#endif //ONLINE_JUDGE
template<typename T> inline T abs(T t) { return t < 0? -t : t; }
const ll modn = 1000000007;
inline ll mod(ll x) { return x % modn; }

const int MAXN = 212345;

int n, m, k;
char s[MAXN];

int main (){
    scanf(" %s", s);
    n = strlen(s);
    int ia = n, iz = -1;
    for(int a=0;a<n;a++){
        if(s[a] == 'A')
            ia = min(ia, a);
        if(s[a] == 'Z')
            iz = max(iz, a);
    }
    printf("%d\n", iz-ia+1);
}


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

// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;

// REPEAT
// ----------------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REPA(i,a) for(ll i=0;i<(ll)(a.size());i++);
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define COUT(a) cout << (a) << endl;
#define ENDL(a) cout << endl;
#define COUTA(i,a) for(ll i=0;i<(ll)(a.size());i++) {cout << (a)[i] << " ";} cout << endl;

// UTIL
// ----------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())

// DEBUG
// ----------------------------------------
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

// BIT FLAG
// ----------------------------------------
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
const unsigned int BIT_FLAG_8 = (1 << 8); // 0000 0001 0000 0000
const unsigned int BIT_FLAG_9 = (1 << 9); // 0000 0010 0000 0000
const unsigned int BIT_FLAG_10 = (1 << 10); // 0000 0100 0000 0000
const unsigned int BIT_FLAG_11 = (1 << 11); // 0000 1000 0000 0000

// CONST
// ----------------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI=3.14159265358979323846; // or M_PI
constexpr int MOD = 1000000007;


void Main() {
  string s;
  ll n;

  cin >> n;
  vll d(n);
  REP(i, n) {
    cin >> d[i];
  }

  ll total = 0;
  REP(i, n) {
    FOR(j, i + 1, n - 1) {
        total += d[i] * d[j];
    }
  }

  COUT(total);


}

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

/*

3 2
*/


Measured memory_bytes: 3592
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  int x, a, b;
  readf("%s %s %s\n", &x, &a, &b);
  if (abs(a - x) < abs(b - x)) {
    writeln("A");
  } else {
    writeln("B");
  }
}


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

int a,b;

int main()
{
  scanf("%d%d",&a,&b);
  if(a<=0 && b>=0) {printf("Zero");}
  else if(b>0) {printf("Positive");}
  else if((b-a+1)&1) {printf("Negative");}
  else printf("Positive");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)

using namespace std;
int N, M, S;

int main(void){
	//IO("test.in", "test.out");
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		int n;
		scanf("%d", &n);
		S += n;
		if(n > M) M = n;
	}
	printf("%d\n", S - M / 2);
}

Measured memory_bytes: 256
#include <stdio.h>
int main() {
	int n;
	scanf("%d", &n);
	for (int i = 0; i < 8; i++) {
		if (n < 1 << i) {
			printf("%d\n", 1 << (i - 1));
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//Get the highest value and key from a map.
template<typename KeyType, typename ValueType>
std::pair<KeyType,ValueType> get_max( const std::map<KeyType,ValueType>& x ) {
  using pairtype=std::pair<KeyType,ValueType>;
  return *std::max_element(x.begin(), x.end(), [] (const pairtype & p1, const pairtype & p2) {
        return p1.second < p2.second;
  });
}
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;

int main() {
  int n, m;
  cin >> n >> m;
  ll l, r;
  l = -INF;
  r = INF;
  rep(i, m) {
    ll a, b;
    cin >> a >> b;
    l = max(l, a);
    r = min(r, b);
  }

  if (r >= l) {
    cout << (r - l) + 1 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {
    public static void main(String[]args){
		Scanner sc = new Scanner(System.in);
		PrintWriter ou = new PrintWriter(System.out);
		int n = Integer.parseInt(sc.next());
		int[] a = new int[n];
		for(int i = 0 ; i < n ; i++) a[i] = Integer.parseInt(sc.next()) - 1;
		sc.close();
		boolean[] q = new boolean[n];
		Arrays.fill(q , false);
		q[0] = true;
		int now = 0;
		for(int i = 0 ; i < n ; i++){
			q[now] = true;
			now = a[now];
		}
		if(!q[1]) ou.println(-1);
		else{
			int cou = 0;
			Arrays.fill(q , false);
			now = 0;
			while(!q[1]){
				cou++;
				now = a[now];
				q[now] = true;
			}
			ou.println(cou);
		}
		ou.flush();
	}
}

Measured memory_bytes: 59100
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <functional>

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  long long int A[N], sum=0;
  for(int i=0; i<N; i++) cin >> A[i];
  vector<pair<long long int, long long int> > data(M);
  for(int i=0; i<M; i++) cin >> data[i].second >> data[i].first;
  sort(A, A+N);
  sort(data.begin(), data.end(), greater<pair<long long int, long long int> >());
  int k=0, flag=0;
  for(int i=0; i<M; i++){
    for(int j=0; j<data[i].second; j++){
      if(k == N || A[k] > data[i].first){
        flag = 1;
        break;
      }
      A[k] = data[i].first;
      k++;
    }
    if(flag == 1) break;
  }
  for(int i=0; i<N; i++) sum += A[i];
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 2560
#include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
    
    int main(void){
		int ai[100];
		int N,i,max,min;
		scanf("%d",&N);
		
		for(i = 0;i < N; i++) scanf("%d",&ai[i]);
		max = ai[0];
		min = ai[0];
		for(i = 0;i < N; i++){
			if(max < ai[i]) max = ai[i];
			if(min > ai[i]) min = ai[i];
		}
		printf("%d" , max - min);
    }
     

Measured memory_bytes: 128
def dfs(i,prohi,visited,edges,before=-1): 
    if visited[i]:
        cnt=1
        visited[i]=False
        for e in edges[i]:
            if e[1]!=prohi and e[0]!=before:
                cnt+=dfs(e[0],prohi,visited,edges,i)
        return cnt

    else:
        return 0

def main():
    import sys
    input=sys.stdin.readline
    n,m=map(int,input().split())
    edges=[[] for i in range(n)]
    for i in range(m):
        a,b=map(int,input().split())
        a-=1
        b-=1
        edges[a].append([b,i])
        edges[b].append([a,i])
    
    ans=0
    for prohi in range(m):
        cnt=0
        visited=[True]*n
        if dfs(0,prohi,visited,edges)!=n:
            ans+=1
    print(ans)
if __name__=='__main__':
    main()

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
//#include <bits/stdc++.h>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "Yes" : "No";
}
int main()
{
    int n; cin >> n;
    int a[n+10];
    a[0] = 0;
    rep1(i,n) cin >> a[i];
    
    int rd = 0;
    rep(i,n){
        rd += abs(a[i+1]-a[i]);
    }
    rd += abs(a[n]-a[0]);
    
    rep1(i,n){
        if(i != n){
            int dx = abs(a[i+1]-a[i-1]) - abs(a[i]-a[i-1])-abs(a[i+1]-a[i]);
            cout << rd+dx << endl;
        }else{
            int dx = abs(a[0]-a[i-1]) - abs(a[i]-a[i-1]) - abs(a[0]-a[i]);
            cout << rd+dx << endl;
        }
    }
        
        
}



Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define RFOR(i,a,b) for(int i=(b-1); i>=(a); i--)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
using ll = long long;
using D = double;
using LD = long double;
using P = pair<int, int>;
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; }

int main(){
    vector<int> v(5);
    rep(i,5) cin >> v[i];
    rep(i,5){
        if(v[i] == 0){
            cout << i+1 << endl;
            return 0;
        }
    }
}


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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define pll pair<ll, ll>
#define vll vector<ll>
#define mll map<ll, ll>

using namespace std;

const ll MOD = 1000000007LL;
const ll INF = (1LL << 60LL);

int main() {
  ll N;
  scanf("%lld", &N);

  vector<ll> list;
  for (ll i = 0; i < N; i++) {
    ll v;
    scanf("%lld", &v);
    list.emplace_back(v);
  }
  sort(list.begin(), list.end());

  ll ans = 0;

  for (ll i1 = 0; i1 < N - 2; i1++) {
    for (ll i2 = i1 + 1; i2 < N - 1; i2++) {
      for (ll i3 = i2 + 1; i3 < N; i3++) {
        auto v1 = list[i1];
        auto v2 = list[i2];
        auto v3 = list[i3];
        if (v1 == v2 || v2 == v3) {
          continue;
        }
        vll v = {v1, v2, v3};
        sort(v.begin(), v.end());

        if (v[2] < v[1] + v[0]) {
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3676
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
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; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define vint vector<int>
#define pri_que priority_queue
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define show(x) cout<<#x<<"="<<x<<endl;
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >>n;
    vint a(n+1),b(n);
    rep(i,n+1) cin>>a[i];
    rep(i,n)cin>>b[i];

    int res=0;
    rep(i,n){
        int k1=0,k2=0;
        k1=min(b[i],a[i]);
        //b[i]-=k1;
        k2=max(0LL,min(b[i]-k1,a[i+1]));
        a[i+1]-=k2;
        res+=k1+k2;
        //show(k1);show(k2);
    }   
    cout<<res<<endl;
}

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

typedef double du ;
typedef string st ;
typedef long long ll ;
typedef long double ld ;
typedef long long int lli ;

#define vi vector <lli>
#define loop(num) for (lli i = 0 ; i < num ; i ++ )
#define loopcin(num , ar ) for (lli i = 0 ; i < num ; i ++ ) {cin >> ar [i] ;}
#define loopcout(num , ar) for (lli i = 0 ; i < num ; i ++ ) {cout << ar [i] << ' '; }

#define forr(num1 , num2) for (lli i = num1 ; i < num2 ; i ++ )
#define forrcin(num1 , num2 , ar ) for (lli i = num1 ; i < num2 ; i ++ ) {cin >> ar [i] ;}
#define forrcout(num1 , num2 , ar) for (lli i = num1 ; i < num2 ; i ++ ) {cout << ar [i] << ' '; }

#define D2forrcin(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cin >> A[i][j] ;}}
#define D2forrcout(num1_1 , num1_2 , num2_1 , num2_2 , A ) for (lli i = num1_1 ; i < num1_2 ; i ++){ for (lli j = num2_1 ; j < num2_2 ; j++){cout << A[i][j] << ' ' ;}cout << endl ;}

#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main ()
{
    fastio
    st u ;
    pair <st , lli> a[2] ;
    cin >> a[0] . first >> a[1] . first ;
    cin >> a[0] . second >> a[1] . second ;
    cin >> u ;
    if (u == a[0] . first)
        a[0] . second -- ;
    else if (u == a[1] . first)
        a[1] . second -- ;

    cout << a[0] . second << ' ' << a[1] . second ;


    return 0 ;
}

/*___________________________________________________________________functions___________________________________________________________________________*/



Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main(){
    long long i,n,a,b,l=-1,r=1e10,mid,h[100010],c,d;
    cin >> n >> a >> b;
    for(i=0;i<n;i++){
        cin >> h[i];
    }

    while(r-l>1){
        mid = (l+r)/2;
        c = 0;
        for(i=0;i<n;i++){
            d = (h[i]-mid*b+a-b-1)/(a-b);
            if(d>0){
                c += d;
            }
        }
        if(c<=mid){
            r = mid;
        }else{
            l = mid;
        }
    }
    cout << r << endl;
}

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

#define ull unsigned long long

#define min(a, b) ((a) > (b) ? (b) : (a))
#define max(a, b) ((a) > (b) ? (a) : (b))

bool isPalindrome(string s) {
    string t(s.rbegin(), s.rend());
    return s == t;
}

int main(void) {
    long A, B;
    long count = 0;
    cin >> A >> B;
    for(long i = A;i <= B;i++) {
        if(isPalindrome(to_string(i))) count += 1;
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
defmodule Main do
  def main do
    n = IO.gets("") |> String.trim() |> String.to_integer()

    IO.stream(:stdio, :line)
    |> Enum.take(n)
    |> Enum.map(&String.trim/1)
    |> Enum.frequencies()
    |> print()
  end

  defp print(map) do
    ["AC", "WA", "TLE", "RE"]
    |> Enum.map(fn s ->
      "#{s} x #{Map.get(map, s, 0)}"
    end)
    |> Enum.each(&IO.puts/1)
  end
end


Measured memory_bytes: 75432
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;

#define rep(i,x,y) for(int i=(x); i<(y); ++i)
const int INF = (1<<30);
const ll INFLL = 1LL<<62;
const long double EPS = 1e-12;

template <typename T>
void vec_print(vector<T> VEC){
  rep(i, 0, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  rep(i, 0, MAT.size()){
    rep(j, 0, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

class HOGE{
  public:
    ll index;
    ll value;
    HOGE(ll index, ll value){
      this->index = index;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "index : " << index << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  cin >> N;

  ll N_copy = N;

  ll num_loop=0;
  ll count=0;
  bool flag=true;
  while(N>0){
    count += N%10;
    N = N/10;
    num_loop++;
  }

  ll N_=1;
  while(num_loop>1){
    N_*=10;
    num_loop--;
  }

  if(N_==N_copy){
    cout << "10" << "\n";
    return 0;
  }

  cout << count << "\n";

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  queue<pair<string,char>> A;
  A.push(make_pair("",'a'));
  while(!A.empty()){
    pair<string,char> p=A.front();
    A.pop();
    if(p.first.size()==N){
      cout<<p.first<<endl;
      continue;
    }
    for(char c='a';c<p.second;c++)
      A.push(make_pair(p.first+c,p.second));
    A.push(make_pair(p.first+p.second,p.second+1));
  }
}

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


long long divMod(long long a, long long b){
    if(a % b == 0){
        return a/b;
    }else{
        return a/b + 1;
    }
}

void solve(long long H, long long W, long long N){
    long long res = 0;
    if(H > W){
        res = divMod(N, H);
    }else{
        res = divMod(N, W);

    }
    cout << res << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    long long N;
    scanf("%lld",&N);
    solve(H, W, N);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=1e9+7;
signed main(){
    ll d;cin>>d;
    vector<ll>c(26);
    rep(i,26)cin>>c[i];
    vector<vector<ll> >s(d,vector<ll>(26));
    rep(i,d){
        rep(j,26)cin>>s[i][j];
    }
    vector<ll>last(26);
    vector<ll>v(d);
    ll ans=0;
    rep(i,d){
        ll t;cin>>t;
        t--;
        ans+=s[i][t];
        last[t]=i+1;
        rep(j,26){
            ans-=c[j]*(i-last[j]+1);
        }
        v[i]=ans;
    }
    rep(i,d){
        cout<<v[i]<<endl;
    }
}

Measured memory_bytes: 3720
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstring>
#include<string>
using namespace std;
int n,a[55],ss=0;
string s[55]; 
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>s[i]>>a[i];
	string t;
	cin>>t;
	for(int i=n;i>=1;i--){
		if(s[i]==t)return cout<<ss<<endl,0;
		ss+=a[i];
	}
}

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

using namespace std;

int main() {
	int d, n, ans = 1;
	cin >> d >> n;
	while (n) {
		int sa = ans, cnt = 0;
		while (sa % 100 == 0) {
			sa /= 100;
			++cnt;
		}
		if (cnt == d)
			--n;
		++ans;
	}
	cout << ans - 1 << '\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define debug(x) cerr << #x << " " << x << '\n'
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
const int INF = 0x3f3f3f3f, N = 255;
const ll LINF = 1e18 + 5;
int n, a[N], x[N][N], y[N][N];
int main()
{
 	ios::sync_with_stdio(false);
 	cin.tie(0);
 	cin >> n;
 	for(int i=0;i<n;i++)
 	{
 		cin >> a[i];
 		for(int j=1;j<=a[i];j++)
 			cin >> x[i][j] >> y[i][j];
 	}
 	int ed = (1<<n)-1, ans = 0;
 	for(int i=1;i<=ed;i++)
 	{
 		bool tag = 1;
 		int cnt = 0;
 		for(int j=0;j<n;j++)
 		{
 			if((i>>j)&1)
 			{
 				cnt++;
 				for(int k=1;k<=a[j];k++)
 				{
 					if(((i>>(x[j][k]-1))&1)!=y[j][k]) tag = 0;
 				}
 			}
 		}
 		if(tag&&cnt>ans) ans = cnt;
 	}
 	cout << ans;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define INF 1ll<<60
using namespace std;
signed main(){
  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  int a,b;
  cin>>a>>b;
  vector<int>vet(a);
  int aux=b;
  int menor=INF;
  int guardi;
  for(int i=0;i<a;i++){
    vet[i]=aux;
    aux++;
    if(abs(vet[i]-0)<menor){
      menor=abs(vet[i]-0);
      guardi=i;
    }
  }
  vet[guardi]=0;
  int soma=0;
  for(int i=0;i<vet.size();i++){
    soma+=vet[i];
  }
  cout<<soma<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

#define sz(x) (int) x.size()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end())
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x)) 
#define y1 aksjdaskdjksjfksdjf
#define left kdnvldvoiwejifejg
#define right lkdsjflksdjfdjfk
#define prev asdasfsadjkjsdfjs
#define tm aklsjdasjdasjdkdjjf
#define lcm hddalkwjeidjjhasda
#define random_shuffle asdasdd

string s, t;
int mp[500], mpb[500];
int cnt;

int main() { 

  getline(cin, s);
  getline(cin, t);

  for (int i = 0; i < sz(s); i++) {
    if ((mp[s[i]] && mp[s[i]] != t[i]) || (mpb[t[i]] && mpb[t[i]] != s[i])) {
      puts("No");
      return 0;
    }
    mp[s[i]] = t[i];
    mpb[t[i]] = s[i];
  }
  
  puts("Yes");

  return 0;
}


Measured memory_bytes: 1020
# include <cmath>
# include <iostream>
# include <queue>
# include <set>
# include <stack>
# include <string>
# include <vector>


using namespace std;


int main() {
    int a; cin >> a;
    string s; cin >> s;

    if (a < 3200) {
        cout << "red" << endl;
    }
    else {
        cout << s << endl;
    }
    return 0;
}



Measured memory_bytes: 888
fun main(args: Array<String>) = yorukatsu9d()

fun yorukatsu9d() {
    val (n, x) = readLine()!!.split(' ').map { it.toLong() }

    val pattyAndBans = LongArray(51)
    pattyAndBans[0] = 1
    for (i in 0 until pattyAndBans.lastIndex) pattyAndBans[i + 1] = pattyAndBans[i] * 2 + 3

    val bans = LongArray(51)
    bans[0] = 1
    for (i in 0 until bans.lastIndex) bans[i + 1] = bans[i] * 2 + 1

    fun dfs(lv: Int, pos: Long): Long {
        if (lv == 0) return 1
        if (pos == 1L) return 0
        if (pos == pattyAndBans[lv]) return bans[lv]
        val mid = pattyAndBans[lv] / 2 + 1
        return when {
            pos < mid -> dfs(lv - 1, pos - 1)
            pos == mid -> bans[lv - 1] + 1
            else -> dfs(lv - 1, pos - mid) + bans[lv - 1] + 1
        }
    }

    val answer = dfs(n.toInt(), x)

    println(answer)
}


Measured memory_bytes: 37944
#include <bits/stdc++.h>
#define Int int64_t

using namespace std;

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

	bool ok = false;
	for (int i = 1; i * 100 <= x; ++i) {
		ok = ok || (i * 100 <= x && x <= i * 105);
	}
	cout << (ok ? 1 : 0) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
#define int long long
const int MAX = 2001;
const int MOD = 1000000007;
 
 


int u=0;
 
signed main(){
    int n;
    cin>>n;
    int a[n+1],b[n];
    for(int i=0;i<=n;i++){
        cin >>a[i];
    }
    for(int i=0;i<n;i++){
        cin >>b[i];
    }
    int ans1=0,t=0;
    for(int i=0;i<n;i++){
        if(a[i]-t>b[i]){
            ans1+=b[i]+t;
            t=0;
        }
        else{
            ans1+=a[i];
           t=b[i]-max(a[i]-t,u);
        }
    }
    ans1+=min(t,a[n]);
    int ans2=0;
    t=0;
    for(int i=n-1;i>=0;i--){
        if(a[i+1]-t>b[i]){
            ans2+=b[i]+t;
            t=0;
        }
        else{
            ans2+=a[i+1];
           t=b[i]-max(a[i+1]-t,u);
        }
    }
    ans2+=min(t,a[0]);

    cout<<max(ans1,ans2);

    return 0;
}

Measured memory_bytes: 1792
n=int(input())
if n==1:
    print(0)
    exit()
h=list(map(int,input().split()))
height=h[0]
l=[]
cnt=0
for i in range(1,n):
    if h[i]<=height:
        cnt+=1
    else:
        cnt=0
    height=h[i]
    l.append(cnt)
print(max(l))

Measured memory_bytes: 20496
def main():
    a, b, c = map(int, input().split())
    k = int(input())
    while b <= a:
        b *= 2
        k -= 1
    while c <= b:
        c *= 2
        k -= 1
    if k >= 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()


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

void solve(std::string S){
    ll ans =0;
    for(int i=0;i<3;i++){
        ll num =0;
        while(i<3 && S[i] == 'R'){
            num++;
            i++;
        }
        ans = max(ans,num);
    }
    cout << ans << endl;

}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 3624
"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let N = cin.getInt();
    let A0 = new Array(N);
    let A1 = new Array(N);
    for (let n = 0; n < N; n++) A0[n] = cin.getInt();
    for (let n = 0; n < N; n++) A1[n] = cin.getInt();
    for (let n = 1; n < N; n++) {
        A0[n] += A0[n - 1];
        A1[N - n - 1] += A1[N - n];
    }
    let ans = 0;
    for (let n = 0; n < N; n++) {
        let s = A0[n] + A1[n];
        if (ans < s) ans = s;
    }
    console.log(ans);
}
class Inputer{constructor(t){if(typeof t=='undefined')throw new Error('引数（stdin）を省略できません！');this.cnt=0;this.items=t.split(/\n|\s/)}getInt(){return this.items[this.cnt++]-0}getIntArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');if(t<1)throw new Error('引数は1以上であること！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getInt();return r}getStr(){return this.items[this.cnt++]}getStrArray(t){if(typeof t=='undefined')throw new Error('引数（1以上）を省略できません！');if(t<1)throw new Error('引数は1以上であること！');let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getStr();return r}}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

int main(){
	ll w,a,b,ans=INF;
	cin>>w>>a>>b;
	
	if(b>(a+w)){
		ans=min(ans,b-(a+w));
	}
	if(a>(b+w)){
		ans=min(ans,a-(b+w));
	}
	if(ans==INF){
		ans=0;
	}
	cout<<ans<<endl;


    return 0;
}

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

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

    int N;
    cin >> N;

    vector<vector<ll>> a(3, vector<ll>(N, 0));
    rep(i,N) rep(j,3) cin >> a[j][i];

    vector<vector<ll>> dp(3, vector<ll>(N, 0));
    rep(i,3) dp[i][0] = a[i][0];

    for (int i = 1; i < N; i++) {
        dp[0][i] = max(dp[0][i], dp[1][i-1] + a[0][i]);
        dp[0][i] = max(dp[0][i], dp[2][i-1] + a[0][i]);

        dp[1][i] = max(dp[1][i], dp[0][i-1] + a[1][i]);
        dp[1][i] = max(dp[1][i], dp[2][i-1] + a[1][i]);

        dp[2][i] = max(dp[2][i], dp[0][i-1] + a[2][i]);
        dp[2][i] = max(dp[2][i], dp[1][i-1] + a[2][i]);
    }

    cout << max(dp[0][N-1], max(dp[1][N-1], dp[2][N-1])) << endl;

    return 0;
}


Measured memory_bytes: 5752
package main

import "fmt"

func main() {
	var x int
	fmt.Scan(&x)

	for {
		ok := true
		for j := 2; j*j <= x; j++ {
			if x%j == 0 {
				ok = false
				break
			}
		}
		if ok {
			fmt.Println(x)
			return
		}
		x++
	}
}


Measured memory_bytes: 1772
n=int(input())
l=[input().split() for i in range(n)]
for i in range(n):
  if l[i][1]=="JPY":
    l[i][1]=1
  else:
     l[i][1]=380000
print(sum(float(l[i][0])*l[i][1] for i in range(n)))

Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr ll mod = 1000000007;

pair<ll, ll> extgcd(ll a, ll b) {
    if (b == 0) return make_pair(a, 0);
    auto t = extgcd(b, a % b);
    return make_pair(t.second, t.first - (a / b) * t.second);
}

ll imd[2001], ifd[2001], fd[2001];

ll inv_mod(ll n) {
    if (n < 1) throw;
    if (imd[n] == 0) imd[n] = ((extgcd(n, mod).first%mod)+mod)%mod;
    return imd[n];
}

ll fac_inv(ll n) {
    if(n < 0) throw;
    if (n == 0) return 1;
    if (ifd[n] == 0) ifd[n] = (fac_inv(n - 1) * inv_mod(n)) % mod;
    return ifd[n];
}

ll fac(ll n) {
    if(n < 0) throw;
    if (n == 0) return 1;
    if (fd[n] == 0) fd[n] = (fac(n - 1) * n) % mod;
    return fd[n];
}

ll cmb(ll n, ll k) {
    if(n < k || k < 0) throw;
    return (((fac(n) * fac_inv(k)) % mod) * fac_inv(n - k)) % mod;
}

int main() {
    ll n, k;
    cin >> n >> k;
    for (ll i = 1; i <= k; i++) {
        ll p = 0;
        ll r = cmb(k - 1, i - 1);//blue i
        if (n - k == 0 && i == 1) {
            cout << r << endl;
            continue;
        }
        if ((n - k) - 1 >= i - 2 && i >= 2) {
            ll s = cmb((n - k) - 1, i - 2);//red i-1
            p = (p + (r * s)) % mod;
        }
        if ((n - k) - 1 >= i - 1) {
            ll s = cmb((n - k) - 1, i - 1);//red i
            p = (p + (r * s * 2)) % mod;
        }
        if ((n - k) - 1 >= i) {
            ll s = cmb((n - k) - 1, i);//red i+1
            p = (p + (r * s)) % mod;
        }
        cout << p << endl;
    }
}


Measured memory_bytes: 384
import java.io.*;

class Main{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line;
int[] l=new int[11];
l[0]=0;
while((line=br.readLine())!=null){
String[] value=line.split(",");
for(int i=0;i<10;i++){
l[i+1]=l[i]+Integer.parseInt(value[i]);
}
int v1=Integer.parseInt(value[10]);
int v2=Integer.parseInt(value[11]);
double d=l[10]*v1/(v1+v2);
for(int i=0;i<10;i++){
if(l[i+1]>=d){
System.out.println(i+1);
break;
}
}
}
}
}

Measured memory_bytes: 16896
#include<stdio.h>

int main(){
    int a, b, c;

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

    if(a == 1 || b == 1){
        if(a == 2 || b == 2){
            printf("%d\n", 3);
        }
        else {
            printf("%d\n", 2);
        }
    }
    else {
        printf("%d\n", 1);
    }


    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define reps(i, m, n) for (int i = m; i < n; i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

int main(void){
    int a, b, c, x, y;
    scanf("%d %d %d %d %d", &a, &b, &c, &x, &y);
    int ab = min(a+b, c*2);
    a = min(a, c*2);
    b = min(b, c*2);
    
    ll ans = ab*min(x, y)+a*max(0, x-y)+b*max(0, y-x);
    printf("%lld\n", ans);
    
    return 0;
}

Measured memory_bytes: 3828
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

typedef long long ll;
const int MAXN = 2e5 + 10;
int N;
int A[MAXN]; ll sum;
map<ll, int> mp;
ll ans;

int main() {
	register int i;
	scanf("%d", &N); mp[0] = 1;
	for(i = 1; i <= N; ++i)
		scanf("%d", A + i), sum += A[i], ans += mp[sum], ++mp[sum];
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 13568
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		(new Main()).doit(in);
	}
	
	void doit(BufferedReader in) throws IOException{
		String str;
		Stack stack = new Stack(10);
		int tmp;
		while(null != (str = in.readLine())){
			tmp = Integer.parseInt(str);
			if(tmp!=0){
				stack.push(tmp);
			}else{
				System.out.println(stack.pop());
			}
		}
	}
	
	class Stack{
		int stack[], sp;
		
		Stack(int capacity){
			stack = new int[capacity];
		}
		
		void push(int item){
			stack[sp++] = item;
		}
		
		int pop(){
			return stack[--sp];
		}
	}
}

Measured memory_bytes: 16872
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;

int main(int argc, char const *argv[])
{
    int N, i;
    cin >> N >> i;
    cout << N - i + 1 << endl;

    return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const ll INF=1e9;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,n){cout<<arr[i][j]<<" ";}cout<<endl;}
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    Vec v(n);
    Vec ans;
    rep(i,n){
        cin>>v[i];
    }
    while(!v.empty()){
        ll mx = 0;
        rep(i,v.size()){
            if(i+1==v[i]){
                mx = max(mx,i);
            }
        }
        if(mx==0&&v[mx]!=1){
            cout << -1 << endl;
            return 0;
        }else{
            ans.pb(v[mx]);
            v.erase(v.begin()+mx);
        }
    }
    reverse(ALL(ans));
    rep(i,ans.size()){
        cout<<ans[i]<<endl;
    }
    return  0;
}


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

int main()
{
	std::priority_queue<int> q;
	for( int i = 0; i < 10; i++ ){
		int n;
		std::cin >> n;
		q.push( n );
	}
	
	for( int i = 0; i < 3; i++ ){
		std::cout << q.top() << std::endl;
		q.pop();
	}

 	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int N, M, Q;
vector<vector<int>> q;
int ans = 0;

int judge(vector<int> v) {
    int ret = 0;
    REP(i,Q) {
        if (v[q[i][1]] - v[q[i][0]] == q[i][2]) ret += q[i][3];
    }
    return ret;
}

void dfs(vector<int> v,int x) {
    v.push_back(x);
    if (v.size() == N) {
        ans = max(ans,judge(v));
        return;
    }
    FOR(i,x,M+1) {
        dfs(v,i);
    }
}


int main(void)
{
    IOS
    cin >> N >> M >> Q;
    
    REP(i,Q) {
        vector<int> abcd(4);
        REP(j,4) cin >> abcd[j];
        abcd[0]--;
        abcd[1]--;
        q.push_back(abcd);
    }

    FOR(i,1,M+1) dfs(vector<int>(0),i);

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 3660
#include<bits/stdc++.h>
int main(){
  std::string s[3];
  long long k,a[3]={};
  std::cin>>s[0]>>k;
  for(size_t i=0;i<2;++i) s[i+1]=s[i]+s[0];
  for(size_t i=0;i<3;++i) for(size_t j=1;j<s[i].length();++j) if(s[i][j]==s[i][j-1]) ++a[i],++j;
  std::cout<<(k&1?a[0]:a[1])+(k-1)/2*(a[2]-a[0])<<std::endl;
  assert(a[0]+a[1]<=a[2]);
}


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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,ans=LINF,a[ohara],b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

      
      cin>>n;
      rep(i,n){
        cin>>a[i];
        sum+=a[i];
      }
      rep(i,n-1){
        x+=a[i];
        y=sum-x;
        ans=min(ans,abs(x-y));
      }
      Cout(ans);
     

       
return 0;
}


Measured memory_bytes: 1792
/*input
abracadabra
avadakedavra

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int main(){
	IOS
	string s,t;cin>>s>>t;
	ll dpt[s.size()+1][t.size()+1];
	memset(dpt,0,sizeof(dpt));
	ll i=1,j=1;
	for(i=1;i<=s.size();++i){
		for(j=1;j<=t.size();++j){
			if(s[i-1]==t[j-1]){
				dpt[i][j]=dpt[i-1][j-1]+1;
			}
			else{
				dpt[i][j]=max(dpt[i-1][j],dpt[i][j-1]);
			}
		}
	}
	i=s.size();j=t.size();
	string ans="";
	while(i>=1 && j>=1){
		if(max(dpt[i-1][j],dpt[i][j-1])==dpt[i][j]){
			// ans+=s[i-1];
			if(dpt[i-1][j]>dpt[i][j-1])
				--i;
			else
				--j;
		}
		else{
			ans+=s[i-1];
			--i;--j;
		}
	}
	reverse(ans.begin(),ans.end());
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 70656
#include "bits/stdc++.h"
#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;


template<class X> X gcd(X a, X b) {return b ? gcd(b,a%b):a;}
int main(){
    int N;
    cin >> N;
    ll HP;
    cin >> HP;
    for(int i = 0; i < N - 1; i++) {
        ll A;
        cin >> A;
        HP = gcd(HP, A);
    }
    cout << HP << endl;
}

Measured memory_bytes: 256