akhauriyash/Code-Regression huggingface dataset:
//============================================================================
// Name        : wLbtT
// Author      : Afify
// Description : AtCoder Beginner Contest 074
//============================================================================
#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,n) for(int i = x;i<n;i++)
#define ll long long
#define ld long double
#define all(v) v.begin(),v.end()
//============================================================================


int main() {
	int n, k;
	cin >> n >> k;
	ll res = 0;
	loop(i, 0, n) {
		int x;
		cin >> x;
		res += min(2 * x, 2 * abs(k - x));
	}
	cout << res << endl;

	return 0;
}


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

int main()
{
  int n;
  cin>>n;
  vector<int> a(n);
  for(auto &e:a) cin>>e;
  int cnt=0;
  int tmp=a[0];
  int ans=0;
  if(n==2)
  {
    if(a[0]==a[1]) cnt++;
  }
  else 
  {
    for(int i=0;i<n;++i)
    {
      if(i==0) cnt--;
      if(tmp==a[i]) cnt++;
      else
      {
        ans+=(cnt+1)/2;
        tmp=a[i];
        cnt=0;
      }
    }
  }
  ans+=(cnt+1)/2;  
  cout<<ans<<endl;

  return 0;
}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  while(1){
    int n,w;
    cin >> n >> w;
    if(n==0) return 0;
    vector<int> v(n);
    int ma=0;
    for(int i=0;i<n;i++){
      cin >> v[i];
      ma=max(ma,v[i]);
    }
    int hb=ma/w+1;
    vector<int> d(hb,0);
    for(int i=0;i<n;i++){
      d[v[i]/w]++;
    }
    ma=0;
    for(int i=0;i<hb;i++){
      ma=max(ma,d[i]);
    }
    LD ans=0.01;
    for(int i=0;i<hb;i++){
      ans+=(LD)(hb-i-1)/(hb-1)*d[i]/ma;
    }
    cout << fixed << setprecision(10) << ans << endl;
  }
  return 0;
}



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


using namespace std;


// Powered by caide (code generator, tester, and library code inliner)


class Solution {
public:
  void solve(std::istream& in, std::ostream& out)
  {
    int n;
    in >> n;
    deque<int> d;
    for(int i = 0; i < n; i++) {
      int num;
      in >> num;
      if(i % 2) {
        d.push_back(num);
      } else {
        d.push_front(num);
      }
    }
    if (n % 2) {
      auto i = d.cbegin();
      for(; i + 1 != d.cend(); i++) {
        out << *i << " ";
      }
      out << *i << "\n";
    } else {
      auto i = d.crbegin();
      for (; i + 1 != d.crend(); i++) {
        out << *i << " ";
      }
      out << *i << "\n";
    }
  }
};

void solve(std::istream& in, std::ostream& out)
{
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}


#include <fstream>
#include <iostream>


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


  istream& in = cin;


  ostream& out = cout;

  solve(in, out);
  return 0;
}




Measured memory_bytes: 3072
#ifndef ___CLASS_MODINT
#define ___CLASS_MODINT

#include <cstdint>

template<std::uint32_t mod>
class modint {
private:
	std::uint32_t n;
public:
	modint() : n(0) {};
	modint(std::uint64_t n_) : n(n_ % mod) {};
	bool operator==(const modint& m) const { return n == m.n; }
	bool operator!=(const modint& m) const { return n != m.n; }
	std::uint32_t get() const { return n; }
	modint& operator+=(const modint& m) { n += m.n; n = (n < mod ? n : n - mod); return *this; }
	modint& operator-=(const modint& m) { n += mod - m.n; n = (n < mod ? n : n - mod); return *this; }
	modint& operator*=(const modint& m) { n = std::uint64_t(n) * m.n % mod; return *this; }
	modint operator+(const modint& m) const { return modint(*this) += m; }
	modint operator-(const modint& m) const { return modint(*this) -= m; }
	modint operator*(const modint& m) const { return modint(*this) *= m; }
	modint binpow(std::uint64_t b) const {
		modint ans = 1, m = modint(*this);
		while (b) {
			if (b & 1) ans *= m;
			m *= m;
			b >>= 1;
		}
		return ans;
	}
	modint inv() { return (*this).binpow(mod - 2); }
};

#endif // ___CLASS_MODINT

#include <string>
#include <vector>
#include <iostream>
using namespace std;
using modulo = modint<1000000007>;
int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	vector<string> S(H);
	for (int i = 0; i < H; ++i) {
		cin >> S[i];
	}
	vector<vector<modulo> > dp(H, vector<modulo>(W));
	dp[0][0] = 1;
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (S[i][j] == '.') {
				if (i >= 1) dp[i][j] += dp[i - 1][j];
				if (j >= 1) dp[i][j] += dp[i][j - 1];
			}
		}
	}
	cout << dp[H - 1][W - 1].get() << '\n';
	return 0;
}

Measured memory_bytes: 5248
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define speedX ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
template<typename T>
void __p(T a) { cout << a << " "; }
template<typename T, typename F>
void __p(pair<T, F> a) { cout << "{ "; __p(a.first); __p(a.second); cout << "}"; }
template<typename T>
void __f(const char* s, T t) { cout << s << " : "; __p(t); }
template<typename T>
void __t(const char* s, const T &x) { cout << s << " : { "; for (auto it : x) __p(it); cout << "} ";}
template<typename T, typename ... F>
void __f(const char* s, T t, F ... f) {
	int i = 0; for (;; ++i) if (s[i] == ',') break;
	cout.write(s, i) << " : "; __p(t); cout << " | "; __f(s + i + 1, f...);
}
#define trace(...) { cout<<"LINE: "<<__LINE__<<" || "; __f(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
#define debug(...) { cout<<"LINE: "<<__LINE__<<" || "; __t(#__VA_ARGS__,__VA_ARGS__); cout<<"\n\n"; }
int begtime = clock();
#define end_time() cout << "\n\nTime of execution: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define trace(...)
#define debug(...) 
#define end_time()
#endif
 
 
#define int long long 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef vector<int> vi;
typedef vector<pii> vii;

inline bool equals(ld a, ld b) {return fabs(a - b) < 1e-9;}
inline int gcd(int a, int b) { a=abs(a); b=abs(b); while(a>0 && b>0) (a>b?a%=b:b%=a); return (a==0?b:a); } 
inline int power(int x, int n, int m = LLONG_MAX)
    {  int res=1; x = (x%m + m)%m;
       while(n) { if(n&1) res=(res*x)%m;  x=(x*x)%m;  n >>= 1; }  return res;
    }
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define uset unordered_set
#define umap unordered_map
#define all(x) x.begin(), x.end()
#define mod 1000000007

void solve(){
	int n;
	cin>>n;
	int h[n];
	for(int i = 0; i<n; i++){
		cin>>h[i];
	}
	int dp[n] = {0};
	dp[0] = 0;
	for(int i = 1; i<n; i++){
		if(i==1) dp[i] = dp[i-1]+abs(h[i]-h[i-1]);
		else dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
	}
	cout<<dp[n-1]<<"\n";
}
signed main(){
	speedX;
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
	int t=1;
	//cin>>t;
	for(int i=1;i<=t;++i) {
		//cout<<"Case #"<<i<<": ";
		solve();
	}
	end_time();
	return 0;
}


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

int main(){
    using namespace std;
    unsigned long N, D, A;
    cin >> N >> D >> A;
    vector<pair<unsigned long, unsigned long>> enemies(N);
    for(auto& i : enemies){
        cin >> i.first >> i.second;
        i.second = (i.second + A - 1) / A;
    }
    sort(enemies.begin(), enemies.end());
    unsigned long ans{0}, now{0};
    queue<pair<unsigned long, unsigned long>> pq;
    for(const auto& i : enemies){
        while(!pq.empty() && pq.front().first < i.first && (now += pq.front().second))pq.pop();
        auto k = i.second - min(i.second, ans - now);
        if(k)pq.emplace(i.first + D * 2, k);
        ans += k;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4992
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		try (Scanner sc = new Scanner(System.in)) {
			final int N = sc.nextInt();
			final long H = sc.nextLong();
			
			PriorityQueue<Long> a_queue = new PriorityQueue<Long>(N, Collections.reverseOrder());
			PriorityQueue<Long> b_queue = new PriorityQueue<Long>(N, Collections.reverseOrder());
			
			for(int i = 0; i < N; i++){
				final long a = sc.nextLong();
				final long b = sc.nextLong();
				
				a_queue.add(a);
				b_queue.add(b);
			}
			
			int b_count = 0;
			long b_sum = 0;
			long min = Long.MAX_VALUE;
			while(!a_queue.isEmpty()){
				final long a = a_queue.poll();
				
				while(b_sum < H && !b_queue.isEmpty()){
					if(b_queue.peek() < a){ break; }
					b_count++;
					b_sum += b_queue.poll();
				}
				//System.out.println(a + " " + b_sum);
				
				final long a_count = (Math.max(0, H - b_sum) + (a - 1)) / a;
				min = Math.min(min, b_count + a_count); 
			}
			
			System.out.println(min);
		}
	}
 
	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;
 
		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}
 
		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}
 
		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}
 
		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextInt();
			}
			return ret;
		}
 
		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = this.nextLong();
			}
			return ret;
		}
 
		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 50508
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        String line = br.readLine();

        while(!(line.equals("0 0"))){
            String[] input = line.split(" ");
            int h = Integer.valueOf(input[0]);
            int w = Integer.valueOf(input[1]);
            StringBuilder sb = new StringBuilder();

            for(int i = 0; i < h; i++){
                boolean which = i%2 == 0;
                for(int j = 0; j < w; j++){
                    if(which) sb.append("#");
                    else sb.append(".");
                    which = !which;
                }
                sb.append("\n");
            }

            System.out.println(sb);
            
            line = br.readLine();
        }

    }
}



Measured memory_bytes: 25856
#include <bits/stdc++.h>
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; 0 <= i; i--)
#define for_(i, start, end) for (int i = start; i < end; i++)
#define rfor(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD53       = 998'244'353;
constexpr double PI       = 3.14159265358979323846;
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;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}
void debug() { std::cerr << '\n'; }
template <class H, class... T> void debug(H &&head, T &&... args) {
    std::cerr << head;
    sizeof...(args) == 0 ? std::cerr << "" : std::cerr << ' ';
    debug(std::forward<T>(args)...);
}
template <class T> void debug(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cerr << v[i];
        i == v.size() - 1 ? std::cerr << '\n' : std::cerr << ' ';
    }
}
template <class T> void debug(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cerr << v[i][j];
            j == v[i].size() - 1 ? std::cerr << '\n' : std::cerr << ' ';
        }
    }
}

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

    string s;
    scan(s);

    int ans = 0;
    int N   = s.size();
    rep(i, N / 2) {
        if (s[i] != s[N - 1 - i]) {
            ans++;
        }
        debug(s[i], s[N - i]);
    }
    print(ans);

    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;

int main()
{
    int a, b;
    cin >> a >> b;
    if (a == 1)
    {
        if (b == 2)
            cout << 3 << endl;
        else
            cout << 2 << endl;
    }
    else if (a == 2)
    {
        if (b == 1)
            cout << 3 << endl;
        else
            cout << 1 << endl;
    }
    else
    {
        if (b == 1)
            cout << 2 << endl;
        else
            cout << 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 3604
// Problem : B - Count Balls
// Contest : AtCoder - AtCoder Beginner Contest 158
// URL : https://atcoder.jp/contests/abc158/tasks/abc158_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

//Macros

#define ll long long
#define db long double
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define inf 1e10
#define PI acos(-1.0)
#define int long long
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 100005

//Solution

void solve(){
    int n,a,b;
    cin>>n>>a>>b;
    int x = n/(a+b);
    int y = n%(a+b);
    int ans = x*a + (y < a ? y : a);
    cout<<ans<<endl;
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    int tests;
    //cin>>tests;
    tests = 1;
    while(tests--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;


int main()
{
string s; cin >> s;
for (int i=0; i<s.length(); i++)
    cout << 'x';


}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#define MAX 1000
int main()
{
   int n;
   int i, j=0, sum;
   int score[MAX];
   double ave, tmp;
   double dev[MAX];
   while(1)
{
       scanf("%d", &n);
       if(n==0)break;
       sum=0;
       for(i=0;
i<n;
i++)
{
           scanf("%d", &score[i]);
           sum+=score[i];
       }
       ave=(double)sum/(double)n;
       tmp=0.0;
       for(i=0;
i<n;
i++)
{
           tmp+=pow(score[i]-ave, 2);
       }
       dev[j++]=sqrt(tmp/(double)n);
   }
  for(i=0;
i<j;
i++)
{
       printf("%f\n", dev[i]);
   }
   return 0;
}


Measured memory_bytes: 2048
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }

constexpr int MAX_N = 100;
int N;
int a[MAX_N];

void _main() {
  cin >> N;
  rep(i, 0, N) cin >> a[i];
  sort(a, a + N);

  cout << (a[N-1] - a[0]) << "\n";
}

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

using namespace std;

int main() {
  int a[3];
  for (int i = 0; i < 3; i++) {
    cin >> a[i];
  }
  sort(a, a + 3);
  if (a[0] + a[1] == a[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
from collections import deque
from bisect import bisect_left

N = int(input())
A = [int(input()) for _ in range(N)]

t = deque([A[0]])
for a in A[1:]:
    i = bisect_left(t, a) - 1
    if i == -1:
        t.appendleft(a)
    else:
        t[i] = a
print(len(t))


Measured memory_bytes: 8828
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include<numeric>
#include<cmath>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
using vvii = vector<vector<int> >;
using vvll =  vector<vector<ll> >;
const ll mod = 1e9 + 7;

const ll inf = 1LL << 60;

struct mint{
    ll x;
    mint(ll x = 0): x((x % mod + mod)%mod){}

    
    mint& operator+=(const mint a){
        if((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a){
        if((x += mod-a.x) >= mod)  x -= mod;
        return *this;
    }
    mint& operator*=(const mint a){
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator+(const mint a) const{ //クラスのメンバを変更しない
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const{ //クラスのメンバを変更しない
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const{ //クラスのメンバを変更しない
        mint res(*this);
        return res*=a;
    }

    mint pow(ll n)const{
        if(n == 0)return 1;
        mint a = pow(n>>1);
        a *= a;
        if(n & 1)a *= (*this);
        return a;
    }

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

ostream& operator<<(ostream &os, const mint &m){
    os << m.x;
    return os;
}

struct Combination{
    vector<mint> fact,ifact;
    Combination(int n): fact(n+1),ifact(n+1){
        fact[0] = 1;
        for(int i = 1; i<=n; i++)fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for(int i = n; i>= 1; i--){
            ifact[i-1] = ifact[i] * i;
        }
    }

    mint comb(int n, int k){
        if(k < 0 || n < k)return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

int main(){
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
    ll n,k; cin >> n >> k;
    Combination C(n);
    mint ans = 0;
    if(k >= n)k = n-1;
    REP(i,k+1){
        ans += C.comb(n-1, n-1-i) * C.comb(n,i);
    }
    cout << ans << endl;
}


Measured memory_bytes: 6324
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <string> 
#include <stdio.h>
using namespace std;

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

  for(int i=0;i<=4;i++){
    cout << str[i];
  }
  
  printf(" ");
  
  for(int i=6;i<=12;i++){
    cout << str[i];
  }
  
  printf(" ");

  for(int i=14;i<=18;i++){
    cout << str[i];
    }

  cout << endl;


  return 0;
}


Measured memory_bytes: 256
n = int(input())
ans = 0
comment = [[] for _ in range(n)]
for i in range(n):
    A = int(input())
    for _ in range(A):
        x, y = map(int, input().split())
        comment[i].append((x, y))

for i in range(2 ** n):
    t = (n - len(bin(i)[2:])) * '0' + bin(i)[2:]
    point = 1
    for index, value in enumerate(t):
        if value == '1':
            for com in comment[index]:
                if t[com[0] - 1] == str(com[1]):
                    continue
                else:
                    point = 0
                    break
    if point == 1:
        ans = max(ans, t.count('1'))
print(ans)

Measured memory_bytes: 3316
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    stack<char> c[3];
    rep(i, 3) {
        string S; cin >> S;
        RREP(j, S.length() - 1, 0) c[i].push(S[j]);
    }
    char state = 'a';
    while(!c[state - 'a'].empty()) {
        
        char prev = state;
        state = c[state - 'a'].top(); 
        c[prev - 'a'].pop();
        //cout << (char)(state + 'A' - 'a') << endl;
        
    }
    cout << (char)(state + 'A' - 'a') << endl;

    return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func sumOfDegit(n int) int {
	var sum int
	for n > 0 {
		sum += n % 10
		n /= 10
	}
	return sum
}

func main() {
	var N, a, b int
	fmt.Scan(&N, &a, &b)
	ans := 0
	for i := 0; i <= N; i++ {
		if v := sumOfDegit(i); a <= v && v <= b {
			ans += i
		}

	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
const int N=200005;
char s[N];
long long ans,a[N],p[N];
int main()
{
	scanf("%s",s+1);
	int n=strlen(s+1),t=0;
	a[t]++;
	p[n+1]=1;
	for(int i=n;i>=1;i--)
	{
		int x=s[i]-'0';
		p[i]=p[i+1]*10%2019;
		t=(t+x*p[i])%2019;
		a[t]++;
	}
	for(int i=0;i<2019;i++)
		ans+=a[i]*(a[i]-1)/2;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 5412
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll ar[500009],br[500009],cr[500009];
int main()
{
    ll a,b,c,i,j,k=0,f,g,x,z,y;
    string s;
    cin>>a;
    for(i=1; i<=a; i++)
    {
        ar[i]=i;
    }
    for(i=1; i<=a; i++)
    {
        cin>>br[i];
    }
    for(i=1; i<=a; i++)
    {
        cin>>cr[i];
    }
    z=0;
    g=0;
    do
    {
        z++;
        k=0;
        for(i=1; i<=a; i++)
        {
            if(ar[i]==br[i])
            {

            }
            else
            {
                k=1;
            }
        }
        if(k==0)
        {
            x=z;
        }
        f=0;
        for(i=1; i<=a; i++)
        {
            if(ar[i]==cr[i])
            {

            }
            else
            {
                f=1;
            }
        }
        if(f==0)
        {
            y=z;
        }
    }
    while (next_permutation(ar+1,ar+a+1));
    cout<<abs(x-y)<<endl;
}


Measured memory_bytes: 4352
double x[100],y[100],d,t,u,a,b,s;
n,i,j,k,m,c;
main(){
	for(;scanf("%d",&n),i=j=n;printf("%d\n",m)){
		m=1;
		for(;i--;scanf("%lf,%lf",x+i,y+i));
		for(i=n;--i;)
			for(j=i-1;j--;)
				if((d=hypot(x[j]-x[i],y[j]-y[i])/2)<=1)
					for(s=1,t=atan2(y[j]-y[i],x[j]-x[i]),u=acos(d);c=0,s+3;s-=2)
						for(a=x[i]+cos(t+s*u),b=y[i]+sin(t+s*u),k=n;k--;)
							hypot(a-x[k],b-y[k])<1+1e-7&&++c>m?m=c:0;
	}
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A[3];
    rep(i, 3) cin >> A[i];
    sort(A, A + 3);
    int cnt = 0;
    while(abs(A[2] - A[0]) > 0) {
        if (A[2] - A[0] > 1) A[0] += 2;
        else {A[0]++; A[1]++;}
        cnt++;
        sort(A, A + 3);
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}

Measured memory_bytes: 27168
#include<bits/stdc++.h>
using namespace std;
long long a[10005]={2};
long long GDX(int n)
{
	for(int i=1;i<=n;i++)
	{
		a[i]=(a[i-1]+1)*2;
	}
	return a[n];
}
int main()
{
	long long n;
	cin>>n;
	cout<<GDX(n)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	ll a,b;
	cin>>a>>b;

	ll l = 0;
	ll r = INFL;
	while(r-l>1){
		ll mid = (l+r)/2;
		bool ok = true;
		if(mid*2>b) ok=false;
		else{
			ll t = b-mid*2;
			ll tt = t/2 + a;
			if(tt<mid) ok=false;
		}
		if(ok){
			l = mid;
		}
		else{
			r = mid;
		}
	}
	cout<<l<<endl;
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

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

using namespace std;

#define pb push_back
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(x) x.begin(),x.end()
#define debug(x) cout << x << endl;
#define FOR(x) for(int i =0; i < (x) ; i++)

int main(){
    IOS
    //edit
    int k, x;
    cin >> k >> x;
    for(int i = x - k + 1; i < k + x; i++){
        cout << i << " ";
    }
    return 0;
}


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

namespace AtCoder_20190707_1
{    class Program
    {
        static void Main(string[] args)
        {
            long[] X = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);

            for(int i = 0; i < X.Length; i++)
            {
                if(X[i] == 0)
                {
                    Console.WriteLine(i + 1);
                    return;
                }
            }
        }
    }
}

Measured memory_bytes: 27516
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;

int main(){
	int n, m;
	scanf("%d %d", &n, &m);
	std::vector<P> ab(n);
	for(int i=0; i<n; i++) scanf("%ld %ld", &ab[i].first, &ab[i].second);
	std::sort(ab.begin(), ab.end());
	
	ll ans = 0;
	for(P p: ab){
		if(m<=0) break;
		if(m>=p.second){
			ans += p.first * p.second;
			m -= p.second;
		}else{
			ans += p.first * m;
			m = 0;
		}
	}
	printf("%ld\n", ans);
	return 0;
}


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

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> G(N);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  
  vector<bool> dist(N, false);
  vector<int> ans(N);
  queue<int> Q;
  dist[0] = true;
  Q.push(0);

  while (!Q.empty()) {
    int v = Q.front();
    Q.pop();
    for (int nv : G[v]) {
      if (dist[nv]) continue;
      dist[nv] = true;
      ans[nv] = v;
      Q.push(nv);
      
    }
  }
  
  for (int i = 0 ; i < N; i++) {
    if (!dist[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  for (int i = 1; i < N; i++) {
    cout << ans[i]+1 << endl;
  }
}


Measured memory_bytes: 10192
K = int(input())
import math
from functools import reduce

def gcd3(a, b, c):
    return math.gcd(math.gcd(a,b), c)
ans = 0

for i in range(1, K+1):
    for j in range(i+1, K+1):
        for k in range(j+1, K+1):
            ans += gcd3(i, j, k)

ans *= 6

for i in range(1, K+1):
    ans += gcd3(i, i, i)

for i in range(1, K+1):
    for j in range(i+1, K+1):
        ans += gcd3(i, i, j)
        ans += gcd3(i, i, j)
for i in range(1, K+1):
    for j in range(i+1, K+1):
        ans += gcd3(i, j, j)
        ans += gcd3(i, j, j)
for i in range(1, K+1):
    for j in range(i+1, K+1):
        ans += gcd3(i, j, i)
        ans += gcd3(i, j, i)
print(ans)

Measured memory_bytes: 9580
<?php
$n=trim(fgets(STDIN));
$i=1;
$ans=0;
while($i<=$n){
  $j=1;
  while($j<=$n){
  $gcd=gcd($i,$j);
    $k=1;
  while($k<=$n){
    $ans+=gcd($gcd,$k);
    ++$k;
  }
    ++$j;
  }
  ++$i;
}
echo $ans;
function gcd($x,$y){
  return($x%$y)?gcd($y,$x%$y):$y;
}

Measured memory_bytes: 16180
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int minimum=INT_MAX, maximum=-INT_MAX;
	for(int i=0; i< 5 ; i++){
		int temp;
		cin>>temp;
		if(temp>maximum)
			maximum=temp;
		if(temp<minimum)
			minimum=temp;
	}
	long long int k;
	cin>>k;
	if(maximum-minimum>k)
		cout<<":("<<endl;
	else
		cout<<"Yay!"<<endl;
	return 0;
}


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

int main() {
  int N,a,num=1,count=0;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>a;
    if(a==num){
      count++;
      num++;
    }
  }
  if(count>0)cout<<N-count<<endl;
  else cout<<"-1"<<endl;
}


Measured memory_bytes: 3580
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if (b - a <= k) and (c - a <= k) and (d - a <= k) and (e - a <= k) and (c - b <= k) and (d - b <= k) and (e - b <= k) and (d - c <= k) and (e - c <= k) and (e - d <= k):
    print('Yay!')
else:
    print(':(')


Measured memory_bytes: 3064
#pragma GCC optimize(2)
#include <iostream>
#include <cstring>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <queue>
#define all(v) (v).begin(),(v).end()
#define rep(x,y) for(ull i = (x);i<=(y);(x)++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const int maxn = 1e6+10;
int dir[8][2] = {-1,0,1,0,0,1,0,-1,-1,-1,-1,1,1,-1,1,1};
int dir2[4][2] = {0,1,1,0,0,-1,-1,0};
const ll eps = -3000;

string s;



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

    cin>>s;
    for(int i = 0;i<s.length();i++){
        if(i&1 && s[i] == 'R'){
            cout<<"No";
            return 0;
        }
        if((i&1)==0 && s[i] == 'L'){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}

Measured memory_bytes: 256
def main():
    n = int(input())
    a = list(map(int, input().split()))
    a_s = sorted(a)
    res = 1
    for i in a_s:
        res *= i
        if res == 0:
            print(0)
            break
        if res > 10 ** 18:
            print(-1)
            break
    if res > 0 and res <= 10 ** 18:
        print(res)
if __name__ == '__main__':
    main()

Measured memory_bytes: 21788
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = (1LL << 31) - 1;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1
#define MAX_N 100100 * 3

int n;
int x[1000];
int dp[300][300];
int ans[300];

int C(int lb, int ub) {
	if (dp[lb][ub] != -1)return dp[lb][ub];
	if (ub - lb <= 0)return dp[ub][lb] = 0;
	else if (ub - lb == 1) {
		if (abs(x[lb] - x[ub]) <= 1)return dp[lb][ub] = 2;
		return dp[lb][ub] = 0;
	}
	int res = 0;
	if (abs(x[lb] - x[ub]) <= 1) {
		if (C(lb + 1, ub - 1) == ub - lb - 1) {
			res = C(lb + 1, ub - 1) + 2;
		}
	}
	FOR(mid, lb, ub) {
		res = max(res, C(lb, mid) + C(mid + 1, ub));
	}
	return dp[lb][ub] = res;
}

int main() {
	while (cin >> n&&n) {
		rep(i, 300)rep(j, 300) {
			dp[i][j] = -1;
		}
		rep(i, n)cin >> x[i];
		cout << C(0, n - 1) << endl;
	}
}

Measured memory_bytes: 3376
n, m = map(int, input().split())
a = [input() for _ in range(n)]
b = [input() for _ in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        for k in range(m):
            Flag = True
            if a[i+k][j:j+m] != b[k]:
                Flag = False
                break
        if Flag == True:
            print('Yes')
            exit()

print('No')

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iomanip>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;

#define ld long double
#define ll long long

map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  double T,X;
  cin >> T >>X;
  double ans=0;
  cout << fixed << setprecision(10) << T/X << endl;
  return 0;
}

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, ans, count;
  cin >> N;
  ans = count = 0;
  for (int i = 1; i <= N; ++i) {
    int a = i * 1.08;
    if (a == N) {
      ans = i;
      ++count;
      break;
    }
  }
  if (count == 0) {
    printf(":(\n");
  }
  else if (count == 1) {
    printf("%d\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();
        String s1 = sc.next();
        String s2 = sc.next();
        sc.close();

        int mod = (int)Math.pow(10, 9)+7;
        long ans = 1;
        int flag = 0;

        int pos = 0;
        while(pos < N){
            if(s1.charAt(pos) == s2.charAt(pos)){
                if(flag == 0){
                    ans = (ans*3)%mod;
                    pos++;
                    flag = 1;
                } else
                if(flag == 1){
                    ans = (ans*2)%mod;
                    pos++;
                } else
                if(flag == -1){
                    pos++;
                    flag = 1;
                }
            } else {
                if(flag == 0){
                    ans = (ans*6)%mod;
                    flag = -1;
                    pos += 2;
                } else
                if(flag == 1){
                    ans = (ans*2)%mod;
                    flag = -1;
                    pos += 2;
                } else
                if(flag == -1){
                    ans = (ans*3)%mod;
                    pos += 2;
                }
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 23636
L =[0 for i in range(100000)]
for i in range(100000):
  N = i
  a = N//10000
  b = (N//1000)%10
  d = (N//10)%10
  e = N%10
  
  if a == e and d == b:
    L[i] = 1

A, B = map(int, input().split())
print(sum(L[A:B+1]))

Measured memory_bytes: 4632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
const ll MOD = 1000000007;
struct edge{
    int to,weight;
    edge(int to,int weight):to(to),weight(weight){}
};
using Graph = vector<vector<int>>;
using GraphEdge = vector<vector<int>>;
long long modinv(long long a, long long m=MOD) {long long b = m, u = 1, v = 0;while (b) {    long long t = a / b;    a -= t * b; swap(a, b);    u -= t * v; swap(u, v);}u %= m; if (u < 0) u += m;return u;}
//MODの割り算の際にa/＝b;をa *= modinv(b,MOD);とする。
int gcd(int a, int b){if (a%b == 0){return(b);}else{return(gcd(b, a%b));}}
int lcm(int a, int b){return a * b / gcd(a, b);}

int main(){
    int a,b,c;cin >> a >> b >> c;
    int sum = a + b + c;
    int ma = max(a,max(b,c));
    cout << sum - ma + ma * 10 << endl;
    return 0;
}

Measured memory_bytes: 3624
#line 2 "abc169/../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U> inline void cmax(T &a, U b) { if (a < b) a = b; }
template<class T, class U> inline void cmin(T &a, U b) { if (a > b) a = b; }
constexpr char el = '\n';
template<class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<class T, class U> istream &operator>>(istream &is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) os << v[i] << (i+1 != v.size() ? " " : ""); return os; }
template<class T> istream &operator>>(istream &is, vector<T> &v) { for(T &i : v) is >> i; return is; }
struct IoSetup {
  IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); }
} io_setup;
#line 3 "abc169/../../library/prime_factorization.hpp"

map<ll, ll> prime_factorization(ll n) {
  map<ll, ll> m;
  for (ll i = 2; i*i <= n; i++) {
    while (n%i == 0) {
      m[i]++;
      n /= i;
    }
  }
  if (n != 1) m[n]++;
  return m;
}
#line 3 "abc169/d.cpp"

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

  ll ans = 0;

  auto m = prime_factorization(n);
  for (auto&& i : m) {
    for (ll cnt = 1; i.second-cnt >= 0; cnt++) {
      i.second -= cnt;
      ans++;
    }
  }

  cout << ans << el; 
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279
 
#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define REP1(i, n) for(ll i = 1; i <= n; i++)
#define REPR1(i, n) for(ll i = n; i >= 1; i--)
#define FOR1(i, m, n) for(ll i = m; i <= n; i++)
const ll INF = LLONG_MAX;
const ull MOD = 1000000007;
#define VEC(type,A,N) vector<type> A(N)
#define VECi(type,A,N,i) vector<type> A(N,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N,vector<type>(M))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N,vector<type>(M,i))
#define ALL(v) v.begin(), v.end()
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
ll digitPoor(ll n)
{
    assert(INT_MAX == 2147483647);
    assert(n >= 0);

    if (n < 10)         return 1;
    if (n < 100)        return 2;
    if (n < 1000)       return 3;
    if (n < 10000)      return 4;
    if (n < 100000)     return 5;
    if (n < 1000000)    return 6;
    if (n < 10000000)   return 7;
    if (n < 100000000)  return 8;
    if (n < 1000000000) return 9;
    return 10;
}
struct p{
  ll x;
  bool b;
};
int main(){
    ll A,B,C;
    string S;
    cin>>A>>B>>C;
    
    cout<<A*B/2.0;
    
    return 0;
    //cout<<fixed<<setprecision(32)<<m;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 3696
#include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
#define rep(i,n) for(int i = 0 ; i < (int)(n) ; i++)
typedef long long ll;
typedef long double Double;

#define fillZero(a) memset((a), 0,  sizeof(a))
#define fillINF(a) memset((a), 0x3f, sizeof(a)) // 3f3f3f3f = 1,061,109,567 < 2^30
#define all(a) (a).begin(), (a).end()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)

class Edge {
public:
	virtual int from() const = 0;
	virtual int to() const = 0;
	virtual Edge* reversedEdge() = 0;
};

typedef int EdgeWeight;
class SimpleEdge : public Edge {
	int from_, to_;
	EdgeWeight weight_;
public:
	SimpleEdge(int from,int to,EdgeWeight weight_) : from_(from), to_(to), weight_(weight_) {}
	static SimpleEdge* createFromInput(){
		int a,b,w;
		cin >> a >> b >> w;
		return new SimpleEdge(a,b,w);
	}
	int to() const { return to_; }
	int from() const { return from_; } 
	int weight() const { return weight_; }
	SimpleEdge* reversedEdge(){
		return new SimpleEdge(to_, from_, weight_);
	}
};

class Graph {
public:
	virtual vector<Edge*> *connectedEdges(int v) = 0;
	virtual void addEdge(Edge *edge) = 0;
};

class UndirectedGraph : public Graph {
private:
	vector<Edge*> edges;
	vector< vector<Edge*> > graph;
public:
	UndirectedGraph(int n){
		graph.resize(n);
	}
	
	size_t size(){
		return graph.size();
	}

	void addEdge(Edge *edge){
		edges.push_back(edge);
		assert(edge->from() < size());
		assert(edge->to() < size());

		graph[edge->from()].push_back(edge);
		graph[edge->to()].push_back(edge->reversedEdge());
	}
	vector<Edge*> *connectedEdges(int v){
		return &graph[v];
	}
	vector<Edge*> *allEdges(){
		return &edges;
	}
};


const int N_MAX = 100010;
bool canMakeZero(int bit){
	int tst = 0;
	rep(i,16) if( bit >> i & 1 ) tst ^= i;
	return tst == 0;
}
int main(){
	int n;
	cin >> n;
	UndirectedGraph g(n);
	for(int i = 0 ; i < n - 1 ; i++){
		g.addEdge(SimpleEdge::createFromInput());
	}
	
	int vXors[N_MAX] = {};
	for( auto e : *g.allEdges() ){
		vXors[e->from()] ^= ((SimpleEdge*)e)->weight();
		vXors[e->to()] ^= ((SimpleEdge*)e)->weight();
	}
	int freq[16] = {};
	rep(i,g.size()){
		freq[vXors[i]]++;
	}
	int baseAnswer = 0;
	int freqBit = 0;
	for(int i = 1 ; i < 16 ; i++){
		baseAnswer += freq[i] / 2;
		freqBit |= (freq[i]%2) << i;
	}

	int dp[1<<16];
	fillINF(dp);
	dp[0] = 0;
	for(int i = 0 ; i <= freqBit ; i+=2){
		int j = i;
		while(j){
			dp[i] = min(dp[i], dp[i^j] + popcount(j) - (canMakeZero(j) ? 1 : 0));
			j = (j-1) & i;
		}
	}
	cout << dp[freqBit] + baseAnswer << endl;
}

Measured memory_bytes: 15476