akhauriyash/Code-Regression huggingface dataset:
#define _GLIBCXX_DEBUG
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;

/*int P[10010];
void init(int n){
    for(int i=0;i<n;++i)P[i]=i;
}
int root(int a) {
    if(P[a]==a)return a;
    return (P[a]=root(P[a]));
}
bool is_same_set(int a,int b){
    return root(a) == root(b);//代表元を求める
}
void unite(int a,int b){
    P[root(a)]=root(b);
}//対set,グラフ？
//セグメント木？？？
*/

double dot_product(xy_t a, xy_t b) { return (conj(a)*b).real(); }//内積
double cross_product(xy_t a, xy_t b) { return (conj(a)*b).imag(); }//外積
xy_t projection(xy_t p, xy_t b) { return b*dot_product(p,b)/norm(b); }//投影
//対図形

#define mod 1000000007
/*ll f[2001];
//int n,k とかしておく

ll pw(ll x, ll y){//euclidの互除法より
    ll a= 1;
    while(y){
        if(y&1){//奇数なら
            a = a*x%mod;
        }
        x = x*x%mod;
        y /= 2;
    }
    return a;
}

ll modinv(ll x){//逆元を求める
    return pw(x, mod - 2 );
}

ll comb(int n,int r){
    if(n<r){
        return 0;
    }
    return f[n] * modinv(f[r])%mod*modinv(f[n-r])%mod;
}//対combination//ただしfは用意してね
*/

struct BIT{
    vector<int> dat;
    int sz;
    BIT(int n){
        for(sz=1;sz<n;sz *= 2);
        dat.resize(++sz);
    }
    int q(int n){
        int ret = 0;
        for(int i=n;i>0;i-=i&-i)ret +=dat[i];//和の計算　iから最後の１のbit(i&-i 多分＆はビット積)を減算
        for(int i=n;i<sz;i+=i&-i) dat[i]++;//値の加算　iから最後mの１のbitを加算
        return ret;
    }
};

int gcd(int x, int y){
    if(x<y){
        int z=x;
        x=y;
        y=z;
    }
    if(y==0)return x;
    return gcd(y,x%y);
}

int main(){
    int n;
    cin >> n;
    int a[n];
    rep(i,n){
        cin >> a[i];
    }
    int ans=1;
    vector<int> l(n),r(n);
    rep(i,n-1){
        l[i+1]=gcd(l[i],a[i]);
        r[n-i-2]=gcd(r[n-i-1],a[n-i-1]);
    }
    rep(i,n){
        ans=max(ans,gcd(r[i],l[i]));
    }
    cout<<ans <<endl;
    return 0;
}

Measured memory_bytes: 1408
a = input()
cIsExist = False

for i in range(len(a)):
    if i == 0:
        if a[i] != "A":
            print("WA")
            exit()
    elif 2 <= i <= len(a)-2:
        if a[i] == "C":
            if not cIsExist:
                cIsExist = not cIsExist
            else:
                print("WA")
                exit()
        else:
            if a[i] != a[i].lower():
                print("WA")
                exit()
    else:
        if a[i] != a[i].lower():
            print("WA")
            exit()
if cIsExist:
    print("AC")
else:
    print("WA")


Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
	char s[55];
	int N;
	int S;
	cin >> N;
	cin >> S;
	for (int i = 1; i <= N; i++)
	{
		cin >> s[i];
	}
	s[S] = s[S] +32;
	for (int i = 1; i <= N; i++)
	{
		cout<< s[i];
	}
	return 0;


}

Measured memory_bytes: 256
// atcoder/abc174/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  lli n, d;
  while (cin >> n >> d) {
    vec<pair<lli, lli>> v(n);
    cin >> v;

    int cnt = 0;
    each (i, v) {
      lli x = i.first * i.first;
      lli y = i.second * i.second;
      cnt += ((x + y) <= (d * d));
    }
    cout << cnt << endl;
  }

  return 0;
}


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

using namespace std;

int main(){
  int X, Y, Z;
  cin >> X >> Y >> Z;
  
  int tmp = 0;
  for(int i = 1; i <= (X + Y - 1) / Y; i++){
    if(i * Y + (i + 1) * Z > X){
      tmp = i - 1;
      break;
    }
  }
  cout << tmp;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=200111;
const int inf=1000000007;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};


struct UnionFind {
	vector<int> par;
	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool same(int x, int y) {
		return root(x) == root(y);
	}

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y); // merge technique
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};

vvl comb(int n, int r) {
vvl v(n + 1,vl(n + 1, 0));
for (int i = 0; i < v.size(); i++) {
v[i][0] = 1;
v[i][i] = 1;
}
for (int j = 1; j < v.size(); j++) {
for (int k = 1; k < j; k++) {
v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
}
}
return v;
}

void sosu(ll x,bool f[]){
	ll y=x;
	for(ll i=2;i<=sqrt(y);i++){
		if(x%i==0){
			x/=i;
			f[i]=true;
			i--;
		}
	}
}

ll __gcd(ll x,ll y){
	if(x<y)swap(x,y);
	while(1){
		ll tmp=x%y;
		x=y;
		y=tmp;
		if(y==0)break;
	}
	return x;
}


int main(){
	int n;
	ll p[2*M];
	cin>>n;
	rep(i,0,n)cin>>p[i];
	ll mi=p[0];
	int ans=0;
	rep(i,0,n){
		mi=min(mi,p[i]);
		if(mi==p[i])ans++;
	}
	print(ans);


}

Measured memory_bytes: 2560
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int dp[105][100010], s[105];
signed main(void)
{
	int n;
	cin >> n;
	REP(i, n) cin >> s[i];

	dp[0][0] = 1;
	FOR(i, 1, n+1) {
		REP(j, 100001) {
			if(j >= s[i-1] && dp[i-1][j-s[i-1]]) {
				dp[i][j] = 1;
				//cout << i << " " << j << endl;
			}
			if(dp[i-1][j]) {
				dp[i][j] = 1;
			}
		}
	}

	int ret = 0;
	REP(i, 100001) {
		if(dp[n][i] && i%10 != 0) {
			ret = i;
			//cout << "a" << endl;
		}
	}
	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 39168
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::{i32, i64, u32, u64, f64};
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};
//#[allow(unused_imports)]
//use proconio::marker::{Isize1, Usize1, Bytes, Chars};

//#[proconio::fastout]
fn main() {
    input!{
        s: String,
        k: i64
    }
    let k = k - 1;
    let s = s.chars().map(|c| c.to_digit(10).unwrap()).collect::<Vec<_>>();
    let p = s.iter().position(|n| *n != 1).unwrap_or(0);
    if k >= p as i64 { println!("{}", s[p]); }
    else { println!("1"); }
}



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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

int main(){
    map<int,int> mp;

    int n;  cin >> n;
    rep(i,n){
        int x;  cin >> x;
        mp[x]++;
    }

    cout << mp.size() << endl;

    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    int N,K;
    cin>>N>>K;
    long long ans=K;
    rep2(i,1,N){
        ans*=(K-1);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
// D - Wizard in Maze
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(x) (x).begin(),(x).end()
#define rp(i,s,e) for(int i=(int)(s);i<(int)(e);++i)
#define irp(i,s,e) for(int i=(int)(s);i>(int)(e);--i)
using PR = pair<int,int>; // <h,w>
using T3 = tuple<int,int,int>; // <h,w,gid>

int main(){
	int H,W; cin>>H>>W;
	int C[2],D[2]; cin>>C[0]>>C[1]>>D[0]>>D[1];
	C[0]--, C[1]--, D[0]--, D[1]--;
	string S[H]; rp(i,0,H) cin>>S[i];

	PR dhw[] = { //<h,w>
		      {1,0},
		{0,-1},     {0,1},
		      {-1,0},
		{2,-2},{2,-1},{2,0},{2,1},{2,2},
		{1,-2},{1,-1},      {1,1},{1,2},
		{0,-2},                   {0,2},
		{-1,-2},{-1,-1},      {-1,1},{-1,2},
		{-2,-2},{-2,-1},{-2,0},{-2,1},{-2,2}
	};

	vvi vis(H, vi(W, -1));
	deque<T3> dq;
	dq.push_back({C[0], C[1], 0});
	while(dq.size()){
		int h, w, gid; tie(h, w, gid) = dq.front(); dq.pop_front();
		// if(0 <= vis[h][w] and vis[h][w] <= gid) continue;
		if(vis[h][w] >= 0) continue;
		// if(vis[h][w] <= gid) continue;
		if(S[h][w] == '#') continue;
		vis[h][w] = gid;
		rp(i, 0, 4){
			int nx_h = h + dhw[i].first;
			int nx_w = w + dhw[i].second;
			if(nx_h < 0 || H <= nx_h) continue;
			if(nx_w < 0 || W <= nx_w) continue;
			dq.push_front({nx_h, nx_w, gid});
		}

		rp(i, 4, 24){
			int nx_h = h + dhw[i].first;
			int nx_w = w + dhw[i].second;
			if(nx_h < 0 || H <= nx_h) continue;
			if(nx_w < 0 || W <= nx_w) continue;
			dq.push_back({nx_h, nx_w, gid+1});
		}

	}

	// rp(h,0,H){
	// 	rp(w,0,W){
	// 		if(vis[h][w] < 0) cout<<"X ";
	// 		else cout<<""<<vis[h][w]<<" ";
	// 	}
	// 	puts("");
	// }
	// puts("---");

	cout<< vis[D[0]][D[1]] <<endl;
}


Measured memory_bytes: 11804
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
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; }
//#define int long long

void solve() {
	int n, k; cin >> n >> k;
    int p[200200];
    rep(i, n) {
        cin >> p[i];
    }
    int renzoku = 0;
    set<int> s;
    rep(i, k) {
        s.insert(p[i]);
        if(i > 0 && p[i] > p[i - 1]) {
            renzoku ++;
        } else {
            renzoku = 0;
        }
    }
    int cnthenkanasi = 0, cntmaetoonazi = 0;
    if(renzoku >= k - 1) {
        cnthenkanasi ++;
    }

    int j = k - 1;
    while(j <= n - 2) {
        j ++;
        if(p[j] > p[j - 1]) {
            renzoku ++;
        } else {
            renzoku = 0;
        }
        bool flag = false;

        if(renzoku >= k - 1) {
            cnthenkanasi ++;
            flag = true;
        }

        s.insert(p[j]);
        if((*s.begin() == p[j - k] && *s.rbegin() == p[j])) {
            if(flag == false) cntmaetoonazi ++;
        }
        s.erase(p[j - k]);
    }

    int ans = n + 1 - k - cntmaetoonazi + (cnthenkanasi == 0 ? 0 : 1 - cnthenkanasi);
    cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}


Measured memory_bytes: 10368
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef long long ll;

int main()
{
	int N,M;
	scanf("%d%d", &N, &M);
	char ac[3] = "AC";
	char wa[3] = "WA";
	int q[M];
	char s[M][3];
	int i = 1;
	while (i <= M)
	{
		scanf("%d", &q[i]);
		scanf("%s", s[i]);
		i++;
	}
	i = 1;
	int log[N+1];
	int pena[N+1];
	while (i <= N)
	{
		pena[i] = 0;
		log[i] = i;
		i++;
	}
	i = 1;
	int cnt = 0;
	int ans = 0;
	int j = 1;
	while(i <= M)
	{
		if (strcmp(s[i], wa) == 0 && log[q[i]] != 0)
		{
			// printf("log[%d] = %d\n",q[i], log[q[i]]);
			pena[q[i]]++;
		}
		else if (strcmp(s[i], ac) == 0 && log[q[i]] != 0)
		{
			ans++;
			log[q[i]] = 0;
			cnt += pena[q[i]];
			// printf("log[%d] = %d\n",q[i], log[q[i]]);
		}
		i++;
	}
	printf("%d %d\n",ans, cnt);
	return (0);
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
    string N;
    int A, B, C, D;
    cin >> N;
    A = N[0] - '0';
    B = N[1] - '0';
    C = N[2] - '0';
    D = N[3] - '0';
    int64_t sum = 0;
    int64_t e = 0;
    int64_t f = 0;
    string ans = "";
    string op1 = "";
    string op2 = "";
    string op3 = "";
    bool canop = false;
    for (int i=0; i < 2; i++) {
        if (i == 0) {
            e = A + B;
            op1 = "+";
        } else {
            e = A - B;
            op1 = "-";
        }
        for (int j=0; j < 2; j++) {
            if (j == 0) {
                f = e + C;
                op2 = "+";
            } else {
                f = e - C;
                op2 = "-";
            }
        for (int k=0; k < 2; k++) {
            if (k == 0) {
                sum = f + D;
                op3 = "+";
            } else {
                sum = f - D;
                op3 = "-";
            }

            if (sum == 7) {
                ans = to_string(A) + op1 + to_string(B) + op2 + to_string(C) + op3 + to_string(D) + "=7";
                canop = true;
            }

            sum = 0;
            if (canop) break;
            }
            if (canop) break;
        }
            if (canop) break;
    }

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

Measured memory_bytes: 3664
K = int(input())
A,B = map(int,input().split())
i = A
chack = 0

for i in range(A,B+1):
    if i % K == 0:
        chack = 1
        break
    i = i + 1

if chack == 1:
    print("OK")
else:
    print("NG")


Measured memory_bytes: 9172
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	int q;
	cin>>q;
	while(q--){
		string s;
		cin>>s;
		bool h=true;
		rep(i,s.size()-1)if(s[i]==s[i+1])h=false;
		if(h)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;	
	}
}

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

int main(){
  int x;
  char s[100];
  int stk[100];
  int stk_ptr = 0;
  int a, b;

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
    	b = stk[--stk_ptr];
    	a = stk[--stk_ptr];
    	stk[stk_ptr++] = a + b;
    } else if ( s[0] == '-' ){
    	b = stk[--stk_ptr];
    	a = stk[--stk_ptr];
    	stk[stk_ptr++] = a - b;
    } else if ( s[0] == '*' ){
    	b = stk[--stk_ptr];
    	a = stk[--stk_ptr];
    	stk[stk_ptr++] = a * b;
    } else {
      x = atoi(s);
      stk[stk_ptr++] = x;
    }
  }
  
  printf("%d\n", stk[0]);

  return 0;
}

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



class Program
{
    const int MOD = 1000000007;
    const int INF = 1 << 30;

    static void Main(string[] args)
    {
        Solve();
    }

    //static long GCD(long x,long y)
    //{
    //    if (y == 0) return x;
    //    return GCD(y, x % y);
    //}

    //static long LCM(long x,long y)
    //{
    //    return x * y / GCD(x, y);
    //}

    //static int keta(int x)
    //{
    //    string s = x.ToString();
    //    return s[s.Length - 1]-'0';
    //}

    static void Solve()
    {
        Scan sc = new Scan();
        write wr = new write();

        int N = sc.intarr[0];
        for(int i = 0; i <= 25; ++i)
        {
            for(int j = 0; j < 20; ++j)
            {
                if (i * 4 + j * 7 == N)
                {
                    wr.wri("Yes");
                    return ;
                    
                }
            }
        }
        wr.wri("No");

    }


}
    




class Scan
{
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
    public char[] chararr => str.ToArray();


}



class write
{
    public void wri<Type>(Type x)
    {
        Console.WriteLine(x);
    }
}


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

using namespace std;

typedef long long ll;

mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

const int inf = 1e9 + 7;
const int mod = 1e9 + 7;

inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
}

inline int mul(int a, int b) {
  return (a * (ll) b) % mod;
}

inline int pw(int x, int n) {
  int res = 1;
  while (n > 0) {
    if (n % 2) {
      res = mul(res, x);
      n--; 
    } else {
      x = mul(x, x);
      n /= 2;
    }
  }
  return res;
}

const int N = 1e5 + 7;

ll dp[N];

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, mx;
  cin >> n >> mx;
  dp[0] = 0;
  for (int i = 1; i < N; i++) {
    dp[i] = inf;
  }
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    for (int j = N - 1; j >= 0; j--) {
      if (j + b < N) {
        dp[j + b] = min(dp[j + b], dp[j] + a);
      }
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (dp[i] <= mx) {
      cout << i << '\n';
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 1024
fn main() {
    let first_line = read_all_and_parse::<usize>();
    let tenbou_cnt = first_line[0];
    let road_cnt = first_line[1];
    let heights = read_all_and_parse::<usize>();
    // roads[a]からたどり着ける道たち
    let mut tenbous = Vec::with_capacity(tenbou_cnt);
    for tenbou_idx in 0..tenbou_cnt {
        tenbous.push(Road {
            highest_idx: tenbou_idx,
            highest_height: heights[tenbou_idx],
        });
    }
    for _ in 0..road_cnt {
        let line = read_all_and_parse::<usize>();
        let from = line[0] - 1;
        let to = line[1] - 1;
        let from_road = tenbous[from];
        if from == from_road.highest_idx {
            let to_height = heights[to];
            if from_road.highest_height <= to_height {
                tenbous[from].highest_idx = to;
                tenbous[from].highest_height = to_height;
            }
        }
        let to_road = tenbous[to];
        if to == to_road.highest_idx {
            let from_height = heights[from];
            if to_road.highest_height <= from_height {
                tenbous[to].highest_idx = from;
                tenbous[to].highest_height = from_height;
            }
        }
    }
    let mut good_cnt = 0;
    for (idx, tenbou) in tenbous.iter().enumerate() {
        if idx == tenbou.highest_idx {
            good_cnt += 1;
        }
    }
    println!("{}", good_cnt);
}
#[derive(Copy, Clone, Debug)]
struct Road {
    highest_idx: usize,
    highest_height: usize,
}
fn read_all_and_parse<T: std::str::FromStr + std::fmt::Debug>() -> Vec<T> {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    let line = line.trim();
    line.split(' ').map(|s| s.parse::<T>().ok().unwrap()).collect()
}

Measured memory_bytes: 4352
#include <stdio.h>

int main(void){
  char S[100];
  scanf("%s",S);

  long long K;
  scanf("%lld",&K);

  for(int i = 0;i < K;i++){
    if(S[i] != '1'){
      printf("%c\n",S[i]);
      return 0;
    }
  }

  printf("1\n");

  return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(){
    int a;
    int b;
    cin >> a >> b;
    if (a > b){
        cout << "a > b" << endl;
    }else if (a < b){
        cout << "a < b" << endl;
    }else{
        cout << "a == b" <<endl;
    }
    return 0;
}


Measured memory_bytes: 3076
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cstdio>
#include<cmath>
#include<map>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
int MOD=1000000007;
struct Node{
    int no;
    int par;
    int sum;
    int top;
    vector<Node*> child;
    void build(int i){
        no=i;par=i;sum=0;top=0;
    }
    vector<int> left,right;
    map<int,int> pos;
};
void dfs(Node& node){
    int n=node.child.size();
    if(n==1&&node.par!=node.no){
        node.sum=1;
        return;
    }
    int sum=1;
    rep(i,n){
        if(node.child[i]->no!=node.par){
            dfs(*node.child[i]);
            sum*=node.child[i]->sum+1;
            sum%=MOD;
        }
        node.left[i+1]=sum;
    }
    node.sum=sum;
    sum=1;
    for(int i=n-1;i>=0;--i){
        if(node.child[i]->no!=node.par){
            //dfs(*node.child[i]);
            sum*=node.child[i]->sum+1;
            sum%=MOD;
        }
        node.right[i+1]=sum;
    }
}
signed main(){
    int n,m;cin>>n>>m;
    MOD=m;
    vector<Node> node(n+1);
    rep1(i,n){
        node[i].build(i);
    }
    rep(i,n-1){
        int x,y;cin>>x>>y;
        node[x].child.push_back(&node[y]);
        node[y].child.push_back(&node[x]);
    }
    queue<Node> que;que.push(node[1]);
    while(!que.empty()){
        Node buf=que.front();que.pop();
        int num=buf.child.size();
        node[buf.no].left.resize(num+5,1);
        node[buf.no].right.resize(num+5,1);
        rep(i,num){
            node[buf.no].pos.emplace(buf.child[i]->no,i+1);
            if(buf.child[i]->no!=buf.par){
                buf.child[i]->par=buf.no;
                que.push(*buf.child[i]);
            }
        }
    }
    dfs(node[1]);
    que.push(node[1]);
    vector<int> res(n+1,0);
    res[1]=node[1].sum;
    node[1].top=res[1];
    //cout<<res[1]<<endl;
    int HHH=res[1];
    while(!que.empty()){
        Node buf=que.front();que.pop();
        int num=buf.child.size();
        int ans=1;
        int hoge=0;//親が黒い場合の数
        hoge+=node[buf.par].right[node[buf.par].pos[buf.no]+1]*node[buf.par].left[node[buf.par].pos[buf.no]-1];
        hoge%=MOD;
        hoge*=node[buf.par].top+1;//親の親が黒い場合の数
        hoge%=MOD;
        node[buf.no].top=hoge;
        hoge+=1;//親が白い場合を追加
        hoge%=MOD;
        rep(i,num){
            if(buf.par!=buf.child[i]->no){
                hoge*=buf.child[i]->sum+1;
                hoge%=MOD;
                que.push(*buf.child[i]);
            }
        }
        res[buf.no]=hoge;
        if(buf.no==1){
            node[buf.no].sum=HHH;
            res[buf.no]=HHH;
            node[1].top=0;
        }
    }
    rep1(i,n){
        cout<<res[i]<<"\n";
    }
    return 0;
}


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

int main(){
    string s;
    cin>>s;
    for(int i=0;i<4;i++){
        cout<<s[i];
    }
    cout<<" ";
    for(int i=4;i<12;i++){
        cout<<s[i];
    }
    cout<<endl;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <memory>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int v, w; };

#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	int H, W; cin >> H >> W;
	vector<string> a(H);
	rep(y, H) cin >> a[y];
	int y = 0, x = 0;
	a[y][x] = '.';
	for (;;)
		if (y + 1 < H && a[y + 1][x] == '#') {
			y++;
			a[y][x] = '.';
		}
		else if (x + 1 < W && a[y][x + 1] == '#') {
			x++;
			a[y][x] = '.';
		}
		else break;
	bool ok = true;
	rep(y, H) rep(x, W)
		if (a[y][x] == '#')
			ok = false;
	cout << (ok ? "Possible" : "Impossible") << endl;
}


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int a = ri();
	int b = ri();
	int c = ri();
	int d = ri();
	printf("%d\n", std::max(0, c * 60 + d - a * 60 - b - ri()));
	return 0;
}


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


Measured memory_bytes: 2100
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
using namespace std;

typedef long long ll;

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; }
const int INF = 1e9;
const long long INFL = 1LL<<60;

int main() {
  int n, k;
  cin >> n >> k;
  int ans = 0;
  rep(i, n) {
    int h;
    cin >> h;
    if (h >= k) ans++;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<typename T >inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }


void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}

void solve() {
  int a, b;
  cin >> a >> b;
  if (a >= 13) cout << b << endl;
  else if (a > 5) cout << b / 2 << endl;
  else cout << 0 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;


vector<int>  dx = {1,-1,0,0};
vector<int>  dy = {0,0,1,-1};


int main() {
	
	int N; cin >> N;
	vector<pair<string, int>> v;
	for (int i = 0; i < N; i++) {
		string s; cin >> s;
		v.push_back(make_pair(s,-1));
	}

	int M; cin >> M;
	int state = -1;
	for (int i = 0; i < M; i++) {
		string s; cin >> s;
		for (int j = 0; j < v.size(); j++) {
			if (v[j].first == s) {
				state *= -1;
				if (state == 1) {
					cout << "Opened by " << s << endl;
				}else {
					cout << "Closed by " << s << endl;
				}
				break;
			}else if (v[j].first != s and j == v.size() - 1) {
				cout << "Unknown " << s << endl;	
			}
		}
	}

	return 0;
}



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

int main(){
  int N100,N10,N1;
  cin >> N100 >> N10 >> N1;
  const int N= N100*100+ N10*10+ N1;

  string ans= (N%4==0) ? "YES" : "NO";

  cout << ans << endl;
}

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

int main(){
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  rep(i, N-2){
    string T;
    rep(j, 3) T += S[i+j];
    if (T == "ABC") ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <numeric>
#include <cmath>
#include <map>
#include <set>
#define ull unsigned long long
#define ll long long
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> a;
    int n;
    cin >> n;
    int k;
    for(int i=0;i<n;i++){
        cin >> k;
        a.push_back(k);
    }
    sort(a.begin(),a.end(),greater<int>());
    a[0]/=2;
    cout << accumulate(a.begin(),a.end(),0) << endl;


    return 0;
}

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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;

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

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

    // 素数である
    return true;
}

int sum_of_two(ll a){
    int ans(0);
    while(1){
        if(a%2==0){
            ans++;
            a /= 2;
        }else{
            return ans;
        }
    }
}

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

    int ans(0);
    rep(i,n){
        ll a;   cin >> a;
        if(a%2==0){
            ans += sum_of_two(a);
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
#include <stack>
#include <iomanip>
#include <limits>
using namespace std;
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
using Graph=vector<vector<int>>;
using edge= struct{int to;ll cost;};
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
typedef priority_queue<ll> PQ_HIGH;
typedef priority_queue<ll,VL,greater<ll>> PQ_LOW;//昇順

int main(){
  ll n,m;cin>>n>>m;
  vector<vector<ll>> data(n,vector<ll>(0));
  REP(i,m){
    ll a,b;cin>>a>>b;
    a--,b--;
    data[a].push_back(b);
    data[b].push_back(a);
  }
  ll rest=0;
  VL cou(n,0);
  VL ans(n,0);
  queue<ll> tmp;
  cou[0]=1;
  tmp.push(0);
  while(!tmp.empty()){
    ll now=tmp.front();
    tmp.pop();
    for(auto e:data[now]){
      if(cou[e]==0){
        tmp.push(e);
        cou[e]=1;
        ans[e]=now;
        rest++;
      }else{
        continue;
      }
    }
  }
  if(rest!=n-1){
    cout<<"No"<<endl;
    return 0;
  }
  cout<<"Yes"<<endl;
  for(int i=1;i<n;i++){
    cout<<ans[i]+1<<endl;
  }
}

Measured memory_bytes: 13372
def select_sort(n, a):
  count = 0
  for i in range(n):
    minj = i
    for j in range(i, n):
      if a[j] < a[minj]:
        minj = j
    if i != minj:
      a[i], a[minj] = a[minj], a[i]
      count += 1
  print(*a)
  print(count)

select_sort(int(input()), [int(i) for i in input().split()])



Measured memory_bytes: 5616
#include<stdio.h>

int main()
{
int i,r,d,x,s[10];

scanf("%d%d%d",&r,&d,&x);

for(i=9;i>=0;i--){
    s[i]=r*x-d;
    x=s[i];
    printf("%d\n",s[i]);
    }

return 0;
}


Measured memory_bytes: 1692
n = int(input())
x = list(map(int, input().split()))
ans = 0
ans1 = 0

p = sum(x)//n
pa = p + 1

for i in range(n):
    ans += x[i]**2

ans1 = ans + n*(pa**2)
ans1 -= 2*pa*sum(x)

ans += n*(p**2)
ans -= 2*p*sum(x)

print(min(ans, ans1))

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

int main() {
  long n;
  string ans="No";
  cin >> n;
  for(long i=0;i<100;i++) {
    for(long j=0;j<100;j++) {
      if(i*4+j*7==n) ans="Yes";
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define n_p(v) next_permutation(v.begin(),v.end())
#define print(a) cout<<(a)<<endl;
#define to_ll(b) stoll(b)
#define MOD 1000000007

int main(){
	int N; cin>>N;
	set<int> s;
	int cnt=0;
	rep(i,0,N){
		int a; cin>>a;
		if(a<=399) s.insert(1);
		else if(a<=799) s.insert(2);
		else if(a<=1199) s.insert(3);
		else if(a<=1599) s.insert(4);
		else if(a<=1999) s.insert(5);
		else if(a<=2399) s.insert(6);
		else if(a<=2799) s.insert(7);
		else if(a<=3199) s.insert(8);
		else cnt++;
	}
	//cout<<cnt<<endl;
	if(s.size()==0) cout<<1<<" ";
	else cout<<s.size()<<" ";
	int k=1;
	while(1){
		if(cnt==0) break;
		if(!s.count(k)){
			s.insert(k);
			cnt--;
		}
		k++;
	}
	cout<<s.size();
}

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

int main(){
    int N,L;
    cin >> N >> L;
    vector<string> vec(N);
    rep(i,N){
        cin >> vec[i];
    }
    sort(all(vec));
    rep(i,N){
        cout << vec[i];
    }
    cout << endl;
}


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

int main() {
	long n, x, y,mem;
	int counter = 0;
	cin >> n >> x >> y;
	vector<long> kyori(n,0);
	for (long i = 1; i < n; i++) {
		for (long j = i + 1; j < n + 1; j++) {
				mem = min(labs(x - i) + 1 + labs(j - y),j-i);
				kyori[mem]++;
		}
	}
	for (int i = 0; i < n - 1; i++) {
		cout << kyori[i + 1] << endl;
	}
}

Measured memory_bytes: 256
def binarySearch(array, n, key)
  left  = 0
  right = n
  while left < right
    mid = ((left + right) / 2).floor
    return true if key == array[mid]

    if key > array[mid]
      left = mid + 1
    else
      right = mid
    end
  end
end


n = gets.chop.to_i
s_ary = gets.chop.split.map(&:to_i)
q = gets.chop.to_i
t_ary = gets.chop.split.map(&:to_i)

sum = 0
q.times do |i|
  sum += 1 if binarySearch(s_ary, n, t_ary[i])
end


puts sum



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

int main() {
  std::vector<int> A1;
  std::vector<int> A2;
  int N;
  std::cin >> N;

  A1.resize(N);
  A2.resize(N);
  for (int i = 0; i < N; i++) std::cin >> A1[i];
  for (int i = 0; i < N; i++) std::cin >> A2[i];

  int sum1 = 0, sum2 = 0;
  for (int i = 0; i < N; i++) sum2 += A2[i];

  int max = 0;
  for (int i = 0; i < N; i++) {
    sum1 += A1[i];
    max = std::max(max, sum1 + sum2);
    sum2 -= A2[i];
  }

  std::cout << max;

  return 0;
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  a,b,c,x,y=LI()
  return min(max(x,y)*c*2,a*x+b*y,max(0,x-y)*a+y*c*2,max(0,y-x)*b+x*c*2)

# main()
print(main())


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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int k;
  cin >> k;
  for (int n = 0; n <= k; n++) {
    for (int i = 0; i <= n; i++) {
      for (int j = 0; j <= n - i; j++) {
        for (int l = 0; l <= n - i - j; l++) {
          if (pow(2, i) * a < pow(2, j) * b && pow(2, j) * b < pow(2, l) * c) {
            cout << "Yes" << endl;
            return 0;
          }
        }
      }
    }
  }

  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3944
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef long long int ll;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define F first
#define S second
using namespace std;
const ll INF = 10000000000000;

int main() {
  int n,d;
  cin>>n>>d;
  double z[11][11];
  int ans=0;
  rep(i,0,n)rep(j,0,d)cin>>z[i][j];
  rep(i,0,n)rep(j,i+1,n){
    double dis=0;
    rep(k,0,d)dis+=pow((z[i][k]-z[j][k]),2.0);
    if(int(pow(dis,0.5))==pow(dis,0.5))ans++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    for (int h = 0; h < H; ++h) cin >> S[h];
    vector<vector<int>> YSum(H, vector<int>(W+1)), TSum(W, vector<int>(H+1));
    for (int h = 0; h < H; ++h) {
        for (int w = 0; w < W; ++w) {
            YSum[h][w+1] = YSum[h][w] + (S[h][w] == '#');
        }
    }
    for (int w = 0; w < W; ++w) {
        for (int h = 0; h < H; ++h) {
            TSum[w][h+1] = TSum[w][h] + (S[h][w] == '#');
        }
    }
    int Res = 0;
    for (int h = 0; h < H; ++h) {
        for (int w = 0; w < W; ++w) {
            if (S[h][w] == '#') continue;
            int Tmp = (upper_bound(YSum[h].begin(), YSum[h].end(), YSum[h][w])
            - lower_bound(YSum[h].begin(), YSum[h].end(), YSum[h][w])) - 1;
            Tmp += (upper_bound(TSum[w].begin(), TSum[w].end(), TSum[w][h])
            - lower_bound(TSum[w].begin(), TSum[w].end(), TSum[w][h])) - 1;
            Tmp -= 1;
            if (Tmp > Res) Res = Tmp;
        }
    }
    cout << Res << endl;

    return 0;
}


Measured memory_bytes: 35968
N = int(input())
A = list(map(int, input().split()))
maxim = max(A)
counter = [0]*(maxim+1)
dif = [-1, 0, 1]
for a in A:
    for d in dif:
        i = a + d
        if i < 0 or maxim < i:
            continue
        else:
            counter[i] += 1
print(max(counter))

Measured memory_bytes: 14008
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
#define PI 3.14159265358979323846
using namespace std;
//
int main(){
  string SS,T;
  cin>>SS>>T;
  int SSL=SS.size(),TL=T.size();
  for(int i=SSL-TL;i>=0;i--){
    int j=i,k=0;
    string S=SS;
    while(S[j]==T[k]||S[j]=='?'){
      S[j]=T[k];
      j++;
      k++;
      if(k==TL){
        FOR(l,0,SSL){
          if(S[l]=='?'){
            S[l]='a';
          }
        }
        cout<<S<<endl;
        return 0;
      }
    }
  }
  cout<<"UNRESTORABLE"<<endl;
  return 0;
}


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

class Program
{
    static void Main(string[] args)
    {

        string[] input = Console.ReadLine().Split(' ');
        int N = int.Parse(input[0]);
        int A = int.Parse(input[1]);
        int B = int.Parse(input[2]);
        Console.WriteLine(Math.Min(N * A, B));

        Console.ReadKey();
    }

}


Measured memory_bytes: 13140
using System.Collections.Generic;
using System.Linq;

public class Hello
{
    public static void Main()
    {
        hoge();
        System.Console.ReadLine();
    }

    public static void hoge()
    {
        var line = System.Console.ReadLine();

        for(int i = 0; i < line.Count(); i++)
        {
            System.Console.Write("x");
        }
        System.Console.WriteLine("");
    }


}



Measured memory_bytes: 11220
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		int ans, at, bt,bb;
		ans = 0;
	for(int i=a;i<=b;i++){
		at=i/1000;
		bt=i-(i/100)*100;
		bb=bt;
		bt=bt/10;
		bb=bb-bt*10;
		bt=bb*10+bt;
		if(at==bt){
			ans++;
			}
	}
System.out.println(ans);
	}}

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

int main() {
	int a, b, c, x, y;
	int i, ans = 1000000000, temp, max;

	cin >> a >> b >> c >> x >> y;

	if (x > y)	max = x;
	else max = y;

	int nx, ny;
	for (i = 0; i <= max; i++) {
		nx = x - i;	ny = y - i;
		if (nx < 0)	nx = 0;
		if (ny < 0)	ny = 0;
		temp = a * nx + b * ny + c * 2 * i;
		if (ans > temp)	ans = temp;
	}

	cout << ans << endl;

	return 0;
}

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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

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

  ll sum = 0;
  vector<ll> ans;
  for (ll i = 1; i <= n; ++i) {
    sum += i;
    ans.push_back(i);
    if (sum >= n) break;
  }

  ll ex = sum - n;
  map<ll, bool> excl;
  for (ll i = 1; i <= ex; ++i) {
    ex -= i;
    if (ex == 0) {
      excl[i] = true;
      break;
    } else if (ex <= i) {
      ex += i;
      excl[ex] = true;
      break;
    }
    excl[i] = true;
  }

  each (i, ans) {
    if (excl.count(i)) continue;
    cout << i << endl;
  }

  return 0;
}


Measured memory_bytes: 384
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        var nab = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var N = nab[0];
        var A = nab[1];
        var B = nab[2];

        var train = N * A;

        Console.WriteLine(train<B?train:B);
    }
}


Measured memory_bytes: 13268
// clang-format off
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl;
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;}
const int INF = 1e9;
const ll LINF = 1e18;
// clang-format on

void solve(long long A, long long B) { ANS(6 - A - B); }

int main() {
  long long A;
  scanf("%lld", &A);
  long long B;
  scanf("%lld", &B);
  solve(A, B);
  return 0;
}


Measured memory_bytes: 256