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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vvvl vector<vector<vector<long long>>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vs vector<string>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define fi first
#define se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define bitrep(i,s,n) for(long long i=(s);i<(1LL<<(n));i++)
#define bitcheck(bit,i) (bit)&(1LL<<(i))
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define Lin(s) getline(cin,(s))

//Yes,No
void Yes(bool a){cout<<(a?"Yes":"No")<<endl;}
void YES(bool a){cout<<(a?"YES":"NO")<<endl;}

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//切り上げ除算
long long cutup(long long a,long long b){return (a+b-1)/b;}

//累乗
template<typename t>
constexpr t my_pow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
    }
    return x;
}
#define pow my_pow

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

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n,m;
    cin>>n>>m;
    vp A(n);
    rep(i,n)cin>>A[i].first>>A[i].second;
    sort(all(A));
    int i=0;
    ll res=0;
    while(m>0){
        if(A[i].se<=m){
            m-=A[i].se;
            res+=A[i].fi*A[i].se;
        }else{
            res+=A[i].fi*m;
            m=0;
        }
        i++;
    }
    cout<<res<<endl;
}

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

int main()
{
  int n,a,b,count,f=0;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    cin>>a>>b;
    if(a==b)
      count++;
    else
      count=0;
    if(count==3)
    {
      cout<<"Yes";
      f=1;
    }
  } 
  if(!f)
    cout<<"No";
   return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

signed main(){
	string s;
	cin >> s;
	int n = s.length();
	reverse(all(s));
	s += '0';
	int dp[1000100][2];
	for(int i = 0;i <= n + 1;i++) dp[i][0] = dp[i][1] = INF;
	dp[0][0] = 0;
	for(int i = 0;i <= n + 1;i++){
		int c = s[i] - '0';
		for(int j = 0;j < 2;j++){
			for(int k = 0;k < 10;k++){
				if(k - j - c < 0) chmin(dp[i + 1][1],dp[i][j] + k + 10 + k - j - c);
				else chmin(dp[i + 1][0],dp[i][j] + k + k - j - c);
			}
		}
	}
	cout << dp[n + 1][0] << endl;
}

Measured memory_bytes: 17028
n = int(input())
A = list(map(int, input().split()))
f = 0
ans = 0
while f == 0:
    for i in range(n):
        if not A[i]%2 == 0:
            f = 1
    if f == 0:
        ans += 1
        for j in range(n):
            A[j] /= 2
print(ans)

Measured memory_bytes: 3060
/*
　　　∫ ∫ ∫
　　　ノヽ
　　（＿　 ）
　（＿　　　 ）
（＿＿＿＿＿＿ ）
　ヽ(´･ω･)ﾉ　
　　 |　 /
　　 UU
*/
#pragma region macro
#include <bits/stdc++.h>
typedef long long int64;
using namespace std;
typedef vector<int> vi;
const int MOD = (int)1e9 + 7;
const int64 INF = 1LL << 62;
const int inf = 1<<30;
const char bn = '\n';
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i,s,n) for (int i = s; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end() //コンテナじゃないと使えない!!
#define debug(x) cerr << #x << ": " << x << "\n";
#define mp make_pair
template <typename T>
ostream& operator<<(ostream& os, const vector<T> &V){
    int N = V.size();
    REP(i,N){
        os << V[i];
        if (i!=N-1) os << " ";
    }
    os << "\n";
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, pair<T,S> const&P){
    os << "(";
    os << P.first;
    os << " , ";
    os << P.second;
    os << ")";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T> &S){
    auto it=S.begin();
    while(it!=S.end()){
        os << *it;
        os << " ";
        it++;
    }
    os << "\n";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, deque<T> &q){
    for(auto it=q.begin();it<q.end();it++){
        os<<*it;
        os<<" ";
    }
    os<<endl;
    return os;
}
template <typename T,typename S>
ostream& operator<<(ostream& os, map<T,S> const&M){
    for(auto e:M){
        os<<e;
    }
    os<<endl;
    return os;
}
vector<pair<int,int>> dxdy = {mp(0,1),mp(1,0),mp(-1,0),mp(0,-1)};
#pragma endregion
//fixed<<setprecision(10)<<ans<<endl;

//xから1日で行ける一番遠いホテル
int calc_next(int64 x, vector<int64> const& X){
    return (upper_bound(ALL(X), x) - X.begin()) - 1;
}

//to:iの1ステップ先, MAX_K:ステップ数の上界
vector<vector<int>> doubling(vector<int> const& to, int64 MAX_K){
    int J = 1;
    while(MAX_K>0){
        J++;
        MAX_K >>= 1;
    }

    size_t N = to.size();
    vector<vector<int>> DP(N, vector<int>(J)); //DP[i][j] := 状態iから2^jステップ後の状態x
    for(int i=0; i<N; i++) DP[i][0] = to[i];

    for(int j=1;j<J;j++){
        for(int i=0; i<N; i++){
            DP[i][j] = DP[DP[i][j-1]][j-1];
        }
    }

    return move(DP);
}


int solve(int a, int b, vector<vector<int>> const& DP){
    int res = 0;
    int now = a;
    while(now < b){
        auto idx = lower_bound(ALL(DP[now]), b) - DP[now].begin() - 1; //b以上にならない最大のindex
        if(idx<0){
            res++; break;
        }
        res += 1<<idx;
        now = DP[now][idx];
    }
    return res;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<int64> X(N);
    REP(i,N) cin >> X[i];
    int64 L; cin >> L;

    vector<int> to(N);
    REP(i,N){
        to[i] = calc_next(X[i] + L, X);
    }

    auto DP = doubling(to, 1e5);

    int Q; cin >> Q;
    REP(i,Q){
        int a,b; cin >> a >> b;
        a--;b--;
        if(a>b) swap(a,b);
        auto ans = solve(a,b,DP);
        cout << ans << bn;
    }

}

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

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define MAX 100000
#define INF 1410065408
#define EPS 1e-9
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{int from, to; ll cost;};

vector<ll> es[MAX+1];
ll dp[MAX+1][10+1];
vector<ll> v(MAX+1), d(MAX+1), c(MAX+1);

void dfs(ll vv, ll depth, ll c){
	dp[vv][depth] = c;
	if(depth == 0) return;
	for(ll to : es[vv]){
	    if(dp[to][depth-1] == 0) dfs(to, depth-1, c);
	}
    if(dp[vv][depth-1] == 0) dfs(vv, depth-1, c);
}


signed main(){
	ll N, M, Q;
	cin >> N >> M;
	fill(dp[0], dp[N+1], 0);
	rep(M){
		ll tmp1, tmp2;
		cin >> tmp1 >> tmp2;
		es[tmp1].push_back(tmp2);
		es[tmp2].push_back(tmp1);
	}
	cin >> Q;
	rep(Q){
		cin >> v[i] >> d[i] >> c[i];
	}
	for(int i=Q-1;i>=0;i--){
		if(dp[v[i]][d[i]] == 0){
			dfs(v[i], d[i], c[i]);
		}
	}
	
	rep(N){
		cout << dp[i+1][0] << endl;
	}
	
}

Measured memory_bytes: 17780
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    ll A;
    double B;
    cin >> A >> B;
    ll _B = round(100 * B);
    cout << (ll)((A * _B) / 100) << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Measured memory_bytes: 3820
N = int(input())
L = sorted(list(map(int, input().split())))

if N <= 3:
    print(0)
    exit()

ans = 0

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            ans += 1
            if L[i] == L[j]:
                ans -= 1
            elif L[j] == L[k]:
                ans -= 1
            elif L[i] + L[j] <= L[k]:
                ans -= 1

print(ans)


Measured memory_bytes: 9196
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

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

int main() {
    ll N,K;
    cin >> N >> K;
    vector<ll> A(N);
    
    for(int i=0;i<N;i++) cin >> A[i];
    sort(A.begin(),A.end());
    ll gc=A[0];
    for(int i=1;i<N;i++){
        gc=euclidean_gcd(gc,A[i]);
    }
    ll st=lower_bound(A.begin(),A.end(),K)-A.begin();
    bool jg=false;
    for(int i=st;i<N;i++){
        if(K%gc==A[i]%gc){
            jg=true;
            break;
        }
    }
    cout << (jg?"POSSIBLE":"IMPOSSIBLE") << endl;




    return 0;
}

Measured memory_bytes: 1024
//
// Created by ?????°?????? on 2016/06/21.
//

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;

int main(){
    string t,p; cin >> t >> p;
    int nt = t.size();
    int np = p.size();
    if(nt < np) return 0;
    for (int i = 0; i < nt-np +1 ; ++i) {
        if(t[i]== p[0]){
            if(t.substr(i,np) == p) printf("%d\n",i);
        }
    }
    return 0;
}

Measured memory_bytes: 2052
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[11],i,j,c=0,mn=INT_MAX,p=0;
    string s;
    cin>>s;
    for(i=0; i<s.size(); i++)
    {
        a[i]=s[i]-'0';

    }
    for(i=0; i+2<s.size(); i++)
    {
        c=0;
        p=0;
        for(j=i; j<s.size(); j++)
        {
            p=p*10+a[j];
            c++;
            if(c==3)
            {
                p=abs(p-753);
                // cout<<p<<endl;
                mn=min(mn,p);

            }

        }

    }

    cout<<mn<<endl;




}


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

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
bool marked[100001];
vector<ii> v[100001];  //adjList

ll prim(int k){
    priority_queue<ii, vector<ii>, greater<ii> > q;
    ll u;
    long long minimumCost = 0;
    ii p;
    q.push(mp(0, k));
    while(!q.empty())
    {
        p = q.top();
        q.pop();
        k = p.second;
        if(marked[k] == true)
            continue;
        minimumCost += p.fi;
        marked[k] = true;
        for(ll i = 0;i < v[k].size();++i)
        {
            u = v[k][i].se;
            if(marked[u] == false)
                q.push(v[k][i]);
        }
    }
    return minimumCost;
}

int main() {
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    long long n;
    cin>>n;
    vector<ii> x;
    vector<ii> y;
    for(ll i =0;i<n;i++){
        ll a,b;
        cin>>a>>b;
        x.pb(mp(a,i));
        y.pb(mp(b,i));
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    for(ll i=0;i<n-1;i++){
        v[x[i].se].pb(mp(x[i+1].fi-x[i].fi,x[i+1].se));
        v[x[i+1].se].pb(mp(x[i+1].fi-x[i].fi,x[i].se));
        v[y[i].se].pb(mp(y[i+1].fi-y[i].fi,y[i+1].se));
        v[y[i+1].se].pb(mp(y[i+1].fi-y[i].fi,y[i].se));
    }
    ll ans=prim(0);
    cout<<ans;
    return 0;
}


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

int main() {
  int n; cin >>n;
  bool ans = false;
  for(int a = 1; a <= 9; a++){
    for(int b = 1; b <=9;b++){
      if(a*b==n) ans = true;
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int n;
  string s;
  cin >> n >> s;
  rep(i, s.size()) {
    int d = s[i] - 'A' + n;
    if (d > 25) {
      cout << (char)('A' + d - 26);
    } else {
      cout << (char)(s[i] + n);
    }
  }
  cout << endl;
  
  return 0;
}

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

def main():
    l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

    K = int(input())

    print(l[K-1])



if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 9e18;
constexpr int inf = 1e9;
constexpr double INFD = 1e100;
constexpr ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -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; }
// ---------------------------------------------------------------------------
 
 // snukeさんのmodint
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

// mint N;

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};

// combination c(N);
// mint ans = c(N,n);
// cout << ans.x << endl;
// Nとnはll型(mintではない)
// -------------------------------------------------------------


int main(){
  int N,Q;
  cin >> N >> Q;
  priority_queue<pair<ll,pair<int,ll>>,vector<pair<ll,pair<int,ll>>>,greater<pair<ll,pair<int,ll>>>> event;
  for(int i=0; i<N; i++){
    ll s,t,x;
    cin >> s >> t >> x;
    event.push(make_pair(s-x,make_pair(1,x)));
    event.push(make_pair(t-x,make_pair(-1,x)));
  }
  vector<ll> ans(Q);
  set<ll> stop;
  for(int i=0; i<Q; i++){
    ll d;
    cin >> d;
    while(event.size() and event.top().first <= d){
      auto now = event.top();
      event.pop();
      if(now.second.first == 1){
        stop.insert(now.second.second);
      }else{
        stop.erase(now.second.second);
      }
    }
    if(stop.size()){
      ans[i] = *stop.begin();
    }else{
      ans[i] = -1;
    }
  }
  for(int i=0; i<Q; i++){
    cout << ans[i] << endl;
  }
  return 0;
}

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

int main()
{
  int n,m;
  for(;cin>>n>>m,n||m;)
    {
      int data[n+1];
      memset(data,-1,sizeof(data));
      int list[2][m];
      for(int i=0;i<m;i++)
	{
	  cin>>list[0][i]>>list[1][i];
	  if(list[0][i]==1)
	    data[list[1][i]]=1;
	}
      for(int i=0;i<m;i++)
	{
	  if(data[list[0][i]]==1 && data[list[1][i]]!=1 )
	    data[list[1][i]]=2;
	  if(data[list[1][i]]==1 && data[list[0][i]]!=1 )
	    data[list[0][i]]=2;
	}
      int cnt=0;
      for(int i=2;i<n+1;i++)
	{
	  ///	  cout<<data[i]<<endl;
	if(data[i]>0)
	  cnt++;
	}

      cout<<cnt<<endl;
    }
}

Measured memory_bytes: 1248
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef long long ll;
const int MOD = 998244353;
const int BASE = 27;
const int N = 100002;
const ll oo = 1e18;
const double EPS = 1e-9;

ll n,last = -1;

vector<ll> ans;

int main() {
	cin >> n;
	for(ll i = 1 ; i*i <= n ; i++){
		if(n/i == n%i)ans.push_back(i);
	}
	for(ll i = 1 ; i*i <= n ; i++){
		ll l = n/(i+1) + 1;
		ll r = n/i;
		if(l > r)continue;
		ll looking = n/i - 1;
		if(n%i == 0 && looking >= l && looking <= r)ans.push_back(looking);
		//cout << l << " "<< r << " = "<< i << " " << looking<< endl;
	}
	sort(ans.begin(),ans.end());
	ans.resize(unique(ans.begin(),ans.end())-ans.begin());
	//cout << ans.size() << endl;
	ll res = 0;
	for (int i = 0; i < ans.size(); ++i){
		res += ans[i];
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
    int a,b;
    int len;
    cin>>len;
    cin>>a;
    cin>>b;
    string str;
    cin>>str;
    int counta=0;int countb=0;
    for (int i=0; i<len; i++) {
        if(str[i]=='c') {cout<<"No"<<endl;
            continue;
        }
        if (str[i]=='a' && (counta+countb) < a+b) {
            cout<<"Yes"<<endl;
            counta++;
              continue;
        }
        if (str[i]=='b' && countb < b  && (counta+countb) < a+b) {
            cout<<"Yes"<<endl;
            countb++;
              continue;
        }
        else{
            cout<<"No"<<endl;
        }
    }
    return 0;
}


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

int main()
{
  int n, k, i, j;
  string s;
  cin >> n >> k >> s;
  vector<int> man0(50010);
  vector<int> man1(50010);
  int a = 0;
  int b = 0;
  for(i = 0; i < n; i++)
  {
    if(s.at(i) == '0')
    {
      man0.at(a)++;
    }
    if(s.at(i) == '1')
    {
      man1.at(b)++;
    }
    if(i >= 1)
    {
      if(s.at(i-1) == '0' && s.at(i) == '1')
      {
        a++;
      }
      else if(s.at(i-1) == '1' && s.at(i) == '0')
      {
        b++;
      }
    }
  }
  if(man0.at(a) != 0) a++;
  if(man1.at(b) != 0) b++;
  int maxi = 1;
  int sum = 0;
  for(i = 0; i < max(a-k+1, 1); i++)
  {
    for(j = i; j < min(i+k, 50005); j++)
    {
      sum += man0.at(j) + man1.at(j);
    }
    if(i >= 1 && s.at(0) == '0')
    {
      sum += man1.at(i-1);
    }
    if(s.at(0) == '1')
    {
      sum += man1.at(min(i+k, 50005));
    }
    if(sum >maxi)
    {
      maxi = sum;
    }
    sum = 0;
  }
  if(k >= n)
  {
    cout << n << endl;
  }
  else
  {
    cout << maxi << endl;
  }
}

Measured memory_bytes: 896
x,y,a,b,c=map(int,input().split())
p=[int(i) for i in input().split()]
q=[int(i) for i in input().split()]
r=[int(i) for i in input().split()]
p.sort()
q.sort()
p=p[-x:]
q=q[-y:]
s=p+q+r
s.sort()
print(sum(s[-x-y:]))

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

main(){
  string smp,smp1;
  string rei[100];
  int x;
  int ans=0,a;
  int ch[100]={0};
  
  cin >> smp;
  cin >> x;
  for(int i=0;i<x;i++){
    cin >> rei[i];
    rei[i] += rei[i];
    a = rei[i].find(smp,0);
    if(a != string::npos){
      ans++;
      ch[i]++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 1220
#include<iostream>
using namespace std;
int A[10];
bool dfs(int start, int topB, int topC){
	if(start == 9){
		if(A[start] > topB || A[start] > topC){
			return true;
		}
		else{
			return false;
		}
	}
	bool b1 = false, b2 = false;
	if(A[start] > topB){
		b1 = dfs(start+1, A[start], topC);
	}
	if(A[start] > topC){
		b2 = dfs(start+1,topB,A[start]);
	}
	return (b1 || b2 );
}
int main(){
	int N;
	cin >> N;
	for(int i = 0; i < N; ++i){
		for(int j = 0; j < 10; ++j){
			cin >> A[j];
		}
		bool result = dfs(0,0,0);
		if(result == true){
			cout << "YES" << endl; 
		}
		else{
			cout << "NO" <<endl; 
		}
	}
	return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using boost::multiprecision::cpp_int;
using namespace std;

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MOD 1000000007

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 pair<ll, ll> p;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = int(s.size());
  reverse(ALL(s));
  int x = 1, tot = 0;
  // vector<ll> cnt(2019);
  map<int, ll> cnt;
  ll res = 0;
  rep(i, n){
    cnt[tot]++;
    // cout << tot << endl;
    // print(cnt);
    tot += (s[i]-'0')*x;
    tot %= 2019;
    res += cnt[tot];
    x = x*10%2019;
  }
  cout << res << endl;
}


Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
#define il inline
#define ll long long
#define CL(a,b) memset(a,b,sizeof a)
#define pb push_back
#define fi first
#define sc second
#define pi pair<int,int>
#define pii pair<int,pair<int,int>>
const int N=1e5+7;
int a[N];
ll gcd(ll a,ll b)
{
    return b?gcd(b,a%b):a;
}
int main()
{
    int n;
    ll m;
    int f=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]),a[i]>>=1;
    ll last=a[1];
    int flag=0;
    for(int i=2;i<=n;i++)
    {
        int g=gcd(a[i],last);
        last=a[i]/g*last;
        if(last>m) {flag=1;break;}
    }
    if(flag) {printf("0");return 0;}
   // cout<<last;
    for(int i=1;i<=n;i++)
        if((last/a[i])%2==0)
        f=1;
    if(!f)
    printf("%d",(m/last+1)/2);
    else
    printf("0");
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
string s;
int ans,totg,totp;//totg>=totp
int main(){
	cin>>s;
	if(s[0]=='p') ans++;
	totg++;
	for(int i=1;i<s.size();i++)
	  if(totg<=totp)
	  	if(s[i]=='p') ans--,totg++;
	  	else totg++;
	  else
	    if(s[i]=='p') totp++;
	    else ans++,totp++;
	cout<<ans;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <queue>
#include <cmath>
#include <random>
#include <fstream>
#include <string>
#include <tuple>
#include <deque>
#include <set>
#include <map>
#include <stack>

#define REP(i, N) for(int i = 0; i< N; i++)
using namespace std;
#define ll long long
const int INF = 1 << 29;
const ll llINF = 10000000000000000;

const int MOD = 1000000007;

#define MAX_N 100100
typedef pair<int, int> P;
typedef pair<ll, ll> llP;

int main(){
    int N, M, Q;
    int lr[510][510] = {0};
    int haba[510][510] = {0};
    cin >> N >> M >> Q;
    REP(i, M){
        int l, r;
        cin >> l >> r;
        l--;
        r--;
        lr[l][r] ++;
    }
    REP(w, N){
        REP(i, N - w){
            haba[i][i + w] = lr[i][i + w];
            if(w > 0)haba[i][i + w] += (haba[i + 1][i + w] + haba[i][i + w - 1]);
            if(w > 1)haba[i][i + w] -= haba[i + 1][i + w - 1];
        }
    }
    
    REP(i, Q){
        int p, q;
        cin >> p >> q;
        p--;
        q--;
        printf("%d\n", haba[p][q]);
    }
    
}


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

int main(){
  int n,m;
  cin>>n>>m;
  char a[50][50];
  int w[50],r[50],b[50];
  lp(i,50){
    w[i]=0;
    r[i]=0;
    b[i]=0;
  }
  lp(i,n){
    lp(j,m){
      cin>>a[i][j];
      if(a[i][j]=='W') w[i]++;
      if(a[i][j]=='R') r[i]++;
      if(a[i][j]=='B') b[i]++;
    }
  }
  int ans=10000;
  lp(i,n-2){
    for(int j=i+1;j<n-1;j++){
      int mem=0;
      for(int k=0;k<=i;k++){
	mem+=r[k]+b[k];
      }
      for(int k=i+1;k<=j;k++){
	mem+=w[k]+r[k];
      }
      for(int k=j+1;k<n;k++){
	mem+=w[k]+b[k];
      }
      if(mem<ans) ans=mem;
    }
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(long long i=0; i<(int)n; i++)
#define rep2(i,a,n) for(long long i=(a); i<(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using psi = pair<string, int>;
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};
const int mod = 1e9+7;
int gcd(int a, int b){if(a%b == 0){return(b);}else{return(gcd(b, a%b));}}
int lcm(int a, int b){return a * b / gcd(a, b);}

int N, M, K, H, W, L, R, X;
//string S, T;

signed main(){
  const int mn = 1e6+1;
  vector<bool> prime(mn,true);
  prime[0] = false, prime[1] = false; 
  for(int i = 2; i*i <= mn; i++){
    if(prime[i] == true){
      for(int j=i+i; j<=mn; j += i){
        prime[j]=false;
      }
    }
  }
  

  vvi l2017(mn,vi(2,0));
  int tsum = 0;
  for(int i=1; i<mn; i +=2 ){
    if(prime[i] && prime[(i+1)/2]){
      ++tsum;
      l2017[i][0] = 1;
    }
    l2017[i][1] = tsum;
  }  
  cin >> N;
  rep(i,N){
    int a, b; cin >> a >> b;
    cout << l2017[b][1]-l2017[a][1] + l2017[a][0]  << endl;
  }

  return 0;
}

Measured memory_bytes: 57976
#pragma GCC optimize ("O3")
#pragma GCC optimize("unroll-loops")
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
const int mod=1e9+7;
int n;
const int N=2e5;
int f[N],inv[N];
vector<vector<int>> ad;
int sz[N];
int dp[N];
int ans[N];
int modp(int a,int b)
{
	if(b==0)return 1;
	int u=modp(a,b/2);
	u=(u*u)%mod;
	if(b&1)return (a*u)%mod;
	return u;
}
void dfs1(int node=0, int par=-1)
{
	sz[node]=1;dp[node]=1;
	for(int u:ad[node])
	{
		if(u!=par)
		{
			dfs1(u,node);
			sz[node]+=sz[u];
			dp[node]*=dp[u];
			dp[node]%=mod;
		}
	}
	dp[node]*=sz[node];
	dp[node]%=mod;
}
void dfs2(int u=0, int par=-1, int abovediv=1)
{
	ans[u]=f[n-1];
	ans[u]*=modp(abovediv,mod-2);ans[u]%=mod;
	ans[u]*=modp(dp[u],mod-2);ans[u]%=mod;ans[u]*=sz[u];ans[u]%=mod;
	
	for(auto v:ad[u])
	{
		if(v!=par)
		{
			int pass=dp[u]*abovediv;pass%=mod;pass*=(n-sz[v]);pass%=mod;pass*=modp(dp[v],mod-2);
			pass%=mod;pass*=modp(sz[u],mod-2);
			pass%=mod;
			dfs2(v,u,pass);
		}
	}
	
	
	
	
}
int32_t main()
{
	#ifdef ONLINE_JUDGE
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	#endif
	cin>>n;
	int u,v;
	f[0]=1;
	for(int i=1;i<N;i++)
	f[i]=(i*f[i-1])%mod;
	inv[N-1]=modp(f[N-1],mod-2);
	for(int i=N-2;i>=0;i--)inv[i]=((i+1)*inv[i+1])%mod;
	ad=vector<vector<int>>(n+1);
	for(int i=0;i<n-1;i++)
	{
		cin>>u>>v;
		u--;v--;
		ad[u].push_back(v);
		ad[v].push_back(u);
	}
	
	dfs1();
	dfs2();
	for(int i=0;i<n;i++)cout<<ans[i]<<'\n';
}

Measured memory_bytes: 23408
n,q=list(map(int,input().split()))

n_t=[input().split() for i in range(n)]

p_time=0

while n_t:
    
    if int(n_t[0][1])<=q:
        p_time+=int(n_t[0][1])
        finish=n_t.pop(0)
        print(finish[0],p_time)
    else:
        
        n_t[0][1]=str(int(n_t[0][1])-q)
        n_t.append(n_t[0])
        p_time+=q
        del n_t[0]  

Measured memory_bytes: 19600
import sys
from io import StringIO
import unittest


def resolve():
    # s = input()
    # n = int(input())
    x, k, d = map(int, input().split())
    # l = [list(map(int, input().split())) for _ in range(n)]

    m = abs(x) // d

    if k < m:
        print(abs(x) - k * d)
    else:
        x = abs(x) - m * d
        k -= m

        if k % 2 == 0:
            print(abs(x))
        elif k % 2 == 1:
            print(abs(x - d))


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """6 2 4"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """7 4 3"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """10 1 2"""
        output = """8"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """1000000000000000 1000000000000000 1000000000000000"""
        output = """1000000000000000"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()


Measured memory_bytes: 16332
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
int a[3][3],n;

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
signed main() 
{
  ll n; cin>>n;
  vector<string> v(n);
  map<string, int> m;
  for(int i=0;i<n;i++)
   {
       cin>>v[i];
       sort(v[i].begin(),v[i].end());
       m[v[i]]++;
   }
   ll ans=0;
   map<string, int>::iterator i;

   for(i=m.begin();i!=m.end();i++)
   {
       ll x=i->second;
       ans+=(x*(x-1))/2;
   }
   cout<<ans;

}


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

int main()
{
  int N;
  float A;
  cin>>N;
  if((N%2)==0)
  {
   A=0.5;
  }
  else 
  {
    float X=N;
   A=(X+1)/(2*X);
  }
  cout<<A<<endl;
}

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()


int main() {
    int N, M, X[100000], diff[99999];
    cin >> N >> M;
    REP(i, M) cin >> X[i];
    sort(X, X + M);
    REP(i, M - 1) diff[i] = X[i + 1] - X[i];
    sort(diff, diff + M - 1);
    ll ans = 0;
    REP(i, M - N) ans += diff[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
import math

def combinations_count(n, r):
	if n < 2:
		return 0
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


a = input().split(" ")
n = int(a[0])
m = int(a[1])

c = combinations_count(n, 2)
c += combinations_count(m, 2)

print(c)

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

int main()
{
	int N;
	cin >> N;
	vector<int> a(N);
	for (int i = 0; i < N; i++) {
		cin >> a[i];
	}
	sort(a.rbegin(), a.rend());
	int res = 0;
	for (int i = 0; i < N; i++) {
		if (i & 1) {
			res -= a[i];
		}
		else {
			res += a[i];
		}
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
n, y = map(int, input().split())

y = y // 1000

yen = 0
for i in range(n + 1):
    for j in range(n + 1 - i):
        yen = (i * 10) + (j * 5)
        if i + j + (y - yen) == n and yen <= y:
            print(i, j, y - yen)
            exit()

print("-1 -1 -1")

Measured memory_bytes: 3060
#include<stdio.h>
#define MAX 105



int main(){
  int i,j,k,n,m,l;
  int a[MAX][MAX];

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

  for(i=1;i<=n;i++){
    scanf("%d%d",&l,&m);
    for(j=0;j<m;j++){
      scanf("%d",&k);
	a[l][k]=1;
    }
  } 

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      printf("%d",a[i][j]);
      if(j!=n) printf(" ");
    }
    printf("\n");
  }

  return 0;
}



Measured memory_bytes: 2112
#include <bits/stdc++.h>
#include <ctime>
using namespace std;
#define MAXN    100001
long long read(){
    long long x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
long long num[100050];
int n;
queue<long long> q;
int main(){
    n=read();
	for (int i=1;i<=n;i++){
		num[i]=read();	
	}
	sort(num+1,num+n+1);
	
	for (int i=n;q.size()<2&&i>=1;i--){
		if (num[i]==num[i-1]){
			q.push(num[i]);
			i--;
		}
	}
	if (q.size()>=2){
		long long x=q.front();q.pop();
		long long y=q.front();q.pop();
		cout<<x*y<<endl;
	}
	else{
		cout<<0<<endl;
	}
    return 0;
}

Measured memory_bytes: 1024
ns = gets.split(" ").map{|nn|nn.to_i}
ns.sort!

a = ns[0]
b = ns[1]
c = ns[2]

add = c - a + c - b
if add % 2 == 0
  add /= 2
else
  add += 3
  add /= 2
end

puts add.to_s

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

int main()
{
	long long a;
	int b_1,b_2;
	char c;
	cin>>a>>b_1>>c>>b_2;
	
	long long ans=b_1*100+b_2;
	ans*=a;
	cout<<ans/100ll<<endl;
	return 0;
}

Measured memory_bytes: 3632
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


a, b = Is()

if a>=13:
    print(b)
elif 13>a>=6:
    print(int(b/2))
else:
    print(0)


Measured memory_bytes: 64108
n=int(input())
a=list(map(int, input().split()))
l = [0]*8
c = 0
for i in range(n):
  if a[i] >= 3200:
    c += 1
  else:
    l[a[i]//400] = 1

if l.count(1) == 0:
  print("1 "+str(c))
else:
  print(str(l.count(1))+" "+str(l.count(1)+c))

Measured memory_bytes: 8892
#include<bits/stdc++.h>
using namespace std;
#define next Next
#define int long long
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
	int ret=0,f=0;char c=gc();
	while(!isdigit(c)){if(c=='-')f=1;c=gc();}
	while(isdigit(c)){ret=ret*10+c-48;c=gc();}
	if(f)return -ret;return ret;
}
using namespace std;
int n,m,l,p,c,cnt=1,ch[101000][2];
char s[101000];
int dfs(int x,int d)
{
	return x?dfs(ch[x][0],d-1)^dfs(ch[x][1],d-1):d&-d;
}
signed main()
{
	for(scanf("%lld%lld",&n,&m);n--;)
	{
		scanf("%s",s+1);
		l=strlen(s+1);
		for(int i=p=1;i<=l;i++)
		{
			c=s[i]-'0';
			if(!ch[p][c])ch[p][c]=++cnt;
			p=ch[p][c];
		}
	}
	puts(dfs(1,m+1)?"Alice":"Bob");
}

Measured memory_bytes: 4992
import java.util.*;
class Main
{
    public static void main(String[] args)
    {
        
        Scanner sc = new Scanner(System.in);
        
        String a = sc.next();
        
        boolean flag =true;
        
        for(int i=0; i < a.length();i++) {
            char c = a.charAt(i);
            if(c=='U' || c=='D' ) continue;
            if(i%2 == 0 && c!='R') {
                System.out.println("No");
                flag=false;
                break;
            }
            else if (i%2!=0 && c!='L') {
                System.out.println("No");
                flag=false;
                break;
            }
        
        }
        if(flag){
            System.out.println("Yes");
            
        }
       
    }
}

Measured memory_bytes: 21844
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using static Input;
using static Util;
class Program
{
    static long[] N;
    static long[] B = new long[100000 + 1];
    static void INPUT()
    {
        N = LineLong();
        for (var ii = 0; ii < N[0]; ii++)
        {
            var a = LineInt();
            B[a[0]] += a[1];
        }
    }
    static void OUT()
    {
        var a = 0;
        var k = N[1];
        for (var i = 1; i <= 100000 && k > 0; i++)
        {
            a = i;
            k -= B[i];
        }

        Console.WriteLine(a);
    }
    static void Main(string[] args)
    {
#if DEBUG  
        TESTINPUT();
#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
       // N = 1000003;
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{
}




Measured memory_bytes: 18348
#include <bits/stdc++.h>
#define rep(i,a,b) for(auto i=(a);i<(b);i++)
#define per(i,a,b) for(auto i=(a);i>=(b);i--)
#define Min(a,b) ((a) < (b) ? (a) : (b))
#define Max(a,b) ((a) > (b) ? (a) : (b))
#define int_inf 0x3f3f3f3f
#define int_max 2147483647
#define ll_max 9223372036854775807
#define ull_max 18446744073709551615
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lowbit(x) (x)&(-x)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const ll mod=1e9+7;
template<class T>
inline T read()
{
	T x=0,f=1;char s=getchar();
	while(s<'0'||s>'9') {if(s=='-')f=-1;s=getchar();};
	while(s>='0'&&s<='9'){x=(x<<3)+(x<<1)+s-48;s=getchar();};
	return x*f;
}
template<typename T>
inline void wri(T x)
{
	if(x<0){x=-x;putchar('-');};
	if(x/10) wri(x/10);
	putchar(x%10+48);
}
template<typename T>
inline void print(T x,char s)
{
	wri(x);
	putchar(s);
}
template<typename T>
T gcd(T a,T b)
{
	return b==0?a:gcd(b,a%b);
}
//关闭流同步就不能手写读入优化啦
int a,b;
int cnt=1;
int vis[100010];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    cin>>a>>b;
    if(b%2==1){
    	int l1=1,r1=b,l2=b+1,r2=b*2+1;
    	int cnt=0;
    	while(l1<r1){
    		if(cnt>=b) break;
    		cout<<l1<<" "<<r1<<endl;
    		cnt++;
    		l1++,r1--;
		}
		while(l2<r2){
    		if(cnt>=b) break;
    		cout<<l2<<" "<<r2<<endl;
    		cnt++;
    		l2++,r2--;
		}
	}
	else{
		int l1=1,r1=b+1,l2=b+2,r2=b*2+1;
    	int cnt=0;
    	while(l1<r1){
    		if(cnt>=b) break;
    		cout<<l1<<" "<<r1<<endl;
    		cnt++;
    		l1++,r1--;
		}
		while(l2<r2){
    		if(cnt>=b) break;
    		cout<<l2<<" "<<r2<<endl;
    		cnt++;
    		l2++,r2--;
		}
	}
    return 0;
}


Measured memory_bytes: 3660
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    string s;
    cin >> s;
    if(s.size() != 26) {
        vector<bool> ex(26,false);
        for(char c : s) ex[c-'a'] = true;
        cout << s;
        rep(i,26) if(!ex[i]) {
            char c = 'a'+i;
            cout << c << endl;
            return 0;
        }
    } else {
        for(int i = 24; i >= 0; i--) {
            char c = s[i];
            bool ok = false;
            rep2(j,i+1,26) {
                if(s[j] > c) ok = true;
            }
            if(ok) {
                cout << s.substr(0,i);
                string ns = s.substr(i);
                char nc = 'z';
                rep2(j,1,ns.size()) if(ns[j] > c) chmin(nc,ns[j]);
                cout << nc << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

N, A, B = get_ints

train = N * A
taxi = B

puts train > taxi ? taxi : train


Measured memory_bytes: 14432
/*  -*- coding: utf-8 -*-
 *
 * c.cc: C: Otoshidama
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int n, y;
  scanf("%d%d", &n, &y);
  y /= 1000;

  // i+j+k=n, 10i+5j+k=y -> j+k=n-i, 5j+k=y-10i
  // -> 4j=(y-10i)-(n-i)=y-n-9i
  for (int i = 0; i <= n && 10 * i <= y; i++) {
    int m = y - n - 9 * i;
    if (m >= 0 && m % 4 == 0) {
      int j = m / 4, k = n - i - j;
      if (k >= 0) {
	printf("%d %d %d\n", i, j, k);
	return 0;
      }
    }
  }

  puts("-1 -1 -1");
  return 0;
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define sumvec(v) accumulate(all(v),0LL)
#define mapmax(v) v.rbegin()->first
#define mapmin(v) v.begin()->first
#define pb push_back
#define pf push_front
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef long long ll;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;

typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;

const double pi = acos(-1.0);
const int mod=1000000007;
const int mod2=998244353;

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

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

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;}

void YES(bool b) {cout << (b?"YES\n":"NO\n");}
void Yes(bool b) {cout << (b?"Yes\n":"No\n");}
void yes(bool b) {cout << (b?"yes\n":"no\n");}
void Yay(bool b) {cout << (b?"Yay!\n":":(\n");}

long long powmod(long long a,long long b){
    long long c=1;
    while(b>0){
        if(b&1) c=a*c%mod;
        a=a*a%mod;
        b>>=1;
    }
    return c;
}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n,m,ans=0;
	cin >> n >> m;
	vll x(n),y(n),z(n);
	rep(i,n) cin >> x[i] >> y[i] >> z[i];
	rep(i,1<<3){
		vll v;
		rep(j,n){
			ll tmp=0;
			if(i&(1<<0)) tmp-=x[j];
			else tmp+=x[j];
			if(i&(1<<1)) tmp-=y[j];
			else tmp+=y[j];
			if(i&(1<<2)) tmp-=z[j];
			else tmp+=z[j];
			v.pb(tmp);
		}
		sort(rall(v));
		ll sum=0;
		rep(j,m) sum+=v[j];
		chmax(ans,sum);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define booga cout << "booga" << endl
#define ll long long int
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a,b;
	cin >> a >> b;
	cout << a*b << "\n";
	return 0;
}




Measured memory_bytes: 3612