akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
    int n;
    cin >> n;
    float x;
    string u;
    float sum = 0;
    rep(i, n){
        cin >> x >> u;
        if(u=="JPY"){
            sum += x;
        }else{
            sum += x*380000.0;
        }
    }

    cout << sum << endl;
    return 0;
}

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

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int[] aa=new int[3];

		for(int i=0; i<3; i++) {
			aa[i]=sc.nextInt();
		}
		Arrays.sort(aa);

		System.out.println(aa[2]*10+aa[1]+aa[0]);
	}
}

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

using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pll = pair<ll, ll>;

const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;

#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = ll(b) - 1; i >= (a); i--)
#define TR(X)                                                  \
    ({                                                         \
        if (1) cerr << "TR: " << (#X) << " = " << (X) << endl; \
    })
#define LL(name) \
    ll name;     \
    cin >> name;
#define VL(name, num) \
    vl name(num);     \
    FOR(INPUT_VL_I, 0, num) { cin >> name[INPUT_VL_I]; }

int main() {
    cin.sync_with_stdio(0);
    LL(N);
    LL(A);
    LL(B);
    LL(C);

    vector<string> ss(N);
    FOR(i, 0, N) cin >> ss[i];

    vector<char> ans;
    vl score = {A, B, C};
    FOR(i, 0, N) {
        auto s = ss[i];

        ll a = s[0] - 'A';
        ll b = s[1] - 'A';

        auto doa = [&]() {
            score[a]++;
            score[b]--;
            ans.pb('A' + a);
        };
        auto dob = [&]() {
            score[a]--;
            score[b]++;
            ans.pb('A' + b);
        };

        if (score[a] == 0 && score[b] == 0) {
            break;
        }
        if (score[a] == 0 || score[b] > 1) {
            doa();
            continue;
        }
        if (score[b] == 0 || score[a] > 1) {
            dob();
            continue;
        }
        assert(score[a] == 1 && score[b] == 1);

        if (i == N - 1) {
            doa();
            break;
        }

        auto next_s = ss[i + 1];
        if (next_s.find(s[0]) != string::npos) {
            doa();
        } else {
            dob();
        }
    }

    if (sz(ans) == N) {
        cout << "Yes" << endl;
        for (char c : ans) cout << c << endl;
    } else {
        cout << "No" << endl;
    }
}  // cin.tie(0) bei schnellem Wechseln


Measured memory_bytes: 6656
/*
    Mbak Sana Dong
*/
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
const int mod = 1e9+7;
ll arr[300300];
ll sana[300300];
int main()
{
    int n,m,i,j,k,x,y,ans,curr,temp;
    cin >> n;
    for(i=1;i<=n;i++)
    {
        cin >> arr[i];
    }
    ll sum = 0;
    for(ll a=0;a<61;a++)
    {
        ll one = 0, zero = 0;
        for(j=1;j<=n;j++)
        {
            if(arr[j] % 2 == 0)
            {
                zero++;
            }
            else
            {
                one++;
            }
            arr[j] /= 2;
        }
        ll now = (zero*((one*((1LL << a)%mod)) % mod)) % mod;
        sum = (sum + now) % mod;
    }
    cout << sum << endl;
    return 0;
}


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

namespace AOJ
{
  class Program
  {
    static void Main()
    {
      int[] data = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
      int r = data[0];
      int c = data[1];
      int row_sum, col_sum, i, j;
      int[] cols = new int[c];
      for (i = 0; i < c; i++) cols[i] = 0;

      col_sum = 0;
      for (i = 0; i < r; i++)
      {
        data = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        row_sum = 0;
        for (j = 0; j < c; j++)
        {
          Console.Write("{0} ", data[j]);
          row_sum += data[j];
          cols[j] += data[j];
        }
        Console.WriteLine(row_sum);
        col_sum += row_sum;
      }

      for (i = 0; i < c; i++)
        Console.Write("{0} ", cols[i]);
      Console.WriteLine(col_sum);
    }
  }
}

Measured memory_bytes: 9704
#include<stdio.h>
#include<string.h>
int M,i,j,k,l,p;
char S[75],res[1000][75];
void ins(char *x)
{
	int i;
	for(i=0;i<p;i++)
		if(strcmp(res[i],x)==0)
			break;
	if(i==p)
		memcpy(res[p++],x,sizeof(res[i]));
}
void m(char *s,char *t)
{
	char b[75]={0};
	memcpy(b,s,sizeof(char)*strlen(s));
	strcat(b,t);
	ins(b);
}
int main()
{

	for(scanf("%d\n",&M);M--;)
	{
		p=0;
		gets(S);
		l=strlen(S);
		for(i=1;i<l;i++)
		{
			char s[75]={0},rs[75]={0},t[75]={0},rt[75]={0};
			memcpy(s,S,sizeof(char)*i);
			for(k=0,j=strlen(s)-1;j>=0;k++,j--)rs[k]=s[j];
			memcpy(t,S+i,sizeof(char)*(l-i));
			for(k=0,j=strlen(t)-1;j>=0;k++,j--)rt[k]=t[j];
			m(s,t);m(t,s);m(rs,t);m(t,rs);m(s,rt);m(rt,s);m(rs,rt);m(rt,rs);
		}
		printf("%d\n",p);
	}
	return 0;
}

Measured memory_bytes: 660
#include<iostream>
#include<cstdio>
#include<set>
#include<queue>
#include<cstring>
#include<algorithm>
typedef long long ll;
#define inf 1000000000
using namespace std;


struct _node
{
	ll v,w;
	//:v(a),w(b)
	_node(ll a=0,ll b=0)
	{
		v=a;
		w=b;
	
	};
	bool operator <(const _node & other) const
	{
		return other.w<w;
	}
	
}node;

vector<_node> A[10500];
bool mark[10500];
ll dis[10500];

priority_queue<_node> Q;

void add(ll a,ll b,ll c)
{
	//cout<<a<<" "<<b<<" "<<c<<endl; 
	A[a].push_back(_node(b,c));
	//cout<<A[a][0].w<<endl;
	
}


void dlsj(ll n)
{
	//while(!Q.empty())Q.pop();
	ll v,v1;
	_node tmp;
	for(int i=0;i<n;i++)dis[i]=inf;

	dis[0]=0;
	Q.push(_node(0,0));
	
	while(!Q.empty())
	{
		tmp=Q.top();
		Q.pop();
		v=tmp.v;
		//cout<<v<<endl;
		//cout<<A[v].size()<<endl;
		if(mark[v])continue;
		mark[v]=1;
		for(int i=0;i<A[v].size();i++)
		{
			
			if(mark[A[v][i].v])continue;
			v1=A[v][i].v;
			//cout<<i<<" "; 
			//cout<<dis[2]<<" "<<dis[A[v][i].v]<<" "<<dis[v]+A[v][i].w<<endl;
			//cout<<A[v][i].v<<endl;
			if(dis[v1]>dis[v]+A[v][i].w)
			{
				
				dis[v1]=dis[v]+A[v][i].w;
				
				Q.push(_node(A[v][i].v,dis[v1]));
				
			}
			
			
			
			
		} 
		
		
	}
	
	
	
	
}




int main()
{
	ll n;
	scanf("%lld",&n);
	add(0,0,0);
	for(int i=1;i<=n;i++)
	{
		ll u,k,a,b;
		scanf("%lld%lld",&u,&k);
		while(k--)
		{
			scanf("%lld%lld",&a,&b);
			add(u,a,b);
		}
		
		
		
		
	} 
	dlsj(n);
	for(int i=0;i<n;i++)
	{
		//cout<<"e"<<endl;
		cout<<i<<" "<<dis[i]<<endl;
		
	}
	
}


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

int main(){
	int n;
	cin >> n;
	vector<vector<bool>> v(4, vector<bool>(13));
	while(n--){
		char c;
		int a;
		cin >> c >> a;
		int index = c == 'S' ? 0 : c == 'H' ? 1 : c == 'C' ? 2 : 3;
		v[index][--a] = true;
	}
	for(int i = 0; i < 4; i++) for(int j = 0; j < 13; j++) if(!v[i][j]) cout << "SHCD"[i] << ' ' << j + 1 << endl;
}

Measured memory_bytes: 3008
import java.util.Scanner;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long A = sc.nextLong();
    long B = sc.nextLong();
    long C = N/(A+B);
    long D = N%(A+B);
    
    if(A==0){
      System.out.println(0);
    } else if(D<=A) {
      System.out.println(C*A+D);
    } else if(D>A) {
      System.out.println(C*A+A);
    }
  }
}

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

int main() {
  long N;
  cin >> N;

  vector<long> d(N);
  for (long i=0; i<N; i++) {
    cin >> d.at(i);
  }
  
  //sortして、中間の値の間にいくつ数値が入るかを調べる
  sort(d.begin(), d.end());
  long diff = d.at(d.size()/2)-d.at(d.size()/2-1);
  
  cout << diff << endl;
  
  return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

typedef long long ll;
typedef long double ld;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int n, h;
    cin >> n >> h;
    priority_queue<int> pq;
    pq.push(-1);
    int attack = 0;
    rep (i, n) {
        int a, b;
        cin >> a >> b;
        attack = max(attack, a);
        pq.push(b);
    }
    int cnt = 0;
    while (h > 0) {
        int f = pq.top();
        if (f <= attack) {
            cnt += (h + attack - 1) / attack;
            break;
        } else {
            h -= f;
            pq.pop();
            cnt++;
        }
    }
    cout << cnt << endl;
    
    return 0;
}



Measured memory_bytes: 892
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int min = sc.nextInt();
        int ans = Integer.MIN_VALUE;
        
        for (int i = 0; i < n - 1; i++) {
            int input = sc.nextInt();
            ans = Math.max(input - min, ans);
            min = Math.min(input, min);
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 99432
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  long long n;
  cin >> n;
  long long ans=0;
  for(long long i=0;i<=n;i++){
    if(i%3!=0&&i%5!=0){
      ans+=i;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
std::ios::sync_with_stdio(false);
int n;cin>>n;
int a,b,c;
int dpa[n],dpb[n],dpc[n];
cin>>a>>b>>c;
dpa[0]=a;
dpb[0]=b;
dpc[0]=c;
for(int i=1;i<n;i++){
    cin>>a>>b>>c;
    dpa[i]=max(dpb[i-1],dpc[i-1])+a;
    dpb[i]=max(dpa[i-1],dpc[i-1])+b;
    dpc[i]=max(dpb[i-1],dpa[i-1])+c;
}
cout<<max(max(dpa[n-1],dpb[n-1]),dpc[n-1]);

return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using ll  = long long;
#define int ll
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define erep(e,v) for(auto && e :v)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? (int)1e9:(int)1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){for(auto itr :a){if(itr != *a.begin())cout << " "; cout << itr;} }
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
signed main(){
    int n; cin >> n;
    vector<int>dp(100,0);
    dp[0] = 2;
    dp[1] = 1;
    rep(i,dp.size()){
        if(i>=2)dp[i] = dp[i-1] + dp[i-2];
    }
    cout << dp[n] << endl;
}




Measured memory_bytes: 256
A, B, C, x, y = list(map(int, input().split()))

cost = 1e+15
for i in range(max(x, y)+1):
  xx = max(0, x - i)
  yy = max(0, y - i)
  cost = min(cost, A * xx + B * yy + 2*C*i)
print(cost)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
int dp[2005];
int main(){
    int n;
    cin >> n;
    dp[0] = 1;
    for(int i=0;i<=n;i++){
        for(int j=3;j<=n;j++){
            if(i+j <= n) dp[i+j] = (dp[i+j] + dp[i])%mod;
        }
    }
    printf("%d\n", dp[n]);
}

Measured memory_bytes: 3768
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;

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

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)


int main()
{
    int a, b;
    cin >> a >> b;
    cout << setprecision(15) << a*b/3.305785 << endl;
}

Measured memory_bytes: 1232
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N, K, ans=0;
    cin >> N >> K ;
    vector<int> l(N);

    for(int i=0; i<N; i++){
	cin >> l[i];
    }
    sort(l.begin(), l.end(), greater<int>());
	
    for(int i=0; i<K; i++){
	ans += l[i];
    }

    cout << ans << endl;

}



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

pair<int, int> a[100010];
int main(){

	int n,tmp;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&tmp);
		a[i]=make_pair(tmp,i);
	}
	sort(a, a+n);

	int ans=0;
	for(int i=0;i<n;i++){
		if(a[i].second%2!=i%2)
			ans++;
	}
	ans/=2;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  int a,b;cin >>a>>b;
  cout << max(max(a+b,a-b),a*b) << endl;
  return 0;
}


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

using namespace std;

/**
 *  Name: Chris M. Perez
 *  University: Interamerican University Metro Campus
 *
**/

#define endl '\n'
#define MOD 10e9
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define gcd(x , y) __gcd(x , y)
#define all(x) (x).begin() , (x).end()
#define forn(i , a , b) for(int i=(a);i<(b);i++)
#define forrange(j , a , b) for(int j=(a);j<=(b);j++)
#define nestedforn(i , a , b , j , c , d) for(int i=(a);i<=(b);i++) for(int j=(c);j<=(d);j++)
#define sort_all(x) sort(all(x))
#define zeros_at_beginning(x) __builtin_clz(x)
#define zeros_at_end(x) __builtin_ctz(x)
#define ones(x) __builtin_popcount(x)
#define parity_even_or_odd_ones __builtin_parity(x)

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef tuple<int , int , int> tiii;
typedef vector<pii> vpii;
typedef vector<tiii> vtiii;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef long long int lli;

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

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

#ifdef LOCAL_DEFINE
  freopen("input.txt" , "rt" , stdin);
#endif
 
  int n; cin >> n;
  int k; cin >> k;
  cout << (((n + 1) / 2) >= k ? "YES" : "NO") << endl;
  
   
#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif  
  return 0;
}

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

#define MAX_SIZE 110
#define INF (1<<30)
#define NOT_VISITED 0
#define VISITED 1
#define COMPLETE 2

int n, G[MAX_SIZE][MAX_SIZE];

int prim() {
    int d[MAX_SIZE], parent[MAX_SIZE], status[MAX_SIZE];
    for (int i = 0; i < n; i++) {
        d[i] = INF;
        parent[i] = -1;
        status[i] = NOT_VISITED;
    }
    d[0] = 0;

    int u, min_cost;
    while (1) {
        u = -1;
        min_cost = INF;
        for (int i = 0; i < n; i++) {
            if (min_cost > d[i] && status[i] != COMPLETE) {
                u = i;
                min_cost = d[i];
            }
        }
        if (u == -1) break;
        status[u] = COMPLETE;
        for (int i = 0; i < n; i++) {
            if (status[i] == COMPLETE || G[u][i] == INF) continue;
            if (d[i] > G[u][i]) {
                d[i] = G[u][i];
                parent[i] = u;
                status[i] = VISITED;
            }
        }
    }
    
    int sum = 0;
    for (int i = 0; i < n; i++) {
        if (parent[i] != -1) sum += G[i][parent[i]];
    }

    return sum;
}

int main() {
    cin >> n;

    int a;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a;
            if (a == -1) G[i][j] = INF;
            else G[i][j] = a;
        }
    }

    cout << prim() << endl;

    return 0;
}


Measured memory_bytes: 3088
#include<bits/stdc++.h>
 
#define INF 1000000007
#define LINF 1000000000000000007
 
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> P;


string s;

int main(){
	cin >> s;
	
	if(s.size()==2)cout << s << endl;
	else cout << s[2] << s[1] << s[0] << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <functional>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <limits>

long long n, x;
int a[2010];

long long func(int r) {
    long long sum = 0;
    for(int i = 0; i < n; ++i) {
        int d = std::numeric_limits<int>::max();
        for(int j = 0; j <= r; ++j) {
            int m = i - j;

            if(m < 0)
                m += n;
            
            d = std::min(a[m], d);
        }
        sum += d;
    }

    return sum + x * r;
}

int main() {
    long long sum = 0;

    std::cin >> n >> x;


    for(int i = 0; i < n; ++i) {
        std::cin >> a[i];
    }


    int left = 0, right = n - 1;

    while(left + 2 < right) {
		if (func((left * 2 + right) / 3) < func((left + right * 2) / 3)){
			right = (left + right * 2) / 3;
		} else {
			left = (left * 2 + right) / 3;
		}
	}

    long long m = std::numeric_limits<long long>::max();
    for(int i = left; i <= right; ++i) {
        m = std::min(func(i), m);
    }
    
    std::cout << m << std::endl;
}

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

int n, m;

int main()
{
	scanf("%d%d", &n, &m); int m_ = m/n;
	for (int i = m_; i >= 1; i--) if (m%i == 0) { printf("%d\n", i); return 0; }
}

Measured memory_bytes: 256
import Control.Applicative
import Data.Array.IO

main = do
        n <- readLn
        arr <- newListArray (0,(n-1)) =<< map read.words<$>getLine :: IO (IOArray Int Int)
        printIOArray arr
        insertionSortShow n arr
        return ()

insert :: (MArray a e m, Ord e) => Int -> a Int e -> m (a Int e)
insert i arr = readArray arr i >>= \e -> searchPos e (i-1) arr

searchPos :: (MArray a e m, Ord e) => e -> Int -> a Int e -> m (a Int e)
searchPos e j arr
    | j < 0 = writeArray arr (j+1) e >> return arr
    | otherwise = do
        e' <- readArray arr j
        if e' > e then writeArray arr (j+1) e' >> searchPos e (j-1) arr
                  else writeArray arr (j+1) e >> return arr

insertionSort :: (MArray a e m, Ord e) => Int -> a Int e -> m (a Int e)
insertionSort n arr = foldl (>>=) (return arr) $ map insert [0..(n-1)]

insertionSortShow n arr = foldl (>>=) (return arr) $ map (\i arr -> insert i arr >>= printIOArray >> return arr) [1..(n-1)]

printIOArray :: (Show e) => IOArray Int e -> IO ()
printIOArray arr = getElems arr >>= putStrLn.unwords.map show

Measured memory_bytes: 4088
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2000 + 5);
const double EPS = 1e-10;
const int dy[] = {0, 1, 0, -1}, dx[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)

ll n, h, w;
ll X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
ll field[MAX_N*4][MAX_N*4];
vector<ll> xs, ys, xunzip, yunzip;
map<ll,ll> xzip, yzip;

void compress(vector<ll> &x, map<ll, ll> &zip, vector<ll> &unzip) {
    sort(x.begin(), x.end());
    x.erase(unique(x.begin(), x.end()), x.end());
    unzip.resize(x.size());
    for (int i = 0; i < x.size(); i++) {
        zip[x[i]] = i;
        unzip[i] = x[i];
    }
}

int main() {
    while(1){

    cin >> w >> h;
    if(w==0)break;
    cin >> n;

    xs.clear();
    ys.clear();
    xzip.clear();
    yzip.clear();
    xunzip.clear();
    yunzip.clear();

    REP(i,n){
        cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
        xs.push_back(X1[i]);
        xs.push_back(X2[i]);
        ys.push_back(Y1[i]);
        ys.push_back(Y2[i]);
        if(X2[i]+1<=w)xs.push_back(X2[i]+1);
        if(Y2[i]+1<=h)ys.push_back(Y2[i]+1);
    }
    xs.push_back(0);
    xs.push_back(w);
    ys.push_back(0);
    ys.push_back(h);

    compress(xs, xzip, xunzip);
    compress(ys, yzip, yunzip);

    w = xzip[w];
    h = yzip[h];

    REP(i,h) fill(field[i],field[i]+w,0);
    REP(i,n){
        field[yzip[Y1[i]]][xzip[X1[i]]]++;
        field[yzip[Y1[i]]][xzip[X2[i]]]--;
        field[yzip[Y2[i]]][xzip[X1[i]]]--;
        field[yzip[Y2[i]]][xzip[X2[i]]]++;
    }
    REP(i,h+1)REP(j,w){
        field[i][j+1] += field[i][j];
    }
    REP(j,w+1)REP(i,h){
        field[i+1][j] += field[i][j];
    }



    ll ans = 0;
    for(int y=0; y<h; y++){
        for(int x=0; x<w; x++){
            if(field[y][x])continue;
            ans++;

            queue<pair<ll,ll> > que;
            que.push(make_pair(y,x));
            while(!que.empty()){
                ll py = que.front().first ,px = que.front().second;
                que.pop();

                for(int i=0; i<4; i++){
                    ll ny = py+dy[i], nx = px+dx[i];
                    if(ny<0 || ny>=h)continue;
                    if(nx<0 || nx>=w)continue;
                    if(field[ny][nx])continue;
                    que.push(make_pair(ny,nx));
                    field[ny][nx] = 1;
                }
            }
        }
    }

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



Measured memory_bytes: 11292
#include <bits/stdc++.h>
using namespace std;
using ld = long double;
const ld os = (ld)1 / 6;

int main()
{
	cout << fixed << setprecision(8);
	int N, T, L, B;
	while (cin >> N >> T >> L >> B, N | T | L | B) {
		vector<int> d(N + 1);
		vector<vector<vector<ld>>> dp(T + 1, vector<vector<ld>>(N + 1, vector<ld>(2)));
		dp[0][0][0] = 1.0;
		for (int i = 0, l; i < L; i++) {
			cin >> l;
			d[l] = 1;
		}
		for (int i = 0, b; i < B; i++) {
			cin >> b;
			d[b] = 2;
		}
		for (int i = 1; i <= T; i++) {
			for (int j = 0; j < N; j++) {
				if (d[j] == 1) {
					dp[i][j][0] += dp[i - 1][j][1];
				}
				for (int k = 1; k <= 6; k++) {
					int ne = (j + k <= N ? j + k : N * 2 - (j + k));
					dp[i][ne][d[ne] == 1] += dp[i - 1][j][0] * os;
				}
			}
			for (int j = 1; j < N; j++) {
				if (d[j] == 2) {
					dp[i][0][0] += dp[i][j][0];
					dp[i][j][0] = 0;
				}
			}
			dp[i][N][0] += dp[i - 1][N][0];
		}
		cout << dp[T][N][0] << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
    queue<char> a,b,c;
    string sa,sb,sc;
    cin>>sa>>sb>>sc;
    for(auto at:sa) a.push(at);
    for(auto at:sb) b.push(at);
    for(auto at:sc) c.push(at);
    
    char point='a';
    
    while(true){
        if(point=='a'){
            if(a.empty()) break;
            
            point=a.front();
            a.pop();
        }else if(point=='b'){
            if(b.empty()) break;
            
            point=b.front();
            b.pop();
        }else{
            if(c.empty()) break;
            
            point=c.front();
            c.pop();
        }
    }
    
    cout<<(char)(point-0x20)<<endl;
    
    return 0;
}

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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    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;
    }
}
ll 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;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}

vector<pair<int,ll>> vec[100000];
ll cost[100000];
void dfs(int now,ll COST){
    cost[now]=COST;
    int next;
    REP(i,vec[now].size()){
        next=vec[now][i].first;
        if(cost[next]<0){
            dfs(next,COST+vec[now][i].second);
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s=in<string>();
    ll K=in();
    string ans;ans=s;
    REP(i,s.length()){
        if(s[i]=='a')continue;
        if('z'-s[i]+1<=K){
            ans[i]='a';
            K-='z'-s[i]+1;
        }
    }
    K=K%26;
    ans[s.length()-1]=ans[s.length()-1]+K;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3968
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <cmath>

using namespace std;    
typedef long long ll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

int main(){

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

    if(a <= 5){
        cout << 0 << endl;
    }
    else if(a <= 12){
        cout << b / 2 << endl;
    }
    else{
        cout << b << endl;
    }
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;

signed main(){
  fastio
  int n,k;cin>>n>>k;

  int digit[10]={0},x;
  for(int i=0;i<k;i++)  cin>>x,digit[x]++;
  int mi=11,ma=-1;
  for(int i=0;i<10;i++){
    if(!digit[i])
      mi=min(mi,i),ma=max(ma,i);
  }
  // cout<<mi<<" "<<ma<<"\n";
  string s=to_string(n);
  string ans;
  int fail=0;
  for(int i=0;i<s.size();i++){
    if(digit[s[i]-'0']){
      int k;
      for(k=s[i]-'0';k<10;k++){
        if(!digit[k]){
          // cout<<"k="<<k<<"\n";
          // cout<<char(k+'0')<<"\n";
          ans+=string(1,char(k+'0'));
          // cout<<ans<<"\n";
          i++;
          while(i<s.size()){
            ans+=string(1,char(mi+'0'));
            i++;
          }
          break;
        }
      }
      // cout<<k<<" "<<fail<<"\n";
      if(k==10) fail=1;
      else      break;
    }else{
      ans+=s[i];
    }
  }
  if(fail){
    string ans;
    for(int i=1;i<10;i++){
      if(!digit[i]){
        ans+=string(1,char(i+'0'));
        break;
      }
    }
    ans+=string(s.size(),char(mi+'0'));
    cout<<ans<<"\n";
    return 0;
  }
  cout<<ans<<"\n";
  return 0;
}

Measured memory_bytes: 256
s = raw_input()
x = []
for i in s:
    if len(x) > 0:
        if i == '0':
            x.append('0')
        elif i == '1':
            x.append('1')
        elif i == 'B':
            x.pop()
    else:
        if i == '0':
            x.append('0')
        elif i == '1':
            x.append('1')

print ''.join(x)


Measured memory_bytes: 2568
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n-1;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 999999

ll min(ll a, ll b){
	if (a<b) return a;
	else return b;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<ll> a(5);
	REP(i, 5){cin >> a[i];}
	ll k;
	cin >> k;
	if (a[4]-a[0]>k){
		cout << ":(" << endl; return 0;
	}
	cout << "Yay!" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N; cin >> N;
    long long x; cin >> x;
    vector<long long> a(N);
    for (int i = 0; i < N; ++i) cin >> a[i];
    sort(a.begin(), a.end());
    int res = 0;
    for (int i = 0; i < N; ++i) {
        if (x >= a[i]) ++res, x -= a[i];
        else break;
    }
    if (res == N && x) --res;
    cout << res << endl;    
}




Measured memory_bytes: 256
n_m = input().split(' ')
n = int(n_m[0])
m = int(n_m[1])

field = [0]*n

h = input().split(' ')

for m_ in range(m):
    x_y = input().split(' ')
    x = int(x_y[0])-1
    y = int(x_y[1])-1
    if float(h[x]) > float(h[y]):
        field[y] += 1
    elif float(h[x]) < float(h[y]):
        field[x] += 1
    elif float(h[x]) == float(h[y]):
        field[x] += 1
        field[y] += 1
count = 0
for f in field:
    if f == 0:
        count+=1
print(count)


Measured memory_bytes: 17736
#include<bits/stdc++.h>
#define maxn 2000005
using namespace std;
const int mod = 1e9+7;
int X[7],Y[7],fac[maxn],inv[maxn],ans;
struct node{int x,y,f;}p[9];
inline int C(int n,int m){return 1ll*fac[n]*inv[m]%mod*inv[n-m]%mod;}
inline int F(int a,int b,int c,int d){return C(c+d-a-b,c-a);}
int solve(node s,node t){
	int ret=0;
	for(int x=X[3];x<=X[4];x++){
		ret=(ret-1ll*F(s.x,s.y,x,Y[3]-1)*F(x,Y[3],t.x,t.y)%mod*(x+Y[3]))%mod;
		ret=(ret+1ll*F(s.x,s.y,x,Y[4])*F(x,Y[4]+1,t.x,t.y)%mod*(x+Y[4]+1))%mod;
	}
	for(int y=Y[3];y<=Y[4];y++){
		ret=(ret-1ll*F(s.x,s.y,X[3]-1,y)*F(X[3],y,t.x,t.y)%mod*(X[3]+y))%mod;
		ret=(ret+1ll*F(s.x,s.y,X[4],y)*F(X[4]+1,y,t.x,t.y)%mod*(X[4]+y+1))%mod;
	}
	return ret*s.f*t.f;
}
int main()
{
	for(int i=1;i<=6;i++) scanf("%d",&X[i]);
	for(int i=1;i<=6;i++) scanf("%d",&Y[i]);
	fac[0]=fac[1]=inv[0]=inv[1]=1;
	for(int i=2;i<maxn;i++) fac[i]=1ll*fac[i-1]*i%mod,inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;
	for(int i=2;i<maxn;i++) inv[i]=1ll*inv[i]*inv[i-1]%mod;
	p[1]=(node){X[1]-1,Y[1]-1,1},p[2]=(node){X[1]-1,Y[2],-1},p[3]=(node){X[2],Y[1]-1,-1},p[4]=(node){X[2],Y[2],1};
	p[5]=(node){X[6]+1,Y[6]+1,1},p[6]=(node){X[6]+1,Y[5],-1},p[7]=(node){X[5],Y[6]+1,-1},p[8]=(node){X[5],Y[5],1};
	for(int i=1;i<=4;i++) for(int j=5;j<=8;j++) ans=(ans+solve(p[i],p[j]))%mod;
	printf("%d\n",(ans+mod)%mod);
}

Measured memory_bytes: 15872
import math

N, D = map(int, input().split())
xy = [list(map(int, input().split())) for i in range(N)]
ans = 0

for i in range(N):
  if math.sqrt(xy[i][0] * xy[i][0] + xy[i][1] * xy[i][1]) <= D:
    ans += 1
    
print(ans)

Measured memory_bytes: 45284
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.logging.LoggingMXBean;

/**
 * @author wuyue
 *
 */
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long m = sc.nextLong();
		long k = sc.nextLong();
		
//		int nn = (int) Math.sqrt(n);
//		int mm = (int) Math.sqrt(m);
//		int kk = (int) Math.sqrt(k);
//		if (nn + mm < kk) {
//			System.out.println("Yes");
//		} else {
//			System.out.println("No");
//		}
		 
		if (k - m- n>0) {
			if (((k-m-n) *(k-m-n) - 4*n*m) > 0) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} else {
				System.out.println("No");
		}
		
		
		
	}

}


Measured memory_bytes: 21972
/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fill(x,c) memset(x,c,sizeof(x))
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get_be(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
//get_be biger & equal
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const ll oo=1e9+10;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll n;
void solve(){
	cin>>n;
	string s;
	cin>>s;
	char c = s[0];
	int ans=1;
	rep(i,1,n){
		if(s[i]!=s[i-1]){
			ans++;
			c = s[i];
		}
	}
	cout<<ans;
}
int main() {
	//ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}





Measured memory_bytes: 512
N,M,X = map(int,input().split())
C = [list(map(int,input().split())) for i in range(N)]
# print(C)

ans = [10**9]
index = 0
score = [0]*M
coin = 0
import copy

def rec(index,coin,score):
    # print(score,index)
    if index > N-1:
        f = True
        for i in range(M):
            if score[i] < X:
                f = False
        if f:
            # print(score)
            # print(score)
            ans[0] = min(ans[0],coin)

        return 1
    
    
    # rec(index+1,coin,score)
    score1 = copy.deepcopy(score)
    rec(index+1,coin,score1)

    for i in range(M):
        score1[i] += C[index][i+1]
    # print("a")
    # print(score1,C[index])
    rec(index+1,coin+C[index][0],score1)
    # print("b")
    return 1


rec(index,coin,score)

if ans[0]==10**9:
    ans[0] = -1
print(ans[0])

Measured memory_bytes: 9364
import std.stdio, std.string, std.conv, std.range, std.algorithm;

void main() {
  auto s = readln.chomp;
  char[] line;

  foreach (c; s) {
    if (c == 'B' && line.length > 0) {
      line = line.dropBackOne;
    } else if (c == '0' || c == '1') {
      line ~= c;
    }
  }

  line.writeln;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp> 
//using namespace boost::multiprecision; 
using namespace std;
#define ll long long int
#define ld long long double
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define nl '\n'
#define mp make_pair
#define debug1(x) cout <<#x<<" "<<x<<'\n';
#define debug2(x,y) cout <<#x<<" "<<x <<" "<<#y<<" "<<y <<'\n';
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<'\n';
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define inf 1e18
const int mod = (int)1e9+7;
pair<ll,ll>s4[4]={{-1,0},{1,0},{0,-1},{0,1}};
pair<ll,ll>s8[8]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,1},{1,0},{1,-1}};

void solve() {
	int a,b;
	cin >> a >>b;
	int mi = INT_MAX;
	for(int i=1;i<=10000;i++) {
		if(floor((double)i*0.08)==a && floor((double)i*0.1)==b) {
			mi = min(mi,i);
		}
	}
	if(mi < INT_MAX)
		cout << mi <<endl;
	else{
		cout << "-1"<<endl;
	}
}

signed main() {
	boost;
	solve();
}

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

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

            for (int i = 1; i < N; i++)
            {
                Console.WriteLine(string.Join(" ", A.Select(n => n.ToString()).ToArray<string>()));

                var v = A[i];
                var j = i - 1;

                while (j>=0 && A[j]>v)
                {
                    A[j + 1] = A[j];
                    j--;
                }
                A[j + 1] = v;
            }
            Console.WriteLine(string.Join(" ", A.Select(n => n.ToString()).ToArray<string>()));
        }
    }
}

Measured memory_bytes: 9684
import java.util.Scanner;
public class Main {
		
		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int res = 0;
			String s = sc.next();
			if(n%2!=0)
				System.out.println("No");
			else {
			for(int i = 0; i<n/2;i++) {
				if(s.charAt(i)!=s.charAt(n/2+i)) {
					res++;
				}
			}
			if(res==0) {
				System.out.println("Yes");
			}
			else
				System.out.println("No");
			
			sc.close();
		}
	}
	public static void main(String[] args) {
		solve();

	}

}

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

int main(){
  vector<int> A(5),B(5),C(5);
  int k=0;
  for(int i=0;i<5;i++){
    cin>>A.at(i);
    B.at(i)=(A.at(i)-1)%10;
    if(B.at(i)<B.at(k)){
      k=i;
    }
    C.at(i)=((A.at(i)-1)/10+1)*10;
  }
  int ans=0;
  for(int i=0;i<5;i++){
    if(i==k){
      ans+=A.at(i);
    }else{
      ans+=C.at(i);
    }
  }
  cout<<ans<<endl;


}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <set>
#include <iomanip>
using namespace std;

typedef long long ll;

int main()
{
    ll N;
	cin >> N;
	vector<ll> A(N);
	ll ans=0;
	for(int i=0; i<N; i++){
		cin >> A[i];
		ans+=A[i]-1;
	}
	cout << ans << endl;
    

    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader reader = new BufferedReader((new InputStreamReader(System.in)));
        String[] l = reader.readLine().split(" ");
        int N = Integer.parseInt(l[0]);
        int M = Integer.parseInt(l[1]);
        String res="";
        if(N>M){
            for(int i= 0;i<N;i++){
                res=res+Integer.toString(M);
            }
        }
        else{
            for(int i= 0;i<M;i++){
                res=res+Integer.toString(N);
            }
        }
        System.out.println(res);
    }
}


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

int main() {
    int K, A, B;
    cin >> K >> 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: 3636
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
// 217
// 44

using namespace std;

const int INF = (int) 1e9;
const int MAXN = 1000;
const int MAXW = 5000;

vector <int> g[MAXN + 1];
int w[MAXN + 1];

int dp[MAXN + 1]; // min g pt cealalta cul
int aux[MAXW + 1][2];

void dfs(int nod) {
    for(auto it : g[nod]) {
        dfs(it);
    }
    if(g[nod].empty()) {
        return ;
    }
    int j;
    dp[nod] = INF;
    int cur = 1;
    aux[0][0] = 0;
    for(j = 1; j <= MAXW; j++) {
        aux[j][0] = INF;
    }
    for(auto it : g[nod]) {
        for(j = MAXW; j >= 0; j--) {
            aux[j][cur] = INF;
            if(j >= w[it])
                aux[j][cur] = min(aux[j][cur], aux[j - w[it]][1 - cur] + dp[it]);
            if(j >= dp[it])
                aux[j][cur] = min(aux[j][cur], aux[j - dp[it]][1 - cur] + w[it]);
        }
        cur = 1 - cur;
    }
    for(j = 0; j <= w[nod]; j++) {
        dp[nod] = min(dp[nod], aux[j][1 - cur]);
    }
}

int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int i, n;
    ios::sync_with_stdio(false);
    cin >> n;
    for(i = 2; i <= n; i++) {
        int p;
        cin >> p;
        g[p].push_back(i);
    }
    for(i = 1; i <= n; i++) {
        cin >> w[i];
    }
    dfs(1);
    if(dp[1] < INF) {
        cout << "POSSIBLE";
    }
    else {
        cout << "IMPOSSIBLE";
    }
    //cin.close();
    //cout.close();
    return 0;
}


Measured memory_bytes: 384
import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	long[] ds = readln.chomp.split.map!(to!long).array;
	
	long a = ds[0], b = ds[1], c = ds[2];
	
	long ans;
	if(a % 2 == 0 || b % 2 == 0 || c % 2 == 0) ans = 0;
	else ans = min(a * b, a * c, b * c);
	
	ans.writeln;
	}

Measured memory_bytes: 256
#include<cstdio>

int main(void){
    int result = 0;
    char s[4];

    scanf("%s", s);
    for(int i = 0; i < 3; i++){
        result += s[i] == '1' ? 1 : 0;
    }
    printf("%d\n", result);

    return 0;
}

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

#define int long long
#define reps(i,s,n) for(ll (i)=(s);(i)<(ll)(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) reps(i,0,n+1)
#define repst(i,s,n) reps(i,s,n+1)
#define reprt(i,n,t) for(ll (i)=(n);(i)>=t;--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb emplace_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define dbg(x) cout<<#x" = "<<(x)<<ln
#define dbga(x,n) for(int (i)=0;i<n;++i){cout<<x[i]<<(i==n-1?'\n':' ');}

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<ld> vld;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

// まず関数fはx1^i * x2^j * x3^k * ... (i+j+k+... = c)のi,j,k,...全通りの組み合わせの和
// 例えばn==3のときx=x1, y=x2, z=x3とすると x^3+y^3+z^3 + x^2y+x^2z+y^2x+y^2z+z^2x+z^2y + xyz
// dp[k][l]: k番目まででl個の飴を配ったときのxi^aiの総和 とおくと
// a==bのとき dp[k+1][l+m] = Σ dp[k][l+p] * a[i]^p (p = 0,1,...,m)
// a!=bのとき dp[k+1][l+m] = Σ dp[k][l+p] * (a[i]^p + (a[i]+1)^p + ... + b[i]^p)
// 一番最後のかっこ内は事前計算しとく

int n, c, a[429], b[429], s[429][429], sp[429][429], dp[429][429];

signed main() {
	cin >> n >> c;
	rep(i,n) cin >> a[i];
	rep(i,n) cin >> b[i];
	// sp[i][j] = i^j
	// s[i][j] = 0^j + 1^j + ... + (i-1)^j
	sp[0][0] = 1;
	repst(i,1,400) {
		sp[i][0] = 1;
		rep(j,400) sp[i][j+1] = sp[i][j]*i %mod;
	}
	rept(j,400) rept(i,400) s[i+1][j] = (s[i][j] + sp[i][j]) %mod;
	dp[0][0] = 1;
	// i番目まででx個配った状態 -> i+1番目まででx+y個配った状態 という遷移
	rep(i,n) rept(x,c) rept(y,c-x) {
		ll p = (s[b[i]+1][y] + mod - s[a[i]][y]) %mod;
		dp[i+1][x+y] = (dp[i+1][x+y] + dp[i][x]*p) %mod;
	}
	cout << dp[n][c] << ln;
}

Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<list>
#include<queue>
#include<string.h>
#include<functional>
#include<stack>
#include<deque>
#include<string>
#include<limits.h>
#include<map>
#include<set>
#include<unordered_map>
#include<cmath>
#include<unordered_set>
#define int long long
#define mod 1000000007
using namespace std;

int dp[1001][1001];//i人以下のグループを使ってj人をグループにした
vector<int>C[1001];//i人からj人選ぶ方法
int p(int a, int b) {
	int c = 1;
	while (b > 1) {
		if (b & 1)c = c*a%mod;
		a = a*a%mod;
		b >>= 1;
	}
	return a*c%mod;
}
signed main() {
	C[0].push_back(1);
	for (int i = 1; i <= 1000; i++) {
		C[i].push_back(1);
		for (int j = 1; j < i; j++) {
			C[i].push_back((C[i - 1][j - 1] + C[i - 1][j])%mod);
		}
		C[i].push_back(1);
	}
	int N, a, b, c, d; cin >> N >> a >> b >> c >> d;
	dp[a - 1][0] = 1;
	for (int i = a; i <= b; i++) {//i人のグループを使う
		for (int j = 0; j <= N; j++) {//j人をグループにした
			int n = 1, m = 1;
			for (int k = 0; k <= (N - j) / i; k++) {
				if (k) {
					n *= C[N - j - i*(k - 1)][i]; n %= mod;
					m *= k; m %= mod;
				}
				if (k == 0 || (k >= c&&k <= d)) {
					dp[i][j + i*k] = (dp[i][j + i*k] + dp[i - 1][j]*n%mod*p(m,mod-2)) % mod;
				}
			}
		}
	}
	cout << dp[b][N] << endl;
}

Measured memory_bytes: 13440
s=input()
n=len(s)-1
l=[]
l3=[]
Sum=0
for i in range(2**n):
  bag=[" "]*n
  #print("pattern:",i)
  for j in range(n):
    if ((i>>j) & 1):
      bag[j]="+"
  l.append(bag)
#print(l)

for b in l:
  ll=[]
  inc=0
  for ii in range(n):
    if b[ii] == "+":
      ll.append(int(s[inc:ii+1]))
      inc=ii+1
  ll.append(int(s[inc:len(s)]))
  #print(ll)
  Sum+=sum(ll)
print(Sum)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 2e5+9, INF = 0x3f3f3f3f;
int dt[105], v[105];

int main( void ) {
    ios::sync_with_stdio( false );
  	int n;
  	cin >> n;
  	cout << n * n * n << '\n';
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pair<ll,ll>> vii;
typedef vector<vii> vvii;
typedef pair<ll,ll> ii;

#define pb push_back
#define mp make_pair
#define sz(vs) (ll)(vs.size())
#define rep(i,a,b) for (ll i=a;i<b;i++)
#define iter(i,c) for (auto i:c)
#define ss second
#define ff first
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define DEBUG2(x,a) cout << '>' << #x << ':' << x << " >" << #a << ':' << a <<  endl;
#define DEBUG3(x,a,b) cout << '>' << #x << ':' << x << " >" << #a << ':' << a << " >" << #b << ':' << b << endl;
#define DEBUG4(x,a,b,c) cout << '>' << #x << ':' << x << " >" << #a << ':' << a << " >" << #b << ':' << b << " >" << #c << ':' << c << endl;
#define printstr(a,st,e,s) if (st<e) {cout<<s<<a[st];rep(noname,st+1,e) cout<<""<<a[noname];}cout<<"\n"
#define printarr1(a,st,e,s) if (st<e) {cout<<s<<a[st];rep(noname,st+1,e) cout<<" "<<a[noname];}cout<<'\n'
#define printarr(a,st,e,s) cout<<s<<": [";if (st<e) {cout<<a[st];rep(noname,st+1,e) cout<<", "<<a[noname];}cout<<"]\n"
#define printus(c,s) cout<<s<<": {";for (auto noname:c) cout<<noname<<",";cout<<"}\n"
#define printum(c,s) cout<<s<<": {";for (auto noname:c) cout<<noname.first<<":"<<noname.second<<", ";cout<<"}\n"
#define MAXN 10000007
#define mod 1000000007
 
ll n, m, k, a[MAXN], f[MAXN], spf[MAXN];
string s,s1;
char c;

void fill() {
	memset(spf,0,sizeof(spf));
	spf[1] = 1;
	rep(i,2,MAXN) {
		if (spf[i]) continue;
		spf[i] = i;
		rep(j,i,MAXN/i+1) {
			if (spf[i*j]) continue;
			spf[i*j] = i;
		}
	}
	a[1] = 1;
	rep(i,2,MAXN) {
		ll temp = i/spf[i];
		if (spf[temp] == spf[i]) a[i] = a[temp] + 1;
		else a[i] = 1;
	}
	f[1] = 1;
	rep(i,2,MAXN) {
		ll temp = i/spf[i];
		f[i] = f[temp]/(a[i])*(a[i]+1);
	}
}

void solve() {
	cin>>n;
	ll ans = 0;
	for (ll i = n; i>0; --i) {
		ans += f[i]*i;
	}
	cout<<ans<<endl;
}
 
void aux() {
	fill();
}
 
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	aux();
	ll _ = 1;
	// cin>>_;
	while(_--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 238016
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound, __gcd, count, find, next_permutation
#include <bitset>    // bitset
#include <deque>     // deque
#include <iomanip>   // setprecsion
#include <iostream>  // cout, endl, cin
#include <map>       // map
#include <queue>     // queue, priority_queue
#include <set>       // set
#include <stack>     // stack
#include <string>    // string, to_string, stoi
#include <tuple>     // tuple, make_tuple
#include <utility>   // pair, make_pair
#include <vector>    // vector

#include <cassert> // assert
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>  // abs, sin, cos, tan
#include <ctime> // clock

// __builtin_popcountll

using namespace std;
using Graph = vector<vector<int>>;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

void Main()
{
  ll a, b; cin >> a >> b;
  ll mouse = 1;
  ll i = 0;
  while(1)
  {
    if(mouse >= b) fin(i);
    mouse += a - 1;
    i++;
  }
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  //cout << setfill('0') << internal << setw(4); 0埋め４桁
  Main();
  return 0;
}

Measured memory_bytes: 256