akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Text;

class Program
{
	static void Main(string[] args)
	{
		int[] func = new int[200001];
		int[] popcount = new int[200001];
		for(int i=1; i<200001; i++)
		{
			popcount[i] = popcount[i/2] + i%2;
			int buf = i % popcount[i];
			func[i] = func[buf] + 1;
		}

		string[] input = Read();
		int n = int.Parse(input[0]);
		char[] x = Read()[0].ToCharArray();
		bool[] bit = new bool[n];
		int count1 = 0;
		for(int i=0; i<n; i++)
		{
			if(x[n-i-1]=='1')
			{
				bit[i] = true;
				count1++;
			}
		}
		int[][] amari = new int[n][];
		int[] amariBase = new int[2];
		int[] add = new int[]{-1,1};
		//if(count1<2) add[0] = 0;
		amari[0] = new int[2];
		for(int j=0; j<2; j++) amari[0][j] = 1 % Math.Max(count1 + add[j], 1);
		if(bit[0]){
		for(int j=0; j<2; j++) amariBase[j] = amari[0][j];}
		for(int i=1; i<n; i++)
		{
			amari[i] = new int[2];
			for(int j=0; j<2; j++) amari[i][j] = (amari[i-1][j] * 2) % Math.Max(count1 + add[j],1);
			if(bit[i]) for(int j=0; j<2; j++) amariBase[j] = (amariBase[j] + amari[i][j]) % Math.Max(count1 + add[j],1);
		}
		for(int i=0; i<n; i++)
		{
			int idx = n-i-1;
			int addIdx = bit[idx] ? 0 : 1;
			if(count1+add[addIdx]==0)
			{
				Write(0);
				continue;
			}
			int buf = amariBase[addIdx] + amari[idx][addIdx] * add[addIdx];
			if(buf < 0) buf += count1 + add[addIdx];
			buf = buf % (count1+add[addIdx]);
			Write(func[buf]+1);
		}
	}

	static string[] Read()
	{
		return Console.ReadLine().Split(' ');
	}

	static void Write(object o)
	{
		Console.WriteLine(o.ToString());
	}
}


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

bool prime[2005];

int N, K;
int get(int x, int y)
{
	return (K+1 + (K-1)*(x) + (y));
}

int main(void)
{
	for(int i = 2; i < 2005; i++){
		if(prime[i]) continue;
		for(int j = 2*i; j < 2005; j+=i) prime[j] = true;
	}
	
	for(K = 2; K <= 1000; K++){
		N = K*(K-1)+1;
		if(!prime[K-1] && N >= 1000 && N <= 2000){
			break;
		}
	}
	cout << N << " " << K << endl;
	for(int i = 1; i <= K; i++) cout << i << " "; cout << endl;
	for(int i = 1; i <= K; i++){
		for(int j = 0; j < K-1; j++){
			cout << i << " ";
			if(i < K){
				for(int k = 0; k < K-1; k++){
					cout << get((j+(i-1)*k)%(K-1), k) << " ";
				}
			}else{
				for(int k = 0; k < K-1; k++){
					cout << get(k, j) << " ";
				}
			}
			cout << endl;
		}
	}
	
	
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define max(a,b) ((a>b)? a:b)
#define min(a,b) ((a<b)? a:b)
int main()
{
  int n,m,X,Y;
  cin>>n>>m>>X>>Y;
  vector<int> x(n),y(m);
  for(int i=0;i<n;i++){
    cin>>x[i];
  }
  for(int i=0;i<m;i++){
    cin>>y[i];
  }
  sort(x.begin(),x.end(),greater<int>());
  sort(y.begin(),y.end());
  if(max(x[0],X)<min(y[0],Y)){
    cout<<"No War";
    return 0;
  }
  cout<<"War";
}

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

int main(){
  int  n;
  cin >> n;
  int a[n];
  long int  num[200001]={0};
  for(int i=0; i<n; i++){
    int s;
    scanf("%d",&s);
    a[i] =s;
    num[s]++;
  }
  long int sum=0;
  for(int i=1; i<=n; i++){
    if(num[i]>1){
      sum +=num[i]*(num[i]-1)/2;
     }
  }
  for(int i=0; i<n; i++){
    if(num[a[i]]==1){
      cout << sum << endl;
    }else{
      long int b = num[a[i]];
      cout << sum - (b-1) << endl;
    }

  }
  return 0;
}

Measured memory_bytes: 4864
#include<bits/stdc++.h>
#define int long long int  //comment for large arrays
#define pll pair<int,int>
#define dbl long double
#define ff first
#define ss second
#define endl "\n"
#define mod 1000000007
#define eps 0.00000001
#define INF 10000000000000001
#define all(x) (x).begin(),(x).end()
#define LB(v,x) (lower_bound(all(v),x) - v.begin()) 
#define UB(v,x) (upper_bound(all(v),x) - v.begin())
#define size(x) (int)(x).size()
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define popb() pop_back()
#define popf() pop_front()
#define mp(x,y) make_pair((x),(y))
#define vec(dt) vector<dt>
#define vv(dt) vector<vector<dt>>
#define fastio(x) ios_base::sync_with_stdio(x); cin.tie(NULL)
#define init(v,s) memset(v,s,sizeof(v)) 
#define bug(x) cerr<<"LINE: "<<__LINE__<<" || click to see test details "<<#x<<" = "<<x<<endl
#define loop(i,s,n) for(int i=s;i<n;i++)
#define bugprint(v) for(auto it:v) cout<<it<<" "; cout<<endl 
using namespace std;


signed main()
{
	fastio(0);
	int n;
	cin>>n;
	dbl p[n+1],dp[n+1],ans = 0;
	loop(i,1,n+1) cin>>p[i];
	dp[0] = 1;
	loop(i,1,n+1) dp[i] = 0;
	loop(i,1,n+1)
	{
		for(int j=n;j>0;j--) dp[j] = p[i]*dp[j-1] + (1-p[i])*dp[j];
		dp[0] = dp[0]*(1-p[i]);
	}
	loop(i,n/2 + 1,n+1) ans += dp[i];
	cout<<fixed<<setprecision(15)<<ans<<endl;
	return 0;		
}

Measured memory_bytes: 512
<?php
fscanf(STDIN, "%d", $m);

while ($m--) {
  fscanf(STDIN, "%d", $fund);
  fscanf(STDIN, "%d", $t);
  fscanf(STDIN, "%d", $n);

  $ans = 0;
  while ($n--) {
    fscanf(STDIN, "%d %f %d", $op, $p, $q);

    $total = $fund;
    if ($op == 0) { // 単利
      $tmp = 0;
      for ($i = 0; $i < $t; $i++) {
        $tmp += floor($total * $p);
        $total -= $q;
      }
      $total += $tmp;
    } else { // 複利
       for ($i = 0; $i < $t; $i++) {
        $total += floor($total * $p) - $q;
      }
    }
    $ans = max($ans, $total);
  }

  print $ans . "\n";
}

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

using namespace std;

int main()
{
    string s;
    cin >> s;
    for(int i = 0; i < 19; ++i){
        if(i != 5 && i != 13)
            cout << s[i];
        else
            cout << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main()
{
int h[100001] ,i,dp[100001],m,n,N;
  scanf("%d",&N);
  for(i=0;i<N;i++)scanf("%d",&h[i+1]);
  dp[1]=0;
  dp[2]=abs(h[2]-h[1]);
  for(i=3;i<=N;i++)
  {
    m=abs(h[i]-h[i-1])+dp[i-1];
    n=abs(h[i]-h[i-2])+dp[i-2];
    if(m>n)dp[i]=n;
    else if(n>m)dp[i]=m;
    else dp[i]=n;
  }
  printf("%d",dp[N]);
  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  for (int i = 0; i < n; i++){
    cin >> a.at(i);
    if (a.at(i) % 2 == 1){
      b.at(i) = 1;
    }
    else{
      b.at(i) = 2;
    }    
  }
  int x = 1;
  for (int i = 0; i < n; i++){
    x *= b.at(i);
  }
  
  cout << pow(3, n) - x << endl;
}

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

int main()
{
    long long n;
    cin >> n;
    vector<long long> fact(1, 1);
    for(long long i = 2; i * i <= n; ++i)
    {
        if(n % i == 0)
        {
            fact.push_back(i);
            if(i * i != n) fact.push_back(n / i);
        }
    }
    sort(fact.begin(), fact.end());
    fact.push_back(n);
    cout << (fact.size() % 2 ? fact[fact.size() / 2] * 2 - 2: fact[fact.size() / 2 - 1] + fact[fact.size() / 2] - 2) << endl;
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main() {
    int X;
    cin >> X;
    int rate[9] = {400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000};
    int rank = 0;
    for (int i = 0; i < 8; i++) {
        if (X >= rate[i] && X < rate[i+1])
            rank = 8 - i;
    }
    cout << rank << endl;
}

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

string S;
size_t cur = 0;

int number(){
	int num = 0;
	while(isdigit(S[cur])){
		num = 10 * num + (S[cur++] - '0');
	}
	return num;
}

int parser(){
	vector<int> res;
	if(S[cur]=='[') cur++;

	if(isdigit(S[cur])){
		const int num = number();
		res.push_back((num+1)/2);
	}else{
		while(S[cur]=='['){
			res.push_back(parser());
		}
	}

	assert(S[cur]==']');
	cur++;

	sort(begin(res),end(res));
	const int n = res.size();
	int ret = 0;
	rep(i,n/2+1) ret += res[i];
	return ret;

}

int main(void){
	int n;
	cin >> n;
	rep(i,n){
		cin >> S;
		cur = 0;
		cout << parser() << endl;
	}

	return 0;
}

Measured memory_bytes: 3204
#include <bits/stdc++.h>
#define ALL(A) (A).begin(),(A).end()
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)

const ll mod = 1e9+7;
const ll INF = 2*1e18;
const int inf = 1e9+7;

using namespace std;

int main(void){
	int N;
	ll A,B,mx=0;
	cin >> N >> A >> B;
	ll x = A-B;
	vector<ll> h(N);
	rep(i,N){
		cin >> h[i];
		mx = max(mx,h[i]);
	}
	ll ok = mx;
	ll ng = 0;
	while(abs(ok-ng)>1){
		ll mid = (ok+ng)/2;
		
		ll cnt = 0;
		for(int i=0;i<N;i++){
			if(h[i]>mid*B){
				cnt += ((h[i]-mid*B)+x-1)/x;
			}
		}
		if(cnt<=mid)ok = mid;
		else ng = mid;
	}
	cout << ok << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstring>
#include<cstdio>

#define MAX 1000005
#define ll long long
using namespace std;
ll dp[MAX][2];
int main( )
{
	string s;
	while(cin >> s){
		int len = s.length();
		ll ans = 0;
		memset(dp,0,sizeof(dp));
		int di = s[0] - '0';
		dp[0][0] = di;
		dp[0][1] = 10 - di + 1;
		
		for(int i = 1; i < len; i++){
			di = s[i] - '0';
		//	cout << dp[i - 1][0] << ":" << dp[i - 1][1] << endl;
		//	cout << di << endl;
		//	getchar();
			dp[i][0] = min(dp[i - 1][0],dp[i - 1][1]) + di;
			dp[i][1] = min(dp[i - 1][0] + 1 + 10 - di,dp[i - 1][1] - 1 + 10 - di); 
		}
		cout << min(dp[len - 1][0],dp[len - 1][1]) << endl;
	}
	return 0;
}



Measured memory_bytes: 17028
#include<bits/stdc++.h>
using namespace std;
const long long MX=1e18;
const long long MD=1e9+7;
const int N=1e5+5;
long long n,a[100005],dp[100005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    for(int i=0;i<n;i++)cin>>a[i];
    dp[1]=abs(a[0]-a[1]);
    for(int i=2;i<n;i++)
    {
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
    }
    cout<<dp[n-1];
}


Measured memory_bytes: 1792
#include<stdio.h>

int main(){
	int a, b, c, i,j;
	int syou, amari, kosuu = 0;
	scanf("%d %d %d", &a, &b, &c);
	for (i = a; i <= b; i++){
		syou = c / i;
		amari = c - syou*i;
		if (amari == 0){
			kosuu++;
		}	
	}
	printf("%d\n", kosuu);
	return 0;
}

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

int main() {
  long N;
  
  long K;
  
  long Q;
  
  cin >> N >> K >> Q;
  
  vector<long> A(N);
  vector<long> An(Q);
  
  for(long i = 0;i < Q;i++){
    cin >> An.at(i);
  }
  
  for(long i = 0;i < N;i++){
    A.at(i) = K;
  }
  
  for(long i = 0;i < Q;i++){
    A.at(An.at(i) - 1)++;
  }
  
  for(long i = 0;i < N;i++){
    if(A.at(i) - Q > 0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
}

Measured memory_bytes: 2176
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))
c = collections.Counter(a)
c = sorted(c.items(), key=lambda k: k[1],
           reverse=True)

size = len(c)
if size > k:
    ans = sum([v for _, v in c[k:]])
    print(ans)

else:
    print(0)


Measured memory_bytes: 39352
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;


/*
辺に関するdp（辺より先の部分木に関するdp）
dp[p][i] = pから出るi番目の辺より奥の部分木の塗り方の総数。
	v[p][i]が白のとき、それ以降はすべて白なので1通り。
	v[p][i]が黒のとき、v[p][i]から出る辺で行き先がp以外ものについての塗り方の制約は無い。
実はこのままだとTLEする。
隣接点が極端に多い点があったら、掛け算の回数がn^2に近くなってしまう。mが素数ならmod mでの逆元を用いて計算量を短縮できるが、ここではmは一般の数なのでそれも出来ない。
解決方法：配列のうち 1 要素を除いた積を取る
	順方向と逆方向の累積積を持っておけば[$ O(1)]で求まる
	ru:順方向
	ru2:逆方向
*/

ll n,m,visited[100010]={};
vector<ll> v[100010],v_rev[100010],dp[100010],ru[100010],ru2[100010];

ll f(ll p,ll rev,bool begin){
	// cout<<"cur: "<<p<<endl;
	ll next=1;
	int k = v[p].size();
	if(k==0 || visited[p]<k){//pに隣接する未探索の辺があったら
		rep(i,k){
			if(i==rev)continue;
			if(dp[p][i]==-1){
				dp[p][i] = (f(v[p][i], v_rev[p][i], false) + 1) % m;
				visited[p]++;
			}
			next=(next*dp[p][i]) % m;
		}
	}else if(visited[p]>=k){//pに隣接する全ての辺についてdpが確定したら
		if(visited[p]==k){//累積和未計算
			ru[p][0]=dp[p][0];
			reg(i,1,k-1)ru[p][i]=(dp[p][i]*ru[p][i-1]) % m;
			ru2[p][k-1]=dp[p][k-1];
			irep(i,k-1)ru2[p][i]=(dp[p][i]*ru2[p][i+1]) % m;
			visited[p]+=10;
			//
			// cout<<"ru"<<p<<": ";
			// rep(i,k)cout<<ru[p][i]<<" ";
			// cout<<endl;
			// cout<<"ru_rev"<<p<<": ";
			// rep(i,k)cout<<ru2[p][i]<<" ";
			// cout<<endl;
		}
		if(begin){
			next=ru[p][k-1];
			// cout<<"ru"<<p<<"="<<ru[p][k-1]<<endl;
		}else{
			if(rev>0)next=ru[p][rev-1];
			if(rev<k-1)next=(next*ru2[p][rev+1]) % m;
		}
	}
	return next;
}

int main(void){
	cin>>n>>m;
	rep(i,n-1){
		int x,y;
		cin>>x>>y;
		v[x].push_back(y);
		v[y].push_back(x);
		v_rev[x].push_back(v[y].size()-1);
		v_rev[y].push_back(v[x].size()-1);
		dp[x].push_back(-1);
		dp[y].push_back(-1);
		ru[x].push_back(-1);
		ru[y].push_back(-1);
		ru2[x].push_back(-1);
		ru2[y].push_back(-1);
	}
	//
	// reg(i,1,n){
	// 	cout<<i<<": ";
	// 	rep(j,v[i].size()){
	// 		cout<<v[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }
	// reg(i,1,n){
	// 	cout<<i<<": ";
	// 	rep(j,v[i].size()){
	// 		cout<<v_rev[i][j]<<" ";
	// 	}
	// 	cout<<endl;
	// }
	//
	reg(i,1,n){
		// cout<<"current: "<<i<<endl;
		cout<<f(i,1e9,true)<<endl;
	}
	return 0;
}

Measured memory_bytes: 35712
#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(i, (v).size()) { cout << v[i]; if (i != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	ll ans = 1;
	REP(i, n) {
		ans *= i + 1;
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

bool fn_is_prime(ll n) {
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

bool isOK(int index, int key, vector<ll>& a) {
    if (a[index] >= key) return true;
    else return false;
}

int binary_search(int key, vector<ll>& a) {
    int ng = -1;
    int ok = a.size();

    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;

        if (isOK(mid, key, a)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main()
{
    int n; cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];    
    sort(a.begin(), a.end());
    cout << a[n-1] - a[0] << endl;
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
template<typename _T>
inline void read(_T &x) {
  x=0; bool fl=0; char ch=getchar();
  for(;!isdigit(ch) && ch!='-';ch=getchar());
  if(ch=='-') {fl=1; ch=getchar();}
  for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+(ch^48);
  if(fl) x=-x;
}
//===========================================================
const int N=1000010;
int n;
int head[N],nxt[N<<1],to[N<<1],lst=0;
inline void adde(int x,int y) {nxt[++lst]=head[x]; to[lst]=y; head[x]=lst;}
int in[N];
int col[N];
int ans=0;
int lef[N];
int f[N];
void DP(int u,int fr) {
  bool fl=0;
  for(int i=head[u];i;i=nxt[i])
    if(to[i]!=fr) {
      int v=to[i]; DP(v,u);
      lef[u]+=lef[v];
      f[u]+=f[v];
      fl|=lef[v]==1;
    }
  if(lef[u]<=1) f[u]=1,lef[u]=1;
  else f[u]-=fl;
}
signed main() {
  read(n);
  if(n==1) {puts("0"); return 0;}
  if(n==2) {puts("1"); return 0;}
  for(int i=1;i<n;i++) {
    int x,y; read(x); read(y); ++x; ++y;
    adde(x,y); adde(y,x);
    ++in[x]; ++in[y];
  }
  int rt=-1;
  for(int i=1;i<=n;i++) if(in[i]>2) {rt=i; break;}
  if(rt!=-1) {DP(rt,0); printf("%d\n",f[rt]);}
  else puts("1");
  //for(int i=1;i<=n;i++) printf("%d ",f[i]);
  return 0;
}

Measured memory_bytes: 18432
S=input()
n=0
s=0
w=0
e=0
for i in range(len(S)):
    if S[i]=="N":
        n+=1
    if S[i]=="S":
        s+=1
    if S[i]=="W":
        w+=1
    if S[i]=="E":
        e+=1

if n!=0 and s!=0 and w!=0 and e!=0 or n==0 and s==0 and w!=0 and e!=0 or n!=0 and s!=0 and w==0 and e==0:
    print("Yes")

else:
    print("No")
    


Measured memory_bytes: 9048
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a[] = new int [4];
    for(int i = 0;i<4;i++){
      a[i] = sc.nextInt();
    }
    int an = Math.max(a[0],a[2]),bn = Math.min(a[1],a[3]);
    int ans = bn - an;
    if(ans < 0){
      ans = 0;
    }
    System.out.println(ans);
  }
}


Measured memory_bytes: 23124
#pragma GCC target ("avx2")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>
#define int long long
#define double long double
#define mp make_pair
#define pb push_back
#define er erase
#define cl clear
#define sw swap
#define br break
#define ct continue
#define rt return
#define xx exit(0)
#define yy cout<<"Yes\n"
#define nn cout<<"No\n"
#define x first
#define y second
#define fo(i,a,b) for(int i=a;i<b;i++)
using namespace std;
struct st{
    
};
bool cmp(){
    return 1;
}
int go(){
    return 0;
}
void recur(){
    
}
void solve(){
    string s;
    cin>>s;
    int sum=0;
    for (int i=0; i<s.size(); i++){
        sum+=s[i]-'0';
    }
    if (sum%9==0) yy;
    else nn;
    
    
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    fo(i,0,t) solve();
}

Measured memory_bytes: 3744
def GCD(a, b):
    r = a % b
    while(r!=0):
        a = b
        b = r
        r = a % b
    
    return b

def main():
    ans = 0 
    K = int(input())
    for i in range(1, K+1):
        for j in range(1, K+1):

            if(i == 1 or j == 1):
                gcd1 = 1
            elif(i < j):
                gcd1 = GCD(j, i)
            else:
                gcd1 = GCD(i, j)
            for k in range(1, K+1):
                ans += GCD(gcd1, k)

    print(ans)



if __name__ == main():
    main()

Measured memory_bytes: 68572
#include<iostream>
#include<string>
#include<algorithm>
#include<string.h>
using namespace std;
#define ll long long 
int main()
{
	ll n;
	cin>>n;
	ll a[111111];
	for(int i=0;i<n+1;i++)
	{
		cin>>a[i];
	}
	ll sum=0;
	ll b;
	for(int i=0;i<n;i++)
	{
		cin>>b;
		if(b>=a[i])
		{
			sum+=a[i];
			b-=a[i];
			if(b>=a[i+1])
			{
				sum+=a[i+1];
				a[i+1]=0;
			}
			else
			{
				sum+=b;
				a[i+1]-=b;
			}
		}
		else
		{
			sum+=b;
		}
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 1024
//#include <bits/stdc++.h>
#include<iostream>
#include <cmath>
#include <math.h>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<ctype.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
//----------program from here----------

int ctoi(char c) {
  if('0'<=c && c <= '9') return c-'0';
  return 0;
}

int main(){
    int n=0;
    cin >> n;
    long long int a[n];
    for(int i=0;i<n;++i){
        cin >> a[i];
    }
    long long int mini=1000000000,maxi=0;
    for(int i=0;i<n;++i){
        mini = min(mini,a[i]);
        maxi = max(maxi,a[i]);
    }
    cout << maxi - mini;
    return 0;
}

Measured memory_bytes: 256
from numba import njit
import numpy as np
@njit
def dfs(v,c,h,stay):
    # hを更新
    x,y=divmod(v,n)
    for dx,dy in ((0,1),(0,-1),(1,0),(-1,0)):
        nx,ny=x+dx,y+dy
        if 0<=nx<n and 0<=ny<n:
            nv=nx*n+ny
            if h[nv]>c:
                h[nv]=c
                dfs(nv,c+stay[nv],h,stay)

@njit
def main(n,p):
    h=[min(i//n,n-i//n-1,i%n,n-i%n-1) for i in range(n**2)]
    h=np.array(h)
    stay=np.full(n**2,1)
    ans=0

    for v in p:
        c=h[v]
        ans+=c
        stay[v]=0
        dfs(v,c,h,stay)
    print(ans)

    #for i in range(n):
    #    print(h[i*n:(i+1)*n])
if __name__=='__main__':
    n=int(input())
    p=np.array(list(map(int,input().split())),np.int32)
    p-=1
    main(n,p)


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

# define y1 aasjdladljskdj

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef unsigned long long ull;

const int N = int(2e5) + 5;
const int inf = (int)1e9 + 7;

int n;
int cnt[2][N];
set < pii > s;

int main(){
  scanf("%d", &n);
  for(int i = 1; i <= n; ++i){
    int x;
    scanf("%d", &x);
    cnt[i % 2][x]++;
  }
  int ans = n + 1;
  for(int i = 1; i <= (int)2e5; ++i){
    s.insert(make_pair(cnt[0][i], i));
  }
  for(int i = 1; i <= (int)2e5; ++i){
    s.erase(make_pair(cnt[0][i], i));
    int t = s.rbegin() -> first;
    ans = min(ans, (n / 2 - t) + (n / 2 - cnt[1][i]));
    s.insert(make_pair(cnt[0][i], i));
  }
  printf("%d", ans);

  return 0;
}


Measured memory_bytes: 10368
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

debug = True
#debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    a = II()
    s = SI()

    if a >= 3200:
        print(s)
    else:
        print("red")

solve()

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

using namespace std;

using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m, x, y;
    cin >> n >> m >> x >> y;
    int xmax = -114514, ymin = 114514;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        xmax = max(xmax, a);
    }

    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        ymin = min(ymin, a);
    }

    cout << ((max(x, xmax) < min(y, ymin)) ? "No War" : "War") << endl;
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/perl

my ($k) = map { $_ - 0 } split(/\s+/,<STDIN>);
my ($a,$b) = map { $_ - 0 } split(/\s+/,<STDIN>);

for(my $i=1;$i<=1000;$i++){
  if( $a <= $k * $i and $k * $i <= $b ){
    print "OK\n";
    exit(0);
  }
}
print "NG\n";
exit(0);


Measured memory_bytes: 4824
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int M = scan.nextInt();
		String S = scan.next();
		String T = scan.next();

		if (S.charAt(0) != T.charAt(0)) {
			System.out.println(-1);
			return;
		}

		int g = gcd(N, M);
		if (g == 1) {
			System.out.println((long) M * N / g);
		} else {
			int n = N / g;
			int m = M / g;
			//System.out.println(S.charAt(m));
			//System.out.println(T.charAt(n));
			int i = 1;
			while (n < N && m < M) {
				if (S.charAt(n) != T.charAt(m)) {
					System.out.println(-1);
					return;
				}
				i++;
				n = (N / g) * i;
				m = (M / g) * i;
			}
			System.out.println((long) M * N / g);

		}

	}

	private static int gcd(int n, int m) {
		int r;
		while ((r = n % m) != 0) {
			n = m;
			m = r;
		}
		return m;
	}
}


Measured memory_bytes: 28496
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,-1,0,1,1,-1,1,-1,0};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

int main(){
    ll n;cin >> n;
    vl v(n);rep(i,n)cin >> v[i];
    vl ans;
    while(n--){
        per(i,v.size()){
            if(v[i]==i+1){
                ans.pb(v[i]);
                v.erase(v.begin()+i);
                break;
            }
        }
        if(v.size()>n)cout << -1 <<endl,exit(0);
    }
    rev(all(ans));
    for(auto p:ans)cout << p <<endl;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<ll,ll>;
#define For(i,a,b)  for(int i=a;i<=b;i++)
#define Forr(i,a,b) for(int i=a;i>=b;i--)
#define F first
#define S second
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define bpc __builtin_popcount
#define MOD (ll)(1e9+7)
#define INF (2e9)
#define EPS (1e-6)
#define NATHANLEE_IS_EVIL_AND_ELECTRIC true
#define int ll
#ifdef LOCAL_TEST
#define debug(...) do{\
	cerr<<__PRETTY_FUNCTION__<<" - "<<__LINE__<<\
	" : ("#__VA_ARGS__<<") = ";\
	_OUT(__VA_ARGS__);\
}while(0)
template<typename T>void _OUT(T x){cerr<<x<<"\n";}
template<typename T,typename...I>void _OUT(T x,I ...tail){cerr<<x<<", ";_OUT(tail...);}
#else
#define debug(...)
#endif
void INIT(){
#ifdef LOCAL_TEST
	freopen("D:\\input.in","r",stdin);
	freopen("D:\\output.out","w",stdout);
	freopen("D:\\error.out","w",stderr);
#endif
	ios::sync_with_stdio(!NATHANLEE_IS_EVIL_AND_ELECTRIC);
	cin.tie(0);
}

ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }
ll lcm(ll a,ll b) { return a/gcd(a,b)*b; }
ll fpow(ll b,ll p){
	b%=MOD;
	ll ans=1;
	while(p>0){
		if(p&1) ans=(ans*b)%MOD;
		p/=2;
		b=(b*b)%MOD;
	}
	return ans;
}

double pos[3010][3010]; //first i with j head

int32_t main() {
	INIT();
	//code...
	int n; cin>>n;
	memset(pos,0,sizeof(pos));
	pos[0][0]=1;
	For(i,1,n){
		double p; cin>>p;
		pos[i][0]=pos[i-1][0]*(1-p);
		For(j,1,n) pos[i][j]=pos[i-1][j]*(1-p)+pos[i-1][j-1]*p;
	}
	double ans=0;
	For(i,n/2+1,n) ans+=pos[n][i];
	cout<<fixed<<setprecision(15)<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 74592
k,n=map(int,input().split())
arr=list(map(int,input().split()))
arr.sort()
maxi=arr[n-1]-arr[0]
for i in range(n-1):
    if arr[i]+k-arr[i+1]<maxi:
        maxi=arr[i]+k-arr[i+1]
print(maxi)


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

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define MIN(a,b) ((a)>(b)? (b): (a))
#define MAX(a,b) ((a)<(b)? (b): (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

vector<pair<long long, long long>> prime_factorize(long long N)
{
    vector<pair<long long, long long>> res;
    for (long long a = 2; a * a <= N; ++a)
    {
        if (N % a != 0)
            continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける

        while (N % a == 0)
        {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1)
        res.push_back({N, 1});
    return res;
}

int main(){
    ll n;
    cin >> n;
    vector<pair<long long, long long>> fact;
    fact = prime_factorize(n);
    ll out = 0;
    rep(i, fact.size())
    {
        ll prime = fact[i].first;
        ll num = fact[i].second;
        ll minus = 1;
        while (num >= minus)
        {
            num -= minus;
            out ++;
            minus++;
        }
    }
    cout << out << endl;
    return 0;
}

Measured memory_bytes: 3632
fn main() {
    #[allow(unused_imports)]
    use std::io::{Read, Write, BufWriter};
    let mut a = Vec::new();
    std::io::stdin().read_to_end(&mut a).unwrap();
    let a = String::from_utf8(a).unwrap();
    let mut a = a.split_whitespace();
    #[allow(unused_mut,unused_variables)]
    let mut b = BufWriter::new(std::io::stdout());
    macro_rules! yomu { () => (a.next().unwrap().parse().unwrap()); ($t:ty) => (a.next().unwrap().parse::<$t>().unwrap())}
    #[allow(unused_macros)]
    macro_rules! kaku { ($($arg:tt)*) => (writeln!(b, $($arg)*).unwrap()) }
    #[allow(unused_imports)]
    use std::cmp::{min, max};

    let n: usize = yomu!();
    let mut a: Vec<i64> = vec![0; n];
    for i in 0..n {
        a[i] = yomu!(i64)*2;
    }
    let mut s = 0;
    for i in 0..n {
        if i % 2 == 0 {
            s += a[i];
        } else {
            s -= a[i];
        }
    }
    s /= 2;
    for i in 0..n {
        print!("{} ", s);
        s = a[i] - s;
    }
}


Measured memory_bytes: 7420
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;
// const int MOD = 998244353;

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

   ll a, v;
   ll b, w;
   ll t;
   cin >> a >> v >> b >> w >> t;
   ll da = a + v * t;
   ll db = b + w * t;
   ll da2 = a - v * t;
   ll db2 = b - w * t;
   if (a == b)
      cout << "YES" << endl;
   else if (a < b && da >= db)
      cout << "YES" << endl;
   else if(b < a && da2 <= db2)cout << "YES" << endl;
   else cout << "NO" << endl;
   return 0;
}

Measured memory_bytes: 3652
#include <algorithm>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

void OutputError(std::string s) {
  cerr << "\033[93m" << s << "\033[m" << endl;
  return;
}

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::string str;
  bool n = false, w = false, s = false, e = false;
  cin >> str;
  for (auto x : str) {
    if (x == 'N') n = true;
    if (x == 'W') w = true;
    if (x == 'S') s = true;
    if (x == 'E') e = true;
  }
  if (n == s && w == e)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;

  return 0;
}


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

int main(){
	long long n;
	cin >> n;
	long long result=1;
	while(n>0){
		if(n%((long long)1e9+7)==0) cout << n;
		result = result*n;
		result = result%((long long) 1e9+7);
		n--;
	}
	cout << result;
}


Measured memory_bytes: 256
import math
from functools import reduce
n = int(input())
A = list(map(int,input().split()))

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
  return reduce(lcm_base, numbers, 1)

ans = 0
lcm = lcm(*A)

for a in A:
  ans += (lcm-1) % a
print(ans)

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

int main(){
  double n,m,d,ans;
  cin >> n >> m >> d;
  ans=0;
  if(d != 0){
    for(int i=0;i<m-1;i++){
      ans+=(2*(n-d))/(n*n);
    }
  }
  else{
   for(int i=0;i<m-1;i++){
      ans+=(n-d)/(n*n);
    }
  }
  cout<<fixed<<setprecision(20)<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdio>
#define FOR(i,l,r) for(int (i) = (l); (i) <= (r); (i)++)
using namespace std;

int main(){
#ifdef __APPLE__
	freopen("main.in","r",stdin);
#endif
	char a,b;
	scanf(" %c%c",&a,&b);
	if(a == '9' || b == '9') puts("Yes");
	else puts("No");
	return 0;
}


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


int main()
{   
    long long n,m;
    cin>>n;
    m=n-1;
    for(long long i=1;i*i<=n;i++)
        if(n%i==0)
            m=min(m,i+n/i-2);
        
    cout<<m;

    return 0;
}

Measured memory_bytes: 768
import sys
n,a,b,c = map(int, input().split())

s = list()
for i in range(n):
    s.append(input())

r = list()

for i in range(n):
    if s[i]=='AB':
        if a>b:
            r.append('B')
            a=a-1
            b=b+1
        elif a<b:
            r.append('A')
            a=a+1
            b=b-1
        else:
            if i==n-1 or 'A' in s[i+1]:
                r.append('A')
                a=a+1
                b=b-1
            else: 
                r.append('B')
                a=a-1
                b=b+1
    elif s[i]=='AC':
        if a>c:
            r.append('C')
            a=a-1
            c=c+1
        elif a<c:
            r.append('A')
            a=a+1
            c=c-1
        else:
            if i==n-1 or 'A' in s[i+1]:
                r.append('A')
                a=a+1
                c=c-1
            else: 
                r.append('C')
                a=a-1
                c=c+1
    else:
        if b>c:
            r.append('C')
            b=b-1
            c=c+1
        elif b<c:
            r.append('B')
            b=b+1
            c=c-1
        else:
            if i==n-1 or 'B' in s[i+1]:
                r.append('B')
                b=b+1
                c=c-1
            else: 
                r.append('C')
                b=b-1
                c=c+1
    if min(a,b,c)<0:
        print('No')
        sys.exit()


print('Yes')
for str in r:
    print(str)


Measured memory_bytes: 17052
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define MP make_pair
#define PB push_back
#define ll long long
#define int long long
#define f(i,x,n) for(int i=x;i<n;i++)
#define ld long double
const int mod=998244353;
const int INF=1e18;
int n,s;
int a[3005];
int dp[3005][3005][2];
int dfs(int i,int j,int state)
{
    if(j>s)
        return 0;
    int &an=dp[i][j][state];
    if(an!=-1)
        return an;
    if(j==s)
    {
        if(state==1)
            return an=(n-i+1);
        else
            return an=0;
    }
    if(i==n)
    {
        return an=0;
    }
    return an=(dfs(i+1,j,0)+dfs(i+1,j+a[i],1))%mod;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    f(i,0,3005)
        f(j,0,3005)
            f(k,0,2)
                dp[i][j][k]=-1;
    cin>>n>>s;
    f(i,0,n)
        cin>>a[i];
    int ans=0;
    f(i,0,n)
    {
        ans=(ans+(i+1)*dfs(i+1,a[i],1))%mod;
    }
    cout<<ans<<'\n';
    return 0;
}

Measured memory_bytes: 141568
from math import floor, ceil


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

x = sum(A) / n
if abs(floor(x) - x) < abs(ceil(x) - x):
    x = floor(x)
else:
    x = ceil(x)

answer = 0
for a in A:
    answer += (a - x)**2

print(answer)


Measured memory_bytes: 3060
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
from bisect import bisect_left, bisect_right
import random
from itertools import permutations, accumulate, combinations
import sys
import string



INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


n = I()
D =LI()
ret = 0
for i in range(n):
    for j in range(i + 1, n):
        ret += D[i] * D[j]


print(ret)

Measured memory_bytes: 41328
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
int n,ans;
vector<bool> prime(102,1);
int32_t main()
{
	#ifndef ONLINE_JUDGE
		freopen("in","r",stdin);
		freopen("out","w",stdout);
	#endif
	prime[0]=prime[1]=0;
	for(int i=2;i<=100;i++)
	{
		if(!prime[i])continue;
		for(int j=i*i;j<=100;j+=i)prime[j]=0;

	}
	vector<int> p;
	cin>>n;
	for(int i=0;i<=n;i++)
	{
		if(prime[i])p.push_back(i);
	}
	vector<int> pw;
	for(auto u:p)
	{
		int t=n;int cur=0;
		while(t)
		{
			cur+=t/u;
			t/=u;
		}
		pw.push_back(cur+1);
	}

	vector<int> a(76);
	for(auto i:pw)
	{
		if(i>=75)a[75]++;
		if(i>=25)a[25]++;
		if(i>=15)a[15]++;
		if(i>=5)a[5]++;
		if(i>=3)a[3]++;
	}


	int ans=(a[75]+(a[25])*(a[3]-1)+(a[15]*(a[5]-1))+(a[5])*(a[5]-1)*(a[3]-2)/2);
	cout<<ans;

}


Measured memory_bytes: 3624
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<cstring>
#include<queue>
#include<stack>
#include<numeric>
using namespace std;
#define INF (1 << 30) - 1
#define LINF 1LL << 60
const int MOD = 1000000007;
using ll = long long;
using P = pair<int, int>;

vector<vector<ll>> dp;

int main(){
  int n, m;
  cin >> n >> m;
  dp.assign(n, vector<ll>(n, LINF));
  for(int i = 0; i < n; ++i)dp[i][i] = 0;
  for(int i = 0; i < m; ++i){
    int s, t;
    ll d;
    cin >> s >> t >> d;
    dp[s][t] = d;
  }

  for(int k = 0; k < n; ++k){
    for(int i = 0; i < n; ++i){
      for(int j = 0; j < n; ++j){
        if(dp[i][k] == LINF || dp[k][j] == LINF)continue;
        dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
      }
    }
  }

  for(int i = 0; i < n; ++i){
    if(dp[i][i] < 0){
      cout << "NEGATIVE CYCLE" << endl;
      return 0;
    }
  }

  for(int i = 0; i < n; ++i){
    for(int j = 0; j < n; ++j){
      if(dp[i][j] == LINF)cout << "INF";
      else cout << dp[i][j];
      if(j < n - 1)cout << " ";
    }
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3228
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    let n: usize = s.trim().parse().unwrap();

    let x = input();
    let y = input();

    let mut ans1: f64 = 0.0;
    for i in 0..n {
        ans1 += (x[i] - y[i]).abs();
    }

    let mut ans2: f64 = 0.0;
    for i in 0..n {
        ans2 += (x[i] - y[i]).powf(2.0);
    }
    ans2 = ans2.sqrt();

    let mut ans3: f64 = 0.0;
    for i in 0..n {
        ans3 += (x[i] - y[i]).abs().powf(3.0);
    }
    ans3 = ans3.cbrt();

    let mut ans4: f64 = 0.0;
    for i in 0..n {
        ans4 = if (x[i] - y[i]).abs() > ans4 {
            (x[i] - y[i]).abs()
        } else {
            ans4
        };
    }

    println!("{}\n{}\n{}\n{}", ans1, ans2, ans3, ans4);
}

fn input() -> Vec<f64> {
   let mut s = String::new();
   std::io::stdin().read_line(&mut s).unwrap();

   let v: Vec<f64> = s.trim().split_whitespace().map(|x| x.parse().unwrap()).collect::<_>();

   v
}



Measured memory_bytes: 5220
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, Y;
  cin >> N >> Y;

  for (int _1000 = 0; _1000 <= N; _1000++) {
    for (int _5000 = 0; _5000 <= N - _1000; _5000++) {
      int _10000 = N - (_1000 + _5000);
      if (_1000 * 1000 + _5000 * 5000 + _10000 * 10000 == Y) {
        cout << _10000 << " " << _5000 << " " << _1000 << endl;
        return 0;
      }
    }
  }

  cout << "-1 -1 -1" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
#define N 500005
#define mod 998244353
#define ll long long
ll Pow(ll a, ll b)
{
	ll ans = 1;
	while (b)
	{
		if (b & 1)
			ans = ans * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return ans;
}
int n, m, ans;
int fac[N], inv[N];
void Init(int n)
{
	fac[0] = 1;
	for (int i = 1; i <= n; i++)
		fac[i] = 1ll * fac[i - 1] * i % mod;
	inv[n] = Pow(fac[n], mod - 2);
	for (int i = n - 1; i >= 0; i--)
		inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
}
int C(int n, int m)
{
	if (n < 0 || m < 0 || m > n)
		return 0;
	return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main()
{
	scanf("%d%d", &n, &m);
	if (n < m) swap(n, m);
	Init(n);
	for (int k = 0; k <= m; ++k)
	{
		ans += 1ll * Pow(-1, k) * C(n, k) % mod * C(m, k) % mod * fac[k] % mod * Pow(m + 1, n - k) % mod * Pow(n + 1, m - k) % mod;
		ans = (ans % mod + mod) % mod;
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 7712
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int mod_) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod_;
		}
		x = x * x % mod_;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}
/*--------Library Zone!--------*/

int n;
signed main() {
	set<int>st;
	cin >> n;
	rep(i, n) {
		int a; cin >> a;
		st.insert(a);
	}
	if (st.size() % 2)cout << st.size() << endl;
	else cout << st.size() - 1 << endl;
}


Measured memory_bytes: 4992
#include <iostream>
#include <algorithm>
#include <string>

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()

using namespace std;

int main() {
    string S;
    cin >> S;
    cout << 700 + 100 * count(ALL(S), 'o') << endl;
    return 0;
}

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

int main()
{
    ll a, b, x;
    scanf("%lld %lld %lld", &a, &b, &x);

    ll cnt1 = a/x;
    ll cnt2 = b/x;

    if(a%x==0) cout << cnt2-cnt1 + 1<<endl;
    else cout << cnt2 - cnt1 <<endl;

    return 0;
}


Measured memory_bytes: 256
s=input()
a=int(s[0:2])
b=int(s[2:])
if 1<=a<=12 and 1<=b<=12:
    print('AMBIGUOUS')
elif 1<=b<=12:
    print('YYMM')
elif 1<=a<=12:
    print('MMYY')
else:
    print('NA')

Measured memory_bytes: 9112
mod=11
n,k=map(int,raw_input().split())
k=(k-8)%mod
last=7*n-7*2-2
idx=-1
for i in xrange(1,last+1):
    if 3*(i+i+1+i+2)%mod==k:
        idx=i
        break
r2idx=r1idx=-1
for i in xrange(1,n+1):
    if (7*i-1-idx)%11==0:
        r2idx=7*i-1
        break
for i in xrange(1,n+1):
    if (7*i-idx)%11==0:
        r1idx=7*i
        break
if idx==-1:
    print(0)
    exit()
if r1idx==-1:
    if r2idx==-1:
        print((last-idx)/11+1)
    else:
        print((last-idx)/11+1-(last-r2idx)/(7*11)-1)
else:
    if r2idx==-1:
        print((last-idx)/11+1-(last-r1idx)/(7*11)-1)
    else:
        print((last-idx)/11+1-(last-r2idx)/(7*11)-1-(last-r1idx)/(7*11)-1)

#print r1idx,r2idx,idx
#print((last-idx)/11+1-(last-r2idx)/(n*11)-1-(last-r1idx)/(n*11)-1)


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

int q, a, b, c, d, num, x[100005], y[100005];
string s, t;
int main() {
	int i;
	cin >> s >> t >> q;
	for(i=0; s[i]; i++) x[i+1] = x[i] + s[i]-'A' + 1;
	for(i=0; t[i]; i++) y[i+1] = y[i] + t[i]-'A' + 1;
	while(q--) {
		scanf("%d%d%d%d", &a, &b, &c, &d);
		num = (x[b] - x[a-1] - y[d] + y[c-1] + 300000) % 3;
		puts(num ? "NO" : "YES");
	}
	return 0;
}

Measured memory_bytes: 1664
/*input
12
757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604
74164189 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212
*/
#include<bits/stdc++.h>
using namespace std;

#define int long long 
#define double long double
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define RE(i,n) for (int i = 1; i <= n; i++)
#define RED(i,n) for (int i = n; i > 0; i--)
#define REPS(i,n) for(int i = 1; (i*i) <= n; i++)
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define mii map<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define WL(t) while(t --)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define print(arr) for (auto it = arr.begin(); it != arr.end(); ++it) cout << *it << " "; cout << endl;
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;
const int INF = 1e18+1;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;

int fast_ex(int a,int n,int m){
  if(n == 0)return 1;
  if(n == 1)return a;
  int x = 1;
    x *= fast_ex(a,n/2,m);
    x %= m;
    x *= x;
    x %= m;
    if(n%2)x*= a;
    x %= m;
    return x;
}

int n;
const int N = 1e5+1;
int a[N];
int b[N];
int x[N];

bool comp(int i,int j){
	 return (a[i]-b[i]) > (a[j]-b[j]);
}

bool check(int y){
	 int extra = 0;
	 int ind = y;
	 REP(i,y){
	 	 if(a[x[i]] < b[x[i]]){ind = i;break;}
         extra += a[x[i]]-b[x[i]];
	 }
	 //cout << extra << endl;
	 int extrahah = 0;
	 FOR(i,ind,n){
	 	if(b[x[i]]>a[x[i]])extrahah += b[x[i]]-a[x[i]];
	 }
	 return (extra >= extrahah);
}

void solve(){
	 cin >> n;
	 REP(i,n){
	 	cin >> a[i];
	 	x[i] = i;
	 }
	 REP(i,n)cin >> b[i];
	 sort(x,x+n,comp);
	 int inneed = 0;
	 REP(i,n){
	 	if(a[i] < b[i])inneed++;
	 }
     int lo = 0;
     int hi = n-1;
     while(lo < hi){
     	int mid = (lo+hi)/2;
     	if(check(mid))hi = mid;
     	else lo = mid+1;
     }
     if(!check(lo))cout << -1;
     else cout << lo+inneed;
}

signed main(){
  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  //freopen(".in","r",stdin);freopen(".out","w",stdout);
  int t = 1;//cin >> t;
  WL(t)solve();
  return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define PI atan(1)*4
typedef long long int ll;
using namespace std;
int a[200005];
int main(){
	io;
    int r;
    cin >> r;
    double ans = 2*PI*r;
    cout << ans;
    return 0;
} 

Measured memory_bytes: 3804