akhauriyash/Code-Regression huggingface dataset:
import * as fs from 'fs';

namespace AtCoder.abc001 {

    export class Program {

        constructor(private readonly args: string[][]) {
        }

        /**
         * in
         *
         * out
         *
         */
        main(this: Program): void {
            const n: number = parseInt(this.args[0][0], 10);

            console.log(Math.floor(n / 3));

        }
    }
}

const args: string[][] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n').map(r => r.split(' '));
const prg: AtCoder.abc001.Program = new AtCoder.abc001.Program(args);
prg.main();


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
//const ll MOD = 1000000007;
const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair

int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  ll t = min(c, a + b);
  if (c > t) t++;
  cout << b + t << endl;
}


Measured memory_bytes: 256
#include <cstdio>

int main(){
    int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0;
    int k = 0, l = 0, m = 0, n = 0, o = 0, p = 0, q = 0, r = 0, s = 0, t = 0;
    int u = 0, v = 0, w = 0, x = 0, y = 0, z = 0, Y = 0;
    int I = 0;
    char W[1000] = "abcdefghijklmnopqrstuvwxyz"; 
    char Z;
    while(scanf("%c", &Z) != EOF){
        if (Z == 'a' || Z == 'A'){
            a += 1;
        } else if (Z == 'b' || Z == 'B') {
            b += 1;
        } else if (Z == 'c' || Z == 'C') {
            c += 1;
        } else if (Z == 'd' || Z == 'D') {
            d += 1;
        } else if (Z == 'e' || Z == 'E') {
            e += 1;
        } else if (Z == 'f' || Z == 'F') {
            f += 1;
        } else if (Z == 'g' || Z == 'G') {
            g += 1;
        } else if (Z == 'h' || Z == 'H') {
            h += 1;
        } else if (Z == 'i' || Z == 'I') {
            i += 1;
        } else if (Z == 'j' || Z == 'J') {
            j += 1;
        } else if (Z == 'k' || Z == 'K') {
            k += 1;
        } else if (Z == 'l' || Z == 'L') {
            l += 1;
        } else if (Z == 'm' || Z == 'M') {
            m += 1;
        } else if (Z == 'n' || Z == 'N') {
            n += 1;
        } else if (Z == 'o' || Z == 'O') {
            o += 1;
        } else if (Z == 'p' || Z == 'P') {
            p += 1;
        } else if (Z == 'q' || Z == 'Q') {
            q += 1;
        } else if (Z == 'r' || Z == 'R') {
            r += 1;
        } else if (Z == 's' || Z == 'S') {
            s += 1;
        } else if (Z == 't' || Z == 'T') {
            t += 1;
        } else if (Z == 'u' || Z == 'U') {
            u += 1;
        } else if (Z == 'v' || Z == 'V') {
            v += 1;
        } else if (Z == 'w' || Z == 'W') {
            w += 1;
        } else if (Z == 'x' || Z == 'X') {
            x += 1;
        } else if (Z == 'y' || Z == 'Y') {
            y += 1;
        } else if (Z == 'z' || Z == 'Z') {
            z += 1;
        } 
    }
    int V[1000] = {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z};
    while(I <= 25){
        printf("%c : %d\n", W[I], V[I]);
        I += 1;
    }
}



Measured memory_bytes: 2680
#include <bits/stdc++.h>
#include <complex>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,C,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
const long double EPS = 1e-9;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;


int main() {
    cin>>A>>B>>C;
    cout<<((B*10 + C) % 4 == 0 ? "YES" : "NO")<<endl;
}

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

int main() {
  int A,B,C; // 500, 100, 50
  int X;     // 合計
  int num = 0;

  cin >> A >> B >> C;
  cin >> X;

  for(int i = 0; i <= A; i++){
    for(int j = 0; j <= B; j++){
      for(int k = 0; k <= C; k++){
        if((500*i)+(100*j)+(k*50) == X){
          num++;
        }
      }
    }
  }

  cout << num << endl;


  return 0;
}

Measured memory_bytes: 256
program negative_doubling
  implicit none
  integer :: n, d(2,200000) = 0, i, j, x, y
  integer(8) :: a(200000) = 0_8, p, q, dp(2,200000,0:15) = 0_8, m
  read(*,*) n
  read(*,*) a(1:n)
  do j = 1, 2
    do i = 1, n-1
      p = a(i)
      q = a(i+1)
      if (p <= q) then
        do while (4_8*p <= q)
          d(j,i) = d(j,i)-1
          p = 4_8*p
        end do
      else
        do while (p > q)
          d(j,i) = d(j,i)+1
          q = 4_8*q
        end do
      end if
    end do
    a(1:n) = a(n:1:-1)
  end do
  do x = 0, 15
    dp(:,n,x) = int(2*x,8)
  end do
  do j = 1, 2
    do i = n-1, 1, -1
      do x = 0, 15
        y = max(x+d(j,i),0)
        if (y <= 15) then
          dp(j,i,x) = dp(j,i+1,y)+int(2*x,8)
        else
          dp(j,i,x) = dp(j,i+1,15)+int(2*x,8)+2_8*int(y-15,8)*int(n-i,8)
        end if
      end do
    end do
  end do
  dp(2,1:n,:) = dp(2,n:1:-1,:)
  do i = 1, n
    dp(2,i,:) = dp(2,i,:)+int(i,8)
  end do
  m = min(dp(1,1,0),dp(2,n,0))
  do i = 2, n
    m = min(m,dp(1,i,0)+dp(2,i-1,0))
  end do
  write(*,'(i0)') m
  stop
end program negative_doubling

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

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(ll size) {
        size = max((int) sqrt(size) + 1, 101010);
        prime.resize(size, 1);
        prime[0] = 0;
        prime[1] = 0;
        for (size_t i = 2; i * i <= size; ++i)
            if (prime[i]) {
                for (size_t j = 2; i * j <= size; ++j)prime[i * j] = false;
            }
    }
};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


ll GCD(ll a, ll b) {
    if (b == 0)return a;
    return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    ll gcd = GCD(a, b);
    return a / gcd * b;
}

ll N, R, G, B;
string s;

int main() {
    cin >> R >> G >> B >> N;
    ll res = 0;
    REP(r, N / R + 1) {
        REP(g, N / G + 1) {
            if ((N - r * R - g * G) < 0)continue;
            if ((N - r * R - g * G) % B == 0)res++;
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using VVV = vector<VV>;
using VVVll = vector<VVll>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) (a).begin(), (a).end()
struct fast_ios { fast_ios(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline int sz(T &x) { return x.size(); }
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << '(' << p.first << ", " << p.second << ')'; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << ' '; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int fLog2(const int x) { assert(x > 0); return 31-__builtin_clz(x); } // floor(log2(x))
inline int fLog2(const ll x) { assert(x > 0); return 63-__builtin_clzll(x); }
inline int cLog2(const int x) { assert(x > 0); return (x == 1) ? 0 : 32-__builtin_clz(x-1); } // ceil(log2(x))
inline int cLog2(const ll x) { assert(x > 0); return (x == 1) ? 0 : 64-__builtin_clzll(x-1); }
inline int popcount(const int x) { return __builtin_popcount(x); }
inline int popcount(const ll x) { return __builtin_popcountll(x); }
void fail() { puts("-1"); exit(0); }
// const int INF  = 1<<30;
// const ll INFll = 1ll<<62;
// const ld EPS   = 1e-10;
// const ld PI    = acos(-1.0);
// const int MOD  = int(1e9)+7;
// const int MOD  = 998244353;


vector<pair<char, int>> RLE(string s) {
  vector<pair<char, int>> res = {{s[0], 1}};
  for (auto c : s.substr(1)) {
    if (res.back().first == c) ++res.back().second;
    else res.emplace_back(c, 1);
  }
  return res;
}


int main() {
  int n, k; cin >> n >> k;
  string s; cin >> s;
  string rs = s;
  reverse(all(rs));
  s = s + rs;

  string cm(n, 'z');
  rep(i, n+1) chmin(cm, s.substr(i, n));

  auto rle = RLE(cm);
  auto [c, l] = rle[0];
  int m = l;
  rep(i, k-1) {
    l *= 2;
    if (l >= n) break;
  }
  l -= m;
  chmin(l, n);

  string ans(l, c);
  ans += cm.substr(0, n-l);
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 3796
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <vector>

using namespace std;

int main() {
    int n, a, b;
    cin >> n >> a >> b;

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

    map<long long, int> v_cnt;
    for (int i = 0; i < n; i++) {
        v_cnt[v[i]]++;
    }

    sort(v.begin(), v.end(), greater<long long>());

    map<long long, int> v_rec;
    for (int i = 0; i < a; i++) {
        v_rec[v[i]]++;
    }

    if (v_rec.size() == 1) {
        for (int i = a; v[i - 1] == v[i] && i < n; i++) {
            v_rec[v[i]]++;
        }
    }

    long long sum = 0, size = 0;
    for (map<long long, int>::iterator i = v_rec.begin(); i != v_rec.end(); i++) {
        sum += i->first * i->second;
        size += i->second;
    }

    double avg = static_cast<double>(sum) / size;

    vector<vector<long long>> nck(n + 1, vector<long long>(n + 1, 0));
    nck[0][0] = 1;
    for (int i = 1; i <= n; i++) {
        nck[i][0] = nck[i][i] = 1;
        for (int j = 1; j < i; j++) {
            nck[i][j] = nck[i - 1][j - 1] + nck[i - 1][j];
        }
    }

    long long pat = 0;
    if (v_rec.size() == 1) {
        for (int i = a; i <= b && i <= n; i++) {
            pat += nck[v_cnt[v_rec.begin()->first]][i];
        }
    } else {
        pat = nck[v_cnt[v_rec.begin()->first]][v_rec.begin()->second];
    }

    cout << setprecision(12) << fixed << avg << endl;
    cout << pat << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll
typedef vector<int> vi;
typedef pair<int,int> pii;

signed main(void) {
  int i,j;
  int n;
  cin>>n;
  vi a(n);
  rep(i,n)cin>>a[i];
  int ans=0;
  rep(i,n){
    ans+=a[i]/2;
    a[i]%=2;
    if(i+1<n&&a[i]&&a[i+1]){
      ans++;
      a[i+1]--;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 1152
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;

int main()
{
  long long int x,y;
  cin >> x >> y;
  if((x > 0 && y > 0) || (x < 0 && y < 0)){
    if(x > 0 && y > x)
      cout << y - x << endl;
    else if(x > 0 && y < x)
      cout << 1 + x-y + 1 << endl;
    else if(x < 0 && y > x)
      cout << y - x << endl;
    else if(x < 0 && y < x)
      cout << 1 + x-y + 1 << endl;
  }else if ((x > 0 && y < 0) || (x < 0 && y > 0)){
    if(x > 0 && abs(x) >= abs(y))
      cout << 1 + abs(x+y) << endl;
    else if(x > 0 && abs(x) < abs(y))
      cout << abs(x+y) + 1 << endl;
    else if(x < 0 && abs(x) >= abs(y))
      cout << abs(x+y) + 1 << endl;
    else if(x < 0 && abs(x) < abs(y))
      cout << 1 + abs(x+y) << endl;
  }else if(x == 0 && y > 0){
    cout << y << endl;
  }else if(x == 0 && y < 0){
    cout << 1 + abs(y) << endl;
  }else if(y == 0 && x > 0){
    cout << 1 + x << endl;
  }else if(y == 0 && x < 0){
    cout << abs(x) << endl;
  }
  return 0;
}


Measured memory_bytes: 256
//52
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

void rm(vector<vector<int> > &v,int y,int x){
  while(x<v[y].size()){
    if(x+1<v[y].size()){
      v.push_back(vector<int>(1,v[y].back()));
    }
    v[y].pop_back();
  }
}

int main(){
  for(int n;cin>>n,n;){
    vector<vector<int> > v(n);
    for(int i=0;i<n;i++){
      v[i].push_back(i+1);
    }
    for(int ij[2];cin>>ij[0]>>ij[1],ij[0]|ij[1];){
      int y[2],x[2];
      for(int i=0;i<v.size();i++){
	for(int j=0;j<v[i].size();j++){
	  for(int k=0;k<2;k++){
	    if(v[i][j]==ij[k]){
	      y[k]=i;
	      x[k]=j;
	    }
	  }
	}
      }
      if(ij[0]!=ij[1]){
	if(ij[1]==0){
	  if(x[0]){
	    rm(v,y[0],x[0]);
	    v.push_back(vector<int>(1,ij[0]));
	  }
	}else if(y[0]==y[1]){
	  if(x[0]<x[1]){
	    rm(v,y[0],x[0]);
	    for(int i=v.size()-1;;i--){
	      if(v[i][0]==ij[1]){
		v[i].push_back(ij[0]);
		break;
	      }
	    }
	  }
	}else{
	  rm(v,y[0],x[0]);
	  v[y[1]].push_back(ij[0]);
	}
      }
    }
    vector<int> np;
    for(int i=0;i<v.size();i++){
      if(!v[i].empty()){
	np.push_back(v[i].size());
      }
    }
    sort(np.begin(),np.end());
    for(int i=0;i<np.size();i++){
      cout<<np[i]<<endl;
    }
    cout<<"end"<<endl;
  }
  return 0;
}

Measured memory_bytes: 1244
#include <iostream>  
#include <cstdio>  
#include <assert.h>  
#include <cstring>  
#include <algorithm>  
#include <vector>  
#include <map>  
#include <cmath>  
#include <set>  
#include <queue>  
const int INF=1e9+10;  
const double EPS = 1e-10;    
typedef long long ll;  
const ll mod=998244353;
using namespace std;
ll a[105];
ll gcd(ll a,ll b){
    return !b?a:gcd(b,a%b);
}
int main(){
    int n;
    while(cin>>n){
        for(int i=0;i<n;i++)
            cin>>a[i];
        ll k=a[0],ans=1LL;
        for(int i=0;i<n-1;i++){
            k=a[i+1]/gcd(a[i+1],a[i])*a[i];
            a[i+1]=k;
        }
        cout<<k<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
/*-----lusar98-----*/
#include<bits/stdc++.h>
#define fast() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define mod 1000000007
#define eps 1e-9
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
using namespace std;
int main()
{
    // fast();
    ll n;
    cin>>n;
    double arr[n];
    for(ll i=0;i<n;i++)
    	cin>>arr[i];
    double dp[n+2];
    memset(dp,0,sizeof dp);
    dp[0]=1;
    for(ll i=0;i<n;i++)
    {
    	double x = arr[i];
    	for(ll j = i+1 ;j >= 0;j--)
    	{
    		dp[j] = (j == 0? 0: dp[j-1]*x) + dp[j] * (1-x);
    	} 
    }
	ll h = n/2;
	double ans=0;
	while(h++ <= n)
	{
		ans += dp[h];
	}
	printf("%.10lf\n", ans );

}


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

int main() {
  int a, b;
  cin >> a >> b;
  if (a == 1) a += 13;
  if (b == 1) b += 13;

  if (a == b) cout << "Draw" << endl;
  else if (a > b) cout << "Alice" << endl;
  else cout << "Bob" << endl;
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

void dfs(ll num, ll generation, vector<ll> &result, vector<vector<ll>> &g,
         vector<bool> &used, ll child_num) {
    used[num] = true;
    if (generation == 0) {
        result[num] = 0;
    } else if (generation == 1) {
        result[num] = 1 + child_num;
    } else {
        result[num] = 2 + child_num;
    }
    ll counter = 0;
    rep(i, g[num].size()) {
        if (!used[g[num][i]]) {
            dfs(g[num][i], generation + 1, result, g, used, counter);
            counter++;
        }
    }
}

int main() {
source:
    ll n, k;
    cin >> n >> k;
    vector<vector<ll>> g(n);
    rep(i, n - 1) {
        ll a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vector<ll> result(n);
    vector<bool> used(n, false);
    dfs(0, 0, result, g, used, 0);
    ll ans = 1;
    rep(i, n) {
        ans *= max(k - result[i], 0LL);
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 12416
#include<bits/stdc++.h>
typedef long long ll;
#define pii pair<int,int>
#define ff first
#define ss second
using namespace std;
void fast()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}
int main()
{
    char s[105];
    int a[28]={0};
    cin>>s;
    for(int i=0;i<strlen(s);i++)
    {
        int temp=(int)s[i]-'a';
        a[temp]++;
    }
    for(int i=0;i<27;i++)
    {
        if(a[i]%2)
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n"<<endl;
}


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

#define rep(i, n) for(i=0;i<(int)(n);i++)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define bit(n) (1LL<<(n))
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(void){
  int a,b,i,tmp,tmp2,result=-1;
  scanf("%d %d", &a, &b);
  for(i=a;i<=1000;i++){
    tmp = (int) (i * 0.08);
    tmp2 = (int) (i / 10);
    if(tmp == a && tmp2 == b){
      result=i;
      break;
    }
  }
  printf("%d", result);
  
  return 0;
}



Measured memory_bytes: 128
#!/usr/bin/env python3
import sys

def solve(N: int, M: int, A: "List[int]", B: "List[int]", C: "List[int]"):

    # bc = [c for b,c in zip(B, C) for b_ in range(b)]
    # print(A+bc)
    # k = sorted(A+bc)[-N:]
    a = [(l, 1) for l in A]
    for x, y in zip(C, B):
        a.append((x,y))


    n = N
    ans = 0
    for x, y in sorted(a, reverse=True):
        if n >= y:
            n -= y
            ans += x*y
        else:
            ans += x*n
            break
    
    print(ans)

    # print(sum(k))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]"
    C = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    solve(N, M, A, B, C)

if __name__ == '__main__':
    main()


Measured memory_bytes: 32308
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main{
    //directed graph
    LinkedList<LinkedList<Integer>> adg = new LinkedList<LinkedList<Integer>>();
    Main(int n){

        for(int i = 0; i<=n; i++){
            LinkedList<Integer> temp = new LinkedList<Integer>();
            adg.add(temp);
        }
    }
    void addEdge(int index, int vertex){
        adg.get(index).add(vertex);
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Main graph = new Main(n);
        for(int i = 0; i<n; i++){
            int index = in.nextInt();
            int m = in.nextInt();
            for(int j = 0; j<m; j++){
                int temp = in.nextInt();
                graph.addEdge(index,temp);
            }
        }
        //change to matrix
        Integer[][] matrix = new Integer[n+1][n+1];
        for(int i = 1; i<=n; i++){
            if(graph.adg.get(i).size()!=0) {
                for (int c : graph.adg.get(i)) {
                    matrix[i][c] = 1;
                }
            }
        }
        for(int i = 1; i<=n; i++){
            for(int j = 1; j<=n; j++){
                if(matrix[i][j]==null) matrix[i][j] = 0;
                if(j!=n) System.out.print(matrix[i][j]+ " ");
                else System.out.print(matrix[i][j]);
            }
            System.out.println();
        }

    }
}



Measured memory_bytes: 33552
def examA():
    N, X, T = LI()
    ans = (1 + (N-1)//X)*T
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

namespace ExaWiz
{
    class Program
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int c = s.Count(x => x == 'R');
            Console.WriteLine((c > (N - c))? "Yes":"No");
        }
    }
}

Measured memory_bytes: 11220
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T = int> void print(vector<T> v){for(auto a:v)cout<<a<<" ";cout<<endl;}

/*
*/

bool ok=true;
string s;

int main(void){
	cin>>s;
	if(s[0]=='A' && s[1]=='A' && s[2]=='A')ok=false;
	if(s[0]=='B' && s[1]=='B' && s[2]=='B')ok=false;
	cout<<(ok?"Yes":"No")<<endl;
	return 0;
}

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

vector<pair<ll, ll>> a;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll n, W, w, v, vv = 0LL;
    cin >> n >> W;

    a.push_back({0, 0});
    for (ll i = 0; i < n; i++) {
        cin >> w >> v;
        a.push_back({w, v});
    }
    ll dp[100001];
    memset(dp, 0x3f, sizeof(dp));

    dp[0] = 0;
    ll max_w = 0;

    for (ll j = 1; j <= n; j++) {
        for (ll i = 100000; i >= a[j].second; i--) {
            dp[i] = min(dp[i], dp[i-a[j].second]+a[j].first);
            if (dp[i] <= W) {
                max_w = max(max_w, i);
            } 
        } 
    }
    cout << max_w << endl;
    return 0;
}


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

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

    int mi = 1000000;
    int ma = -1000000;
    long sum = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
       
       mi = min(mi, a);
       ma = max(ma, a);
       sum += a;
    }
    cout << mi << " " << ma  << " " << sum << endl;
    return 0;
}


Measured memory_bytes: 3096
#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	if(a%2<1&&b%2<1){
		cout<<"No"<<endl;
	}
	else if(a%2>0&&b%2<1){
		cout<<"No"<<endl;
	}
	else if(a%2<1&&b%2>0){
		cout<<"No"<<endl;
	}
	else{
		cout<<"Yes"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <iomanip>
#include <cmath>
#include <queue>
#include <bitset>
#include <numeric>
#include <array>
#include <cstring>
#include <random>
#include <chrono>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {

  ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  int n = 0;

  cin >> n;

  cout << (n + (n % 1000 != 0 ? 1000 - n % 1000 : 0)) - n;

  return 0;
}
/*

*/


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

using namespace std;

const int SIZE = 105;
int a[SIZE];

int main()
{
	int n;
	scanf("%d", &n);
	for (int i=0; i<n; ++i)
	{
		scanf("%d", &a[i]);
	}
	int cnt = 0;
	for(int i = 0; i<n; ++i)
	{
		int mini = a[i];
		int m = i;
		for(int j = i+1; j <n;++j)
		{
			if(a[j] < mini)
			{
				 mini = a[j];
				 m = j;
			}
		}
		if(i != m)
		{
			swap(a[i], a[m]);
			++cnt;
		}
	}
	for (int i =0; i<n; ++i)
	{
		printf("%d", a[i]);
		if(i != n-1) printf(" ");
		else printf("\n");
	}
	printf("%d\n", cnt);
	return 0;
}

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

int main(){

	int N;
	int temp;
	cin >> N;
	int a[N];
	for(int i = 0; i < N; i++){
		cin >> a[i];
	}
	for (int i=0;i<N;i++) {
	    for(int j=i+1 ;j < N; j++) {
	        if(a[i] < a[j] ) {
	            temp = a[i];
	            a[i] = a[j];
	            a[j] = temp;
	        }
	    }
	}
	int A = 0;
	int B = 0;
	for (int i=0;i<N;i++) {
	    if (i%2==0) {
	        A+=a[i];
	    }
	    else {
	        B+=a[i];
	    }
	}
	cout << A-B << endl;
	return 0;

}


Measured memory_bytes: 256
# -*- coding:utf-8 -*-
N = int(input())
s = input()
t = input()
index = N
a = -1
for tmp in range(1,len(t)+1):
    if s[index-1:len(s)] == t[0:tmp]:
        a = index-1
    index -= 1
if a == -1:
    print(len(s+t))
else:
    for tmp in range(len(s)-a, len(t)):
        s = s+t[tmp]
    print(len(s))

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

int main() {
    int a,b,c;
    int rec=0;
    int dia=0;
    char ch;
    while (cin>>a>>ch>>b>>ch>>c) {
        if (a==b&&a*a*2!=c*c)
            dia++;
        else if (a!=b&&a*a+b*b==c*c)
            rec++;
    }
    cout<<rec<<endl<<dia<<endl;
    return 0;
}


Measured memory_bytes: 2992
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n, i, j, k, x;
	string s;

	set<pair<string, pair<int, int>>> ss;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> s >> x;
		ss.insert({ s, { -x, i + 1 } });
	}

	for (auto p : ss) cout << p.second.second << "\n";


	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
 
#define mod(cans) cans%10**9+7
#define debug(x) cout << "Debug" << x << "\n"
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define cin_pl(n,x) rep(i,n){cin>>x[i];}
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define prians(Answer) cout<<Answer<<"\n"
#define TF(X) X==1?cout<<"Yes\n":cout<<"No\n"
#define elcon else{continue;}
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<vector<int> > matrix;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
typedef greater<int> gi;
typedef vector<unsigned> vu;


ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
bool is_prime(const unsigned n){
    switch(n){
        case 0:
        case 1: return false;
        case 2: return true;
    }
 
 
    for(unsigned i=2;i<n;++i){
        if(n%i == 0) return false;
    }
 
    return true;
}

int main()
{
    ll a,b,k;
    cin>>a>>b>>k;
    a-=k;
    if(a<0)
    {
        k=a;
        a=0;
        b+=k;
        if(b<0)
        b=0;
        
    }
    
    
        cout<<a<<" "<<b;
    
    
} 

Measured memory_bytes: 256
import java.util.Scanner;

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

        System.out.printf("%d %d %.10f\n",a/b,a%b,(double)a/(double)b);

    }
}


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

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

    llint ans = 0, anstmp, m;
    for(llint in=1;in<=n;in++) {
        m = n/in;
        anstmp = (m+1)*m/2;
        anstmp *= in;
        ans += anstmp;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define INF 1000000000
#define LINF 1000000000000000000
#define MOD 1000000007
#define mod 1000007
#define INF63 1061109567
#define INF127 9187201950435737471
#define F first
#define S second
#define ll long long
using namespace std;
int main(){
	ll n,i,x;
	set<ll> st;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>x;
		st.insert(x);
	}
	if(st.size()!=n)
	{
		cout<<"NO"<<endl;
	}
	else
	{
		cout<<"YES"<<endl;
	}
	return 0;
}

Measured memory_bytes: 9600
// #include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main() {
  string N;
  cin >> N;
  bool found = false;
  rep(i,N.size()) {
    if (N[i] == '7') found = true;
  }

  if (found) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define dunk(a) cout << (a) << endl
#define rall(a) (a).rbegin(),(a).rend()
const int INF = 2e9;
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    ll n, h; cin >> n >> h;
    vector<ll> a(n), b(n); rep(i,n) cin >> a[i] >> b[i];
    ll maxia = 0;
    rep(i,n) maxia= max(maxia, a[i]);

    ll sumb = 0;
    vector<ll> c; 
    rep(i,n){
        if(b[i] > maxia){
            c.emplace_back(b[i]);
            sumb += b[i];
        }
    }

    sort(all(c)); reverse(all(c));
    ll cnt = 0;
    rep(i,c.size()){
        cnt ++;
        h-=c[i];
        if(h<=0) break;
    }

    if(h>=1) cnt += (h+maxia-1)/maxia;

    cout << cnt << endl;
}

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

///******************************** C o n t a i n e r ********************************///

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef map<int,int> mii;
typedef map<ll,int> mli;

///*********************************** C o n s t ***********************************///

const int       N=1e6+3;
const double    PI = acos(-1);
const ll        MOD=1000000007;  ///1e9+7

///********************************** M a r c o ***********************************///

#define pb push_back
#define F first
#define S second
#define test int tc; cin>>tc; while(tc--)
#define forn(i,n) for(i=0;i<n;i++)
#define rforn(i,n) for(i=n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(x) x.size()
#define el <<'\n'
#define sp <<' '
#define print(a) {for(auto x:a)cout<<x<<" ";cout<<endl;}
#define mem(a,b) memset(a, b, sizeof(a))
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) (a)*(a)

#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

///*********************************** F u n c t i o n ***********************************///

ll powmod(ll a,ll b){ll p=MOD;a%=p;if(!a) return 0;ll pr=1;while(b>0){if(b&1){pr*=a;pr%=p;--b;}a*=a;a%=p;b/=2;}return pr;}
bool isPrime(ll n){ if(n<=1)return false;if(n<=3)return true;if(n%2==0 or n%3==0)return false;for(ll i=5;i*i<=n;i+=6){if(n%i==0 or n%(i+2)==0)return false;}return true;}
void seive(bool a[]){ll mx=sqrt(N),ii,jj;for(ii=3;ii<=mx;ii+=2)if(!a[ii])for(jj=ii*ii;jj<=N;jj+=2*ii)a[jj]=true;}
void numofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]++; else a[jj]+=2;}}}
void sumofdiv(ll a[]){ll mx=sqrt(N),ii,jj;for(ii=1;ii<=mx;ii++){for(jj=ii*ii;jj<=N;jj+=ii){if(jj==ii*ii) a[jj]+=ii; else a[jj]+=ii+jj/ii;}}}

///**************************************************** C o d e ****************************************************///
///-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=///



void _case()
{
    string a;
    ll n,i,r=0,w=0,d=0;
    cin>>n>>a;
    for(i=0;i<n;i++){
        if(a[i]=='R') r++;
        else w++;
    }
    ll j=n-1;
    if(!r or !w) {cout<<0 el; return;}
    while(j>=0 and a[j]=='W') j--;
    for(i=0;i<n;i++){
        if(a[i]=='W' and i<j){
            swap(a[i],a[j]);
            d++;
            while(j>=0 and a[j]=='W') j--;
        }
    }
    cout<<d el;
}

main()
{
//    fastio();
        _case();

}


///Thank you.


///Brainless_Loco Terminates Here!


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

int main() {
	string str, order, p;
	int q, n1, n2;
	cin >> str >> q;
	for (int i = 0;i < q;i++) {
		cin >> order >> n1 >> n2;
		if (order == "print")
			cout << str.substr(n1, n2-n1+1) << endl;
		else if (order == "reverse") {
			reverse(str.begin()+n1,str.begin()+n2+1);				
		}
		else {
			cin >> p;
			str.replace(n1, n2-n1+1, p);
		}
			
	}

}

Measured memory_bytes: 3176
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0;
            while ((line = br.readLine()) != null) {
            	if(line.equals("0 0")){
            		break;
            	}else{
            		String[] str=line.split(" ");
            		int a=Integer.parseInt(str[0]);
            		int b=Integer.parseInt(str[1]);
            		int c=Integer.parseInt(str[2]);
            		for(int k=a;k<=b;k++){
            			if(c%k==0){
            				i++;
            			}
            		}
            		System.out.println(i);
            	}
            }
        }
    }
}

Measured memory_bytes: 24476
import java.util.*;

public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}

	public Main(){
		new AOJ1129().doIt();
	}
	
	class AOJ1129{
		int n,p;
		
		void solve(){
			int a[] = new int[n];
			for(int i=n-1;i>=0;i--)a[i] = n-i;
			for(int i=0;i<p;i++){
				int index = in.nextInt()-1;
				int mai = in.nextInt();
				ArrayList<Integer> list = new ArrayList<Integer>();
				for(int s=index;s<index+mai;s++)list.add(a[s]);
				for(int s=0;s<n;s++)if(s<index||mai+index<=s)list.add(a[s]);
				a = new int[n];
				for(int s=0;s<n;s++)a[s] = list.get(s);
			}
			System.out.println(a[0]);
		}
		
		void doIt(){
			while(in.hasNext()){
				n = in.nextInt();
				p = in.nextInt();
				if(n+p==0)break;
				solve();
			}
		}
	}
	
}

Measured memory_bytes: 31460
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#include <stack>
using namespace std;

int main(){
  int R, C;
  int N;
  cin >> R >> C >> N;
  vector<pair<int,int>> l, r, b, t;
  int x1, y1, x2, y2;
  for(int i = 0; i < N; ++i){
    cin >> x1 >> y1 >> x2 >> y2;
    
    if(x1 > 0 and x1 < R and y1 > 0 and y1 < C)
      continue;
    if(x2 > 0 and x2 < R and y2 > 0 and y2 < C)
      continue;
    
    if(x1 == 0){
      l.emplace_back(y1,i);
    }else if(y1 == 0){
      b.emplace_back(x1,i);
    }else if(x1 == R){
      r.emplace_back(y1,i);
    }else if(y1 == C){
      t.emplace_back(x1,i);
    }
    
    if(x2 == 0){
      l.emplace_back(y2,i);
    }else if(y2 == 0){
      b.emplace_back(x2,i);
    }else if(x2 == R){
      r.emplace_back(y2,i);
    }else if(y2 == C){
      t.emplace_back(x2,i);
    }
  }
  sort(l.begin(), l.end());
  sort(r.rbegin(), r.rend());
  sort(t.begin(), t.end());
  sort(b.rbegin(), b.rend());
  vector<int> T;
  for(auto e : l)
    T.push_back(e.second);
  for(auto e : t)
    T.push_back(e.second);
  for(auto e : r)
    T.push_back(e.second);
  for(auto e : b)
    T.push_back(e.second);
  stack<int> st;
  for(auto e : T){
    cerr << e << " ";
    if(st.empty()){
      st.push(e);
      continue;
    }
    if(st.top() == e)
      st.pop();
    else
      st.push(e);
  }
  cerr << endl;
  if(st.empty()) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 3688
def main():
    from functools import lru_cache
    import sys
    input=sys.stdin.readline
    sys.setrecursionlimit(100000000)
    INF=10**9
    n=int(input())
    M=[list(map(int,input().split())) for _ in range(n)]
   
    @lru_cache(maxsize=None)
    def dp(i,j):
        if i+1==j:
            return 0
        else:
            ans=INF
            for k in range(i+1,j):
                ans=min(ans,dp(i,k)+dp(k,j)+M[i][0]*M[k][0]*M[j-1][1])
            return ans
    print(dp(0,n))

if __name__=='__main__':
    main()


Measured memory_bytes: 6884
use proconio::*;
use std::cmp::max;

fn main() {
    input! {
        n: usize,
        m: usize,
        k: i64,
        mut a: [i64; n],
        mut b: [i64; m],
    };

    let mut acc = b.iter().sum::<i64>();
    let mut j = m;
    let mut ans = 0;

    for i in 0..a.len() + 1 {
        while acc > k && j > 0 {
            j -= 1;
            acc -= b[j];
        }

        if acc > k {
            break;
        }

        ans = max(ans, j + i);
        if i == n {
            break;
        }
        acc += a[i];
    }

    println!("{}", ans);
}


Measured memory_bytes: 9224
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

int main()
{
    int n, k, s;
    cin >> n >> k >> s;

    vector<int> a(n, s);
    fill(a.begin() + k, a.end(), (s == 1000000000 ? 1 : s + 1));
    cout << a[0];
    for(int i=1; i<n; ++i)
        cout << ' ' << a[i];
    cout << endl;

    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#include <set>
#include <iterator>
using namespace std;
using namespace __gnu_pbds;


#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()

#define ll long long int
#define vi vector<int>
#define vii vector<pair<int,int> >
#define pii pair<int,int>
#define plii pair<pair<ll, int>, int>
#define piii pair<pii, int>
#define viii vector<pair<pii, int> >
#define vl vector<ll>
#define vll vector<pair<ll,ll> >
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define mp make_pair
#define ms(x, v) memset(x, v, sizeof x)
#define pr_vec(v) for(int i=0;i<v.size();i++) cout << v[i] << " " ;

#define f_in(st) freopen(st,"r",stdin)
#define f_out(st) freopen(st,"w",stdout)

#define INF INT_MAX
#define matrix vector<vector<ll> >

#define fr(i, a, b) for(i=a; i<=b; i++)
#define fb(i, a, b) for(i=a; i>=b; i--)
#define ASST(x, l, r) assert( x <= r && x >= l )
#define maxbits 9
#define maxmask (1ll<<maxbits)
typedef tree<pll, null_type, less<pll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;
const int  N=100000 +10, M=(ll)1e9+1 ;
const int mod =998244353 ,sz=5 ;
vl a(510);
ll n,k;

bool check(ll x){
  vl b;
  for(ll i=0;i<n;i++)
    b.pb(a[i]%x);
  sort(b.begin(),b.end());
  ll l,r;
  l=0,r=n-1;
  ll rem,req;
  rem=req=0;
  while(l<=r){
    if(rem<=0){
      rem+=b[l];
      req+=b[l];
      l++;
    }
    else{
      rem-=(x-b[r]);
      req+=(x-b[r]);
      r--;
    }
  }
  // cout << x << " " << req << "\n";
  if(req>2*k)
    return 0;
  return 1;
}
void work(){
  cin >> n >> k;
  ll s=0;
  for(ll i=0;i<n;i++){
    cin >> a[i];
    s+=a[i];
  }
  // cout << s << " " << check(7) << " ";
  ll ans=-1;
  for(ll i=1;i*i<=s;i++){
    if(s%i==0){
        if(check(i))
        ans=max(ans,i);
        if(check(s/i))
        ans=max(ans,s/i);
    }
  }
  cout << ans;

}
int main(){
 ios_base::sync_with_stdio(0);
 cin.tie(0);
    ll t;
    // cin >> t;
    t=1;
    while(t--){
            work();
    }
   return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
 
#include<vector>
#include<string>
 
#include<algorithm>
#include<cmath>
 
using namespace std;
typedef long long ll;
const int INF = 1e9+1;
 
template <class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template <class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
 
int D, G;
 
 
//核問題についてコンプするか全く手を出さないかの二択
//ただし中途半端に解くのが1種だけある場合あり
//その場合コンプしない問題の中から最も単価が高いもの
int main() {
    cin >> D >> G;
    vector<int> p(D),c(D),comp(D);
    int maxc = -1;
    for (int i = 0; i < D; i++) {
        cin >> p[i] >> c[i];
    }
    for (int i = 0; i < D; i++) {
        comp[i] = 100 * (i+1) * p[i] + c[i];
    }
    int res = INF;
    for (int s = 0; s < 1 << D; s++) {
        int point = 0;
        int count = 0;
        int k = 0;
        for (int i = 0; i < D; i++) {
            if (s & 1 << i) {
                point += comp[i];
                count += p[i];
            } else {
                k = i;
            }
        }   
        if (point < G) {
            int j = 0;
            while (point < G) {
                if (j == p[k]-1) {        
                    break;
                }
                point += 100 * (k+1);
                count++;
                j++;
            }
        }
        if (point >= G) {
            chmin(res,count);
        }
    }
    cout << res << endl;
 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
using namespace std;

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

const int N = 100 + 5;

int d[N][N], g[N][N];

const int inf = 1e9;

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int n,m;
	cin >> n >> m;
	vector<pii> e;
	rep(i,0,n)rep(j,0,n)d[i][j] = d[j][i] = (i == j ? 0 :inf);
	rep(i,0,m){
		int x,y,w;
		cin >> x >> y >> w;
		--x,--y;
		d[x][y] = d[y][x] = w;
		g[x][y] = g[y][x] = w;
		e.emplace_back(x,y);
	}
	rep(k,0,n){
		rep(i,0,n){
			rep(j,0,n){
				gmin(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
	int cnt = 0;
	for(pii p:e){
		int x = p.first;
		int y = p.second;
		bool bad = 1;
		rep(i,0,n){
			rep(j,0,n){
				if(d[i][j] == d[i][x] + d[y][j] + g[x][y])bad = 0;
			}
		}
		cnt += bad;
	}
	cout << cnt << '\n';
}


Measured memory_bytes: 384
# -*- coding: utf-8 -*-
# 整数の入力
n = input()

if (n[0] == 'A') and (n[1] == 'B') and (n[2] == 'C'):
    print('ARC')

if (n[0] == 'A') and (n[1] == 'R') and (n[2] == 'C'):
    print('ABC')


Measured memory_bytes: 9104
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a >= 10 || b >= 10) {
			System.out.println(-1);
		}else {
			System.out.println(a * b);
		}
		sc.close();
	}
}


Measured memory_bytes: 22228