akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <cmath>
#include <limits>

using namespace std;

#define ll long long

int main(void){
    int n;
    cin >>n;
    vector<pair<double, double>> pos(n, pair<double, double>());
    vector<int> num(n);
    for(int i = 0;i < n;++i){
        cin >> pos[i].first >> pos[i].second; 
        num[i] = i;
    }


    double ans = 0.0;
    do{
        double dist = 0.0;

        for(int i = 1;i < n;++i){
            dist += sqrt(pow(pos[num[i]].first - pos[num[i-1]].first, 2.0) + pow(pos[num[i]].second - pos[num[i-1]].second, 2.0));
        }

        ans += dist;
    }while(next_permutation(num.begin(), num.end()));

    double a = 1.0;
    for(int i = 1;i <= n;++i){
        a *= (double)i;
    }
    printf("%.15lf\n", ans / a);

    return 0;
}

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

#define f s.insert(a+b), s.insert(b+a);

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

    while(m-- > 0){
        string str;
        cin >> str;
        set<string> s;
        for(int i = 1; i < str.length(); i++){
            string a = str.substr(0,i), b = str.substr(i);
            f
            reverse(a.begin(), a.end());
            f
            reverse(b.begin(), b.end());
            f
            reverse(a.begin(), a.end());
            f
        }

        cout << s.size() << endl;
    }
    return 0;
}


Measured memory_bytes: 3184
/**
 *   @FileName	c.cpp
 *   @Author	kanpurin
 *   @Created	2020.09.13 21:06:29
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

template< int MOD >
struct mint {
public:
    long long x;
    mint(long long x = 0) :x((x%MOD+MOD)%MOD) {}
    mint(std::string &s) {
        long long z = 0;
        for (int i = 0; i < s.size(); i++) {
            z *= 10;
            z += s[i] - '0';
            z %= MOD;
        }
        this->x = z;
    }
    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) {
        long long n = MOD - 2;
        mint u = 1, b = a;
        while (n > 0) {
            if (n & 1) {
                u *= b;
            }
            b *= b;
            n >>= 1;
        }
        return *this *= u;
    }
    mint operator+(const mint &a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-() const {return mint() -= *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;
    }
    friend std::ostream& operator<<(std::ostream &os, const mint &n) {
        return os << n.x;
    }
    friend std::istream &operator>>(std::istream &is, mint &n) {
        long long x;
        is >> x;
        n = mint(x);
        return is;
    }
    bool operator==(const mint &a) const {
        return this->x == a.x;
    }
    mint pow(long long k) const {
        mint ret = 1;
        mint p = this->x;
        while (k > 0) {
            if (k & 1) {
                ret *= p;
            }
            p *= p;
            k >>= 1;
        }
        return ret;
    }
};
const int MOD = 1e9 + 7;

template<typename T>
struct Combination {
private:
    int N;
public:
    vector< T > FACT, IFACT;
    
    Combination(int n) : N(n) {
        FACT.resize(n + 1);
        IFACT.resize(n + 1);
        FACT[0] = 1;
        IFACT[0] = 1;
        for (int i = 1; i <= n; i++) {
            FACT[i] = FACT[i - 1] * i;
            IFACT[i] = T(1) / FACT[i];
        }
    }
    T comb(int n, int r) {
        if (n < 0 || r < 0 || r > n) return 0;
        if (r > n / 2) r = n - r;
        return FACT[n] * IFACT[n - r] * IFACT[r];
    }
};
int main() {
    int n;cin >> n;
    if (n == 1) {
        cout << 0 << endl;
        return 0;
    }
    mint<MOD> ans = mint<MOD>(10).pow(n);
    ans -= mint<MOD>(9).pow(n) * 2 - mint<MOD>(8).pow(n);
    cout << ans << endl;
    return 0;
}

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

int main() {
    int N, ans = 0;
    string S;
    cin >> N;
    cin >> S;
    for(int i = 0;i < N-2;i++) {
        if(S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C') ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
S = input()
ans = True
N = len(S)
twice = (N - 1) // 2
triple = (N + 3) // 2
cnt=0
for i in range(N):
    if S[i] != S[-(i+1)]:
       ans = False
for j in range(twice):
    if S[j] != S[twice - j-1]:
        ans = False
for k in range(triple,N - triple + 1):
    if S[k] != S[N - cnt]:
        ans = False
    cnt += 1
if ans:
    print('Yes')
else:
    print('No')


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

// ---------------------------template starts here-------------------------- 

#define int long long int
#define pb push_back
#define MAX INT_MAX
#define F first
#define precise std::cout << std::fixed;std::cout << std::setprecision(6); 
#define S second  
#define mp make_pair
#define MIN INT_MIN
#define MOD 1000000007
#define FO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

set <int> s;
bool ar[100001];
void seive() {
    ar[0] = ar[1] = true;

    for(int p=2; p*p<=100001; p++) {
        if(ar[p] == false) {
            for(int i=p*p;i<=100001;i+=p)
                ar[i] = true ;
        }
    }

    for(int p=2;p<=100001;p++) {
        if(ar[p] == false)
            s.insert(p);
    }
}

bool is_palindrome(string str) {
    int len = str.length();
    for(int i=0;i<=len/2;i++) {
        if(str[i] != str[len-1-i])
            return false;
    }
    return true;
}

int binexpo(int x, int y, int p) {    
    int res = 1;     // Initialize result  
    x = x % p; // Update x if it is more than or  
                // equal to p  

    while (y > 0)  {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;
}
// --------------------------template ends here------------------------------

void solve() {
    int n;
    cin >> n;

    int a[n][3];

    for(int i=0;i<n;i++) {
        cin >> a[i][0] >> a[i][1] >> a[i][2];
    }

    int cost = 0, prev;

    int dp[200005][3];

    memset(dp, 0, sizeof(dp));

    dp[0][0] = a[0][0];
    dp[0][1] = a[0][1];
    dp[0][2] = a[0][2];

    for(int i=1;i<n;i++) {
        for(int j=0;j<3;j++) {
            dp[i][j] = max(dp[i-1][(j+1)%3], dp[i-1][(j+2)%3]) + a[i][j];
        }
    }

    for(int i=0;i<n;i++)
        cost = max(dp[i][0], max(dp[i][1], dp[i][2]));

    cout << cost << endl;
    return;
}
int32_t main() {
    FO;
    solve();
    return 0;
}

Measured memory_bytes: 7296
import java.util.*

fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val aa = readLine()!!.split(" ").map { it.toInt() }
    val bb = HashMap<Int, Int>()

    aa.forEach {
        bb[it] = (bb[it] ?: 0) + 1
        if (bb[it]!! > 1) {
            println("NO")
            return
        }
    }

    println("YES")
}

Measured memory_bytes: 82304
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int n,ans1=0,cnt=-1,ans2=-1; cin>>n;
    vector<int> a(n,0);
    rep(i,n){
        cin>>a[i];
        ans1=max(ans1,a[i]);
    }
    rep(i,n){
        int k=a[i];
        if(k==ans1) continue;
        if(k>ans1/2) k=ans1-k;
        if(cnt<k){
            cnt=k;
            ans2=a[i];
        }
    }
    cout<<ans1<<" "<<ans2<<endl;
}

Measured memory_bytes: 640
fun main(args: Array<String>) {
    var s = readString()

    while (true) {
        s = s.dropLast(2)
        if (s.drop(s.length / 2) == s.dropLast(s.length / 2)) {
            println(s.length)
            return
        }
    }
}

// Tools
fun readString() = readLine()!!

Measured memory_bytes: 35792
//https://atcoder.jp/contests/tenka1-2018-beginner/tasks/tenka1_2018_d
//
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
const ll LINF = 0x1fffffffffffffff;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}
int main() {
#if LOCAL&01
  std::ifstream in("./test/sample-1.in");
  //std::ifstream in("./input.txt");
  std::cin.rdbuf(in.rdbuf());
#else
  cin.tie(0);
  ios::sync_with_stdio(false);
#endif
  ll N; cin>>N;
  ll i=1;
  while(true){
    auto calc=[](ll n){
      ll result=(1+n)*n/2;
      return result;
    };
    auto cur=calc(i);
    if(cur==N){
      //output
      cout<<"Yes"<<endl;
      cout<<i+1<<endl;
      vector<vector<ll>> mat(i+1);
      ll v=1;
      FOR(y,0,i){
        FOR(x,y,i){
          mat.at(y).push_back(v++);
        }
      }
      v=1;
      FOR(x,0,i){
        FOR(y,x,i){
          mat.at(y+1).push_back(v++);
        }
      }
      dump(mat);
      for(const auto& l:mat){
        cout<<l.size();
        FOR(x,0,l.size()){
          cout<<" ";
          cout<<l.at(x);
        }
        cout<<endl;
      }
      return 0;
    }else if(cur>N){
      cout<<"No"<<endl;
      return 0;
    }
    ++i;
  }
  return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod

signed main(){
    int N,M; cin>>N>>M;
    int ans = 0;
    if(N==1&&M==1){
        ans = 1;
    }
    else if(N==1||M==1){
        ans = N*M-2;
    }
    else{
        ans = (N-2)*(M-2);
    }
    Out(ans);
}




Measured memory_bytes: 256
def primelist( pmax )

	primes = Array.new( pmax + 1 )
	primes[ 0 ] = 0 
	primes[ 1 ] = 0 
	2.upto( pmax ){ |i|
		primes[ i ] = 1
	}

	max = Math.sqrt( pmax ).to_i

	prime = 0
	while true
		(prime+1).upto( pmax ){ |t|
			if primes[ t ] != 0
				prime = t 
				break
			end
		}
		break if prime > max 

		n = 2
		while prime * n <= pmax
			primes[ prime * n ] = 0
			n += 1
		end
	end

	plist = Array.new
	0.upto( pmax ).each{ |n|
		plist << n if primes[ n ] == 1
	}
	plist	
end


def main
	answers = Array.new
	list = primelist( 60000 )
	while line = $stdin.gets
		n = line.chomp.to_i

		i = 0
		while list[ i ] < n
			i += 1
		end
# list[i] == n or list[i] > n
# list[i] == n ?????¨??????list[ i -1 ] , list[ i + 1]
# list[i] > n?????¨??? list[i-1],list[i]
		a1 = list[ i - 1 ]		
		if list[ i ] == n
			a2 = list[ i + 1 ]
		else
			a2 = list[ i ]
		end
		answers << [ a1, a2]
	end

	answers.each{ |a|
		print "#{a[0]} #{a[1]}\n"
	}
end

main


Measured memory_bytes: 6644
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    vector<pair<int64_t, int64_t>> ba(n);
    for (auto&& aa : ba) {
        cin >> aa.second;
    }
    for (auto&& aa : ba) {
        cin >> aa.first;
    }

    sort(ba.rbegin(), ba.rend());

    auto cmp = [&](int64_t lhs, int64_t rhs) {
        return make_pair(ba[lhs].second, ba[lhs].first) <
               make_pair(ba[rhs].second, ba[rhs].first);
    };

    priority_queue<int64_t, vector<int64_t>, decltype(cmp)> q(cmp);

    for (auto i : irange(0L, n)) {
        const auto& t = ba[i];
        // a > b
        if (t.second > t.first) {
            q.emplace(i);
        }
    }

    if (q.size() >= n - 1) {
        std::cout << "No" << endl;
        return 0;
    }

    multiset<int64_t> as;
    auto prev_it = ba.begin();
    int64_t nums = 0;
    while (!q.empty()) {
        auto idx = q.top();
        q.pop();
        auto end = partition_point(ba.begin(), ba.end(),
                                   [&](const pair<int64_t, int64_t>& p) {
                                       return ba[idx].second <= p.first;
                                   });

        if (end == ba.begin()) {
            std::cout << "No" << endl;
            return 0;
        }

        for (auto it = prev_it; it != end; ++it) {
            as.emplace(it->second);
        }
        prev_it = end;

        auto it = as.upper_bound(ba[idx].first);
        if (it != as.begin()) {
            --it;
            auto tmp = ba[idx].second;
            ba[idx].second = *it;
            as.erase(it);
            as.emplace(tmp);
        } else if (*it < ba[idx].second) {
            auto tmp = ba[idx].second;
            ba[idx].second = *it;
            as.erase(it);
            as.emplace(tmp);

            q.emplace(idx);
        } else {
            std::cout << "No" << endl;
            return 0;
        }

        ++nums;
        if (nums >= n - 1) {
            std::cout << "No" << endl;
            return 0;
        }
    }

    std::cout << "Yes" << endl;
}

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

int main(){
  long long n,mn=10000000000000,mx=-1;
  cin>>n;
  vector<long long>a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  for(int i=0;i<n;i++){
    mn=min(mn,a[i]);
    mx=max(mx,a[i]);
  }
  cout<<mx-mn<<endl;
}
  


Measured memory_bytes: 256
#include <iostream>
#include <tuple>
#include <vector>
using namespace std;
vector<tuple<int, int, int, int>> ans;
signed main() {
	int h, w; cin >> h >> w;
	int map[600][600];
	for (int i = 0; i < h; i++)
		for (int j = 0; j < w; j++)
			cin >> map[i][j];
	for (int i = 0; i < h; i++) {
		for (int j = w - 1; j > 0; j--) {
			if (map[i][j] % 2) {
				ans.push_back(make_tuple(i, j, i, j - 1));
				map[i][j]--;
				map[i][j - 1]++;
			}
		}
	}
	for (int i = h - 1; i > 0; i--) {
		if (map[i][0] % 2) {
			ans.push_back(make_tuple(i, 0, i - 1, 0));
			map[i][0]--;
			map[i - 1][0]++;
		}
	}
	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++)
		cout << get<0>(ans[i])+1 << ' ' << get<1>(ans[i])+1 << ' ' << get<2>(ans[i])+1 << ' ' << get<3>(ans[i])+1 << endl;
}

Measured memory_bytes: 5360
/// Kazuki Hoshino


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define f first
#define ss second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define endl '\n'

ll n, a[1<<19], temp , t = 1,mx[1<<19];
pll ans[1<<19], res[1<<19] ;

void add(int x, int y){
    vi v;
    v.pb(ans[x].first);
    v.pb(ans[x].second);
    v.pb(ans[y].first);
    v.pb(ans[y].second);
    sort(all(v));
    reverse(all(v));
    ans[x].first = v[0];
    ans[x].second = v[1];
}

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

//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);


cin >> n;

rep(i, 0, (t<<n)-1 ){

    cin >> a[i];
    ans[i].f = a[i];
    //ans[i].ss = a[0];

    if(ans[i].ss > ans[i].f){
        swap(ans[i].ss , ans[i].f);
    }

}


rep(i, 0, n){

    rep(j, 0, (t<<n)-1){

    if(j & (t<<i))continue;
    else temp = j|(t<<i);
    add( temp, j );
    /*
    if(ans[temp].ss<=a[j]){
        ans[temp].ss = a[j];
        if(ans[temp].f < ans[temp].ss){
            swap(ans[temp].f, ans[temp].ss);
        }
    }
    */
    }

}
/*
rep(i, 0, n){

    rep(j, 1, (t<<n)-1 ){

    if(j<(t<<i) ){
        mx[j] = max( mx[j-1], ans[j].f + ans[j].ss) ;
    }

    }

}
*/
ll pree = ans[0].first+ans[0].second;
rep(i, 1, (1<<n)-1){
pree = max(pree, ans[i].first+ans[i].second );
//cout << ans[i].f << " " << ans[i].ss << endl;
//cout << max( ans[i].f + ans[i].ss ,  mx[i]) << endl ;
cout << pree << endl;
}





return 0;}
///....


Measured memory_bytes: 17408
// AUTHOR: ROSHAN SRIVASTAVA
// WEBSITE: https://www.youtube.com/channel/UC6uQdd7kLLOdlHSVklhV7Cw

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

int h, w; 
int m;

int mr[300009], mc[300009];
set<pair<int, int> > grid;

int main(){

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    memset(mr, 0, sizeof mr);
    memset(mc, 0, sizeof mc);
    
    cin >> h >> w >> m ;

    for(int i = 0; i < m; i++){
        int h1, w1;
        cin >> h1 >> w1;
        mr[h1] += 1;
        mc[w1] += 1;
        grid.insert({h1, w1});
    }


    int mmr = 0;
    for(int i = 1; i <= h; i++) {
        mmr = max(mmr, mr[i]);
    }


    int mmc = 0;
    for(int i = 1; i <= w; i++) {
        mmc = max(mmc, mc[i]);
    }


    vector<int> mcv, mrv;
    
    for(int i = 1; i <= h; i++) {
        if(mr[i] == mmr) mrv.push_back(i);
    }

    for(int i = 1; i <= w; i++) {
        if(mc[i] == mmc) mcv.push_back(i);
    }

    int ans = mmc + mmr - 1;

    for(auto i: mrv) {
        for(auto j: mcv) {
            if(grid.find({i, j}) == grid.end()) {
                ans ++;
                cout << ans << endl;
                return 0;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 23880
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; 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 int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------

const string MINUSINF = "-";
void chmax(string &a, string b)
{
    if (a == MINUSINF)
    {
        a = b;
        return;
    }
    if (b.length() > a.length())
    {
        a = b;
        return;
    }
    if (b > a)
    {
        a = b;
    }
}

int N, M;
string dp[10101];
int match[10] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};

int main()
{
    cin >> N >> M;
    vector<int> A(M);
    rep(i, 0, M)
    {
        cin >> A[i];
    }
    rep(i, 1, N)
    {
        dp[i] = MINUSINF;
    }
    dp[0] = "";
    rep(i, 0, N)
    {
        if (dp[i] == MINUSINF)
            continue;
        for (auto e : A)
        {
            char ec = e + '0';
            chmax(dp[i + match[e]], dp[i] + ec);
        }
    }
    cout << dp[N] << endl;
}


Measured memory_bytes: 43776
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;

internal class Program {
    static void Main() => CustomMain();

    static void Solve() {
        int a, b, c;
        ReadMulti(out a, out b, out c);
        var ans = (a * 100 + b * 10 + c) % 4 == 0 ? "YES" : "NO";
        WriteAnswer(ans);
    }


    static void CustomMain() {
#if DEBUG
        // ファイルからテストケースを読み込む
        ChangeStdIn();
        // 時間計測
        var stopwatch = new Stopwatch();
        stopwatch.Start();
#endif
        // 出力高速化
        var streamWriter = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(streamWriter);
        // 回答
        Solve();
#if DEBUG
        stopwatch.Stop();
        Console.WriteLine(stopwatch.Elapsed);
#endif
        Console.Out.Flush();
    }

    static string ReadString() => Console.ReadLine().Trim();
    static int ReadInt() => int.Parse(ReadString());
    static long ReadLong() => long.Parse(ReadString());
    static float ReadFloat() => float.Parse(ReadString());
    static double ReadDouble => double.Parse(ReadString());

    static string[] ReadStringArray() => ReadString().Split(' ');
    static int[] ReadIntArray() => Array.ConvertAll(ReadString().Split(' '), int.Parse);
    static long[] ReadLongArray() => Array.ConvertAll(ReadString().Split(' '), long.Parse);
    static float[] ReadFloatArray() => Array.ConvertAll(ReadString().Split(' '), float.Parse);
    static double[] ReadDoubleArray() => Array.ConvertAll(ReadString().Split(' '), double.Parse);

    static T TypeConversion<T>(string s) {
        if (typeof(T) == typeof(int)) {
            return (T) Convert.ChangeType(int.Parse(s), typeof(T));
        } else if (typeof(T) == typeof(long)) {
            return (T) Convert.ChangeType(long.Parse(s), typeof(T));
        } else if (typeof(T) == typeof(double)) {
            return (T) Convert.ChangeType(double.Parse(s), typeof(T));
        } else {
            return (T) Convert.ChangeType(s, typeof(T));
        }
    }

    static void ReadMulti<T, U>(out T a, out U b) {
        var str = ReadStringArray();
        a = TypeConversion<T>(str[0]);
        b = TypeConversion<U>(str[1]);
    }

    static void ReadMulti<T, U, V>(out T a, out U b, out V c) {
        var str = ReadStringArray();
        a = TypeConversion<T>(str[0]);
        b = TypeConversion<U>(str[1]);
        c = TypeConversion<V>(str[2]);
    }

    static void WriteAnswer(object ans) => Console.WriteLine(ans);

    static bool IsOdd(long num) {
        return (num & 1) == 1;
    }

    static bool IsEven(long num) {
        return (num & 1) == 0;
    }

    static long GCD(long a, long b) {
        return b != 0 ? GCD(b, a % b) : a;
    }

    static long RoundUp(long a, long b) {
        return (a + b - 1) / b;
    }


    static void ChangeStdIn() {
        var path = "./../../TestCase.txt";
        var exStdIn = new System.IO.StreamReader(path);
        Console.SetIn(exStdIn);
    }
}

Measured memory_bytes: 11092
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
  void Solve()
  {
    var N = ToInts();
    if (N[1]==1)
    {
      Console.WriteLine(0);
      return;
    }
    var ret = 1;
    var max = N[0];
    for(; ;)
    {
      if (max>=N[1])
        break;

      max += (N[0] - 1);

      ret += 1;
    }
    
    Console.WriteLine(ret); ;
  }
  static int[] ToInts()
  {
    var ss = Console.ReadLine().Split();
    var ret = new /**/int[ss.Length];
    for (int i=0;i<ss.Length ;i++)
    {
      ret[i] = /**/int.Parse(ss[i]);
    }
    return ret;
  }

  static void Main(string[] args)
  {
    new Program().Solve();
  }
}


Measured memory_bytes: 13140
using System;
using System.Linq;

namespace aizu
{
    class OnlineJudge
    {
        static void Main()
        {
            var price = Enumerable.Range(1, 5).Select(p => new { i = p , v = int.Parse(Console.ReadLine())}).GroupBy(p => p.i <= 3).ToArray();
            Console.WriteLine(price[0].Min(p => p.v) + price[1].Min(p => p.v) - 50);
        }
    }
}

Measured memory_bytes: 6548
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <limits>
#include <memory>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#define all(a) (a).begin(), (a).end()
#define sz(a) static_cast<int>((a).size())
#define fillchar(a, x) memset(a, x, sizeof(a))
#define rep(i, a, b) for(int i=int(a); i<=int(b); ++i)
#define irep(i, a, b) for(int i=int(a); i>=int(b); --i)
#define replr(i, a, b) rep(i, a, (b)-1)
#define reprl(i, a, b) irep(i, (b)-1, a)
#define repn(i, n) rep(i, 0, (n)-1)
#define irepn(i, n) irep(i, (n)-1, 0)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef long long LL;
typedef pair<LL,LL> PLL;
typedef pair<int,int> PII;
typedef pair<double,double> PDD;
typedef vector<LL> VL;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef vector<string> VS;
template<class T, class S> ostream& operator<<(ostream& os, const pair<T, S>& v) { return os<<"("<<v.first<<", "<<v.second<<")"; }
template<class T> ostream& operator<<(ostream& os, const vector<T>& v) { os<<"["; repn(i, sz(v)) { if(i) os<<", "; os<<v[i]; } return os<<"]"; }
template<class T> bool setmax(T &_a, T _b) { if(_b>_a) { _a=_b; return true; } return false; }
template<class T> bool setmin(T &_a, T _b) { if(_b<_a) { _a=_b; return true; } return false; }
template<class T> T gcd(T _a, T _b) { return _b==0?_a:gcd(_b,_a%_b); }

int main() {
    int n; cin>>n;
    LL x, y; cin>>x>>y;
    repn(i, n-1) {
        LL u, v; cin>>u>>v;
        LL times=max((x-1)/u+1, (y-1)/v+1);
        x=u*times, y=v*times;
    }
    cout<<(x+y)<<endl;
    return 0;
}


Measured memory_bytes: 256
using System;
class Program
{
	static void Main(string[] args)
	{
		// スペース区切りの整数の入力
		string[] input = Console.ReadLine().Split(' ');
		int b = int.Parse(input[0]);
		int c = int.Parse(input[1]);
		
        if(b*c % 2 == 0){
          //出力
          Console.WriteLine("Even");
        }else{
          //出力
          Console.WriteLine("Odd");
        }
		
	}
}

Measured memory_bytes: 11092
//MISHON69
//DATE:6/22/2020
#include<bits/stdc++.h>
using namespace std;
#define FOR(i, n) for (int i = 0; i < (int)(n); i++)
int fact(int n){
   int f=1;
   FOR(i,n){
      f=f*(i+1);
   }
   return f;
}
int main(){
   int n;
   cin>>n;
   vector<pair<int,int> >point;
   FOR(i,n){
      int x,y;
      cin>>x>>y;
      point.push_back(make_pair(x,y));
   }
   vector<int>index;
   FOR(i,n)
   index.push_back(i);
   double sum=0;
   do{
     for(int i=0;i<n-1;++i){
        sum+=sqrt((point[index[i]].first-point[index[i+1]].first)*(point[index[i]].first-point[index[i+1]].first)+(point[index[i]].second-point[index[i+1]].second)*(point[index[i]].second-point[index[i+1]].second));
     }
   }while(next_permutation(index.begin(),index.end()));
   sum/=fact(n);
   cout<<fixed<<setprecision(10)<<sum<<endl;
}

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

def Dijkstra(N, edges, s):
    from heapq import heappush, heappop, heapify
    dist = [10**18 for _ in range(N)]
    dist[s], h = 0, [[0, s]]
    while (len(h)):
        p = heappop(h)
        d, v = p[0], p[1]
        if d > dist[v]:
            continue
        for i in range(len(edges[v])):
            u = edges[v][i]
            if d + 1 < dist[u]:
                dist[u] = d + 1
                heappush(h, [dist[u], u])
    return dist

N, M = map(int, input().split())
es = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(lambda x: int(x) - 1, input().split())
    es[a].append(b)
    es[b].append(a)
dist = Dijkstra(N, es, 0)
if dist[N - 1] == 2:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

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

char sky[110][110];
int  ans[110][110];

int main(){
	
	int H,W ;
	cin >> H >> W ;
	for( int i=0 ; i<H ; i++ ){
		for( int j=0 ; j<W ; j++ ){
			cin >> sky[i][j] ;
			ans[i][j] = -1 ;
		}
	}
	
	for( int i=0 ; i<H ; i++ ){
		int cnt = 0;
		for( int j=0 ; j<W ; j++ ){
			if( sky[i][j] == 'c' ) cnt = 1 ;
			if( cnt ) ans[i][j] = cnt++ -1 ;
		}
	}
	
	for( int i=0 ; i<H ; i++ ){
		for( int j=0 ; j<W ; j++ ){
			cout << (j?" ":"") << ans[i][j] ;
		}cout << endl ;
	}
}

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

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


int  H,W,M;
cin>>H>>W>>M;

vector<pair<int,int>>items(M);
vector<int>Hcount(H),Wcount(W);

int Hmax=-1,Wmax=-1;

for(int i=0;i<M;i++)
{
   cin>>items[i].first>>items[i].second;
}

for(int i=0;i<M;i++)
{   
     items[i].first--;
     items[i].second--;
    Hcount[items[i].first]++;
    Wcount[items[i].second]++;

    Hmax= max(Hmax,Hcount[items[i].first]);
    Wmax= max(Wmax,Wcount[items[i].second]);

}


int  ans = Hmax + Wmax;
int Hmaxcount=0,Wmaxcount=0;
for(int i=0;i<H;i++)
{
      if(Hcount[i] == Hmax)
       Hmaxcount++;
         
}
for(int i=0;i<W;i++)
{
      if(Wcount[i] == Wmax)
        Wmaxcount++;
    
}
long long total_common_space = (long long)Hmaxcount*Wmaxcount;
long long total_common_item = 0;

for(int i=0;i<M;i++)
{
    if((Hcount[items[i].first]==Hmax) && (Wcount[items[i].second]== Wmax))
    {
        total_common_item++;
    }
}
/*
If all the cross sections of Hmax and Wmax are filled with elements 
then that means the answer cannot be Hmax + Wmax, as one common element
will always be counted one extra time.
Thus we have to find a cross section with no element present.
that is why total_common_item < total_common_space for ans = Hmax + Wmax
else ans = Hmax + Wmax -1
*/

if(total_common_item >= total_common_space)
     { ans--;}

cout<<ans<<endl;
return 0;

}

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

using namespace std;

const int mod = 1e9 + 7;

int add() { return 0; }
template<typename... M> int add(int a, M... b) {
  int x = add(b...);
  return a + x - mod * (a + x >= mod);
}

int mul() { return 1; }
template<typename... M> int mul(int a, M... b) {
  return int(1ll * a * mul(b...) % mod);
}

int pwr(int a, long long x) {
  return (x ? mul(pwr(mul(a, a), x >> 1), (x & 1 ? a : 1)) : 1);
}

int dvd(int a, int b) {
  return mul(a, pwr(b, mod - 2));
}

int sub(int a, int b) {
  return a - b + mod * (a < b);
}

void inc(int& a, int b) {
  a = add(a, b);
}

void dec(int& a, int b) {
  a = sub(a, b);
}

long long get(int a, int b) {
  return 1ll * (a + b) * (b - a + 1) / 2;
}

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

  int n, k;
  cin >> n >> k;
  int ans = 0;
  for (int i = k; i <= n + 1; ++i) {
    inc(ans, (get(n - i + 1, n) - get(0, i - 1) + 1) % mod);
  }
  cout << ans;

  return 0;
}

Measured memory_bytes: 3672
from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

R = ni()
import math
print(math.pi*2*R)



Measured memory_bytes: 65204
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int i,t;
		t = 0;
		for(i = a; i <= b; ++i){
			if(c % i == 0)
				++t;
		}
		System.out.println(t);
	}

}

Measured memory_bytes: 26048
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    vl a(n);
    rep(i, n) {
        cin >> a[i];
    }

    if(a[0] > 0) {
        out(-1);
        re0;
    }

    rep(i, n-1) {
        if(a[i+1] - a[i] > 1) {
            out(-1);
            re0;
        }
    }

    ll ans = 0;
    exrep(i, 1, n-1) {
        if(a[i] == a[i-1] + 1) {
            ans++;
        }
        else {
            ans += a[i];
        }
    }

    out(ans);
    re0;
}

Measured memory_bytes: 1792
#! /usr/bin/python
# -*- coding: utf-8 -*-

def reduction(num, denom):
    p = num
    q = denom
    while p%q != 0:
        r = p%q
        p = q
        q = r
    return [num/q, denom/q]

d = raw_input()
while d != "#":
    l = 0
    direc = []
    while l < len(d):
        if d[l] == 'n':
            direc.append('n')
            l += 5
        elif d[l] == 'w':
            direc.append('w')
            l += 4
    direc = direc[::-1]

    a = []
    for i in range(len(direc)):
        if direc[i] == 'n':
            if i == 0:
                a = [0, 1]
            else:
                a[0] = a[0]*2-90
                a[1] *= 2
        elif direc[i] == 'w':
            if i == 0:
                a = [90, 1]
            else:
                a[0] = a[0]*2+90
                a[1] *= 2
    a = reduction(a[0], a[1])
    if a[1] == 1:
        print a[0]
    else:
        print str(a[0])+'/'+str(a[1])

    d = raw_input()

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

 string Replace(string s,int a,int b,string t){
 for(int i=a;i<=b;i++){
 s[i]=t[i-a];
}
 return s;
 }
 string Reverse(string s,int a,int b){
 int i=a,j=b;
while(i<j){
 swap(s[i],s[j]);
 i++;
 j--;
 }
 return s;
}
 void Print(string s,int a,int b){
 for(int i=a;i<=b;i++){
 cout<<s[i];
}
 cout<<endl;
}
int main(){
 string str,command,t;
 cin>>str;
 int q,a,b;
 cin>>q;
 for(int i=0;i<q;i++){
 cin>>command;
 cin>>a>>b;
 if(command=="replace"){
 cin>>t;
 str=Replace(str,a,b,t);
 }else if(command=="reverse"){
 str=Reverse(str,a,b);
 }else if(command=="print"){
 Print(str,a,b);
}
}
}


Measured memory_bytes: 3176
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
#include <functional>
#include <random>
#include <thread>
#include <chrono>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vvvl> vvvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<ll, ll> PL;
typedef vector<PL> vpl;
typedef vector<vector<PL>> vvpl;
typedef vector<vvpl> vvvpl;
const int INF = 1001001001;
const ll LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back
#define ALL(X) (X).begin(),(X).end()

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

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    sort(ALL(vec));
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

inline ll popcnt(ll x){return __builtin_popcountll((unsigned long long)x);};
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
//friend bool operator<(const stc& lhs, const stc& rhs){
//    return std::tie(lhs.l, lhs.r) < std::tie(rhs.l, rhs.r);
//}



int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N, M; cin >> N >> M;
    vl A(M), B(M), C(M);
    rep(i, M){
        cin >> A[i] >> B[i];
        ll st = 0;
        rep(j, B[i]){
            ll c; cin >> c; c--; st |= (1ll<<c);
        }
        C[i] = st;
    }
    
    
    vvl dp(M+1, vl(1ll<<N, LINF));
    dp[0][0] = 0;
    rep(i, M){
        rep(st, 1ll<<N){
            chmin(dp[i+1][st|C[i]], dp[i][st] + A[i]);
            chmin(dp[i+1][st], dp[i][st]);
        }
    }
    ll ans = dp[M][(1ll<<N)-1];
    cout << (ans == LINF ? -1 : ans)  << endstr;
    return 0;
}


Measured memory_bytes: 32384
H,W = map(int,input().split())
src = [list(map(int,input().split())) for i in range(H)]

order = []
for i in range(H):
    if i%2==0:
        for j in range(W):
            order.append((i,j))
    else:
        for j in reversed(range(W)):
            order.append((i,j))

ans = []
for (y1,x1),(y2,x2) in zip(order, order[1:]):
    if src[y1][x1]%2:
        ans.append((y1+1,x1+1,y2+1,x2+1))
        src[y2][x2] += 1

print(len(ans))
for row in ans:
    print(*row)

Measured memory_bytes: 48344
a = int(input())
b = []
c = []
ans = ""

for i in range(a):
    b.append(input())
    c.append(len(b[i]))

alpha = [chr(i) for i in range(97,97+26)]

for ii in range(26):
    d = []
    for i in range(a):
        d.append(b[i].count(alpha[ii]))
    ans = ans + (alpha[ii] * min(d))
           
print(ans)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int w = Integer.parseInt(scanner.next());
        int h = Integer.parseInt(scanner.next());
        int x = Integer.parseInt(scanner.next());
        int y = Integer.parseInt(scanner.next());
        int r = Integer.parseInt(scanner.next());

        String answer = (x - r >= 0) && (x + r <= w) && (y - r >= 0) && (y + r <= h) ? "Yes" : "No";

        System.out.println(answer);
    }
}

Measured memory_bytes: 26300
s = input()
 
y1 = [0 if x % 2 ==0 else 1 for x in range(len(s))]
y2 = [0 if x % 2 !=0 else 1 for x in range(len(s))]
 
ans1 = sum([1 for i,j in zip(s,y1) if int(i)==j])
ans2 = sum([1 for i,j in zip(s,y2) if int(i)==j])
print(min([ans1,ans2]))

Measured memory_bytes: 48240
#include<bits/stdc++.h>
#define LL long long
#define pll pair<LL,LL>
#define mp make_pair
#define fr first
#define sc second
using namespace std;
int n,sl,fh,num,ans;
pll a[55];
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
int main()
{
	n=rd();LL x,y;
	for(int i=1;i<=n;++i) a[i].fr=rd(),a[i].sc=rd();
	for(int i=1;i<=n;++i)
		for(int j=i+1;j<=n;++j)
		{
			num=0;x=a[j].fr-a[i].fr;y=a[j].sc-a[i].sc;
			for(int p=1;p<=n;++p)
				for(int q=1;q<=n;++q)
					if(a[q].fr-a[p].fr==x&&a[q].sc-a[p].sc==y)
						num++;
			ans=max(ans,num);
		}
	printf("%d\n",n-ans);
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long ll;
const int N = 60;

int n, l, r;
ll S, a[N], c[N][N];

int main() {
	c[0][0] = 1;
	for(int i = 1; i <= 50; ++i) {
		c[0][i] = c[i][i] = 1;
		for(int j = 1; j < i; ++j) {
			c[j][i] = c[j][i - 1] + c[j - 1][i - 1];
		}
	}
	scanf("%d%d%d", &n, &l, &r);
	for(int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);
	for(int i = 1; i <= l; ++i) S += a[i];
	printf("%.15Lf\n", (long double)S / l);
	int cnt = 0, tot = 0;
	for(int i = l; i; --i) 
		if(a[i] == a[l]) ++cnt;
	for(int i = 1; i <= n; ++i) 
		if(a[i] == a[l]) ++tot;
	if(a[1] == a[l]) {
		ll ans = 0;
		for(int i = l; i <= r; ++i) ans += c[i][tot];
		printf("%lld\n", ans);
	} else printf("%lld\n", c[cnt][tot]);
	return 0;
} 

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

#define REP(i, s, e) for(int i = (int)s; i < (int) e; i++)
#define rep(i, n) REP(i, 0 ,n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define fi first
#define se second


typedef long long ll;

int main(){
  int n;
  char s[1024][256];
  while(~scanf("%d", &n) && n){
        rep(i, n) scanf("%s", s[i]);
        set<char> st[256];
        bool ans = true;
        rep(i, n){
          REP(j, i+1, n){
                bool f = true;
                int li = strlen(s[i]), lj = strlen(s[j]);
                int l = min(li, lj);
                rep(k, l){
                  if(s[i][k] != s[j][k]){
                        f =false;
                        if(st[s[j][k]].count(s[i][k])){
                          ans = false;
                          break;
                        }
                        st[s[i][k]].insert(s[j][k]);
                        break;
                  }
                }
                if(f && li > lj) ans = false;
          }
        }
        printf("%s\n", (ans?"yes" : "no"));
  }
}

Measured memory_bytes: 3300
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;


int main() {
    long long int a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    if (v <= w) {
        cout << "NO" << endl;
        return 0;
    }
    if (abs(b - a) <= (v - w) * t) cout << "YES";
    else
        cout << "NO";
    cout << endl;
}


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

int N, W, w[105], v[105], dp[105][105][305];

int main() {
	scanf("%d%d", &N, &W);
	for (int i = 0; i < N; i++) scanf("%d%d", &w[i], &v[i]);
	for (int i = 1; i <= N; i++) {
		for (int j = 0; j <= i; j++) {
			for (int k = 0; k <= j * 3; k++) {
				dp[i][j][k] = dp[i - 1][j][k];
				if (j > 0 && k - (w[i - 1] - w[0]) >= 0) dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k - (w[i - 1] - w[0])] + v[i - 1]);
			}
		}
	}
	int ans = 0;
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= 3 * N; j++) {
			long long weight = (long long)w[0] * i + j;
			if (weight > W) continue;
			ans = max(ans, dp[N][i][j]);
		}
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 11008
#include<bits/stdc++.h>
using namespace std;
int ranker_MAX[1000005];
int tenpaman[1000005];
int kc,len;
bool compare_sa(int i,int j){
  return
    ranker_MAX[i]!=ranker_MAX[j]?
    ranker_MAX[i]<ranker_MAX[j]:
    (i+kc<=len?ranker_MAX[i+kc]:-1)<(j+kc<=len?ranker_MAX[j+kc]:-1);
}

void construct_sa(char* S,int *sachiko){
  len=strlen(S);
  for(int i=0;i<=len;i++){
    sachiko[i]=i;
    ranker_MAX[i]=i<len?S[i]:-1;
  }
  for(kc=1;kc<=len;kc*=2){
    sort(sachiko,sachiko+len+1,compare_sa);
    tenpaman[sachiko[0]]=0;
    for(int i=1;i<=len;i++){
      tenpaman[sachiko[i]]=tenpaman[sachiko[i-1]]+compare_sa(sachiko[i-1],sachiko[i]);
    }
    for(int i=0;i<=len;i++)ranker_MAX[i]=tenpaman[i];
  }
}
int n,m;
char strttenannkaiiiyone[1000005];
char t[1000005];
int sachiko[1000005];

int main(){
  scanf("%s",strttenannkaiiiyone);
  n=strlen(strttenannkaiiiyone);
  construct_sa(strttenannkaiiiyone,sachiko);
  scanf("%d",&m);
  while(m--){
    scanf("%s",t);
    int k=strlen(t);
    int l=0,r=n+1,m;
    while(l+1<r){
      m=(l+r)/2;
      if(strncmp(strttenannkaiiiyone+sachiko[m],t,k)<=0)l=m;
      else r=m;
    }
    printf("%d\n",(strncmp(strttenannkaiiiyone+sachiko[l],t,k)==0));
  }
  return 0;
}



Measured memory_bytes: 15968
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef __int128 big;

int main()
{
    ll a,b,c;
    cin>> a >> b >> c;
    big x=abs(a),k=b,d=c,t=2;
    if(x-k*d>=0) cout<< (ll)(x-k*d) <<endl;
    else{
        ll y=x/d;
        ll p=-(x-(y+1)*d);
        if((k-y-1)%t==1) p+=d;
        ll q=x-y*d;
        if((k-y)%t==1) q+=d;
        cout<< (ll)min(p,q) <<endl;
    }
    return 0;
}

Measured memory_bytes: 3604