akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ll long long

using namespace std;

double dist(pair<int, int> l, pair<int, int> r){
  double dx = l.first-r.first;
  double dy = l.second-r.second;
  return pow(dx*dx+dy*dy, 0.5);
}

int main(){
  int n;
  cin>>n;
  vector<pair<int,int>> xy;
  rep(i, n){
    int x,y;
    cin>>x>>y;
    xy.emplace_back(x,y);
  }
  
  vector<int> ar;
  rep(i,n){
    ar.push_back(i);
  }
  
  double sum = 0;

  do {
    rep(i,n-1){
      sum += dist(xy[ar[i]], xy[ar[i+1]]);
    }
  } while( next_permutation(ar.begin(), ar.end()) );
  
  int fac = 1;
  rep(i,n) fac *= (i+1);

  cout<<fixed<<setprecision(8)<<(sum/fac)<<setprecision(6);

  return 0;
}

Measured memory_bytes: 256
/******
author :- Mahmoud Tarek.
*******/

#include<bits/stdc++.h>

using namespace std ;

#define rg register
#define dbg(v) cerr << #v << " " << v ;
typedef long long ll ;

int n, m ;
const int N = 1e3 + 5  ;
int mod = 1e9 + 7 ;
char a[N][N] ;
int dp[N][N] ;

bool valid(int x, int y){
 return x >= 0 && x < n && y >= 0 && y < m ;
}



int solve(int x, int y){
   if(x == n - 1 && y == m - 1){
      return 1 ;
   }


   int & ret = dp[x][y] ;
   if(~ret) return ret ;
   ret = 0 ;
   if(valid(x + 1, y) && a[x + 1][y] == '.'){
     ret = solve(x + 1, y) ;
     ret %= mod ;
   }

   if(valid(x, y + 1) && a[x][y + 1] == '.'){
     ret = (ret % mod + solve(x, y + 1) % mod) % mod ;
   }
   return ret % mod ;
}

int main() {
//  freopen("in.txt", "r", stdin) ;
    cin >> n >> m ;
    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < m ; j++){
            cin >> a[i][j] ;
        }
    }

    memset(dp, -1, sizeof dp) ;
    cout << solve(0, 0) ;

}


/*
  Empty set of troubles.
*/


Measured memory_bytes: 5248
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#define INF 2000000000
using namespace std;
int dx[5]={1,0,-1,0,0},dy[5]={0,1,0,-1,0};
long long gcd(long long a,long long b){if(a%b==0){return b;}else return gcd(b,a%b);}
long long lcm(long long a,long long b){if(a==0){return b;} return a/gcd(a,b)*b;}
#define MOD 1000000007
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define mk make_pair
#define en endl
#define WHITE 1
#define BLACK 2
#define GRAY 1
#define RE return 0
#define int ll
#define P pair<int,int>

string t[4]={"dreamer","dream","eraser","erase"};

signed main(){
  string s; cin>>s;
  
  for(int i=0; i<s.size(); i++){
    pair<int, bool> same;
    same.second=false;
    same.first=-1;
    for(int j=0; j<4; j++){
      if(same.second) break;
      for(int k=0; k<t[j].size(); k++){
        if(s[i+k]!=t[j][k]){
          break;
        }
        if(k==t[j].size()-1){
          if(j==0&&s[i+k+1]=='a') break;
          same.second=true;
          same.first=j;
          break;
        }
      }
    }
    if(!same.second){
      cout<<"NO"<<en;
      RE;
    }
    i+=t[same.first].size()-1;
  }
  cout<<"YES"<<en;
}


Measured memory_bytes: 512
import sys
sys.setrecursionlimit(100001)
def input():
    return sys.stdin.readline()[:-1]
N, M = map(int,input().split())
if M == 0:
    print("Yes")
    exit(0)

INF = float("inf")
G = [[] for k in range(N)]
D = [INF for k in range(N)]
def dfs(x):
    if len(G[x]) == 0:
        D[x] = x
    else:
        for e in G[x]:
            if D[e[0]] == INF:
                D[e[0]] = D[x] + e[1]
                dfs(e[0])
            else:
                if D[e[0]] != D[x] + e[1]:
                    print("No")
                    exit(0)

for k in range(M):
    L, R, S = map(int,input().split())
    G[L-1].append([R-1,S])
    G[R-1].append([L-1,-S])

for k in range(N):
    if D[k] == INF:
        D[k] = k
        dfs(k)
print("Yes")


Measured memory_bytes: 135176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
#define ALL(a)  (a).begin(),(a).end()
const ll INF = 1e18+18;
const ll MAX = 200000;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
static const double pi = 3.141592653589793;



int main(){
    ll N, M, X;
    cin>>N>>M>>X;
    vector<ll> A(M, 0);
    ll mae=0;
    ll ushiro=0;
    rep(i, M){
        cin>>A[i];
        if(A[i]<X)mae++;
        if(A[i]>X)ushiro++;
    }
    cout<<min(mae, ushiro)<<endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int fib(int n);

int dp[45];

int main() {
    int n;
    dp[0] = 1;
    dp[1] = 1;
    cin >> n;
    for(int i = 2; i <= n; i++) {
        dp[i] = fib(i);
    }
    cout << dp[n] << endl;
}

int fib(int n) {
    return dp[n - 1] + dp[n - 2];
}


Measured memory_bytes: 3116
#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
const int mod = 1e9+7;
const Int Inf = 1e17;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int(i)=0; i<n; i++)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) {rep(pri2i,n-1)cout<<a[pri2i]<<' '; cout<<a[n-1]<<'\n';}
#define prip(p) cout<<p.fi<<' '<<p.se<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

Int n,m,_,x,y,q;
string s,sb;
bool ok;
char cf,cb;

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

  cin>>n; Int ans=0; m=ceil(sqrt(n)-1);
  for(Int i=1; i<=m; i++)if(!((n-i)%i)&&(n%((n-i)/i)))ans+=(n-i)/i;
  END
}

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

constexpr int MOD = 1000000007;
constexpr int INF = 1LL << 30;
constexpr long long LLINF = 1LL << 60;

template<typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (T &x : vec) is >> x;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    if (it != vec.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}

inline void print(void) { cout<<'\n'; }
template<class T> inline void print(const T &x) { cout<<x<<'\n'; }
template<class T, class... U> inline void print(const T &x, const U&... y) { cout<<x<<" "; print(y...); }

long long dp[1010][1010] = {};

int main() {
  int h, w; cin>>h>>w;
  vector<string> g(h);
  rep(i, h) cin>>g[i];
  dp[0][0] = 1;
  rep(i, h) rep(j, w) {
    if (i < h-1 and g[i+1][j] != '#') (dp[i+1][j] += dp[i][j]) %= MOD;
    if (j < w-1 and g[i][j+1] != '#') (dp[i][j+1] += dp[i][j]) %= MOD;
  }
  print(dp[h-1][w-1]);
  return 0;
}


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

void yes() { cout << "Yes" << endl; exit(0); }
void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> void amax(T &x, T y) { x = max(x, y); }
template <typename T> void amin(T &x, T y) { x = min(x, y); }
template <typename T> T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

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

void solve() {
  int h, w, x, y;
  cin >> w >> h >> x >> y;
  if (x * 2 == w && y * 2 == h) {
    cout << (double) w * h / 2 << " " << 1 << endl;
  } else {
    cout << (double) w * h / 2 << " " << 0 << endl;
  }
}


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner scn = new Scanner(System.in);
      	int sum = 0;
      	for(int i = 0; i < 5; i++){
          sum += scn.nextInt();
        }
      	System.out.println(15-sum);
	}
}



Measured memory_bytes: 35680
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,v;
    scanf("%d %d",&a,&v);
    int b,w;
    scanf("%d %d",&b,&w);
    int t;
    scanf("%d",&t);
    if(v>=w)
    {
        if((long long)(v-w)*t>=(long long)abs(a-b))
            printf("YES\n");
        else
            printf("NO\n");
    }
    else
    {
        if(v==w)
            printf("YES\n");
        else
            printf("NO\n");
    }
	return 0;
}


Measured memory_bytes: 3712
use std::cmp::{max,min};
fn main() {
    let _n = rv::<usize>()[0];
    let mut c = [0;13];
    c[0]=1;
    for d in rv::<usize>() {
        c[d]+=1;
    }
    let mut x = vec![];
    let mut y = vec![];
    for i in 0..13i8 {
        let c=c[i as usize];
        if i==0 || i==12 {
            if c>1 {
                println!("{}",0);
                return;
            }
            if c==1 {
                x.push(i);
            }
        }
        else {
            if c>2 {
                println!("{}",0);
                return;
            }
            if c==2 {
                x.push(i);
                x.push(24-i);
            }
            else if c==1 {
                y.push(i);
            }
        }
    }
    let n=x.len();
    let m=y.len();
    let mut t=0;
    for b in 0..1<<m {
        x.truncate(n);
        for i in 0..m {
            x.push(if b>>i&1==0 {y[i]} else {24-y[i]});
        }
        let mut s=12;
        for i in 0..n+m { for j in 0..n+m { if i!=j {
            let d=(x[i]-x[j]).abs();
            s = min(s,min(d,24-d));
        }}}
        t = max(t,s);
    }
    println!("{}",t);
}
fn rl() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s
}
fn rv<T>() -> Vec<T> where T: std::str::FromStr, T::Err: std::fmt::Debug, {
    rl().split_whitespace().map(|x|x.parse::<T>().unwrap()).collect()
}

Measured memory_bytes: 4352
#include "bits/stdc++.h"

#define rep(a,b) for(int a = 0;a < b;a++)
#define REP(i, x, n) for(int i = x; i < n; i++)
#define P(a) cout << a << endl
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ssort(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define vP(v) for(int i = 0;i < v.size();i++){cout << v[i];if(i != v.size()-1)cout << endl;}
#define vcin(v,n) rep(i,n){int a;cin >> a;v.pb(a);}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 1, -1 , 0 , 0 };
int dy[] = { 0,  0,  1, -1 };
ll MOD = 1000000007;

void solve(){
	string s;
	cin >> s;
	int count = 0;
	rep(i,s.length()){
		if(s[i] == '1')count++;
	}
	P(count);
}

int main() {
    solve();
    return 0;
}


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

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl
#define debug2(s, t, u) cout << s << " " << t << " " << u << endl
#define printvec(v)       \
    for (auto &&i : v)    \
        cout << i << " "; \
    cout << endl

using namespace std;
using i64 = long long;

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

    int ans = n*n*n;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define long long long
#define up(i,a,b) for (int i = a, _b = (b); i <= _b; i++)
#define down(i,a,b) for (int i = a, _b = (b); i >= b; i--)
#define endl '\n'
#define X first
#define Y second
#define II pair<int, int>
#define debug(X) cerr<< #X << "=" <<X << endl
#define debug2(X,Y)  cerr<< #X << "=" <<X << ", " << #Y << "=" <<Y << endl
#define show(X,a,b) {cerr << #X << " = "; up(__,a,b) cerr << X[__] << ' '; cerr << endl;}
#define gc getchar
#define pc putchar
using namespace std;

inline void read(int &x) {
    register int c = gc();
    x = 0;
    int neg = 0;
    for (;((c<48 || c>57) && c != '-') ;c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}
inline void writeln(int x) {

         char buffor[21];
         register int i=0;
         int neg=0; if (x<0) {neg=1; x= -x;}
         do{
               buffor[i++]=(x%10)+'0';
               x/=10;
            } while(x);
           i--;
           if (neg) pc('-');
           while(i>=0) pc(buffor[i--]);
           pc('\n');
       }
int X, Y, d[12][12], f[102][102];
vector<II> edge;
void input() {
    cin >> X >> Y;
    up(i, 1, X)
        up(j, 1, Y)
            cin >> d[i][j];
}

void solve() {
    //s = 201, t= 202
    up(a, 0, 100)
        up(b, 0, 100) {
            f[a][b] = 0;
            up(x, 1, X)
                up(y, 1, Y)
                    f[a][b] = max(f[a][b], d[x][y] - x * a - y * b);
        }

    up(x, 1, X)
        up(y, 1, Y) {
            int cur_d = 1e9;
            up(a, 0, 100)
                up(b, 0, 100)
                    cur_d = min(cur_d, f[a][b] + x * a + y * b);
            if (cur_d != d[x][y]) {
                cout << "Impossible"; return;
            }
        }
    cout << "Possible" << endl;
    int s = 201, t = 202;
    cout << 202 << " " << 10401 << endl;
    cout << s << " " << 1 << " X" << endl;
    up(i, 1, 99) cout << i << " " << i + 1 << " X" << endl;
    up(i, 101, 199) cout << i << " " << i + 1 << " Y" << endl;
    cout << 200 << " " << t << " Y" << endl;
    up(i, 101, 200) cout << s << " " << i << " " << f[0][200 - i + 1] << endl;
    up(i, 1, 100)
        up(j, 101, 200)
            cout << i << " " << j << " " << f[i][200 - j + 1] << endl;
    cout << s << " " << t << " " << f[0][0] << endl;
    up(i, 1, 100) cout << i << " " << t << " " << f[i][0] << endl;
    cout << s << " " << t << endl;
}

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

    #ifdef I_Love_Pork
    #define TASK "tmp"
    freopen(TASK".inp","r",stdin);
    freopen(TASK".out","w",stdout);
    #endif

    input();
    solve();

    return 0;
}


Measured memory_bytes: 384
import sys
input = sys.stdin.readline

#input
N = int(input())
A = [0] * N
B = [0] * N
for i in range(N):
    A[i], B[i] = map(int, input().split())

#output
C = [a+b for a, b in zip(A, B)]
C.sort(reverse = True)
accum = 0
for i in range(N):
    if i % 2 == 0:
        accum += C[i]
answer = accum - sum(B)
print(answer)


Measured memory_bytes: 15340
K=int(input())

lunlun=[[0 for i in range(0,10)] for i in range(0,13)]
for i in range(0,10):
    lunlun[1][i]=1
for i in range(2,13):
    for j in range(0,10):
        if j==0:
            lunlun[i][j]=lunlun[i-1][0]+lunlun[i-1][1]
        else:
            ans=0
            ans+=lunlun[i-1][j-1]+lunlun[i-1][j]
            if 9>j:
                ans+=lunlun[i-1][j+1]

            lunlun[i][j]=ans

def condition(num):
    s=str(num)
    n=len(s)
    ans=0
    dp=[0 for i in range(0,n+1)]
    dp[n]=1
    for k in range(0,n-1):
        i=n-1-k
        j=int(s[i-1])
        ans=0
        if j>0:
            if int(s[i])>j-1:
                ans+=lunlun[n-i][j-1]
            elif int(s[i])==j-1:
                ans+=dp[i+1]

        if int(s[i])>j:
            ans+=lunlun[n-i][j]
        elif int(s[i])==j:
            ans+=dp[i+1]

        if 9>j:
            if int(s[i])>j+1:
                ans+=lunlun[n-i][j+1]
            elif int(s[i])==j+1:
                ans+=dp[i+1]

        dp[i]=ans

    ans=0
    for i in range(1,int(s[0])):
        ans+=lunlun[n][i]
    ans+=dp[1]
    for i in range(1,n):
        for j in range(1,10):
            ans+=lunlun[i][j]

    return ans>=K
start=1
end=10**12
while end-start>1:
    test=(end+start)//2
    if condition(test):
        end=test
    else:
        start=test

if condition(start):
    print(start)
else:
    print(end)

Measured memory_bytes: 38640
N = gets.to_i
ab=[]
N.times do
  ab << gets.split.map(&:to_i)
end
ab.sort_by!{|(a,b)| b}
sum = 0
ans = true
ab.each do |(a,b)|
  sum += a
  if sum > b
    ans = false
  end
end
puts ans ? 'Yes' : 'No' 


Measured memory_bytes: 22544
#include<stdio.h>
 
int main(){
    int n,i,j,max=0,jmax,mount[10];
    for(n=0;n<10;n++)scanf("%d",&mount[n]);
    for(i=0;i<3;i++){
        for(j=0;j<10;j++){
            if(mount[j]>max){
                 max=mount[j];
                 jmax=j;
            }
        }
        printf("%d\n",max);
        max=0;
        mount[jmax]=0;
    }
    return 0;
}

Measured memory_bytes: 600
import java.util.Scanner;

class Main{
      public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	String s = sc.next();
	String t = sc.next();
	if(s.length()>10||s.length()<1){
	    System.out.println("No");
	    System.exit(0);
	}
	if(t.length()!=s.length()+1){
	    System.out.println("No");
	    System.exit(0);
	}
	if(!(s.equals(t.substring(0,t.length()-1)))){
	    System.out.println("No");
	    System.exit(0);
	}
	System.out.println("Yes");
      }
}


Measured memory_bytes: 35724
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1e9+7;
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;

int main(){
    int n, q, time = 0;
    cin >> n >> q;
    queue<pair<string, int> > p;
    pair<string, int> input;
    REP(i, n){
        cin >> input.first >> input.second;
        p.push(input);
    }
    while (!(p.empty())){
    	if (p.front().second - q <= 0){
        	time += p.front().second;
        	cout << p.front().first << " " << time << endl;
        	p.pop();
    	}
    	else {
    	    pair<string, int> temp;
    	    temp.first = p.front().first;
    	    temp.second = p.front().second - q;
    	    p.push(temp);
    	    p.pop();
            time += q;
    	}
    }
}


Measured memory_bytes: 6172
/**
 * File              : A - Bulletin Board.cpp
 * Author            : horcrux2301 <khajuriaharsh729@gmail.com>
 * Date              : 12/02/2019 21:39:49
 * Last Modified Date: 12/02/2019 21:39:49
 */
#include <bits/stdc++.h>
#define ll long long
#define mp(a, b) make_pair(a, b)
#define newline cout << endl;
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

template <typename S, typename T> ostream& operator<<(ostream& out, pair<S, T> const& p)
{
	out << '(' << p.ff << ", " << p.ss << ')';
	return out;
}

template <typename T> ostream& operator<<(ostream& out, vector<T> const& v)
{
	int l = v.size();
	for (int i = 0; i < l - 1; i++)
		out << v[i] << ' ';
	if (l > 0)
		out << v[l - 1];
	return out;
}

template <typename T> void trace(const char* name, T&& arg1) { cout << name << " : " << arg1 << endl; }

template <typename T, typename... Args> void trace(const char* names, T&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " | ";
	trace(comma + 1, args...);
}

int main()
{
	//ios::sync_with_stdio(false);
	//cin.tie(0);
	//cout.tie(0);
	clock_t tStart = clock();
	int test;
	test = 1;
	// cin >> test;
	while (test--) {
		ll N,H,W;
		cin >> N >> H >> W;
		ll ans = 0;
		ans += (N-H+1)*(N-W+1);
		cout << ans << endl;
	}
#ifdef LOCAL_DEFINE
	printf("Time taken: %.2fs\n", (double)(clock() - tStart) / CLOCKS_PER_SEC);
#endif
	return 0;
}


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

#ifdef DEBUG
#include "../include/debug.hpp"
#else
#define debug(...) 42
#define rdfile(...) 42
#endif

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    // rdfile("_input.txt");

    int N, L;
    cin >> N >> L;

    int sum = 0;
    int eat = L;
    for (int i=1; i<=N; ++i) {
        int t = L+i-1;
        sum += t;
        if (abs(t) < abs(eat)) eat = t;
    }

    cout << sum - eat << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
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; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int kurai(int a,int b){
  int m=pow(10,b),n=pow(10,b-1);
  return (a%m)/n;
}
int ketawa(int a){
  int k=0;
  rep(i,keta(a)){
  k+=kurai(a,i+1);
  }
  return k;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
int mid(int a,int b,int c){
  vector<int> k(3);
  k[0]=a;k[1]=b;k[2]=c;
  sort(all(k));
  return k[1];
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
 if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m;
 int memo = modpow(a,b>>1,m);
 return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  int a;
  cin>>a;
  vector<int> b(a),c(a);
  rep(i,a)
    cin>>b[i];
  rep(i,a)
    cin>>c[i];
  int d=-1;
  rep(i,a){
    int e=0;
  rep(j,a){
  if(i==j)
  e+=b[j]+c[j];
    else if(i<j)
    e+=c[j];
    else
    e+=b[j];
  }
    chmax(d,e);
  }
  out(d);
}


Measured memory_bytes: 3800
#include <bits/stdc++.h>
using namespace std;
vector<pair<int,int>>edge;
int main(){
    int n;cin>>n;
    if((1<<int(ceil(log2(n))))==n)
        return puts("No"),0;
    edge.emplace_back(n+1,n+2);
    edge.emplace_back(n+2,n+3);
    edge.emplace_back(n+3,1);
    edge.emplace_back(1,2);
    edge.emplace_back(2,3);
    for(int a=4,b=5;b<=n;a+=2,b+=2){
        edge.emplace_back(a,b);
        edge.emplace_back(a+n,b+n);
        edge.emplace_back(a,1);
        edge.emplace_back(b+n,1);
    }
    if(n%2==0)
        for(int a=2;;a++){
            int b=(n+1)^a;
            if(2<=a&&a<n&&2<=b&&b<n){
                edge.emplace_back(n,a&1?a+n:a);
                edge.emplace_back(2*n,b&1?b+n:b);
                break;
            }
        }
    puts("Yes");
    for(auto i:edge)
        cout<<i.first<<" "<<i.second<<"\n";
    return 0;
}

Measured memory_bytes: 3952
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

typedef vector<int> vi;
typedef vector<vi> vvi;

typedef long long ll;


//レーベンシュタイン距離を求める
int LD(string s1, string s2)
{
    int l1 = s1.length() + 1;
    int l2 = s2.length()+ 1;
    vvi dist(l1);
    rep(i,l1) dist[i].resize(l2);
    int cost = 0;
 
    rep(i,l1) dist[i][0] = i;
    rep(i,l2) dist[0][i] = i;
 
    REP(i,1,l1){
        REP(j,1,l2){
            cost = !(s1[i-1] == s2[j-1]);
            dist[i][j] = min(dist[i-1][j]+1,min(dist[i][j-1]+1,dist[i-1][j-1]+cost));
        }
    }
    return dist[l1-1][l2-1];
}
 
int main()
{   
    string s1; cin>>s1;
    string s2; cin>>s2;
    cout<<LD(s1,s2)<<endl;
    return 0;
}

Measured memory_bytes: 4964
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



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


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count

N=int(input())
X=np.array(acinput())

u = round(np.mean(X))


res=0

print(int(np.sum((u-X)**2)))


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

int main(void) {
  int64_t A, B, C;
  cin >> A >> B >> C;
  int64_t answer = 0;
  if ((A + B) < C) {
    answer = (A + B + 1) + B;
  } else {
    answer = B + C;
  }
  cout << answer << endl;
  return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef vector<int> vint;
typedef vector<float> vfloat;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vstr> vvstr;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


int main() {
    string s;
    cin >> s;
    sort(all(s));
    if (s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) puts("Yes"); 
    else puts("No");
    return 0;
}

Measured memory_bytes: 256
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N, M, Q = reads()

mat = [[0] * N for _ in range(N)]
for _ in range(M):
  l, r = reads()
  l, r = l-1, r-1
  mat[l][r] += 1

acc = [[0] * (N+1) for _ in range(N+1)]
for i in range(N):
  vec = [0] + list(accumulate(mat[i]))
  acc[i+1] = [acc[i][j] + vec[j] for j in range(N+1)]

for _ in range(Q):
  p, q = reads()
  p, q = p-1, q-1
  ans = acc[N][q+1] - acc[p][q+1]
  print(ans)


Measured memory_bytes: 15968
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n").map(Number);
arr.some(function(v){
   if(v==0)return true;
   var loop=function(start,sum,arr){
      if(sum==v)console.log(arr.join(" "));
      else if(sum<v){
         for(var i=start;i>=1;i--){
            if(arr.length==0 || arr[arr.length-1]>=i)loop(start-1,sum+i,arr.concat(i));
         }
      }
   };
   loop(v,0,[]);
});

Measured memory_bytes: 17640
#include <bits/stdc++.h>
#define ll long long
#define INF 1e9
#define pb push_back
#define mp  make_pair
#define loop(a,n) for(long long i=a;i<n;i++)
#define vil vector<long long int>
#define vi vector<int>
#define sz(v) v.size()
#define setbits(x)          __builtin_popcountll(x)
#define ff first
#define ss second
using namespace std;


ll gcd(ll a, ll b) {
  if (a == 0)return b;
  return gcd(b % a, a);
}
bool isperfect(ll n) {
  ll y = sqrt(n);
  if (n % y == 0 && y * y == n)return true;
  return false;
}
bool comp(pair<int,int> a, pair<int,int> b) {
    if(a.first == b.first) return a.second>b.second;
  return a.first < b.first;
}
 ll powi(ll a, ll b) {
  ll ans = 1;
  while (b > 0) {
    if (b & 1)ans = (ans * a);
    b = b >> 1;
    a = (a * a);
  }
  return ans;
}
bool isprime(ll n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)return false;
  }
  return true;
}
bool prime[10000000];
void seive() {

  prime[1] = true;
  for (int i = 2; i * i < 10000000; i++) {

    if (prime[i])continue;
    for (int j = i * i; j < 10000000; j += i) {
      prime[j] = true;
    }

  }
}
int main()
{
  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 ll n;cin>>n;
 ll a[6]={100,101,102,103,104,105};
   ll dp[7][n+1];
   for(int i=0;i<=6;i++){
       for(int j=0;j<=n;j++){
           if(i==0) {
               dp[i][j]=0;continue;
           }
           if(j==0) {
               dp[i][j]=1;continue;
           }
           bool inc=0,exc=0;
           if(j-a[i-1]>=0){
               inc=dp[i][j-a[i-1]];
           }
           exc=dp[i-1][j];
          // cout<<inc<<exc<<endl;
           dp[i][j]=exc|inc;
       }
   }   
    int f=1;
    for(int i=1;i<=6;i++){
        if(dp[i][n]==1) {
            f=0;
            cout<<1;break;
        }
    }
    if(f)
   cout<<0;
}



  

Measured memory_bytes: 9004
<?php

$sequence = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51];
fscanf(STDIN, '%d', $K);
echo $sequence[$K - 1];

echo PHP_EOL;


Measured memory_bytes: 4604
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pii pair<int,int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define IO ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define read(FILE)  freopen(FILE, "r", stdin);
#define out(FILE) freopen(FILE, "w", stdout);
#define all(x) x.begin(),x.end()
#define rep(i,m,n) for(int i=m ; i<n ; i++)
#define forr(i,m,n) for(int i=m ; i<=n ; i++)
#define clr(v,val) memset(v,val,sizeof(v))
#define endl '\n'
#define pb push_back
#define pff push_front
#define re return
const int N = 1e5 + 5;
const ll mod=int(1e9)+7;
using namespace std;
int main()
{
string s; cin>>s;
int n=s.size(),cnt1=0;
rep(i,0,n/2){
if(s[i]!=s[n-i-1])
cnt1++;
}

cout<<cnt1;

}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  string s;cin>>s;
  bool ok=false;
  rep(i,s.size()){
    if(s[i]=='C')ok=true;
    if(s[i]=='F'&&ok){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
}

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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.length();
    int black = 0;
    int white = 0;
    rep (i, n) {
        if (i % 2 == 0) {
            if (s[i] == '0')
                white++;
            else
                black++;
        } else {
            if (s[i] == '0')
                black++;
            else
                white++;
        }
    }
    print(min(black, white));

    return 0;
}


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

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    unordered_map<string, int> sm;
    for (int i = 0; i < N; i++) {
        string s;
        cin >> s;
        sm[s]++;
    }
    map<int, set<string>> ans;
    for (auto& e: sm) {
        if (ans.count(-e.second)) {
            ans[-e.second].insert(e.first);
        } else {
            ans[-e.second] = {e.first};
        }
    }
    for (auto& s: ans.begin()->second) {
        if (s.length()) {
            cout << s << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 32072
#include<bits/stdc++.h>
#define MIN -1000000
using namespace std;
typedef long long ll;
int ans=0;
const int INF=1e9;
int N,M,S,T;
int dp[100005][3];
typedef pair<int,int> P;
vector<int> G[100005];
int main(void)
{
    for(int i=0;i<=100000;i++)
    {
        for(int j=0;j<3;j++) dp[i][j]=INF;
    }
    cin >> N >> M;
    for (int i = 0; i < M; i++)
    {
        int u,v;
        cin >> u >> v;
        G[u].push_back(v);
    }
    cin >> S >> T;
    queue<P> que;
    que.push(P(S,0));
    dp[S][0]=0;
    while(!que.empty())
    {
        int v=que.front().first;
        int l=que.front().second;
        que.pop();
        for(auto i:G[v])
        {
            int nl=(l+1)%3;
            if(dp[i][nl]!=INF) continue;
            dp[i][nl]=dp[v][l]+1;
            que.push(P(i,nl));
        }
    }
    int ans=dp[T][0];
    if(ans==INF)
    {
        cout << -1 << endl;
        return 0;
    }
    else ans/=3;
    cout << ans << endl;
    return 0;
}


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

// Template for atcoder
public class Main {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    final long MOD = 1000L * 1000L * 1000L + 7;
    private static final int[] dx = {0, -1, 0, 1};
    private static final int[] dy = {1, 0, -1, 0};

    void solve() throws IOException {
        int n = nextInt();
        int[] arr = nextIntArr(n);
        int sum = 0;
        for (int v : arr) {
            sum = sum ^ v;
        }
        for (int v : arr) {
            out((sum ^ v) + " ");
        }
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public Main() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new Main();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}


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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

 int main(){
      int N;
      ll X;
      cin >> N >> X;

      vector<ll>a(N + 1);
      a.at(0) = X;
      for(int i = 1; i < N + 1; i++){ 
           cin >> a.at(i);
      }
      sort(all(a));

      vector<int>d(N);
    for(int i = 0; i < N; i++){ 
        d.at(i) = a.at(i + 1) - a.at(i);
    }
      ll now;
      ll m = MOD;
    if(d.size() == 1){
        print(d.at(0));
        return 0;
    }
    for(int i = 0; i < N - 1; i++){ 
         now = gcd(d.at(i), d.at(i + 1));
         m = min(m, now);
    }
 print(m);
 }

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll p=pow(10,9)+7;
ll phi(ll n) {
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            while(n % i == 0)
                n /= i;
            result -= result / i;
        }
    }
    if(n > 1)
        result -= result / n;
    return result;
}
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      
    x = x % p;  
   while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p; 
    } 
    return res; 
} 

ll modInverse(ll n, ll p) 
{ 
    return power(n, p-2, p); 
}
ll isPalindrome(string str) 
{ 
    // Start from leftmost and rightmost corners of str 
    int l = 0; 
    int h = str.length() - 1; 
  
    // Keep comparing characters while they are same 
    while (h > l) 
    { 
        if (str[l++] != str[h--]) 
        { 
           
            return 0; 
        } 
    } 
    return 1;
} 


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll l;
    cin>>l;
    long double d=l*l*l;
    d/=27;
    cout<<fixed<<setprecision(10)<<d;
 
}
    



Measured memory_bytes: 256
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
typedef long long LL;

int main() {
  int N; std::cin >> N;
  std::string S, T; std::cin >> S >> T;
  for (int i = 0; i < N; ++i) {
    std::cout << S[i];
    std::cout << T[i];
  }
  std::cout << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;



int main() {
    int n, k;
    cin >> n >> k;
    ll now = (ll)(n/k)*(n/k)*(n/k);
    if (k%2 == 1) {
        ll ans = now;
        cout << ans << endl;
        return 0;
    }
    ll cnt = 0;
    for (int i = 1; i <= n; i++) {
        if (i%k == k/2) cnt++;
    }
    ll ans = cnt*cnt*cnt + now;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
n, = map(int, input().split())
p = [-1] + [*map(int, input().split())]

MOD = 10**9+7
dp = [[] for _ in range(n+1)]
dep = [0]*(n+1)
nxt = [0]*(n+1)

for v in range(n,0,-1):
    _,nxt[p[v]],dep[p[v]] = sorted([nxt[p[v]],dep[p[v]],dep[v]+1])

tot = [0]*(dep[0]+1)
for i in range(n+1): tot[dep[i]] += 1

def merge(p,v):
    if len(dp[p]) < len(dp[v]):
        dp[p],dp[v]=dp[v],dp[p]
    for i in range(-len(dp[v]),0):
        a,b,c = dp[p][i]
        d,e,f = dp[v][i]
        dp[p][i][:] = [a*d%MOD,(b*d+a*e)%MOD,c*f%MOD]

for v in range(n,-1,-1):
    dp[v].append([1,1,2])
    for i in range(-nxt[v]-1,0):
        dp[v][i][0] = dp[v][i][2] - dp[v][i][1]
    if v: merge(p[v],v)

ans = 0
for d in dp[0]:
    ans += pow(d[2],MOD-2,MOD)*d[1]%MOD
print(ans*pow(2,n+1,MOD)%MOD)

Measured memory_bytes: 63068
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
int main() {
    int A, B, C; cin >> A >> B >> C;
    int add = min(A - B, C);
    C -= add;
    cout << C << endl;
    return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        x: usize,
    }
    const N: usize = 200_000;
    let mut pr = vec![true; N];
    pr[0] = false;
    pr[1] = false;
    for i in 2..N {
        for j in 2..(N - 1) / i + 1 {
            pr[i * j] = false;
        }
    }
    let mut x = x;
    while !pr[x] {
        x += 1;
    }
    puts!("{}\n", x);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


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

using namespace std;

typedef long long ll;

int main() {
	ll n, a, b;
	scanf("%lld%lld%lld",&n,&a,&b);
	ll nn=n%(a+b);
	printf("%lld",(n/(a+b))*a+min(nn, a));
	return 0;
}

Measured memory_bytes: 256