akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
map<string, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    mp[s]++;
  }
  cout << mp.size() << endl;
}

Measured memory_bytes: 19232
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
using ll = long long;

int main()
{
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N), F(N);
    for (int i = 0; i < N; i++)
        cin >> A[i];
    for (int i = 0; i < N; i++)
        cin >> F[i];
    sort(A.begin(), A.end());
    sort(F.begin(), F.end(), greater<ll>());
    ll highest = 0;
    for (int i = 0; i < N ; i++)
        highest = max(highest, A[i] * F[i]);
    ll lowest = -1;
    while (highest - lowest > 1)
    {
        ll border_score = (highest + lowest) / 2, train_cnt = 0;
        for (int i = 0; i < N; i++)
            train_cnt += max(A[i] - (border_score / F[i]), 0ll);
        if(train_cnt <= K)
            highest = border_score;
        else
            lowest = border_score;
    }
    cout << highest << endl;
}

Measured memory_bytes: 6428
def main():
    s, t = map(str, input().split(' '))
    a, b = map(int, input().split())
    u = str(input())
    if u == s:
        print(str(a - 1) + ' ' + str(b))
    else:
        print(str(a) + ' ' + str(b - 1))
main()

Measured memory_bytes: 9088
from math import sqrt, pow
from operator import sub


def sub_(t):
    return abs(sub(*t))


n = input()
x = list(map(float, input().split()))
y = list(map(float, input().split()))

print(sum(map(sub_, zip(x, y))))
print(sqrt(sum(map(lambda t: sub_(t) ** 2, zip(x, y)))))
print(pow(sum(map(lambda t: sub_(t) ** 3, zip(x, y))), 1/3))
print(max(map(sub_, zip(x, y))))


Measured memory_bytes: 5788
class BinaryTree
  attr_accessor :root

  class Node
    attr_accessor :parent, :left, :right, :key

    def initialize(key)
      @key = key
      @parent = nil
      @left = nil
      @right = nil
    end
  end

  def initialize
    @root = nil
  end

  def insert(key)
    n = Node.new(key)
    y = nil
    x = @root

    while x != nil
      y = x
      x = if n.key < x.key
            x.left
          else
            x.right
          end
    end
    n.parent = y

    if y == nil
      @root = n
    elsif n.key < y.key
      y.left = n
    else
      y.right = n
    end
  end

  def inorder(n)
    return unless n
    inorder(n.left)
    print " #{n.key}"
    inorder(n.right)
  end

  def preorder(n)
    return unless n
    print " #{n.key}"
    preorder(n.left)
    preorder(n.right)
  end

  def dump
    inorder(@root)
    print "\n"
    preorder(@root)
    print "\n"
  end
end

n = gets.to_i
bt = BinaryTree.new

n.times do |i|
  cmd, v = gets.split
  case cmd
  when "insert"
    bt.insert(v.to_i)
  when "print"
    bt.dump
  end
end

Measured memory_bytes: 71204
# -*- coding: utf-8 -*-

s = str(input())
n = len(s) - 1
answer = 0
for i in range(2 ** n):
    operation = [""] * n
    for j in range(n):
        if (i >> j) & 1:
            operation[n - 1 -j] = "+"
    
    formula = ""
    for p_n, p_o in zip(s, operation + [""]):
        formula += (p_n + p_o)
    
    answer += eval(formula)

print(answer)

Measured memory_bytes: 9072
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

vector<ll> div(ll N){
    vector<ll> ret;
    for(ll i = 1; i * i <= N; i++){
        if(N % i == 0){
            ret.pb(i);
            if(i != N / i) ret.pb(N / i);
        }
    }
    sort(all(ret));
    return ret;
}

ll pow_mod(ll a, ll b, ll m){
    ll ret = 1;
    while (b > 0) {
        if (b & 1) {
            ret = ret * a % m;
        }
        a = a * a % m;
        b >>= 1;
    }
    return ret;
}

ll inv_mod(ll a, ll m){
    return pow_mod(a, m - 2, m);
}




int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    ll inv2 = inv_mod(2, mod);
    
    ll N, K;
    cin >> N >> K;
    map<ll, int> M;
    auto D = div(N);
    rep(i, D.size()){
        M[D[i]] = i;
    }
    vector<ll> E(D.size());
    rep(i, D.size()){
        ll A = pow_mod(K, (D[i] + 1) / 2, mod);
        auto DA = div(D[i]);
        rep(j, DA.size() - 1){
            (A -= E[M[DA[j]]]) %= mod;
        }
        E[i] = (A + mod) % mod;
    }
    ll ret = 0;
    rep(i, D.size()){
        ll B;
        if(D[i] % 2 == 0) B = E[i] * (D[i] / 2) % mod;
        else B = E[i] * D[i] % mod;
        (ret += B) %= mod;
    }
    
    output(ret);
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const int inf=1e9+7;
const ll INF=1e18;

int main(){
    int n,c;cin>>n>>c;
    vvin d(c,vin(c));
    rep(i,c)rep(j,c)cin>>d[i][j];
    vvin color(n,vin(n));
    vin zero(c),one(c),two(c);
    rep(i,n)rep(j,n){
        cin>>color[i][j];
        if((i+j)%3==0){
            rep(k,c)zero[k]+=d[color[i][j]-1][k];
        }
        else if((i+j)%3==1){
            rep(k,c)one[k]+=d[color[i][j]-1][k];
        }
        else{
            rep(k,c)two[k]+=d[color[i][j]-1][k];
        }
    }
    int ans=inf;
    rep(i,c)rep(j,c)rep(k,c){
        if(i==j||j==k||k==i)continue;
        ans=min(ans,zero[i]+one[j]+two[k]);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1280
def main():
    N, K = map(int, input().split())
    H = [0] + list(map(int, input().split()))
    dp = [[float("inf")] * (N+1) for _ in range(N+1)]
    dp[0][0] = 0
    for i in range(1, N+1):
        for j in range(i):
            diff = max(H[i] - H[j], 0)
            for k in range(min(N-K, j+1)):
                dp[i][k+1] = min(dp[i][k+1], dp[j][k] + diff)
    ans = float("inf")
    for i in range(N+1):
        ans = min(ans, dp[i][N-K])
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 45532
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1ll << 60;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

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

  for (char i = 'a'; i <= 'z'; i++){
    string now = S + i;
    if (now == T){
      Yes(); return 0;
    }
  }
  No();

  return 0;
}


Measured memory_bytes: 3592
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <functional>
#include <cctype>
#include <list>
#include <limits>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>

const double EPS = (1e-10);


using namespace std;
using Int = long long;
//using namespace boost::multiprecision;

const Int MOD = 1000000007;

void fast_input() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

template<typename T>
T gcd(T a, T b) {
    return b != 0 ? gcd(b, a % b) : a;
}

template<typename T>
T lcm(T a, T b) {
    return a * b / gcd(a, b);
}

int D[10005];
int used[10005];
int main(void) {
    //priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
    int ans[10005];
    int N; cin >> N;
    vector<vector<int>> edge(N);
    for (int i = 0; i < N-1; i++) {
        int a, b; cin >> a >> b;
        a--;
        b--;
        D[a]++;
        D[b]++;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    vector<int> c(N);
    for (int i = 0; i < N; i++) {
        cin >> c[i];
    }
    int sum = 0;
    sort(c.begin(), c.end());
    for (int i = 0; i < N; i++) {
        int mi = 10000000;
        int v;
        for (int j = 0; j < N; j++) {
            if (mi > D[j] && used[j] == 0) {
                v = j;
                mi = D[j];
            }
        }
        used[v] = 1;
        ans[v] = c[i];
        sum += D[v] * c[i];
        for (int j = 0; j < edge[v].size(); j++) {
            D[v]--;
            D[edge[v][j]]--;
        }
        
    }
    cout << sum << endl;
    for (int i = 0; i < N; i++) {
        cout << ans[i] << " ";
    }
    cout << endl;
}   

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MN = 1e5 + 5, LN = 20;
int N, h[MN];
int dp[MN];

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> N;
    for (int i = 1; i <= N; i++) cin >> h[i];
    memset(dp, 0x3f, sizeof(dp));
    dp[1] = 0;
    dp[2] = abs(h[1] - h[2]);
    for (int i = 3; i <= N; i++)
        dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]));
    cout << dp[N] << '\n';
    return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>

int main(){
  int i, n, x[44] = {};
  x[0] = x[1] = 1;

  scanf("%d", &n);

  for(i = 2; i <= n; i++){
    x[i] = x[i-2] + x[i-1];
  }
  printf("%d\n", x[i-1]);

  return 0;
}



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

#define ll long long
#define pb push_back
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define inf 0x3f3f3f3f

int main(){
    fcin;
    int a, b;
    cin >> a >> b;
    cout << max({2*a-1, 2*b-1, a+b});
    return 0;
}




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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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




int main(){

	lli h1,m1,h2,m2,k;

	cin>>h1>>m1>>h2>>m2>>k;
	h1*=60;
	h1 += m1;

	h2*=60;
	h2 += m2;

	cout<<h2-h1-k<<endl;


    return 0;
}


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

using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using f64 = double;
using f80 = long double;

#define FOR(v, a, b) for(i64 v = (a); v < (b); ++v)
#define FORE(v, a, b) for(i64 v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(i64 v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define fst first
#define snd second
#define UNIQ(v) (v).erase(unique(ALL(v)), (v).end())
#define bit(i) (1LL<<(i))

#ifdef DEBUG
#include <Mylib/Debug/debug.cpp>
#else
#define dump(...) ((void)0)
#endif

using namespace std;

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}

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

template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}
template <typename T> auto make_vector(int n, int m, const T &value){return vector<vector<T>>(n, vector<T>(m, value));}

template <typename T> void print(const T &value){std::cout << value << "\n";}
template <typename T, typename ...Args> void print(const T &value, const Args&... args){std::cout << value << " ";print(args...);}


struct Init{
  Init(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cerr << fixed << setprecision(12);
  }
}init;


int main(){
  int N;
  while(cin >> N){
    vector<int> A(N), B(N);
    REP(i,N) cin >> A[i] >> B[i];

    int ans = 0;

    sort(ALL(A));
    sort(ALL(B));

    if(N % 2 == 0){
      int lb = A[N/2] + A[N/2-1];
      int ub = B[N/2] + B[N/2-1];

      ans = ub - lb + 1;
    }else{
      ans = B[N/2] - A[N/2] + 1;
    }
    
    

    print(ans);    
  }

  return 0;
}


Measured memory_bytes: 4788
#include <iostream>
#include <algorithm>
#include <string>
#define flush fflush(stdout)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int mod = 1e9 + 7, INF = 1e9;


int main(void) {
    int h, w, n, si, sj, i, pi1, pi2, pj1, pj2;
    string s, t;

    scanf("%d%d%d%d%d", &h, &w, &n, &si, &sj);
    cin >> s >> t;
    
    pi1 = 1;
    pi2 = h + 1;
    pj1 = 1;
    pj2 = w + 1;
    for (i = n - 1; i >= 0; i--) {
        if (t[i] == 'L') pj2 = min(w + 1, pj2 + 1);
        if (t[i] == 'R') pj1 = max(1, pj1 - 1);
        if (t[i] == 'U') pi2 = min(h + 1, pi2 + 1);
        if (t[i] == 'D') pi1 = max(1, pi1 - 1);

        if (s[i] == 'L') pj1 = min(w + 1, pj1 + 1);
        if (s[i] == 'R') pj2 = max(1, pj2 - 1);
        if (s[i] == 'U') pi1 = min(h + 1, pi1 + 1);
        if (s[i] == 'D') pi2 = max(1, pi2 - 1);

        if (pi1 >= pi2 || pj1 >= pj2) {
            printf("NO\n");
            return 0;
        }
    }

    if (pi1 <= si && si < pi2 && pj1 <= sj && sj < pj2) {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }

    return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
string S;
bitset<4000> X,P;
ll mo=998244353;
ll p2[202020];
int ng;

bitset<4000> gcd(bitset<4000> A,bitset<4000> B) {
	int i;
	for(i=3999;i>=0;i--) {
		if(A[i]==1 && B[i]==1) {
			B^=A;
			break;
		}
		if(A[i]==1) break;
		if(B[i]==1) {
			swap(A,B);
			break;
		}
	}
	
	// A>B
	while(1) {
		int x;
		for(x=i-1;x>=0;x--) if(B[x]) break;
		if(x<0) break;
		while(i>=x) {
			if(A[i]) A^=B<<(i-x);
			i--;
		}
		i=x;
		swap(A,B);
	}
	return A;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	p2[0]=1;
	FOR(i,101010) p2[i+1]=p2[i]*2%mo;
	
	cin>>N>>S;
	FOR(i,S.size()) if(S[i]=='1') X[S.size()-1-i]=1;
	FOR(j,N) {
		cin>>S;
		bitset<4000> B;
		FOR(i,S.size()) if(S[i]=='1') B[S.size()-1-i]=1;
		if(j==0) P=B;
		else P=gcd(P,B);
	}
	
	ll ret=0;
	FOR(i,4000) if(P[i]) x=i;
	bitset<4000> Y;
	for(i=3999;i>=x;i--) {
		if(X[i]) ret+=p2[i-x];
		if(X[i]^Y[i]) Y^=P<<(i-x);
	}
	
	/*
	FOR(i,6) cout<<X[i];
	cout<<" ";
	FOR(i,6) cout<<Y[i];
	cout<<endl;
	*/
	ret++;
	for(i=x-1;i>=0;i--) {
		if(Y[i]<X[i]) {
			break;
		}
		if(Y[i]>X[i]) {
			ret--;
			break;
		}
	}
	
	cout<<ret%mo<<endl;
	
	
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int MOD = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct edge{
    ll to, cost;
};


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

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

// 素数
vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){
        IsPrime.resize(max+1,true);
    } 
    IsPrime[0] = false;
    IsPrime[1] = false;

    for(size_t i=2; i*i<=max; ++i){
        if(IsPrime[i]){
            for(size_t j=2; i*j<=max; ++j){
                IsPrime[i*j] = false;
            }
        }
    }
}

// べき乗の余り
ll modpow(ll a, ll n){
    ll res = 1;
    while(n){
        if(n & 1){
            res = res * a % MOD;
        }
        a = a * a % MOD;
        n = n >> 1;
    }
    return res;
}

// コンビネーション
ll MAXN = 2e5+10;
vector<ll> inv(MAXN);
ll nCk(ll n, ll k) {
	ll res = 1;
	for(ll i = 1; i <= k; i++) {
		res = res*(n-i+1) % MOD;
	}
 
	for(ll i = 1; i <= k; i++) {
		res = res*inv[i] % MOD;
	}
	return res;
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

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

    ll ans = 0;
    ll sum = 0;
    while(true){
        sum += x;
        ans += t;
        if(sum >= n){
            break;
        }
    }
    cout<<ans<<endl;

    return 0;
}

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


def solve(N: int, d: "List[int]"):
    total = 0
    for v in itertools.combinations(d, 2):
        total += v[0] * v[1]
    print(total)
    return


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

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main (){
ll n,a[100009],b[100009],c[100009];
cin>>n;
for(int i=0;i<n;i++)cin>>a[i]>>b[i]>>c[i];
for(int i=1;i<n;i++)
a[i]=max(b[i-1]+a[i],c[i-1]+a[i]),
b[i]=max(c[i-1]+b[i],a[i-1]+b[i]),
c[i]=max(b[i-1]+c[i],a[i-1]+c[i]);

cout<<max(max(a[n-1],b[n-1]),c[n-1])<<endl;

}

Measured memory_bytes: 2688
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmin(x,y) x = min(x,y)

const int INF = 1001001001;
int dp[1000005][2];

int main() {
  string s;
  cin >> s;
  reverse(s.begin(), s.end());
  s += '0';
  int n = s.size();
  rep(i,n+1)rep(j,2) dp[i][j] = INF;
  dp[0][0] = 0;
  rep(i,n)rep(j,2) {
    int x = s[i]-'0';
    x += j;
    if (x < 10) chmin(dp[i+1][0], dp[i][j]+x);
    if (x > 0) chmin(dp[i+1][1], dp[i][j]+(10-x));
  }
  int ans = dp[n][0];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 9220
#include<stdio.h>
#include<string.h>
int main()
{
    char s[10000];
    scanf("%s", s);
    int l, count=0, i, flag=0, j;
    l = strlen(s);
    if(s[0] == 'A')
    {

        for(j=2;j<l-1;j++)
        {
            if(s[j] == 'C')
            {
                flag = 1;
                break;
            }
        }
    }
    if(flag == 1)
    {
        for(i=0;i<l;i++)
        {
            if(s[i] >= 'a' && s[i] <= 'z')
                count++;
        }
    }
    if(count == l-2)
        printf("AC\n");
    else
        printf("WA\n");
}


Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
  cin >> n;
  int V[n], C[n];
  for (int i = 0; i < n; i++)
    cin >> V[i];
  for (int i = 0 ; i < n; i++)
    cin >> C[i];
  int res = 0;
  for (int i = 0 ; i < n; i++)
    res += max(0, V[i]-C[i]);
  cout << res <<'\n';

	return 0;
}

Measured memory_bytes: 256
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

S = input()

prevg = 0
prevp = 0

ans = 0
for enec in S:
  if prevg > prevp:
    #どちらでも出せるので勝つ方を出す
    if enec=='p':
      prevp += 1
    else:
      prevp += 1
      ans += 1
  else:
    #gを出すしかない
    prevg += 1
    if enec=='p':
      ans -= 1

print(ans)






Measured memory_bytes: 40088
import java.util.Scanner;

class Main{

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

		int area = a * b;
		int perimeter = 2*(a + b);

		// String input = sc.nextLine();
	  // String nums[] = input.split(" ");

	  // long A = Long.parseLong(nums[0]);
	  // long B = Long.parseLong(nums[1]);
	  // long sum = Long.parseLong(nums[2]);

		System.out.println(area + " " + perimeter);
		// System.out.println(S.toString());

	}
}


Measured memory_bytes: 26292
#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define iss istringstream
#define sst stringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sh(i) (1LL<<i)
#define sz size()
#define vi vector<int>
#define vc vector
#define vl vector<ll>
#define vs vector<string>

int n,m[9][9],f[9][9];

int main(){
	cin>>n;
	while(n--){
		memset(f,0,sizeof(f));
		rep(i,9)rep(j,9)cin>>m[i][j];
		rep(i,9){
			rep(j,9)rep2(k,j+1,9){
				if(m[i][j]==m[i][k])f[i][j]=f[i][k]=1;
				if(m[j][i]==m[k][i])f[j][i]=f[k][i]=1;
			}
		}
		rep(i,3)rep(j,3){
			rep(ii,3)rep(jj,3)rep(iii,3)rep(jjj,3){
				if((ii!=iii||jj!=jjj)&&m[i*3+ii][j*3+jj]==m[i*3+iii][j*3+jjj]){
					f[i*3+ii][j*3+jj]=f[i*3+iii][j*3+jjj]=1;
				}
			}
		}
		rep(i,9){
			rep(j,9)cout<<(f[i][j]?"*":" ")<<m[i][j];
			cout<<endl;
		}
		if(n)cout<<endl;
	}
}

Measured memory_bytes: 0
from collections import deque

n = int(input())
a = list(map(int, input().split()))

b = deque([])
rev = 1
for i in a:
    if rev == 1:
        b.append(i)
        rev = -1
    elif rev == -1:
        b.appendleft(i)
        rev = 1

print(*(b if rev == 1 else list(b)[::-1]))


Measured memory_bytes: 25416
#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.at(i);
  }
  bool result = true;
  for(int i=0;i<N;i++){
    if(a.at(i)%2 == 0){
      if(!(a.at(i)%3==0 || a.at(i)%5==0)){
        result = false;
      }
    }
  }
  if(result){
    cout << "APPROVED" << endl;
  }
  else{
    cout << "DENIED" << endl;
  }
      
   
 
  
}




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

using namespace std;

using ll = long long int;
using vi = vector<int>;
using vvi = vector<vi>;

#define _LIBCPP_DEBUG 0
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

int main() {
	int N, Y; cin >> N >> Y;
	for (int x=0; x<=N; x++) {
		for (int y=0; x+y<=N; y++) {
			int z = N - x - y;
			if (Y == 10000*x + 5000*y + 1000*z) {
				cout << x << " " << y << " " << z << endl;
				return 0;
			}
		}
	}
	cout << "-1 -1 -1" << endl;
	return 0;
}


Measured memory_bytes: 3132
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
	int ans,sum,a,b;
	ans=0;
	int n;
	cin>>n>>a>>b;
	//cout<<n<<a<<b;
	for(int i=1;i<=n;i++){
		int t=i;
		sum=0;
		while(t){
			sum+=t%10;
			t/=10;
		}	
		if(sum>=a&&sum<=b)
			ans+=i;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) int((a).size())
const int INF=INT_MAX;


int main(){
  ll n,k,ans=0;cin>>n>>k;
  vll p(n,0);
  rep(i,0,k){
    ll d;cin>>d;
    rep(j,0,d){
      ll a;cin>>a;
      p[--a]++;
    }
  }
  rep(i,0,n){
    if(p[i]==0){ans++;}
  }
  cout<<ans<<endl;
}

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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

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

const string YES = "Yes";
const string NO = "No";

int main(){
    int n, k;
    cin >> n >> k;
    vi a(n);
    rep(i, n) cin >> a[i];
    for (int r=k; r<n; ++r) {
        int l = r-k;
        if (a[l] < a[r]) cout << YES << endl;
        else cout << NO << endl;
    }
    return 0;
}


Measured memory_bytes: 4052
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>

using namespace std;
int main(){
    
long long  N;
long long  K;

cin >> N >> K;
long long  c[2002][2002];
c[1][1]=1;
long long md=1000000007;
//パスカルの三角形で組み合わせを求める。
//c[n][k]=n段目、k番目を表し、
//c[n][k]=(n-1)C(k-1)
//c[n+1][k+1]=nCkとなることに注意
for(long long i=2;i<=N+1;i++){
    for(int l=1;l<=i;l++){
        c[i][l]=c[i-1][l]+c[i-1][l-1];
        if(c[i][l]>md){
            c[i][l]%=md;
        }
    }
}
long long ans1;
long long ans2;

for(int i=1;i<=K;i++){
ans1=c[N-K+2][i+1]%md;
ans2=c[K][i]%md;
ans1=(ans1*ans2)%md;
cout << ans1 <<endl;
}



 return 0;
}

Measured memory_bytes: 31488
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

void solve()
{
    string s;cin>>s;
    if(s=="SUN")cout<<7 <<endl;
    if(s=="MON")cout<<6 <<endl;
    if(s=="TUE")cout<<5 <<endl;
    if(s=="WED")cout<<4 <<endl;
    if(s=="THU")cout<<3 <<endl;
    if(s=="FRI")cout<<2 <<endl;
    if(s=="SAT")cout<<1 <<endl;
}
int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    solve();
    return 0;
}


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

namespace CSharpSample01
{

	class Program
	{
		static void Main(string[] args)
		{
			var L = int.Parse(Console.ReadLine());
			double value = L / 3.0;

/*			long max = 0;
			for(int x = 1; x < L; x++)
			{
				for(int y = 1; y < L - x; y++)
				{
					var answer = x * y * (L - x - y);
					if(max < answer)
					{
						max = answer;
					}
				}
			}
*/
			Console.WriteLine(value * value * value);
		}

	}
}

Measured memory_bytes: 11092
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
a = [0] * N
b = [0] * N
c = [0] * N

for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())
    if i > 0:
        a[i] += max(b[i-1], c[i-1])
        b[i] += max(a[i-1], c[i-1])
        c[i] += max(a[i-1], b[i-1])

print(max(a[N-1], b[N-1], c[N-1]))


Measured memory_bytes: 14916
//Coloring Colorfully

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end()
#define pb push_back
const int inf = 2147483647;

int main (){
    string s;cin>>s;
    int c=0,cc=0;
    //01010
    rep(i,0,s.size()/2){
        if(s[i*2]=='1')c++;
        if(s[i*2+1]=='0')c++;
    }
    if(s.size()%2==1&&s[s.size()-1]=='1')c++;
    //10101
    rep(i,0,s.size()/2){
        if(s[i*2]=='0')cc++;
        if(s[i*2+1]=='1')cc++;
    }
    if(s.size()%2==1&&s[s.size()-1]=='0')cc++;
    cout << min(c,cc) << endl;
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<cmath>
using namespace std;
bool cal(int a, int b, int x){
	int ans(a-b);
	ans *= (pow(a,4)+pow(a,3)*b+pow(a,2)*pow(b,2)+a*pow(b,3)+pow(b,4));
	if(ans == x)return true;
	return false;
}
int main(void){
	int x;
	cin>>x;
	bool finish(false);
	for(int i(1);i<=x;i++){
		if(x%i != 0)continue;
		for(int j(-200);j<=200;j++){
			if(cal(j,j-i,x)){
				cout<<j<<" "<<j-i<<endl;
				finish = true;
			}
			if(finish)break;
		}
		if(finish)break;
	}
	return 0;
}

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

int main(){
    int a,b;
    cin >> a >> b;
    if(a>=13){
        cout << b << endl;
    }else if(a>=6){
        cout << b/2 << endl;
    }else{
        cout << 0 << endl;
    }
}

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

int main() {
    int N; cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    rep(i, N) {
        if(A[i] % 2 == 0 && A[i] % 3 && A[i] % 5) {
            cout << "DENIED" << '\n';
            return 0;
        }
    }
    cout << "APPROVED" << '\n';
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n) / gcd(n, m)*abs(m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;

void solve(){
  string s;
  int k;
  cin>>s>>k;
  int n=s.size();
  rep(i,n){
    if(s[i]=='a')continue;
    if(k>=26-(s[i]-'a'))k-=26-(s[i]-'a'),s[i]='a';
    //cout<<s[i]-'a'<<endl;
  }
  s.back()+=k%26;
  cout<<s;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}


Measured memory_bytes: 592
#include<iostream>
using namespace std;
int main(){
	int w,h,x,y,r;
	cin>>w>>h>>x>>y>>r;
	if((x<0||y<0)||(x>w||y>h)){
		cout<<"No"<<endl;
	}else if((w-x-r)<0||(h-y-r)<0){
		cout<<"No"<<endl;
	}else{
		cout<<"Yes"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
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; }
const long long INF = 1LL << 60;

int main()
{
    int A,B,C;
    cin >> A>>B>>C;
    
    int minab = min(A,B);
    int maxab = max(A,B);

    vector<int> nums;

    for(int i=1; i<=minab; i++){
        if(minab%i==0){
            nums.push_back(i);
        }
    }
    reverse(nums.begin(), nums.end());
    int cnt=0;
    for(auto x:nums){
        if(maxab%x==0){
            cnt++;
            if(cnt==C){
                cout << x << endl;
                break;
            }
        }
    }
    

    return 0;
}

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

int main() {
	int n, k;
	cin >> n >> k;
	double ans = 0;
	for (int i = 1; i <= n; i++) {
		int a = i;
		double b = 1;
		while (a < k) {
			a *= 2;
			b *= 0.5;
		}
		ans += b / n;
	}
	printf("%.10f\n", ans);
	return 0;
}

Measured memory_bytes: 3728
#include <iostream>

using namespace std;

int main(void)
{
    int N, A, B;
    cin >> N >> A >> B;
    int ans1 = A>B ? B : A;
    int ans2 = A+B-N>=0 ?A+B-N:0;
    cout << ans1 <<" " <<ans2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

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

void solve(long long N, long long T, long long A, std::vector<long long> H){
    int ans = 0;
    double mini = 100100100.0;
    REP(i, N) {
        double tmp = abs(A - (T - H[i] * 0.006));
        if (tmp < mini) {
            ans = i + 1;
            chmin(mini, tmp);
        }
    }
    cout << ans << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long N;
    scanf("%lld",&N);
    long long T;
    scanf("%lld",&T);
    long long A;
    scanf("%lld",&A);
    std::vector<long long> H(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&H[i]);
    }
    solve(N, T, A, std::move(H));
    return 0;
}


Measured memory_bytes: 384
package main
 
import (
  "fmt"
)
 
func main() {
  var a, b int
  fmt.Scanf("%d %d", &a, &b)
  
  ans := "Yay!"
  if a > 8 {
    ans = ":("
  }
  if b > 8 {
    ans = ":("
  }
  
  fmt.Printf("%s\n", ans)
}

Measured memory_bytes: 1836
#include <bits/stdc++.h>
using namespace std;
using Int = long long int;
template<typename T> void swap(T *t1, T *t2){ T* tmp=t1; t1=t2; t2=tmp;}


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

    Int r;
    cin >> r;
    cout << 3 * r * r << endl;

    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict

n = int(input())
vs = list(map(int, input().split()))

vsd1 = defaultdict(int)
for i in range(0, n, 2):
    vsd1[vs[i]] += 1

vsd2 = defaultdict(int)
for i in range(1, n, 2):
    vsd2[vs[i]] += 1

vsc1 = []
for k, v in vsd1.items():
    vsc1.append((k, v))

vsc2 = []
for k, v in vsd2.items():
    vsc2.append((k, v))

vsc1.append((-1, 0))
vsc2.append((-1, 0))
vsc1 = sorted(vsc1, key=lambda x: x[1], reverse=True)
vsc2 = sorted(vsc2, key=lambda x: x[1], reverse=True)

if vsc1[0][0] != vsc2[0][0]:
    print(n - (vsc1[0][1] + vsc2[0][1]))
else:
    print(n - max(vsc1[0][1] + vsc2[1][1], vsc1[1][1] + vsc2[0][1]))

Measured memory_bytes: 23008
#define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007; 
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

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



int morethan(int a, std::vector<int> &cnt){
    int c(0);
    for(int i(0), i_len(cnt.size()); i < i_len; ++i){
        if(cnt[i] >= a) ++c;
    }
    return c;
}

int main(){
    int N; std::cin >> N;
    std::vector<int> cnt;
    std::vector<int> prime{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31,
                           37, 41, 43, 47, 53, 59, 61, 67, 71, 73,
                           79, 83, 89, 97};
    for(int i(0), i_len(prime.size()); i < i_len; ++i){
        if(prime[i] > N) break;
        int c(0);
        for(int j(prime[i]); j <= N; j *= prime[i]){
            c += N / j;
        }
        cnt.push_back(c);
    }
    int ans(0);
    ans += morethan(75-1, cnt);
    ans += morethan(25-1, cnt) * (morethan(3-1, cnt) - 1);
    ans += morethan(15-1, cnt) * (morethan(5-1, cnt) - 1);
    ans += morethan(5-1, cnt) * (morethan(5-1, cnt) - 1) / 2 * (morethan(3-1, cnt) - 2);
    std::cout << ans << std::endl;
    return 0;
}


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

using namespace std;

int main()
{
	int k, x;
	cin >> k >> x;

	int left = max(-1000000, x - k + 1);
	int right = min(1000000, x + k - 1);

	for(auto i = left; i <= right; ++i) {
		cout << i << " ";
	}
}


Measured memory_bytes: 256
N, X = map(int,input().split())
L = []
L = list(map(int, input().split()))
D = 0
Dtmp = 0
cnt = 1
# D2から開始
for i in range(0, N):
  D = Dtmp + L[i]
  if D <= X:
    Dtmp = D
    cnt = cnt + 1
  else:
    break

print(cnt)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define MOD (1000000007)
#define INF (1e9)
#define INFL (1e18)

typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
template<class T>using arr=vector<vector<T>>;
template<class T>void pr(T x){cout << x << endl;}
template<class T>void prvec(vector<T>& a){rep(i, a.size()-1){cout << a[i] << " ";} pr(a[a.size()-1]);}
template<class T>void prarr(arr<T>& a){rep(i, a.size()) if(a[i].empty()) pr(""); else prvec(a[i]);}
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; }
int n, m;
vector<int> a;

void solve(){
    vector<int> c(n*(n-1)/2 + n + 1);
    int ci=0;
    rep(i, n) FOR(j, i+1, n){
        c[ci++] = a[i] + a[j];
    }
    rep(i, n) c[ci++] = a[i];
    c[ci] = 0;
    sort(ALL(c));
    // prvec(c);
    int ans = 0;
    rep(i, n) rep(j, n){
        if(a[i] + a[j] > m) continue;
        // printf("%d, %d, %d\n", a[i], a[j], m - a[i] - a[j]);
        int k = *(--upper_bound(ALL(c), m - a[i] - a[j]));
        // printf("k=%d\n", k);
        // pr(a[i] + a[j] + k);
        chmax(ans, a[i] + a[j] + k);
    }
    pr(ans);
}

int main()
{
    while(cin >> n >> m){
        if(n==0 && m==0) break;
        a.resize(n);
        rep(i, n) cin >> a[i];
        solve();
    }
    return 0;}


Measured memory_bytes: 5060
#include<bits/stdc++.h>
#define n 500000
#define mem(arr) memset(arr, 0, sizeof(arr))
using namespace std;
typedef long long lli;
typedef double llf;
typedef pair<int, int> P;
void solve();
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int times = 1;
//	cin >> times;
	for(int i=0; i<times; i++)
	{
		solve();
		cout << '\n';
	}
	return 0;
}

int a, b, c, d, e, f, g, h;
int arr[n + 50], arr1[n + 50], arr2[n + 50];

//type here

void solve()
{
	cin >> a >> b;
	if(a < b) swap(a, b);
	cout << max(a + a - 1, a + b);
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true) {
int H = sc.nextInt();
int W = sc.nextInt();
if (H == 0 && W == 0) {
break;
}
for(int i = 0; i < H; i++){
for(int j = 0; j < W; j++){
System.out.print("#");
}
System.out.println("");
}
System.out.println("");
}
}
}


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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	ll X; cin >> X;
	ll ans = 0;
	ans += 1000LL * (X / 500);
	X = X % 500;
	ans += 5LL * (X / 5);
	print(ans);
}

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

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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	string s; int k; cin>>s>>k;
	int n=s.size();
	set<string> st;
	for (int j=1; j<=k; j++)
		for (int i=0; i<=n-j; i++)
			st.insert(s.substr(i,j));
	string ret;
	k--;
	while(k-->0)
		st.erase(st.begin());
	cout<<*st.begin()<<"\n";
	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long lli;
typedef vector<lli> vll;
typedef pair<char,lli> pcl;
typedef vector<pcl> vec;

lli partition(vec& a,lli p,lli r){
	lli x = a[r].second;
	lli i = p;
	for(lli j = p;j < r;j++){
		if(a[j].second <= x){
			swap(a[j],a[i++]);
		}
	}
	swap(a[i],a[r]);
	return i;
}

void qsort(vec& a,lli p,lli r){
	if(p < r){
		lli q = partition(a,p,r);
		qsort(a,p,q-1);
		qsort(a,q+1,r);
	}
}


lli n;
vec a;
vec b;

void output(){
	for(lli i = 0;i < n;i++) cout << a[i].first << " " << a[i].second << endl;
}
int main(){
	cin >> n;
	a = vec(n);
	for(lli i = 0;i < n;i++) cin >> a[i].first >> a[i].second;
	b = a;
	qsort(a,0,n-1);
	stable_sort(b.begin(),b.end(),[](pcl a,pcl b){
		return a.second < b.second;
	});
	for(lli i = 0;i < n;i++){
		if(a[i].first != b[i].first){
			cout << "Not stable" << endl;
			output();
			return 0;
		}
	}
	cout << "Stable" << endl;
	output();
	return 0;

}

Measured memory_bytes: 7556
import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.functional;

enum Num = [2,5,5,4,5,6,3,7,6];

void main() {
    const tmp = readln.split.to!(long[]);
    const N = tmp[0], M = tmp[1];
    const as = readln.split.to!(long[]);

    long cost(long a) {
        return Num[a-1];
    }

    struct Number {
        long[] x;

        int opCmp(Number n) {
            if (x.length < n.x.length) return -1;
            if (x.length > n.x.length) return +1;

            foreach (i; 0..x.length) {
                if (x[i] < n.x[i]) return -1;
                if (x[i] > n.x[i]) return +1;
            }
            return 0;
        }
    }

    struct Result {
        Number n;
        bool valid;
    }

    Result func(long n) {
        if (n < 0) return Result(Number(), false);
        if (n == 0) return Result(Number(), true);
        auto candidates = as
            .map!(a => tuple(a, memoize!func(n-cost(a))))
            .filter!(t => t[1].valid)
            .map!(t => tuple(t[0], t[1].n))
            .map!(t => max(Number(t[0] ~ t[1].x), Number(t[1].x ~ t[0])));

        if (candidates.empty) return Result(Number(), false);

        return Result(candidates.reduce!max, true);
    }

    writeln(func(N).n.x.map!(to!string).join);
}


Measured memory_bytes: 500732