akhauriyash/Code-Regression huggingface dataset:
// ######      ###      #######    #######    ##     #     #####        ###     ##### //
// #     #    #   #          #        #       # #    #    #     #      #   #     ###  //
// #     #   #     #        #         #       #  #   #   #       #    #     #    ###  //
// ######   #########      #          #       #   #  #   #           #########    #   //
// #     #  #       #     #           #       #    # #   #    ####   #       #    #   //
// #     #  #       #    #            #       #     ##   #    #  #   #       #        //
// ######   #       #   #######    #######    #      #    #####  #   #       #    #   //


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> ppl;
#define ain(a,n) for(ll i=0;i<(n);++i)	cin>>(a)[i];
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define loop(i,n) for(ll i=0;i<(n);++i)
#define FOR(i,a,b) for(ll i=(a);i<=(b);++i)
#define FORD(i,a,b) for(ll i=(a);i>=(b);--i)
#define cases ll T=0;cin>>T;while(T--)
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define END "\n"
#define pb push_back
#define mp make_pair
#define go(c,itr) for(auto itr=(c).begin(); itr!=(c).end(); ++itr)
#define back(c,itr) for(auto itr=(c).rbegin(); itr!=(c).rend(); ++itr)
#define PI 3.14159265359
#define inf 9e18
#define MOD 1000000007
#define MODU 998244353
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MAXN 100005
const string alpha = "abcdefghijklmnopqrstuvwxyz";
const ll N = 1e8;
ll binexp(ll a, ll b, ll m) {
	a %= m;
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = res * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return res;
}
ll modinvfermat(ll a, ll m)
{
	return binexp(a, m - 2, m);
}
void task(bool flag)
{
	if (flag)
		cout << "YES\n";
	else
		cout << "NO\n";
}
ll lcm(ll a, ll b)
{
	return ((1LL * a * b) / (__gcd(a, b)));
}

signed main() {

	fast
	ll n;
	cin >> n;
	vl pre(64, 0);
	loop(i, 64)	pre[i] = i * (i + 1) / 2;
	ll ans = 0;
	FOR(i, 2, sqrt(n))
	{
		if (n % i == 0)
		{
			ll ctr = 0;
			while (n % i == 0)
			{
				++ctr;
				n /= i;
			}
			auto low = lower_bound(all(pre), ctr);
			ans += (low - pre.begin());
			if (*low != ctr)
				--ans;
		}
	}
	if (n != 1)
		++ans;
	cout << ans << END;




	return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int a[7],b[7],i;
    for(i=0;i<7;i++){
        cin>>a[i]>>b[i];
    }
    for(i=0;i<7;i++){
        cout<<a[i]-b[i]<<endl;
    }
      return 0;
}

Measured memory_bytes: 3088
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
 
x = int(input())
res = 0
res += (x//11)*2
if x%11 > 6:
    res += 2
elif x%11 > 0:
    res += 1
else:
    res += 0

print(res)

Measured memory_bytes: 3060
#include <iostream>
    #include <algorithm>
    #include <climits>
    #include <numeric>
    #include <iomanip>
    #include <cmath>
    #include <vector>
    #include <set>
    #include <unordered_set>
    #include <queue>
    #include <deque>
    #include <stack>
    #include <map>
    #include <unordered_map>

    #define barsik ios::sync_with_stdio(false)
    #define all(x) begin(x), end(x)
    #define rall(x) rbegin(x), rend(x)

    typedef long long ll;
    typedef std::vector<int> vi;
    typedef std::pair <int, int> pi;
    typedef std::unordered_set <int> u_si;
    const double PI = acos(-1);
    using namespace std;

    void solve(){
        int a, b;
        cin >> a >> b;
        if(a <= 9 && b <= 9) cout << a * b;
        else cout << -1;
    }

    int main(){
        barsik;
        int q = 1;
        //cin >> q;
        while(q--){
            solve();
        }
    }



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

#define rep0(i, n) for(int i=0; i<(int)(n);i++)
#define rep1(i, n) for(int i=1; i<=(int)(n);i++)
#define all(x) (x).begin(), (x).end()
#define debug(a) if(flagdebug){cout << "debug (" #a "):" << endl << (a) << endl;}

using namespace std;

typedef uint64_t ulint;
typedef int64_t lint;

// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;

template<class T> lint sum(vector<T> a);
template<class T> double ave(vector<T> a);
template<typename T> ostream& operator << (ostream& s, const vector<T>& v);
ulint gcd(lint a, lint b);
ulint lcm(lint a, lint b);

bool flagdebug = false;





int main(){
//////////////////////////////////////////////////////

    flagdebug = true; ///本番時削除！！！！！

    //入力

    lint n;
    cin >> n;

    vector<lint> a(n);
    //2次元配列
    //vector<vector<lint>> mat(row, vector<lint>(column, 初期値));

    rep0(i, n)
    {
        cin >> a[i];
    }

    sort(all(a));

    bool okflag = true;
    rep0(i, n-1)
    {
        if(a[i] == a[i + 1])okflag = false;
    }

    if(okflag)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
    

    //2次元配列
    //vector<vector<lint>> mat(row, vector<lint>(column, 初期値));
    //ペア
    //pair<lint,lint> p = make_pair(1,2);
    //vector<pair<lint,lint>> c(100010, pair<lint,lint>(0,0));
    //タプル
    //tuple<lint,lint,lint> t  = make_tuple(1,2,3);


    //昇順ソート
    //sort(all(a));
    //降順ソート
    //sort(all(a),greater<lint>());
    //特殊なソート（ラムダ式）
    //sort(all(mat), [&i](const vector<lint> &a, const vector<lint> &b){return a[i] < b[i];});
    // //[&i]は参照する変数，いらなければからの大括弧でよし．
    //ソート済集合（順序付き集合）
    //set<lint> st;
    //itr.insert(0);
    //auto itrmin = st.begin(); //最小値の次へアクセス
    //auto itrmax = st.end(); //最大値の次へアクセス（かならずデクリメントが必要）
    //itrmax --; //最大値はst.end()の1つ前
    //st.erase(0);
    //st.find;
    
    //////////////////////////////////////////////////////
    //キュー
    //queue<lint> que;
    //que.push(value);
    //que.front(); //トップを参照（消されないので消したい場合は直後にpop()を使う）
    //que.pop(); //追い出す
    //que.empty(); //空なら1，あれば0
    //優先度付きキュー
    //priority_queue<lint> que;
    //キューにque.push()で入れると最大値順に並べられる．que.pop()で取り出すときは常に最大値が前にくる．
    //最小値から取り出したい時はpriority_queue< lint, std::vector<lint>, std::greater<lint> >
    //////////////////////////////////////////////////////
    //スタック
    //stack<lint> stk;
    //stk.push(value);
    //stk.top(); //先頭を参照（消されないので消したい場合は直後にpop()を使う）
    //stk.pop(); //トップを削除
    //stk.empty(); //空なら1,あれば0
    //stk.size(); //数
    //
    // sort(input.begin() , input.end());
    // uint64_t max = numeric_limits<uint64_t>::max();

//////////////////////////////////////////////////////
// Ctrl + Opt + N to make
    return 0;
}

//vectorprint用
template<typename T> ostream& operator << (ostream& s, const vector<T>& v) {
    s << "[\t";
    for (auto i = v.begin(); i < v.end() - 1; i++){s << *i << "\t";}
    s << *(v.end() - 1) << "\t]\n";
	return s;
}

// 最大公約数
ulint gcd(lint a, lint b){
    if(b!=0){return gcd(b, a % b);}
    return a;    
}

//最小公倍数
ulint lcm(lint a, lint b){
    return a / gcd(a, b) * b;
}


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

using namespace std;
int a[6][6];
void find(int &ans, int rows[], int columns[], int x, int y, int k, int n, int m)
{
    if (k == 0 && x >= n && y >= m)
    {
        ans++;
    }
    if (x < n || y < m)
    {
        if (x < n)
        {
            for(int i =0 ; i < m ; i ++)
            {
                if(a[x][i] == 1)
                columns[i]--;
            }
            find(ans, rows, columns, x + 1, y + 1, k - rows[x], n, m);
            for(int i =0 ; i < m ; i ++)
            {
                if(a[x][i] == 1)
                columns[i]++;
            }
        }
        if (x < n && y < m)
        {
            for(int i =0 ; i < m ; i ++)
            {
                if(a[x][i] == 1)
                columns[i]--;
            }
            for(int i =0 ; i < n ; i ++)
            {
                if(a[i][y] == 1)
                rows[i]--;
            }
            find(ans, rows, columns, x + 1, y + 1, k - rows[x] - columns[y] - a[x][y], n, m);
            for(int i =0 ; i < m ; i ++)
            {
                if(a[x][i] == 1)
                columns[i]++;
            }
            for(int i =0 ; i < n ; i ++)
            {
                if(a[i][y] == 1)
                rows[i]++;
            }
        }
        if (y < m)
        {
            for(int i =0 ; i < n ; i ++)
            {
                if(a[i][y] == 1)
                rows[i]--;
            }
            find(ans, rows, columns, x + 1, y + 1, k - columns[y], n, m);
            for(int i =0 ; i < n ; i ++)
            {
                if(a[i][y] == 1)
                rows[i]++;
            }
        }
        {
            find(ans, rows, columns, x + 1, y + 1, k, n, m);
        }
    }
}
int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    int rows[n] = {0};
    int columns[m] = {0};
    int total = 0;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            char x;
            cin >> x;
            a[i][j] = 0;
            if (x == '#')
            {
                rows[i]++;
                columns[j]++;
                a[i][j] = 1;
                total++;
            }
        }
    }
    int ans = 0;
    find(ans, rows, columns, 0, 0, total - k, n, m);
    cout << ans << endl;
}

Measured memory_bytes: 3644
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(long long x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<long long,long long> P;
typedef pair<long long,P> PP;
long long n;
long long t;
long long a[3005];
long long b[3005];
long long aa[3005];
long long bb[3005];
long long f[3005];
long long ccc;
long long k;
long long ans;
long long ka;
long long kb;
long long ff;
long long Ma;
long long Mb;
long long dp[3005];
long long dpa[3005];
int main()
{
	rep(i,3005)dp[i]=-1;
	cin>>n>>t;
	rep(i,n)
	{
		cin>>a[i];
		cin>>b[i];
	}
	/*
	rep(i,n)
	{
			aa[ccc]=a[i];
			bb[ccc]=b[i];
			ccc++;
	}*/
	rep(i,n)
	{
		ff=1;
		rep(j,n)
		{
			if(f[j])continue;
			if(ff)
			{
				k=j;
				ka=a[j];
				kb=b[j];
				ff=0;
			}
			else
			{
				if(ka>a[j]||(ka==a[j]&&kb<b[j]))
				{
					k=j;
				ka=a[j];
				kb=b[j];
				}
			}
		}
		f[k]=1;
		aa[i]=ka;
		bb[i]=kb;
		
	}
	rep(i,n)
	{
		if(i==0)
		{
			dp[0]=0;
			dp[aa[i]]=bb[i];
		}
		else
		{
			rep(j,t)
			{
				if(j<aa[i])
				{
					dpa[j]=dp[j];
				}
				else
				{
					long long m=dp[j];
					if(m<dp[j-aa[i]]+bb[i])
					{
						m=dp[j-aa[i]]+bb[i];
					}
					dpa[j]=m;
				}
			}
			rep(j,t)
			{
				dp[j]=dpa[j];
			}
			
		}
		Ma=0;
		rep(j,t)
		{
			if(Ma<dp[j])Ma=dp[j];
		}
		Mb=0;
		rep2(j,i+1,n)
		{
			if(Mb<bb[j])Mb=bb[j];
		}
		if(ans<Ma+Mb)ans=Ma+Mb;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 384
import java.util.*;

public class Main {
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = A - (B*2);
		if(C >= 0) {
		System.out.println(C);
		}
		else {
		System.out.println(0);
		}
	}
}

Measured memory_bytes: 22356
#include<bits/stdc++.h>
using namespace std;
long long n,ans;
int c(long long x)
{
	int cnt=0;
	while(x)
	{
		cnt++;
		x/=10;
	}
	return cnt;
}
int main()
{
	cin>>n;
	for(long long i=1;i*i<=n;i++)
	{
		if(n%i==0)
		{
			ans=c(n/i);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (N, K) = listOfInt()
    var ans = 0.0
    for (n in 0 until N) {
        var b = 1
        var r = n + 1
        while (r < K) {
            r *= 2
            b *= 2
        }
        ans += 1.0 / N.toDouble() * 1.0 / b.toDouble()
    }
    println(ans)
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)

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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;

    vector<ll> X(N);
    rep (i, N) {
        cin >> X[i];
    }

    ll ans = INF;
    for (int i = -100; i <= 100; i++) {
        ll sum = 0;
        rep (j, N) {
            sum += (X[j]-i)*(X[j]-i);
        }
        ans = min(ans, sum);
    }

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

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

// driver code
int main() {
  string s;
  cin>>s;
  size_t found_A = s.find("A");
  size_t found_B = s.find("B");
  if (found_A != string::npos && found_B != string::npos)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


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

using namespace std;

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

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

int main(void) {
  long long A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;
  long long diff_speed = V - W;
  long long diff_distance = abs(B - A);

  cout << (diff_speed > 0 && diff_distance <= diff_speed * T ? "YES" : "NO")
       << endl;
  return 0;
}

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

int jou10(int sisuu){
    int ans=1;
    for(int i=0;i<sisuu;i++){
            ans *= 10;
    }
    return ans;
}
 
int main() {
    int N,M;
    cin >> N >> M;
    vector<int> s(M), c(M);
    for(int i=0;i<M;i++) cin >> s.at(i) >> c.at(i);
    int ans = -1;
    int flag = 0;
    string nums;

    if(N==1){
        for(int i=0;i<10;i++){
            flag = true;
            nums = to_string(i);
            for(int j=0;j<M;j++){
                if(nums[s.at(j)-1]!=to_string(c.at(j))[0]) flag = false;
            }
            if(flag){ans = i;break;}
        }
    }else{
        for(int i=jou10(N-1);i<jou10(N);i++){
            flag = true;
            nums = to_string(i);
            for(int j=0;j<M;j++){
                if(nums[s.at(j)-1]!=to_string(c.at(j))[0]) flag = false;
            }
            if(flag){ans = i;break;}
        }
    }

    cout << ans << endl;
    
}

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;
const int INF = 2147483647;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//myfuncs
//素数判定
template<class T> inline T isPrime(T x) {
    bool ret = true;
    if (x < 2) {
        ret = false;
    }
    for (LL i = 2; i <= sqrt(x); i++) {
        if (x%i == 0) {
            ret = false;
        }
    }
    return ret;
}

//Union FInd
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

//main code
int yukurid(int a,int b) {
    /* 自然数 a > b を確認・入替 */
    if(a<b){
        int tmp;
        tmp = a;
        a = b;
        b = tmp;
    }

    /* ユークリッドの互除法 */
    int r;
    r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }

    return b;

}

int main(int argc, char const* argv[])
{
    int n;
    cin >> n;
    int a;
    LL ans = 0;
    for (int i = 0; i < n; i++) {
        cin >> a;
        ans += a-1;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>  // clang-format off
using namespace std;
using Int = long long;
#define REP2(i, n) for (Int i = 0, max_i = (n); i < max_i; i++)
#define REP3(i, a, b) for (Int i = (a), max_i = (b); i < max_i; i++)
#define OVERLOAD2(_1, _2, _3, name, ...) name
#define REP(...) OVERLOAD2(__VA_ARGS__, REP3, REP2)(__VA_ARGS__)
struct SetupIO { SetupIO() { cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(13); } } setup_io;
#ifndef _MY_DEBUG
#define dump(...)
#endif  // clang-format on

/**
 *    author:  knshnb
 *    created: Sun Feb 16 21:00:34 JST 2020
 **/

template <class T, class S> vector<T> make_vec(size_t n, S x) { return vector<T>(n, x); }
template <class T, class... Ts> auto make_vec(size_t n, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(n, make_vec<T>(ts...));
}

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

signed main() {
    string s;
    cin >> s;
    Int n = s.size();
    auto dp = make_vec<Int>(n + 1, 2, 1e18);
    dp[n][0] = 0;
    dp[n][1] = 1;
    for (Int i = n - 1; i >= 0; i--) {
        REP(j, 2) {
            chmin(dp[i][0], s[i] - '0' + j + dp[i + 1][j]);
            chmin(dp[i][1], 10 - (s[i] - '0' + j) + dp[i + 1][j]);
        }
    }
    cout << min(dp[0][0], dp[0][1] + 1) << endl;
}


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

int main()
{
	int n;
	cin>>n;
	
	bool f=0;
	for(int i=0;i*4<=n;i++){
		if((n-4*i)%7==0) f=1;
	}
	
	if(f==1) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
const int mod=1e9+7;
using namespace std;
int a,b,c;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>a>>b>>c;
    if((a==b && a!=c) || (a==c && a!=b) || (b==c && b!=a)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <cstdio>

using namespace std;

int main(){
	int l[10];
	int v[2];

	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", 
	&l[0], &l[1], &l[2], &l[3], &l[4], 
	&l[5], &l[6], &l[7], &l[8], &l[9], &v[0], &v[1]) != EOF){
		int sum = 0;
		double d;
		for(int i = 0; i < 10; i++){
			sum += l[i];
			l[i] = sum;
		}
		d = (double)v[0]*l[9]/(v[0]+v[1]);
		for(int i = 0; i < 10; i++){
			if(d <= l[i]){
				cout << i+1 << endl;
				break;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 1208
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>

#define MOD 1e9+7;
#define INF 1e17+9;
#define PI acos(-1);

using namespace std;

int main(){
	long long q,h,s,d;
	cin >> q >> h >> s >> d;
	long long n;
	cin >> n;
	long long min_1=min(4*q,min(2*h,s));
	long long min_2=min(2*min_1,d);
	long long ans=(n/2)*min_2+(n%2)*min_1;
	cout << ans << endl;
	return 0;
}


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

namespace Algorithm
{
    class Program
    {
        const int N = 1000;
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            for (var i = 0; i < n; i++)
            {
                var s1 = Console.ReadLine();
                var s2 = Console.ReadLine();

                Console.WriteLine(Lcs(s1, s2));
            }
        }

        static int Lcs(string X, string Y)
        {
            var c = new int[N + 1, N + 1];
            var m = X.Length;
            var n = Y.Length;
            var max = 0;

            X = " " + X;
            Y = " " + Y;

            for (var i = 1; i <= m; i++)
            {
                for (var j = 1; j <= n; j++)
                {
                    if (X[i] == Y[j])
                        c[i, j] = c[i - 1, j - 1] + 1;
                    else
                        c[i, j] = Math.Max(c[i - 1, j], c[i, j - 1]);

                    max = Math.Max(max, c[i, j]);
                }
            }

            return max;
        }
    }
}



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

using namespace std;

int main() {
  string s;
  cin >> s;
  int n = s.size();

  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    a[i] = s[i] - '0';
  }

  long long ans = 0;
  for (int bit = 0; bit < (1 << (n - 1)); bit++) {
    long long t = 0, cur = a[0];
    for (int i = 0; i < n - 1; i++) {
      if ((bit >> i) & 1) {
        t += cur;
        cur = a[i + 1];
      } else {
        cur *= 10;
        cur += a[i + 1];
      }
    }
    t += cur;
    ans += t;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, w;
    cin >> h >> w;
    vector<string> g(h);
    for (int i = 0; i < h; i++)
    {
        cin >> g[i];
    }
    // 障害物のあるindexをメモしておく
    vector<vector<int>> yoko(h), tate(w);

    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (g[i][j] == '#')
            {
                yoko[i].push_back(j);
                tate[j].push_back(i);
            }
        }
    }
    for (int i = 0; i < h; i++)
    {
        yoko[i].push_back(-1);
        yoko[i].push_back(w);
        sort(ALL(yoko[i]));
    }
    for (int i = 0; i < w; i++)
    {
        tate[i].push_back(-1);
        tate[i].push_back(h);
        sort(ALL(tate[i]));
    }
    int ans = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (g[i][j] == '#')
            {
                continue;
            }
            int right = upper_bound(ALL(yoko[i]), j) - yoko[i].begin();
            int left = yoko[i][right - 1];
            right = yoko[i][right];
            int down = upper_bound(ALL(tate[j]), i) - tate[j].begin();
            int up = tate[j][down - 1];
            down = tate[j][down];
            int cnt = (right - left - 1) + (down - up - 1) - 1;
            chmax(ans, cnt);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 38656
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ABC045A
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, h;
 
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());
            h = int.Parse(Console.ReadLine());
 
            Console.WriteLine((a + b) * h / 2);
 
            Console.ReadKey();
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define lp(i,a,n) for(int i=(a);i<=(int)(n);++i)
#define lpd(i,a,n) for(int i=(a);i>=(int)(n);--i)
#define mem(a,b) memset(a,b,sizeof a)
#define all(v) v.begin(),v.end()
#define println(a) cout <<(a) <<endl
#define sz(x) ((int)(x).size())
#define readi(x) scanf("%d",&x)
#define read2i(x,y) scanf("%d%d",&x,&y)
#define read3i(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define mod 1000000007
#define eps 1e-8
#define infi 1000000000
#define infll 1000000000000000000ll
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef set<int> si;
typedef map<int,int> mii;

const int N = 100002;
int n,m,q,v[N],d[N],c[N],ans[N];
vvi g(N);
bool vis[N][12];

void bfs(int src, int d, int c){
    if(!ans[src]) ans[src] = c;
    vis[src][d] = true;
    queue<pii> q;
    q.push(mp(src, 0));
    while(sz(q)){
        pii curr = q.front(); q.pop();
        if(curr.s == d) break;
        for(int j : g[curr.f]) if(!vis[j][d-curr.s]){
            vis[j][d-curr.s] = true;
            if(!ans[j]) ans[j] = c;
            q.push(mp(j, curr.s+1));
        }
    }
}

int main(){
    read2i(n,m);
    lp(i,1,m){
        int x,y;
        read2i(x,y);
        g[x].pb(y);
        g[y].pb(x);
    }
    readi(q);
    lp(i,1,q) read3i(v[i],d[i],c[i]);

    lpd(i,q,1) bfs(v[i], d[i], c[i]);

    lp(i,1,n) printf("%d\n",ans[i]);
}

/*
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
*/


Measured memory_bytes: 9720
# -*- coding: utf-8 -*-
"""
N : 人数
A1.....An : n番目の人の身長
自分より前に自分より背の高い人がいないようにするための踏み台の最小値
"""

N = int(input())
A_list = [int(x) for x in input().split()]

before_p = A_list[0]
ans = 0

for i in A_list:
  comp = 0
  if i == before_p:
    pass
  elif i >= before_p:
    pass
  elif i < before_p:
    comp = before_p - i
    i += comp
  before_p = i
  ans += comp

print(ans)

Measured memory_bytes: 31012
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

map<pii,int> cnt;

int main(){
	ll h,w,n;
	cin >> h >> w >> n;
	int x,y;
	cu(i,0,n){
		cin >> x >> y;	
		fu(j,-1,1){
			fu(k,-1,1){
				if(x + j > 1 && y + k > 1 && x + j < h && y + k < w)++cnt[{x + j, y + k}];
			}	
		}
	}
	vector<ll> ans(10);
	int tot = 0;
	for(auto ent:cnt){
		++ans[ent.S];
		++tot;
	}
	ans[0] = (h - 2)*(w - 2) - tot;
	cu(i,0,10){
		cout << ans[i] << '\n';
	}
}


Measured memory_bytes: 56448
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

#define rep(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define irep(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define rrep(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)

using namespace std;

const int MOD = 1e9 + 7;

struct Edge {
    int to;
    long long cost;
};

void calc_depth(int node, int from,  vector<long long> &depth, vector<vector<Edge>> &edges) {
    for (auto t : edges[node]) {
        int to = t.to;
        if (to == from)
            continue;
        depth[to] = depth[node] + t.cost;
        calc_depth(to, node, depth, edges);


    }
}

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

    vector<int> a(n - 1), b(n - 1), c(n - 1);
    rep(i, 0, n - 1) {
        cin >> a[i] >> b[i] >> c[i];
        a[i]--, b[i]--;
    } 
    vector<vector<Edge>> edges(n);
    rep(i, 0, n - 1) {
        edges[a[i]].push_back({ b[i], c[i] });
        edges[b[i]].push_back({ a[i], c[i] });
    }
    int q, k;
    cin >> q >> k;
    k--;

    vector<long long> depth(n);
    depth[k] = 0;
    calc_depth(k, -1, depth, edges);


    rep(i, 0, q) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        cout << depth[x] + depth[y] << endl;
        
    }
   
    return 0;
}

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007


int main(){
  
  ll n,x;
  cin >> n >> x;
  vector<ll> v(n);
  rep(i,n)cin >> v[i];
  ll old = min(v[0],x*1ll);
  ll sum = max(0ll,v[0]-x);
  ll res = 1ll << 60;
  rep(i,n-1){
    if(v[i+1]+old > x)sum += v[i+1]+old-x,old = x-old;
    else old = v[i+1];
  }
  res = min(res,sum);
  sum = max(v.back()-x,0ll);
  old = min(x*1ll,v.back());
  for(ll i = n-2;i >= 0;i--){
    if(v[i]+old > x)sum += v[i]+old-x,old = x-old;
    else old = v[i];
  }
  res = min(res,sum);
  cout << res << endl;




  return 0;
}


Measured memory_bytes: 1152
///#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

/*
    zet:
        find_by_order(k): k-stat [k > 0]
        order_of_key(k) : {el < k}

    gp_hash_table<key, val, custom_hash>

    rope<T>:
        iterators: mutable_begin, ..
        methods  : erase, insert, substr, ..
*/

#define all(x) (x).begin(), (x).end()
#define size(x) (int)((x).size())
#define em_back emplace_back

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<typename T>
using zet = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

mt19937 eng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1e5 + 4;

int n, m, a[N], b[N];
vector<int> odd;

void read() {
    cin >> n >> m;
    for (int i = 0; i < m; ++i) {
        cin >> a[i];
        if (a[i] & 1) {
            odd.em_back(i);
        }
    }
}

void write(int id) {
    for (int i = 0; i < m; ++i) {
        cout << a[i] << " ";
    }
    cout << "\n" << id << "\n";
    for (int i = 0; i < id; ++i) {
        cout << b[i] << " ";
    }
    cout << "\n";
}

void solve() {
    read();

    if (size(odd) > 2) {
        cout << "Impossible\n";
        return;
    }

    if (size(odd)) {
        swap(a[0], a[odd[0]]);
        swap(a[m - 1], a[odd.back()]);
    }

    int id = 0;
    if(m == 1) {
        b[id++] = 1;
        if (a[0] > 1) {
            b[id++] = a[0] - 1;
        }
    } else {
        for (int i = 0; i < m; ++i) {
            if (i == 0) {
                b[id++] = a[i] + 1;
            } else {
                b[id++] = a[i];
            }
        }

        if (a[m - 1] > 1) {
            b[id - 1]--;
        } else {
            --id;
        }
    }

    write(id);
}

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

    int z = 1;
    /// cin >> z;

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

    return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

const int mod = 1000000007;
struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this;}
  mint& operator++() { x += 1; return *this;}
  mint& operator-=(const mint a) { if ((x += mod-a.x) >= mod) x -= mod; return *this; }
  mint& operator--() { x -= 1; return *this;}
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
  mint operator+(const mint a) const { mint res(*this); return res+=a; }
  mint operator-(const mint a) const { mint res(*this); return res-=a; }
  mint operator*(const mint a) const { mint res(*this); return res*=a; }
  bool operator==(const int n) const { mint a(n); return this->x == a.x; }
  bool operator==(const ll n) const { mint a(n); return this->x == a.x; }
  bool operator!=(const int n) const { mint a(n); return this->x != a.x; }
  bool operator!=(const ll n) const { mint a(n); return this->x != a.x; }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod-2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const { mint res(*this); return res/=a; }
};
istream& operator>>(istream& is,const mint& m) { return is >> m.x; }
ostream& operator<<(ostream& os,const mint& m) { return os << m.x; }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n,m;
    cin >> n >> m;
    vi x(n),y(m);
    cin >> x >> y;
    mint ansx = 0,ansy = 0;
    rep(i,n-1) ansx += mint(x[i+1]-x[i])*mint(i+1)*mint(n-1-i);
    rep(i,m-1) ansy += mint(y[i+1]-y[i])*mint(i+1)*mint(m-1-i);
    cout << ansx*ansy << endl;
}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int main() {
	int n,min=300000,ans=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		if (t <= min) {
			ans++;
			min = t;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;

void main()
{
    auto input = readln.chomp.split(' ').to!(long[]);
    long N = input[0];
    long M = input[1];

    writeln(((N == 1)?N:N-2) * ((M == 1)?M:M-2));
}


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

typedef long long ll;

int main() {
    int N;
    cin >> N;
    vector<ll> x(N), y(N), a(N), b(N);
    ll maxa = -1e18, mina = 1e18, maxb = -1e18, minb = 1e18;
    rep(i, N) {
        cin >> x[i] >> y[i];
        a[i] = x[i] - y[i];
        b[i] = x[i] + y[i];
        maxa = max(maxa, a[i]);
        mina = min(mina, a[i]);
        maxb = max(maxb, b[i]);
        minb = min(minb, b[i]);
    }
    cout << max(maxa - mina, maxb - minb) << "\n";
}

Measured memory_bytes: 9536
X, Y, Z = map(int, input().split())

def is_ok(key):
    if key * Y + (key + 1) * Z <= X:
        return True
    else:
        return False

def binary_search():
    ok = 0
    ng = 3000001
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

print(binary_search())

Measured memory_bytes: 3060
#include <stdio.h>

int cel[50][11][11];

int main(void)
{
  int i, j, n, d = 0, t;
  int total = 0; 
  int celd[50][1];

  scanf("%d", &n);
  
  while(n != 0){
    for (i = 0; i < n; i++){
      for (j = 0; j < n; j++){
        scanf("%d", &cel[d][i][j]);   
      }
    }

    for (i = 0; i < n; i++){
      for (j = 0; j < n; j++){
        total += cel[d][i][j];
      }

      cel[d][i][n] = total;
      total = 0;
    }

    for (i = 0; i < n; i++){
      for (j = 0; j < n; j++){
        total += cel[d][j][i];
      }
      cel[d][n][i] = total;
      total = 0;
    }

    for (i = 0; i < n; i++){
      total += cel[d][n][i];
    }

    cel[d][n][n] = total;
    total = 0;
	celd[d][1] = n + 1;
	d++;
	scanf("%d", &n);
  }
  
  for (t = 0; t < d; t++){
  	for (i = 0; i < (celd[t][1]); i++){
      for (j = 0; j < (celd[t][1]); j++){
		printf("%5d", cel[t][i][j]);
      }
	  printf("\n");
    }
  }
  
  return (0);
}

Measured memory_bytes: 628
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;
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; }
const long double PI = acos(-1.0);
// cout << fixed << setprecision(14);

const int MAX = 2000010;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int modpow(int x, int n, int mod) {
    int res = 1;
    while (n > 0) {
        if (n & 1) {  // nが奇数のとき
            res *= x;
            res %= mod;
        }
        x *= x;
        x %= mod;
        n >>= 1;
    }
    return res;
}

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

    COMinit();

    int K;
    string S;
    cin >> K >> S;
    int N = S.size();
    int ans = 0;
    int M = N+K;
    for(int i=N;i<=M;i++){
        ans += ((COM(i-1,N-1) * modpow(25,i-N,MOD) ) % MOD) * modpow(26,M-i,MOD);
        ans %= MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 51104
#define _USE_MATH_DEFINES
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <string.h>
#include <math.h>
#include <map>
#include <time.h>
using namespace std;

int main(){ 
	int N, H, W, ans = 0;
	cin >> N >> H >> W;

	ans = (N - H + 1) * (N - W + 1);

	cout << ans << endl;

	return 0;
}

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

string A, B, C;

int main() {
    cin >> A >> B >> C;

    // cout << A[A.size() - 1] << endl;
    if (A[A.size() - 1] == B[0] && B[B.size() - 1] == C[0]) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define inf 999999999
#define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i)
#define rep(i, n) loop(i, 0, n)
#define lin long long
#define lfl long double
lin k,a,b;

lin calc()
{
    if(b - a <= 2)
        return 1 + k;

    if(1 + k <= a)
        return 1 + k;

    lin r = k - (a - 1);
    lin c = r / 2;
    return 1 + c * (b-a) + (k-c*2);
}

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

    lin res = calc();
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	static final long BASE = 2000000;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int l = sc.nextInt();
		UnionFindTree roadTree = new UnionFindTree(n);
		for (int i = 0; i < k; i++) {
			roadTree.unite(sc.nextInt() - 1, sc.nextInt() - 1);
		}
		UnionFindTree trainTree = new UnionFindTree(n);
		for (int i = 0; i < l; i++) {
			trainTree.unite(sc.nextInt() - 1, sc.nextInt() - 1);
		}
		HashMap<Long, Integer> counts = new HashMap<>();
		for (int i = 0; i < n; i++) {
			long key = roadTree.find(i) * BASE + trainTree.find(i);
			if (counts.containsKey(key)) {
				counts.put(key, counts.get(key) + 1);
			} else {
				counts.put(key, 1);
			}
		}
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < n; i++) {
			if (i != 0) {
				sb.append(" ");
			}
			long key = roadTree.find(i) * BASE + trainTree.find(i);
			sb.append(counts.get(key));
		}
		System.out.println(sb);
	}
	
	static class UnionFindTree {
		int[] parents;
		
		public UnionFindTree (int size) {
			parents = new int[size];
			for (int i = 0; i < size; i++) {
				parents[i] = i;
			}
			
		}
		
		public int find(int x) {
			if (x == parents[x]) {
				return x;
			}
			int ans = find(parents[x]);
			parents[x] = ans;
			return ans;
		}
		
		public void unite(int x, int y) {
			int xx = find(x);
			int yy = find(y);
			if (xx == yy) {
				return;
			}
			parents[xx] = yy;
		}
	}
	
}


Measured memory_bytes: 95936
#include<bits/stdc++.h>
using namespace std;
char s[110];
int main(){
	bool f=true;
	gets(s);
	for (int i=0;i<strlen(s);i++) {
		if (s[i]=='C') {
			for (int j=i+1;j<strlen(s);j++){
				if (s[j]=='F') {
					cout<<"Yes";
					f=false;
					break;
				}
			}
			if (f==false) break;
		}
	}
	if (f==true) cout<<"No";
}

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}






int gcd(int a,int b)
{
 
  int r, tmp;
 
  
 
  /* 自然数 a > b を確認・入替 */
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
 
 
  return b;
}







int fac(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}
///////////////////////////
int main() {
  int n,ans=1;
  cin>>n;
  string s;
  cin>>s;
  rep(i,n-1){
    if(s[i]!=s[i+1]) ans++;
  }
  cout<<ans<<endl;
}
///////////////////////////

Measured memory_bytes: 512
N=int(input())
A=list(map(int,input().split()))

import numpy as np

A=np.array(A)

from bisect import bisect_left
s = bisect_left(A.cumsum(), A.sum()/2)

if A.sum()/2 in A.cumsum():
    print(0)
else:
    print(int(min(abs(A.sum()/2 - A[0:s].sum()) * 2, abs(A.sum()/2 - A[0:s+1].sum()) * 2)))

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int n,k;
int a[25];

int main(){
  scanf("%d%d",&n,&k);
  REP(i,n)scanf("%d",a+i);
  ll ans = 1e18;
  REP(mask,1<<n){
    if(__builtin_popcount(mask) != k)continue;
    ll tmp = 0;
    int mx = -1;
    REP(i,n){
      if((mask>>i)&1){
        // use this
        if(a[i]<=mx){
          tmp += (mx+1) - a[i];
          mx++;
        }else{
          CHMAX(mx,a[i]);
        }
      }else{
        CHMAX(mx,a[i]);
      }
    }
    CHMIN(ans,tmp);
  }
  printf("%lld\n",ans);
  return 0;
}


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

int main() {
  int A,B,C,X,Y;
  cin>>A>>B>>C>>X>>Y;
  int max,value,min;
  if(X<Y){
    max=Y, min=X, value=B;
  } else {
    max=X; min=Y; value=A;
  }

  int sum=0;
  if(A+B<=2*C) {
    if(A<2*C) sum+=A*X;
    else sum+=2*C*X;
    if(B<2*C) sum+=B*Y;
    else sum+=2*C*Y;
    cout<<sum<<endl; return 0;
  } else {
    sum+=min*2*C; max-=min;
    if(max==0) { cout<<sum<<endl; return 0; }
    if(max>0) {
      if(2*C<value) sum+=max*2*C;
      else sum+=max*value;
      cout<<sum<<endl; return 0;
    }
  }
}


Measured memory_bytes: 256