akhauriyash/Code-Regression huggingface dataset:
// 見せてやるぜ、奇跡ってやつをよぉ……
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

int n;
V<int> a, b;

bool check(ll mask) {
    for (int i = 0; i < n; i++) {
        V<int> ch(51, 0);
        ch[a[i]] = 1;
        for (int j = 50; j >= 0; j--) {
            if (ch[j] == 1) {
                for (int k = j; k >= 1; k--) {
                    if ((mask >> k) & 1) ch[j % k] = 1;
                }
            }
        }
        if (ch[b[i]] == 0) return false;
    }
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    a.resize(n), b.resize(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i];

    ll mask = (1LL << 51) - 1;
    if (!check(mask)) {
        cout << -1 << '\n';
        return 0;
    }

    for (int i = 50; i >= 0; i--) {
        mask ^= (1LL << i);
        if (!check(mask)) mask ^= (1LL << i);
    }
    cout << mask << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
  int A,B,C=0;
  scanf("%d %d",&A,&B);
  C = A + B;
  if (C%2==0) {
    printf("%d\n",C/2);
  } else {
    printf("IMPOSSIBLE\n");
  }
  return 0;
}

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

long long calc(string s){
  int N = s.size();
  long long ret = stoll(s);
  
  //recursive step
  for(int i=1;i<N;i++){
    string sl = s.substr(0,i);
    string sr = s.substr(i,N-i);
    ret += stoll(sl)*pow(2,sr.size()-1);
    ret += calc(sr);
  }
  
  return ret;
}

int main(){
  string s;
  cin >> s;
  cout << calc(s) << endl;
  
  return 0;
}

Measured memory_bytes: 3944
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int arr[n];
	memset(arr,0,sizeof(arr));
	for(int i=0;i<n-1;i++){
		int a;
		cin>>a;
		arr[a-1]++;
	}
	
	for(int i=0;i<n;i++){
		cout<<arr[i]<<"\n";
	}
	return 0;
}    


Measured memory_bytes: 4424
#include <bits/stdc++.h>
using namespace std;
int main () {
  long N,K;
  cin >> N >> K;
  long quo = N / K;
  if (K % 2 == 1) {
    cout << (long)quo * quo * quo << endl;
  } else {
    if (N - K * quo >= K / 2)cout << (long)quo * quo * quo + (quo + 1)*(quo + 1)*(quo + 1) << endl;
    else cout << (long) 2 * quo * quo * quo << endl;
  }
  return 0;
}


Measured memory_bytes: 256
def az10():
    while True:
        xs = raw_input().split()
        a,op,b = int(xs[0]),xs[1],int(xs[2])
        if op == "?" : break
        if op == "+" : print (a + b)
        if op == "-" : print (a - b)
        if op == "*" : print (a * b)
        if op == "/" : print (a / b)

az10()

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

#define int long long
#define pb push_back
#define mp make_pair
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin>>n;
    vector<pair<int,int>> v;

    int a,b;
    for(int i=0;i<n;i++)
    {
        cin>>a>>b;
        v.pb(mp(b,a));
    }

    sort(v.begin(),v.end());
    int t=0;
    for(int i=0;i<n;i++)
    {
        t+=v[i].second;
        if(t>v[i].first)
        {
            cout<<"No";
            return 0;
        }
    }

    cout<<"Yes";

    return 0;
}

/*



*/

Measured memory_bytes: 6600
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;
  vector<int> l(n);
  rep(i, 0, n) cin >> l[i];
  int max_val = *max_element(l.begin(), l.end());
  int sum_val = accumulate(l.begin(), l.end(), 0);
  if (max_val < sum_val - max_val)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}


Measured memory_bytes: 384
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val set = mutableSetOf<Int>()
    for (i in 0..n-1) {
        val value = scanner.nextInt()
        if (set.contains(value)) {
            println("NO")
            return
        } else {
            set.add(value)
        }
    }

    println("YES")
}

Measured memory_bytes: 88580
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,i,j,sum=0;
    cin>>n;
    cin.ignore();
    string a;
    cin>>a;

    for(i=0;i<n-2;i++)
    {

            if(a[i]=='A')
            {
                if(a[i+1]=='B')
                {
                    if(a[i+2]=='C'){
                        sum++;
                    }
                }
        }
    }
    cout<<sum<<endl;
}


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

int main(){

    string S;
    cin >> S;

    if (S.length() == 2) {
        cout << S << endl;
    } else {
        cout << S[2] << S[1] << S[0] << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

ll ll_gcd(ll a, ll b) {
    if (a < b) return ll_gcd(b, a);
    ll r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

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

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll n;
    cin >> n;
    vector<vector<ll>> z(20, vector<ll>{-1});
    vector<ll> s(n);
    vector<vector<ll>> u(n, vector<ll>(20));
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        for (int j = 0; j < 20; j++) {
            if (s[i] & (1 << j)) {
                u[i][j] = z[j].size();
                z[j].push_back(i);
            }
        }
    }
    for (int j = 0; j < 20; j++) {
        z[j].push_back(n);
    }
    vector<ll> dp(n+1);
    dp[n] = 0;
    ll ans = 0;
    for (int i = n-1; i > -1; i--) {
        ll zans = dp[i+1]+1;
        for (int j = 0; j < 20; j++) {
            if (s[i] & (1 << j)) {
                zans = min(zans, z[j][u[i][j]+1] - i);
            }
        }
        ans += zans;
        dp[i] = zans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 61368
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
using namespace std;
typedef pair<int, int> P;
typedef long long LL;

#define _CRT_SECURE_NO_WARNINGS
LL X,Y;
int main() {
	scanf("%lld %lld",&X,&Y);
	int n = 1;
	while(1) {
		X = X<< 1;
		if (X>Y) {
			break;
		}
		n++;
	}
	printf("%d\n",n);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <sstream>
#include <fstream>

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)

using namespace std;
typedef long long unsigned int ll;

int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int i = 1; i <= N; i+=2) {
    int cnt = 0;
    for (int y = 1; y <= i; ++y) {
      if (i % y == 0)
	cnt++;
    }
    if (cnt == 8) ans++;
  }
  cout << ans << endl;
  return 0;
}


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

int main()
{
	int n, m;
	cin >> n >> m;
	vector<pair<long long,long long>> store;
	for (int i = 0; i < n; i++) {
		long long a, b;
		cin >> a >> b;
		store.push_back(make_pair(a, b));
	}
	if (store.size() > 1) {
		sort(store.begin(), store.end());
	}
	long long ans = 0;
	int i = 0;
	while (1) {
		if (store[i].second < m) {
			m = m - store[i].second;
			ans = ans + store[i].second * store[i].first;
		}
		else {
			ans = ans + m * store[i].first;
			break;
		}

		i++;
	}

	cout << ans << endl;
	return 0;

}

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

typedef long long ll;

int main() {
    ll N, X, M, A;
    cin >> N >> X >> M;
    vector<ll> R(M, -1), S(M + M, 0);
    A = X;
    R[A] = 0;
    S[1] = A;
    int B, C;
    rep(i, M + M) {
        A = (A * A) % M;
        //cout << "i=" << i << " A=" << A << "\n";
        S[i + 2] = S[i + 1] + A;
        if (R[A] != -1) {
            B = R[A];
            C = i + 1;
            break;
        }
        R[A] = i + 1;
    }
    /*
    cout << B << " " << C << "\n";
    rep(i, C - B + 1) {
        cout << "S[" << i + B << "]=" << S[i + B] << "\n";
    }
    */
    if (N <= C) {
        cout << S[N] << "\n";
        return 0;
    }
    ll q = (N - B) / (C - B);
    ll r = (N - B) % (C - B);
    ll ans = S[B] + q * (S[C] - S[B]) + S[B + r] - S[B];
    cout << ans << "\n";
}

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

using namespace std;
using ll = long long;
using ld = long double;

const ll MOD = 1e9 + 7;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);

  int n, k;
  vector<ll> pos, neg;
  int zero = 0;

  cin >> n >> k;
  for(int i = 1; i <= n; i++) {
    ll x;
    cin >> x;
    if(x > 0) {
      pos.push_back(x);
    } else if(x < 0) {
      neg.push_back(-x);
    } else {
      zero++;
    }
  }

  if(zero > n - k) {
    cout << 0 << '\n';
  } else {
    sort(pos.begin(), pos.end(), greater<ll>());
    sort(neg.begin(), neg.end(), greater<ll>());
    priority_queue<ll> pq;
    if(k % 2 == 0) {
      for(int i = 0; i + 1 < (int)pos.size(); i += 2) {
        ll x = (pos[i] * pos[i + 1]);
        pq.emplace(x);
      }
      for(int i = 0; i + 1 < (int)neg.size(); i += 2) {
        ll x = (neg[i] * neg[i + 1]);
        pq.emplace(x);
      }
      ll res = 1;
      int tot = 0;
      while(!pq.empty() && tot < k) {
        ll temp = (pq.top()) % MOD;
        pq.pop();
        res = (res * temp) % MOD;
        tot += 2;
      }
      if(tot == k) {
        cout << res << '\n';
      } else {
        if(zero == 0) {
          res = (res * pos[pos.size() - 1]) % MOD;
          res = (res * neg[neg.size() - 1] * (-1LL)) % MOD;
          if(res < 0)
            res = (res + MOD) % MOD;
          cout << res << '\n';
        } else {
          cout << 0 << '\n';
        }
      }
    } else {
      if(!pos.empty()) {
        ll res = pos[0];
        int tot = 1;
        for(int i = 1; i + 1 < (int)pos.size(); i += 2) {
          ll x = (pos[i] * pos[i + 1]);
          pq.emplace(x);
        }
        for(int i = 0; i + 1 < (int)neg.size(); i += 2) {
          ll x = (neg[i] * neg[i + 1]);
          pq.emplace(x);
        }
        while(!pq.empty() && tot < k) {
          ll temp = (pq.top()) % MOD;
          pq.pop();
          res = (res * temp) % MOD;
          tot += 2;
        }
        if(tot == k) {
          cout << res << '\n';
        } else {
          if(zero == 0) {
            res = (res * pos[pos.size() - 1]) % MOD;
            res = (res * neg[neg.size() - 1] * (-1LL)) % MOD;
            if(res < 0)
              res = (res + MOD) % MOD;
            cout << res << '\n';
          } else {
            cout << 0 << '\n';
          }
        }
      } else {
        if(zero == 0) {
          ll res = 1;
          for(int i = (int)neg.size() - 1; i >= (int)neg.size() - k; i--) {
            res = (res * neg[i]) % MOD;
          }
          res = (MOD - res) % MOD;
          if(res < 0)
            res = (res + MOD) % MOD;
          cout << res << '\n';
        } else {
          cout << 0 << '\n';
        }
      }
    }
  }

  return 0;
}


Measured memory_bytes: 6628
#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 arr[n]={0};
  for(int i=1;i<n;i++)
  {
    arr[i]=min(i-1>=0?abs(A[i]-A[i-1])+arr[i-1]:INT_MAX,i-2>=0?abs(A[i]-A[i-2])+arr[i-2]:INT_MAX);
  }
  cout<<arr[n-1];

}


Measured memory_bytes: 1024
import sys
n = int(input())
A = list(map(int,sys.stdin))
cnt = 0
G = [int((2.25**i-1)/1.25)for i in range(17,0,-1)]
G = [v for v in G if v <= n]
def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
        A[j+g] = v
for g in G:
    insertionSort(A, n, g)
print(len(G))
print(*G)
print(cnt)
print('\n'.join(map(str,A)))



Measured memory_bytes: 126048
while True:
    N = int(input())
    if N == 0:
        break
    
    data = []
    for _ in range(N):
        inp = input().split()
        P, A, B, C, D, E, F, S, M = map(int, inp[1:])
        time = A + B + C + M * (D + E)
        money = M * F * S - P

        da = [inp[0], money/time]
        data.append(da)

    data.sort(key=lambda x:x[0])
    data.sort(key=lambda x:-x[1])
    for i in range(N):
        print(data[i][0])
    print('#')




Measured memory_bytes: 5612
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <queue>

using namespace std;

const int maxn = 305;

double E[maxn][maxn][maxn];
int n;
int cnt[5];

int main(){
    cin >> n; 
    E[0][0][0] = 0;
    for(int i = 0;i <= n;i++){
        for(int j = 0;j <= n;j++){
            if(i + j > n)
                break;
            for(int k = 0;k <= n;k++){
                if(i + j + k > n)
                    break;
                if(i == 0 and j == 0 and k == 0)
                    continue;
                if(i > 0){
                    E[i][j][k] += 1.0 * i / n * E[i - 1][j + 1][k];
                }
                if(j > 0){
                    E[i][j][k] += 1.0 * j / n * E[i][j - 1][k + 1];
                }
                if(k > 0){
                    E[i][j][k] += 1.0 * k / n * E[i][j][k - 1];
                }
                E[i][j][k] += 1.0;
                E[i][j][k] *= 1.0 * n / (i + j + k);
            }
        }
    }
    for(int i = 1;i <= n;i++){
        int a;
        scanf("%d", &a);
        cnt[a]++;
    }    
    printf("%.10lf\n", E[cnt[3]][cnt[2]][cnt[1]]);
    return 0;
}


Measured memory_bytes: 219392
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <utility>
#include <set>
#include <map>
#include <deque>
#include <stack>

using namespace std;

int main() {
    long long s, c, k;
    cin >> s >> c;
    k = max((long long)0, (c - 2 * s) / 4);
    if (2*s <= c)
       cout << s + k << "\n";
    else
       cout << c / 2 << "\n"; 
    cin >> s;
    return 0;
}


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

int main()
{
    string s;
    // vector<char>s;
    cin >> s;
    int l = s.length();
    int k = 0;
    for (int i = 0; i < l; i = i + 2)
    {
        if (s[i] == 'L')
        {
            k++;
            cout << "No" << endl;
            break;
        }
        if (s[i + 1] == 'R')
        {
            k++;
            cout << "No" << endl;
            break;
        }
    }

    if (k != 1)
        cout << "Yes" << endl;
    return 0;
}

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

typedef long long LL;
typedef pair<int,int> pii;

#define pb push_back
#define mp make_pair

const int mod = 1e9 + 7;
const int N = 64;

int n, C[N];
LL a, B[N];

int main(){
    memset(C, 0, sizeof(C));

    B[0] = 1;
    for(int i=1; i<N; i++){
        B[i] = (B[i-1] << 1) % mod;
    }

    scanf("%d", &n);
    for(int i=0; i<n; i++){
        scanf("%lld", &a);
        for(int j=0; j<N; j++){
            if(a & 1)   C[j]++;
            a>>=1;
        }
    }

    LL ans = 0;
    for(int i=0; i<N; i++){
        ans = (ans + B[i] * C[i] % mod * (n - C[i]) % mod) % mod;
    }

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

    return 0;
}


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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

struct Data {
    string n;
    ll index;
};

ll N;

bool checkStable(vector<Data> v) {
    REP(i, N) {
        FOR(j, N, i) {
            if (v[i].n[1] != v[j].n[1])
                break;
            if (v[i].index > v[j].index)
                return false;
        }
    }
    return true;
}

void bubble(vector<Data> v) {
    REP(i, N) {
        for (ll j = N - 1; j > i; --j) {
            if (v[j].n[1] < v[j - 1].n[1])
                swap(v[j], v[j - 1]);
        }
    }
    REP(i, N - 1) {
        cout << v[i].n << " ";
    }
    cout << v[N - 1].n << endl;
    if (checkStable(v))
        cout << "Stable" << endl;
    else
        cout << "Not stable" << endl;
}

void select(vector<Data> v) {
    auto copy = v;
    REP(i, N) {
        ll mi = i;
        FOR(j, N, i) {
            if (v[j].n[1] < v[mi].n[1])
                mi = j;
        }
        swap(v[i], v[mi]);
    }
    REP(i, N - 1) {
        cout << v[i].n << " ";
    }
    cout << v[N - 1].n << endl;
    if (checkStable(v))
        cout << "Stable" << endl;
    else
        cout << "Not stable" << endl;
}

int main() {
    cin >> N;
    vector<Data> v;
    REP(i, N) {
        Data d;
        cin >> d.n;
        d.index = i;
        v.push_back(d);
    }

    bubble(v);
    select(v);

    return 0;
}


Measured memory_bytes: 3180
#include <stdio.h>
int main(void) {
    int a,b;
    char op;
    while (1) {
        scanf("%d %c %d",&a,&op,&b);
        if (op == '?') break;
        if (op == '+') {
            printf("%d\n",a+b);
        } else if (op == '-') {
            printf("%d\n",a-b);
        } else if (op == '*') {
            printf("%d\n",a*b);
        } else if (op == '/') {
            printf("%d\n",a/b);
        }
    }
    return 0;
}

Measured memory_bytes: 600
#include<stdio.h>

int main(void){
  int N,p[200001],i,c=0,min;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&p[i]);
  }
  min=p[0];
  for(i=0;i<N;i++){
	if(min>=p[i]){
      c++;
      min=p[i];
  }}
  printf("%d",c);
  return 0;
}

Measured memory_bytes: 896
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)*}
    };
}

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

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

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

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

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

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

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

//
// # Examples
//
// # integers
// input! { n: i32, m: i32, ... }
//
// # array
// input! { n: i32, v: [i32; n], }
//
// # matrix
// input! { n: i32, m: i32, mat: [[]] }
//
// # string
// input! { s: chars }
//
// 3 4
// ####
// #..#
// .#.#
//
// input!{
//     h: i32,
//     w: i32,
//     board: [chars; h],
// }

// https://practice.contest.atcoder.jp/tasks/practice_1
//fn main() {
//    input!{
//        a: i32, b: i32, c: i32,
//        foo: chars,
//    }
//    let s: String = foo.into_iter().collect();
//    println!("{} {}", a+b+c, s);
//}
fn main() {
    input!{
        a : usize, b: usize, x: usize
    }
    if a > x {
        println!("{}", "NO");
    } else if (x-a) <= b {
        println!("{}", "YES");
    } else {
        println!("{}", "NO");
    }
}

Measured memory_bytes: 4352
a,b,k = map(int,input().split())
l = []
if b-a >= k:
    for i in range(k):
        l.append(a+i)
    for i in range(k):
        l.append(b-i)
    l = sorted(set(l))
    for i in range(len(l)):
        print(l[i])
else:
    for i in range(b-a+1):
        print(a+i)

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

int nextInt() { int x; scanf("%d", &x); return x;}


int x[50];
ll dp[51][2501];

int main2() {
  int N = nextInt();
  int A = nextInt();
  REP(i, N) x[i] = nextInt();
  CLR(dp, 0);

  dp[0][0] = 1;
  for (int xi = 0; xi < N; xi++) {
    for (int j = N-1; j >= 0; j--) {
      for (int i = 2500 - x[xi]; i >= 0; i--) {
        dp[j+1][i + x[xi]] += dp[j][i];
      }
    }
  }
  ll ans = 0;
  for (int j = 1; j <= N; j++) {
    ans += dp[j][j * A];
  }
  cout << ans << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

#define Endl endl


/*--------------------template--------------------*/


int main() {
    cin.sync_with_stdio(false); cout << fixed << setprecision(10);
    cin >> n;
    set<ll> v;
    REP(i, n) {
        cin >> m;
        if (v.count(m)) {
            v.erase(m);
        } else {
            v.insert(m);
        }
    }
    cout << v.size() << endl;

}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
 
void print_vec(vector<int> B)
{
 
	for(int i =0;i<B.size();i++)
	{
		cout<<B[i]<<" ";
	}
	cout<<endl;
}

void print_vec_vec_bool(vector<vector<bool>> A)
{
	for(int i = 0 ; i < A.size() ; i++)
	{
		for(int j = 0 ; j < A[i].size() ; j++)
		{
			cout<<A[i][j]<<" ";
		}
		cout<<endl;
	}
	cout<<endl;
}

bool compare(string A1,string A2)
{
  if( A1[1] == '=' && A2[1] == '!')
  {
    return (A1<(A2));
  }
  return (A2 < A1);
}

void print_vec_string(vector<string> A)
{
	for(int i = 0 ; i <A.size() ;i++)
	{
		cout<<A[i]<<" ";
	}
	cout<<endl;
}
 
void print_multiset(multiset<pair<int,pair<int,int>>> s)
{
	auto itr = s.begin();
	while(itr != s.end())
	{
		pair<int,pair<int,int>> p = *itr;
		cout<<"(("<<p.first<<"),("<<p.second.first<<","<<p.second.second<<") ";
		itr++;
	}
	cout<<endl;
}



int main()
{
	long long int n;
	cin>>n;
	long long ans = (long long)((long long )((n-1)*(n))/((long long )2));
	cout<<ans<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
def inpl(): return map(int, input().split())
from itertools import accumulate
from bisect import bisect, bisect_left
from collections import Counter, deque
from functools import reduce
from itertools import accumulate
from operator import itemgetter, xor

from sys import setrecursionlimit
setrecursionlimit(10**9)
 
import sys
#input = sys.stdin.readline
from collections import Counter
def inpl(): return list(map(int, input().split()))

N, K = inpl()
A = inpl()

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)
    # divisors.sort()
    return divisors

D = sorted(make_divisors(sum(A)))

ans = 1
g0 = itemgetter(0)

for d in D:
    x = 0
    X = []
    for i in range(N):
        X.append(A[i]%d)

    X = sorted(X)
    l = 0
    r = N-1
    while l < N and X[l] == 0:
        l += 1
    while l < N and (not (X[l] == 0 or X[l] == d)):
        m = min(X[l], d - X[r])
        x += m
        X[l] -= m
        X[r] += m
        if X[l] == 0:
            l += 1
        if X[r] == d:
            r -= 1
    if x <= K:
        ans = max(ans, d)

print(ans)

Measured memory_bytes: 43612
n, a, b, c, d = map(int, input().split())
s = input()

if '##' in s[a-1:d]:
    print('No')
    exit()

if c < d:
    print('Yes')
    exit()

if '...' in s[b-2:d+1]:
    print('Yes')
else:
    print('No')

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

int main(){
  vector<int> num(3);
  
  for (int i=0; i<3;i++){
 	std::cin>>num.at(i);
  }
  
  std::cout<<num.at(2)<<" "<< num.at(0)<<" "<< num.at(1)<<std::endl;
}

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

int main(){
    ll n;
    cin >> n;
    rep (i, n) cout << "ACL";
    cout << endl;
}

Measured memory_bytes: 3596
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define cool ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	#define int  long long int
	#define pb push_back
	#define fe first
    #define lb lower_bound 
    #define ub upper_bound
    #define pii pair<pair<int,int>,pair<int,int> >
	#define se second
	#define endl "\n"
	#define pi pair<int, int>
	#define vi vector<int> 
	#define vvi vector<vi>
    #define bs   binary_search
	#define rep(i,a,b) for(int i=a;i<b;i++)
	#define rep1(i,a,b) for(int i=a;i<=b;i++)	
    #define all(c) (c).begin(),(c).end()
    #define sz(x)       (int)x.size() 
	#define PI 3.14159265358979323846
    
	const int N =2e5+5;
    
     int mod= 1e9+7;
     int dx[4]={0,0,+1,-1};
     int dy[4]={+1,-1,0,0};
     
     int INF=1e17; 
   
   void solve(){  
	   
	   int n;
	   cin>>n;
	   vi v(3*n,0),l(3*n+1,-INF),r(3*n+1,INF);
	   rep(i,0,3*n)
	     cin>>v[i];
	   
	   priority_queue<int > pq2;
	   priority_queue<int,vi,greater<int> > pq1;
	   
	   int csm=0;
	   
	   rep(i,0,3*n) {
		   csm+=v[i];
		   pq1.push(v[i]);
		   if(sz(pq1)>n) {
			   csm-=pq1.top();
			   pq1.pop();
		   }
		   
		   if(sz(pq1)==n) {
			   l[i]=csm;
		   }	   
	   }
	   
	   csm=0;
	   
	   for(int i=3*n-1;i>=0;i--) {
		 csm+=v[i];
		   pq2.push(v[i]);
		   if(sz(pq2)>n) {
			   csm-=pq2.top();
			   pq2.pop();
		   }
		   
		   if(sz(pq2)==n) {
			   r[i]=csm;
			   //~ cout<<i<<endl;
		   }	   
	   }
	   
	   
	   int maxi=-INF;
	   
	   rep(i,0,2*n) {
		   int yo=l[i]-r[i+1];
		   maxi=max(yo,maxi);
	   }
	   
	   //~ rep(i,0,3*n)
	    //~ cout<<l[i]<<" ";
	    //~ cout<<endl;
	   
	   //~ rep(i,0,3*n)
	    //~ cout<<r[i]<<" ";
	    //~ cout<<endl;
	    
	   cout<<maxi<<endl;	      	  
   }  
	
	      
	int32_t main() {	
	  
	  cool;
	  int t=1;
      //~ cin>>t;     
        
     
	  while (t--)
		 solve();	
	
	  return 0;
	}


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

int main(){
  int N;
  string S;
  cin>>N>>S;
  int k=0;
  for(int i=0;i<N-1;i++){
    vector<int> A(26,0),B(26,0);
    for(int j=0;j<N;j++)
      if(j<=i)
        A[S[j]-'a']++;
      else
        B[S[j]-'a']++;
    int l=0;
    for(int j=0;j<26;j++)
      if(A[j]!=0 && B[j]!=0)
        l++;
    k=max(k,l);
  }
  cout<<k<<endl;
}

Measured memory_bytes: 256
unsigned alp;
main(c){
        while((c=getchar())!='\n') alp |= 1<<(c-'a');
        for(int i=0; i<26; i++) if(!((alp>>i)&1)) {
                putchar(i+'a');
                return 0;
        }
        puts("None");
        return 0;
}

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

using namespace std;

void solve()
{
    int n, k;
    cin >> n >> k;
    vector<int> as(n), bs(n);
    for (int i = 0; i < n; i++)
    {
        cin >> as[i] >> bs[i];
    }
    long ans = 0;
    for (int i = -1; i <= 30; i++)
    {
        int mask;
        if (i == -1)
        {
            mask = k;
        }
        else
        {
            if (!(k >> i & 1))
                continue;
            mask = (k ^ (1 << i)) | ((1 << i) - 1);
        }
        long res = 0;
        for (int j = 0; j < n; j++)
        {
            if ((mask | as[j]) == mask)
            {
                res += bs[j];
            }
        }
        ans = max(ans, res);
    }
    cout << ans << endl;
}

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


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

using namespace std;

int main() {
    int k;
    string s;
    cin >> k >> s;
    if(s.size() <= k) cout << s << endl;
    else {
        for (int i=0; i<k; ++i) {
            cout << s[i];
        }
        cout << "..." << endl;
    }
}


Measured memory_bytes: 3620
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define chmin(a,b) a=min(a,b)
int n,k;
string s,p;
void doubl(){
    p=s;
    string t=s; reverse(t.begin(),t.end());
    s+=t;
}
int main(){
  cin>>n>>k>>s;
  for(int i=0;i<min(k-1,100);i++){
      doubl();
      for(int i=0;i<=n;i++){
          chmin(p,s.substr(i,n));
      }
      reverse(p.begin(),p.end());
      s=p;
  }
  doubl();
  for(int i=0;i<n;i++)chmin(p,s.substr(i,n));
  cout<<p<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long

int main(){
	int n;cin>>n;
	vector<int>h(n);
	for(int i=0;i<n;++i)cin>>h[i];
	int sum=1,ans=0;
	while(sum!=0){
		sum=0;
		bool ku=true;
		for(int i=0;i<n;++i){
			//空白にいる状態で空白ではないもの
			if(ku==true && h[i]!=0)++ans,ku=false;

			//空白ではない状態で、空白に出会った
			if(ku==false && h[i]==0)ku=true;
		}
	

		for(int i=0;i<n;++i){
			if(h[i]!=0){
				sum+=h[i];
				--h[i];
			}
		}
		//cout<<"sum="<<sum<<endl;
		//cout<<"ans="<<ans<<endl;
	}
	cout<<ans<<endl;
}

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

int main()
{
    int A, B;
    cin >> A >> B;

    if((abs(A+B)%2) == 0) {
        cout << abs(A+B)/2 << endl;
    } else {
        cout << "IMPOSSIBLE" << endl;
    }

    return 0;
}

Measured memory_bytes: 3592
n, m, q = map(int, input().split())

train = [[0 for _ in range(n+1)] for __ in range(n+1)]

for _ in range(m):
    l, r = map(int, input().split())
    train[l][r] += 1

ans = [[0 for _ in range(n+1)] for __ in range(n+1)]

for i in range(n):
    for j in range(n+1):
        ans[i+1][j] = ans[i][j] + train[i+1][j]

for j in range(n):
    for i in range(n+1):
        ans[i][j+1] = ans[i][j+1] + ans[i][j]

for __ in range(q):
    p, q = map(int, input().split())
    print(ans[q][q] - ans[q][p-1] - ans[p-1][q] + ans[p-1][p-1])

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

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


int main(){
    int K;
    cin>>K;
    int64_t sum=0;
    for(int a=1;a<K+1;a++){
        for(int b=1;b<K+1;b++){
            for(int c=1;c<K+1;c++){
                sum+=gcd(gcd(a,b),c);
            }
        }
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e18+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N;
    cin >> N;
    int ans = 0;
    for(int i = 1; i <= N; i++) {
        ans += (N-1)/i;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << #x << " = " << x << endl;


#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 110

ll factorial(int n,int M){
  ll ret=1;
  if(n<=1) return 1;
  
  for(int i=1;i<=n;i++){
    ret = (ret*i)%M;
  }
  
  return ret;
}

ll power(int k,int n,ll M){
  if(n==0) return 1;
  if(n==1) return (ll)k;
  
  ll ret = power(k,n/2,M);
  
  ret=(ret*ret)%M;
  
  if(n%2==1)
    ret=(ret*k)%M;
  
  return ret;
}


//nCm nPm nHm (mod M)

/*Combination*/
int C(int n,int m,int M){
  if(n<m) return 0;
  if(m==0 || n==m) return 1;
  
  ll chi = factorial(n,M);
  ll mot = (factorial(m,M) * factorial(n-m,M))%M;
  
  mot = power((int)mot,M-2,M);
  
  ll ret = (chi*mot)%M;
  
  return (int)ret;
}
/*Permutation*/
int P(int n,int m,int M){
  if(n<m) return 0;
  if(m==0) return 1;
  
  ll chi = factorial(n,M);
  ll mot = factorial(n-m,M);
  
  
  mot = power((int)mot, M-2,M);
  
  ll ret = (chi*mot)%M;
  
  return (int)ret;
}
/*Combination with Repetitions*/
int H(int n,int m,int M){
  if(n==0 && m==0) return 1;
  return C(n+m-1,m,M);
}



int main(){
  string s;

  cin >> s;

  int n = s.size();
  ll ans = 0;
  
  for(int i=0;i<n;i++){
    for(int j=1;i+j<=n;j++){
      ans += stoll(s.substr(i,j)) * power(2,max(0,i-1),LLINF) * power(2,max(0,n-(i+j)-1),LLINF);
    }
  }

  cout << ans << endl;
  
  return 0;
}


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

int main() {
  long long x;
  cin >> x;
  long long cnt = (x/11)*11, ans = (x/11)*2;
  if (cnt < x) {
    cnt += 6;
    ans++;
  }
  if (cnt < x) {
    cnt += 5;
    ans++;
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
	string s;
	cin >> s;
	string result;
	int i;
	for (i = 0; i < s.length(); i++) {
		if (s.at(i) == '0') {
			result.push_back('0');
		} else if (s.at(i) == '1') {
			result.push_back('1');
		} else if (result.size() != 0) {
			result.pop_back();
		}
	}
	cout << result << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <sstream>
#include <set>
#include <tuple>
#include <algorithm>
#include <memory>
#include <numeric>
#include <queue>
#include <functional>
#include <cmath>
#include <cstring>
#include <map>
#include <unordered_map>
#include <sstream>
#include <iomanip>

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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

const ll INF = 1LL << 60;
const ll MOD = 1000000007;

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

	ll N;
	cin >> N;

	//for (ll x = 1; x * x + 2 * x + 2 <= n; ++x)
	//{
	//	for (ll y = 0; y )
	//}

	vector<ll> ans(N, 0);

	for (ll x = 1; x * x + 2 * x + 2 <= N; ++x)
	//for (ll x = 1; x <= N; ++x)
	{
		for (ll y = 1; y * y + 2 * y + 2 <= N; ++y)
			//for (ll y = 1; y <= N; ++y)
		{
			for (ll z = 1; z * z + 2 * z + 2 <= N; ++z)
			//for (ll y = 1; y <= N; ++y)
			{
				ll val = x * x + y * y + z * z + x * y + y * z + z * x;
				if (val > N) break;

				ans[val - 1]++;
			}
		}
	}

	for (ll i = 0; i < N; ++i)
	{
		cout << ans[i] << endl;
	}
}


Measured memory_bytes: 3648
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(void)
{
    int n,i,j,ans=1,len1;
    char w[100][11];

    scanf("%d",&n);
    for ( i = 0; i < n; i++)
    {
        scanf("%s",w[i]);
    }

    for ( i = 1; i < n; i++)
    {
        len1=strlen(w[i-1]);
        if(w[i-1][len1-1]!=w[i][0]) ans=0;
        for ( j = 0; j < i; j++)
        {
            if(strcmp(w[i],w[j])==0) ans=0;
        }
    }

    if(ans==1) printf("Yes");
    else printf("No");

    return 0;
}

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

int main() {
	int n, k, q;
	cin >> n >> k >> q;
	vector<int> point(n, k-q);
	for(int i = 0, k; i<q; i++){
		cin >> k;
		point[k-1]++;
	}

	for(int i: point){
		if(i>0){
			cout << "Yes" << '\n';
		}
		else{
			cout << "No" << '\n';
		}
	}

}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
    Main(){
        Scanner sc = new Scanner(System.in);
        int W = sc.nextInt();
        int H = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        if(r<=x && r+x<=W && r<=y && r+y<=H){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }

    public static void main(String[] args){
        new Main();
    }
}



Measured memory_bytes: 26356
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<int>>;
const int INT_INF = 1001001001;
//stoi(s) : string→int stoll(s) :string→longlong  int→string to_string(i)
const double PI = acos(-1.0);
//小数点の表し方 cout << fixed << setprecision(5);
const int MAXN = 200100;
ll num[MAXN] = {0};
bool seen[MAXN] = {false};

void dfs(Graph &G,int n){
    seen[n] = true;
    for(auto x:G[n]){
        if(seen[x]) continue;
        num[x] += num[n];
        dfs(G,x); 
    }
}

int main(){
    int n,q;
    cin >> n >> q;
    vector<int> a(n-1),b(n-1);
    vector<int> p(q),x(q);
    for(int i=0;i<n-1;i++){
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
    }
    for(int i=0;i<q;i++){
        cin >> p[i] >> x[i];
        p[i]--;
        num[p[i]] += x[i];
    }
    Graph G(n);
    for(int i=0;i<n-1;i++){
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }
    dfs(G,0);
    for(int i=0;i<n;i++){
        cout << num[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 27648
n = int(input())
result = [0]*2
for i in range(n):
    s = input().strip().split()
    ss = sorted(s)
    if s[0] == s[1]:
        result[0] += 1
        result[1] += 1
    elif s[1] == ss[0]:
        result[0] += 3
    elif s[1] == ss[1]:
        result[1] += 3
        
print('{} {}'.format(result[0],result[1]))
        


Measured memory_bytes: 5600
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define show(x) cout<<#x<<"="<<x<<"\n"
using namespace std;

int n,m;
string s;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
#ifdef LOCAL_DEFINE
    FILE *stream1;
    //FILE *stream2;
    stream1=freopen("in","r",stdin);
    //stream2=freopen("out","w",stdout);
    if(stream1==NULL)return 0;
    //if(stream2==NULL)return 0;
#endif
    cin>>n>>m;
    n%=500;
    if(n>m)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
#ifdef LOCAL_DEFINE
    cerr<<"Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC<<"s.\n";
    fclose(stream1);
    //fclose(stream2);
#endif
    return 0;
}


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

int dp[101][76];

int main()
{
    int N;
    cin >> N;
    map<int, int> prime_diviation;  //Nの階乗の素因数の分布
    for(int i=2; i<=N; i++){
        int n = i;
        for(int p=2; p<=n; p++){
            while(n % p == 0){
                prime_diviation[p]++;
                n /= p;
            }
        }
    }

    vector<int> nums;
    for(auto p : prime_diviation) nums.push_back(p.second);
    int len = nums.size();

    vector<int> div75 = {1, 3, 5, 15, 25, 75};

    dp[0][1] = 1;
    for(int i=0; i<len; i++){
        for(auto d1: div75){
            for(auto d2: div75){
                if(d1*d2 <= 75 && nums[i]+1 >= d2){
                    dp[i+1][d1*d2] += dp[i][d1];
                }
            }
        }
    }
    cout << dp[len][75] << endl;
    return 0;
}

Measured memory_bytes: 256
import sys

n, m = map(int, sys.stdin.readline().split())

def main():
    s = n
    c = m
    res = 0
    if c < 2 * s:
        return m // 2
    
    res += s
    c -= 2 * s 
    res += c // 4
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 3060
'use strict';
(function(stdin) {
	var lines  = stdin.toString().split('\n');
	var result = (function(params,data) {
		var A = data.slice(0,params[0])
		.map(function(v){return v.split(' ').map(Number);});
		var B = data.slice(params[0],params[0] + params[1]).map(Number);
		var result = [];

		for (var i = 0; i < params[0]; i++) {
			var tmp = 0;
			for (var j = 0; j < params[1]; j++) {
				tmp += A[i][j] * B[j];
			}
			result.push(tmp);
		}

		return result.join('\n');

	}(
	lines.shift().split(' ').map(Number)
	,lines
	));
	console.log(result);

}(require('fs').readFileSync('/dev/stdin', 'utf8')));

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

#define int long long
#define pb push_back
typedef pair<int, int> ii;
typedef pair<ii, int> iii;

int n, tmp1;
vector<iii> edges;

signed main(){
    cin >> n;
    int tmp = log2(n);
    for(int i = 1; i <= tmp; i++){
        edges.pb({{i, i + 1}, 1 << (i - 1)});
    }
    for(int i = 1; i < 20; i++) edges.pb({{i, i + 1}, 0});
    tmp1 = (1 << (tmp));
    n -= tmp1;
    for(int i = 20; i >= 0; i--){
        if(n & (1 << i)){
            edges.pb({{i + 1, 20}, tmp1});
            tmp1 += 1 << i;
        }
    }
    cout << 20 << " " << edges.size() << "\n";
    for(int i = 0; i < edges.size(); i++) cout << edges[i].first.first << " " << edges[i].first.second << " " << edges[i].second << "\n";
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=998244353;
const int M=1e9+7;
#define inf 0x3f3f3f3f
//std::ios::sync_with_stdio(0);
int main()
{
    std::ios::sync_with_stdio(0);
    string s;
    cin>>s;
    string s1="RRR";
    string s2="RRS";
    string s3="SRR";
    string s4="SSS";
    string s5="SRS";
    string s6="RSR";
    string s7="SSR";
    string s8="SSS";
    int cnt=0;
    if(s==s1)
        cnt=3;
    else if(s==s2||s==s3)
        cnt=2;
    else if(s==s8)
        cnt=0;
    else
        cnt=1;
    cout<<cnt<<endl;



}


Measured memory_bytes: 3608
nim = int(input())
array = [0] * 55556
prime = []
for i in range(2, 55556):
    if array[i] == 0:
        if i % 10 == 1:
            prime.append(i)
        for j in range(i, 55556, i):
            array[j] = 1
    if len(prime) == nim:
        print (*prime)
        exit()

Measured memory_bytes: 3444
package main

import "fmt"

func main() {
	var n, k int
	fmt.Scan(&n, &k)
	x := n / k
	ans := x * x * x
	if k%2 == 0 {
		y := (n + k/2) / k
		ans += y * y * y
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#![allow(non_snake_case, unused_mut)]
use std::collections::HashMap;
fn main() {
    proconio::input! {N:i64,A:[i64;N]}
    let mut map = HashMap::new();
    for &k in A.iter() {
        *map.entry(k).or_insert(0) += 1i64;
    }
    let mut total = 0;
    for (_, &v) in map.iter() {
        total += v * (v - 1) / 2;
    }
    for &k in A.iter() {
        let v = map.get(&k).unwrap();
        let ans = total - v + 1;
        println!("{}", ans);
    }
}


Measured memory_bytes: 11452