akhauriyash/Code-Regression huggingface dataset:
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int[] d = new int[N];

		int idx;
		for (idx = 0; idx < N; idx++) {
			d[idx] = Integer.parseInt(sc.next());
		}

		Arrays.sort(d);

		int low = d[N / 2 - 1];
		int high = d[N / 2];

		System.out.println(high - low);

	}

}


Measured memory_bytes: 48188
#!/usr/bin/env python3


def solve(t, paths):
    return min((p for p in paths if p[1] <= t), default=(None, None))[0]


def main():
    n, t = (int(z) for z in input().split())
    paths = (tuple(int(ct) for ct in input().split()) for _ in range(n))
    res = solve(t, paths)
    print("TLE" if res is None else res)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

X = input()
S = ""
for ch in X:
    if ch == 'S':
        S += ch
    else:
        if len(S) > 0 and S[-1] == 'S':
            S = S[:-1]
        else:
            S += ch
print(len(S))


Measured memory_bytes: 3816
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define mod 1000000007
#define INF 200000000000
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
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;}
#define all(x) x.begin(), x.end()

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



int main() {
    ll N;

    cin >>N;
    vector<ll> P(N);
    vector<ll> Q(N);
    vector<ll> a(N);

    rep(i,N){
        cin>> P[i];
    }
    rep(i,N){
        cin>> Q[i];
    }
    rep(i,N){
        a[i] = i+1;
    }
    ll pind=0, qind=0;
    ll pcnt = 0, qcnt =0; 
    do {
        for (int i = 0; i < N; i++) {
            if(a[i] != P[i]) break;
            if(i == N-1){
                pind = pcnt;
            }
        }
        pcnt++;

    } while(next_permutation(all(a)));

    rep(i,N){
        a[i] = i+1;
    }

    do {
        for (int i = 0; i < N; i++) {
            if(a[i] != Q[i]) break;
            if(i == N-1){
                qind = qcnt;
            }
        }
        qcnt++;

    } while(next_permutation(all(a)));
    cout << abs(pind-qind) << endl;
    
    
    return 0;
    

}

Measured memory_bytes: 3556
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)

int count(int N)
{

        int cnt = 0;
        while (N)
        {
                cnt++;
                N /= 10;
        }
        return cnt;
}

int main()
{
        int N, A, B;
        ll s = 0;

        cin >> N >> A >> B;

        if ((B - A) % 2 == 0)
        {
                cout << "Alice" << endl;
        }
        else
        {
                cout << "Borys" << endl;
        }

        return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    int n;
    cin>>n;
    int sum=0,m=0,l=0;
    for(int i=1;i<=n;++i){
        sum+=i;m=i;
        if(sum>n){l=sum-n;break;}
    }
    for(int i=1;i<=m;++i){
        if(i!=l)cout<<i<<endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n, d, x;
  cin >> n >> d >> x;

  vector<int> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];

  int ans = 0;
  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= d; j += a[i]) ans++;
  }

  cout << ans+x << endl;
}


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

int main()
{
	
	int N;
	int sum = 0;
	scanf("%d", &N);
	int j = 1;
	//	printf("%d\n", (12598%1));
	//	printf("%d\n", (12598/10) );
	//	printf("%d", (12598-(12598/10)*10-(12598%1))/1);
	
		for(int i = 1; (N/j*10) > 0; i++){
			sum = sum + ((N-(N/(j*10))*(j*10)-(N%j))/j);
			j = pow(10, i);
		//	printf("%d\n", sum);
		}
		
		//sum = sum + ((N - (N/(10)))*(10))-((N%1)/1);
		
		if((N%sum)!=0){
			printf("No");
		}
		else{
			printf("Yes");
		}

		
	
	
	
	
	
	return 0;
}

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

public class Solution
{
    public static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var A = vals[0];
        var V = vals[1];
        vals = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var B = vals[0];
        var W = vals[1];
        var T = long.Parse(Console.ReadLine());

        var d = V - W;
        if (d * T >= Math.Abs(A - B))
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
    }
}

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

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long

typedef pair<int, int> P;

int main(){
    int n, k;
    cin >> n >> k;
    int ans = n;
    vector<int> a(n);
    REP(i, n) cin >> a[i];

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

    int tmp = 0;
    REP_REV(i, n) {
        tmp += a[i];
        if(tmp >= k) {
            ans = i;
            int tmpp = tmp - a[i];
            while(i > 0) {
                if(tmpp + a[i-1] >= k) {
                    ans = i-1;
                    i--;
                } else {
                    tmp = tmpp;
                    break;
                }
            }
            //tmp = 0;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] r = new int[n];
        boolean[] p = new boolean[n];
        for(int i= 0; i < n; i++) {
            r[i] = in.nextInt() - 1;
        }
        int ans = 0;
        for(int i = 0; i < n; i++) {
            if(!p[i] && i == r[r[i]]) {
                p[i] = p[r[i]] = true;
                ans++;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 50660
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

int N;
void input()
{
    cin>>N;
}

void solve()
{
    if(N%10==3) cout<<"bon"<<endl;
    else if(N%10==0 || N%10==1 || N%10==6 || N%10==8) cout<<"pon"<<endl;
    else cout<<"hon"<<endl;
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

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

int memo[200000];
signed main() {
    int n, k;
    cin >> n >> k;
    set<int> v;
    for(int i=0; i<n; ++i) {
        int a;
        cin >> a;
        v.insert(a);
        memo[a]++;
    }
    vector<int> b;
    for(auto i : v) b.push_back(memo[i]);
    sort(b.begin(), b.end());
    int t = max((int)v.size() - k, 0);
    int ans = 0;
    for(int i=0; i<t; ++i) ans += b[i];
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 11516
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll n;
  cin>>n;
  ll s=sqrt(n);
  for(ll i=s;i>0;--i) if(n%i==0){cout<<i+n/i-2;return 0;}
  return 0;
}

Measured memory_bytes: 256
//Md Fahad
// CSE 18

#include<bits/stdc++.h>

using  namespace  std;

#define PI              acos(-1.0)
#define lcm(a,b)        (a * (b / __gcd(a,b)))
#define en '\n'

#define READ_IN freopen("Input.txt","r",stdin);
#define READ_OUT freopen("Output.txt","w",stdout);
#define Infi                0x3f3f3f3f

const int fx[] = {+1,-1,+0,+0};                         // 4 X directions
const int fy[] = {+0,+0,+1,-1};                         // 4 Y directions
const int fx8[] = {+0,+0,+1,-1,-1,+1,-1,+1};            // King X Moves
const int fy8[] = {-1,+1,+0,+0,+1,+1,-1,-1};            // King Y Moves
const int kx[] = {-2, -2, -1, -1,  1,  1,  2,  2};      // Knight X Moves
const int ky[] = {-1,  1, -2,  2, -2,  2, -1,  1};      // Knight Y Moves



int  Set    (int N,int pos) {return N=N | (1<<pos);}    /// turn a bit on
int  reset  (int N,int pos) {return N= N & ~(1<<pos);}  /// turn a bit off
bool check  (int N,int pos) {return (bool)(N & (1<<pos));} /// check, if a bit is on or not

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define trace(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define trace(x...)
#endif

typedef long long int           ll;
typedef unsigned long long int  llu;





int main(void)
{
    //READ_IN;
    //READ_OUT;

    ll n,k;
    cin >> n >> k;

    vector<ll> a(n);

    for(auto &it:a)
        cin >> it;

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

    ll sum =0;

    if(n<=k)
    {
        cout << 0 << endl;
        return 0;
    }
    else
    {
        for(int i=0;i<n-k;i++)
        {
            sum+=a[i];
        }
        cout << sum << endl;
    }

    return 0;
}



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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).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;
}

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using DoP = pair<double, double>;
using edge = struct { int to; double cost;}; // edge x = {to, cost}

const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1<<29;
const ll INF64 = 1ll << 45;
const int mod = 1000000007;

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

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

int main(){
  ll x; cin >> x;
  vector<ll> num(201, 0);
  for(ll i = 1; i <= 200; ++i) {
    num[i] = (ll)pow(i, 5);
    //cout << num[i] << endl;
  }
  for(ll i = 0; i <= 200; ++i) {
    for(ll j = 0; j <= 200; ++j) {
      if(num[i]-num[j] == x) {
        cout << i << " " << j << endl;
        return 0;
      }
      else if(num[i]+num[j] == x) {
        cout << i << " " << -j << endl;
        return 0;
      }
    }
  }
}

Measured memory_bytes: 4024
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int32_t, int32_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

int32_t neighbours[][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};

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

  string S;
  cin >> S;
  const int32_t length = static_cast<int32_t>(S.length());
  bool is_okay = false;
  if (S == "keyence") {
    is_okay = true;
  } else {
    for (int32_t start = 0; start < length; ++start) {
      for (int32_t sub_length = 1; start + sub_length <= length; ++sub_length) {
        const string modified_s = S.substr(0, start) + S.substr(start + sub_length, length);
        if (modified_s == "keyence") {
          is_okay = true;
          break;
        }
      }
      if (is_okay) {
        break;
      }
    }
  }
  if (is_okay) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


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

using namespace std;

typedef long long int ll;
typedef vector<ll> V;
typedef vector<V> VV;

int main() {
  // Happy hacking!
  ll n;
  V v, c;
  cin >> n;
  for(ll i=0; i<n; i++) {
    ll vt;
    cin >> vt;
    v.push_back(vt);
  }
  for(ll i=0; i<n; i++) {
    ll ct;
    cin >> ct;
    c.push_back(ct);
  }

  ll res = 0;
  for(ll i=0; i<n; i++) {
    ll hoge = v[i] - c[i];
    if(hoge > 0) {
      res += hoge;
    }
  }

  cout << res << endl;

  return 0;
}


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

using namespace std;
#define REPI(x) for(int i=0;i<x;i++)


int main ()
{
  string S;
  string subS;
  int j,start;
  long long res = 0;
  
  cin >> S;
  for (int i = 0; i < pow (2, S.size () - 1) ; i++) 
  {
    subS = S[0];
    j = 0;
    while (j < S.size () - 1)
    {
      if (i & (int)pow (2, j))      
        subS += '+';
      j++;
      subS += S[j];      
    }
    
    subS += '+';
    start = 0;
    for (int k = 0; k < subS.size (); k++)
    {
      if (subS[k] == '+')
      {
        res += atoll (subS.substr (start, k - start).c_str ());
        start = k + 1;
      }
      
    }
  }

  cout << res << endl;

  return 0; 
}

Measured memory_bytes: 512
s = input()
t = input()
num_s = len(s)
num_t = len(t)
idx_t = []

def match(s,i):
	if s[i] in (t[0],'?'):
		for j in range(num_t):
			if s[i+j] not in (t[j],'?'):
				return '!'
		return i
	else:
		return '!'

for i in range(num_s-num_t+1):
	idx = match(s,i)
	if idx != '!':
		idx_t.append(idx)

if len(idx_t) == 0:
	print('UNRESTORABLE')
else:
	s0 = s
	s_l = []
	for i in idx_t:
		if i == 0:
			s1 = t + s0[num_t:]
		elif i != num_s-num_t:
		  s1 = s0[:i] + t + s0[i+num_t:]
		else:
			s1 = s0[:i] + t
		s_l.append(s1)
	ans = min(s_l)
	print(ans.replace('?','a',100))
	
				

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
using Data = pair<long long, vector<int> >;
typedef unsigned long long ull;
int X, Y, Z, K; 

int main(){
    cin >> X >> Y >> Z >> K;
    std::vector<ull> A(X, 0);
    std::vector<ull> B(Y, 0);
    std::vector<ull> C(Z, 0);
    std::vector<int> N{X, Y, Z};
    for (int i = 0; i < X; ++i) cin >> A[i]; sort(A.begin(), A.end(), greater<ull>()); 
    for (int i = 0; i < X; ++i) cin >> B[i]; sort(B.begin(), B.end(), greater<ull>());
    for (int i = 0; i < X; ++i) cin >> C[i]; sort(C.begin(), C.end(), greater<ull>());
    
    priority_queue<Data> que;
    set<Data> se;
    que.push(Data(A[0] + B[0] + C[0], vector<int>({0, 0, 0})));

    for (int k = 0; k < K; ++k){
        Data now = que.top(); que.pop();
        cout << now.first << endl;
        for (int j = 0; j < 3; ++j){
            if (now.second[j] + 1 < N[j]){
                auto num = now.second;
                num[j]++;
                ull sum = A[num[0]] + B[num[1]] + C[num[2]];
                Data d = Data(sum, num);
                
                if (!se.count(d)) se.insert(d), que.push(d);
            }
        }
        
    }
}

Measured memory_bytes: 1408
import java.util.*;

public class Main{
	public static void main(String[] $){
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		ArrayList<String> l=new ArrayList<>();

		int r=0;
		boolean f=false;

		int xa=0;
		int ba=0;
		int bx=0;

		for(int i=0;i<n;++i){
			String v=s.next();
			r+=ab(v);
			if(v.endsWith("A")){
				if(v.startsWith("B"))
					++ba;
				else
					++xa;
			}else{
				if(v.startsWith("B"))
					++bx;
			}
		}
		if(ba>0) {
			r+=ba-1;
			ba=0;
			if(xa>0) {
				--xa;
				++r;
			}
			if(bx>0) {
				--bx;
				++r;
			}
		}
		r+=Math.min(xa,bx);

		System.out.println(r);
		System.err.println(r+" "+xa+" "+ba+" "+bx);
	}

	private static int ab(String v){
		int r=0;
		for(int i=0,e=v.length()-1;i<e;++i){
			if(v.charAt(i)=='A'&&v.charAt(i+1)=='B')
				++r;
		}
		return r;
	}
}

Measured memory_bytes: 30788
var input = '';
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chunk) {
  input += chunk;
  var match = input.match(/^(\d+)\n/);
  if( match )
  {
    var num = match[1];
    console.log( num * num * num );
  }
});

Measured memory_bytes: 7644
#include <iostream>
#include <string>

char Compare_Func(const char arg_a);

const int L_CHAR_MIN = 0x41;	// A
const int L_CHAR_MAX = 0x5a;	// Z
const int S_CHAR_MIN = 0x61;	// a
const int S_CHAR_MAX = 0x7a;	// z

int main()
{
	char Result = NULL;
	char Char_Temp = NULL;
	std::string buf;
	std::cin >> buf;
	if (!buf.empty())
	{
		Char_Temp = buf[0];
	}
	Result = Compare_Func(Char_Temp);
    std::cout << Result <<std::endl;
}


char Compare_Func(const char arg_a)
{
	char temp = NULL;
	if (((L_CHAR_MIN <= arg_a) && (L_CHAR_MAX >= arg_a)) || ((S_CHAR_MIN <= arg_a) && (S_CHAR_MAX >= arg_a)))
	{
		if ((L_CHAR_MIN <= arg_a) && (L_CHAR_MAX >= arg_a))
		{
			temp = 'A';
			return temp;
		}
		if ((S_CHAR_MIN <= arg_a) && (S_CHAR_MAX >= arg_a))
		{
			temp = 'a';
			return temp;
		}
	}
	return temp;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
  typedef long long ll;
int main()
{
      int n,a[100005];
      double s=0;
      cin>>n;
   for(int i=0;i<n;i++)
      {
            cin>>a[i];
      }
      sort(a,a+n);
      s=(a[0]+a[1])/2.0;
      for(int i=2;i<n;i++)
      {
            s=(s+a[i])/2.0;
      }
      cout<<s<<endl;

    return 0;
}


Measured memory_bytes: 256
N,M = map(int, input().split())
A = list(map(int, input().split()))
a = sum(A)
A = sorted(A, reverse=True)
A = A[0:M]
count = 0
for i in range(M):
  if A[i]<1/(4*M)*a:
    count += 1
if count==0:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 9192
#include <bits/stdc++.h>
#include <numeric>
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1N(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
typedef unsigned long long ull ;
using namespace std ;

ull gcd(ull a, ull b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

ull lcm(ull a, ull b)
{
   return a * b / gcd(a, b);
}

ull f( ull x, ull c, ull d )
{
  ull res = x ;
  res -= x/c ;
  res -= x/d ;
  res += x/lcm( c, d ) ;
  return res ;
}

int main()
{
  ull a, b, c, d ;
  cin >> a >> b >> c >> d ;
  
  int lcm_val = lcm( c, d ) ; 

  
  cout << f(b, c, d) - f(a-1, c, d);
  
  return 0 ;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, x, t;
  cin >> n >> x >> t;
  
  int count = 0;
  while (n > 0) {
    n -= x;
    count++;
  }
  
  cout << t * count << '\n';
}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main(void){
  int n,a[100],j=0;
  cin >> n;
  for(int i=0;i < n;i++){
    cin >> a[i];
  }
  for(int i=0;i < n;i+=2){
    if(a[i]%2 == 1){
      j++;
    }
  }
  cout << j;
}


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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
vector<T> makeVector(size_t a, T b) { return (vector<T>(a, b)); }
template<typename... Ts>
auto makeVector(size_t a, Ts... ts) { 
	return (vector<decltype(makeVector(ts...))>(a, makeVector(ts...)));
}

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

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

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	ll N, K; cin >> N >> K;
	vector<Pl> dats(N);
	for (auto &dat : dats) {
		cin >> dat.second >> dat.first;
	}
	sort(rbegin(dats), rend(dats));
	vll cnt(100005, 0ll);
	ll knum = 0;
	ll sum = 0;
	for (int i = 0; i < K; i++) {
		sum += dats[i].first;
		if (!cnt[dats[i].second]) knum++;
		cnt[dats[i].second]++;
	}
	ll maxv = sum + knum*knum;
	ll r = K;
	for (ll l = K-1; l >= 0; l--) {
		if (cnt[dats[l].second] > 1) {
			cnt[dats[l].second]--;
			sum -= dats[l].first;
			while (r < N && cnt[dats[r].second]) r++;
			if (r < N) {
				cnt[dats[r].second]++;
				sum += dats[r].first;
				knum++;
				chmax(maxv, sum + knum*knum);
			}
		}
	}
	cout << maxv << endl;
}

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


Measured memory_bytes: 5588
n,k=list(map(int,input().split()))
ans=[0]*105
c=0
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for j in range(len(a)):
        ans[a[j]-1]=ans[a[j]-1]+1
for i in range(n):
    if ans[i]==0:
        c=c+1
print(c)

Measured memory_bytes: 67712
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      hs: [i64; n],
    }

    const INF: i64 = 1 << 50;
    let mut dp = vec![INF; n];
    dp[0] = 0;
    for i in 0..n {
        if i + 2 < n {
            dp[i+2] = min(dp[i+2], dp[i] + (hs[i+2] - hs[i]).abs());
        }
        if i + 1 < n {
            dp[i+1] = min(dp[i+1], dp[i] + (hs[i+1] - hs[i]).abs());
        }
    }
    puts!("{}\n", dp[n-1]);
}


Measured memory_bytes: 6396
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
ll N;
int main(){
	cin.tie(0);
	cin.sync_with_stdio(false);
	cin>>N;
	cout<<(N%10==7||N/10%10==7||N/100==7?"Yes":"No")<<endl;
}


Measured memory_bytes: 3656
#include<stdio.h>
int main(void)
{
 
  int a, b, r, tmp;
  scanf("%d", &a);
  scanf("%d", &b);
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  printf("%d\n", b);
 
  return 0;
}



Measured memory_bytes: 2100
#include <bits/stdc++.h>
using namespace std;
const int MOD =(int)(1e9)+7;
int main()
{
    int N,K;
    cin >> N >> K;
    long long ans=0;
    int a[N];
    vector<long long>B(N);
    for(int i=0;i<N;i++){
        cin >> a[i] >> B[i];
    }

    for(int i=0;i<N;i++){
        bool ok=true;
        for(int j=33;j>=0;j--){
            ok&=((K&(1L<<j))!=0)||((a[i]&(1L<<j))==0);
        }
        if(ok)ans+=B[i];
    }

    for(int b=33;b>=0;b--){
        if((K&(1L<<b))==0)continue;
        long long sum=0;
        for(int i=0;i<N;i++){
            bool ok=true;
            for(int j=33;j>=0;j--){
                if(j>b){
                    ok&=((K&(1L<<j))!=0)||((a[i]&(1L<<j))==0);
                }
                else if(j==b){
                    ok&=((a[i]&(1L<<j))==0);
                }
            }
            if(ok)sum+=B[i];
        }
        ans=max(ans,sum);
    }
    cout << ans << endl;

    return 0;
}

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

int main(void)
{
    int num,score[1000],i;
    double average,sigma,sum;

    while(1){
        scanf("%d",&num);
        if (num==0) break;
        sum=0;

        for (i=0; i<num; i++) {
            scanf("%d",&score[i]);
            sum+=score[i];
        }

        average=1.0*sum/num;
        sum=0;

        for (i=0; i<num; i++) sum+=(score[i]-average)*(score[i]-average);
        sigma=sum/num;

        printf("%.8lf\n",sqrt(sigma));
    }
    return 0;
}


Measured memory_bytes: 2112
use std::io::*;
use std::str::FromStr;
   
fn read<T: FromStr>() -> T {
	let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

     
fn main() {
	let n: usize = read();
    let s: String = read();
    let t: String = read();
	
    let mut u: String = String::new();

	for i in 0..n {
		u.push(s.as_bytes()[i] as char);
		u.push(t.as_bytes()[i] as char);
	}
	println!("{}", u);
}


Measured memory_bytes: 4352
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def func(n):
    if n % 2 == 0: return n // 2
    return 3 * n + 1


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    ans = [N]
    cnt = 0
    while True:
        q = func(ans[cnt])
        if q in ans:
            print(len(ans) + 1)
            exit()
        else:
            ans.append(q)
            cnt += 1


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <set>
#include <cstring>

using namespace std;

void solve()
{
	int d[51][31];
	int m[51][51];
	int n;
	while(cin >> n, n)
	{
		memset(d, 0, sizeof(d));
		memset(m, 0, sizeof(m));
		for(int i = 0; i < n; ++i)
		{
			int num;
			cin >> num;
			for(int j = 0; j < num; ++j)
			{
				int t;
				cin >> t;
				d[i][t] = 1;
			}
			m[i][i] = 1;
		}
		for(int t = 1; t <= 30; ++t)
		{
			set<int> Set;
			for(int i = 0; i < n; ++i)
			{
				if(!d[i][t])
				{
					continue;
				}
				for(int j = 0; j < n; ++j)
				{
					if(m[i][j])
					{
						Set.insert(j);
					}
				}
			}
			for(int i = 0; i < n; ++i)
			{
				if(!d[i][t])
				{
					continue;
				}
				for(set<int>::iterator It = Set.begin(); It != Set.end(); ++It)
				{
					m[i][*It] = 1;
				}
			}
			if(Set.size() == n)
			{
				cout << t << endl;
				goto NEXT;
			}
		}
			cout << -1 << endl;
NEXT:
	;
	}
}

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

Measured memory_bytes: 0
import math

n, k  = map(int, input().split())
if k<=n:
    ans = 0
    for i in range(1, k):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
    ans/=n
    ans += (n-k+1)/n
    print(ans)
else:
    ans = 0
    for i in range(1, n+1):
        m = math.ceil(math.log2(k/i))
        ans+=1/pow(2, m)
    ans/=n
    print(ans)

Measured memory_bytes: 64968
n=int(input())
place=[0,0]
bf_t=0
flag=0
for _ in range(n):
    t,x,y=map(int, input().split(" "))
    if (abs(place[0]-x) + abs(place[1] - y)) > (t-bf_t):
        #print("aaa")
        flag=1
        break
    elif (t-bf_t)%2 != ((place[0]+place[1]) - (x + y))%2:
        #print("bbb")
        flag=1
        break
    place[0]=x
    place[1]=y
    bf_t=t

if flag==0:
    print("Yes")
else:
    print("No")


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

main(){
  int n;cin >> n;
  vector<int> x(n),y(n),h(n);
  for(int i=0;i<n;i++) cin >> x[i] >> y[i] >> h[i];
  int max=100;
  for(int posY=0;posY<=max;posY++){
    for(int posX=0;posX<=max;posX++){
      int needH=-1;
      for(int i=0;i<n;i++){
        if(h[i]>0){
          int tmp=h[i]+abs(x[i]-posX)+abs(y[i]-posY);
          if(needH==-1){
            needH=tmp;
          }
          else {
            if(needH!=tmp){
              needH=-2;
              break;
            }
          }
        }
      }
      if(needH==-2) continue;
      for(int i=0;i<n;i++){
        if(h[i]==0){
          int dist=abs(x[i]-posX)+abs(y[i]-posY);
          if(needH>dist){
            needH=-2;
            break;
          }
        }
      }
      if(needH==-2) continue;
      cout << posX <<" "<< posY <<" "<< needH << endl;
      return 0;  
    }
  }
}

Measured memory_bytes: 3592
import sys
input = sys.stdin.readline
N = int(input())
L = list(map(int, input().split()))

L.sort()
#print(L)

from bisect import bisect_right,bisect_left

ans = 0
for i, a in enumerate(L[:-2]):
    for j, b in enumerate(L[i+1:-1]):
        j=i+1+j
        #print(a+b, abs(a-b), i, j)
        #for k, c in enumerate(L[j+1:]):
        #    if abs(a-b) < c and c < a+b:
        #        ans += 1
        #    if c >= a+b:
        #        break
        l = bisect_left(L, abs(a-b),j+1)
        r = bisect_left(L, a+b,j+1)
        #print(r-l)
        ans += r-l
print(ans)

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

int main() {
    int a, b; cin >> a >> b;
    if (a > 0 && a < 10 && b > 0 && b < 10) cout << a * b << endl;
    else cout << -1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  vector<int> h(n+1);
  for(int i=1;i<n+1;i++) cin>>h[i];
  vector<int> c(n+1,0);
  for(int i=1;i<n+1;i++){
    if(i==1) c[i]=0;
    else c[i]=c[i-1]+abs(h[i]-h[i-1]);
    for(int j=1;j<k+1;j++){
      if(i-j>0) c[i]=min(c[i],c[i-j]+abs(h[i]-h[i-j]));
    }
  }
  cout<<c[n]<<endl;
}

Measured memory_bytes: 1024
n = int(input())
my_cards = {input() for _ in range(n)}
lost_cards = (
  "{} {}".format(s, i)
  for s in ('S', 'H', 'C', 'D')
  for i in range(1, 13 + 1)
  if "{} {}".format(s, i) not in my_cards
)
for card in lost_cards:
  print (card)

Measured memory_bytes: 7644
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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

	int W, H, x, y;
	cin >> W >> H >> x >> y;
	cout << (double)W * H / 2 <<" ";

	if (x*2==W&&y*2==H) {
		cout << 1 << endl;
	}
	else {
		cout << 0 << endl;
	}

	return 0;
}



Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int N;
	string S;
	int K;
	cin >> N >> S >> K;

	char ch = S[K - 1];
	for (int i = 0 ; i < N; i++) {
		if (ch == S[i]) {
			cout << S[i];
		}
		else {
			cout << "*";
		}
	}
	cout << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int H;
  char mas[10][5];
  while( cin >> H, H){
    for(int i = 0; i < H; i++){
      for(int j = 0; j < 5; j++){
        cin >> mas[i][j];
      }
    }

    int ret = 0;
    bool changed = true;

    for(int foo = 0; foo < 7; foo++){
      
      for(int q = 0; q < 7; q++){
        for(int i = H - 1; i > 0; i--){
          for(int j = 0; j < 5; j++){
            if(mas[i][j] == '*'){
              swap(mas[i][j],mas[i - 1][j]); //上から持ってくる
            }
          }
        }
      }

      for(int i = 0; i < H; i++){
        char prev = mas[i][0];
        int cnt = 0;
        for(int j = 0; j < 5; j++){
          if(mas[i][j] == '*'){
            cnt = 0;
            continue;
          }
          if(mas[i][j] != prev){
            prev = mas[i][j];
            cnt = 0;
          }
          cnt++;
          if(cnt == 3){
            ret += (mas[i][j] - '0') * 3;
            for(int k = j, l = 0; l < cnt; l++, k--){
              mas[i][k] = '*';
            }
          } else if(cnt > 3){
            ret += (mas[i][j] - '0');
            mas[i][j] = '*';
          }
        }
      }
    }
    cout << ret << endl;
  }
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		String ans = "No";
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= 9; j++) {
				if (i * j == n) {
					ans = "Yes";
				}
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	}
	
}




Measured memory_bytes: 26972
program test
implicit none

integer(8) :: x
real(8) :: ans,p

read(*,*) x
read(*,*) p

if(p == 100) then
	if(mod(x,2) == 0)then
		ans = x/2.
	else
		ans = (x-1)/2. + 1.
	endif
else
	if(mod(x,2) == 0)then
		ans = (x/2.) * (100./p)
	else if(x == 1) then
		ans = 1. + 100./p
	else
		ans = 1. + (p/100.) * ((x-1.)/2.) * (100./p) + (1.-p/100.) * ((x+1.)/2.) * (100./p)
	endif
endif


write(*,*) ans

end program

Measured memory_bytes: 512
import java.util.AbstractMap.SimpleEntry;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		try(Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			List<SimpleEntry<Integer, Integer>> list = new ArrayList<>();
			for(int i = 0 ; i < n ; i++) {
				list.add(new SimpleEntry<Integer, Integer>(sc.nextInt(), sc.nextInt()));
			}
			Collections.sort(list, (e1, e2) -> {
				return Integer.compare(e1.getValue(), e2.getValue());
			});
			int current = 0;
			for(SimpleEntry<Integer, Integer> entry : list) {
				if(current + entry.getKey() > entry.getValue()) {
					System.out.println("No");
					System.exit(0);
				} else {
					current += entry.getKey();
				}
			}
			System.out.println("Yes");
		}

	}

}


Measured memory_bytes: 117004
#include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll> 
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++) 
#define forr1(i, n) for(ll i=1; i<=n; i++)
using namespace std;
const ld PI =3.1415926535897923846;
const ll MOD = 1000000007;
const ll N=998244353;
ll power(ll x,ll n){ll res=1;while(n>0){if(n&1) res=res*x%MOD;x=x*x%MOD;n>>=1;}return res;}
ll modinverse(ll a){return power(a, MOD-2);}
void solve()
{
    ll n;
    cin>>n;
    vl a(n);
    forr(i, n)
    {
    	cin>>a[i];
    }
    vl count(60, 0);
    forr(i, n)
    {
    	ll nm=a[i];
    	forr(j, 60)
    	{
    		if( ( ( ( ll ) 1 << j ) & nm ) )
    			{
    				count[j]++;
    			}
    	}
    }
    ll ans=0;
    forr(i, 60)
    {
    	ll k=count[i];
    	if(!k)
    		continue;
    	ll term=(((n*(n-1)/2))-((n-k)*(n-k-1)/2)-(k*(k-1)/2))%MOD;
    	term*=(power(2, i))%MOD;
    	term%=MOD;
    	ans+=term;
    	ans%=MOD;
    }
    cout<<ans<<endl;
}
int main()
{
	#ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll test=1;
    //cin>>test;
    while(test--)
    {
        solve();
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 5540
using System;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Text;


namespace aizu
{
	public class EntryPoint
	{
		public static int[] Split(string line)
		{
			return Regex.Split(line, " ").Select(x => int.Parse(x)).ToArray();
		}
		public static void Main()
		{
//			var line = Console.ReadLine();
			
//			var v = Split(line);
			
			
			for (int i = 1; true; i++)
			{
				var line = Console.ReadLine();
				var v = int.Parse(line);
				if (0 == v) break;
				
				Console.WriteLine(string.Format("Case {0}: {1}", i, v));
			
			}

			
			
		}
	}


}

Measured memory_bytes: 5844
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define int long long
#define ld long double
#define sb __builtin_popcount
#define vi vector<int>
#define vc vector<char>
#define ii pair<int, int>
#define pq priority_queue<ii, vector<ii>, greater<ii>>
#define vii vector<ii>
#define sz(a) int((a).size())
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <=n; i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rloop(i,a,b) for(int i=a;i>=b;i--)
#define in(a, b) (b.find(a) != string::npos)
#define minin(a) *min_element(all(a))
#define maxin(a) *max_element(all(a))
#define X first
#define Y second
#define fill(a, x) memset(a, x, sizeof(a))
#define pb push_back
#define pf push_front
#define all(v) v.begin(), v.end()
#define rall(v) reverse(v.begin(), v.end())
#define el "\n"
#define mx3(a, b, c) max(max(a, b), c)
#define mn3(a, b, c) min(min(a, b), c)
#define S(v) accumulate(all(v), (ll)0)
#define SP(n) cout.precision(n)
#define PI = atan(1.0) * 4.0;
#define MOD = 1e9 + 7;
void start() {
    fio;
    SP(10);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int32_t main() {
    start();
    int n, q;
    cin >> n;
    int x;
    map<int, int>mp;
    int sm = 0;
    for (int i = 0; i < n; i++) {
        cin >> x;
        mp[x]++;
        sm += x;
    }
    cin >> q;
    int a, b;
    while (q--) {
        cin >> a >> b;
        if (mp[a]) {
            sm -= mp[a] * a;
            sm += b * mp[a];
            mp[b] += mp[a];
            mp[a] = 0;
        }
        cout << sm << el;
    }
    return 0;
}


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

int main() {

  long long N, D;
  cin >> N >> D;

  long long x, y;
  int cnt = 0;
  for(int i = 0; i < N; i++){
    cin >> x >> y;
    if((x * x + y * y) <= D * D){
      cnt++;
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define int long long int
#define endl "\n"
using namespace std;
void solve()
{
	//Enter your code here Tanmay:)
	int n,k,q;
	cin>>n>>k>>q;
	int arr[q];
	int a[n];
	for(int i=0;i<q;i++)
	{
		cin>>arr[i];
	}
	for(int i=0;i<n;i++)
	a[i]=k-q;
	map<int ,int>mp;
	for(int i=0;i<q;i++)
	{
		mp[arr[i]]++;
	}
	for(auto x:mp)
	{
		a[x.first-1]+=x.second;
	}
	for(int i=0;i<n;i++)
	{
		if(a[i]<=0)
			cout<<"No"<<endl;
		else
			cout<<"Yes"<<endl;
	}
}
signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}
void fastscan(int &number) 
{ 
    //variable to indicate sign of input number 
    bool negative = false; 
    register int c; 
  
    number = 0; 
  
    // extract current character from buffer 
    c = getchar(); 
    if (c=='-') 
    { 
        // number is negative 
        negative = true; 
  
        // extract the next character from the buffer 
        c = getchar(); 
    } 
  
    // Keep on extracting characters if they are integers 
    // i.e ASCII Value lies from '0'(48) to '9' (57) 
    for (; (c>47 && c<58); c=getchar()) 
        number = number *10 + c - 48; 
  
    // if scanned input has a negative sign, negate the 
    // value of the input number 
    if (negative) 
        number *= -1; 
} 

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


def read():
    N, H = map(int, input().strip().split())
    A, B = [], []
    for i in range(N):
        a, b = map(int, input().strip().split())
        A.append(a)
        B.append(b)
    return N, H, A, B


def solve(N, H, A, B):
    # 刀を振り続ける->最後にまとめて投げる
    amax = max(A)
    B.sort(reverse=True)
    ans = 0
    for b in B:
        if amax >= b:
            break
        H -= b
        ans += 1
        if H <= 0:
            break
    if H > 0:
        ans += H // amax
        if H % amax > 0:
            ans += 1 
    return ans


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Measured memory_bytes: 16816
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

L = len(make_divisors(N))

A = make_divisors(N)

ans = 0
for i in range(1,L):
    t = N
    while t%(A[i]) == 0:
        t = t//A[i]
    if t%A[i] == 1:
        ans = ans + 1
        
print(ans + len(make_divisors(N-1)) -1)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
int n, a, b, c;
int l[8];
int ans = 1e9;

void dfs(int i, int x, int y, int z, int xn, int yn, int zn){
    if(i == n){
        int cost = 0;
        cost += (xn-1)*10;
        cost += (yn-1)*10;
        cost += (zn-1)*10;
        cost += (abs(a - x) + abs(b - y) + abs(c - z));
        if(xn == 0 || yn == 0 || zn == 0) cost = 1e9;
        ans = min(ans, cost);
        return;
    }

    dfs(i+1, x+l[i], y, z, xn+1, yn, zn);
    dfs(i+1, x, y+l[i], z, xn, yn+1, zn);
    dfs(i+1, x, y, z+l[i], xn, yn, zn+1);
    dfs(i+1, x, y, z, xn, yn, zn);
}

int main(){
    cin >> n >> a >> b >> c;
    for(int i=0; i<n; i++) cin >> l[i];
    dfs(0, 0, 0, 0, 0, 0, 0);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256