akhauriyash/Code-Regression huggingface dataset:
//#pragma comment(linker, "/stack:200000000")

#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

#define int long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define ret(a) return cout<<a,0;
using namespace std;
typedef pair < int , int > pii ;
typedef pair < long long  , long long > pll ;
const int N = 2e5 + 123 ;
int n , c , x[N] , v[N] , dpc[N] , dpcc[N];
int dp[N] , ans = 0;
#define distc asfadfd
int distc(int x1 , int x2){
	return (x2 - x1 + c) % c;
}

main(){
	ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
	cin >> n >> c;
	for(int i = 1 ; i <= n ; i++)
		cin >> x[i] >> v[i];
	for(int i = 1 ; i <= n ; i++){
		dpc[i] = dpc[i - 1] + v[i] - distc(x[i - 1] , x[i]);
		ans = max(ans , dpc[i]);
	}
	multiset < int > st;
	for(int i = n ; i >= 1 ; i--){
		dpcc[i] = dpcc[i + 1] + v[i]  - distc(x[i] , x[i + 1]);
		ans = max(ans , dpcc[i]);
		st.insert(dpcc[i]);
	}
	st.insert(0);
	for(int i = 1 ; i <= n ; i++){
		st.erase(st.find(dpcc[i]));
		ans = max(ans , dpc[i] - x[i] + (int)(*st.rbegin()));
	}
	for(int i = n ; i >= 1 ; i--){
	 	st.insert(dpc[i]);
	}
	for(int i = n ; i >= 1 ; i--){
		st.erase(st.find(dpc[i]));		
		ans = max(ans , dpcc[i] - (c - x[i]) + (int)(*st.rbegin()) );
	}
	cout << ans;
	

}

Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD 1000000007
#define INF 1000000000000000
#define fi first
#define se second
#define all(v) v.begin(),v.end()
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
struct edge{int to,cost;};
typedef pair<int,int> P;
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
bool prime(int a){
	if(a==1)return false;
	for(int i=2;i*i<=a;i++){
		if(a%i==0)return false;
	}
	return true;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){//線分の交差判定
	double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
	double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
	double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
	double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
	return tc*td<0&&ta*tb<0;
}
int kaijo(int n){
	int ans=1;
	for(int i=2;i<=n;i++){
		ans*=i;
		ans%=MOD;
	}
	return ans;
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	return modpow(a,b/2)*modpow(a,b/2)%MOD;
}
int comb(int a,int b){
	return kaijo(a)*modpow(kaijo(a-b),MOD-2)%MOD*modpow(kaijo(b),MOD-2)%MOD;
}
int h,w,K,dp[110][10];
signed main(){
	cin>>h>>w>>K;
	dp[0][0]=1;
	rep(i,h){
		rep(j,w)dp[i][j]%=MOD;
		rep(j,(1<<(w-1))){
			rep(k,w-2)if(((j>>k)&1)&&(j>>(k+1)&1))goto no;
			rep(k,w){
				if(k&&((j>>(k-1))&1))dp[i+1][k-1]+=dp[i][k];
				else if(k!=w-1&&((j>>k)&1))dp[i+1][k+1]+=dp[i][k];
				else dp[i+1][k]+=dp[i][k];
			}
			no:;
		}
	}
	cout<<dp[h][K-1]%MOD<<endl;
	return 0;
}


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

int main(){
  int K,A,B;
  cin >> K >> A >> B;
  
  bool ans = false;
  for(int i=A;i<=B;i++){
    if(i%K == 0){
      ans = true;
      break;
    }
  }
  if(ans){
    cout << "OK" << endl;
  }else{
    cout << "NG" << endl;
  }
  return 0;
}

Measured memory_bytes: 3636
n = int(input())
a_lis = list(map(int, input().split()))
all_sum = sum(a_lis)
half_sum = all_sum // 2
tmp_sum = 0
i = 0
while tmp_sum < half_sum:
    tmp_sum += a_lis[i]
    i += 1    
sep = i - 1
if sep == n:
    print(a_lis[-1] - sum(a_lis[:-1]))
else:
    print(min(tmp_sum - (all_sum - tmp_sum), all_sum - (tmp_sum - a_lis[sep])- (tmp_sum - a_lis[sep])))

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

int main(){
	while(true){
		int n,m,p,sum = 0;
		cin >> n >> m >> p;
		if(n == 0) return 0;
		int a[105] = {0};
		for(int i = 1; i <= n; i++){
			cin >> a[i];
			sum += a[i];
		}
		int pr = sum * (100-p);
		if(a[m] != 0) cout<<pr / a[m] <<endl;
		else cout<<"0"<<endl;
	}
}


Measured memory_bytes: 3056
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define ep emplace_back
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(v) v.begin(), v.end()
#define revall(v) v.rbegin(), v.rend()
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){ if(y<h && y>=0 && x<w && x>=0) return true; return false; }
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(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a.at(i);
	vector<int> b(n);
	if(n % 2 == 1){
		int j = 0;
		for(int i = n / 2; i >= 0; i--){
			b.at(i) = a.at(j);
			j += 2;
		}
		j = 1;
		for(int i = n / 2 + 1; i < n; i++){
			b.at(i) = a.at(j);
			j += 2;
		}
	}
	else{
		int j = 1;
		for(int i = n / 2 - 1; i >= 0; i--){
			b.at(i) = a.at(j);
			j += 2;
		}
		j = 0;
		for(int i = n / 2; i < n; i++){
			b.at(i) = a.at(j);
			j += 2;
		}
	}
	rep(i,n){
		if(i == n - 1) cout << b.at(i) << endl;
		else cout << b.at(i) << " ";
	}
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
ll a,b,c;
  cin>>a>>b>>c;
  if(a==b&&b!=c){
    cout<<"Yes"<<endl;
  }
  else if(c==b&&b!=a){
    cout<<"Yes"<<endl;
  }
  else if(a==c&&b!=c){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 3624
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <cmath>
#include <math.h>
#include <string>
#include <time.h>
#include <random>
#include <memory.h>
#include <bitset>
using namespace std;

#define FILE0
#define MAGIC0
mt19937 rnd(time(0)); //rnd()

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mii map<int, int>
#define mll map<ll, ll>
#define msl map<string, ll>
#define mls map<ll, string>
#define MOD (1000000007ll)
#define MOD2 (1000000009ll)
#define BIGMOD (1000000000000000007ll)
#define RMOD int(5e8 + rnd() % (int) 5e8)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#ifdef FILE1
ifstream in("input.txt");
ofstream out("output.txt");
#endif
#ifdef MAGIC1
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#endif

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

bool isPalindrom(const string &s, int l, int r)
{
	for (int i = 0; i < (r - l + 1) / 2; i++)
	{
		if (s[l + i] != s[r - i])
		{
			return 0;
		}
	}
	return 1;
}

template <class type1> type1 gcd(type1 a, type1 b)
{
	type1 t;
	while (b)
	{
		t = b;
		b = a%b;
		a = t;
	}
	return a;
}

ll positiveMod(ll v, ll md)
{
	v = v%md;
	if (v < 0)
	{
		v += md;
	}
	return v;
}

//-----------------------------------------------------end--------------------------------------//

map <int, vector<int> > inf;
vector <int> dat;
vector <int> mx;


int main()
{
	fast;

	int n, t, a, b, c, d, i, j, mxDif = 0, res = 0;

	cin >> n >> t;
	for (i = 0; i < n; i++)
	{
		cin >> a;
		dat.push_back(a);

		inf[a].push_back(i);
	}

	mx.resize(n);
	mx[n - 1] = dat[n - 1];
	for (i = n - 2; i >= 0; i--)
	{
		mx[i] = max(mx[i + 1], dat[i]);
	}

	for (i = 0; i < n - 1; i++)
	{
		mxDif = max(mxDif, mx[i + 1] - dat[i]);
	}

	for (auto& it : inf)
	{
		int aa = it.first, bb = it.first + mxDif, tn;
		vector <pii> totalInf;

		if (inf[bb].size() == 0)
		{
			inf.erase(inf.find(bb));

			continue;
		}

		for (auto& itt : it.second)
		{
			totalInf.push_back({ itt, aa });
		}
		for (auto& itt : inf[bb])
		{
			totalInf.push_back({ itt, bb });
		}

		sort(totalInf.begin(), totalInf.end());

		int tr = 0;
		vector <int> pr(totalInf.size()), sf(totalInf.size());

		tn = totalInf.size();

		pr[0] = 0;
		if (totalInf[0].second == aa)
		{
			pr[0]++;
		}
		for (i = 1; i < totalInf.size(); i++)
		{
			pr[i] = pr[i - 1];
			if (totalInf[i].second == aa)
			{
				pr[i]++;
			}
		}

		sf[tn - 1] = 0;
		if (totalInf[tn - 1].second == bb)
		{
			sf[tn - 1]++;
		}
		for (i = tn - 2; i >= 0; i--)
		{
			sf[i] = sf[i + 1];
			if (totalInf[i].second == bb)
			{
				sf[i]++;
			}
		}

		tr = min(pr.back(), sf[0]);
		for (i = 0; i < tn - 1; i++)
		{
			tr = min(tr, pr[i] + sf[i + 1]);
		}

		res += tr;
	}

	cout << res;

	return 0;
}

Measured memory_bytes: 12024
W, H, x, y, r = [int(x) for x in input().split()]
if (0 <= x-r <= W) and (0 <= x+r <= W):
    if(0 <= y-r <= H) and (0 <= y+r <= H):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Measured memory_bytes: 7740
#include<iostream>
#include<cmath> 
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	int ans=-1;
	for(int i=1;floor(i*0.08)<=min(a,b);i++){
		if(floor(i*0.08)==a&&floor(i*0.1)==b){
			ans=i;
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

#define ll long long int
#define endl '\n'

void solve()
{
    ll n;
    cin>>n;
    ll a,b,ans=0,maxi=0;
    while(n--)
    {
    	cin>>a>>b;
    	if(a==b)
    	{
    		maxi++;
    	}
    	else
    	{
    		ans = max(ans,maxi);
    		maxi=0;
    	}
    	//cout<<"Maxi: "<<maxi<<endl;
    }
    ans = max(ans,maxi);
    if(ans>=3)
    	cout<<"Yes"<<endl;
    else
    	cout<<"No"<<endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    #ifdef JAY
        freopen("C:/Users/jayra/Desktop/cp/input.txt","r",stdin);
        freopen("C:/Users/jayra/Desktop/cp/output.txt","w",stdout);
    #endif

    int t=1;
    while(t--) {
        solve();
   }
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

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

    if (n >= m) {
        cout << 0 << endl;
        ret();
    }

    vector<ll> pins(m);
    rep(i, m)cin >> pins[i];
    sort(pins.begin(), pins.end());
    ll from = pins.back() - pins.front();

    vector<ll> sub;
    rep(i, m - 1) sub.push_back(pins[i + 1] - pins[i]);
    sort(sub.rbegin(), sub.rend());
    ll s = accumulate(sub.begin(), sub.begin() + n - 1, 0ll);
    ll ans = from - s;
    cout << ans << endl;
}


Measured memory_bytes: 5032
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        double[] p = new double[N];
        for (int i = 0; i < N; i++) {
            p[i] = sc.nextDouble();
        }

        double[] calc = new double[N-(K-1)];

        double tmp =0;
        for (int i = 0; i < K; i++) {
            tmp += expe(p[i]);
        }
        calc[0] = tmp;

        for (int i = 1; i < calc.length; i++) {
            calc[i] = calc[i-1] + expe(p[i+K-1]) - expe(p[i-1]);
        }

        Arrays.sort(calc);
        System.out.println(calc[calc.length-1]);
    }

    static double expe(double n){
        return (n+1)/2;
    }
}


Measured memory_bytes: 160532
#include <iostream>
#include <set>

int main(int argc, char *argv[]) {
	int paint_id;
	std::set<int> ids;

	while (1) {
		std::cin >> paint_id;
		ids.insert(paint_id);
		if (std::cin.eof()) {
			break;
		}
	}

	std::cout << ids.size() << std::endl;
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

func intMin(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func intMax(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	N, K := scanInt(), scanInt()
	V := make([]int, N)
	for i := 0; i < N; i++ {
		V[i] = scanInt()
	}

	ans := 0

	for ab := 0; ab <= intMin(K, N); ab++ {
		for a := 0; a <= ab; a++ {
			b := ab - a
			L := make([]int, ab)

			L = append(L, V[:a]...)
			L = append(L, V[N-b:]...)
			sort.Ints(L)

			tmp := 0
			for i, l := range L {
				if i >= (K-ab) || l >= 0 {
					tmp += l
				}
			}
			ans = intMax(ans, tmp)
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1792
#include <stdio.h>

int main(void)
{
  int a, b, c, d, e, f;
  scanf("%d %d %d", &a, &b, &c);
  if(a < b && c < b){
    f = b;
     if(a < c){
       d = a; e = c;
     } else {
       d = c; e = a;
     }
  } else if(a < c && b < c){
    f = c;
     if(a < b){
       d = a; e = b;
     } else {
       d = b; e = a;
     }
  } else {
    f = a;
     if(b > c){
       d = c; e = b;
     } else {
       d = b; e = c;
     }
  }
    printf("%d %d %d\n", d, e, f);
  return 0;
}

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

using namespace std;

typedef long long ll;

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

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

int main(void) {
    string s;
    cin >> s;

    map<char, int> m;
    char a;
    for (int i = 0; i < (int) s.size(); i++) {
        m[s[i]]++;
        a = s[i];
    }

    if ((int) m.size() != 2) {
        cout << "No" << endl;
        return 0;
    }
    if (m[a] != 2) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    return 0;
}


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

using namespace std ;

const int MAX = 1e5 + 10 ;

int arr[MAX] ;
long long n , k ;

int main()
{
	ios_base::sync_with_stdio(0) ;
	cin.tie(0) ;
	cin>>n>>k ;
	n -= n / k * k  ;
	return cout<<min(n , k-n)<<"\n" , 0 ;
}		

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

int main() {
    int r, g, b, n; cin >> r >> g >> b >> n;
    int ans = 0;

    rep (i, n+1) {
        if (r*i > n) continue;

        rep (j, n+1) {
            if (r*i + g*j > n) continue;
            if ((n - r*i - g*j) % b == 0) ans++;
            // rep (k, n+1) {
            //     if (r*i + g*j + b*k == n) {
            //         // cout << i << ", " << j << ", " << k << endl;
            //         ans++;
            //     }

            //     if (r*i + g*j + b*k > n) {
            //         continue;
            //     }
            // }
        }
    }

    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).rbegin(), (x).rend())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
#define SP << " " <<
template <class T> bool maxi(T &a, const T &b) {
    if (a < b) { a = b; return 1;} return 0;}
template <class T> bool mini(T &a, const T &b) {
    if (b < a) { a = b; return 1;} return 0;}
#define dame {cout<< "-1" <<"\n"; return;}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
using namespace std;
using ll = long long;
using ld = long double;
using P  = pair<ll,ll>;
//--GLOBAL---------------------------------

//--MAIN-----------------------------------
void Main() {
    ll N,M;
    cin>>N>>M;
    vector<ll> A(N);
    rep(i,N) cin>>A[i];
    ll sum=0;
    rep(i,N) sum+=A[i];
    ll ct=0;
    rep(i,N){
        if(A[i]*M*4>=sum) ++ct;
    }
    cout<< ( ct>=M ? "Yes" : "No" )<<"\n";

}

//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------


Measured memory_bytes: 256
#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<map>
#include<utility>
#include<algorithm>
using namespace std;

int main(void)
{
	int N, K;
	cin >> N >> K;

	vector<int> A(N);
	for(int i=0; i<N; i++)
		cin >> A[i];

	map<int, int> mp;
	for(int i=0; i<N; i++)
		mp[A[i]]++;

	vector<int> table;
	for(auto it=mp.begin(); it!=mp.end(); it++)
		table.push_back(it->second);

	sort(table.begin(), table.end());

	int ret = 0;
	for(int i=0; i<(int)table.size()-K; i++)
		ret += table[i];

	cout << ret << endl;

	return 0;
}


Measured memory_bytes: 11516
N, T = map(int, input().split())
A = list(map(int, input().split()))

# i番目の町以降の取引金額の最大値
# 末尾はダミー
righter_max = [0] * (N+1)
for i, a in enumerate(A[::-1], 2):
  righter_max[-i] = righter_max[-i+1]
  if righter_max[-i] < a:
    righter_max[-i] = a

ans = 0
max_profit = 0
for i, a in enumerate(A, 1):
  profit = righter_max[i] - a
  if profit == max_profit:
    ans += 1
  elif profit > max_profit:
    max_profit = profit
    ans = 1

print(ans)

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

using namespace std;

int main() {

	int n;
	cin >> n;

	vector<int> res(10001);

	for (int x = 1; x <= 100; x++) {
		for (int y = 1; y <= 100; y++) {
			for (int z = 1; z <= 100; z++) {

				if (x*x + y * y + z * z + x * y + y * z + z * x <= n) {
					res[x*x + y * y + z * z + x * y + y * z + z * x]++;
				}
			}
		}
	}

	for (int i = 1; i <= n; i++) {
		cout << res[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 3584
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int main(void) {
  ios::sync_with_stdio(false);
  int64_t N;
  cin >> N;
  string answer;
  do {
    answer += 'a' + ((N - 1) % 26);
    N = (N - 1) / 26;
  } while (N);
  reverse(answer.begin(), answer.end());
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 3652
n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]

ans = 0
for i in xy:
    for j in xy:
        ans += ((i[0] - j[0]) ** 2 + (i[1] - j[1]) ** 2) ** 0.5

print(ans/n)


Measured memory_bytes: 3188
n,a,b,c,d=map(int,input().split())

if n%a==0:
    x=(n//a)*b
else:
    x=((n//a)+1)*b
if n%c==0:
    y=(n//c)*d
else:
    y=((n//c)+1)*d
    
if x>y:
    print(y)
else:
    print(x)


Measured memory_bytes: 5596
#include <bits/stdc++.h>
#define FOR(i, k, n) for(int i = (k); i < (n); i++)
#define FORe(i, k, n) for(int i = (k); i <= (n); i++)
#define FORr(i, k, n) for(int i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(int i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;

struct UnionFind{
  vector<int> par;
  UnionFind(int n) : par(n, -1){}
  int root(int x){ return (par[x] < 0) ? x : par[x] = root(par[x]); }
  int size(int x){ return -par[root(x)]; }
  bool issame(int x, int y){ return root(x) == root(y); }
  void marge(int x, int y){
    x = root(x); y = root(y);
    if(x == y) return;
    if(x > y) swap(x, y);
    par[x] += par[y];
    par[y] = x;
  }
};

int main(void){
  ll n, m;
  cin >> n >> m;
  UnionFind uf(n);
  vector<P> bridges(m);
  REP(i, m){
    int a, b;
    cin >> a >> b;
    a--; b--;
    bridges[i] = P(a, b);
  }

  vector<ll> ans(m);
  ll cur = n*(n-1)/2;
  FORre(i, m, 0){
    ans[i] = cur;
    int a = bridges[i].first;
    int b = bridges[i].second;
    if(uf.issame(a, b)) continue;
    ll sa = uf.size(a);
    ll sb = uf.size(b);
    cur -= sa * sb;
    uf.marge(a, b);
  }
  REP(i, m) cout << ans[i] << endl;
  return 0;
}

Measured memory_bytes: 3328
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
	double a,b,c,d,e,f;
	while(cin>>a>>b>>c>>d>>e>>f){
		double anx=0,any=0;
		if((c*e-f*b)!=0 && (a*e-d*b)!=0){
			anx=(c*e-f*b)/(a*e-d*b);
		}
		if((c*d-f*a)!=0 && (b*d-e*a)!=0){
			any=(c*d-f*a)/(b*d-e*a);
		}
		printf("%.3f ",anx);
		printf("%.3f\n",any);
	}
	return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<string> s(N);

    rep(i,N){
        cin >> s.at(i);
    }

    int M;
    cin >> M;
    vector<string> t(M);
    rep(i,M){
        cin >> t.at(i);
    }

    int max_score = 0;
    rep(i,N){
        string cand = s.at(i);
        int score = 0;
        rep(j,N){
            if (s.at(j) == cand){
                score++;
            }
        }
        rep(j,M){
            if (t.at(j) == cand){
                score--;
            }
        }
        if (score > max_score){
            max_score = score;
        }
    }
    cout << max_score << endl;
}

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

const int N = 1e5 + 10;
typedef long long LL;

LL a[N] , sum[N];
bool cmp(LL a , LL b )
{
    return a > b;
}
int main()
{
    int n;
    scanf("%d",&n);
    for(int i = 1 ; i <= n ; i++) scanf("%I64d",&a[i]);
    sort(a + 1 , a + 1 + n);
    sum[1] = a[1];
    for(int i = 2 ; i <= n ; i++) sum[i] = sum[i - 1] + a[i];
    int ans = 1;
    for(int i = n ; i >= 1 ; i--){
        //printf("%I64d %I64d\n",a[i],sum[i - 1]);
        if(a[i] <= sum[i - 1] * 2) ans++;
        else break;
    }
    printf("%d\n",ans);
    return 0;
}


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

#define rep(i,N) repv(i,0,N)
#define reps(i,N) repvs(i,0,N)
#define repv(i,a,b) for(int i=a;i<b;i++)
#define repvs(i,a,b) for(int i=a+1;i<=b;i++)
#define repr(i,N) for(int i=N-1;i>=0;i--)
#define reprs(i,N) for(int i=N;i>0;i--)

#define debug(a) if(isDebugMode) cout<<#a<<"="<<a<<","
#define debug2(a,b) if(isDebugMode) cout<<#a<<"="<<a<<","<<#b<<"="<<b
#define debug3(a,b,c) if(isDebugMode) cout<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c
#define debug4(a,b,c,d) if(isDebugMode) cout<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<","<<#d<<"="<<d
#define debugarr(arr,N){if(isDebugMode){ rep(i,N+1)\
	{if(arr[i]==INF)printf("INF ");\
		else cout<<arr[i]<<" ";} cout<<endl;}}
#define debugarr2(arr,N,M){if(isDebugMode) rep(i,N+1){rep(j,M+1)\
	{if(arr[i][j]==INF)printf(" INF");\
		else printf(" %3d",arr[i][j]);} cout<<endl;}}
#define pb push_back
#define pob pop_back
#define show(a) cout<<a<<endl;

auto chmax =[](int &a,int b){a=max(a,b);};
auto chmin =[](int &a,int b){a=min(a,b);};

typedef long long ll;
typedef pair<int,int> P;
const int INF=100000000;
const int dx[4]={ 0, 1, 0,-1};
const int dy[4]={ 1, 0,-1, 0};

bool isDebugMode=true;
//--------------------------------------//
int a[3];

int main(){
	int m=-1;
	int c=-1;
	rep(i,3){
		cin>>a[i];
		if(a[i]>m){
			m=a[i];
			c=i;
		}
	}
	int ans=0;
	rep(i,3){
		if(i==c){
			ans+=a[i]*10;
		}
		else ans+=a[i];
	}
	cout<<ans<<endl;
	return 0;
}


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

int main(){
   int n;
   cin >> n;
   vector<ll> a(n),b(n);
   rep(i,n) cin >> a[i];
   rep(i,n){
       if(i%2==0) b[0]+=a[i];
       else b[0]-=a[i];
   }
   b[0]/=2;
   rep1(i,1,n) b[i]=a[i-1]-b[i-1];
   rep(i,n) b[i]*=2;
   rep(i,n) cout << b[i] << ' '; 
}

Measured memory_bytes: 2944
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int max1 = -1, max2 = -1;
  int max_idx;
  for (int i = 0; i < n; ++i) {
    cin >> a.at(i);
    if (max1 < a.at(i)) {
      max1 = a.at(i);
      max_idx = i;
    } else if (max2 < a.at(i)) {
      max2 = a.at(i);
    }
  }
  for (int i = 0; i < n; ++i) {
    if (i == max_idx) {
      cout << max2 << endl;
    } else {
      cout << max1 << endl;
    }
  }
  return 0;
}

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

// #define set unordered_set
#define map unordered_map

using namespace std;

class UnionFind {
private:
	int size;
	int parent[40000];
	int rank[40000];

public:
	UnionFind() {}
	UnionFind(int sz) {
		init(sz);
	}
	void init(int sz) {
		size = sz;
		fill(rank, rank+sz, 0);
		for (int i = 0; i < sz; ++i) {
			parent[i] = i;
		}
	}
	int root(int n) {
		if (parent[n] == n) return n;
		return parent[n] = root(parent[n]);
	}
	void unite(int n, int m) {
		int x = root(n);
		int y = root(m);
		if (x == y) return;

		if (rank[x] < rank[y]) {
			parent[x] = y;
		}
		else if (rank[x] > rank[y]) {
			parent[y] = x;
		}
		else {
			parent[x] = y;
			++rank[y];
		}
	}
	bool isUnited(int n, int m) {
		return root(n) == root(m);
	}
};


typedef pair<int, int> P;

struct Query {
	int type, u, v;
};

typedef vector< set<int> > Graph;

const int bucket = 100;

map<int, int> make_table(set<P>& use) {
	map<int, int> res;
	set<int> s;
	for (P p : use) {
		s.insert(p.first);
		s.insert(p.second);
	}
	int n = 0;
	for (int v : s) {
		res[v] = n++;
	}
	return res;
}
Graph trim(Graph& G, set<P>& use, map<int, int>& tbl) {
	tbl = make_table(use);

	int i = 0;
	Graph res(tbl.size());
	UnionFind uf(G.size());
	for (int i = 0; i < G.size(); ++i) {
		for (int v : G[i]) {
			if ( !use.count( P(i, v) ) ) {
				uf.unite(i, v);
			}
		}
	}
	for (P p1 : tbl) {
		for (P p2 : tbl) {
			int a = p1.first, b = p2.first;
			if ( uf.isUnited(a, b) ) {
				tbl[a] = tbl[b];
			}
		}
	}
	for (P p1 : tbl) {
		for (P p2 : tbl) {
			int a = p1.first, b = p2.first;
			if ( G[b].count(a) ) {
				res[tbl[b]].insert(tbl[a]);
			}
		}
	}
	return res;
}
void unite(Graph& G, int u, int v) {
	G[u].insert(v);
	G[v].insert(u);
}
void remove(Graph& G, int u, int v) {
	G[u].erase(v);
	G[v].erase(u);
}
bool judge(Graph& G, int v, int t, vector<bool>& reached) {
	if (v == t) return true;
	reached[v] = true;
	for (int to : G[v]) {
		if ( !reached[to] ) {
			if ( judge(G, to, t, reached) ) return true;
		}
	}
	return false;
}
bool judge(Graph& G, int s, int t) {
	vector<bool> reached(G.size(), false);
	return judge(G, s, t, reached);
}

set<P> Use[40000/bucket+1];
int main() {
	int N, M; cin >> N >> M;
	Query Q[40000];
	for (int i = 0; i < M; ++i) {
		int t, u, v; scanf("%d%d%d", &t, &u, &v);
		Q[i] = (Query){t, u, v};
	}
	for (int i = 0; i < M; ++i) {
		int type = Q[i].type, u = Q[i].u, v = Q[i].v;
		Use[i/bucket].insert( P(u, v) );
		Use[i/bucket].insert( P(v, u) );
	}
	Graph G(N);
	Graph g;
	map<int, int> tbl;
	for (int i = 0; i < M; ++i) {
		int type = Q[i].type, u = Q[i].u, v = Q[i].v;
		if (i % bucket == 0) {
			g = trim(G, Use[i/bucket], tbl);
		}
		switch (type) {
		case 1: // unite
			unite(G, u, v);
			unite(g, tbl[u], tbl[v]);
			break;
		case 2: // remove
			remove(G, u, v);
			remove(g, tbl[u], tbl[v]);
			break;
		case 3: // judge
			if ( judge(g, tbl[u], tbl[v]) ) {
				cout << "YES" << endl;
			}
			else {
				cout << "NO" << endl;
			}
			break;
		}
	}
}

Measured memory_bytes: 11848
/*
[agc002] E - Candy Piles
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()

const int MAX_N = 1e5;

int N;
int a[MAX_N];

ll solve() {
    sort(a, a + N, greater<int>());

    int l = 0;
    while (l + 1 < N && a[l + 1] > l + 1) {
        l++;
    }
    int r = l;
    while (r + 1 < N && a[r + 1] > l) {
        r++;
    }

    return (a[l] - l - 1) % 2 == 1 || (r - l) % 2 == 1;
}

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }

    cout << (solve() ? "First" : "Second") << endl;

    return 0;
}


Measured memory_bytes: 640
using System;

namespace ACprac
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int A = int.Parse(Console.ReadLine());
            int B = int.Parse(Console.ReadLine());
            int C = int.Parse(Console.ReadLine());
            int D = int.Parse(Console.ReadLine());
            int E = int.Parse(Console.ReadLine());
            int K = int.Parse(Console.ReadLine());
           
            if(E -A <= K)
            {
                Console.WriteLine("Yay!");
            }
            else 
            {
                Console.WriteLine(":(");
            }
            
        }
    }
}


Measured memory_bytes: 11092
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DMenagerie solver = new DMenagerie();
        solver.solve(1, in, out);
        out.close();
    }

    static class DMenagerie {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            boolean[] sheep = new boolean[n];
            boolean[] s = new boolean[n];

            String input = in.next();
            for (int i = 0; i < n; i++) {
                s[i] = input.charAt(i) == 'o';
            }

            for (int configFirstThree = 0; configFirstThree < 8; configFirstThree++) {
                sheep[0] = (configFirstThree & 1) > 0;
                sheep[1] = (configFirstThree & 2) > 0;
                sheep[2] = (configFirstThree & 4) > 0;
                for (int i = 3; i < n; i++) {
                    sheep[i] = sheep[i - 3] ^ s[i - 2] ^ s[i - 1];
                }

                boolean valid = true;
                for (int i = 0; i < n; i++) {
                    int a = i, b = (i + 1) % n, c = (i + 2) % n;
                    if (sheep[a] ^ sheep[b] ^ sheep[c] != s[b])
                        valid = false;
                }
                if (valid) {
                    out.println(stringify(sheep));
                    return;
                }
            }

            out.println(-1);
        }

        private static String stringify(boolean[] sheep) {
            StringBuilder sb = new StringBuilder();
            for (boolean s : sheep) {
                sb.append(s ? "S" : "W");
            }
            return sb.toString();
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 27796
import java.util.Scanner;

public class Main {

    private static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
        }
        long[] left = new long[n + 1];
        long[] right = new long[n + 1];
        left[0] = 0;
        right[n] = 0;
        for (int i = 0; i < n; i++) {
            left[i + 1] = gcd(left[i], a[i]);
            right[n - i - 1] = gcd(right[n - i], a[n - i - 1]);
        }
        long max = 0;
        for (int i = 0; i < n; i++) {
            max = Math.max(max, gcd(left[i], right[i + 1]));
        }
        System.out.println(max);
    }

}


Measured memory_bytes: 59844
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>
 
using namespace std;

typedef long long ll;
typedef long double ld;
 
#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int, int>
#define Point Vect
#define no {cout << "No\n"; return;}

const int N = 1e5 + 7;

int a[N];

 void solve() {
    int n, m, sum = 0;
    cin >> n >> m;
    loop(i, n) {
        cin >> a[i];
        sum += a[i];
    }
    sort(a, a + n, greater<int>());
    cout << (a[m - 1] * 4 * m >= sum ? "Yes" : "No");
 }

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define Endl '\n'
typedef long long int lli;
/*
created on: 19/4/2020
*/
void solve();
int main(int argc, char const *argv[]){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
void solve(){
  double R;
  cin>>R;
  double pie = 6.28318530717958623200/2;
  printf("%.8f\n", 2*pie*R);
}


Measured memory_bytes: 3808
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn read_vec<T: FromStr>(n: usize) -> Vec<T> {
    return (0..n).map(|_| read()).collect();
}

fn min<T: std::cmp::PartialOrd>(a: T, b: T) -> T {
    if a < b {
        return a;
    } else {
        return b;
    }
}

fn main() {
    let k: usize = read();
    let n: usize = read();
    let ai: Vec<usize> = read_vec(n);
    let ai_len = ai.len();

    let mut diffs = Vec::new();
    for i in 0..ai_len-1 {
        diffs.push(ai[i+1] - ai[i]);
    }
    let diff_max = diffs.into_iter().max().unwrap();

    let ans1 = ai[ai_len-1] - ai[0];
    let ans2 = k - diff_max;

    println!("{}", min(ans1, ans2));
}


Measured memory_bytes: 8444
# coding: utf-8
N, M = map(int, input().split())
ans = 1
for d in range(1, int(M**0.5)+1):
    if M % d == 0 and d <= M / N:
        ans = max(ans, d)
        if M // d <= M // N:
            ans = max(ans, M//d)
print(ans)

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

int main(){
    int N, K;
    cin >> N >> K;
    vector<long long> x(N);
    for(int i=0; i<N; i++) cin >> x[i];

    if(x[0] >= 0){
        cout << x[K-1] << endl;
    }else if(x[N-1] <= 0){
        cout << -x[N-1-K+1] << endl;
    }else{
        int pos = 0;
        for(int i=0; i<N-1; i++){
            if(x[i] <= 0 && 0 <= x[i+1])
                pos = i;
        }
        long long ans = 1LL<<60;
        if(pos+K < N){
            ans = min(ans, x[pos+K]);
        }
        if(pos-K+1 >= 0){
            ans = min(ans, -x[pos-K+1]);
        }
        for(int i=0; i<=pos; i++){
            int n = K + i - 1;
            if(n <= pos || n >= N) continue;
            ans = min(ans, 2*x[n]-x[i]);
            ans = min(ans, -2*x[i]+x[n]);
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const int INF=1e9;
const ll MX = 1e18;
const ll MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
const string tr="abcdefghijklmnopqrstuvwxyz";
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
#define YN {puts("YES");}else{puts("NO");}
const ll MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {fac[0] = fac[1] = 1;finv[0] = finv[1] = 1;inv[1] = 1;for (ll i = 2; i < MAX; i++){fac[i] = fac[i - 1] * i % MOD;inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;finv[i] = finv[i - 1] * inv[i] % MOD;}}
long long COM(ll n, ll k){if (n < k) return 0;if (n < 0 || k < 0) return 0;return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;}
ll llpow(ll n,ll i){ll cnt=n;  for(ll j=0;j<i-1;j++){n*=cnt;}return n;}
bool ip/*is_prime*/(long long N) {if (N == 1) return false;for (long long i = 2; i * i <= N; ++i) {if (N % i == 0) return false;}return true;}
int digit(ll N) {int ans = 0;while (N) {++ans;N /= 10;}return ans;}
vector<pair<ll,ll>> pf/*prime_factorize*/(ll n){vector<pair<ll,ll>> res;for(ll a=2;a*a<=n;a++){if(n%a!=0) continue;ll ex=0;while(n%a==0){ex++;n/=a;}res.pb({a,ex});}if(n!=1) res.pb({n,1});return res;}
vector<ll> div/*divisor*/(ll n){  vector<ll> res={1};for(ll a=2;a*a<=n;a++){if(n%a!=0) continue;ll b=n/a;res.pb(b);if(b!=a) res.pb(a);}sort(all(res));return res;}

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


Measured memory_bytes: 3524
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
  int n,m;
  cin>>n>>m;
  map<P,int> mp;
  int e[n][n],g[n][n];
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      if(i==j) g[i][j]=e[i][j]=0;
      else g[i][j]=e[i][j]=1<<25;
  for(int i=0;i<m;i++){
    int a,b,c;
    cin>>a>>b>>c;
    a--;b--;
    mp[P(a,b)]=mp[P(b,a)]=i;
    g[a][b]=g[b][a]=e[a][b]=e[b][a]=c;
  }
  for(int k=0;k<n;k++)
    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++)
	e[i][j]=min(e[i][k]+e[k][j],e[i][j]);
  bool used[m];
  memset(used,0,sizeof(used));
  for(int s=0;s<n;s++){
    for(int t=0;t<n;t++){
      bool vi[n];
      memset(vi,0,sizeof(vi));
      queue<int> q;
      q.push(s);
      while(!q.empty()){
	int cur=q.front();q.pop();
	if(vi[cur]) continue;
	vi[cur]=1;
	for(int i=0;i<n;i++){
	  if(i!=cur&&g[cur][i]+e[i][t]==e[cur][t]){
	    q.push(i);
	    used[mp[P(i,cur)]]=1;
	  }
	}
      }
    }
  }
  int ans=m;
  for(int i=0;i<m;i++) ans-=used[i];
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int H,W,h,w;
  cin >> H >> W >> h >> w;
  if(H == h) cout << 0 << endl;
  else if(W == w) cout << 0 << endl;
  else cout << H*W - (h*W + H*w -h*w) << endl;
}

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

#if defined(DEBUG)

#include <unistd.h>
#include <sys/fcntl.h>
#define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
#define DCALL(func, ...) func(__VA_ARGS__)

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#else  // defined(DEBUG)

#define DLOG(...)
#define DCALL(func, ...)

#endif // defined(DEBUG)

ll N, K;
vector<ll> A;
vector<ll> lastPos;
vector<ll> nextOccDist;
vector<ll> revNOD;
ll aLim = 2e5;
vector<ll> cleared;

int main(int argc, char *argv[]) {
#if defined(DEBUG)
  // GDB on Cygwin ignores redirection at run command.
  if (argc == 2) dup2(open(argv[1], 0), 0);
#else
  // For performance.  We should not use C-style stdio functions
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  cout << setprecision(20);

  cin >> N >> K;
  A.resize(N);
  lastPos.resize(aLim+1, -1);
  nextOccDist.resize(N);
  revNOD.resize(N);
  for (ll i = 0; i < N; i++)  cin >> A.at(i);
  for (ll i = 0; i < N; i++) {
    ll a = A.at(i);
    ll p = lastPos.at(a);
    if (p >= 0)  {
      nextOccDist.at(p) = i - p;
      revNOD.at(i % N) = i - p;
    }
    lastPos.at(a) = i;
  }
  for (ll i = 0; i < N; i++) {
    ll a = A.at(i);
    ll p = lastPos.at(a);
    if (p >= 0)  {
      nextOccDist.at(p) = N + i - p;
      revNOD.at(i % N) = N + i - p;
    }
    lastPos.at(a) = -1;
  }


  cleared.resize(N, -1);
  ll i = 0;
  while (i < N*K && cleared.at(i % N) == -1) {
    cleared.at(i % N) = i;
    i += nextOccDist.at(i % N) + 1;
  }
  if (i <= N*K) {
    ll dist = i - cleared.at(i % N);
    assert (dist % N == 0);
    i +=  dist * ((N * K - i) / dist);
  }else {
    i = 0;
  }

  vector<ll> answer;
  while (1) {
    while (1) {
      ll j = i + nextOccDist.at(i % N) + 1;
      if (j > N*K) break;
      i = j;
    }
    if (i == N*K) { break; }
    answer.push_back(A.at(i % N));
    i += 1;
  }

  if (answer.size() > 0) {
    for (ll t = 0; t < (ll)answer.size(); t++) {
      if (t > 0) { cout << " "; }
      cout << answer.at(t);
    }
    cout << endl;
  }

  return 0;
}



Measured memory_bytes: 10992
ans :: [Int] -> String
ans (w:h:x:y:r:s)
  | (x-r>=0) && (y-r>=0) && (x+r<=w) && (y+r<=h) = "Yes"
  | otherwise = "No"

main = do
  l <- getLine
  let i = map read $ words l
      a = ans i
  putStrLn a

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define pb push_back
#define fo for(int i=0;i<n;i++)
#define clear cin.clear();cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define loopSolve int t; cin>>t; while(t--){solve();}
//INT_MAX         2,147,483,647                       <10^10
//U_INT_MAX       4,294,967,295                       <10^10
//LONG_LONG_MAX   9,223,372,036,854,775,807           <10^18
//U_LONG_LONG_MAX 18,446,744,073,709,551,615          <10^18

/*ll power(int a, int b){
    return (ll)(pow(a,b)+0.5);
}*/

vector<int> gV(int n){
    vector<int> v;
    int input;
    fo { cin>>input; v.pb(input); }
    return v;
}

int* gA(int n){
    int* arr = new int[n];
    fo cin>>arr[i];
    return arr;
}

void secondThreadApproach(){
    int H,W,K;
    cin>>H>>W>>K;
    char** arr= new char*[H];
    for(int i=0;i<H;i++){
        arr[i]=new char[W];
    }

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin>>arr[i][j];
        }
    }

    int range = (1<<(H+W))- 1;                //2^(H+W)-1
    int ans=0;                              //int as ans can be at max 2^(H+W) and H,W<=6

    for(int mask=0;mask<=range;mask++){
        int count=0;
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                if(arr[i][j]!='#') continue;
                //if ((mask&(1<<(H-i-1+W)|(1<<(W-j-1))))!=0) continue;              //For mask 10010 => R0,R1,C0,C1,C2. 1=>Painted, 0=>Not Painted
                if((mask&((1<<W+i)|(1<<j)))!=0) continue;                      //For mask 10010 => R1,R0,C2,C1,C2. 1=>Painted, 0=>Not Painted
                count++;
            }
        }
        if(count==K)
            ans++;
    }

    cout<<ans<<endl;
}

//https://atcoder.jp/contests/abc173/tasks/abc173_c
void solve(){
    int H,W,K;
    cin>>H>>W>>K;
    char** arr= new char*[H];
    for(int i=0;i<H;i++){
        arr[i]=new char[W];
    }

    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin>>arr[i][j];
        }
    }

    int range = (1<<H+W)- 1;                //2^(H+W)-1
    ll ans=0;
    for(int i=0;i<=range;i++){
        int t=i,count=0;
        map<int,bool> row;
        map<int,bool>col;
        while(t>0){
            if(t&1==1){
                if(count<W) col[count]=true;
                else row[count-W]=true;
            }
            t=t>>1;
            count++;
        }

        ll temp=0;
        for(int p=0;p<H;p++){
            if(row[p]) continue;
            for(int q=0;q<W;q++){
                if(col[q]) continue;
                if(arr[p][q]=='#') temp++;
            }
        }
        if(temp==K) ans++;

    }

    cout<<ans<<endl;




}




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

    secondThreadApproach();
    //solve();
    //loopSolve;

	return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */

int main() {
  
  string s; cin >> s;
  char cur = 'A';
  lint ans = 0;
  for (auto c : s) {
    if (c <= cur) {
      ans++;
    }
    cur = c;
  }

  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3212
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#include <numeric>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
//----------------------------------------------------------------------

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

int main(void) {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];


    int ans = 0;
    rep(i, n) {
        int tmp = 0;
        int v = a[i];
        while(v % 2 == 0) {
            v /= 2;
            tmp++;
        }
        ans += tmp;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256