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

using namespace std;
#define all(x) (x).begin(), (x).end()
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<vector<bool>> vvb;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long>> vvl;
typedef pair<int,int> pii;
typedef long long ll;
#define debug(x) cout << #x << "=" << x << endl;
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){ for(int i = 0; i < v.size(); cout << (i>0 ? " ":"") << v[i++]); cout << "\n"; return os;}

vi w;
vvi g;
vi ans;
int n;

void dfs(int v, int p, vi &dp){
    // max j | dp[j] < w[v]
    int lb = lower_bound(all(dp), w[v]) - dp.begin(); // first >=
    lb--; // dp[lb] < w[v]
    bool inc = false;
    int org = -1;
    if(lb == dp.size() - 1){
        inc = true;
        dp.push_back(w[v]);
    }else if(dp[lb + 1] > w[v]){
        org = dp[lb+1];
        dp[lb+1] = w[v];
    }
    ans[v] = dp.size() - 1;

    for(auto u : g[v]){
        if(u == p) continue;
        dfs(u, v, dp);
    }

    if(inc){
        dp.pop_back();
    }else if(org >= 0){
        dp[lb+1] = org;
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    w = vi(n);
    cin >> w;
    g = vvi(n);
    int i,u,v;
    for(i=0;i<n-1;i++){
        cin >> u >> v;
        u--;v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    vi dp;
    dp.push_back(0);
    ans = vi(n);
    dfs(0, -1, dp);
    for(i=0;i<n;i++){
        cout << ans[i] << "\n";
    }

    return 0;
}

Measured memory_bytes: 30032
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,m,k,t1;
int dp[1<<16],t[101],a[101][101],d[101];
int main(){
  memset(dp,-1,sizeof(dp));
  memset(t,-1,sizeof(t));
  cin>>n>>m>>k;
  r(i,m){
    cin>>d[i];
    d[i]--;
    t[d[i]]=i;
  }
  r(i,n)r(j,k)
    cin>>t1,
    a[i][j]=t1-1;

  queue<int>q;
  q.push((1<<m)-1);
  dp[(1<<m)-1]=0;
  while(!q.empty()){
    int p=q.front();q.pop();
    if(!p){
      cout<<dp[0]<<endl;
      break;
    }
    r(i,k){
      int x=0;
      r(j,m)if((p>>j)&1)
        if(t[a[d[j]][i]]>=0)
          x|=(1<<t[a[d[j]][i]]);

      if(dp[x]<0){
        dp[x]=dp[p]+1;
        q.push(x);
      }

    }
  }
}

Measured memory_bytes: 3556
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
int N, K;
int A[5010] = {};
bool dp[5010][5010] = {}; // dp[i番目まで][和がちょうどj] = 可能？
bool necessary(int m){ // m番目を除いて[K-A[m], K)の値を作れるか？
    int c=A[m];
    A[m]=0;
    
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= K; j++){
            dp[i][j] = false;
        }
    }
    dp[0][0] = true;
    
    for(int i = 0; i < N; i++){
        
        for(int j = K-1; j>=0; j--){
            if(j-A[i]>=0&&dp[i][j-A[i]]==true){
                dp[i+1][j]=true;
            }else if(dp[i][j]==true){
                dp[i+1][j]=true;
            }
            }
       
    }
    bool ans = false;
    for(int a = max(K - c, 0); a < K; a++){
        if(dp[N][a]){ans = true;}
    }
    A[m]=c;
    return ans;
}



int main() {
    cin >> N >> K;
    for(int i = 0; i <N; i++){
        cin >> A[i];
    }
    sort(A, A+N);
    // a<bでaが必要かつbが不必要とすると矛盾．
    // aが属し，K<=(Sの元の和)<K+aなるSを1つとる．bがSの元のときはSそのものが，
    // bがSの元でないときはSからaを除きbを加えたものが反例．
    if(necessary(0)){cout << 0 << endl;}
    else if(!necessary(N-1)){cout << N << endl;}
    else{
        int L = 1, R = N;
        while(R - L > 1){
            int M = (L + R) / 2;
            if(necessary(M-1)){R = M;}
            else{L = M;}
        }
        cout << L << endl;
    }
}


Measured memory_bytes: 24704
#!/usr/bin/env python3
n, *b = map(int, open(0).read().split())
l = []
while True:
    F = 1
    for i, j in enumerate(b[::-1]):
        if len(b) - i == j:
            del b[len(b) - i - 1]
            l += j,
            F = 0
            break
    if F:
        break
if b:
    exit(print(-1))
for i in l[::-1]:
    print(i)

Measured memory_bytes: 3060
import sys
class dice:
    def __init__(s, i):
        s.d1,s.d2,s.d3,s.d4,s.d5,s.d6 = map(int, i)
    
    def W(s):
        tmp = s.d1
        s.d1 = s.d3
        s.d3 = s.d6
        s.d6 = s.d4
        s.d4 = tmp
        
    def E(s):
        tmp = s.d1
        s.d1 = s.d4
        s.d4 = s.d6
        s.d6 = s.d3
        s.d3 = tmp
        
    def N(s):
        tmp = s.d1
        s.d1 = s.d2
        s.d2 = s.d6
        s.d6 = s.d5
        s.d5 = tmp
        
    def S(s):
        tmp = s.d1
        s.d1 = s.d5
        s.d5 = s.d6
        s.d6 = s.d2
        s.d2 = tmp
        
    def L(s):
        tmp = s.d2
        s.d2 = s.d3
        s.d3 = s.d5
        s.d5 = s.d4
        s.d4 = tmp
        
    def isSame(s, d):
        flg = False
        
        #1つのダイスを基準に6面回す
        for i in range(6):
            #2つ目のダイスを6面全て上部に設定し、総当たり
            for j in range(6):
                if s.d1 == d.d1 and s.d6 == d.d6:
                    #上部、下部が一致した場合、左周りに回転させ側面が全て一致するか確認
                    for j in range(3):
                        if s.d2 == d.d2 and s.d3 == d.d3 and s.d4 == d.d4 and s.d5 == d.d5:
                            #全部の面が一致した場合、Trueを返し判定終了
                            return True
                        else:
                            #一致しない場合は左周り
                            d.L()
                    
                #一致するケースが無い場合、2つ目のダイスを回転させる
                if j <= 3:
                    d.N()
                elif j == 4:
                    d.E()
                else:
                    d.E()
                    d.E()
            
            #一致するケースが無い場合、基準のダイスを回転させる
            if i <= 3:
                s.N()
            elif i == 4:
                s.E()
            else:
                s.E()
                s.E()
        
        #全ケース一致する場合が無ければFalseを返す
        return False

n = int(input())
dlst = []
for i in range(n):
    dice1 = dice(input().split())
    if i >= 1:
        for d in dlst:
            if dice1.isSame(d):
                print("No")
                sys.exit()
    dlst.append(dice1)
print("Yes")


Measured memory_bytes: 5612
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
c = a + t * v
d = b + t * w


if(a > b):
    c = a - t * v
    d = b - t * w
    if(c <= d):
        print("YES")
    else:
        print("NO")
elif(a == b):
    print("YES")
else:
    c = a + t * v
    d = b + t * w
    if(c >= d):
        print("YES")
    else:
        print("NO")


Measured memory_bytes: 9200
import java.util.*;
public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);

      int N = sc.nextInt();
      int M = sc.nextInt();
      int c = sc.nextInt();

      int[] b = new int[M];
      for (int i = 0; i < b.length; i++) {
         b[i] = sc.nextInt();
      }

      int count = 0;

      for(int j = 0; j < N; j++){

         int sum = 0;

         int[] a = new int[M];
         for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
         }

         for(int i = 0; i < M; i++){
            sum = sum + a[i] *  b[i];
         }

         sum = sum + c;
  
         if (sum > 0) {
            count = count + 1;
         }
      }

      System.out.println(count);


   }
}

Measured memory_bytes: 24404
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main(){
long long int X; 
cin >> X; 
if(X % 11 == 0) cout << X/11 * 2 << endl; 
if(X % 11 >= 1 && X % 11 <= 6) cout << X/11 * 2 + 1 << endl;
if(X % 11 >= 7 && X % 11 <= 10) cout << X/11 * 2 + 2 << endl;
}

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

int main() {
  int n,a; cin>>n;
  vector<pair<int,int>> p;
  for(int i;i<n;i++){
    cin>>a;
    p.push_back(make_pair(a,i+1));
  }
  sort(p.begin(),p.end());
  int x,y;
  for(int j;j<n;j++){
    tie(x,y)=p[j];
    cout<<y<<' ';
  }
  cout<<endl;
}

Measured memory_bytes: 1780
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

int main(void) {
    while(1) {
        string s;
        cin >> s;
        if(s == "#") break;

        ll b[7][7]={
            {7,8,18,0,1,2,3},
            {8,9,0,1,10,3,4},
            {18,0,17,2,3,16,5},
            {0,1,2,3,4,5,6},
            {1,10,3,4,11,6,12},
            {2,3,16,5,6,15,14},
            {3,4,5,6,12,14,13}
        };

        set<ll> st;
        REP(i, 1LL<<19) {
            ll c = 0;
            REP(j, 7) {
                ll v = 0;
                REP(k, 7) v |= (i>>b[j][k]&1)<<k;
                c |= (s[v]-'0')<<j;
            }
            st.insert(c);
        }

        bool ret = true;
        for(const auto &x: st) {
            if((x>>3&1) != s[x]-'0') {
                ret = false;
                break;
            }
        }

        if(ret) cout << "yes" << endl;
        else cout << "no" << endl; 
    }

    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF 1e16
#define mod 1000000007

ll n,m;
ll a[505];
ll sum[505];
double dp[505][505];

int main(){
  cin>>n>>m;
  m=n-m;
  rep(i,n)cin>>a[i];
  rep(i,n)sum[i+1]=sum[i]+a[i];
  rep(i,505)rep(j,505)dp[i][j]=-INF;
  dp[0][0]=0;
  rep(i,n)rep(j,m+1){
    ll sum=0;
    repl(k,i,n){
      sum+=a[k];
      ll num=k-i+1;
      maxch(dp[k+1][j+num-1],dp[i][j]+(double)sum/(double)num);
    }
  }
  printf("%.10f\n", dp[n][m]);
  return 0;
}



Measured memory_bytes: 5228
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int k = sc.nextInt();

		for(int i = a; i <= b; i++)
		  if(i < a + k || b - k < i)
			  System.out.println(i);
	}
}

Measured memory_bytes: 21844
# トポロジカルソート
def tp_sort(i,res,called,hash)
  called[i] = true
  Array(hash[i]).each do |j|
    tp_sort(j,res,called,hash) unless called[j]
  end
  res << i
end

n = gets.to_i
m = gets.to_i
# チームiに対して勝っているチームを配列で表す.hash[i] = [j,k]など。
hash = {}
m.times do
  a = gets.split(" ").map(&:to_i)
  hash[a[1]] = [] if hash[a[1]].nil?
  hash[a[1]] << a[0]
end

# トポロジカルソートを呼び出したかどうかをチェックする
called = Array.new(n+1) {false}

res = []

1.upto(n) do |i|
  tp_sort(i,res,called,hash) unless called[i]
end

puts res

# 他に可能な順位表があるかどうか
other = 0
1.upto(n-1) do |i|
  other = 1 if hash[res[i]].nil? || !hash[res[i]].include?(res[i-1])
end

puts other

Measured memory_bytes: 10052
#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;


const ll MAX = 1000000;
ll fac[MAX], finv[MAX], inv[MAX];
// nCk初期化
void nCkInit(const ll MOD) {//O(max(n,r)logmax(n,r) mは素数)
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll nCk(ll n, ll k,const ll MOD){//init後,O(1)
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


ll N,K;
int main(){
    cin>>N>>K;
    ll ans=0;
    for(ll i=K;i<=N+1;i++){
        ans=(ans+((2*N-i+1)*i/2%MOD-i*(i-1)/2%MOD+1+MOD)%MOD)%MOD;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
#include <utility>
using namespace std;
typedef long long ll;

int c[100005];  
  
int solve( int n ) {  
    int a = 101 , num[12] = { 1 , 6 , 36 , 216 , 1296 , 7776 , 46656 , 9  , 81 , 729 , 6561 , 59049 }; 
    if( n < 0 ) return 101;  
    if( n == 0 ) return 0;  
    if( c[n] != 0 ) return c[n];  
    for( int i = 0 ; i < 12 ; i++ ) a = min( a , solve( n - num[i] ) );  
    c[n] = a + 1;  
    return a + 1;  
}  
  
int main() {  
    int x;  
    cin >> x;  
    cout << solve(x);  
} 



Measured memory_bytes: 16484
def main():
    A, B = map(int, input().split())

    if (A%3 == 0) or (B%3 == 0) or ((A+B)%3 == 0):
        print("Possible")
    else:
        print("Impossible")

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const long long MOD = 1000000007;

vector<int> places[210000];
long long dp[210000];
void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; }

int main() {
    // 入力
    int N; cin >> N;
    vector<int> c(N);
    for (int i = 0; i < N; ++i) cin >> c[i];

    // places[i] := (c[j] = i となるような j の集まり)
    for (int i = 0; i < 210000; ++i) places[i].clear();
    for (int i = 0; i < N; ++i) places[c[i]].push_back(i);

    // DP
    dp[0] = 1;
    for (int i = 1; i <= N; ++i) {
        // 特に操作しない場合
        add(dp[i], dp[i-1]);

        // 操作する場合
        int color = c[i-1];
        int it = lower_bound(places[color].begin(), places[color].end(), i-1)
            - places[color].begin(); // c[i] が color 色の何番目の要素か
        if (it > 0) {
            int j = places[color][it - 1]; // c[j] = c[i] となる j
            if ((i-1) - j > 1) add(dp[i], dp[j+1]);
        }
    }
    cout << dp[N] << endl;
}

Measured memory_bytes: 13824
#include<cstdio>
#include<cstring>
char str[20];
int main(){
  scanf("%s",str);
  int n=strlen(str);
  if(n<4)printf("No\n");
  else{
    if(str[0]=='Y'&&str[1]=='A'&&str[2]=='K'&&str[3]=='I')printf("Yes\n");
    else printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
int get_digit(long long n) {
  int cnt=0;
  while(n!=0) {
    n /= 10;
  	cnt++;
  }
  return cnt;
}

int main() {
  long long N;
  cin >> N;
  
  long long ret = INF;
  for (long long i=1; i*i<=N; i++) {
  	if (N % i != 0) continue;
    long long b = N/i;
    long long t = max(get_digit(i), get_digit(b));
    if (ret > t) ret=t;
  }
  cout << ret << endl;
}

Measured memory_bytes: 256
//Author - Rahil Malhotra
#include <bits/stdc++.h>
using namespace std;
 
template <typename T> void print(T t) { cout<<t<<endl; }
template<typename T, typename... Args> void print(T t, Args... args) { cout<<t<<" "; print(args...); }
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
//#define int long long
#define double long double

int n;
int arr[1000006];
int store[1000006];
int sieve[1000006];
int32_t main()
{
    IOS;
    sieve[1]=0;
    for(int i=2;i<=1000002;i++)
        if(!sieve[i])
            for(int j=1;i*j<=1000002;j++)
                sieve[i*j]=i;
    cin>>n;
    int gcd=0;
    for(int i=1;i<=n;i++)
    {
        cin>>arr[i];
        gcd=__gcd(arr[i],gcd);
    }
    if(gcd!=1)
        print("not coprime");
    else
    {
        int fl=0;
        for(int i=n;i>=1;i--)
        {
            int val=arr[i];
            while(val>1)
            {
                int get=sieve[val];
                while(val%get==0)
                    val/=get;
                if(store[get])
                {
                    fl=1;
                    break;
                }
                store[get]++;
                val/=get;
            }
            if(fl)
                break;
        }
        if(fl)
            print("setwise coprime");
        else
            print("pairwise coprime");
    }
}


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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  int n;
  cin >> n;
  vector<double> r(n),p(n);
  rep(i,n){
    cin >> r[i];
  }
  p[0]=r[0];
  repp(i,1,n){
    double ans=r[i];
    rep(j,i){
      ans=max(ans,2*sqrt(r[i]*r[j])+p[j]);
    }
    p[i]=ans;
  }
  double ans=0;
  rep(i,n){
    ans=max(ans,p[i]+r[i]);
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}



Measured memory_bytes: 3276
#include <bits/stdc++.h>
#define F(i,a,b) for(ll i=a;i<=(b);++i)
#define dF(i,a,b) for(int i=a;i>=(b);--i)
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define pb push_back
#define maxnkp make_pair
#define fi first
#define se second
#define eps 1e-7
#define PI acos(-1.0)
using namespace std;
typedef long long ll;
const int mods = 1e9+7;
const int maxn = 2e5+10;
const int N = 1e5+10;
const int E = 1e6+10; 

int n;
ll a[maxn];
ll suf[maxn];

int main(){
	cin>>n;
	F(i,1,n) cin>>a[i];
	suf[n] = a[n];
	dF(i,n-1,1){
		suf[i] = suf[i+1]+a[i];
		suf[i]%=mods;
	}
	ll ans = 0;
	F(i,1,n){
		ans+= a[i]*suf[i+1]%mods;
		ans%=mods;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 6744
#include<bits/stdc++.h>
using namespace std;
 
int main(){
	int h,n;
	cin>>h>>n;
 
	int a[n];
	int b[n];
 
	for(int i =0;i<n;i++)
		cin>>a[i]>>b[i];
 
	int dp[h+1];
	dp[0] = 0;
	for(int i = 1;i<=h;i++)
		dp[i] = INT_MAX;
	for(int i =1;i<=h;i++){
		for(int j = 0;j <n;j++){
			dp[i] = min(dp[i],b[j] + dp[max(0,i - a[j])]);
		}
	}
 
 
	cout<<dp[h];
	return 0;
}
    
    
    
    


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
signed main(){
	int N, K;
	cin >>N>>K;
	vector<int>A(N);
	for(int i=0;i<N;i++){
		cin >> A[i];
	}
	int X = 0;
	for(int i = 50;i >= 0; i--){
		int bit = (int)1 << i;
		int n1 = 0;
		for(int j=0;j<N;j++){
			if(A[j] & bit){
				n1++;
			}
		}
		if(n1 < N - n1){
			X += bit;
		}
	}
	int res = 0;
	for(int i=0;i<N;i++){
		res+=A[i]^K;
	}
	int z = 0;
	for(int i = 50;i >= 0; i--){
		int bit = (int)1 << i;
		if(K & bit){
			int Y = (X & (bit-1)) + z;
			int ans = 0;
			for(int j=0;j<N;j++){
				ans += A[j] ^ Y;
			}
			res = max(res, ans);
		}
		z += (K & bit);
	}
	cout << res<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
    int n;
    int k[3];
    cin>>k[0]>>k[1]>>k[2]>>n;
    sort(k, k+3);

    cout<<k[0]+k[1]+k[2]*pow(2, n)<<endl;

    
    return 0;
}


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

int n,m,u,v,p[51];

int main(){
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>u>>v;p[u]++;p[v]++;
	}
	for(int i=1;i<=n;i++) cout<<p[i]<<endl;
	return 0;
}


Measured memory_bytes: 256
/*
 * Author       : YangDavid
 * Created Time : 2019年07月15日 星期一 11时24分59秒
 */

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
int n, a[500];
void upd(ll& x, ll y) { x = min(x, y); }

ll solve(int l, int r, ll wl, ll wr) {
    if(l > r) return 0;
    ll ret = INFL;
    for(int i = l; i <= r; ++i)
        upd(ret, solve(l,i-1,wl,wr+wl)+solve(i+1, r,wl+wr,wr)+(wl+wr)*a[i]);
    return ret;
}
int main() {
    scanf("%d", &n);
    rep(i, n) scanf("%d", &a[i]);
    printf("%lld\n", solve(2, n - 1, 1, 1) + a[1] + a[n]);

    return 0;
}


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

public class Main{
	final static int MOD = 1000000007;
	final static int INF = 1000000000;

	public static void main(String[] args) throws IOException{
		NScanner sc = new NScanner(System.in);
		int n = sc.nextInt();
		Deque<Integer> list = new ArrayDeque<Integer>();
		for(int i = 0; i < n; ++i){
			String com = sc.next();
			if(com.charAt(0) == 'i'){
				int x = sc.nextInt();
				list.addFirst(x);
			}else if(com.length() == 6){
				int x = sc.nextInt();
				list.remove(x);
			}else if(com.charAt(6) == 'F'){
				list.pollFirst();
			}else if(com.charAt(6) == 'L'){
				list.pollLast();
			}
		}
		boolean first = true;
		for(int i : list){
			System.out.print((first ? "" : " ") + i);
			
			if(first){
				first = false;
			}
		}
		System.out.println();
	}


}

class NScanner {
	
	private BufferedReader br;
	private StringTokenizer tok;
	
	public NScanner(InputStream is) throws IOException{
		br = new BufferedReader(new InputStreamReader(is));
		getLine();
	}
	
	private void getLine() throws IOException{
		while(tok == null || !hasNext()){
			tok = new StringTokenizer(br.readLine());
		}
	}
	
	private boolean hasNext(){
		return tok.hasMoreTokens();
	}
	
	public String next() throws IOException{
		if(hasNext()){
			return tok.nextToken();
		}else{
			getLine();
			return tok.nextToken();
		}
	}
	
	public int nextInt() throws IOException{
		if(hasNext()){
			return Integer.parseInt(tok.nextToken());
		}else{
			getLine();
			return Integer.parseInt(tok.nextToken());
		}
	}
	
	public long nextLong() throws IOException{
		if(hasNext()){
			return Long.parseLong(tok.nextToken());
		}else{
			getLine();
			return Long.parseLong(tok.nextToken());
		}
	}
	
	public double nextDouble() throws IOException{
		if(hasNext()){
			return Double.parseDouble(tok.nextToken());
		}else{
			getLine();
			return Double.parseDouble(tok.nextToken());
		}
	}
}


Measured memory_bytes: 181812
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
 
#include <stdio.h>
#include <bits/stdc++.h>
 
using namespace std;
 
#include <x86intrin.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;
  
#define pb push_back
#define mp make_pair
#define in insert
#define f first
#define s second
#define ll long long
#define ld long double
  
const int mod = 1e9 + 7;
const int N = 2e5 + 7;
const int inf = 2e9;
const ll INF = 1e18;

ll w[N], v[N], dp[N], p[N];

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	// freopen("*.in", "r", stdin);freopen("*.out", "w", stdout);
	int n, W;
	cin >> n >> W;
	for(int i = 1; i <= n; i++) {
		cin >> w[i] >> v[i];
	}
	dp[0] = 1;
	for(int j = 1; j <= n; j++) {
		for(int i = W; i >= 0; i--) {
			if(dp[i]) {
				dp[i + w[j]] = 1;
				p[i + w[j]] = max(p[i + w[j]], p[i] + v[j]); 
			}
		}
	}
	ll mmax = 0;
	for(int i = W; i >= 0; i--) {
		mmax = max(mmax, p[i]);
	}
	cout << mmax;
}

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

int min(int *s, int a, int b){
    int min = 101;
    int num = -1;
    for (int i = a; i<= b; i++){
        if(min > s[i]) {
            num = i;
            min = s[i];
        }
    }
    return num;
}

void func(int s[], int a, int b, int *count){
    int m = min(s, a, b);
    if(m == -1);
    else if(s[m] == 0){
        func(s, a, m-1, count);
        func(s, m+1, b, count);
    }
    else if (a == b){
        *count += s[a];
        s[a] = 0;
    }
    else{
        int m1 = s[m];
        *count += m1;
        for(int i = a; i <= b; i++){
            s[i] -= m1;
        }
        func(s, a, m-1, count);
        func(s, m+1, b, count); 
    }
}

int main(){
    int N;
    scanf("%d",&N);
    int h[N];
    int count = 0;
    for (int i = 0; i< N; i++){
        scanf("%d", &h[i]);
    }
    func(h, 0, N-1, &count);
    printf("%d\n", count);
    return 0;
}

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

#define 	ll				long long
#define 	vi				vector<int>
#define		rep(i,n) 		for(i=0;i<n;i++)
#define		repe(i,I1,I2) 	for(i=I1;i<I2;i++)
#define		INF  			1e9 + 7
#define		pb  			push_back
#define		mp  			make_pair
#define		endl			'\n'
#define 	mod				1000000007


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n,k,t,c=0,i,a,b,x,y;
	t=1;
	//cin>>t;
	
	while(t--)
	{
		cin>>a>>b>>c>>x>>y;
		n=2*max(x,y)*c;
		k=2*min(x,y)*c;
		k+=( (x>y)?((x-y)*a):((y-x)*b) );
		i=a*x+b*y;
		cout<<min(min(n,k),i);
		if(t!=0)
	   		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
 
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
 
    int H = sc.nextInt();
    int W = sc.nextInt();
 
    for(int i = 0; i <= W; i++) {
        System.out.print("#");
    }
    System.out.println("#");
 
    for(int j = 0; j < H; j++) {
        System.out.print("#");
        System.out.print(sc.next());
        System.out.println("#");
    }   
 
     for(int i = 0; i <= W; i++) {
        System.out.print("#");
    }
        System.out.println("#");
  }
}

Measured memory_bytes: 23508
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
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;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() {
    string s;cin >> s;
    int count = 0;
    int flag = 1;
    rep(i, s.size()) {
        // cout << i << ' ' << s[i] << ' ' << flag << "\n";
        if(s[i]==s[i+1]&&flag == 1) {
            count++;
            flag = 0;
            i++;
        }
        else {
            count++;
            flag = 1;
        }
        // cout << i << endl;
    }
    // if(flag==1) cout << count+1 << endl;
    /*lse*/ cout << count << endl;
    // cout << flag << endl;
    return 0;
}

Measured memory_bytes: 3760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=1e9;
const double eps=1e-9;
inline int read(){
	int x=0,flag=1;
	char ch=getchar();
	while(!isdigit(ch) && ch!='-')ch=getchar();
	if(ch=='-')flag=-1,ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x*flag;
}
int main(){
	int i,j,k,m,n,T;
	T=read();
	while(T--){
		int a=read(),b=read();
		int val=(int)sqrt(1ll*a*b);
		int ans=2*(int)sqrt(1ll*a*b)-1;
		if(1ll*val*val==1ll*a*b && a!=b)ans--;
		if(1ll*val*(val+1)>=1ll*a*b)ans--;
		printf("%d\n",ans);
	}
	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

int main() {
	int N; cin >> N;
	int ans = N * (N + 1) / 2;
	cout << ans << endl;
	return 0;
}

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

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

template<typename T, typename U>
istream& operator >> (istream& istr, pair<T,U>& p){
    istr >> p.first >> p.second;
    return istr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<T>& v){
    if(!v.empty()){
        ostr << v.front();
        for(auto itr = ++v.begin(); itr != v.end(); itr++)
            // ostr << *itr;
            ostr << " " << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, pair<T,U>& p){
    // ostr << p.first << p.second;
    // ostr << p.first << ", " << p.second;
    ostr << "(" << p.first << ", " << p.second << ")";
    return ostr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<vector<T>>& vv){
    if(!vv.empty()){
        ostr << vv.front();
        for(auto itr = ++vv.begin(); itr != vv.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, vector<pair<T,U>>& vp){
    if(!vp.empty()){
        ostr << vp.front();
        for(auto itr = ++vp.begin(); itr != vp.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

typedef long long ll;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<double> vd;
// vll v(n); v[i]=x;
typedef vector<vll> vvll;
typedef vector<vc> vvc;
typedef vector<vd> vvd;
// vvll v(m,vll(n)); v[i][j]=x;
typedef pair<ll,ll> pll;
typedef pair<double,double> pd;
typedef vector<pll> vpll;
typedef vector<pd> vpd;
// vpll v(n); v[i]=make_pair(x,y); v[i].first/second;
// v.front() : v[0]
// v.back()  : v[v.size()-1]

#define PI 3.1415926535897932
#define EPS 1e-12
#define INF ((ll)1e+12)
#define REP(i,n) for(ll i=0; i<(n); i++)
#define RREP(i,n) for(ll i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(ll i=(a); i<=(b); i++)
#define FORR(i,a,b) for(ll i=(b); i>=(a); i--)
#define fix(x) cout << fixed << setprecision(x)
#define dump(x) cout << #x << " = " << (x) << endl
#define all(x) (x).begin(),(x).end()

template<typename T> T sum(vector<T>& v){return accumulate(all(v), (T)0);}
template<typename T> inline void sort(vector<T>& v){sort(all(v));}
template<typename T> inline void rsort(vector<T>& v){sort(all(v), greater<T>());}
template<typename T> inline void chmin(T& a, T b){if(a>b) a=b;}
template<typename T> inline void chmax(T& a, T b){if(a<b) a=b;}

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

    string si;
    map<string, int> s;
    REP(i,n){
        cin >> si;
        s[si]++;
    }
    cout << s.size() << endl;
    return 0;
}


Measured memory_bytes: 19224
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto N = readln.chomp.to!int;
    auto S = N.iota.map!(_ => readln.chomp).array;
    long ans = 0;

    foreach (i; 0..N) {
        bool ok = true;
        int a = 0;
        int b = i;
        foreach (j; 0..N) {
            int c = (a + j) % N;
            int d = (b + j) % N;
            foreach (k; 1..N-j) {
                if (S[(c+k)%N][d] != S[c][(d+k)%N]) {
                    ok = false;
                }
            }
        }
        ans += ok * N;
    }

    ans.writeln;
}


Measured memory_bytes: 380
IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 LN           PIC X(500).
01 N            PIC 9(3).
01 cur          PIC 9(10) VALUE 1.
01 i            PIC 9(18) VALUE 1.
01 j            PIC 9(18).
01 len          PIC 9(10). 
01 A            PIC 9(4) VALUE 1.
01 FLG          PIC 9(1) VALUE 1.

PROCEDURE DIVISION.
MAIN.
ACCEPT N.
ACCEPT LN.
PERFORM N TIMES
    PERFORM VARYING j FROM cur BY 1 UNTIL LN(j:1) = SPACE
    END-PERFORM
    COMPUTE len = j - cur
    MOVE LN(cur:len) TO A
    IF FUNCTION MOD(A, 2) = ZERO AND FUNCTION MOD(A, 3) NOT = ZERO
        AND FUNCTION MOD(A, 5) NOT = ZERO
        MOVE ZERO TO FLG
        EXIT PERFORM
    END-IF
    COMPUTE cur = j + 1
    ADD 1 TO i
END-PERFORM.
IF FLG = 1
    DISPLAY "APPROVED"
ELSE
    DISPLAY "DENIED"
END-IF.

MAIN-EXIT.
STOP RUN.


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

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : abs(x); }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

int h, w;
vector<string> g;

int bfs() {
	queue<pair<int, int>> que;
	vector<vector<int>> dist(h, vector<int>(w));

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (g[i][j] == '#') {
				dist[i][j] = 0;
				que.emplace(i, j);
			}
		}
	}

	while (!que.empty()) {
		int y = que.front().first;
		int x = que.front().second;
		que.pop();

		for (int i = 0; i < 4; i++) {
			int ny = y + dy[i];
			int nx = x + dx[i];

			if (ny < 0 || ny >= h || nx < 0 || nx >= w || g[ny][nx] == '#') {
				continue;
			}

			g[ny][nx] = '#';
			dist[ny][nx] = dist[y][x] + 1;
			que.emplace(ny, nx);
		}
	}

	int ans = 0;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			ans = max(ans, dist[i][j]);
		}
	}

	return ans;
}

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

	cin >> h >> w;

	g.resize(h);
	for (auto &v : g) {
		cin >> v;
	}

	int ans = bfs();
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 13456
S = input()

for s in S[0::2]:
    if s != 'R' and s != 'U' and s != 'D':
        print('No')
        quit()

for s in S[1::2]:
    if s != 'L' and s != 'U' and s != 'D':
        print('No')
        quit()

print('Yes')


Measured memory_bytes: 2940
#include <stdio.h>

int main(void) {
	int N,H,W,ans = 0;
	int A, B;
	scanf("%d%d%d", &N, &H, &W);
	for (int i = 0; i < N; i++)
	{
		scanf("%d%d", &A, &B);
		if (A >= H && B >= W)ans++;
	}
	printf("%d", ans);
	return 0;
}


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

#define reg(i,n) for(int i = 0;i < n;i++)

int main(){
  int k[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 n;
  cin >> n;
  cout << k[n-1] << endl;
  
  

}


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

const int num=1e9+7;

inline ll ex(ll x,ll n){
  if(n==0)return 1;
  else if(n%2==1)return ex(x,n-1)*x%num;
  else return ex(x*x%num,n/2)%num;
};

inline ll nikou(ll n,ll a){
  if(a>n/2)a=n-a;
  ll res1=1,res2=1;
  for(int i=0; i<a; i++){
    res1*=n-i;res1%=num;
    res2*=(i+1);res2%=num;
  }
  ll tmp=ex(res2,num-2)%num;
  return (res1*tmp)%num;
};

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  int ans=ex(2,n)-1;//あとはnCa,nCbを引きたい
  cout << ((ans%num)-(nikou(n,a)+nikou(n,b))%num+num)%num;
  cout << endl;
}



Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.*;
  public class Main
{
	public static void main (String[] args)
	 {
		Scanner sc=new Scanner(System.in);
		int t=1;
		int i;
		while(t>0) 
		{
			t--;
			long n=sc.nextInt();
			long d=sc.nextInt();
			long ans=0;
			for(i=0;i<n;i++)
			{
				long x=sc.nextInt();
				long y=sc.nextInt();
				double dis=Math.sqrt(x*x+y*y);
				if(dis<=d)
					ans++;
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 59736
#include "bits/stdc++.h"
using namespace std;

vector<vector<pair<int, int>>> hen(100000);
vector<bool> seen(100000, false);
vector<int> colors(100000, 0);

void dfs(int num, int color)
{
	seen.at(num) = true;
	colors.at(num) = color;
	for (auto hen_ele : hen.at(num)) {
		if (seen.at(hen_ele.first) == false) {
			if (hen_ele.second % 2 == 0) {
				dfs(hen_ele.first, color);
			} else {
				dfs(hen_ele.first, 1 - color);
			}
		}
	}
}

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		int u_in, v_in, w_in;
		cin >> u_in >> v_in >> w_in;
		hen.at(u_in - 1).push_back(make_pair(v_in - 1, w_in));
		hen.at(v_in - 1).push_back(make_pair(u_in - 1, w_in));
	}

	dfs(0, 0);

	for (int i = 0; i < n; i++) {
		cout << colors.at(i) << endl;
	}
}



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

inline int read() {
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar(); }
	return x * f;
}

int main() {
    int n = read(), k = read();
    if (k >= (1 << n)) {
        puts("-1");
        return 0;
    }
    if (n == 1) {
        if (k != 0) puts("-1");
        else puts("0 1 1 0");
        return 0;
    }
    for (int i = 0; i < (1 << n); i++) if (i != k) printf("%d ", i);
    printf("%d ", k);
    for (int i = (1 << n) - 1; i >= 0; i--) if (i != k) printf("%d ", i);
    printf("%d", k);
    puts("");
    return 0;
}

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


int main(){
	int cnt = 1;
	int N, X, pos = 0; cin >> N >> X;
	int L[N];
	for(int i=0; i<N; i++) cin >> L[i];
	for(int i=1; i<N+1; i++){
		if(pos + L[i-1] <= X) cnt++;
		pos += L[i-1];
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 256
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use std::cmp::*;
use std::collections::*;
use std::mem::*;

fn main() {
    let (r, w, e) = (std::io::stdin(), std::io::stdout(), std::io::stderr());
    let mut io = IO::new(r.lock(), w.lock(), e.lock());
    assert_eq!(!0usize, std::usize::MAX); //🙊
    assert!(0 == 0); //😇
    let a = io.readn::<i64>(3);
    io.writeln(if a[0] <= a[2] && a[2] <= a[1] {
        "Yes"
    } else {
        "No"
    });
}

static MX: usize = 1010101;
static MOD: i64 = 1000000007;
static INF: i64 = std::i64::MAX >> 1;
// IO
use std::io::*;
struct IO<R: Read, W: Write, E: Write> {
    Read: R,
    Write: BufWriter<W>,
    Error: BufWriter<E>,
}
impl<R: Read, W: Write, E: Write> IO<R, W, E> {
    fn new(r: R, w: W, e: E) -> IO<R, W, E> {
        IO {
            Read: r,
            Write: BufWriter::new(w),
            Error: BufWriter::new(e),
        }
    }
    fn read<T>(&mut self) -> T
    where
        T: std::str::FromStr,
    {
        let next: String = self
            .Read
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        next.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
    fn chari(&mut self) -> Vec<i64> {
        self.chars()
            .iter()
            .map(|&c| (c as u8 - b'0') as i64)
            .collect::<Vec<i64>>()
    }
    fn readn<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read::<T>()).collect::<Vec<_>>()
    }
    fn readmat<T: std::str::FromStr>(&mut self, n: usize, m: usize) -> Vec<Vec<T>> {
        (0..n).map(|_| self.readn(m)).collect()
    }
    fn write<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
    }
    fn writeln<S: ToString>(&mut self, val: S) {
        self.Write.write(val.to_string().as_bytes());
        self.Write.write(b"\n");
    }
    fn debug<S: std::fmt::Debug>(&mut self, val: S) {
        writeln!(self.Error, "(debug) {:?}", &val);
    }
    fn debug2<S: std::fmt::Debug, T: std::fmt::Debug>(&mut self, val1: S, val2: T) {
        writeln!(self.Error, "(debug2) {:?} -> {:?}", val1, val2);
    }
    fn debug3<S: std::fmt::Debug, T: std::fmt::Debug, U: std::fmt::Debug>(
        &mut self,
        val1: S,
        val2: T,
        val3: U,
    ) {
        writeln!(
            self.Error,
            "(debug3) {:?} -> {:?} -> {:?}",
            val1, val2, val3
        );
    }
}


Measured memory_bytes: 4352
s = input()
t = input()
ns = len(s)
nt = len(t)

ans = "UNRESTORABLE"
for i in range(ns - nt + 1):
    if all([s[i + j] == "?" or s[i + j] == t[j] for j in range(nt)]):
        ans = s[:i] + t + s[i + nt:]
        ans = ans.replace("?", "a")
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <iomanip>

int main()
{
	double a,b,c,S,L,h;
	double PI = acos(-1);
	
	std::cin >> a >> b >> c;
	S = a*b*sin(PI*c/180)/2;
	L = sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(PI*c/180)) + a + b;
	h = 2*S/a;
	
	std::printf("%.10f\n", S);
	std::printf("%.10f\n", L);
	std::printf("%.10f\n", h);
	
	return 0;
}



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

int main(){
    int n;
    cin >> n;
    int A[n];
    for(int i = 0; i < n; i++){
        cin >> A[i];
    }
    int count  = 0;
    int number = 1;
    for(int i = 0; i < n; i++){
        if(A[i] == number){
            number++;
        }else{
            count++;
        }
    }
    if(count == n){
        cout << -1 << endl;
    }else{
        cout << count << endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
using namespace std;

int N;

int main(){
  ios_base::sync_with_stdio(false); 
  cin >> N;
  vector<int> v(N);
  int mx = -INT_MAX;
  for(int i=0; i<N; ++i){
    cin >> v[i];
    mx = max(mx, v[i]);
  }
  long long res = INT_MAX;
  for(int i=-100; i<=100; ++i){
    long long t = 0;
    for(int j=0; j<N; ++j){
       t += (v[j]-i)*(v[j]-i);
    }
    res = min(res, t);
  }
  cout << res << "\n";
  return 0;
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = LIST()
A.sort(reverse=True)
print(min(abs(A[0]-A[1])+abs(A[1]-A[2]), abs(A[0]-A[2])+abs(A[2]-A[1])))

Measured memory_bytes: 5200
#include <bits/stdc++.h>
#define REP(i, a, n) for (long long i = (a); i < (long long)(n); ++i)
#define REPC(i, a, n) for (long long i = (a); i <= (long long)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define MATINIT(type, row, col, init)                                          \
  vector<vector<type>>(row, vector<type>(col, init));
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
template <typename T> ostream &operator<<(ostream &os, set<T> &s) {
  os << "{";
  for (auto p : s)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, map<T1, T2> &m) {
  os << "{";
  for (auto p : m)
    os << p << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "[" << p.first << " " << p.second << "]";
  return os;
}

int main() {
  int a;
  string s;
  cin>>a>>s;
  if(a>=3200){
    cout<<s<<endl;
  }else{
    cout<<"red"<<endl;

  }

  return 0;
}


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

void solve(long long N) {
    if (N % 2 == 0) {
        cout << N / 2 << endl;
    } else {
        cout << N / 2 + 1 << endl;
    }
}

int main() {
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//コピペするとこ



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


int main()
{
  ll a, b ;
  cin >> a >> b ;
  int ans = 0 ;
  ll x = a ;
  while(x<=b){
    x *= 2 ;
    ans++ ;
  }
  cout <<ans <<endl ;
  
  return 0 ;
}

Measured memory_bytes: 256