akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

int n;

int main() {
    cin>>n;
    ll ret=1;
    for (int i = 2; i <= n; i++) {
        bool ok=true;
        for (int j = 2; j*j <= i; j++) {//素数判定
            if(i%j==0)ok=false;
        }
        if(ok){
            int ord=0;
            int t=n;
            while(t){
                ord+=t/i;
                t/=i;
            }
            (ret*=(ord+1))%=MOD;
        }
    }
    cout<<ret<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long lint;
typedef unsigned long long ulint;

const int n = 100, cutoff = 33;
int values[n + 1];
lint min_squash;

void solve(int i, lint squash, ulint alive0, ulint alive64) {
  if (i == cutoff + 1) {
    static int alives[n];
    int nalive = 0;
    while (alive0 != 0) {
      int alive = __builtin_ctzll(alive0);
      alives[nalive++] = alive;
      alive0 ^= 1ULL<<alive;
    }
    while (alive64 != 0) {
      int alive = __builtin_ctzll(alive64) + 64;
      alives[nalive++] = alive;
      alive64 ^= 1ULL<<(alive - 64);
    }

    int k = nalive;
    for (int j = nalive - 1; j >= 0; --j) {
      if (alives[j] <= cutoff)
        break;
      while (k - 1 >= j && alives[k - 1] >= 2 * alives[j])
        --k;
      if (k < nalive && alives[k] == 2 * alives[j]) {
        if (values[alives[k]] < 0)
          squash -= values[alives[k]];

        squash +=
          min({0, values[alives[k]], values[alives[j]] + values[alives[k]]});
      } else {
        if (values[alives[j]] < 0)
          squash += values[alives[j]];
      }
    }
    min_squash = min(min_squash, squash);
  } else {
    solve(i + 1, squash, alive0, alive64);

    bool is_alive;
    if (i < 64) is_alive = (alive0 & (1ULL<<i)) != 0;
    else is_alive = (alive64 & (1ULL<<(i - 64))) != 0;

    if (is_alive) {
      lint new_squash = squash;
      ulint new_alive0 = alive0, new_alive64 = alive64;
      int m;
      for (m = i; m < 64; m += i) {
        if (alive0 & (1ULL<<m)) {
          new_squash += values[m];
          new_alive0 ^= 1ULL<<m;
        }
      }
      for (; m <= n; m += i) {
        if (alive64 & (1ULL<<(m - 64))) {
          new_squash += values[m];
          new_alive64 ^= 1ULL<<(m - 64);
        }
      }
      solve(i + 1, new_squash, new_alive0, new_alive64);
    }
  }
}

int main() {
  int little_n;
  scanf("%d", &little_n);
  for (int i = 1; i <= little_n; ++i)
    scanf("%d", &values[i]);
  for (int i = little_n + 1; i <= n; ++i)
    values[i] = 0;

  lint sum = 0;
  for (int i = 1; i <= n; ++i)
    sum += values[i];

  min_squash = LLONG_MAX;
  solve(1, 0LL, (~(0ULL)) ^ (1ULL<<0), (1ULL<<(n + 1 - 64)) - 1);

  lint result = sum - min_squash;
  printf("%lld\n", result);

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
	int S, h, m, s;
	scanf("%d", &S);
	h = S / 3600;
	m = S % 3600 / 60;
	s = S % 3600 % 60;
	printf("%d:%d:%d\n", h, m, s);
	return 0;
}

Measured memory_bytes: 1852
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

int main(){
    string s;
    cin >> s;
    int n = s.size();
    cout << string(n, 'x') << endl;
    return 0;
}

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

using namespace std;


int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int a,b,c;
    cin>>a>>b>>c;
    if (a+b==c||b+c==a||c+a==b){
        cout<<"Yes"<<endl;
    }else cout<<"No"<<endl;
    return 0;

}

Measured memory_bytes: 256
#!/usr/bin/env python3
s = input()
a = [int(s[i]) for i in range(4) ]
total = sum(a)
operand = "+-"
for i in range(8):
    k = i
    is_7 = total
    digit = 1
    while digit <= 3:
        if k % 2: is_7 -= 2*a[digit]
        digit += 1
        k = k // 2
    if is_7 == 7:
        print(s[0]+ operand[i%2] + s[1] + operand[(i//2)%2] + s[2] + operand[(i//4)%2] + s[3]+ "=7")
        break

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

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

  int n, k;
  cin >> n >> k;

  ll ans = 0, a1 = 0, a2 = 0;
  rep(i, 1, n + 1) {
    if (i % k == 0)
      a1++;
  }
  ans = a1 * a1 * a1;
  if (k % 2 == 0) {
    rep(i, 1, n + 1) {
      if (i % k == k / 2)
        a2++;
    }
  }
  ans += a2 * a2 * a2;

  cout << ans << endl;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <fstream>

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstdlib>
#include <tuple>
#include <queue>
#include <functional>
#include <stack>
#include <numeric>
#include <cassert>

using namespace std;

class TaskC {
public:
    void solve(istream& in, ostream& out) {
        long long H, W;
        in >> H >> W;
    
        long long mn = abs(H/3 * W - (H - 2*(H/3)) * W);
        mn = min(mn, abs(W/3 * H - (W - 2*(W/3)) * H));
        
        for (int i = 0; i <= H; ++i) {
            long long newH = H - i;
            long long a1 = i * W, a2 = newH / 2 * W, a3 = (newH/2 + newH%2) * W;
            mn = min(mn, max(a1, max(a2, a3)) - min(a1, min(a2, a3)));
            a2 = W / 2 * newH; a3 = (W / 2 + W%2) * newH;
            mn = min(mn, max(a1, max(a2, a3)) - min(a1, min(a2, a3)));
        }
        
        for (int i = 0; i <= W; ++i) {
            long long newW = W - i;
            long long a1 = i * H, a2 = newW / 2 * H, a3 = (newW/2 + newW%2) * H;
            mn = min(mn, max(a1, max(a2, a3)) - min(a1, min(a2, a3)));
            a2 = H / 2 * newW; a3 = (H / 2 + H%2) * newW;
            mn = min(mn, max(a1, max(a2, a3)) - min(a1, min(a2, a3)));
        }
        
        out << mn << "\n";
    }
};


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

	TaskC solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

using vi = vector<int>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define show(x) cout << #x << " = " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo {cout<<"Yes";}else{cout<<"No";}
#define YESNO {cout<<"YES";}else{cout<<"NO";}
#define v(T) vector<T>

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N, T;
  cin >> N >> T;
  int mc = INT32_MAX;
  F0R(i, N) {
    int c, t;
    cin >> c >> t;
    if (t <= T) chmin(mc, c);
  }
  if (mc > 1000) {
    cout << "TLE";
  }
  else {
    cout << mc;
  }
}
#endif


Measured memory_bytes: 3604
#122c
#累積和
N,Q = map(int, input().split())
S = list(input())

AC_cumsum = list()
AC_cumsum.append(0)

for i in range(1,N):
    #print(S[i])
    if S[i-1]=="A" and S[i]=="C":
        AC_cumsum.append(AC_cumsum[-1] + 1)
    else:
        AC_cumsum.append(AC_cumsum[-1])
        
#print(AC_cumsum)
    
for i in range(Q):
    l,r = map(int, input().split())
    print(AC_cumsum[r-1] - AC_cumsum[l-1])

Measured memory_bytes: 6876
N = int(input())
p = list(map(int, input().split()))
ideal_list = [i for i in range(1, N+1)]
delta_list = [abs(a-b) for a, b in zip(p, ideal_list)]
if len([x for x in delta_list if x != 0]) in [0, 2]:
    print('YES')
else:
    print('NO')

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

int main(){
    int r,d,x; cin >> r >> d >> x;
    int sum = x;
    for(int i = 0; i < 10; ++i){
        sum = r*sum - d;
        cout << sum << endl;
    }
}

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

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;
string s;

bool isPalin(int a, int b) {
    while (a < b) {
        if (s[a] != s[b])
            return false;
        a++, b--;
    }
    return true;
}

void solve() {
    cin >> s;
    if (isPalin(0, s.size() - 1) and isPalin(0, (s.size() - 1) / 2 - 1) and isPalin((s.size() + 3) / 2 - 1, s.size() - 1))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}

Measured memory_bytes: 256
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

template<typename T>
vector <T> make_v(size_t a) { return vector<T>(a); }

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

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
    for (auto& e:t) fill_v(e, v);
}

typedef pair<int, int> P;

struct UnionFind {
    vector<int> par;
    vector<int> rank;
    vector<int> vsize;
    UnionFind(int size) : par(size), rank(size), vsize(size) {
        REP(i, size) {
            par[i] = i;
            rank[i] = 0;
            vsize[i] = 1;
        }
    }
    int find(int x) {
        if (par[x] == x) {
            return x;
        } else {
            return par[x] = find(par[x]);
        }
    }
    void unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y) return;
        if (rank[x] < rank[y]) {
            par[x] = y;
        } else {
            par[y] = x;
            if (rank[x] == rank[y]) rank[x]++;
        }
        vsize[x] += vsize[y];
        vsize[y] = vsize[x];
    }
    bool same(int x, int y) { return find(x) == find(y); }
    int getSize(int x) { return vsize[find(x)]; }
};

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

    int N, M;
    cin >> N >> M;

    UnionFind uf(N);

    while (M--) {
        int x, y, z;
        cin >> x >> y >> z;
        x--, y--;
        uf.unite(x, y);
    }


    set<int> s;
    REP(i, N) {
        s.insert(uf.find(i));
    }
    cout << s.size() << endl;

    return 0;
}


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

int main() {
  int h, w;
  cin >> h >> w;
  char grid[h+2][w+2];
  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      cin >> grid[i][j];
    }
  }

  vector<vector<int>> res(h+2, vector<int>(w+2));
  for (int i = 1; i <= h; i++) {
    for (int j = 1; j <= w; j++) {
      if (grid[i][j] == '#') {
        for (int dy = -1; dy < 2; dy++) {
          for (int dx = -1; dx < 2; dx++) {
            if (dy == 0 && dx == 0) continue;
            res[i+dy][j+dx]++;
          }
        }
      }
    }
  }

  for (int i = 1; i < h+1; i++) {
    for (int j = 1; j < w+1; j++) {
      if (grid[i][j] == '#') {
        cout << '#';
      } else {
        cout << res[i][j];
      }
    }
    cout << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pil pair<int,long long>
#define pli pair<long long,int>
#define pll pair<long long,long long>
#define pb push_back
#define mk make_pair
#define sd(x) scanf("%d", &x)
#define pd(x) printf("%d\n",x)
#define pdl(x) printf("%lld\n",x)
#define sdl(x) scanf("%lld", &x)
#define eps 1e-12l
#define maxn 100009
using namespace std;
int main()
{
	int n;
	sd(n);
	ll a[n],ans=0;
	int cnt=0;
	for(int i=0;i<n;i++)
	{
		sdl(a[i]);
		if(a[i]==0)
		{
			ans=ans+(cnt/2);
			cnt=0;
		}
		else
		{
			ans=ans+(a[i]/2);
			if(a[i]%2)
			{
				cnt++;
			}
		}
	}
	ans=ans+(cnt/2);
	pdl(ans);
}

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

using namespace std;

#define N 100000
#define MAX 1000000000

long long a[N + 1];

int main(){
	long long sum, min_a, par;
	int n, i;

	scanf("%d", &n);

	for (i = 1; i <= n; i++){
		scanf("%lld", a + i);
	}

	par = sum = 0;
	min_a = MAX;

	for (i = 1; i <= n; i++){
		sum += abs(a[i]);
		par += (a[i] < 0);
		min_a = min(min_a, abs(a[i]));
	}

	if (par % 2){
		printf("%lld\n", sum - 2 * min_a);
	}
	else{
		printf("%lld\n", sum);
	}

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <boost/math/common_factor.hpp>
#define pan(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define vi vector<int>
#define pb push_back
#define INF 1e9+7
#define PI 3.141592653
using namespace std;


int main(){
    double w,h;
    double x,y;
    cin>>w>>h>>x>>y;
    double area=(w*h)/2;
    double slope;
    if(w!=x) slope=abs((h/2-y)/(w/2-x));
    if(x==w/2 && y==h/2) cout<<fixed<<setprecision(9)<<area<<" "<<1;
    // else if(slope==1 || slope==0 || w==x) cout<<fixed<<setprecision(9)<<area<<" "<<1;
    else cout<<fixed<<setprecision(9)<<area<<" "<<0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){

  int N;int k;
  cin>>N>>k;
  vector<int> snake(N);
  for(int i=0;i<N;i++)
    cin>>snake[i];
  sort(snake.begin(),snake.end(),greater<int>());
  long long ans=0;
  for(int i=0;i<k;i++)
    ans+=snake[i];
  cout<<ans<<endl;
  return 0;
}


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

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

#define INF 100000000

int main() {
  int64_t H;
  cin >> H;

  int64_t atack = 0;
  int64_t new_monster = 1;
  while (0 < H){
    H /= 2;
    atack += new_monster;
    new_monster *= 2;
  }
  cout << atack << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
	if (a < 0) { return -a; }
	if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
	if (a >= b) {
		return a;
	}
	else {
		return b;
	}
}

//大小比較(小)
long long int small(long long int a, long long int b) {
	if (a >= b) {
		return b;
	}
	else {
		return a;
	}
}

int main() {
	long long int n, m, k,p;
	char s[30],str2[15],str3[15];
	scanf("%s",s);
	s[5] = ' ';
	s[13] = ' ';
		printf("%s",s);
	
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;

const int maxn = 63;
ll pow2[maxn];

int main()
{
	//freopen("D.in","r",stdin);
	ll a,b;
	scanf("%lld%lld",&a,&b);
	if (a==b) { puts("1"); return 0; }
	
	pow2[0] = 1LL;
	for (int i=1;i<=62;i++) pow2[i] = pow2[i-1] * 2LL;
		
	ll T;
	for (int i=59;i>=0;i--)
	{
		ll d1 = (a / pow2[i]) & 1LL;
		ll d2 = (b / pow2[i]) & 1LL;
		if (d1 != d2)
		{
			T = pow2[i];
			a %= T;
			b %= pow2[i+1];
			break;
		}
	}
	
	int k = -1;
	if (b > T) k = log(b-T) / log(2);
	ll tmp = T + pow2[k+1] - 1LL;
	
	ll ans = 0;
	if (tmp < T+a) 
	{
		ans = tmp - a + 1LL;
		ans += 2LL*T - 1LL - T - a + 1LL;
	}
	else ans = 2LL*T - 1LL - a + 1LL;
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

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

        int N = sc.nextInt();
        int[] a = new int[N];
        int ans = 0;

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

        int x = 1;
        for(int i=0; i<N; i++){
            ans += 1;
            x = a[x - 1];
            if(x==2){
                System.out.println(ans);
                break;
            }
            if(i==N-1){
                System.out.println(-1);
            }
        }
    }
}

Measured memory_bytes: 49892
#include <stdio.h>
int main(void){
    int count[4][3][10] ={};
    int n,b,f,r,v,i,k,m;
    scanf("%d\n",&n);
    
    for(i=0;i<n;i++){
        scanf("%d %d %d %d\n",&b,&f,&r,&v);
        count[b-1][f-1][r-1] = count[b-1][f-1][r-1]+v;
    }
    
    for(i=0;i<4;i++){
        for(m=0;m<3;m++){
            for(k=0;k<10;k++){
                printf(" %d",count[i][m][k]);
            }
            printf("\n");
        }
        if(i != 3)
        printf("####################\n");
    }
    return 0;
}



Measured memory_bytes: 2112
N = int(input())
v = list(map(int, input().split()))
V = sorted(v, reverse=True)
A = 0

while N > 1:
  v1 = V.pop()
  v2 = V.pop()
  A = (v1 + v2)/2
  V.append(A)
  N -= 1

print(V[0])

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

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")

using namespace std;

typedef long long ll;
typedef long double ld;


void solve() {
    ld a, b;
    cin >> a >> b;
    ll res = a * b;
    cout << res << "\n";
}

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

Measured memory_bytes: 3748
#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

//#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector<vector<int>> mat;
//typedef unsigned int uint;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int D, G;
	int P[100], C[100];
	int ans = INF;

	cin >> D >> G;
	rep(i, 0, D)
	{
		cin >> P[i] >> C[i];
	}
	rep(i, 0, 1 << D)
	{
		int t = 0;
		int c = 0;
		int mi = -1;
		rep(j, 0, D)
		{
			if ((i&(1 << j)))
			{
				t += 100 * (j + 1)*P[j] + C[j];
				c += P[j];
			}
			else
			{
				chmax(mi, j);
			}
		}
		if (mi != -1 && t < G)
		{
			int tc = min(P[mi]-1, (G - t + 100 * (mi + 1) - 1) / (100 * (mi + 1)));
			c += tc;
			t += tc * 100 * (mi + 1);
		}

		if (t < G)
		{
			continue;
		}

		chmin(ans, c);
	}

	cout << ans << endl;

	return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> TUP;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mp(a,b) make_pair(a,b)
const ll MOD=1000000007;

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*y/gcd(x,y);
}

int main(){
	ll N,D; cin>>N>>D;
    if(N%(D*2+1)==0) printf("%lld",N/(D*2+1));
    else printf("%lld",N/(D*2+1)+1);
}

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

#define CH(N,A,B) (A<=N&&N<B)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define RREP(i,a,b) for(int i=(b-1);a<=i;i--)

using namespace std;

int main() {

  int N, M, T, a[105];
  cin>>N>>M>>T;
  REP(i,0,N) cin>>a[i];

  int ans = a[0] - M;
  REP(i,1,N){
    ans += max(0, (a[i]-M*2) - a[i-1]);
    //cout<<"i: "<<i<<", +"<<max(0, (a[i]-M*2) - a[i-1])<<endl;
  }
  ans += max(0, T - (a[N-1] + M));
  //cout<<" +"<<max(0, T - (a[N-1] + M))<<endl;

  cout<<ans<<endl;

  return 0;
}

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

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

 vector<string> w = {"Sunny", "Cloudy", "Rainy"};
 int index;
 for(int i=0; i < 3; i++){
  if(S == w[i]){
    index = i;
    break;
  }
 }
 index = (index + 1) % 3;
 cout << w[index] << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m-1); i>=int(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()
#define fst first
#define snd second
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 P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
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;}
inline int Log2(ll x) {int k; for(k=0; x>0; ++k) x>>=1; return k;} // number of binary digits
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)
}
template<typename T> istream& operator>>(istream& is, vector<T>& v) {
  rep(i, v.size()) is >> v[i]; return is;
}
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
  rep(i, v.size()) os << v[i] << " "; return os;
}
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;


int main() {
  ll a, b, c; cin >> a  >> b >> c;

  cout << c << " " << a << " " << b << endl;
  return 0;
}


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

#define INF 1 << 29
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)

using namespace std;

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

void gen_sosuu(int sosuu[]){
  REP(i,100010){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(100000)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<=100000;j++){
      //printf("%d %d %d\n",i*j,i,j);
      sosuu[i*j] =false;
    }
  }
}
bool flag[4]={false};

char s;
int n;
int main(){
  scanf("%d",&n);
  REP(i,n){
    scanf("%c",&s);
    if(s=='Y'){
      printf("Four\n");
      return 0;
    }
  }
  printf("Three\n");
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
int main(void){
    char n[3];
    int cnt=0;
    for(int i=0;i<3;i++){
        std::cin >> n[i];
        if(n[i] == 'o'){
            cnt++;
        }    
    }
    printf("%d",700+cnt*100);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a,v) memset(a, v, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
ll p=1e9+7;
const int N=2e5+5;
int n,m,q;
struct node
{
    int a,b,c,d;
};
node que[51];
int ans=0;
void rec(int i,int s,vector<int> &a){
    if(i==n){
        int temp=0;
        // dbg(a);
        rep(j,q){
            if(((a[que[j].b-1]-a[que[j].a-1]))==que[j].c){
                temp+=que[j].d;
               // / dbg(j,que[j].d);
            }
        }
        ans=max(ans,temp);
        return ;
    }
    for(int j=s;j<=m;j++){
        a[i]=j;
        rec(i+1,j,a);
    }
    return ;
}
int main() {
  
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    int T=1;
    // cin>>T;
    while(T--){
        cin>>n>>m>>q;
        vector<int> a(n);
        rep(i,q){
            int a,b,c,d;cin>>a>>b>>c>>d;
            que[i]={a,b,c,d};
        }
        rec(0,1,a);
        cout<<ans;
    }   
    timecalculater();
    return 0;   
} 

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<ll> VI; typedef pair<ll,ll> pii;
const int mod = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T> void amin(T& a,T b){ a=min(a,b);}
template <class T> void amax(T& a,T b){ a=max(a,b);}


int main()
{
	//cin.tie(0); ios_base::sync_with_stdio(false);
	
	int n; cin >>n;
	VI a(n), b(n);
	rep(i,n) cin >>a[i];
	rep(i,n) cin >>b[i];
	
	bool ok=true;
	rep(i,n) if(a[i] <b[i]) ok=false;
	if(ok){ puts("0"); return 0;}
	
	ll sma = accumulate(all(a),0LL);
	ll smb = accumulate(all(b),0LL);
	if(smb > sma){puts("-1"); return 0;}
	
	VI odf(n), pdf, mdf;
	rep(i,n) odf[i] = a[i] - b[i];
	sort(all(odf)); reverse(all(odf));
	
	rep(i,n) (odf[i]>=0? pdf: mdf).push_back(odf[i]);
	
	int ans =0;
	
	rep(i, sz(pdf)){
		ll zf = pdf[i];
		repr(j, sz(mdf)-1, 0){
			if(mdf[j]>=0 || zf<=0) break;
			if(mdf[j]+zf >=0){
				zf +=mdf[j];
				mdf[j] =0; ans++;
			}else{
				mdf[j] +=zf; zf=0;
			}
		}
		if(zf !=pdf[i]){ pdf[i]=0; ans++;}
		while(sz(mdf) && mdf.back() >=0) mdf.pop_back();
		if(sz(mdf)==0) break;
	}
	
	cout <<ans <<"\n";
	return 0;
}


Measured memory_bytes: 3832
#include <bits/stdc++.h>
#define optimize ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0) ;
#define ll long long
#define ld long double
#define lint __int128
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
#define lp(i,a,b) for(int i = a ; i <= b ; i ++)
#define rlp(i,a,b) for(int i = b ; i >= a ; i --)
#define a_sort(v) sort(v.begin(), v.end())
#define d_sort(v) sort(v.rbegin(), v.rend())
#define pii pair<int,int>
#define pi 3.14159265358979323846264338327950
using namespace std ;
// #define debug

const int MOD = 1E9 + 7 ;
const int N = 1E5 ;

vector<long long> prime_factorization(long long n) {
    vector<long long> factorization;
    while (n % 2 == 0) {
        factorization.push_back(2);
        n /= 2;
    }
    for (long long d = 3; d * d <= n; d += 2) {
        while (n % d == 0) {
            factorization.push_back(d);
            n /= d;
        }
    }
    if (n > 1)
        factorization.push_back(n);
    return factorization;
}

int main() {
    #ifdef debug
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif // debug
    optimize

    ll n ; cin >> n ;
    vll factor = prime_factorization(n) ;
    map<int, int> mp ;
    for(auto x : factor) mp[x] ++ ;
    int cnt = 0 ;

    for(auto x : mp) {
        int add = (-1 + sqrt(1 + 8 * x.second)) / 2 ;
        cnt += add ;
    }
    cout << cnt << endl ;
}

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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL<<60;
const ll mod =1000000009;





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

	int n;
	ll p;
	cin >> n >> p;

	ll c = 0, d = 0;


	vector<ll> w(n), b(n);
	vector<pair<ll, pair<ll, ll>>> v;
	ll sum = 0;
	ll a = 0;
	REP(i, n) {
		cin >> w[i] >> b[i];
		v.push_back({ (100 - p)*w[i] + p * b[i],{w[i],b[i]} });
		sum += b[i];
	}
	sort(ALL(v));
	reverse(ALL(v));

	int ans = 0;

	REP(i, n) {
		a += v[i].second.first;
		sum -= v[i].second.second;
		ans++;
		if ((100 - p)*a >= p * sum)break;

	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 6388
#include <stdio.h>
#include <stdlib.h>

typedef struct Node{
    long data;
    struct Node* next;
    struct Node* prev;
} Node;

static Node* head = NULL;
static Node* tail = NULL;

void insert(long data);
void delete(long key);
void deleteFirst();
void deleteLast();
void printFW();
int Opcode(char cmd[]);

int main(){
    long n;
    scanf("%ld",&n);
    char cmd[30];
    fgets(cmd,30,stdin);
    for(int i=1; i<=n; i++){
        fgets(cmd,30,stdin);
        switch (Opcode(cmd)){
            case 1: {insert(atoi(&cmd[7])); break;}
            case 2: {delete(atoi(&cmd[7])); break;}
            case 3: {deleteFirst(); break;}
            case 4: deleteLast(); 
        }
        // printFW();
    }
    printFW();
    return 0;
}

void insert(long data){
    Node* newNode = (Node*) malloc(sizeof(Node));
    newNode->data = data;

    if(head == NULL){
        tail = newNode;
    }
    else{
        head->prev = newNode;
    }
    newNode->prev = NULL;
    newNode->next = head;
    head = newNode;
}

void deleteFirst(){
    Node* currentNode = head;  
    // If the list is empty
    if(head == NULL) return;
    // If the list only has 1 node left
    if(head->next == NULL){
        head = NULL;
        tail = NULL;
    }
    else{
        head = head->next;
        head->prev = NULL;
    }
    free(currentNode);
}

void deleteLast(){
    Node* currentNode = tail;
    // If the list is empty
    if(head == NULL) return;
    // If the list only has 1 node left
    if(tail->prev == NULL){
        head = NULL;
        tail = NULL;
    }
    else{
        tail = tail->prev;
        tail->next = NULL;
    }
    free(currentNode);
}

void delete(long data){
    Node* currentNode = head;
    if(head == NULL) return;
    while(currentNode->data != data){
        if(currentNode == tail) return;
        else currentNode = currentNode->next;
    }
    if(currentNode == tail) deleteLast();
    else if(currentNode == head) deleteFirst();
    else{
        Node* buffer1 = currentNode->prev;
        Node* buffer2 = currentNode->next;
        buffer1->next = buffer2;
        buffer2->prev = buffer1;
        free(currentNode);
    } 
}

void printFW(){
    Node* currentNode = head;
    while(currentNode != NULL){
        printf("%ld", currentNode->data);
        currentNode = currentNode->next;
        if(currentNode == NULL) printf("");
        else printf(" ");
    }
    printf("\n");
}

int Opcode(char cmd[]){
    if(cmd[6] == ' '){
        if(cmd[0] == 'i') return 1;
        else return 2;
    }
    else{
        if(cmd[6] == 'F') return 3;
        else return 4;
    }
}


Measured memory_bytes: 32988
N,W=list(map(int,input().split()))

w=[0]*N
v=[0]*N

dp=[[10**20]*(10**5+1) for _ in range(N+1)]
dp[0][0]=0

for i in range(N):
    ww,vv=input().split()
    w[i]=int(ww)
    v[i]=int(vv)

for i in range(N):
    for vv in range(10**5+1):
        if vv-v[i]>=0:
            dp[i+1][vv]=min(dp[i][vv],dp[i][vv-v[i]]+w[i])
        else:
            dp[i+1][vv]=dp[i][vv]

for vv in range(10**5,-1,-1):
    if dp[N][vv]<=W:
        print(vv)
        break

Measured memory_bytes: 145032
#include <bits/stdc++.h>
using namespace std;
#define int long long 
 
#define pi pair<int,int>
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define mx 1000000
#define mn 0
#define hello 123

signed main()
{
    string s,t;
    cin>>s>>t;
    int temp,ans=INT_MAX;
    int x=s.length();
    int y=t.length();
    for(int i=0;i<=x-y;i++)
    {
        temp=0;
        for(int j=0;j<y;j++)
        {
            if(s[i+j]==t[j])continue;
            else temp++;
        }
        ans=min(temp,ans);
        
    }
    cout<<ans;
}

Measured memory_bytes: 3580
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>

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

using namespace std;
using ll = long long int;
const int inf = 1001001000;
const long long int Inf = 1001001001001001000;

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

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

int main()
{
	int n, m;
	cin >> n >> m;
	vector<int> a(n);
	rep(i, n) cin >> a[i];

	sort(all(a));
	reverse(all(a));
	int s = accumulate(all(a), 0);
	rep(i,m){
		if (s > a[i] * 4 * m)
		{
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#pragma GCC optimize(3,"Ofast","inline")
#pragma GCC optimize(2)
#define NIL -1

using namespace std;

struct node{
	int pa,le,ri;
};

const int maxn=1e7+10;
node nd[maxn];

void Init(int n)
{
	for(int i=0;i<n;i++){
		nd[i].pa=nd[i].le=nd[i].ri=NIL;
	}
}

int getRoot(int n)
{
	for(int i=0;i<n;i++){
		if(nd[i].pa==NIL){
			return i;
		}
	}
}

void preParse(int u)
{
	if(u==NIL)return;
	printf(" %d",u);
	preParse(nd[u].le);
	preParse(nd[u].ri);
}

void inParse(int u)
{
	if(u==NIL)return;
	inParse(nd[u].le);
	printf(" %d",u);
	inParse(nd[u].ri);
}

void postParse(int u)
{
	if(u==NIL)return;
	postParse(nd[u].le);
	postParse(nd[u].ri);
	printf(" %d",u);
}

int main()
{
	int n;
	scanf("%d",&n);
	Init(n);
	int v,l,r; 
	for(int i=0;i<n;i++){
		scanf("%d%d%d",&v,&l,&r);
		nd[v].le=l;
		nd[v].ri=r;
		nd[l].pa=v;
		nd[r].pa=v;	
	}
	int root=getRoot(n);
	
	printf("Preorder\n");
	preParse(root);
	printf("\n");
	
	printf("Inorder\n");
	inParse(root);
	printf("\n");
	
	printf("Postorder\n");
	postParse(root);
	printf("\n");
	return 0;
}


Measured memory_bytes: 3160
#include<stdio.h>
int main()
{
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if(a<=b&&b<=c)
	{
	    printf("%d %d %d\n",a,b,c);
	}
	else if(a<=c&&c<=b)
	{
	    printf("%d %d %d\n",a,c,b);
	}
	else if(b<=a&&a<=c)
	{
	    printf("%d %d %d\n",b,a,c);
	}
	else if(b<=c&&c<=a)
	{
	    printf("%d %d %d\n",b,c,a);
	}
	else if(c<=a&&a<=b)
	{
	    printf("%d %d %d\n",c,a,b);
	}
	else if(c<=b&&b<=a)
	{
	    printf("%d %d %d\n",c,b,a);
	}

	return 0;
}



Measured memory_bytes: 2036
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
#include <stack>
#include <bitset>
#include <map>
#include <ctime>
#include <numeric>


#ifndef M_PI
#define M_PI 3.141592653589
#endif
#define int long long
#define double long double

#ifdef TIME
#define start cin.tie(NULL); cout.tie(NULL); cout.setf(ios::fixed); cout.precision(10); ios_base::sync_with_stdio(false);int32_t START = clock()
#define finish cout << "\ntime: " << (clock() - START) / (CLOCKS_PER_SEC * 1.0); return 0
#endif

#ifndef TIME
#define start cin.tie(NULL); cout.tie(NULL); cout.setf(ios::fixed); cout.precision(10); ios_base::sync_with_stdio(false)
#define finish return 0
#endif

using namespace std;


//vector input
template<typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (auto &i : vec) {
        cin >> i;
    }
    return is;
}

//pair output
template<typename E>
ostream &operator<<(ostream &os, pair<E, E> &t) {
    os << t.first << ' ' << t.second;
    return os;
}

//"map" pair output
template<typename E>
ostream &operator<<(ostream &os, pair<const E, E> &t) {
    os << t.first << ' ' << t.second;
    return os;
}

//vector output
template<typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
    for (T i : vec) {
        os << i << ' ';
    }
    return os;
}

//2 dimensional vector output
template<typename T>
ostream &operator<<(ostream &os, vector<vector<T> > &vec) {
    for (vector<T> i : vec) {
        os << i << '\n';
    }
    return os;
}


int32_t main() {
    start;

    int n, d;
    cin >> n >> d;

    int ans = 0;

    for (int i = 0; i < n; ++i) {
        int x, y;
        cin >> x >> y;

        if (sqrt(x * x + y * y) <= d) {
            ans += 1;
        }
    }

    cout << ans << '\n';

    finish;
}

Measured memory_bytes: 3696
// This file is in ~/.config/geany/templates/files
#include<bits/stdc++.h>
using namespace std;

#define forn(i,n) for(int i=0;i<(int)(n); i++)
#define forsn(i,s,n) for(int i=(s);i<(int)(n); i++)
#define debug(x) cout << #x << " = "  << x << endl
#define pb push_back
#define mp make_pair
typedef long long tint;
int toNumber (string s)
{
	int Number;
	if ( ! (istringstream(s) >> Number) ) Number = 0; // el string vacio lo manda al cero
	return Number;
}
string toString (int number)
{
    ostringstream ostr;
    ostr << number;
    return  ostr.str();
}

tint ele(tint a, tint b){
	if(b==0)return 1;
	if(b%2==0){
		return ele((a*a), b/2);
	}else{
		return a*ele((a*a), b/2);
	}
}

tint mcd(tint a, tint b){
	if(a==0)return b;
	return mcd(b%a, a);
}

double d_abs(long a, long b){
	if(a>b){
		return a-b;
	}
	return b-a;
}

void solve(){
	int n, a, b;
	cin>>n>>a>>b;
	if((b-a)%2==0){
		cout<<"Alice"<<endl;
	}else{
		cout<<"Borys"<<endl;
	}
		
}



int main (){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int T;
	T=1;
	while(T--){
		solve();
	}
}


Measured memory_bytes: 256
N = int(input())
A = []
for i in range(N):
    B,P = input().split()
    P = int(P)
    A.append([B,P,i+1])
A.sort(key=lambda x:x[1])
A = A[::-1]
A.sort(key=lambda x:x[0])

for i in range(N):
  print(A[i][2])

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

int main()
{
    ll n,m,x;
    cin>>n>>m;

    priority_queue<ll>pq;
    for(ll i=0;i<n;i++){
        cin>>x;
        pq.push(x);
    }

    while(m-->0){
        ll val = pq.top();
        pq.pop();
        pq.push(val/2);
    }

    ll ans = 0;
    while(!pq.empty()){
        ans = ans + pq.top();
        pq.pop();
    }

    cout<<ans;

}


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

void solve(long long n, std::vector<double> a){
    sort(all(a));
    double tmp = (*a.rbegin())/2;
    auto lb = lower_bound(a.begin(), a.end()-1, tmp);
    if(lb == a.end()-1)lb--;
    else if(lb>a.begin() && tmp-*(lb-1)<*(lb)-tmp)lb--;
    cout << (LL)(*a.rbegin()) << " " << (LL)(*lb) << endl;
}

int main(){
    long long n;
    scanf("%lld",&n);
    std::vector<double> a(n);
    for(int i = 0 ; i < n ; i++){
        scanf("%lf",&a[i]);
    }
    solve(n, std::move(a));
    return 0;
}


Measured memory_bytes: 1024
#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)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using mii = map<int, int>;
using msi = map<string, int>;
using pii = pair<int, int>;

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

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

mint dp[2][4][4][4]; // A:0, C:1, G:2, T:3.

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << std::fixed << std::setprecision(10);
    
    int n; cin >> n;
    REP(i, 4) REP(j, 4) REP(k, 4) {
        dp[0][i][j][k] = 1;
    }
    dp[0][0][2][1] = dp[0][0][1][2] = dp[0][2][0][1] = 0;
    
    REP(p, n - 3) {
        REP(i, 4) REP(j, 4) REP(k, 4) {
            dp[1][i][j][k] = 0;
        }
        REP(i, 4) REP(j, 4) REP(k, 4) REP(x, 4) {
            if(i == 0 && j == 2 && x == 1) continue;
            if(i == 0 && k == 2 && x == 1) continue;
            if(j == 0 && k == 2 && x == 1) continue;
            if(j == 0 && k == 1 && x == 2) continue;
            if(j == 2 && k == 0 && x == 1) continue;
            dp[1][j][k][x] += dp[0][i][j][k];
        }
        swap(dp[0], dp[1]);
    }
    mint ans = 0;
    REP(i, 4) REP(j, 4) REP(k, 4) {
        ans += dp[0][i][j][k];
    }
    cout << ans.x << endl;

    return 0;
}

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

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, x;
  cin >> n >> m >> x;
  vector<int> c(n), s(m);
  vector<vector<int>>a(n,vector<int>(m));
  for (int i = 0; i < n; ++i){
	cin >> c[i];
	for (int j = 0; j < m; ++j){
		cin >> a[i][j];
		s[j] += a[i][j];
	}
  }
  if (*min_element(s.begin(),s.end()) < x){
	cout << "-1" << "\n";
  }else{
	int ans = 1e9 + 9;
	for (int nu = 0; nu < (1 << n); ++nu){
		int cost = 0;
		vector<int>skill(m);
		for (int mask = 0; mask < n; ++mask){
			if( (nu & (1 << mask)) != 0){
				for (int i = 0; i < m; ++i){
					skill[i] += a[mask][i];
				}
				cost += c[mask];
			}
		}
		if (*min_element(skill.begin(),skill.end()) >= x){
			ans = min(ans,cost);
		}
	}
	cout << ans << "\n";
  }
  
  return 0;
}


Measured memory_bytes: 3660
s = input()
ans = []

for i in range(len(s)):
    if s[i] == '0':
        ans.append('0')
    if s[i] == '1':
        ans.append('1')
    if s[i] == 'B':
        if len(ans) != 0:
            ans.pop(-1)

print(''.join(ans))


Measured memory_bytes: 3060