akhauriyash/Code-Regression huggingface dataset:
//問３ 2717 佐久間　翼
import java.util.Scanner;
public class Main{
    
    public void solve(){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        for(int cnt=0;cnt<N;cnt++){
            int x = sc.nextInt();
            int y = sc.nextInt();
            int b = sc.nextInt();
            int p = sc.nextInt();
            int gokei=x*b+y*p;
            if(b<5){
                b=5;
            }
            if(p<2){
                p=2;
            }
            int waribikigo=(x*b+y*p)*8/10;
            if(gokei>=waribikigo){
                System.out.println(waribikigo);
            }else{
                System.out.println(gokei);
            }
        }
    }
    public static void main(String[]args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 23444
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <ctime>

using namespace std;
using ll = long long;

int times(int number){
    if (number <= 5){
        return 0;
    }else if(number == 6 || number == 7){
        return 1;
    }else if(number == 8){
        return 2;
    }else if(number == 9){
        return 3;
    }else {
        return 0;
    }
}

int main()
{

    string s;
    ll k,wins;
    wins = 0;
    cin >> s;
    k = s.size();

    for (int i = 0;i< k;i++){
        if (s[i]=='o'){
            wins++;
        }
    }
    if((15 -k) + wins >=8 ){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair 
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;

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

int main(){
	//input
	ll X,A,B; cin>>X>>A>>B;

	//solve
	if(B<=A) cout<<"delicious";
	else if(B<=X+A) cout<<"safe";
	else cout<<"dangerous";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    Edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int> >;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define mk make_pair
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
typedef unsigned int uint;
#include <bits/stdc++.h>
int main(){
  int n,k;
  std::cin >> n>>k;
  string s;
  std::cin >> s;
  std::vector<int> a;
  int c=0,cc=0;
  if(s[0]=='0'){
    c++;
    a.pb(0);
    
  }
  rep(i,n){
    if(c%2==0){
      if(s[i]=='1'){
        a.pb(cc);
        c++;
        cc=1;
      }
      else{
        cc++;
      }
    }
    else{
      if(s[i]=='0'){
        a.pb(cc);
        c++;
        cc=1;
      }
      else{
        cc++;
      }
    }
  }
  c++;
  a.pb(cc);
  if(s[s.size()-1]=='0'){
    c++;
    a.pb(0);
  }
  std::vector<int> b(c+1,0);
  rep(i,c){
    b[i+1]=b[i]+a[i];
  }
  int ans=0;
  
  //rep(i,c+1)std::cout << b[i] << std::endl;
  if(2*k>=a.size()){
    std::cout << b[b.size()-1]-b[0] << std::endl;
    exit(0);
  }
  rep(i,b.size()-(2*k+1)){
    if(i%2==1)ans=max(ans,b[i+2*k+1]-b[i]);
  }
  std::cout << ans << std::endl;
}


Measured memory_bytes: 1272
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

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

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

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y){
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
/*逆元計算*/
long long int  modinv(long long a, long long m) {
	long long int b = m, u = 1, v = 0;
	while (b) {
		long long int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
// index が条件を満たすかどうか
vector<long long int >meguru;
bool isOK(int index, int key) {
	if (meguru[index] >= key) return true;
	else return false;
}
// 汎用的な二分探索のテンプレ
int binary_search(int key) {
	int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = (int)meguru.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, key)) right = mid;
		else left = mid;
	}
	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1; 
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int sosu[1000020] = {};
long long int numbers[1000030] = {};
int main() {
	long long int n;
	cin >> n;
	vector<long long int>v;
	for (int i = 0; i < n; i++) {
		long long int a;
		cin >> a;
		v.push_back(a);
		numbers[a]++;
	}
	for (int i = 2; i <= 1000000; i++) {
		if (sosu[i] == 0) {
			int sum = 0;
			for (int j = i; j <= 1000000; j = j + i) {
				sosu[j]++;
				if (numbers[j] != 0) {
					sum = sum + numbers[j];
				}
			}
			if (sum >= 2) {
				break;
			}
		}
		if (i == 1000000) {
			cout << "pairwise coprime" << endl;
			return 0;
		}
	}
	long long int b = v[0];
	for (int i = 1; i < v.size(); i++) {
		b = lcm(b, v[i]);
	}
	if (b == 1) {
		cout << "setwise coprime" << endl;
		return 0;
	}
	cout << "not coprime" << endl;
}

Measured memory_bytes: 22980
#include <bits/stdc++.h>
#define X first
#define Y second
#define pb push_back

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.size();
    int cc[30];
    memset(cc, 0, sizeof cc);
    if (n < 26)
    {
        for (int i = 0; i < n; i++)
            cc[s[i] - 'a']++;
        int ans = -1;
        for (int i = 0; i < 30; i++)
        {
            if (cc[i] == 0)
            {
                ans = i;
                break;
            }
        }
        cout << s << char('a' + ans) << '\n';
        return 0;
    }

    int ans = -1;
    char res;
    for (int i = n - 2; i >= 0; i--)
    {
        if (s[i] < s[i + 1])
        {
            for (int j = n - 1; j > i; j--)
            {
                if (s[j] > s[i])
                {
                    ans = i;
                    res = s[j];
                    break;
                }
            }
            break;
        }
    }
    if (ans == -1)
    {
        cout << ans;
        return 0;
    }
    else
    {
        for (int i = 0; i < n; i++)
        {
            if (i == ans)
            {
                cout << res;
                return 0;
            }
            cout << s[i];
        }
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner t = new Scanner(System.in);
        
        int n = t.nextInt();
        int x = t.nextInt();
        int d[] = new int[n+1];
        d[0] = 0;
        for (int i = 0; i < n; i++) {
            int y = t.nextInt();
            d[i+1] = d[i]+y;
        }
        int count = 0;
        for (int i = 0; i <= n; i++) {
            if (d[i] <= x){
                count++;
            }
        }
        System.out.println(count);
    }   
}

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

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var strs = Console.ReadLine().Split();
            var A = int.Parse(strs[0]);
            var B = int.Parse(strs[1]);
            var X = int.Parse(strs[2]);
            
            if (A <= X && A + B >= X)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }
}


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

int main(){

    string s;
    string t;
    cin>>s;
    cin>>t;
    int c=0;
    for(int i=0;i<s.size();i++){
        if(s[i]!=t[i]){
            c++;
        }
    }
    cout<<c;
}


Measured memory_bytes: 3896
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
using namespace std;

int main(){
	string s;
	cin >> s;
	
	char c[12]="w kstnhmyr";
	map<char, char> mp;
	
	mp['T']='a';
	mp['L']='i';
	mp['U']='u';
	mp['R']='e';
	mp['D']='o';
	
	for(int i=0; i<s.size(); i+=2){
		if(s[i]=='0'){
			if(s[i+1]=='U') cout << "nn";
			else 	cout << c[s[i]-'0'] << mp[s[i+1]];
		}
		else if(s[i]=='1') cout << mp[s[i+1]];
		else 	cout << c[s[i]-'0'] << mp[s[i+1]];
	}
	cout << endl;
}	

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

int main() {
    int N;
    cin >> N;
    vector<string> s(N);
    vector<int> t(N);
    for (int i = 0; i < N; i++) cin >> s[i] >> t[i];
    string m;
    cin >> m;
    int ans = 0;
    bool cnt = false;
    for (int i = 0; i < N; i++) {
        if (cnt) ans += t[i];
        if (m == s[i]) cnt = true;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;


void ABC140C()
{
	int N;
	cin >> N;
	vector<int> B(N);
	for (int i = 0; i < N-1; ++i)
	{
		cin >> B[i];
	}
	B[N - 1] = 1000000;

	ll sum = B[0];
	for (int i = 1; i < N; ++i)
	{
		sum += min(B[i - 1], B[i]);
	}
	cout << sum << endl;

}

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

Measured memory_bytes: 256
{-# LANGUAGE BangPatterns #-}
module Main where
import qualified Data.ByteString.Char8 as B
import Data.List(sort, foldl', unfoldr)
import Data.Char(isSpace)
import Data.Monoid((<>))

data PI = PI {-# UNPACK #-} !Int {-# UNPACK #-} !Int
    deriving (Eq)
instance Ord PI where
    compare (PI x y) (PI z w) = compare (- (x + y)) (- (z + w)) <> compare x z 
    

parse :: B.ByteString -> [PI]
parse = unfoldr step
  where
  step !s | B.null s = Nothing
          | otherwise = do
               (n1, s1) <- B.readInt s
               (n2, s2) <- B.readInt (B.tail s1)
               let s3 = B.dropWhile isSpace s2
               return (PI n1 n2, s3)

main :: IO ()
main = do
    n <- fmap read getLine :: IO Int
    content <- B.getContents
    let asbs = parse content
    let l  = sort asbs
        ps = cycle [1,-1 :: Int]
        ans = sum $ zipWith (\(PI a b) p -> if p == 1 then a else - b) l ps
    print ans                


Measured memory_bytes: 20732
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using u32 = uint32_t;
using vi = vector<int>;    using vvi = vector<vi>;
using vb = vector<bool>;   using vvb = vector<vb>;
using vl = vector<ll>;     using vvl = vector<vl>;
using vd = vector<double>; using vvd = vector<vd>;

#define MAXC(c, x) (c = max(c, x))
#define MINC(c, x) (c = min(c, x))

#define REP(i,n) for(auto i = 0 * (n), i##_len = (n); i < i##_len; ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i,s,n) for(ll i=s, i##_len=(ll)(n); i<i##_len; ++i)
#define TEN(x) ((ll)1e##x)
const ll mod = TEN(9) + 7;

const ll INF = 1e9;
using ull = unsigned long long;

// 制約fを満たす最大値（最小値）の二分探索
// ok < ng なら最大値，ok > ng なら最小値探索になる
template<typename F> ll bsearch(ll ok, ll ng, F f) {
	while (abs(ok - ng) > 1) {
		ll middle = (ok + ng) / 2;
		(f(middle) ? ok : ng) = middle;
	}
	return ok;
}


int main() {
	#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
	#endif
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(50);
	ll n, a, b; cin >> n >> a >> b;
	vl h(n); REP(i, n) cin >> h[i];
	ll c = (a - b);
	cout << bsearch(TEN(9), 0, [&](ll x) {
		ll cnt = 0;
		REP(i, n) {
			ll y = max(0ll, h[i] - x * b);
			cnt += y / c + (y % c != 0);
		}
		return x >= cnt;
	}) << endl;

	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <deque>
using namespace std;

long long dp[3001][3001][3];

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

	int n, s;
	cin >> n >> s;
	vector <int> v;
	v.resize(n);

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

	dp[0][0][0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= s; j++) {
			(dp[i][j][0] += dp[i - 1][j][0]) %= 998244353;
			(dp[i][j][1] += dp[i - 1][j][0] + dp[i - 1][j][1]) %= 998244353;
			(dp[i][j][2] += dp[i - 1][j][0] + dp[i - 1][j][1] + dp[i - 1][j][2]) %= 998244353;
			if (j + v[i - 1] <= s) {
				(dp[i][j + v[i - 1]][1] += dp[i - 1][j][0] + dp[i - 1][j][1]) %= 998244353;
				(dp[i][j + v[i - 1]][2] += dp[i - 1][j][0] + dp[i - 1][j][1]) %= 998244353;
			}
		}
	}
	cout << dp[n][s][2] << endl;
}

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

int main()
{
	string s;
	cin >> s;
	if (s[s.size() - 1] == 's') {
		cout << s << "es"<<"\n";
	}
	else {
		cout << s << "s"<<"\n";
	}
	return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF 1000000007 //1000000000000000003
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

struct edge{ll to, cost;}; //edgeパラメータ
typedef pair<ll,ll> P;
struct graph{
  ll N; //ノードの個数
  vector<vector<edge> > G; //G[辺の元]((.to辺の先,.costコスト),...)
  vector<ll> d; // dist[n] = ノードnまでのの重み
  vector<ll> parent;

  graph(ll n){ //グラフ生成時
    N = n;
    G.resize(N); //Edge情報
    d.resize(N); //Node情報,ans
    parent.resize(N);
    rep(i,N){d[i] = INF;}
  }

  void add_edge(ll s, ll t, ll cost){
    G[s].emplace_back((edge){t, cost});
  }

  ll dijkstra(ll s, ll goal){
    rep(i,N){d[i] = INF;}
    d[s] = 0;
    priority_queue<P,vector<P>, greater<P> > que; //ansが小さい順に出る
    que.push(P(0,s)); // P < ans , Node >
    while(!que.empty()){
      P p = que.top(); que.pop(); //pに <ans,Node> 入れる
      ll v = p.second; //vに Node 入れる
      if(d[v] < p.first) continue; //すでに良い数値が入っているならパス
      rep(i,G[v].size()){
        edge& E = G[v][i];
        if(d[E.to] > d[v] + E.cost){ //更新するなら
          d[E.to] = d[v]+ E.cost;
          parent[E.to] = v; //親を記録,goalから遡れば道順
          que.push(P(d[E.to], E.to));
        }
      }
    }
    return d[goal];
  }
};

void Main(){

  int N;

  cin>>N;

  vector<tuple<int,int,int>> tp;

  rep(i,N){
    rep(j,N){
      int a; cin>>a;
      if(i==j or i>j) continue;
      tp.emplace_back(a,i,j);
    }
  }

  SORT(tp);

  graph g(N);
  ll ans=0;

  for(auto x:tp){

    ll dist=g.dijkstra(get<1>(x),get<2>(x));
    if(get<0>(x)==dist) continue;
    if(get<0>(x)>dist){
      cout<< -1 <<"\n";
      return;
    }
    else{
      g.add_edge(get<1>(x),get<2>(x),get<0>(x));
      g.add_edge(get<2>(x),get<1>(x),get<0>(x));
      ans+=get<0>(x);
    }
  }

  cout<< ans<<"\n";

}

//-----------------------------------
int main(){
  // cin.tie(nullptr);
  // ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------


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

#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define mp make_pair
#define mt make_tuple
#define DESYNC                      \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector<ii>
#define all(x) x.begin(), x.end()
#define EPS 1e-9
#define INF 1e18
#define ROOT 1
#define M 1000000007
#define curtime chrono::steady_clock::now().time_since_epoch().count
#define rep(i, beg, n, s) for (int i = beg; i < n; i += s)
const double PI = acos(-1);

using namespace std;

inline int mod(int n, int m = M) {
  int ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}

int exp(int n, int k) {
  if (k == 0) return 1;
  if (k == 1) return n;
  int ax = exp(n, k / 2);
  ax = mod(ax * ax);
  if (k % 2) ax = mod(ax * n);
  return ax;
}

int gcd(int a, int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
//#define MULTIPLE_TEST_CASE
int calc(int u, int v, int n) { return u * (n - v + 1); }

void solution() {
  int n;
  cin >> n;
  vector<ii> edge;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    edge.emplace_back(a, b);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += calc(i, i, n);
  }
  for (ii p : edge) {
    ans -= calc(min(p.ff, p.ss), max(p.ff, p.ss), n);
  }
  cout << ans << endl;
}

int32_t main() {
  DESYNC;
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int t = 1;
#ifdef MULTIPLE_TEST_CASE
  cin >> t;
#endif
  while (t--) solution();
}


Measured memory_bytes: 7464
#include <iostream>
#include <vector>
#include <string> 
#include <algorithm>
#include <set>
using namespace std;
int main(){
    int N, K;
    cin >> N >> K;
    vector<long long> cnt(K);
    for(int i = 1; i <= N; i++){
        cnt[i % K]++;
    }
    long long ans = 0;
    for(int i = 1; i <= N; i++){
        if((K - i % K) % K * 2 % K != 0) continue;
        ans += cnt[(K - i % K) % K] * cnt[(K - i % K) % K];
    }
    cout << ans << endl;
}

Measured memory_bytes: 4752
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int N, K;
  cin >> N >> K;
  if (2 * K - 1 <= N)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;
const int mod = 1000000007;

int main() {
    int n;
    cin >> n;
    vector<int> t(n);
    rep(i, n) cin >> t[i];
    int m;
    cin >> m;
    vector<int> p(m);
    vector<int> x(m);
    rep(i, m) cin >> p[i] >> x[i];

    int sum = 0;
    vector<int> diff(m + 1);

    for (int i = 0; i < n; ++i) {
        sum += t[i];
    }
    for (int i = 0; i < m; ++i) {
        diff[i] = x[i] - t[p[i] - 1];
        print(sum + diff[i]);
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
#define int long long
#define MOD 1000000007
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 1e18
#define For(i,a,b) for (int i = a; i < b; i++)
#define Rep(i,a,b) for (int i = a; i <= b; i++)
#define ps(x,y) fixed << setprecision(y) << x 
#define pb push_back 
#define mp make_pair 
 
int32_t main()
{
    fast;
    int a, b, c; cin >> a >> b >> c;
    int k; cin >> k;
    
    while(b <= a and k > 0) {
        b *= 2;
        k--;
    }
    while(c <= b and k > 0) {
        c *= 2;
        k--;
    }
    
    if(a < b and b < c) cout << "Yes";
    else cout << "No";
    //cout << endl;
    //cout << a << " " << b << " " << c;
    
    
    
    return 0;
}

Measured memory_bytes: 3656
'use strict'

const main = (input) => {
    input = input.split(' ').map(i => Number.parseInt(i))
    const a = input[0]
    const b = input[1]
    const c = input[2]
    const d = input[3]

    if(Math.abs(c - a) <= d){
        console.log('Yes')
        return
    }

    if(Math.abs(b - a) <= d && Math.abs(c - b) <= d){
        console.log('Yes')
        return
    }

    console.log('No')
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

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

using namespace std;

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

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

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

  int h, w;
  cin >> h >> w;

  string a[128];
  vector<bool> side_all(h+1, false);
  vector<bool> ver_all(w+1, true);

  rep(i, h) {
    cin >> a[i];
    side_all[i] = all_of(all(a[i]), [](char c) { return c == '.'; });
  }

  rep(j, w) {
    rep(i, h) {
      if (a[i][j] == '#') ver_all[j] = false;
    }
  }

  rep(i, h) {
    rep(j, w) {
      if (side_all[i]) break;
      if (ver_all[j]) continue;
      cout << a[i][j];
    }
    if (!side_all[i]) cout << "\n";
  }

  return 0;
}

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

public class Main {

    public static void main(String[] args) throws IOException {
        int n,m;
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(br.readLine());
        n=Integer.parseInt(in.nextToken());
        m=Integer.parseInt(in.nextToken());
        Union_Find tree=new Union_Find(n);
        for(int i=0;i<m;i++){
            in=new StringTokenizer(br.readLine());
            int a=Integer.parseInt(in.nextToken()),b=Integer.parseInt(in.nextToken());
            tree.Union(a,b);
        }
        System.out.println(tree.get_tree(n));
    }
}
class Union_Find{
    private int[] t,s;
    public Union_Find(int max_length){
        t=new int[max_length+1];
        s=new int[max_length+1];
        for(int i=0;i<=max_length;i++){
            t[i]=i;
            s[i]=1;
        }
    }
    void Union(int x,int y){
        if (same(x, y)) return;
        int tx = Find(x), ty = Find(y);
        if (s[tx] < s[ty]) {
            s[ty] += s[tx];
            t[tx] = ty;
        }
        else if (s[tx] > s[ty]) {
            s[tx] += s[ty];
            t[ty] = tx;
        }
        else if (tx > ty) {
            t[tx] = ty;
            s[ty] += s[tx];
        }
        else {
            t[ty] = tx;
            s[tx] += s[ty];
        }
    }
    int Find(int n) {
        if (t[n] == n)
            return n;
        else
            return t[n] = Find(t[n]);
    }
    boolean same(int x, int y) {
        return Find(x) == Find(y);
    }
    int get_Size(int a) {
        return s[a];
    }
    int get_tree(int size){
        HashSet<Integer> st=new HashSet<>();
        for(int i=0;i<size;i++){
            st.add(Find(i+1));
        }
        return st.size();
    }
}


Measured memory_bytes: 47348
#include <stdio.h>
#include <vector>
#include <utility>
#include <string.h>

#define lli long long int
#define ll pair<lli, lli>
#define lll pair<ll, lli>
#define mp make_pair
#define fi first
#define se second
#define pb push_back

using namespace std;

lli nxt;
vector<lli> adj[2510], radj[2510];
bool visited[2510], depan[2510], belakang[2510];

void dfs(lli pos) {
	depan[pos] = true;
	visited[pos] = true;
	for (lli i = 0; i < (lli) adj[pos].size(); i++) {
		nxt = adj[pos][i];
		if (!visited[nxt])
			dfs(nxt);
	}
}

void sfd(lli pos) {
	belakang[pos] = true;
	visited[pos] = true;
	for (lli i = 0; i < (lli) radj[pos].size(); i++) {
		nxt = radj[pos][i];
		if (!visited[nxt])
			sfd(nxt);
	}
}

int main() {
	lli n, m, p, a, b, c, dist[2510];
	lll u;
	bool valid = true;
	vector<lll> edge;
	scanf("%lld %lld %lld", &n, &m, &p);
	for (lli i = 0; i < m; i++) {
		scanf("%lld %lld %lld", &a, &b, &c);
		adj[a].pb(b);
		radj[b].pb(a);
		edge.pb(mp(mp(a, b), c - p));
	}
	memset(visited, false, sizeof visited);
	memset(depan, false, sizeof depan);
	dfs(1);
	memset(visited, false, sizeof visited);
	memset(belakang, false, sizeof belakang);
	sfd(n);
	dist[1] = 0;
	for (lli i = 2; i <= n; i++)
		dist[i] = -1000000000000000000;
	for (lli i = 0; i < n; i++)
		for (lli j = 0; j < m; j++) {
			u = edge[j];
			if (dist[u.fi.fi] + u.se > dist[u.fi.se])
				dist[u.fi.se] = dist[u.fi.fi] + u.se;
		}
	for (lli i = 0; i < m; i++) {
		u = edge[i];
		if ((dist[u.fi.fi] + u.se > dist[u.fi.se]) && (depan[u.fi.se]) && (belakang[u.fi.se])) {
			valid = false;
			break;
		}
	}
	if (valid)
		printf("%lld\n", ((dist[n] < 0) ? 0 : dist[n]));
	else
		puts("-1");
	return 0;
}

Measured memory_bytes: 768
fn main() {
    let (n, k): (usize, usize) = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    };
    let a: Vec<usize> = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let iter = buf.split_whitespace();
        iter.map(|x| x.parse().unwrap()).collect()
    };

    for i in k..n {
        if a[i - k] < a[i] {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}

Measured memory_bytes: 5832
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<60;
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; }
using Graph = vector<vector<int>>;

typedef pair<int, int> P;
typedef priority_queue<int, vector<int>, greater<int>> PQ;
const int MOD = 1000000007;

int main(){
    int H, W, K; cin >> H >> W >> K;
    vector<string> c;
    rep(i,H){
        string tmp;
        cin >> tmp;
        c.push_back(tmp);
    }

    ll ans = 0;
    rep(i, 1<<(H+W)){
        set<int> th;
        set<int> tw;
        rep(j,H){
            if (i & (1<<j)) {
                th.insert(j);
            }
        }
        rep(j,W){
            if (i & (1<<(j+H))) {
                tw.insert(j);
            }
        }
        int cnt = 0;
        rep(h,H){
            rep(w,W){
                set<int>::iterator it = th.find(h);
                if (it != th.end()){
                    continue;
                }
                it = tw.find(w);
                if (it != tw.end()){
                    continue;
                }
                if (c[h][w] == '#') cnt++;

            }
        }
        if(cnt == K){
            ans++;
            
        }

    }
    cout << ans << endl;

}

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

int main() {
    std::string S;
    std::cin >> S;

    long long ans = 0;

    std::vector<int> v(2019);
    int x = 1, y = 0;
    for (int i = S.size() - 1; i >= 0; i--) {
        y = ((S[i] - '0') * x + y) % 2019;
        ans += y ? v[y]++ : ++v[y];
        x = x * 10 % 2019;
    }
    std::cout << ans << "\n";
}

Measured memory_bytes: 3696
#define y1 askjdkasldjlkasd
#include <bits/stdc++.h>
#undef y1

using namespace std;

#define pb push_back
#define mp make_pair
#define fi(a, b) for(int i=a; i<=b; i++)
#define fj(a, b) for(int j=a; j<=b; j++)
#define fo(a, b) for(int o=a; o<=b; o++)
#define fdi(a, b) for(int i=a; i>=b; i--)
#define fdj(a, b) for(int j=a; j>=b; j--)
#define fdo(a, b) for(int o=a; o>=b; o--)
#define sz(x) (int)x.size()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<ll> vll;

#ifdef LOCAL
#define err(...) fprintf(stderr, __VA_ARGS__)
#else
#define err(...) while (0)
#endif

double START_TIME;

void exit() {
#ifdef LOCAL	
	cerr << "TIME: " << setprecision(5) << fixed << (clock() - START_TIME) / CLOCKS_PER_SEC << endl;
#endif	
	exit(0);
}

template<typename A, typename B>
ostream& operator<<(ostream& os, pair<A, B> p) {
	os << "(" << p.first << ", " << p.second << ")";
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, vector<T> v) {
	fi(0, sz(v) - 1) {
		os << v[i] << " ";
	}
	return os;
}

template<typename T>
ostream& operator<<(ostream& os, set<T> t) {
	for (auto z : t) {
		os << z << " ";
	}
	return os;
}

template<typename T1, typename T2>
ostream& operator<<(ostream& os, map<T1, T2> t) {
	cerr << endl;
	for (auto z : t) {
		os << "\t" << z.first << " -> " << z.second << endl;
	}
	return os;
}

#ifdef LOCAL
#define dbg(x) {cerr << __LINE__ << "\t" << #x << ": " << x << endl;}
#define dbg0(x, n) {cerr << __LINE__ << "\t" << #x << ": "; for (int ABC = 0; ABC < n; ABC++) cerr << x[ABC] << ' '; cerr << endl;}
#else
#define dbg(x) while(0){}
#define dbg0(x, n) while(0){}
#endif

#ifdef LOCAL
#define ass(x) if (!(x)) { cerr << __LINE__ << "\tassertion failed: " << #x << endl, abort(); }
#else
#define ass(x) assert(x)
#endif

///////////////////////////////////////////////////

const int MAX = 5e3 + 41;
int n, k;
char s[MAX];
string ans;

void refresh(string &str) {
	if (sz(ans) == 0 || ans > str) ans = str;
}

string get(string s, int cnt) {
//	dbg(s);
	int lq = 1;
	fdi(sz(s) - 2, 0) {
		if (s[i] != s[i + 1]) break;
		lq++;
	}
	ll can = ( (ll) lq << cnt);
	if (can >= n) {
		return string(n, s[n - 1]);
	}
	string res = "";
	int shift = can - lq;
	fi(shift, n - 1) {
		res.pb(s[i]);
	}
	fi(0, can - 1 - lq) {
		res.pb(s[n - 1]);
	}
//	dbg(res);
	assert(sz(res) == n);
	reverse(res.begin(), res.end());
	return res;
}

void solve () {
	k = min(k, 30);
	string str = "";
	str += s;
	reverse(s, s + n);
	str += s;
	reverse(s, s + n);
//	dbg(str);
	fi(0, n) {
		string cur = str.substr(i, n);
		string resp = get(cur, k - 1);
		refresh(resp);
	}
	printf("%s\n", ans.c_str());
}

int main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	START_TIME = (double)clock();
#endif
	
	scanf("%d %d", &n, &k);
	scanf("%s", s);
	solve();

	exit();
	return 0;
}





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

using namespace std;

namespace {

#define VEVE(i, a, b) for (ll i = a, __##i = b; i < __##i; ++i)
#define DYDY(i, a, b) for (ll i = a, __##i = b; i > __##i; --i)
#define RARA(x, seq) for (auto &x : seq)
#define SIZE(x) ((ll)(x.size()))
#define ALL(x) x.begin(), x.end()

typedef int ll;
typedef double dd;

/*
Repeatedly delete all black leaves, now we must visit all leaves, can show never need to go over
edge more than twice.

Complete euler tour
  cost is 2*edges + number of verts i such that in_deg_i % 2 != (c_i == 'W'), let this condition be
boolean B_i. Leafs are always B_i = false unless there is only one leaf.

Consider any directed path (may be empty), remove directed path at end, change in cost is
-(number of edges) - (number of verts i such that B_i) + (number of verts i such that not B_i)
= - 2*(number of verts i such that B_i) + 2*(number of verts i such that not B_i)

C_i = 2 if B_i
0 if not B_i

  Find max weight path and answer is euler tour cost - this past. Only works if there is more than one
  leaf

special case if graph is one white vertex answer is 1 not -1
*/


void Solve(ll) {
  ll n;
  if (not(cin >> n))
    return;
  vector<set<ll>> adj(n);
  VEVE(e, 0, n - 1) {
    ll a, b;
    cin >> a >> b;
    --a, --b;
    adj[a].emplace(b);
    adj[b].emplace(a);
  }
  string color;
  cin >> color;
  vector<bool> del(n);
  {
    queue<ll> que;
    // remove black leaves
    VEVE(v, 0, n) que.emplace(v);
    while (not que.empty()) {
      const ll at = que.front();
      que.pop();
      if (SIZE(adj[at]) <= 1 and color[at] == 'B') {
        del[at] = true;
        if (SIZE(adj[at]) == 1) {
          const ll to = *adj[at].begin();
          que.push(to);
          adj[at].clear();
          adj[to].erase(at);
        }
      }
    }
  }
  const ll rem = count(ALL(del), false);
  if (rem == 0) {
    cout << "0\n"; // no white vertex
    return;
  }
  if (rem == 1) {
    cout << "1\n"; // one white vertex
    return;
  }
  vector<bool> bad(n);
  VEVE(v, 0, n) bad[v] = not del[v] and (SIZE(adj[v]) % 2) != (color[v] == 'W');
  const ll euler_tour_cost = 2 * (rem - 1) + count(ALL(bad), true);
  vector<ll> cost(n);
  VEVE(v, 0, n) {
    if (bad[v])
      cost[v] = 2;
    else
      cost[v] = 0;
  }
  ll res = euler_tour_cost;
  vector<ll> dp(n, -1); // max weight path going down from v including v
  function<void(ll, ll)> dfs = [&](ll at, ll par) {
    dp[at] = cost[at];
    RARA(to, adj[at]) if (to != par) {
        dfs(to, at);
        res = min(res, euler_tour_cost - (dp[at] + dp[to]));
        dp[at] = max(dp[at], dp[to] + cost[at]);
      }
    res = min(res, euler_tour_cost - dp[at]);
  };
  {
    const ll root = find(ALL(del), false) - del.begin();
    dfs(root, root);
  }
//  if (rem == 13)
//    VEVE(v, 0, n) RARA(to, adj[v]) cerr << v << color[v] << " " << to << color[to] << endl;
//  DEBUG(bad);
//  DEBUG(dp);
  cout << res << endl;
}

void Init() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
}

int32_t main() {
#ifdef AZN
  freopen("input.txt", "r", stdin);
#endif
  Init();
  ll tests = 11;
  VEVE(test, 1, tests + 1) Solve(test);
  return 0;
}


Measured memory_bytes: 23724
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
#define REP(i, l, r) for (int i=(l); i<(r); ++i)
#define RREP(i, r, l) for (int i=(r); i>(l); --i)
#define CASET int _T; cin >> _T; REP(caset, 0, _T)
#define print(x) cout << to_string(x) << '\n'
#define vi vector<int>
#define vb vector<bool>
#define vs vector<string>
#define pii pair<int,int>
#define t3i tuple<int,int,int>
#define mii map<int,int>
#define sq(x) (x)*(x)
#define inv(x) powa(x, MOD-2)
 
int INF = 1LL<<60;
int MOD = 998244353;
 
string to_string(char &c) {string x(1, c); return x;}
string to_string(string &s) {return s;}
string to_string(const char s[]) {return (string)s;}
template <class C> string to_string(C &v) {
    string res;
    for (auto &x : v) res += to_string(x) + ' ';
    return res;
}
template <typename A> istream &operator>>(istream &is, vector<A> &v) {
    for (auto &x : v) is >> x;
    return is;
}
template <typename A, typename B> ostream &operator<<(ostream &os, pair<A, B> pr) {
    os << '(' << pr.first << ", " << pr.second << ')';
    return os;
}
ostream &operator<<(ostream &os, char &c) {os << (char)c; return os;}
ostream &operator<<(ostream &os, string &s) {for (char &c : s) os << (char)c; return os;}
ostream &operator<<(ostream &os, const char s[]) {os << (string)s; return os;}
template <class Container> ostream &operator<<(ostream &os, Container &v) {
    bool first = true;
    os << '[';
    for (auto &x : v) {
        if (!first) os << ',' << ' ';
        first = false;
        os << x;
    }
    os << ']';
    return os;
}
string bin_string(int x) {
    const int d = 32;
    string res(d, ' ');
    REP(i, 0, d) res[d-1-i] = '0'+(x>>i & 1LL);
    return res;
}
int powa(int base, int exp) {
    int res = 1;
    while (exp) {
        if (exp&1) res = res*base % MOD;
        base = base*base % MOD;
        exp >>= 1;
    }
    return res;
}
 
main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    
    char x;
    cin >> x;
    ++x;
    print(x);
}

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

def solve():
    N = int(input())
    # N以下の整数のうち、桁数が奇数のものの数

    """
    100 ~ 999 = (1000 - 100)
    """

    ans = 0
    if N >= 10**5:  # 100000
        ans += (10**5 - 10**4)
        ans += (10**3 - 10**2)
        ans += (10**1 - 1)
    elif N >= 10**4:  # 10000
        ans += (N - 10**4 + 1)
        ans += (10**3 - 10**2)
        ans += (10**1 - 1)
    elif N >= 10**3:  # 1000
        ans += (10**3 - 10**2)
        ans += (10**1 - 1)
    elif N >= 10**2:  # 100
        ans += (N - 10**2 + 1)
        ans += (10**1 - 1)
    elif N >= 10**1:  # 10
        ans += (10**1 - 1)
    elif N >= 1:
        ans += N
    
    print(ans)

if __name__ == "__main__":
    solve()


Measured memory_bytes: 3064
s = input()
n = len(s)
chk = True
a = s[:((n-1)//2)]
b = s[((n+1)//2):]
if(s[::]!=s[::-1]):chk=False
if a[::]!=a[::-1]:chk=False
if b[::]!=b[::-1]:chk=False
if(chk):print("Yes")
else:print("No")

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

using namespace std;

int main() {

	while (1) {
		int n;
		cin >> n;
		if (n == 0) { return 0; }
		vector<double> s(n, 0);
		double total = 0;
		for (int i = 0; i < n; i++) {
			cin >> s[i];
			total += s[i];
		}
		total /= n;

		double sigma=0;
		for (int i = 0; i < n; i++) {
			sigma += (s[i] - total)*(s[i] - total);
		}
		cout << fixed << setprecision(9) << sqrt(sigma / n) << endl;
	}

}


Measured memory_bytes: 3268
#include <bits/stdc++.h>
using namespace std;
const int N = 17; 
const int inf = 1e9; 
int n, m, a[N][N], f[1 << N][N], sum[1 << N]; 
int main()
{
   cin >> n >> m;
   for (int i = 1; i <= m; i++) {
      int u, v, z; 
      cin >> u >> v >> z;
      u--; v--; 
      a[u][v] = a[v][u] = z;
   }
   
   for (int i = 1; i < (1 << n); i++)
      for (int j = 0; j < n; j++)
	 if (i & (1 << j))
	    for (int k = j+1; k < n; k++)
	       if (i & (1 << k))
		  sum[i] += a[j][k];

   for (int i = 1; i < (1 << n); i++)
      for (int j = 0; j < n; j++)
	 f[i][j] = -inf;
   
   for (int i = 1; i < (1 << n); i++)
      if (i & 1) f[i][0] = sum[i]; 

   for (int i = 1; i < (1 << n); i++)
      for (int j = 0; j < n; j++)
	 if (i & (1 << j))
	    for (int k = (i - 1) & i; k > 0; k = (k - 1) & i)
	       if ((k & (1 << j)) == 0)
		  for (int l = 0; l < n; l++)
		     if ((k & (1 << l)) > 0 && a[j][l] > 0)
			f[i][j] = max(f[i][j], f[k][l] + a[j][l] + sum[i ^ k]);

   cout << sum[(1 << n) - 1] - f[(1 << n) - 1][n - 1] << endl; 
   return 0; 
}


Measured memory_bytes: 3968
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define ll long long



using namespace std;

void file(){
	#ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
	#endif
}
int tc;
const int N=2e5+5,M=2e6+5,MOD=1e9+7,OO=1e9;
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or 
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
ll nck(ll n, ll k, ll mod)
{
	ll res=1;
	for(ll i=n-k+1;i<=n;i++)
	 	res=(res*i)%mod;
	for(ll i=1;i<=k;i++)
	    res=(res * power(i,mod-2, mod))%mod;
	return res;
} 
int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//file();	
 	
 	int n,a,b;

 	scanf("%d %d %d",&n,&a,&b);

 	ll ans = power(2,n,MOD)-1;	

 	ans = (ans-nck(n,a,MOD)+MOD)%MOD;
 	ans = (ans-nck(n,b,MOD)+MOD)%MOD;

 	printf("%lld\n",ans );
}		


Measured memory_bytes: 384
// May this submission get accepted!

#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define STEP(i, is, ie, step) for (long long i=(is), i##_end=(ie), i##_step = (step); i<=i##_end; i+=i##_step)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return true;} return false; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) ((q) ? "Yes" : "No")
#define YES(q) ((q) ? "YES" : "NO")
#define Possible(q) ((q) ? "Possible" : "Impossible")
#define POSSIBLE(q) ((q) ? "POSSIBLE" : "IMPOSSIBLE")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) do { cerr << "[DEBUG] " #q ": ["; REP(i, (q).size()) { cerr << (q)[i] << (i == i_len-1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; } while (false)
template<class T> T gcd(T a, T b) { if (a < b) std::swap(a, b); while (b) std::swap(a %= b, b); return a; }
template<class T> T lcm(const T a, const T b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
#define DANCE_ long
#define ROBOT_ unsigned
#define HUMAN_ signed
#define CHOKUDAI_ const
using  ll = DANCE_ HUMAN_ DANCE_;
using ull = DANCE_ ROBOT_ DANCE_;
using cll = DANCE_ DANCE_ CHOKUDAI_;
using  ld = long double;
using namespace std;

// モジュール

// Kahn (1962) のアルゴリズムによるトポソ DAGでないものを入れると鼻から悪魔が出る可能性がある
vector<ll> toposo(const vector<vector<ll>> &g) {
    ll n = g.size();
    vector<ll> r; r.reserve(n);
    vector<ll> indeg(n, 0);
    for (ll i = 0; i < n; i++) {
        for (const ll &j : g[i]) {
            ++indeg[j];
        }
    }
    deque<ll> zerodeg;
    for (ll i = 0; i < n; i++) {
        if (!indeg[i]) {
            zerodeg.push_back(i);
        }
    }
    while (zerodeg.size()) {
        ll i = zerodeg.front(); zerodeg.pop_front();
        r.push_back(i);
        for (const ll &j : g[i]) {
            if (--indeg[j] == 0) {
                zerodeg.push_back(j);
            }
        }
    }
    return r;
}

// 処理内容
int main() {
    
    // インタラクティブ問題では除去した方がいいかも
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    ll v, e; cin >> v >> e;
    vector<vector<ll>> g(v);
    REP(i, e) {
        ll s, t; cin >> s >> t;
        g[s].push_back(t);
    }

    auto tps = toposo(g);

    for (ll i : tps) cout << i << endl;
    
}


Measured memory_bytes: 3920
#include <iostream>

using namespace std;

int a[32] = {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};

int main()
{
  int n;
  cin >> n;
  n--;
  cout << a[n];
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>

using namespace std;
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (i % 2 == 0)
      cout << s[i];
  }
  return 0;
}

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

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

    int n,k; cin>>n>>k; vector<pair<int,int>> a(k);
    for (int i = 0; i < k; i++){
        int c,d; cin>>c>>d;
        a[i]=make_pair(d,c);
    }
    sort(a.begin(), a.end());
    int ans=0,cut=0;
    for (int i = 0; i < k; i++){
        if(a[i].second>cut){
            ans++; cut=a[i].first-1;
        }
    }
    cout<<ans<<'\n';
}

Measured memory_bytes: 1024
import numpy as np
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
B = np.array(b)
A = np.array(a)
count = 0
for i in range(n):
    if sum(B * A[i]) + c > 0:
        count += 1
print(count)


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

int main() {
string s;
  cin >> s;
  if(s.at(0) == s.at(1) && s.at(1) == s.at(2) || s.at(1) == s.at(2) && s.at(2) ==
     s.at(3) ) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<long long,long long>
#define vl vector<long long>
#define vll vector<pll>
#define vi vector<int>
#define vii vector<pii>
#define sws ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define tcase int tt; cin>>tt; while(tt--)
#define tcase2 int tt; cin>>tt; for(int qq=1;qq<=tt;qq++)
using namespace std;
typedef long long int ll;
typedef  unsigned long long int ull;
typedef long double ld;
const int MAX = 1000010;
const int MOD2 = 998244353;
const int MOD = 1000000007; 
const int INF = 1e8;    
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const ld EPS = 1e-7;
// Extra
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define forne(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()   
#define trav(a, x) for(auto& a : x)
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr<< *it << " = " << a << endl;
	err(++it, args...);
}
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int main()
{
    sws
    ll n;
    cin>>n;
    vl a(n);
    vl r(n/2);
    forn(i,n)
    {
        cin>>a[i];
    }
    for(int i=0;i<n/2;i++)
    {
        r[i]=(a[2*i]^a[2*i+1]);
    }
    ll f=0;
    forn(i,n/2)
        f^=r[i];
    forn(i,n)
        cout<<(a[i]^f)<<" ";
    cout<<endl;
    return 0;
}


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

#define ll long long



void solve(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a*b>c*d){
        cout<<a*b<<endl;
    }else{
        cout<<c*d<<endl;
    }
}

signed main(){
    //while(1)
    solve();
}

Measured memory_bytes: 256