akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const long long M =2e5+2,MOD=1e9+7;
typedef long long ll;
#define pb push_back
#define Y printf("YES\n")
#define N printf("NO\n")
#define O printf("-1\n")
bool f_2=false,vis[M]= {false},f=false;
vector<ll>v[M],v_1,v_2;
string s,p,q,ok,ch;
map<ll,ll>mp,mp_2;
set<ll>st,st_1;
ll parent[M],subtree[M]={0};
ll cnt=0,cost=0,mx=0,NODE,t,par,zero=0,pos=0,neg=0;
//deque<ll>Q;
//vector< pair<ll,ll > >v,v_1;
struct node
{
    ll pa,ran,visit;

};
//node X[M];
void dfs(ll i,ll val)
{
   vis[i]=true;
   subtree[i]=val;
   for(ll j=0;j<v[i].size();j++)
   {
       ll d=v[i][j];
       if(!vis[d])
       {
           dfs(d,subtree[d]+val);
       }
   }
}
int main()
{
    ios::sync_with_stdio(false);//ISHWAR
    cin.tie(0);//Tourist_Twin
    //freopen("kamona.txt","r",stdin);
    ll a,b,c,n,t,sum=0,mx=0,l,x,y,i=0,j=0,res,m,second=0,d;
    cin>>n>>t;
    for(i=0;i<n-1;i++)
    {
        cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    for(i=0;i<t;i++)
    {
        cin>>x>>y;
        subtree[x]+=y;
    }
   for(i=1;i<=n;i++)
   {
       if(!vis[i])
       {
           dfs(i,subtree[i]);
       }
   }
    for(i=1;i<=n;i++)
        cout<<subtree[i]<<" ";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 25600
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <bitset>
#include <tuple>
#include <cmath>
#include <complex>
#include <algorithm>
#include <utility>
#include <regex>
#include <cstdint>
#include <numeric>
#include <functional>
#include <cassert>

using namespace std;
using ll = int64_t;
using ull = uint64_t;

constexpr ll INF = 1'000'000'000'000'000'000;
namespace utils{
    template<class T, class Compare> using p_queue = priority_queue<T, vector<T>, Compare>;
    template<class T> using min_queue = p_queue<T, greater<T>>;
    template<class T> using max_queue = p_queue<T, less<T>>;

    template<class T> bool min_update(T& X, const T& A){ if(X > A) {X = A; return true;} return false; }
    template<class T> bool max_update(T& X, const T& A){ if(X < A) {X = A; return true;} return false; }
    using V_Set = unordered_set<int>;
    using E_Set = unordered_map<int, V_Set>;

#define ALL(x) begin(x), end(x)
#define rALL(x) rbegin(x), rend(x)
}
using namespace utils;

void sub_main(istream &is) {
    string S;
    is >> S;
    if(!is) return;
    reverse(ALL(S));

    constexpr ll MOD = 1'000'000'007;
    ll dig = 1;
    vector<array<ll, 13>> dp(S.size()+1);
    dp[0][0] = 1;

    for (int i = 0; i < S.size(); ++i) {
        for (int j = 0; j < 13; ++j) {
            if(S[i] == '?') {
                for (int k = 0; k < 10; ++k) {
                    ll f = k * dig;
                    f %= 13;
                    ll g = j - f + 13;
                    g %= 13;
                    dp[i + 1][j] += dp[i][g];
                } // end k
            }
            else{
                ll k = S[i] - '0';
                ll f = k * dig;
                f %= 13;
                ll g = j - f + 13;
                g %= 13;
                dp[i+1][j] += dp[i][g];
            }
            dp[i+1][j] %= MOD;
        } // end j
        dig *= 10;
        dig %= 13;
    } // end i

    cout << dp.back().at(5) << endl;

}

int main(int argc, char *argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(16) << scientific;
#ifdef DEBUG
    string test_cases = "test_D.txt";
    cerr << "DEBUG MODE" <<  endl;
    cerr << test_cases << " -->" << endl;
    auto fs = fstream(test_cases, fstream::in);
    int lp = 0;
    while(fs) {
        lp++;
        cout << lp <<  "#------\n";
        sub_main(fs);
    }
    cout << "------#" << endl;
    if(lp <= 1) sub_main(cin);
#else
    sub_main(cin);
#endif
    return 0;
}


Measured memory_bytes: 10704
#include<iostream>
#include<cmath>
using namespace std;
typedef long long ll;
int main(void)
{
     long double a,b,c;

     cin>>a>>b>>c;
     long double eps= 1.0E-14;
     if(sqrt(a) +sqrt(b) + eps <sqrt(c))
     {

         cout<< "Yes" <<endl;
         }
     else
        {
            cout<< "No" <<endl;
     }
     return 0;

     }


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
using namespace std;
int main(void){
  int X;
  cin>>X;
  
  int sum=1,max=1;
  max=0;
  for(int i=2;i<32;i++){sum=1;int ans=0;
      while(sum*i<=X){sum=sum*i; ans++;}
      if(max<sum&&ans!=1) max=sum;
  }
  cout<<max;
  return 0;
}


Measured memory_bytes: 256
use std::io;


fn main() {
    let s = read_one::<String>().chars()
        .collect::<Vec<_>>();
    let t = read_one::<String>().chars()
        .collect::<Vec<_>>();

    let ans = s.iter().zip(&t)
        .filter(|(a, b)| a != b)
        .count();
    println!("{}", ans);
}


#[allow(unused)]
fn read<T>() -> Vec<T>
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}


#[allow(unused)]
fn read_one<T>() -> T
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}


Measured memory_bytes: 3872
#include <bits/stdc++.h>
using namespace std;
#define MAXN 114514

long long N, K;
long long h[MAXN];
long long dp[MAXN];

int main() {
	ios::sync_with_stdio(false);
	memset(h, 0, sizeof(h));
	memset(dp, 127, sizeof(dp));
	cin >> N >> K;
	for(long long i=0; i<N; i++) {
		cin >> h[i];
	}
	dp[0] = 0;
	for(long long i=0; i<N; i++) {
		for(long long j=1; j<=K; j++) {
			if(j<=i) {
				const long long f = i - j;
				const long long cost = llabs(h[i]-h[f]);
				const long long ndp = dp[f] + cost;
				dp[i] = min(ndp, dp[i]);
			}
		}
	}
	cout << dp[N-1] << "\n";
	return 0;
}


Measured memory_bytes: 2048
#include <iostream>
#include <cmath>
using namespace std;
 
int main(){
  long long n, d;
  cin >> n >> d;
  long long x = 0;
  long long y = 0;
  int count = 0;
  for(int i = 0; i < n; ++i){
    cin >> x >> y;
    if(x * x <= d * d - y * y){
     ++count; 
    }
  }
  cout << count << endl;
  
  
  
  return 0;
}

Measured memory_bytes: 3632
#include<iostream>


int func(int K,int S)
{
	int count = 0;
	if (S < K * 1.5)
	{
		for (int x = 0; x <= K; ++x)
		{

			for (int y = 0; y <= K; ++y)
			{
				if (S - x - y >= 0 && S - x - y <= K)
					count++;
				if (S - x - y < 0)
					break;
			}
		}
	}
	else
	{
		for (int x = K; x >=0; --x)
		{

			for (int y = K;  y>=0; --y)
			{
				if (S - x - y >= 0 && S - x - y <= K)
					count++;
				if (S - x - y > K)
					break;
			}
		}

	}

	return count;

	
}
int main()
{
	int K,S;
	std::cin >> K >> S;

	
	std::cout<<func(K,S);
	return 0;
}



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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  int n; cin>>n;
  cout<<(n*n*n)<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct ZJ {
  int v, w;
  long long date;
  char type;
  string name;
  bool operator<(const ZJ &that) const {
    if (v != that.v)
      return v < that.v;
    if (w != that.w)
      return w < that.w;
    if (type != that.type)
      return type < that.type;
    if (date != that.date)
      return date < that.date;
    return name < that.name;
  }
};
int main() {
  int n;
  cin >> n;
  vector<ZJ> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].v >> v[i].w >> v[i].type >> v[i].date >> v[i].name;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) {
    cout << v[i].v << " " << v[i].w << " " << v[i].type << " " << v[i].date
         << " " << v[i].name << endl;
  }
}


Measured memory_bytes: 12176
import java.util.Scanner;

class Main{
	static final long MOD = 1000000007;

	static int H, W, K;
	static long[][] dp = new long[110][10];
	static int ans = 0;
	static long n = 0;


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		n = sc.nextLong();
		int[] p = {2,3,5,7,11,13,17,19, 23 ,29, 31, 37, 41, 43, 47};
		int[] a = new int[15];
		int c2 = 0;
		int c4 = 0;
		int c14 = 0;
		int c24 = 0;
		int c74 = 0;
		for(int i =2;i <= n;i++){
			int d = i;
			for(int j = 0;j < 15;j++){
				while(d%p[j] == 0){
					a[j]++;
					d /= p[j];
				}
			}
		}
		int a3 = 0;
		int a5 = 0;
		int a15 = 0;
		int a25 = 0;
		int a75 = 0;

		for(int i=0; i<15; i++) {		//合計でべき乗が何個あるかカウント
			if(a[i] >= 74) a75++;
			if(a[i] >= 24) a25++;
			if(a[i] >= 14) a15++;
			if(a[i] >= 4) a5++;
			if(a[i] >= 2) a3++;
		}

		int res = 0;

		res += a75;
		res += a25 * (a3 - 1);			//合計で75になる組み合わせの数
		res += a15 * (a5 - 1);
		res += (a5 * (a5-1) / 2) * (a3 - 2);
		System.out.println(res);
	}

}







class Pair implements Comparable{
	int from;		//p
	int end;		//y
	int num;
	int bango;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return end - otherpair.end;
	}
}


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

int g(int a,int b){
  int n;
  if(b==0)return a;
  while(a%b!=0){
    n=a%b;
    a=b;
    b=n;
  }
  return b;
}

int main(){
  int i,j,cnt=0;
  int n;
  cin>>n;
  int a[n];
  for(i=0;i<n;i++)cin>>a[i];
  if(n==2){
    cout<<max(a[0],a[1]);
    return 0;
  }
  int b[n],c[n];
  b[0]=0;
  for(i=1;i<n;i++)b[i]=g(b[i-1],a[i-1]);
  c[n-1]=0;
  for(i=n-2;i>=0;i--)c[i]=g(c[i+1],a[i+1]);
  int ma=0;
  for(i=0;i<n;i++)ma=max(ma,g(b[i],c[i]));
  cout<<ma;
}

Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <array>

using namespace std;

int main(int argc, char const *argv[])
{
	/* code */
	array<int,3> bell;

	for (int i = 0; i < 3; ++i)
	{
		int tmp;
		cin >> tmp;
		bell[i] = tmp;
	}

	sort(bell.begin(),bell.end());

	cout << bell[0]+bell[1] << endl;

	return 0;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

const int MOD = 1000000007;

const ll INF = 1001002003004005006ll;
ll dp[305][305];

int main() {
    int N, K;
    cin >> N >> K;
    int m = N - K;
    vector<int> h(N);
    rep(i, N) cin >> h[i];
    h.insert(h.begin(), 0);

    // dp[i][j] i個目までの要素を見てi個目を残す,j個残すときの最小コスト
    rep(i, N + 1) rep(j, m + 1) dp[i][j] = INF;
    dp[0][0] = 0;

    for (int i = 1; i <= N; i++) { // i:使用する要素
        rep(j, m) { // j: iを使うとき,それまで使用した要素の個数
            ll now = INF;
            rep(k, i) { // k: iの直前の要素がkだった場合
                chmin(now, dp[k][j] + max(0, h[i] - h[k])); // iの直前の壁がkだった場合,iを追加するコストは h[i] - h[k]
            }
            dp[i][j + 1] = now;
        }
    }

    ll ans = INF;
    rep(i, N + 1) chmin(ans, dp[i][m]);
    cout << ans << endl;
}


Measured memory_bytes: 1024
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect, string, copy
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
mod = 10**9+7
ans = count = 0; pro = 1

n=int(input())
s=list(map(int,input()))
S=set()
checked=[0]*10
# print(s)
# print(checked)
for i in range(n):
    # print(s,3456)
    # print(s[i])
    # print(checked[0])
    if not checked[s[i]]:

        C=[[0]*10 for h in range(10)]
        past=[0]*10
        for j in range(i+1,n):

            for k in range(10):
                if past[k] and C[k][s[j]]==0:
                    C[k][s[j]]+=1
            past[s[j]]=1
        for l in range(10):
            for t in range(10):
                if C[l][t]:
                    S.add(str(s[i])+str(l)+str(t))
        checked[s[i]]=1
        # for r in C:
        #     print(r)
# print(S)
print(len(S))

        
            
        
        
        
        


Measured memory_bytes: 43116
#include <iostream>
#include<string>
using namespace std;
string a[185714];
int y[185714] = {};
int cnt = 0;
int main() {
	for (int i = 0; i < 114514; i++) { cin >> a[i];
	if (a[i] == "0") { break; }
	cnt++;
	}
	for (int i = 0; i < cnt; i++) {
		for (int j = 0; j < a[i].size(); j++) {
			if (a[i][j] == '1') { y[i] += 1; }
			else if (a[i][j] == '2') { y[i] += 2; }
			else if (a[i][j] == '3') { y[i] += 3; }
			else if (a[i][j] == '4') { y[i] += 4; }
			else if (a[i][j] == '5') { y[i] += 5; }
			else if (a[i][j] == '6') { y[i] += 6; }
			else if (a[i][j] == '7') { y[i] += 7; }
			else if (a[i][j] == '8') { y[i] += 8; }
			else if (a[i][j] == '9') { y[i] += 9; }
		}
	}
	for (int i = 0; i <cnt ; i++) {
		cout << y[i] << endl;
	}
}



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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
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; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }

ll cnt[10];
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N; cin >> N;
    string S; cin >> S;
    int ans = 0;
    rep(i, 1000) {
        string s = to_string(i);
        while(s.size() < 3) {
            s.insert(0, "0");
        }
        int k = 0;
        rep(j, N) {
            if (S[j] == s[k]) {
                k++;
            }
            if (k == 3) {
                ans++;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main()
{
    int n;

    while (cin >> n, n) {
        while (n--) {
            int pm, pe, pj;

            cin >> pm >> pe >> pj;

            if (pm == 100 || pe == 100 || pj == 100) 
                cout << 'A';
            else if ((pm + pe) / 2.0 >= 90) 
                cout << 'A';
            else if ((pm + pe + pj) / 3.0 >= 80)
                cout << 'A';
            else if ((pm + pe + pj) / 3.0 >= 70)
                cout << 'B';
            else if ((pm + pe + pj) / 3.0 >= 50 && (pm >= 80 || pe >= 80))
                cout << 'B';
            else 
                cout << 'C';
            cout << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 1152
#[allow(unused)]
use std::cmp::{max, min};
use std::io;
use std::io::{BufRead, Read, Write};
use std::str::FromStr;

#[allow(unused, non_snake_case)]
pub fn solve<R: BufRead, W: Write>(mut io: Io<R, W>) {
    let N: isize = io.next();
    let A: isize = io.next();
    let B: isize = io.next();

    let train = N * A;
    let taxi = B;
    let res = min(train, taxi);
    io.println(res);
}

#[allow(dead_code)]
fn main() {
    let stdin = io::stdin();
    let stdin_lock = stdin.lock();
    let stdout = io::stdout();
    let stdout_lock = stdout.lock();

    let io = Io {
        reader: stdin_lock,
        writer: stdout_lock,
    };

    solve(io);
}

/* IO helpers */

pub struct Io<R, W>
where
    R: BufRead,
    W: Write,
{
    pub reader: R,
    pub writer: W,
}

#[allow(dead_code)]
impl<R, W> Io<R, W>
where
    R: BufRead,
    W: Write,
{
    fn println<T: std::fmt::Display>(&mut self, value: T) {
        writeln!(&mut self.writer, "{}", value).expect("Unable to write");
    }

    fn print<T: std::fmt::Display>(&mut self, value: T) {
        write!(&mut self.writer, "{}", value).expect("Unable to write");
    }

    fn next<T: FromStr>(&mut self) -> T {
        let token = self
            .reader
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok().expect("Unable to parse")
    }
}


Measured memory_bytes: 4476
A,B = map(int, input().split())

ans = 0
stride = 2
fcnt = 0
a,b = A,B
if b % 2 ==  1:
  fcnt += 1
  b -= 1
if a % 2 == 1:
  fcnt += 1
  a += 1
fcnt += (b-a+1)//2
if fcnt % 2 == 1:
  ans |= 1

#print("2 ans: ", ans)
#exit(0)

for i in range(50):
  stride <<= 1
  #print("stride: ", stride)
  a,b = A,B
  cnt = 0
  
  #print("\t a%stride :",  a%stride , "stide//2: ", stride//2)
  if a%stride >= stride // 2: #Aが後半にいる
    #print("\tA if after!")
    cnt += stride - (a%stride)
    a   += stride - (a%stride)
    #print("\tnew A: ", a)
  else: # Aが前半にいるときは、頭に戻す
    a -= (a%stride)
  #print("\tnew A: ", a)
  if b % stride >= stride // 2: # Bが後半にいる
    # cnt -= stride - (b%stride)
    cnt += ((b%stride))+1
    b += stride - (b%stride)
  else:# Bが前半にいる
    b -= b %stride
  #print("\tnB: ", b)
  #print("\tcnt: ", cnt)
  if cnt % 2 == 1:
    ans |= stride//2 
  # cnt += (b-a)//stride
print(ans)

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.AbstractMap;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		solve(sc, out);
		
		out.flush();
	}
	
	public static void solve(FastScanner sc, PrintWriter out){
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		out.println(Math.max(a+b, Math.max(a*b, a-b)));
	}

	public static int gcd(int a, int b) {
		if(a < b) return gcd(b, a);
		if(b == 0) return a;
		return gcd(b, a % b);
	}
}

class Pair<K, V> extends AbstractMap.SimpleEntry<K, V> {

    public Pair(final K key, final V value) {
        super(key, value);
    }
 }

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
     }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    }
}

Measured memory_bytes: 23508
fun main(args: Array<String>) {
    abc047b()
}

// 黒く塗らない方向
private enum class Direction { RIGHT, LEFT, ABOVE, BELOW }

private data class Xya(val x: Int, val y: Int, val direction: Direction)

fun abc047b() {
    val (w, h, n) = readLine()!!.split(" ").map { it.toInt() }
    val xyaList = (1..n).map { readLine()!!.split(" ").map { it.toInt() } }
        .map {
            Xya(
                it[0], it[1], when (it[2]) {
                    1 -> Direction.RIGHT
                    2 -> Direction.LEFT
                    3 -> Direction.ABOVE
                    else -> Direction.BELOW
                }
            )
        }

    val left = xyaList.filter { it.direction == Direction.RIGHT }
        .maxBy { it.x }?.x ?: 0
    val right = xyaList.filter { it.direction == Direction.LEFT }
        .minBy { it.x }?.x ?: w
    val below = xyaList.filter { it.direction == Direction.ABOVE }
        .maxBy { it.y }?.y ?: 0
    val above = xyaList.filter { it.direction == Direction.BELOW }
        .minBy { it.y }?.y ?: h

    val answer = Math.max(0, (right - left)) * Math.max(0, (above - below))

    println(answer)
}


Measured memory_bytes: 36112
#include <iostream>

using namespace std;

typedef long long ll;
int main()
{
    int n, k;
    cin >> n >> k;

    ll comb =  1;
    comb *= k;
    for (int i = 2; i <= n; i++) {
        comb *= k - 1;
    }

    cout << comb << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string.h>
#include <iomanip>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <tuple>

using namespace std;

#define INF 100000000;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
#define eps 1.0e-14;

int main(){
    int h1,m1,h2,m2,k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int begintime = h1 * 60 + m1;
    int endtime = h2 * 60 + m2 - k;
    cout << endtime - begintime << endl;
    return 0;
}

Measured memory_bytes: 3636
import sys
bbn=1000000007
	
#+++++

def gcd(a,b):
	if b == 0:
		return a
	return gcd(b, a%b)

def main():
	a, b = map(int, input().split())
	return a*b//gcd(a,b)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

int main(void)
{
    string s;
    cin >> s;
    if (s == "SUN") puts("7");
    if (s == "MON") puts("6");
    if (s == "TUE") puts("5");
    if (s == "WED") puts("4");
    if (s == "THU") puts("3");
    if (s == "FRI") puts("2");
    if (s == "SAT") puts("1");
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main{
	public static void main(String[] args){
		solve();
	}
	public static void solve(){
		Scanner sc = new Scanner(System.in);
		int p = sc.nextInt();
		int q = sc.nextInt();
		if(q%p==0){
			q /= p;
			p = 1;
		}
		boolean[] judge = new boolean[(int)Math.sqrt(1000000000)+5];
		Arrays.fill(judge,true);
		judge[0] = false;
		judge[1] = false;
		boolean flag = false;
		for(int i=2;i<judge.length;i++){
			if(judge[i]){
				if(p%i==0 && q%i==0){
					p /= i;
					q /= i;
					flag = true;
				}
				for(int j=i*2;j<judge.length;j+=i){
					judge[j] = false;
				}
				if(flag){
					flag = false;
					i--;
				}
			}
		}
		for(int i=2;i<judge.length;i++){
			if(judge[i] && q%(i*i)==0){
				q /= i;
				i--;
			}
		}
		System.out.println(q);
	}
}

Measured memory_bytes: 26440
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
typedef complex<D> P;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;


template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,vector<T> &A){ll i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}
template<typename T>vector<T> & cset(vector<T> &A,T e=T()){for(auto &I:A){I=e;} return A;}



int main(){
    const ll MX=256;
    ll n,m;
    while(cin>>n>>m,n){
        vector<ll> C(m);
        cin>>C;
        vector<ll> X(n);
        cin>>X;
        vector<vector<ll>> dp(n+1,vector<ll>(MX,1e15));
        dp[0][MX/2]=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<MX;j++){
                for(int k=0;k<m;k++){
                    ll nx=j+C[k];
                    nx=max(min(nx,MX-1),0LL);
                    dp[i+1][nx]=min(dp[i+1][nx],dp[i][j]+(nx-X[i])*(nx-X[i]));
                }
            }
        }
        ll ans=E;
        for(auto &I:dp.back()){ans=min(ans,I);}
        cout<<ans<<endl;
    }
    
    
    return 0;
}



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

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    N = int(input())
    S = input()

    return N, S


def main(N: int, S: str) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 桁数
        S (str): ラッキーナンバー
    """
    # 求解処理
    ans = 0
    x_bit = [False for n in range(10)]
    for x in range(N):
        S_x = int(S[x])
        if x_bit[S_x]:
            continue
        x_bit[S_x] = True
        y_bit = [False for n in range(10)]
        for y in range(x + 1, N):
            S_y = int(S[y])
            if y_bit[S_y]:
                continue
            y_bit[S_y] = True
            z_bit = [False for n in range(10)]
            for z in range(y + 1, N):
                S_z = int(S[z])
                if z_bit[S_z]:
                    continue
                z_bit[S_z] = True
                ans += 1

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N, S = get_input()

    # メイン処理
    main(N, S)


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

// 二分探索

bool binarySearch(vector<int> &, const int);

int main(int argc, char const *argv[])
{
    int n = 0;
    cin >> n;

    // int elems = 0;
    vector<int> s(n, 0);
    for (int i = 0; i < n; i++)
    {
        cin >> s[i];
        // s.insert(elems);
    }

    int q = 0;
    cin >> q;

    // int elemt = 0;
    vector<int> t(q, 0);
    for (int i = 0; i < q; i++)
    {
        cin >> t[i];
        // t.insert(elemt);
    }

    const int MASTER_SENTINEL = -1;
    t.push_back(MASTER_SENTINEL);

    int c = 0, j = 0;
    while(t[j] != MASTER_SENTINEL) {
        c += static_cast<int>(binarySearch(s, t[j++]));
    }

    cout << c << endl;

    return 0;
}

bool binarySearch(vector<int> &s, const int t)
{
    int lb = 0, rb = s.size() - 1;

    while (rb > lb)
    {
        if (s[(lb + rb) / 2] < t)
        {
            lb = (lb + rb) / 2 + 1;
        }
        else
        {
            rb = (lb + rb) / 2;
        }
    }

    if (s[lb] == t)
    {
        return true;
    }
    else
    {
        return false;
    }
}


Measured memory_bytes: 3504
#!/usr/bin/env python
# coding: utf-8

# In[1]:


N = int(input())


# In[14]:


# N = 4
MOD = 10 ** 9 + 7


# In[15]:


char = ['A', 'C', 'G', 'T']
S = [c1 + c2 + c3 for c1 in char for c2 in char for c3 in char]
S


# In[16]:


ng3 = ['AGC', 'GAC', 'ACG']
ng4 = [c + ng for c in char for ng in ng3] + [ng + c for c in char for ng in ng3] + ['A' + c + 'GC' for c in char] + ['AG' + c + 'C' for c in char]
ng4 = set(ng4)
ng4


# In[17]:


dict1 = {s: 1 if s not in ng3 else 0 for s in S}


# In[18]:


for _ in range(N - 3):
    dict2 = {}

    for s in S:
        val = 0
        for c in char:
            if c + s not in ng4:
                val = (val + dict1[c + s[:2]]) % MOD
        dict2[s] = val
    dict1 = dict2


# In[19]:


ans = 0
for s in dict1.keys():
    ans = (ans + dict1[s]) % MOD
print(ans)


# In[ ]:






Measured memory_bytes: 39664
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <set>
#include <map>

#define FOR0(var, max) for (ul (var) = 0; (var) < (max); ++(var))
#define FORi(var, min, max) for (ul (var) = (min); (var) < (max); ++(var))
#define FORi_INV(var, min, max) for (ul (var) = (max) - 1; (var) + 1 > (min); --(var))
#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))
#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))
#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))
#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;

using sc = signed char;
using si = signed int;
using sl = signed long long int;

const static ui NMAX = 100;
const static ui LiMAX = 100;

static ui N;
static ui Li[2 * NMAX];

void solve(void) {
  sort(begin(Li), end(Li), [](ui a, ui b) {
    return a > b;
  });
  ui res = 0;
  FOR0(i, N) {
    res += Li[2 * i + 1];
  }
  cout << res << endl;
}

int main(void) {
  cin >> N;
  FOR0(i, 2 * N) {
    cin >> Li[i];
  }
  solve();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
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 long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
int trans(char s){
	return (s-'0');
}
int main(){
	int n;
	int ans=0;
	vector<pair<string,string>>data;
	vector<int>table;
	pair<int,int> hash;
	while(1){
	cin >>n;
	data.clear();
	table.clear();
	if(n==0){
		break;
	}
	ans=0;
	table.resize(86410);
	table.assign(86410,0);
	data.resize(n);
	rep(i,n){
		hash=mp(0,0);
		cin>>data[i].F>>data[i].S;//01:34:67
		hash.F+=trans(data[i].F[7]);
		hash.F += 10*trans(data[i].F[6]);
		hash.F += 60*trans(data[i].F[4]);
		hash.F += 600*trans(data[i].F[3]);
		hash.F += 3600*trans(data[i].F[1]);
		hash.F += 36000*trans(data[i].F[0]);

		hash.S += trans(data[i].S[7]);
		hash.S += 10 * trans(data[i].S[6]);
		hash.S += 60 * trans(data[i].S[4]);
		hash.S += 600 * trans(data[i].S[3]);
		hash.S += 3600 * trans(data[i].S[1]);
		hash.S += 36000 * trans(data[i].S[0]);
		table[hash.F]++;
		table[hash.S]--;
	}
	rep(i,86402){
		table[i+1]+=table[i];
		chmax(ans,table[i]);
	}

	cout<<ans<<endl;
	}
}


Measured memory_bytes: 4192
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<class T>
istream& operator >> (istream& is, vector<T>& v)
{
	for (auto &i : v) is >> i;
	return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& v)
{
	const string delimiter = "\n";
	REP(i, v.size())
	{
		os << v[i];
		if (i != v.size() - 1) os << delimiter;
	}
	return os;
}
/*--------------------template--------------------*/

int min_bit(int n)
{
	REP(i, 64)
	{
		if ((n >> i) & 1) return i;
	}
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n; cin >> n;
	vi a(n); cin >> a;
	int x = 0;
	set<int> st;
	for (auto i : a)
	{
		st.insert(min_bit(i));
		x ^= i;
	}
	int ans = 0;
	for (int i = 31; i >= 0; i--)
	{
		if ((x >> i) & 1)
		{
			if (st.count(i))
			{
				ans++;
				x ^= (1 << i) - 1;
			}
			else
			{
				cout << -1 << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
	/*input*/
	char s[4];	cin >> s;
	/*calculation&output*/
	int a = (s[0] - '0')*10 + (s[1] - '0');
	int b = (s[2] - '0')*10 + (s[3] - '0');
	if(a >= 1 && a <= 12){
		if(b >= 1 && b <= 12){
			cout << "AMBIGUOUS" << endl;
		}else{
			cout << "MMYY" << endl;
		}
	}else{ 
		if(b >= 1 && b <= 12){
			cout << "YYMM" << endl;
		}else{
			cout << "NA" << endl;
		} 
	} 
} 


Measured memory_bytes: 256
/*input
2 1 2
*/
/*

author : Avi Mallick
			CSE'15 SUST

*/
#include<bits/stdc++.h>
#define pii                   pair<int,int>
#define tii                   pair<int,pair<int,int> >
#define mkp                   make_pair
#define fs                    first
#define sc                    second
#define pb                    push_back
#define ppb                   pop_back()
#define pcase(x)              printf("Case %d: ",x)
#define hi                    cout<<"hi"<<endl;
#define mod                   1000000007
#define inf                   1000000007
#define pi                    acos(-1.0)
#define mem(arr,x)            memset((arr), (x), sizeof((arr)));
#define FOR(i,x)              for(int i=0;i<(x); i++)
#define FOR1(i,x)             for(int i = 1; i<=(x) ; i++)
#define jora(a,b)             make_pair(a,b)
#define tora(a,b,c)           jora(a,jora(b,c))
#define sf1(a)                scanf("%d",&a)
#define sf2(a,b)              scanf("%d %d",&a,&b)
#define sf3(a,b,c)            scanf("%d %d %d",&a,&b,&c)
#define pf1(a)                printf("%d\n",a);
#define pf2(a,b)              printf("%d %d\n",a,b)
#define pf3(a,b,c)            printf("%d %d %d\n",a,b,c)
#define sf1ll(a)              scanf("%I64d",&a)
#define sf2ll(a,b)            scanf("%I64d %I64d",&a,&b)
#define sf3ll(a,b,c)          scanf("%I64d %I64d %I64d",&a,&b,&c)
#define pf1ll(a)              printf("%I64d\n",a);
#define pf2ll(a,b)            printf("%I64d %I64d\n",a,b)
#define pf3ll(a,b,c)          printf("%I64d %I64d %I64d\n",a,b,c)
#define N 6*100000+5
#define level 26
// #define noya vector< vector<int> >(6,vector<int>(6,0))
// #define mat vector<vector<int> >
// #define m 6
using namespace std;
typedef long long int lint;
typedef double dbl;
int main()
{

    int n;
    int a,b;
    cin>>n>>a>>b;
    if((b-a-1)%2==0)
    	cout<<"Borys\n";
    else cout<<"Alice\n";



	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
	int A, B, C, X;
	cin >> A >> B >> C >> X;

	int ans = 0;
	for (int a = 0; a <= A; a++) {
		for (int b = 0; b <= B; b++) {
			if (500 * a + 100 * b <= X && X <= 500 * a + 100 * b + 50 * C) ans++;
		}
	}

	cout << ans << endl;

	return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll> >;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

ll powmod(ll N, ll K){
    ll ans = 1;
    rep(i, K){
        ans = (ans * N % MOD);
    }
    return ans;
}

void Main() {
    ll N; cin >> N;
    ll ans = 0;
    ans = (ans + powmod(10, N)) % MOD;
    ans = (ans - powmod(9, N)) % MOD;
    ans = (ans - powmod(9, N)) % MOD;
    ans = (ans + powmod(8, N)) % MOD;
    if (ans < 0){ans += MOD;}
    cout << ans << endl;
}

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


Measured memory_bytes: 3652
#include <iostream>
using namespace std;
 
int main(void){
    int n;
    cin >> n;
    int a[101010] = {};
    int l, r;
    for (int i = 0; i < n; i++) {
        cin >> l >> r;
        a[l]++;
        a[r+1]--;
    }
    for (int i = 0; i < n+2; i++) a[i+1] += a[i];
     
    int ans = 0;
    for (int i = 2; i < n+2; i++) {
        if (a[i]+1 >= i) {
            ans = max(ans, i);
        }
    }
    if (ans) ans--;
    cout << ans << endl;
}

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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 60;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  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-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    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++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  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;
  }
};

// h(n, r) = c(n+r-1, r)
struct combination
{
  vector<mint> fact, ifact;
  combination(int n) : fact(n + 1), ifact(n + 1)
  {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i)
    fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i)
    ifact[i - 1] = ifact[i] * i;
  }
  mint operator()(int n, int k)
  {
    if (k < 0 || k > n)
    return 0;
    return fact[n] * ifact[k] * ifact[n - k];
  }
};

ll modpow(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

int main()
{
  int h, n;
  cin >> h >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  if(h <= accumulate(ALL(a), 0)) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3712
def make_divisors(n):
    ans = float('inf')
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans = min(ans, i+N//i-2)
            if i != n // i:
                ans = min(ans, n//i+N//(n//i)-2)

    return ans

N = int(input())
print(make_divisors(N))

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		System.out.println((n-h+1)*(n-w+1));
	}

}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;
int main(){

int n,i,j,k,count=0;

cin >> n;

std::vector<ll> l(n);

rep(i,n){
  cin >> l.at(i);
}

for(i=0;i<n-2;i++){
  for(j=i+1;j<n-1;j++){
    for(k=j+1;k<n;k++){
      if(l.at(i)+l.at(j)>l.at(k) &&
         l.at(j)+l.at(k)>l.at(i) &&
         l.at(k)+l.at(i)>l.at(j) &&
         l.at(i)!=l.at(j) && l.at(j)!=l.at(k)
          && l.at(k)!=l.at(i)){
           count++;
         }
    }
  }
}

cout << count << endl;

}


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

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

    vector<int> l(Q), r(Q);
    for(int i=0; i<Q; i++)
    {
        cin >> l[i] >> r[i];
    }

    //素数の洗い出し
    vector<int>::iterator iter = max_element(r.begin(),r.end());
    size_t index = distance(r.begin(), iter);
    int M = r[index]+1;
    vector<int> is_prime(M, 1);
    is_prime[0] = 0, is_prime[1] = 0; //1と0は素数ではない
    for(int i=2; i<M; i++)
    {
        if(is_prime[i])
        {
            for(int j=2; j*i<M; j++)
            {
                is_prime[j*i] = 0;
            }
        }
    }
    
    //2017数かどうか
    vector<int> is_2017(M, 0);
    for(int i=0; i<M; i++)
    {
        if(is_prime[i] && is_prime[(i+1)/2])
        {
            is_2017[i] = 1;
        }
    }

    vector<int> ruijo(M+1, 0);
    for(int i=0; i<=M; i++)
    {
        ruijo[i+1] = ruijo[i] + is_2017[i];  
    }

    for(int i=0; i<Q; i++)
    {   
        cout << ruijo[r[i]+1] - ruijo[l[i]] << endl;
    }
}

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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if ((a == 5 && b == 5 && c == 7)||(a ==5&&b ==7&&c==5)||(a==7&&b==5&&c==5)){
		cout << "YES";
	}
	else {
		cout << "NO";
	}
	return 0;
}

Measured memory_bytes: 256
N, K = gets.chomp.split.map(&:to_i)
trees = Array.new(N) { gets.chomp.to_i }.sort
diff = 0
ans = 10 ** 9
(N - K + 1).times do |i|
  diff = trees[i + K - 1] - trees[i]
  ans = diff if diff < ans
end
puts ans


Measured memory_bytes: 4472
#include <stdio.h>
#include <math.h>

int main(void)
{
    double x1,x2,y1,y2;
    double x3,y3;
    double P;

    scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);

    x3 = (x2 - x1);
    y3 = (y2 - y1);

    P = (x3 * x3) + (y3 * y3);
    P = sqrt(P);

    printf("%lf", P);

    return (0);
}



Measured memory_bytes: 2040
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  int n;
  cin >> n;
    
  vector<int> p(n);
  cin>>p[0];
  p[0]--;
  
  repo(i,n){
  cin>>p[i];
    if(p[i-1]>p[i]) {
    cout << "No" << endl;
    return 0;
    }
    else if(p[i-1]<p[i]) p[i]--;
  }

  cout << "Yes" << endl;
  
}


Measured memory_bytes: 640
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
  ifstream ifs("in.txt");
  cin.rdbuf(ifs.rdbuf());
#endif
  int N, R;
  while (cin >> N >> R) {
    int res;
    if (N >= 10) {
      res = R;
    } else {
      res = R + (10 - N) * 100;
    }
    cout << res << endl;
  }
  return 0;
}


Measured memory_bytes: 256
# coding=utf-8

###
### for atcorder program
###

import sys
import math
import array

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

def main():
    
    ans = 'No'

    S = input()

    S = [x for x in S]

    S.sort()

    if (S[0] == S[1]) and (S[2] == S[3]) and (S[1] != S[2]):
        ans = 'Yes'

    print(ans)

if __name__ == '__main__':
    main()



Measured memory_bytes: 3064