akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
// #include<assert.h>
#include<random>
using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }



void solve(void)
{ 
  int N;cin>>N;
  int res = 0;
  int prev = 0;
  for (int i = 1; i <= N; i++)
  {
    int C = N - (i-1);
    res += i*C;
  }
  for (int i = 0; i < N-1; i++)
  {
    int X,Y;cin>>X>>Y;
    if(X > Y)swap(X,Y);
    int L = X -1;
    int R = N - Y;
    L++;R++;
    res -=L*R;
  }
  
  cout<<res<<endl;
  
  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 3568
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <map>
const int N = 405;
typedef long long ll; 
using namespace std;

int n, c[N][4], pos[4], u[4], d[4], cnt, sum[N * N], nxt[N * N]; 
struct nd
{
	int u, r, d, l;
	nd(int a = 0, int b = 0, int c = 0, int e = 0) { u = a, r = b, d = c, l = e; }
	bool operator < (const nd &p) const
		{
			return u == p.u ? (r == p.r ? (d == p.d ? l < p.l : d < p.d) : (r < p.r)) : (u < p.u) ;
		}
}; 
map<nd, int> mp; 
ll ans; 

template < typename T >
inline T read()
{
	T x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * w; 
}

int main()
{
#ifndef ONLINE_JUDGE
	freopen("cpp.in", "r", stdin); //, freopen("cpp.out", "w", stdout); 
#endif
	n = read <int> ();
	for(int i = 1; i <= n; i++)
	{
		c[i][0] = read <int> (), c[i][1] = read <int> (), c[i][2] = read <int> (), c[i][3] = read <int> (); 
		for(int n1, n2, n3, n4, j = 0; j < 4; j++)
		{
			n1 = c[i][j], n2 = c[i][(j + 1) % 4], n3 = c[i][(j + 2) % 4], n4 = c[i][(j + 3) % 4]; 
			if(mp.find(nd(n1, n2, n3, n4)) == mp.end()) mp[nd(n1, n2, n3, n4)] = ++cnt; 
			sum[pos[j] = mp[nd(n1, n2, n3, n4)]]++; 
		}
		for(int j = 0; j < 4; j++) nxt[pos[j]] = pos[(j + 1) % 4]; 
	}
	ll res; 
	for(int x, i = 1; i <= n; i++)
		for(int j = 1; j <= n; j++)
		{
			x = mp.find(nd(c[i][0], c[i][1], c[i][2], c[i][3])) != mp.end() ? mp[nd(c[i][0], c[i][1], c[i][2], c[i][3])] : 0; 
			for(int k = 0; k < 4; k++) sum[x]--, x = nxt[x]; 
			x = mp.find(nd(c[j][0], c[j][1], c[j][2], c[j][3])) != mp.end() ? mp[nd(c[j][0], c[j][1], c[j][2], c[j][3])] : 0; 
			for(int k = 0; k < 4; k++) sum[x]--, x = nxt[x]; 
			if(i != j)
				for(int k = 0; k < 4; k++)
				{
					res = 1; 
					for(int l = 0; l < 4; l++) u[l] = c[i][l], d[l] = c[j][(4 - l + k) % 4]; 
					for(int t, x, s = 0; s < 4; s++)
					{
						t = (s + 3) % 4; x = (mp.find(nd(u[s], u[t], d[t], d[s])) != mp.end() ? mp[nd(u[s], u[t], d[t], d[s])] : 0); 
						res = res * (sum[x] >= 0 ? sum[x] : 0); 
						for(int l = 0; l < 4; l++) sum[x]--, x = nxt[x]; 
					}
					ans = ans + res; 
					for(int x, t, s = 0; s < 4; s++)
					{
						t = (s + 3) % 4; x = mp.find(nd(u[s], u[t], d[t], d[s])) != mp.end() ? mp[nd(u[s], u[t], d[t], d[s])] : 0; 
						for(int l = 0; l < 4; l++) sum[x]++, x = nxt[x]; 
					}
				}
			x = mp.find(nd(c[i][0], c[i][1], c[i][2], c[i][3])) != mp.end() ? mp[nd(c[i][0], c[i][1], c[i][2], c[i][3])] : 0; 
			for(int k = 0; k < 4; k++) sum[x]++, x = nxt[x]; 
			x = mp.find(nd(c[j][0], c[j][1], c[j][2], c[j][3])) != mp.end() ? mp[nd(c[j][0], c[j][1], c[j][2], c[j][3])] : 0; 
			for(int k = 0; k < 4; k++) sum[x]++, x = nxt[x];
		}
	printf("%lld\n", ans / 6); 
	return 0; 
}


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

#define rep(i, n)    for(ll i = 0; i < (n); ++i)
#define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
#define repD(i, a, n)  for(ll i = a; i >= (n); --i)
#define pb push_back
#define X first
#define Y second

typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vii;
const ll INF = 1e18+1;
const ll MOD = 1000000007L;

#ifdef umang99m
    #include "/home/umang/.templates/header.h"
#else
    #define dbg(args...)
    #define timer()
#endif

ll f(ll mask,ll k, vector<vi> &a){
    ll h=a.size();
    ll w = a[0].size();
    vi v;
    v.pb(0);
    rep(i,h-1){
        if((1<<i) & mask){
            v.pb(i+1);
        }
    }
    v.pb(h);
    ll segs = v.size()-1;

    ll cuts = 0;
    vi prev(segs,0), cur(segs);

    rep(j,w){
        bool newcut = false;
        rep(s,segs){
            cur[s]=0;
            repA(i,v[s],v[s+1]-1){
                cur[s] += a[i][j];
            }
            if(prev[s] + cur[s] > k){
                newcut = true;
            }
            if(cur[s] > k) return INF;
        }
        if(newcut){
            cuts++;
            rep(s,segs)    prev[s] = cur[s];
        } else {
            rep(s,segs){
                prev[s] += cur[s];
            }
        }
    }
    return cuts + segs-1;
}

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

    ll h,w,k;
    cin>>h>>w>>k;
    vector<vi>a(h, vi(w,0));

    rep(i,h){
        string s;
        cin>>s;
        rep(j,w){
            a[i][j] = s[j] - '0';
        }
    }

    ll ans = INF;

    ll maxmask = (1<<(h-1));
    for(unsigned int mask =  0; mask < maxmask ; mask++){
        ans = min(ans,  f(mask,k, a));
    }
    cout<<ans<<endl;

    timer();
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repi(i,x,n) for(ll i=x;i<(ll)(n);i++)
#define lb lower_bound
#define ub upper_bound
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 +99);
vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};

long long modpow(long long a, long long n, long long MOD) {//a^n(MOD)を求める
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;//次の準備
        n >>= 1;
    }
    return res;
}

ll dp[45][150000]={};

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

    ll n,x,y,z,ans;cin>>n>>x>>y>>z;
    ans=modpow(10,n,mod);

    dp[0][0]=1;

    ll flag=modpow(2,x-1,mod),nind;
    flag<<=y;
    flag+=modpow(2,y-1,mod);
    flag<<=z;
    flag+=modpow(2,z-1,mod);

    rep(i,n){
        rep(j,(1<<17)){
            repi(k,1,11){
                nind=(j<<k);
                nind+=1<<(k-1);
                nind%=(1<<17);

                if((nind&flag)!=flag){
                    (dp[i+1][nind]+=dp[i][j])%=mod;
                }
            }
        }
    }

    rep(j,(1<<17)){
        ans+=mod-dp[n][j];
        ans%=mod;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 48256
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

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


N,M =  input_multiple_number()

listH  = input_multiple_number_as_list()

isGood = [True]*N
for i in range(M):
	A,B = input_multiple_number()

	if listH[A-1] > listH[B-1]:
		isGood[B-1] = False
	elif listH[A-1] < listH[B-1]:
		isGood[A-1] = False
	else:
		isGood[B-1] = False
		isGood[A-1] = False

cnt = 0
for i in isGood:
	if i == True:
		cnt += 1

										
print(cnt)




Measured memory_bytes: 19996
#include <iostream>
#include <string>

using namespace std;


int main()
{
	int A, B;
	string op;

	cin >> A >> op >> B;

	if (op == "+") {
		cout << A + B << endl;
	}
	else if (op == "-") {
		cout << A - B << endl;
	}
	

	return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <vector>
#include <string>

using namespace std;
int main(void) {

	int n, a, b;
	cin >> n >> a >> b;

	if (n * a < b) {
		cout << n*a << endl;
	}

	

	else {
		cout << b << endl;


	}
}

Measured memory_bytes: 3192
//! ----------------------------------------------
//! Framework <https://github.com/vain0x/procon>
//!
//! See the bottom of file for solution.
//! ----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    #[allow(deprecated)]
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let N = read!(usize);
    let S = rl().chars().collect::<Vec<_>>();

    let mut acc = vec![0; N + 1];
    let mut count = 0_usize;

    for &(r, g, b) in &[
        ('R', 'G', 'B'),
        ('R', 'B', 'G'),
        ('G', 'R', 'B'),
        ('G', 'B', 'R'),
        ('B', 'R', 'G'),
        ('B', 'G', 'R'),
    ] {
        acc[N] = 0;
        for i in (0..N).rev() {
            acc[i] = acc[i + 1] + if S[i] == b { 1 } else { 0 };
        }

        for ri in 0..N {
            if S[ri] != r {
                continue;
            }

            for gi in ri + 1..N {
                if S[gi] != g {
                    continue;
                }

                count += acc[gi + 1];

                let bi = gi * 2 - ri;
                if bi < N && S[bi] == b {
                    count -= 1;
                }
            }
        }
    }

    println!("{}", count)
}


Measured memory_bytes: 2176
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <algorithm>
#include <cmath>
#include <iomanip>
 
 
int main()
{
    std::ios::sync_with_stdio(false);
    int n, m; std::cin >> n >> m;
    int wa[n] = {0};
    int ans = 0;
    bool ac[n] = {false};
    for(int i=0; i<m; i++)
    {
        int p; std::string s;
        std::cin >> p >> s;
        if(s=="WA") wa[p-1]++;
        if(s=="AC" && !ac[p-1])
        {
            ac[p-1] = true;
            ans += wa[p-1];
        }
    }
    int acs = 0;
    for(int i=0; i<n; i++)
    {
        acs += ac[i];
    }
    std::cout << acs << " " << ans << std::endl;
    return 0;
}

Measured memory_bytes: 768
#[allow(unused_macros)]
macro_rules! input {
    ( $($t:ty),* ) => {{
        let mut s = String::new();
        std::io::stdin().read_line(&mut s);
        let mut splits = s.trim().split_whitespace();
        ($( { splits.next().unwrap().parse::<$t>().unwrap() },)*)
    }}
}

#[allow(unused_macros)]
macro_rules! invec {
    ( $ t : ty ) => {{
        let mut s = String::new();
        match std::io::stdin().read_line(&mut s) {
            Ok(0) => Vec::<$t>::new(),
            Ok(n) => s
                .trim()
                .split_whitespace()
                .map(|s| s.parse::<$t>().unwrap())
                .collect::<Vec<$t>>(),
            Err(_) => Vec::<$t>::new(),
        }
    }};
}


fn divisors(n: u64) -> Vec<u64> {
    let mut res = vec![];
    for i in (1..(((n as f64).sqrt().floor() as u64) + 1)).rev() {
        if n % i == 0 {
            res.insert(0, i);
            if i != n / i {
                res.push(n / i);
            }
        }
    }
    return res;
}

#[allow(unused_must_use)]
#[allow(unused_variables)]
fn solve() {
    let (n, ) = input!(usize);
    let a = invec!(u32);
    let mut counters = vec![0; n];
    let mut ans = vec![0; n];
    let mut count = 0;
    
    for i in (0..n).rev() {
        if counters[i] % 2 != a[i] {
            ans[i] = 1;
            count += 1;
        }

        if ans[i] == 1 {
            let divisors = divisors((i + 1) as u64);
            for d in divisors {
                counters[(d - 1) as usize] += 1;
            }
        }

    }

    println!("{}", count);
    if count == 0 {
        return;
    }

    let mut flag = false;
    for i in 0..n {
        if ans[i] == 1 {
            if flag {
                print!(" ");
            }
            print!("{}", i + 1);
            flag = true;
        }
    }
    println!("");
}

fn main() {
    solve();
}


Measured memory_bytes: 7164
import numpy as np
n=123456
q = int(input())
 
is_prime = np.ones(n+1,dtype=int)
is_prime[0]=0
is_prime[1]=0
 
for i in range(2,n+1):
    if(is_prime[i]==1):
        j=i+i
        while j <= n:
            is_prime[j] = 0
            j += i
 
cnt = [is_prime[x]*is_prime[(x+1)//2] for x in range(0,n+1)]
 
for i in range(1,n+1):
    cnt[i]+=cnt[i-1]
 
for i in range(q):
    l,r = map(int, input().split())
    print(cnt[r]-cnt[l-1])

Measured memory_bytes: 18528
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdlib>
#include <cmath>

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i);
  }
  int x=1;
  vector<bool> done(N,false);
  done.at(x-1)==true;
  for(int count=1;;count++){
    x=a.at(x-1);
    if(x==2){
      cout << count << endl;
      return 0;
    }
    if(done.at(x-1)){
      cout << -1 << endl;
      return 0;
    }
    done.at(x-1)=true;
  }

  return 0;
}


Measured memory_bytes: 640
#[allow(unused)]
use std::io::{stdin, stdout, Write};    
#[allow(unused)]
macro_rules! read {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty), *) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            read!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
}

fn main() {
    let k = read![i32];
    if k % 2 == 0 || k % 5 == 0 {
        println!("{}", -1);
        return;
    }
    let mut rest: i32 = 7;
    let mut i = 1;
    loop {
        rest %= k;
        if rest == 0 {
            println!("{}", i);
            return;
        }
        rest *= 10;
        rest += 7;
        i += 1;
    }
}

Measured memory_bytes: 2176
def finder(antena,k):
    A = antena[0]
    notAs = antena[1:]
    for notA in notAs:
        if (notA-A)>k:
            return print(':(')
        
        elif len(notAs)==2:
            return print('Yay!')
    return finder(notAs,k)

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())

antena = [a,b,c,d,e]

finder(antena,k)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
using namespace std;
typedef long long ll;

int main(){
    int n;cin>>n;
    string s;cin>>s;
    sort(s.begin(),s.end());
    int x=upper_bound(s.begin(),s.end(),'B')-s.begin();
    if(n-x>x)cout<<"Yes";
    else cout<<"No";
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<vector>
#include<list>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<climits>
#include<ctime>
#include<cstring>
#define REP(i,p,n) for(int i=p;i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))
#define all(c) (c).begin(), (c).end()

using namespace std;

int main() {
	int N,M;
	while(cin >> N >> M && N && M) {
		int num;
		int sum_taro=0,sum_hana=0;
		vector<int> taro,hana;

		rep(i,N) {
			cin >> num;	
			sum_taro += num;
			taro.push_back(num);
		}
		rep(i,M) {
			cin >> num;	
			sum_hana += num;
			hana.push_back(num);
		}
		
		bool is_yes=false;
		vector<int> ok_taros,ok_hanas,ok_sums;
		rep(i,N) { //taro
			rep(j,M) { //hana
				int sum_taro_tmp = sum_taro - taro[i] + hana[j];
				int sum_hana_tmp = sum_hana - hana[j] + taro[i];
				if (sum_taro_tmp == sum_hana_tmp) { 
					is_yes = true; 
					ok_taros.push_back(taro[i]);
					ok_hanas.push_back(hana[j]);
					ok_sums.push_back(taro[i]+hana[j]);
				}
			}
		}
		if (is_yes) { 
			int tmp_i;
			int mini=INT_MAX;
			rep(i,ok_sums.size()) {
				if (ok_sums[i] <= mini) {
					mini = ok_sums[i];
					tmp_i = i;
				}
			}
			cout << ok_taros[tmp_i] << " " << ok_hanas[tmp_i] << endl;
		}
		else { cout << "-1" << endl; }
	}

	return 0;
}

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

int main(){
    int n,m;
    cin >> n;
    vector<int> a(n);
    map<int,int> ans;
    rep(i,n){
        cin >> a[i];
        ans[i+1] = 0;
    }
    rep(i,n){
        ans[a[i]] += 1;
    }
    rep(i,n){
        cout << ans[i+1] << endl;
    }
}

Measured memory_bytes: 13564
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        Scanner scanner = new Scanner(System.in);

        int a = Integer.parseInt(scanner.next());
        int b = Integer.parseInt(scanner.next());

        out.print(a*b);

        out.close();
    }
}

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

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


Measured memory_bytes: 3996
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(int i=(int)(st),i##end=(int)(ed);i<=i##end;++i)
#define DREP(i,st,ed) for(int i=(int)(st),i##end=(int)(ed);i>=i##end;--i)
template<typename T>bool chkmin(T &x,const T &y){return x>y?x=y,1:0;}
template<typename T>bool chkmax(T &x,const T &y){return x<y?x=y,1:0;}
#ifdef __linux__
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#endif
template<typename T>T read(){
	T x=0,f=1;
	char c=getchar();
	while((c<'0')||(c>'9')){if(c=='-')f=-1;c=getchar();}
	while((c>='0')&&(c<='9'))x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x*f;
}
#define read() read<int>()
template<typename T>void write(T x,char c){
	static char t[25];
	static int tlen;
	t[tlen=1]=c;
	if(x<0)putchar('-'),x=-x;
	do t[++tlen]=(x%10)^48;
	while(x/=10);
	while(tlen)putchar(t[tlen--]);
}
const int maxn=100005;
int n,a[maxn],c[maxn],tot;
char s[maxn];
int main(){
	scanf("%s",s);
	n=strlen(s);
	a[0]=s[0]^48,s[n]=48;
	REP(i,1,n)a[i]=s[i]^s[i-1];
	REP(i,0,n)if(a[i]==1)c[++tot]=i;
	int ans=n;
	REP(i,1,tot)
		chkmin(ans,max(n-c[i],c[i]));
	write(ans,'\n');
	return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string s;
  cin >> s;
  
  int ans = s.size();
  for(int i = 1; i < s.size(); i++){
    if(s.at(i - 1) != s.at(i)){
      ans = min(ans, max(i, (int) s.size() - i));
    }
  }
  
  cout << ans << '\n';
}

Measured memory_bytes: 512
a, b, k = map(int, input().split())
li = []

for i in range(1, 101):
	x = a / i
	y = b / i
	if x.is_integer() == True and y.is_integer() == True:
		li.append(i)

sort_li = sorted(li, reverse=True)
print(sort_li[k-1])

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

int main() {
    int A, B, C; cin >> A >> B >> C;
    int K; cin >> K;
    while (K--) {
        if (A >= B) {
            B *= 2;
        } else if (B >= C) {
            C *= 2;
        }
    }
    if (A < B && B < C) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3592
"""
https://atcoder.jp/contests/abc137/tasks/abc137_b
"""

import numpy as np


def calc(K: int, X: int) -> np.ndarray:
    _min_num = -1000000
    _stop_num = 1000000 + 1
    min_ = max(_min_num, X - (K - 1))
    stop = min(_stop_num, X + K)
    return np.array(range(min_, stop))


def load_input_as_int_array() -> np.ndarray:
    return np.array([int(v) for v in input().split(" ")])


def main() -> None:
    K, X = load_input_as_int_array()
    result = calc(K, X)
    print(" ".join([str(v) for v in result]))


main()


Measured memory_bytes: 21568
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
using namespace std;

const int INF = 2e9;

int n;
int X[100], Y[100], H[100];

int sub(int x, int y) {
  set<int> st;
  int lim = INF;
  for (int i = 0; i < n; ++i) {
    int diff = abs(X[i] - x) + abs(Y[i] - y);
    if (H[i] == 0) {
      lim = min(lim, diff);
      continue;
    }
    
    st.insert(H[i] + diff);
  }
  
  int ans = *st.begin();
  if (st.size() == 1 && ans <= lim) return ans;
  return -1;
}

int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> X[i] >> Y[i] >> H[i];
  }
  
  for (int i = 0; i <= 100; ++i) {
    for (int j = 0; j <= 100; ++j) {
      int ans = sub(i, j);
      if (ans > 0) {
        cout << i << ' ' << j << ' ' << ans << endl;
      }
    }
  }
}


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

int N;
long long A[100005];
long long st[20][100005];

void build(){
	int h = floor(log2(N));

	for(int j = 0; j<N; j++) st[0][j] = A[j]; //array itself
	for(int i = 1; i<=h; i++)
	for(int j = 0; j+(1<<i)<=N; j++)
		st[i][j] = __gcd(st[i-1][j], st[i-1][j+(1<<(i-1))]);
}

long long rangemin(int l, int r){ // [l, r) // r is not inclusive
	if (l>=r) return 0;
	int k = 31-__builtin_clz(r-l); // clz = “count leading zeros”
	return __gcd(st[k][l], st[k][r-(1<<k)]);
}


int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	build();
	long long ans = rangemin(1, N);
	for (int i = 1; i < N; i++) {
		ans = max(__gcd(rangemin(0, i), rangemin(i+1, N)), ans);
	}
	cout << ans;
}


Measured memory_bytes: 16640
#include <bits/stdc++.h>
#include <unistd.h>
#include <cctype>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 1 << 30
#define LLINF LLONG_MAX/3
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
using ll = long long;
using Pll = pair<ll,ll>;
using Pii = pair<int,int>;
using Pdd = pair<double,double>;
using dcomplex = complex<double>;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
ll gcd(ll a,ll b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll fact(ll a){ll b=1;FOR(i,1,a)b*=i;return b;}
ll power(ll x,ll n){ll a=1;REP(i,n)a*=x;return a;}
double inf() {return std::numeric_limits<double>::infinity();}

double comb(ll p, ll q) {
  ll ans = 1;
  for(ll i = 0; i < q; i++) {
    ans *= (p-i);
    ans /= (i+1);
  }
  return ans;
}

int N;
int A,B;

int main() {
  cin >> N >> A >> B;
  map<ll,ll> p,q;
  vector<ll> v(N);
  REP(i,N) {
    cin >> v[i];
    p[v[i]]++;
  }
  sort(v.begin(),v.end(),greater<ll>());
  vector<pair<ll,map<ll,ll>>> rec(N+1);
  rec[0].first = 0;
  rec[0].second = q;
  for(int i = 1; i <= B; i++) {
    rec[i].first = rec[i-1].first + v[i-1];
    rec[i].second = rec[i-1].second;
    rec[i].second[v[i-1]]++;
  }
  pair<ll,ll> m = make_pair(rec[A].first,A);
  for(int i = A+1; i <= B; i++) {
    if(m.first*i < rec[i].first*m.second) {
      m = make_pair(rec[i].first,i);
    }
  }
  printf("%.8lf\n",(double)m.first/m.second);
  ll cnt = 0;
  for(int i = A; i <= B; i++) {
    if(m.first*i == rec[i].first*m.second) {
      ll c = 1;
      for(auto val : rec[i].second) {
        // cerr << val.first << " " << val.second << endl;
        c *= comb(p[val.first],val.second);
      }
      cnt += c;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 384
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        if(a <= 0 && b >= 0) {
            System.out.println("Zero");
        } else if(a > 0) {
            System.out.println("Positive");
        } else if(b < 0) {
            if((b - a) % 2 == 1) {
                System.out.println("Positive");
            } else {
                System.out.println("Negative");
            }
        } else {
            if(a % 2 == 1) {
                System.out.println("Negative");
            } else {
                System.out.println("Positive");
            }
        }
    }
}

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

struct dice{
    int d[6];
    void rotation(int& w, int& x, int& y, int& z){
        int tmp=w; w=x; x=y; y=z; z=tmp;
    }
    void n(){rotation(d[4], d[0], d[1], d[5]);}
    void e(){rotation(d[2], d[0], d[3], d[5]);}
    void w(){rotation(d[3], d[0], d[2], d[5]);}
    void s(){rotation(d[1], d[0], d[4], d[5]);}
};

dice dic;
string s;

int main(){
    for(int i = 0; i < 6; i++) cin >> dic.d[i];
    cin >> s;
    for(int i=0; i < s.length(); i++){
        if(s[i]=='N') dic.n();
        if(s[i]=='E') dic.e();
        if(s[i]=='W') dic.w();
        if(s[i]=='S') dic.s();
    }
    cout << dic.d[0] << endl;
    return 0;
}


Measured memory_bytes: 3212
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <fstream>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>
using namespace std;
typedef int64_t ll;
typedef uint64_t ull;
constexpr uint64_t L1 = 1ull;
constexpr ull bit(int n){ return 1ull << n;}

constexpr ll INF       = 1000000000;/* 1e+9a */

ll pow_r(ll d, ll n){
    ll rv{1};
    auto nmul = d;
    while (n > 0) {
        if ((n & 1) == 1) {
            rv *= nmul;
        }
        nmul *= nmul;
        n /= 2;
    }
    return rv;
}

void solve(istream& cin) {
    ll N, P;
    while(cin >> N >> P){
        if(N == 1){
            cout << P << endl;
            continue;
        }
        ll ans = 1;
        ll end = sqrt(P) + 1;
        for (ll i = 2; i < end; ++i) {
            ll d = 0;
            while(P % i == 0){
                P /= i;
                d++;
            }
            ans *= pow_r(i, d/N);
        }
        cout << ans << endl;
    }
}

int main(int argc, char *argv[]) {
    string FileName("A"), Modifier("MEPH_");
    string ExecutionName = Modifier + FileName;
    string sub(argv[0]);
    if(sub.size() > ExecutionName.size())
        sub = sub.substr(sub.size()-ExecutionName.size(), ExecutionName.size());

    if (sub != ExecutionName) {
        cin.tie(0);
        ios::sync_with_stdio(false);
        solve(cin);
    }
    else {    
	    cerr << sub << endl;
        string inFile = FileName +  "_sample.txt";
        auto fs = fstream(inFile, fstream::in);
        solve(fs);
    }
}


Measured memory_bytes: 256
while True:
    n = int(input())
    if n == 0:
        break
    p = 1000-n
    
    c = 0
    for k in [500, 100, 50, 10, 5, 1]:
        if p == 0:
            break
        c += p // k
        p %= k
        
    print(c)


Measured memory_bytes: 5592
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i))
#define p(x) cout<<(x)<<endl;
#define pv(v) for(auto a: v){ cout << a << endl; }

int main() {
  int a,p; cin >> a >> p;
  p((a*3+p)/2)
}


Measured memory_bytes: 256
//Sani buyuk Osman Pasa Plevneden cikmam diyor.
//FatihSultanMehmedHan
//Abdulhamid Han
//Bismillahirrahmanirrahim
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=1;i<=n;i++)
#define mid ((start+end)/2)
#define ort ((bas+son)/2)

const lo MAX = -1000000000000000000;
const lo MIN = 1000000000000000000;
const lo inf = 1000000000;
const lo KOK = 100000;
const lo LOG = 30;
const lo li = 500005;
const lo mod = 1000000007;

lo n,m,b[li],a[1005][1005],k,flag,t,cevap;
lo cev;
string s;
vector<lo> v;

int main(void){
	scanf("%lld %lld",&n,&m);
	for(lo i=1;i<=n;i++){
		for(lo j=1;j<=m;j++){
			scanf("%lld",&a[i][j]);
		}
	}
	for(lo i=1;i<=n;i++){
		for(lo j=i+1;j<=n;j++){
			cev=0;
			for(lo k=1;k<=m;k++){
				cev+=abs(a[i][k]-a[j][k])*abs(a[i][k]-a[j][k]);
			}
			lo at=sqrt(cev);
			if(cev==at*at)cevap++;
		}
	}
	printf("%lld\n",cevap);
	return 0;
}


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

int main() {
    int k;
    int a,b;
    cin >> k;
    cin >> a >> b;

    for (int i = a; i <= b; i++) {
        if (i % k == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }

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

Measured memory_bytes: 3612
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    int a[3];
    scanf("%d %d %d", &a[0], &a[1], &a[2]);
    revrep(i, 2, 0){
        rep(j, 0, i){
            if(a[j] > a[j+1]){
                int b = a[j];
                a[j] = a[j+1];
                a[j+1] = b;
            }
        }
    }
    int ans = 0;
    if((a[2] - a[0])%2 == 1 && (a[2] - a[1])%2 == 1){
        a[0]++; a[1]++; ans++;
    }
    if((a[2] - a[0])%2 == 1 && (a[2] - a[1])%2 == 0){
        a[2]++; a[1]++; ans++;
    }
    if((a[2] - a[0])%2 == 0 && (a[2] - a[1])%2 == 1){
        a[0]++; a[2]++; ans++;
    }
    ans += (a[2] - a[0]) / 2;
    ans += (a[2] - a[1]) / 2;
    printf("%d", ans);

    return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = 0;(i) < (n);i++)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) b.begin(),v.end()
#define SHOW1d(v, n) {REP(WW,n)cerr<<v[WW]<<" ";cerr<<endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr<<v[W_][H_]<<" ";cerr<<endl;}cerr<<endl;}
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll, ll> P;

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

  ll n;cin >> n;
  ll ans = 1;
  ll ma = 1;

  for(ll i = 1;3 * i < LLINF;i *= 3) {
    if(n >= i + (3*i)){
      ans += 2;
      n -= i + (3*i);
      ma = 3 * i;
    }
    else {
      break;
    }
    //cout << i << " " << n << endl;
  }

  //cout << ma << endl;

  ll tmp = 1;
  while (tmp < LLINF)tmp *= 3;
  while (tmp >= 1) {
    while(n >= tmp && tmp <= ma){
      ans++;
      n -= tmp;
    }
    //cout << n << " " << tmp << endl;
    tmp /= 3;
  }

  cout << ans-1 << endl;

  return 0;
}



Measured memory_bytes: 3204
#include<bits/stdc++.h>
using namespace std;
int dp[100005];
int main()
{
  int n,h[100005],one,two;
  cin>>n;
  for(int i=0; i<n; i++){
    cin>>h[i];
  }
  dp[1]=abs(h[0]-h[1]);
  for(int i=2; i<n; i++){
    one=abs(h[i-1]-h[i]);
    two=abs(h[i-2]-h[i]);
    if(one+dp[i-1] < two+dp[i-2]){
      dp[i]+=one+dp[i-1];
    }
    else{
      dp[i]+=two+dp[i-2];
    }
  }
  cout<<dp[n-1]<<'\n';
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main(){
    int a,b,c,x;
    cin>>a>>b>>c>>x;
    int ans=0;
    
    for(int i=0;i<=a;i++){
        for(int j=0;j<=b;j++){
            for(int k=0;k<=c;k++){
                if(i*500+j*100+k*50==x) ans++;
            }
        }
    }
    
    cout<<ans<<endl;
    
    return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
#define FS              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll              long long int
#define ld              long double
#define pb              push_back
#define bp              __builtin_popcount
#define sz              size()
#define ff              first
#define ss              second
#define vll             vector<ll>
#define vbool           vector<bool>
#define vpll            vector<pair<ll,ll>>
#define pll             pair<ll,ll>
#define vllv            vector<vector<ll>>
#define setpri(x)       cout<<setprecision(x)<<fixed;
#define all(v)          v.begin(),v.end()
#define allr(v)         v.rbegin(),v.rend()
#define yesr {cout<<"YES"<<endl;return;}
#define nor {cout<<"NO"<<endl;return;}
// getline (std::cin,name);
ll MOD=1e9+7;
ll ceil1(ll n,ll x){return (n-1)/x+(n>0);}

ll gcd(ll a,ll b){return __gcd(a,b);}
ll lcm(ll a,ll b){return (max(a,b)/gcd(a,b))*min(a,b);}

ll pow1(ll n,ll m ,ll mod=MOD );
ll pow2(ll n,ll k);

ll modinv(ll n,ll mod=MOD){  return pow1(n,mod-2,mod);}

bool func(pair<ll,ll> &a,pair<ll,ll> &b ){
        if(a.ff != b.ff)return a.ff < b.ff;
        return a.ss > b.ss;
}
ll const N=(ll)3e2+11;
ll const LG=(ll)log2(N)+1;


void solve(){
        ll i,j,k,l,n,m,x,y,z,r;
        string s;
        cin>>s;
        n=s.sz;
        map<char,ll> mp;
        for(i=0;i<n;i++){
                mp[s[i]]++;
        }
        
        if(mp.sz!=2 || mp[s[0]]!=2){
                cout<<"No\n";
        }else{
                cout<<"Yes\n";
        }
        
}       
int main(){
        FS;
        
        ll i,j,k,n,m,x,y,z,q;
        q=1;
        // cin>>q;
        while(q--){
                solve();
        }
        return 0;
}


ll pow1(ll n,ll m,ll mod){
        if(m==0)return 1;
        
        if(m%2==0)return pow1((n*n)%mod,m/2,mod);
    	
    	return (pow1((n*n)%mod,m/2,mod)*n)%mod;
}

ll pow2(ll n,ll k){
        ll ans=1;
            while(k>0){
                if(k%2==1)ans=ans*n;
                n=n*n;
                k/=2;
            }
            return ans;
}

Measured memory_bytes: 3628
#include<algorithm>
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
using namespace std;
#define pb push_back
#define S second
#define F first
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,n) for(ll i=1;i<=n;i++)
#define fb(i,n) for(ll i=n-1;i>=0;i--)
#define fb1(i,n) for(ll i=n;i>0;i--)
#define end cout<<'\n';
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<ll>
#define pii pair<ll,ll>
#define CASES  ll t;cin>>t;while(t--)
typedef long long ll;
typedef unsigned long long ull;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
//*X.find_by_order()
//X.order_of_key()
int main()
{
fast;
    ll n;
    cin>>n;
    long double a[n];
    f(i,n)
        cin>>a[i];
    long double dp[n+1][n+1];
    memset(dp,0.0,sizeof(dp));
    dp[0][0]=1.0;
    f1(i,n)
    {
        for(ll j=0;j<=i;j++)
        {
            if(j==0)
            {
                dp[i][j]=dp[i-1][j]*(1.0-a[i-1]);
            }
            else
            {
                dp[i][j]=dp[i-1][j]*(1.0-a[i-1])+dp[i-1][j-1]*(a[i-1]);
            }
        }
    }
    long double ans=0.0;
    for(ll i=(n+1)/2;i<=n;i++)
    {
        ans+=dp[n][i];
    }
    cout<<fixed<<setprecision(10)<<ans;
    return 0;
}

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

int main() {
	string in;
	while(cin >> in) {
		int table[256] = {0};
		bool NA_flag = false;
		string ans = "";
		
		if(in.size() % 2)
			NA_flag = true;

		if(!NA_flag) {
			for(int i = 0; i < in.size(); i += 2) {
				if(in[i] < '1' || '6' < in[i]) NA_flag = true;
				if(in[i + 1] < '1' || '5' < in[i + 1]) NA_flag = true;

				table[i / 2] = 5 * (in[i] - '1') + in[i + 1] - '1';
			}
		}

		if(!NA_flag) {
			for(int i = 0; i < in.size() / 2; i++) {
				if(table[i] < 26)
					ans += 'a' + table[i];
				else if(table[i] == 26)
					ans += '.';
				else if(table[i] == 27)
					ans += '?';
				else if(table[i] == 28)
					ans += '!';
				else if(table[i] == 29)
					ans += ' ';
			}
		}

		if(NA_flag)
			cout << "NA" << endl;
		else
			cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 1196
A, B, C, X, Y = map(int, input().split())

ans = 0
if A+B > 2*C:
    if X >= Y:
        ans += 2*C*Y
        if A > 2*C:
            ans += 2*C*(X-Y)
        else:
            ans += A*(X-Y)
    else:
        ans += 2*C*X
        if B > 2*C:
            ans += 2*C*(Y-X)
        else:
            ans += B*(Y-X)
else:
    ans += X*A + Y*B

print(ans)


Measured memory_bytes: 9192
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;

class Main {
    static final int MOD = 1000000007;
    static final int INF = 1 << 30;
    static final int ALF = 26;

    Main() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long ans = 0;
        int[] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                ans += d[i] * d[j];
            }
        }
        System.out.println(ans);
    }

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


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define MAX_N 10000
#define INF 1e9

using namespace std;

typedef int long long ll;
typedef int long l;
typedef pair<int, int> Pii;
const ll MOD = 1000000007;


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


    int res = 0;
    for (int i = 1; i < n + 1; i += 2) {
        int ans = 0;
        int max = (int)sqrt(i);
        if (max * max == i) {
            continue;
        }
        for (int j = 1; j <= max; j++) {
            if (i % j == 0) {
                ans++;
            }
        }
        if (ans == 4) {
            res++;
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int h, w;
    int i, j;
    while(1){
        scanf("%d %d ", &h, &w);
        if(h==0&&w==0)break;
        for(i=0;i<h;i++){
            for(j=0;j<w;j++){
                printf("#");
            }
            printf("\n");
        }
        printf("\n");
    }

    return 0;
}

Measured memory_bytes: 576
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int sx = sc.nextInt();
		int sy = sc.nextInt();
		int tx = sc.nextInt();
		int ty = sc.nextInt();
		
		StringBuilder sb = new StringBuilder();
		String ans = "";
		String U = "U";
		String D = "D";
		String L = "L";
		String R = "R";
		
		ans += repeat(U, ty - sy);
		ans += repeat(R, tx - sx);
		ans += repeat(D, ty - sy);
		ans += repeat(L, tx - sx);
		ans += "DR";
		ans += repeat(R, tx - sx);
		ans += repeat(U, ty - sy);
		ans += "UL";
		ans += "UL";
		ans += repeat(L, tx - sx);
		ans += repeat(D, ty - sy);
		ans += "DR";
		System.out.println(ans);
	}
	
	public static String repeat(String str, int num) {
		String return_str = ""; 
		for(int i = 0; i < num; i++) {
			return_str += str;
		}
		return return_str;
	}
}


Measured memory_bytes: 63956
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

#define INF 1LL << 60

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

	long long a, b, i, j, k, q, x, aa, bb, aaa, bbb, ans;
	cin >> a >> b >> q;
	vector<long long> s(a), t(b);
	for (i = 0; i < a; i++) cin >> s[i];
	for (i = 0; i < b; i++) cin >> t[i];
	vector<long long>::iterator it;
	while (q--) {
		cin >> x;
		
		if (x < s[0]) aa = INF;
		else {
			it = upper_bound(s.begin(), s.end(), x);
			it--;
			aa = (x - *it);
		}

		if (x > s[a - 1]) aaa = INF;
		else {
			aaa = *lower_bound(s.begin(), s.end(), x) - x;
		}

		if (x < t[0]) bb = INF;
		else {
			it = upper_bound(t.begin(), t.end(), x);
			it--;
			bb = (x - *it);
		}

		if (x > t[b - 1]) bbb = INF;
		else {
			bbb = *lower_bound(t.begin(), t.end(), x) - x;
		}

		ans = min(max(aa, bb), max(aaa, bbb));
		ans = min(ans, min(aa * 2 + bbb, aaa * 2 + bb));
		ans = min(ans, min(aa + bbb * 2, aaa + bb * 2));
		cout << ans << "\n";
	}

	return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int h,a;
    cin>>h>>a;
    if(h%a!=0){
        cout<<h/a+1<<endl;
    }
    else{
        cout<<h/a<<endl;
    }
}

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

using namespace std;

using i64 = long long int;

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()

int main(){
    i64 h, a, b;
    cin >> h >> a >> b;
    i64 ans = 0;
    for(int i = a; i <= b; ++i){
        if(h % i == 0) ++ans;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
int main(void){
  string s;
  cin>>s;
  if(s=="RSS" || s=="SRS" || s=="SSR" || s=="RSR"){
    cout<<1<<endl;
  }else if(s=="RRS" || s=="SRR"){
    cout<<2<<endl;
  }else if(s=="RRR"){
    cout<<3<<endl;
  }else{
    cout<<0<<endl;
  }
}

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

int main(){
  string s, t;
  cin >> s >> t;
  
  for(int i = 0; i < t.size(); i++ ){
    cout << s[i] << t[i];
  }
  if ( s.size() > t.size() ){
    cout << s[s.size() - 1] << endl;
  }else{
    cout << endl;
  }
}

Measured memory_bytes: 256
H, W = gets.split.map(&:to_i)
grid = H.times.map { gets.chomp.chars }

dp = Array.new(H) { Array.new(W, nil) }
dp[0][0] = 1

def dfs(i, j, dp, grid)
  return dp[i][j] if dp[i][j]
  ret = 0
  ret += dfs(i - 1, j, dp, grid) if i > 0 && grid[i - 1][j] == '.'
  ret += dfs(i, j - 1, dp, grid) if j > 0 && grid[i][j - 1] == '.'
  dp[i][j] = ret
end

MOD = 10 ** 9 + 7
puts dfs(H - 1, W - 1, dp, grid) % MOD

Measured memory_bytes: 247164
package main

import "fmt"

func main() {
	var h, w int
	fmt.Scan(&h, &w)
	ar := make([]string, h)
	for i := range ar {
		fmt.Scan(&ar[i])
	}
	vh := []int{0, -1, 0, 1}
	vw := []int{-1, 0, 1, 0}
	ur := make([][]bool, h)
	for i := range ur {
		ur[i] = make([]bool, w)
	}
	ur[0][0] = true
	t, le := 0, 0
	for {
		c := 0
		tv, lv := 0, 0
		for i := 0; i < 4; i++ {
			tt := t + vh[i]
			ll := le + vw[i]
			if 0 <= tt && tt < h && 0 <= ll && ll < w {
				if ur[tt][ll] {
					continue
				}
				if ar[tt][ll] == '#' {
					if i <= 1 {
						fmt.Println("Impossible")
						return
					}
					c++
					tv = tt
					lv = ll
				}
			}
		}
		if c == 2 {
			fmt.Println("Impossible")
			return
		}
		if c == 0 {
			fmt.Println("Possible")
			return
		}
		ur[tv][lv] = true
		t, le = tv, lv
	}
}


Measured memory_bytes: 512