akhauriyash/Code-Regression huggingface dataset:
# include <stdio.h>
# include <string.h>

int main(){

	char str1[55], str2[55];
	int td = 0;
	scanf("%s %s", str1, str2);

	td = strlen(str1) + strlen(str2);

	int j1 = 0;
	int j2 = 0;

	for (int i = 0; i < td; ++i){
		if (i%2==0){
			printf("%c",str1[j1]);
			j1 +=1;
		}
		else{
			printf("%c", str2[j2]);
			j2 += 1;
		}
	}
	printf("\n");


	return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <math.h>
 
using namespace std;
 
typedef long long LL;
typedef long double LD;
typedef string ST;
 
 
#define REP(i,n) for(LL (i)=0;(i)<(n);(i)++)
#define ALL(v) v.begin(), v.end()
#define PRINTLN(v) {LL i=0; for(auto (a): v ){   cerr <<i << " : "<<  a << endl; i++;}}
#define PRINTSP(v) for(auto (a): v ) {cerr << a << " ";} cerr << endl
 
 
LL modpow(LL a, LL n, LL mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
void func() {
  LL N ;
  cin >>N;
  string S;
  cin >>S;

  if(S.length()%2!=0){
    cout << "No";
    return ;
  }
  for(LL i=0;i<S.length()/2;++i){
    if(S[i]!=S[i+S.length()/2]){
      cout << "No";
      return ;
    }
  }
  cout << "Yes";
    
  
}
 

int main()
{
  func();
  return 0;
}
 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int n, k;
    unordered_map<int, int> M;
    cin >> n >> k;
    for(int i = 1; i <= n; i++) M[i]=0;
    for(int i = 0; i < k; i++)
    {
        int d;
        cin >> d;
        for(int j = 0; j < d; j++)
        {
            int a;
            cin >> a;
            M[a]++;
        }
    }
    int cnt=0;
    for(int i = 1; i <= n; i++)
    {
        if(M[i]==0)cnt++;
    }
    cout << cnt;
}


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

#define rep(i,n) for(int i=0,temp=(int)(n);i<temp;++i)
#define vint vector<int>
int ctoi(char c) {return c-'0';}

vint v,u;

int solve(){
  int ans=0;
  rep(i,v.size())
    if(v[i]^u[i]) ans++;
  return ans;
}

int main(){
  string s;cin >> s;
  v.resize(s.length());
  u.resize(s.length());
  
  rep(i,s.size())
    v[i]=ctoi(s[i]);
  for(int i=0;i<s.size();i+=2){
      u[i]=v[0];
      u[i+1]=!v[0];
  }

  cout << solve() << endl;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N,M; cin>>N>>M;
    string s,t; cin>>s>>t;

    int g=__gcd(N,M);
    REP(i,g){
        int x=N/g*i;
        int y=M/g*i;
        if(s[x]!=t[y]){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout<<N/g*M<<endl;
}


Measured memory_bytes: 512
// BEGINNING WITH THE NAME OF ALMIGHTY GOD ALLAH
// AUTHOR:: MOHAMMAD FAISAL
//#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.flush();
    int n,k;
       cin >> n >> k;
  string s;
    cin >> s;
      for(int i=0;i<n;i++)
    {
      if(i+1==k)
        cout<<char(s[i]+32);
      else
        cout<<s[i];
    }
    return 0;
    // BYE BYE
}



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

int main() {
	int n,m,i,j,k,ans,cur,res;
	cin >> n;
	if(n%2==1){
		cout << "No"; return 0;
	}
	string s;
	cin >> s;
	n=s.size();
	for(i=0; i<n/2; i++){
		if(s[i]!=s[i+n/2]){
			cout << "No"; return 0;
		}
	}
	cout << "Yes";
	return 0;
}

Measured memory_bytes: 256
from math import hypot

x1, y1, x2, y2, x3, y3 = map(int, open(0).read().split())

a = hypot(x1 - x2, y1 - y2)
b = hypot(x2 - x3, y2 - y3)
c = hypot(x3 - x1, y3 - y1)
R = abs((x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)) / (a + b + c)
m = max(a, b, c)
r = m / (2 + m / R)

print("{:.12f}".format(r))


Measured memory_bytes: 3060
@S=(1)x(@p=0..10**5);
$%-=<>;
sub f{my$U=pop;$p[$U]=$U-$p[$U]?f($p[$U]):$U}
/ /,${-$'}>0&&(($u=f${-$'})-($v=f$`)and$S[$u]+=$S[$v],$p[$v]=$u),${-$'}=$`for<>;
$%+=($u=${-$_})>0&&$S[f$u]for 1..10**5;
print$%

Measured memory_bytes: 53376
#include <iostream>
using namespace std;
int main(void){
    int n,m;cin>>n>>m;
    const int nmax=50;
    int A[nmax],B[nmax],C[nmax],D[nmax];
    for(int i=0;i<n;i++){
        cin >> A[i] >> B[i];
    }
    for(int j=0;j<m;j++){
        cin >> C[j] >> D[j];
    }
    for(int i=0;i<n;i++){
        int min_dist=abs(A[i]-C[0])+abs(B[i]-D[0]),checkpoint=1;
        for(int j=1;j<m;j++){
            const int cur_dist=abs(A[i]-C[j])+abs(B[i]-D[j]);
            if(min_dist>cur_dist){
                min_dist=cur_dist;
                checkpoint=j+1;
            }    
        }
        cout << checkpoint << endl;
    }
    return 0;     
}


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

using namespace std;

const int max_n = 200222;
const int max_len = 5;

string s;
int dp[max_n][max_len];

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> s;
    memset(dp, -1, sizeof(dp));
    dp[0][0] = 0;
    for (int i = 0; i < s.length(); ++i) {
        for (int j = 0; j < max_len; ++j) {
            if (dp[i][j] == -1) {
                continue;
            }
            //cout << i << " " << j << ": " << dp[i][j] << endl;
            for (int k = 1; i + k <= s.length() && k < max_len; ++k) {
                if (j != k || s.substr(i - j, j) != s.substr(i, k)) {
                    dp[i + k][k] = max(dp[i + k][k], dp[i][j] + 1);
                }
            }
        }
    }
    int ans = *max_element(dp[s.length()], dp[s.length()] + max_len);
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 4484
n = int(input())
a = [int(i) for i in input().split()]

counter = 0

def height_counter(array):
	global counter
	if len(array) == 0:
		return
	if len(array) == 1:
		counter += array[0]
		return
	else:
		b = min(array)
		c = array.count(b)
		counter += b
		for i in range(len(array)):
			array[i] -= b
		for i in range(c):
			d = array.index(0)
			height_counter(array[0:d])
			if d == len(array) - 1:
				array.append(0)
			array = array[d + 1:]
		height_counter(array)

height_counter(a)
print(counter)

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

typedef pair<int,int>  pint;
typedef pair<ll,ll>    pll;
typedef vector<int>    vint;
typedef vector<ll>     vll;
typedef vector<string> vstr;
typedef vector<pint>   vpint;
typedef vector<pll>    vpll;

#define vint2(v,n,m,init) vector<vector<int>> v(n, vector<int>(m, init))
#define vll2(v,n,m,init)  vector<vector<ll>>  v(n, vector<ll>(m, init))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vint var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vstr var(n); rep(i,n){cin >> var[i];}
#define ALL(var)         (var).begin(), (var).end()
#define sortall(var)     sort(ALL(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());

#define prt(var)         cout << (var) << "\n"
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
template <typename T>
bool chmax(T &a, const T& b){if(a<b){a=b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a>b){a=b; return true;} return false;}
//-----------------------------------------------------------------------------
class PrimeTool{

public:
  vector<ll> myMinPrime;

  PrimeTool(){
    myMinPrime.resize(1000001, -1);
    eratosthenes();
  }
  ~PrimeTool(){}

  void eratosthenes(){
    for(ll i=2; i<1000001; i++){
      if(myMinPrime[i]>0) continue;
      ll j=1;
      while(i*j<1000001){
        myMinPrime[i*j]=i;
        j++;
      }
    }
  }

  vector<ll> divisors(ll x){
    vector<ll> v;
    for(ll i=1; i*i<=x; i++){
      if(x%i==0){
        v.push_back(i);
        if(i!=x/i) v.push_back(x/i);
      }
    }
    sort(v.begin(), v.end());
    return v;
  }

  bool isPrime(ll x){
    if (x<2) return false;
    else if (x<1000001){
      return myMinPrime[x]==x;
    } else {
      for (ll i = 3; i*i <= x; i += 2){
        if (x % i == 0) return false;
      }
      return true;
    }
  }

  map<ll, ll> factorize(ll x){
    map<ll, ll> mp;
    if(x<2) return mp;
    // fast prime Factorization
    if(x<1000001){
      while(x>1){
        mp[myMinPrime[x]]++;
        x/=myMinPrime[x];
      }
    }
    // slow prime Factorization
    else {
      while(x%2==0){
        mp[2]++;
        x/=2;
      }
      for(ll i=3; i*i<=x; i+=2){
        while(x%i==0){
          mp[i]++;
          x/=i;
        }
      }
      if(x!=1) mp[x] = 1;
    }
    return mp;
  }
};

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

  PrimeTool pt;

  vint ans;
  REP(i,2,55556){
    if(pt.isPrime(i) && i%5==1){
      ans.push_back(i);
    }
    if(ans.size()==n) break;
  }

  prtall(ans);
}


Measured memory_bytes: 11136
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>

using namespace std;

vector<int> ans;

int main(){
	while(1){
		int n,m;
		cin >> n >> m;
		if(n + m == 0) break;
		map<int,int> root;
		for(int i = 0;i < 11;i++) root[i] = 0;
		for(int i = 0;i < n;i++){
			int d,p;
			cin >> d >> p;
			
			root[p] += d;
		}
		
		for(int i = 10;i >= 0;i--){
			if(root[i] >= m){
				root[i] -= m;
				m = 0;
				break;
			}else{
				int tn = root[i];
				root[i] = 0;
				m -= tn;
			}
		}
		
		int tans=0;
		for(int i = 0;i < 11;i++){
			tans += i * root[i];
		}
		
		ans.push_back(tans);
	}
	for(int i = 0;i < ans.size();i++) cout << ans[i] << endl;
	
	return 0;
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
#define rep(i, n)	for(int i=0;i<(int)(n);i++)
using namespace std;
using ll=long long;
const ll INF = 1LL<<60;

int main(){
    int n,k;
    cin>>n>>k;
    int h[110000];
    rep(i, n) cin>>h[i];
    ll dp[110000];
    rep(i, n) dp[i]=INF;
    dp[0]=0;

    for(int i=0;i<n;i++){
        for(int j=1;j<=k;j++){
            dp[i+j]=min(dp[i+j], dp[i]+abs(h[i]-h[i+j]));
        }
    }
    cout << dp[n-1]<<endl;
}

Measured memory_bytes: 4772
#include <iostream>
#include <cstdlib>
#include <algorithm>

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

using namespace std;

typedef long long ll;

int n;
string s;
ll k;
ll ans;

void dfs(int x){
	if(x == n){
		ans += k;
		return;
	}
	for(int i = 1; x + i <= n; ++i){
		ll v = atoll(string(s, x, i).c_str());
		k += v;
		dfs(x + i);
		k -= v;
	}
}

int main(){
	cin >> s;
	n = s.size();
	dfs(0);
	cout << ans << endl;
	return 0;
}

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

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

const int maxn = 1e5+10;
const int mod = 1e9+7;

using namespace std;

void solve(){
    int n,m,ok=0,s=0;
    cin>>n>>m;
    vi vs(n);
    for(int &x:vs){
        cin>>x;
        s+=x;
    }
    for(int x:vs){
        if(4*m*x >= s)
            ok++;
    }
    cout << (ok>=m ? "Yes" : "No") << endl;
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3552
#include <iostream>
#include <queue>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

#define REP(i,n) for(ll (i) = (0); (i) < (n); ++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) v.begin(),v.end()
#define INF 1100000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007
#define Decimal fixed << setpresicion(20)


typedef long long ll;
typedef pair<ll, ll> P;


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

  vector<ll> v;
  ll msum = 0, ans = 0;
  REP(i, N) {
    ll B; cin >> B;
    if (A[i] - B > 0) v.PB(A[i] - B);
    else if (A[i] - B < 0) ans++, msum += B - A[i];
  }
  sort(ALL(v), greater<ll>());

  ll cnt = 0, sum = 0;
  while (cnt < v.size() && sum < msum) sum += v[cnt++];
  if (sum < msum) cout << -1 << endl;
  else cout << ans + cnt << endl;

  return 0;
}

Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 10;
const int INF = 0x7fff7c7c;

string s;
int n, nxt[MAX][26], dp[MAX];

void build() {
	cin >> s;
	n = (int)s.length();

	for (int i = 0; i <= n; ++i)
		fill(nxt[i], nxt[i] + 26, n);
	fill(dp, dp + n + 1, INF);

	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < 26; ++j)
			nxt[i][j] = nxt[i + 1][j];
		nxt[i][s[i] - 'a'] = i;
	}
}

void solve() {
	vector<pair<char, int>> v(n + 1, { '?', n });

	dp[n] = 1;
	for (int i = n - 1; i >= 0; --i) {
		for (int j = 0; j < 26; ++j) {
			if (nxt[i][j] == n) {
				if (dp[i] > 1) dp[i] = 1, v[i] = { 'a' + j, n };
			}
			else if (dp[i] > dp[nxt[i][j] + 1] + 1) {
				dp[i] = dp[nxt[i][j] + 1] + 1;
				v[i] = { 'a' + j, nxt[i][j] + 1 };
			}
		}
	}

	string ans = "";
	int i = 0;
	while (i < n) {
		auto j = v[i];
		ans += j.first;
		i = j.second;
	}

	cout << ans;
}

int main() {
	cin.sync_with_stdio(0);
	build();
	solve();
	system("pause");
	return 0;
}

Measured memory_bytes: 26392
n=int(input())
name=[]
m=[]
for i in range(1,n+1):
  s,p=input().split()
  p=int(p)
  if s not in name:
    name+=[s]
  m+=[[i,s,p]]
name.sort()
for n in name:
  aa=[]
  for a in m:
    if a[1]==n:
      aa+=[a]
  aa.sort(reverse=1,key=lambda x:x[2])
  for a in aa:
    print(a[0])

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e9;

#define mod             1000000007
#define what_is(x)      cerr<<#x<<" is "<<x<<"\n";
#define read(x)         freopen("in.txt","r",stdin);
#define write(x)        freopen("out.txt","w",stdout);
#define Fast            ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define sz              3000005

int arr[sz];

int main(){
    Fast;///using Fast I/O
    int a,b,c, i,j,k, t,n,m;

    cin>>n>>k;
    for(i=1; i<=n; i++)cin>>arr[i];

    for(i=k+1, j=1; i<=n; i++,j++){
        if(arr[j]<arr[i]){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }

    return 0;
}



Measured memory_bytes: 4420
using System;
using System.Linq;
using System.Text;

namespace _089_TheShortestPathonARhombicPath
{
	class Program
	{
		static void Main ( string[] args )
		{
			//input
			string[] inputStr = new string[100];
			int inputCount = 0;

			while ((inputStr[inputCount] = Console.ReadLine ()) != null)
			{
				inputCount++;
			}

			int[][] inputNum = new int[inputCount][];

			for (int lp = 0; lp < inputNum.Length; lp++)
			{
				inputNum[lp] = Array.ConvertAll (inputStr[lp].Split (','), int.Parse);
			}

			//process
			int[][] pathTable = new int[inputCount][];
			for (int lp = 0; lp < pathTable.Length; lp++)
			{
				pathTable[lp] = new int[inputNum[lp].Length];
			}

			//top to middle
			pathTable[0][0] = inputNum[0][0];

			for (int row = 1; row <= pathTable.Length / 2; row++)
			{
				for (int col = 0; col < pathTable[row].Length - 1; col++)
				{
					int currentDistance = pathTable[row][col];
					int previousAddPathDistance = pathTable[row - 1][col] + inputNum[row][col];
					pathTable[row][col] = Math.Max (currentDistance, previousAddPathDistance);

					currentDistance = pathTable[row][col + 1];
					previousAddPathDistance = pathTable[row - 1][col] + inputNum[row][col + 1];
					pathTable[row][col + 1] = Math.Max (currentDistance, previousAddPathDistance);
				}
			}

			//middle to buttom
			for (int row = pathTable.Length / 2 + 1; row < pathTable.Length; row++)
			{
				for (int col = 0; col < pathTable[row].Length; col++)
				{
					int previousMaxDistance = Math.Max (pathTable[row - 1][col], pathTable[row - 1][col + 1]);
					pathTable[row][col] = previousMaxDistance + inputNum[row][col];
				}
			}

			//output
			Console.WriteLine (pathTable[pathTable.Length - 1][0]);
		}
	}
}

Measured memory_bytes: 9284
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
//ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 998244353;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll c(ll n, ll k) { ll a = 1; rep(i, 1, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }
int f[3][100001];
int main() {
	ll n, c;
	ll sum = 0;
	cin >> n;
	vector<ll> a(n),b(n);
	map<ll, ll>mp;
	rep(i, 0, n)cin >> a[i], b[i] = a[i];
	sort(all(a));
	auto it = a.begin();
	while (it != a.end()) {
		c = upper_bound(it, a.end(), *it) - it;
		mp[*it] = c;
		it += c;
		sum += c * (c - 1) / 2;
	}
	rep(i, 0, n) {
		printf("%lld\n", sum - mp[b[i]] + 1);
	}
	return 0;
}


Measured memory_bytes: 12672
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
using namespace std;

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(ll (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define opf(i) cout<<fixed<<setprecision(10)<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;

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

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

set<ll> s;
//
void solve(long long A, long long B){
  ll Gcd=gcd2(A,B);
  s.insert(1);
  for(ll i=2;i*i<=Gcd;i++){
     while(Gcd%i==0){
      Gcd/=i;
      s.insert(i);
      //op(i)
    }
  }
  //op(0)
  s.insert(Gcd);
  for(auto i:s){
    //op(i)
  }
  //op(000)
  op(s.size())
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


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

int n;
int a[101];
int main() {
    cin>>n;
    REP(i, 0, n) cin>>a[i];

    sort(a, a+n);
    cout<<a[n-1]-a[0]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
/*
//#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
*/

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*
//#if __cplusplus >= 201103L
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
*/
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl

#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
#define M_INF 1000000000
int n,a,i,j,k;

ll dp[51][51][3010];

void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n>>a;
  std::vector<ll> x(n);
  rep(i,n) cin>>x[i];
  dp[0][0][0] = 1;
  rep(j,n){
    rep(k,n){
      rep(s,2500){
        if(dp[j][k][s]){
          dp[j+1][k][s] += dp[j][k][s];
          dp[j+1][k+1][s+x[j]] += dp[j][k][s];
        }
      }
    }
  }
  ll ans = 0;
  repl(i,1,n+1) ans += dp[n][i][i*a];
  cout<<ans<<endl;

}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 58240
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sa = [0]
sb = [0]
for i in range(n):
  sa.append(sa[i]+a[i])
for i in range(m):
  sb.append(sb[i]+b[i])
maxn = 0
j = m
for i in range(n+1):
  if sa[i] <= k:
    while sa[i] + sb[j] > k:
      j -= 1
    maxn = max(maxn,i+j)
print(maxn)

Measured memory_bytes: 47488
#include<stdio.h>
int pow10n(int n) {
    int sum = 1;
    for (int i=0; i<n; i++) sum *= 10;
    return sum;
}
int main() {
    int i, a, b;
    int A = 0, B = 0;
    scanf("%d %d", &a, &b);
    // printf("%d", (int)(pow(a, 3)));
    
    // int d = pow10n(a);
    for(i=0; i<b; i++) {
        A += (a * pow10n(i));
    }

    for(i=0; i<a; i++) {
        B += (b * pow10n(i));
    }
    if (A > B) printf("%d", A);
    else printf("%d", B);
    

   return 0;
}

Measured memory_bytes: 128
# ABC 057: B – Checkpoints
studentPoints = []
checkPoints = []
n, m = map(int, input().split())
for _ in range(n):
    studentPoints.append([int(s) for s in input().split()])
for _ in range(m):
    checkPoints.append([int(s) for s in input().split()])

for i in range(n):
    distances = [abs(studentPoints[i][0] - checkPoints[k][0]) + abs(studentPoints[i][1] - checkPoints[k][1]) for k in range(m)]
    print(distances.index(min(distances)) + 1)

Measured memory_bytes: 3064
import java.io.*;
import java.util.*;
import java.math.*;
// import java.awt.Point;

public class Main {
    public Main(){
        Scanner sc=new Scanner(System.in);
        int N[]=new int[4];
        for(int i=0;i<4;i++){
            N[i]=sc.nextInt();
        }
        int[] ans=new int[]{1,7,9,4};
        boolean[] frag=new boolean[]{false,false,false,false};
        loop1:
        for(int i=0;i<4;i++){
            for(int j=0;j<4;j++){
                if(ans[i]==N[j]){
                    continue loop1;
                }
            }
            System.out.println("NO");
            return;
        }
        System.out.println("YES");
    }
    public static void main(String[] args){
        Main main=new Main();
    }

}


Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    ll x,y;
    cin>>x>>y;
    if(abs(x-y)>1) cout<<"Alice"<<endl;
    else cout<<"Brown"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n+1];
  int b[n+1];
  int c[n];
  for(int i=1;i<=n;i++)
    cin>>a[i];
  for(int i=1;i<=n;i++)
    cin>>b[i];
  for(int i=1;i<n;i++)
    cin>>c[i];
  int s=0;
  for(int i=1;i<=n;i++)
  {
    s+=b[a[i]];
    if(i>1 && a[i]==a[i-1]+1)
      s+=c[a[i-1]];
  }
  cout<<s;
}


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

int x, y, s;

int main(){
	while(scanf("%d%d%d",&x,&y,&s),x||y||s){
		int a,b,A,B;
		int ans = 0;
		for(a = 1; a <= s-1; a++){
			b = s-a;
			A = a*100/(100+x);
			A -= 10;
			while(true){
				if((A+1)*(100+x)/100 > a) break;
				A++;
			}
			if(A*(100+x)/100 <= a-1) continue;
			B = b*100/(100+x);
			B -= 10;
			while(true){
				if((B+1)*(100+x)/100 > b) break;
				B++;
			}
			if(B*(100+x)/100 <= b-1) continue;
			//cout << a << " " << b << " " << A << " " << B << " " << A*(100+y)/100+B*(100+y)/100 << endl;
			ans = max(ans,A*(100+y)/100+B*(100+y)/100);
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1208
#include <iostream>
using namespace std;
int main(void){
    int a,ans,i,j,k,l;
    while(cin >> a){
        ans = 0;
        for(i = 0; i < 10; i++){
            for(j = 0; j < 10; j++){
                for(k = 0; k < 10; k++){
                    for(l = 0; l < 10; l++){
                        if(i + j + k + l == a){
                            ans++;
                        }
                    }
                }
            }
        }
        cout << ans << endl;
    }
}


Measured memory_bytes: 3084
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) std::cout<<arg<<"\n"
#define prin2(arg1,arg2) std::cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using std::cin;
typedef long long ll;
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
const int INF=1e+9;
const ll INFLL=1e+17;
int W,a,b;
int solve(){
  if(a<b){
    return std::max(0,b-(a+W));
  }
  else{
    return std::max(0,a-(b+W));
  }
}
int main(){
  cin>>W>>a>>b;
  prin(solve());
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod = 1e9 + 7;
const ll INF = 1e9;
const ll LINF = 1LL << 60;

int main() {
  int n, r;
  cin >> n >> r;
  if (n < 10)
    cout << r + 100 * (10 - n) << endl;
  else
    cout << r << endl;
  return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
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<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<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e16;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back

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){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

//using edge = struct{ll from, to;};

int main(){
    ll ca = 0, cb = 0, cba = 0;
    ll N; cin >> N;
    vs s(N); ll ans = 0;
    REP(i, N){
        string t; cin >> t; ll len = t.size();
        REP(j, len-1){
            if(t[j] == 'A' && t[j+1] == 'B') ans++;
        }
        if(t[0] == 'B' && t[len-1] == 'A') cba++;
        else if(t[0] == 'B') cb++;
        else if(t[len-1] == 'A') ca++;
    }
    if(cba >= 1){
        ans += cba-1;
        if(ca > 0){
            ans++; ca--;
        }
        if(cb > 0){
            ans++; cb--;
        }
    }
    ans += min(ca, cb);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
import java.util.*;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;

public class Main {
	
	public static HashMap<String,String> map = new HashMap<>();

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int h = sc.nextInt();
		int w = sc.nextInt();
		int[][] map = new int[h][w];
		int[][] ck  = new int[h][w];
		boolean[][] cc = new boolean[h][w];
		for(int i = 0; i < h; i++) {
			char[] mm = sc.next().toCharArray();
			for(int j = 0; j < w; j++) {
				if(mm[j] == '.') continue;
				map[i][j] = mm[j] - '0';
			}
		}
		ArrayDeque<Node> q = new ArrayDeque<Node>();
		ArrayDeque<Node> n_q = new ArrayDeque<Node>();
		int[] vx = {1,1,1,0,0,-1,-1,-1};
		int[] vy = {1,0,-1,1,-1,1,0,-1};
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				if(map[i][j] == 0) {
					for(int k = 0; k < 8; k++) {
						int ty = i + vy[k];
						int tx = j + vx[k];
						if(r(h,w,ty,tx) && map[ty][tx] != 0) {
							cc[ty][tx] = true;
							ck[ty][tx]++;
						}
					}
				}
			}
		}
		for(int i = 0; i < h; i++) {
			for(int j = 0; j < w; j++) {
				if(cc[i][j]) {
					q.add(new Node(i,j));
				}
			}
		}
		
		boolean o = true;
		int ans = 0;
		ArrayDeque<Node> er = new ArrayDeque<Node>();
		while(o) {
			o = false;
			while(!q.isEmpty()) {
				Node n = q.poll();
				if(map[n.h][n.w] == 0) continue;
				
				if(ck[n.h][n.w] >= map[n.h][n.w]) {
					o = true;
					er.add(n);
					for(int i = 0; i < 8; i++) {
						int tx = n.w + vx[i];
						int ty = n.h + vy[i];
						if(r(h,w,ty,tx) && map[ty][tx] != 0 && !cc[ty][tx]) {
							n_q.add(new Node(ty,tx));
							cc[ty][tx] = true;
						}
					}
				} else {
					cc[n.h][n.w] = false;
				}
				
			}
			while(!er.isEmpty()) {
				Node p = er.poll();
				for(int i = 0; i < 8; i++) {
					int tx = p.w + vx[i];
					int ty = p.h + vy[i];
					if(r(h,w,ty,tx) && map[ty][tx] != 0) {
						ck[ty][tx]++;
						if(!cc[ty][tx]) {
							n_q.add(new Node(ty,tx));
							cc[ty][tx] = true;
						}
					}
				}
				map[p.h][p.w] = 0;
			}
			ArrayDeque<Node> tmp = q;
			q = n_q;
			n_q = tmp;
			if(o) ans++;
		}
		System.out.println(ans);
		
	}
	
	static boolean r(int a, int b, int c, int d) {
		if(c < 0 || d < 0 || c >= a || d >= b) return false;
		return true;
	}
	
	static class Node {
		int h;
		int w;
		Node(int a, int b) {
			h = a;
			w = b;
		}
	}
}

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

int main() {
  int N;
  cin >> N;
  int a;
  
  vector<int> A(N);
  for(int i=0;i<N-1;i++){
    cin>>a;
    A.at(a-1)++;
  }
  
  for(int i=0;i<N;i++){
    cout << A.at(i) <<endl;
  }
}

Measured memory_bytes: 4048
#pragma region Macros
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define rep2(i, a, b) for(ll i = a; i <= b; ++i)
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep3(i, a, b) for(ll i = a; i >= b; --i)

main() {
    int n = 0;
    char c;
    while(1) {
        c = getchar();
        if(c!='\n')
            n = n * 10 + c - '0';
        else
            break;
    }
    int sqrtN = sqrt(n);
    ll ans = 0;
    ll d = (ll)(sqrtN) * (sqrtN + 1) * (2 * sqrtN + 1) / 6;
    rep2(i, 1, sqrtN) { ans += (i * (i + (n / i)) * ((n / i) + 1 - i)); }
    ans -= d;
    char wr[15];
    char *w = wr;
    while(ans) {
        *w = ans % 10 + '0';
        ans /= 10;
        w++;
    }
    while(1) {
        w--;
        putchar(*w);
        if(w == wr) break;
    }
}

Measured memory_bytes: 3692
#include <iostream>
#include <string>

using namespace std;

int main() {
    string answer;
    string S;
    u_int num_win = 0;

    // input
    cin >> S;

    // process
    for (int i = 0; i < S.length(); i++) {
        if (S[i] == 'o') {
            num_win++;
        }
    }
    num_win += 15 - S.length();
    if (num_win >= 8) {
        answer = "YES";
    } else {
        answer = "NO";
    }

    // output
    cout << answer << endl;

    return 0;
}

Measured memory_bytes: 256
///mAAria...
#include<bits/stdc++.h>
 
using namespace std;
 
#define int long long
typedef pair<int,int> pii;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mod 1000000007
//#define inf 1000000000
const long long inf = 1e17;
const long double PI = acos(-1);

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

void solve(){
   
    int n,m,l;
    cin >> n >> m >> l;

    int fuel[n+2][n+2] = {inf};
    int dist[n+2][n+2] = {inf};
    for(int i = 1;i<=n;i++){
        for(int j = 1;j<=n;j++){
            //cout << fuel[i][j] << endl;
            fuel[i][j] = inf;
            dist[i][j] = inf;
        }
        dist[i][i] = 0;
        fuel[i][i] = 0;
    }

    for(int i = 0;i<m;i++){
        int a , b ,c;
        cin >> a >> b >> c;

        fuel[a][b] = min(fuel[a][b], c);
        fuel[b][a] = min(fuel[b][a], c);

    }
    //floyd-warshall to find the min fuel needed to go between two towns
    for(int k = 1;k<=n;k++)
    for(int i = 1;i<=n;i++){
        for(int j= 1;j<=n;j++){
            if(i==j)continue;
            fuel[i][j] = min(fuel[i][k] + fuel[k][j], fuel[i][j]); 
        }
        //fuel[i][i] = 0;
    }

    for(int i = 1;i<=n;i++){
        for(int j = 1;j<=n;j++){
            if(i==j)continue;
            if(fuel[i][j]<=l)dist[i][j] = min(dist[i][j], 1LL);
        }
        //dist[i][i] = 0;
    }

    for(int k = 1;k<=n;k++)
    for(int i = 1;i<=n;i++){
        for(int j= 1;j<=n;j++){
            //if(i==j)continue;
            dist[i][j] = min(dist[i][k] + dist[k][j], dist[i][j]); 
        }
        //dist[i][i] = 0;
    }

    int q;
    cin >> q;
    while(q--){
        int a , b;
        cin >> a>> b;
        if(dist[a][b]<inf){
        cout << dist[a][b]-1 << endl;
         }
        else
        cout << -1 << endl;
    }


} 

signed main() 
{   
    IOS;
    int t = 1;
    //cin >> t;

    for(int i = 1;i<=t;i++){
        solve();
    }
    return 0;
} 

 


Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int q;

bool C(int v,int maxi,int a,int b){
	b-=(v-1)/maxi;
	ll cap=(ll)(a-v+1)*maxi;
	if(cap>=b)return true;
	return false;
}

string solve(int a,int b,int c,int d){
	int maxi=(max(a,b)+min(a,b))/(min(a,b)+1);
	int l=0,r=a+1;
	while(l+1<r){
		int mid=(l+r)/2;
		if(C(mid,maxi,a,b))l=mid;
		else r=mid;
	}
	string ans="";
	c--;
	int lenf=l+((l-1)/maxi);
	for(int i=c;i<d;i++){
		if(i<lenf){
			if(i%(maxi+1)==maxi)ans+='B';
			else ans+='A';
		}else{
			if((a+b-i-1)%(maxi+1)==maxi)ans+='A';
			else ans+='B';
		}
	}
	return ans;
}

int main(void){
	scanf("%d",&q);
	for(int i=0;i<q;i++){
		int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		cout << solve(a,b,c,d) << endl;
	}
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <utility>
#include <tuple>
#include <cstdio>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <cstdlib>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
    string N;
    cin >> N;
    long long digit_num=0;
    for(long long i=0;i<N.size();i++){
        digit_num = digit_num + (int)(N[i]-'0');
    }
    if(digit_num==0){
        cout << "Yes" <<endl;
    }
    else if(digit_num%9==0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No"  <<endl;
    }
}

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

namespace ABC054A___One_Card_Poker
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();

            string[] card = input.Split(' ');

            
            Console.WriteLine(Judgment(int.Parse(card[0]), int.Parse(card[1])));

        }

        public static string Judgment(int cardA, int cardB)
        {
            string result = "";

            if (cardA == 1)
            {
                cardA = 14;
            }

            if (cardB == 1)
            {
                cardB = 14;
            }

            switch (cardA.CompareTo(cardB))
            {
                case -1: result = "Bob"; break;
                case 0: result = "Draw"; break;
                case 1: result = "Alice"; break;

            }

            return result;
        }

    }
}


Measured memory_bytes: 13140
#pragma region Macros
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;
#pragma endregion

double rec(int i, int j, int k, vector<vector<vector<double>>> &dp, int n) {
    if (dp.at(i).at(j).at(k) >= 0.0) return dp.at(i).at(j).at(k);

    double res = 0.0;
    if (i > 0) res += rec(i-1, j, k, dp, n) * i;
    if (j > 0) res += rec(i+1, j-1, k, dp, n) * j;
    if (k > 0) res += rec(i, j+1, k-1, dp, n) * k;
    res += n;
    res *= 1.0 / (i + j + k);

    return dp.at(i).at(j).at(k) = res;
}

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i=0; i<n; i++) {
        cin >> a.at(i);
    }

    vector<vector<vector<double>>> dp(n+1, vector<vector<double>>(n+1, vector<double>(n+1, -1)));
    dp.at(0).at(0).at(0) = 0.0;

    cout << rec(count(a.begin(), a.end(), 1), count(a.begin(), a.end(), 2), count(a.begin(), a.end(), 3), dp, n) << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


Measured memory_bytes: 216960
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using o_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define M 1000010

int main(){
	IOS;
	
	ll h,w,k;cin>>h>>w>>k;
	string s[h];
	ll a[h][w];
	rep(i,0,h)rep(j,0,w)a[i][j]=0;
	rep(i,0,h)cin>>s[i];
	ll ptr=1;
	rep(i,0,h){
		rep(j,0,sz(s[i]))if(s[i][j]=='#')a[i][j]=ptr,ptr++;
	}
	rep(i,0,w){
		ll v=0;
		rep(j,0,h)if(a[j][i]>0){v=a[j][i];break;}
		if(v==0)continue;
		rep(j,0,h){
			if(a[j][i]==0)a[j][i]=v;
			else v=a[j][i];
		}
	}
	rep(i,0,h){
		ll v=0;
		rep(j,0,w)if(a[i][j]>0){v=a[i][j];break;}
		if(v==0)a[-1][-1]=0;
		rep(j,0,w){
			if(a[i][j]==0)a[i][j]=v;
			else v=a[i][j];
		}
	}
	rep(i,0,h){rep(j,0,w)cout<<a[i][j]<<" ";cout<<"\n";}
	
	return 0;
}



Measured memory_bytes: 1536
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    int q;cin>>q;
    multiset<int> st;
    rep(i,0,q){
        int a,b;cin>>a>>b;
        if(a==0){
            st.insert(b);
            cout<<st.size()<<endl;
        }else if(a==1){
            cout<<st.count(b)<<endl;
        }else if(a==2){
            st.erase(b);
        }else {
            int r;cin>>r;
            auto low=st.lower_bound(b);
            auto high=st.upper_bound(r);
            for(auto it=low;it!=high;it++)cout<<*it<<endl;
            
            
        }
    }
    
    
}



/*

*/



Measured memory_bytes: 12336
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#define ll long long int
#define lim 100010
#define mod 1e9+7
#define INF 1e9
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define ABS(x) ((x)>0?(x):-(x))

ll p = mod;

ll calc(ll a,ll b){
	if(b==0)return 1;
	if(b%2==0){
		ll d = calc(a,b/2);
		return (d*d)%p;
	}return (a*calc(a,b-1))%p;
}

ll cmb(ll n,ll m){
	ll a=1,b=1;
	for(int i=n;i>=n-m+1;i--)a=(a*i)%p;
	for(int i=1;i<=m;i++) b=(b*i)%p;
	return (a*calc(b,p-2))%p;
}

int main(void){
	ll N,K;
	scanf("%lld%lld",&N,&K);
	for(int i=1;i<=K;i++){
		printf("%lld\n",cmb(N-K+1,i)*cmb(K-1,i-1)%p);
	}
	
	
	return 0;
}

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

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

string S,T;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>S>>T;
	sort(ALL(S));
	sort(ALL(T));
	reverse(ALL(T));
	if(S<T) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	
}


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


Measured memory_bytes: 256
// 参考
// https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// Input macro
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! stdin {
    () => {{
        use std::io::Read;
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }};
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// Test Code
macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r"rng gorilla apple
" => r"YES",

r"yakiniku unagi sushi
" => r"NO",

r"a a a
" => r"YES",

r"aaaaaaaaab aaaaaaaaaa aaaaaaaaab
" => r"NO"
}

use std::cmp;
use std::cmp::{max, min};
use std::collections::HashSet;
use std::f32::MAX;

fn main() {
    println!("{}", solve(&stdin!()));
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: String,
        b: String,
        c: String,
    }

    if a.chars().nth(a.len() - 1) == b.chars().nth(0)
        && b.chars().nth(b.len() - 1) == c.chars().nth(0)
    {
        "YES".to_string()
    } else {
        "NO".to_string()
    }
}


Measured memory_bytes: 4352