akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s=sc.next();
    boolean flag=false;
    if(s.equals("KIHBR"))flag=true;
    if(s.equals("KIHBRA"))flag=true;
    if(s.equals("KIHBAR"))flag=true;
    if(s.equals("KIHBARA"))flag=true;
    if(s.equals("KIHABR"))flag=true;
    if(s.equals("KIHABRA"))flag=true;
    if(s.equals("KIHABAR"))flag=true;
    if(s.equals("KIHABARA"))flag=true;
    if(s.equals("AKIHBR"))flag=true;
    if(s.equals("AKIHBRA"))flag=true;
    if(s.equals("AKIHBAR"))flag=true;
    if(s.equals("AKIHBARA"))flag=true;
    if(s.equals("AKIHABR"))flag=true;
    if(s.equals("AKIHABRA"))flag=true;
    if(s.equals("AKIHABAR"))flag=true;
    if(s.equals("AKIHABARA"))flag=true;

    if(flag) {
    	System.out.println("YES");
    }else {
    	System.out.println("NO");
    }
  }
}


Measured memory_bytes: 22868
N = int(input())
A = list(map(int, input().split(" ")))
A.sort()

n_pos = len([a for a in A if a > 0])
operations = []
if n_pos == 0:
    pos = [A[-1]]
    neg = A[:-1]
elif n_pos == N:
    pos = A[1:]
    neg = A[:1]
else:
    pos = [a for a in A if a > 0]
    neg = [a for a in A if a <= 0]
if len(pos) >= 2:
    tmp = neg[0]
    for i in range(len(pos)-1):
        operations.append((tmp, pos[i]))
        tmp = tmp - pos[i]
    operations.append((pos[-1], tmp))
    tmp = pos[-1] - tmp
    for i in range(1, len(neg)):
        operations.append((tmp, neg[i]))
        tmp = tmp - neg[i]
else:
    tmp = pos[0]
    for i in range(len(neg)):
        operations.append((tmp, neg[i]))
        tmp = tmp - neg[i]
print(tmp)
for o in operations:
    print("{} {}".format(o[0], o[1]))

Measured memory_bytes: 20308
#include <bits/stdc++.h>
//#pragma GCC target("avx,avx2,sse4.2")
#define rep(q, a, b) for (int q = a, q##_end_ = b; q <= q##_end_; ++q)
#define dep(q, a, b) for (int q = a, q##_end_ = b; q >= q##_end_; --q)
#define mem(a, b) memset(a, b, sizeof a)
#define debug(a) cerr << #a << ' ' << a << "___" << endl
using namespace std;
// char buf[10000000], *p1 = buf, *p2 = buf;
#define Getchar() getchar()  // p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 10000000, stdin), p1 == p2) ? EOF : *p1++
void in(int &r) {
    static char c;
    r = 0;
    while (c = Getchar(), c < 48);
        ;
    do
        r = (r << 1) + (r << 3) + (c ^ 48);
    while (c = Getchar(), c > 47);
}
int main(){
	int a;
	in(a);
	cout<<1LL*3*a*a;
	return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

#define MAX 2020

inline int lowbit(const int& i){
	return i & (-i);
}

int m_arr[MAX * 2];

int get(int loc){
	int res = 0;
	while(loc > 0){
		res += m_arr[loc];
		loc -= lowbit(loc);
	}
	return res;
}

void set(int loc, int num){
	while(loc < MAX * 2){
		m_arr[loc] += num;
		loc += lowbit(loc);
	}
}

int loc1[MAX], loc2[MAX];

int cnt[MAX][MAX][2];
int tmparr[MAX * 2];
long long int dp[MAX][MAX];

void init(int num){
	int i, j;

	memset(m_arr, 0, sizeof(m_arr));
	for(i = 1; i <= num; i++){
		cnt[i - 1][0][0] = loc1[i] - get(loc1[i]) - 1;
		set(loc1[i], 1);
	}
	
	memset(m_arr, 0, sizeof(m_arr));
	for(i = 1; i <= num; i++){
		cnt[0][i - 1][1] = loc2[i] - get(loc2[i]) - 1;
		set(loc2[i], 1);
	}
	
	memset(tmparr, 0, sizeof(tmparr));
	for(i = 1; i <= num; i++){
		memcpy(m_arr, tmparr, sizeof(tmparr));
		set(loc1[i], 1);
		memcpy(tmparr, m_arr, sizeof(tmparr));
		for(j = 1; j <= num; j++){
			cnt[i][j - 1][1] = loc2[j] - get(loc2[j]) - 1;
			set(loc2[j], 1);
		}
	}
	
	memset(tmparr, 0, sizeof(tmparr));
	for(i = 1; i <= num; i++){
		memcpy(m_arr, tmparr, sizeof(tmparr));
		set(loc2[i], 1);
		memcpy(tmparr, m_arr, sizeof(tmparr));

		for(j = 1; j <= num; j++){
			cnt[j - 1][i][0] = loc1[j] - get(loc1[j]) - 1;
			set(loc1[j], 1);
		}
	}
}


void getdp(int num){
	int i, j;

	for(i = 1; i <= num; i++){
		dp[i][0] = dp[i - 1][0] + cnt[i - 1][0][0];
	}

	for(i = 1; i <= num; i++){
		dp[0][i] = dp[0][i - 1] + cnt[0][i - 1][1];
	}
	
	for(i = 1; i <= num; i++){
		for(j = 1; j <= num; j++){
			dp[i][j] = dp[i][j - 1] + cnt[i][j - 1][1];
			dp[i][j] = std::min(dp[i][j], dp[i - 1][j] + cnt[i - 1][j][0]);
		}
	}
}

int main()
{
	int num, lo, i;
	char ch;
	while(~scanf("%d", &num)){
		for(i = 1; i <= num * 2; i++){
			getchar();
			scanf("%c", &ch);
			scanf("%d", &lo);
			if(ch == 'W'){
				loc1[lo] = i;
			}
			else{
				loc2[lo] = i;
			}
			
		}
		init(num);
		getdp(num);
		printf("%lld\n", dp[num][num]);
		
		
	}
	
	return 0;
}


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

using namespace std;

int main()
{
   string s;
   cin>>s;
   int ss=0;
   int nn=0;
   int ww=0;
   int ee=0;
   for(int i=0;i<s.size();i++)
   {
       if(s[i]=='S')
       {
           ss++;
       }
       if(s[i]=='W')
       {
           ww++;
       }
       if(s[i]=='E')
       {
           ee++;
       }
       if(s[i]=='N')
       {
           nn++;
       }
   }
   int t=0;
   int m=0;
   if(nn==0 && ss==0)
   {
       t=1;
   }
   if(ee==0 && ww==0)
   {
       m=1;
   }
   if(nn>0)
   {
       if(ss>0)
       {
           t=1;
       }
   }
   if(ee>0)
   {
       if(ww>0)
       {
           m=1;
       }
   }
   if(t==1 && m==1)
   {
       cout<<"Yes"<<endl;
   }else
   {
       cout<<"No"<<endl;
   }
}


Measured memory_bytes: 256
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var w = int.Parse(line[0]);
        var a = int.Parse(line[1]);
        var b = int.Parse(line[2]);
        var ar = a + w;
        var br = b + w;
        if (b > ar) Console.WriteLine(b - ar);
        else if (br < a) Console.WriteLine(a - br);
        else Console.WriteLine(0);
    }
}

Measured memory_bytes: 11092
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	int a[4],i;
	for(i=0;i<3;i++){
		cin>>a[i];
	}
	sort(a,a+3);
	int b=a[2]*10+a[1]+a[0];
	cout<<b<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define rep1(i,n) for(int i=1; i<(int)n; i++)
#define repa(i,a,n) for(int i=(a); i<(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using psi = pair<string, int>;
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};
const int mod = 1e9+7;
int gcd(int a, int b){if(a%b == 0){return(b);}else{return(gcd(b, a%b));}}
int lcm(int a, int b){return a / gcd(a, b)*b;}

int N, M, K, H, W, L, R, X;
//string S, T;
int csum (vi a,int asum){
  rep(i,N-1){
    if(a[i]<0){
      a[i] *= -1;
      a[i+1] *= -1;
      asum += 2*(a[i]+a[i+1]);
    }
  }
  return asum;
}
signed main(){
  cin >> N;
  vi v(N), c(N);
  rep(i,N) cin >> v[i];
  rep(i,N) cin >> c[i];
  
  int ans = 0;
  for (int bit=0; bit<(1<<N); bit++){
    int vsum = 0, csum = 0;
    for (int i=0; i<N; i++){
      if(bit & (1<<i)) {
        vsum += v[i];
        csum += c[i];
      }
    }
    ans = max(ans, vsum - csum);
  }
  cout << ans << endl;
  return 0;
}


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

long long GCD( long long X, long long Y )
{
	while( true )
	{
		X %= Y;
		if( X == 0 ) return Y;

		Y %= X;
		if( Y == 0 ) return X;
	}
}

long long Func( long long C, long long D, long long X )
{
long long iLCM;

	iLCM = C / GCD( C, D );
	iLCM *= D;

	return X - ( X / C ) - ( X / D ) + ( X / iLCM );
}

int main()
{
long long A;
long long B;
long long C;
long long D;

	ios::sync_with_stdio( false );
	cin.tie( 0 );

	cin >> A;
	cin >> B;
	cin >> C;
	cin >> D;

	cout << Func( C, D, B ) - Func( C, D, A - 1 ) << endl;

	return 0;
}


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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
#define ALL(v) (v).begin(),(v).end()
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
template<class T> T gcd(T a,T b) {return b?gcd(b,a%b):a;}
template<class T> T lcm(T a,T b) {return a/gcd(a,b)*b; }
template<class T> bool isPrime(T num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (T i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

using namespace std;

int n,a,b,ans;
string s;

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

        rep2(i,0,10)
        {
                rep2(j,0,10)
                {
                        rep2(k,0,10)
                        {
                                char a='0'+i,
                                     b='0'+j,
                                     c='0'+k;
                                string t="";
                                t.push_back(a);
                                t.push_back(b);
                                t.push_back(c);
                                if(s.find(a)!=string::npos)
                                {
                                        if(s.find(b,s.find(a)+1)!=string::npos)
                                        {
                                                if(s.find(c,s.find(b,s.find(a)+1)+1)!=string::npos)
                                                {
                                                        ans++;
                                                        //cout<<t<<endl;
                                                }
                                        }
                                }
                        }
                }
        }
        cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define true 1
#define false 0
typedef long long ll;
typedef unsigned char Uchar; 

int main(void){
  
  int i,j,k;
  int n;
  int a[1000001];
  scanf("%d",&n);
  for(i=1;i<n+1;i++){
   scanf("%d",&a[i]); 
  }
  
  int tmp;
  for(i=1;i<n+1;i++){
    for(j=i+1;j<n+1;j++){
      if(a[i] > a[j]){
      tmp = a[i];
      a[i] = a[j];
      a[j] = tmp;
      }
    }
  }
  
  int s,t,u;
  int ans=0;
  for(i=1;i<n+1;i++){
    s = a[i];
    for(j=i+1;j<n+1;j++){
      if(s == a[j]) continue;
         //printf("[]%d,%d,%d\n",i,j,k);
      	t = a[j];
        for(k=j+1;k<n+1;k++){
          //printf("[]%d,%d,%d\n",i,j,k);
         if(t == a[k])continue;
          u = a[k]; 
           if(s+t > u){
             ans++;
             //printf("[]%d,%d,%d\n",i,j,k);
             //printf("--%d,%d,%d\n",s,t,u);
           }
        }
    }//j
    
  }//i
  
  printf("%d",ans);
  
  return 0;
}

Measured memory_bytes: 1744
import math
import numpy as np
n,k=(map(int, input().split()))

#arr=[2**i for i in range(50)]

count=0
#print(arr)
for i in range(n):
    if i+1>=k:
        count+=1/n
    else:
        tmp=np.ceil(math.log2(k/(i+1)))
        #print(tmp)
        count+=(1/n)*((1/2)**tmp)
print(count)

Measured memory_bytes: 12396
#include <stdio.h>
int main()
{
	int n, m, i, j, dataa[1000], datab[1000], datac[1000]; 
	int result, output;
	scanf("%d %d",&n, &m);

	for(j=0; j<n; j++)
	{
		scanf("%d",&datab[j]);
		datac[j] = 0;
	}

	for(i=0; i<m; i++)
	{
		scanf("%d",&dataa[i]);
	}

	for(j=0; j<m; j++)
	{
		for(i=0; i<n; i++)
		{
			if(datab[i] <= dataa[j])
			{
				datac[i] += 1;
				break;
			}
		}
	}


	result = 0;
	output = 0;

	for(i=0; i<n; i++)
	{
		if(result < datac[i])
		{
			result = datac[i];
			output = i;
		}

	}
	printf("%d\n",output+1);
	return 0;
}

Measured memory_bytes: 608
from collections import deque, defaultdict
import sys
input = sys.stdin.readline


def main():
    inf = 10 ** 10
    N, M = map(int, input().split())
    x = [inf] * (N + 1)
    adj = defaultdict(lambda: [])
    for _ in range(M):
        L, R, D = map(int, input().split())
        adj[L].append((R, D))
        adj[R].append((L, -D))
    seen = [0] * (N + 1)

    def dfs(adj, start):
        que = deque()
        que.append(start)
        x[start] = 0
        while que:
            v = que.pop()
            seen[v] = 1
            for u, d in adj[v]:
                if seen[u] == 0:
                    que.append(u)
                    if x[u] == inf:
                        x[u] = x[v] + d
                    else:
                        if x[u] != x[v] + d:
                            print('No')
                            sys.exit()

    for i in range(1, N + 1):
        if seen[i] == 0:
            dfs(adj, i)

    print('Yes')


if __name__ == '__main__':
    main()


Measured memory_bytes: 85340
//h09-2 ピザ
#include<iostream>
#include<fstream>
#include<stdio.h>
#include<math.h>
#include<time.h>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<set>
#include<stack>
#include<queue>
#include<cstdlib>
#include<algorithm>
#include<random>
#include<cassert>
using namespace std;
#include<boost/multiprecision/cpp_int.hpp>
namespace boost_multiprecision = boost::multiprecision;
#define LL long long
#define CINT boost_multiprecision::cpp_int
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -21474836487
#define INT_MAX 2147483647
#define LL_MIN -922337203685477580
#define LL_MAX 9223372036854775807
#define segment_size 65536
#define ROOP() while(true)

LL d,n,m;
set<LL> store;

int main(){
    ROOP(){
        cin >> d;
        if(d == 0) break;
        cin >> n >> m;
        store.clear();
        store.insert(0);
        store.insert(d);
        store.insert(2*d);
        store.insert(3*d);
        for(LL i=1; i<n; i++){
            LL tmp;
            cin >> tmp;
            store.insert(tmp);
            store.insert(d+tmp);
            store.insert(2*d+tmp);
        }
        LL answer = 0;
        for(LL i=0; i<m; i++){
            LL tmp;
            cin >> tmp;
            tmp += d;
            auto itr1 = store.lower_bound(tmp);
            auto itr2 = itr1;
            itr2--;
            answer += min(*itr1-tmp,tmp-*itr2);
        }
        cout << answer << endl;
    }
}


Measured memory_bytes: 17144
//People only find me interesting because they can't tell whether I'm serious or not
//#include <boost/multiprecision/cpp_int.hpp> 
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
typedef long long int ll;
typedef double db;
typedef __int128 s128;
typedef __uint128_t u128;
typedef unsigned long long u64;
#define int long long int
#define P 998244353
#define Q 1000000006
#define sz(a) (ll)a.size()
#define lt(a) (ll)a.length()
#define pll pair<ll,ll>
#define f(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define bac(i,a,b) for(ll i=(ll)a;i>=(ll)b;i--)
#define mll map<ll,ll>
#define umll unordered_map<ll,ll>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define teevra_gati ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define N 100005
#define PI 3.14159265359
#define inf LLONG_MAX
//using namespace boost::multiprecision; 
using namespace __gnu_pbds;
using namespace std;

void solve(){
    cout<<setprecision(10);
    long double a,b;
    cin>>a>>b;
    a *= b;
    cout<<ll(a);
}
signed main() {
    teevra_gati
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    
    solve();

    return 0;
}

Measured memory_bytes: 3748
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<string.h>
#include<stdio.h>
#include<string.h> 
#define MAXN (int)1e5+10
using namespace std;

string s;

int main()
{
	bool al[200];
	memset(al,false,sizeof(al));
	cin>>s;
	for(int i=0;i<s.length();i++)
	{
		al[s[i]]=true;
	}
	for(char i='a';i<='z';i++)
	{
		if(!al[i])
		{
			cout<<char(i)<<endl;
			return 0;
		}
	}
	cout<<"None"<<endl;
}

Measured memory_bytes: 512
A,B,C,D,E,F = (int(x) for x in input().split())

CCT = {}
for a in range(F//(100*A)+1):
    for b in range(F//(100*B)+1):
        water = (a*A+b*B)*100
        if water > F:
            continue
        max_suger = water*E//100
        for c in range(max_suger//C+1):
            for d in range((max_suger-c*C)//D+1):
                suger = c*C+d*D
                total = water + suger
                if total > F or total == 0 or max_suger < suger:
                    continue
                CCT[water,suger] = suger/total

ans = (A*100, 0)
max_cct = 0
for (water,suger),cct in CCT.items():
    if cct > max_cct:
        max_cct = cct
        ans = (water+suger, suger)
print(*ans)


Measured memory_bytes: 10160
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.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        ArrayList<Integer>[] G;
        int[][] dp;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            int[] a = new int[m];
            int[] b = new int[m];
            for (int i = 0; i < m; i++) {
                a[i] = in.nextInt() - 1;
                b[i] = in.nextInt() - 1;
            }
            int q = in.nextInt();
            int[] v = new int[q];
            int[] d = new int[q];
            int[] c = new int[q];
            for (int i = 0; i < q; i++) {
                v[i] = in.nextInt() - 1;
                d[i] = in.nextInt();
                c[i] = in.nextInt();
            }

            G = new ArrayList[n];
            for (int i = 0; i < n; i++) {
                G[i] = new ArrayList<>();
            }
            for (int i = 0; i < m; i++) {
                G[a[i]].add(b[i]);
                G[b[i]].add(a[i]);
            }

            dp = new int[100010][11];

            for (int i = q - 1; i >= 0; i--) {
                rec(v[i], d[i], c[i]);
            }

            for (int i = 0; i < n; i++) {
                out.println(dp[i][0]);
            }
        }

        void rec(int v, int d, int c) {
            if (dp[v][d] > 0) return;

            dp[v][d] = c;
            if (d == 0) return;

            for (int to : G[v]) {
                rec(to, d - 1, c);
            }
            rec(v, d - 1, c);
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

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

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 81584
#include <cstdio>
char s[100001];
int x[100001], y[100001], cnt, N, K;
int max(int a, int b) {return a > b ? a : b;}
int main()
{
    int f, ans = 0;
    scanf("%d%d%s", &N, &K, s);
    if (s[0] == '0'){
    x[0] = y[0] = 0;
    cnt = 1;}
    for (int i = 1; i < N; ++i)
    {
        if (s[i] == '0' && s[i - 1] == '1')
        {
            y[cnt++] = i;
        }
        if (s[i] == '1' && s[i - 1] == '0')
        {
            x[cnt] = i;
        }
    }
    if (s[N - 1] == '1')
    {
        y[cnt++] = N;
    }
    else
    {
        x[cnt] = y[cnt] = N;
        cnt++;
    }
    for (int i = 0; i < cnt; ++i)
    {
        int t = max(i - K, 0);
        if (ans < y[i] - x[t])
        {
            ans = y[i] - x[t];
        }
    }
    printf("%d\n", ans);
    return 0;
}


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

int mod = 1000000007;
int64_t large = 9223372036854775807;

int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;

    int ans = 0;
    if (D <= A)
        cout << D;
    else if (D <= A + B)
        cout << A;
    else
        cout << A - (D - A - B);
}

Measured memory_bytes: 3620
from math import gcd
K = int(input())
ans = 0
for i in range(1,K + 1):
    for j in range(1,K + 1):
        if gcd(i,j) == 1: ans += K
        else:
            for k in range(1,K + 1):
                ans += gcd(gcd(i,j),k)
print(ans)


Measured memory_bytes: 68708
n, k, q = map(int, input().split())
points = [0 for _ in range(n + 1)]
for i in range(q):
    answer = int(input())
    points[answer] += 1
for i in range(1, n + 1):
    if (points[i] + k - q) > 0:
        print("Yes")
    else:
        print('No')

Measured memory_bytes: 4732
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 1
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	g := graph{}
	g.ee = make([]Edges, n)
	g.visited = make([]bool, n)
	g.found = make([]int, n)
	g.leave = make([]int, n)
	for i := 0; i < n; i++ {
		u := getNextInt(scanner) - 1
		k := getNextInt(scanner)
		for j := 0; j < k; j++ {
			v := getNextInt(scanner) - 1
			g.ee[u] = append(g.ee[u], Edge{
				to: v,
				id: u,
			})
		}
	}
	for i := 0; i < n; i++ {
		sort.Sort(g.ee[i])
	}
	for i := 0; i < n; i++ {
		if g.visited[i] {
			continue
		}
		g.dfs(i)
	}

	for i := 0; i < n; i++ {
		fmt.Fprintln(writer, fmt.Sprintf("%d %d %d", i+1, g.found[i], g.leave[i]))
	}
}

// Edge ...
type Edge struct {
	to, id int
}

type Edges []Edge

func (a Edges) Len() int           { return len(a) }
func (a Edges) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Edges) Less(i, j int) bool { return a[i].id < a[j].id }

type graph struct {
	ee           []Edges
	t            int
	n            int
	visited      []bool
	found, leave []int
}

func (g *graph) dfs(i int) {
	g.visited[i] = true
	g.t++
	g.found[i] = g.t
	for _, e := range g.ee[i] {
		if g.visited[e.to] {
			continue
		}
		g.dfs(e.to)
	}
	g.t++
	g.leave[i] = g.t
}



Measured memory_bytes: 1260
#include <bits/stdc++.h>
using namespace std;
int main(void){
    long long K; cin >> K;
    vector<long long> A(50);
    long long base = K / 50;
    long long remain = K % 50;
    for (int i = 0; i < 50; i++) {
        A[i] = base + i;
    }
    for (int i = 0; i < remain; i++) {
        for (int j = 0; j < 50; j++) {
            if (j == i) A[j] += 50;
            else A[j]--;
        }
    }
    
    cout << 50 << endl;
    for (int i = 0; i < 50; i++) cout << A[i] << " ";
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {
 public static void main(String[] args) {
	Set<Set<Integer>> all = new HashSet<Set<Integer>>();
	Map<Integer, Map<Integer, Integer>> map = new HashMap<Integer, Map<Integer, Integer>>();
	for (int i = 0; i < 10; i++) {
	 map.put(i + 1, new HashMap<Integer, Integer>());
	 Set<Integer> a = new HashSet<Integer>();
	 a.add(i);
	 all.add(a);
	}
	for (int i = 0; i < 10; i++) {
	 Set<Set<Integer>> set2 = new HashSet<Set<Integer>>();
	 for (Set<Integer> b : all) {
		Set<Integer> bb = new HashSet<Integer>(b);
		bb.add(i);
		set2.add(bb);
	 }
	 all.addAll(set2);
	}
	for (Set<Integer> cc : all) {
	 int val = 0;
	 for (int aa : cc) {
		val += aa;
	 }
	 int count = 1;
	 Map<Integer, Integer> map2 = map.get(cc.size());
	 if (map2.containsKey(val)) {
		count += map2.get(val);
	 }
	 map2.put(val, count);
	}

	Scanner in = new Scanner(System.in);
	boolean endFlag = false;
	int n = in.nextInt();
	int s = in.nextInt();
	while (!endFlag) {
	 Integer integer = map.get(n).get(s);
	 if(integer==null){integer=Integer.valueOf(0);}
	 System.out.println(integer);
	 n = in.nextInt();
	 s = in.nextInt();
	 if (n == 0 && s == 0) {
		endFlag = true;
	 }
	}
 }
}

Measured memory_bytes: 13000
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(obj)   (obj).begin(),(obj).end()

#define debug(var)  do{std::cout << __LINE__ << "> " << #var << ": ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

void Main() {
	int N; cin >> N;
	vector<int> x(N);
	vector<int> y(N);
	REP(i,N) cin >> x[i] >> y[i];
	vector<int> vec(N);
	REP(i, N) vec[i] = i;
	double sum = 0;
	int cnt = 0;
    do {
		double dist = 0;
		REP(i, N - 1) {
			dist += sqrt(pow((x[vec[i]] - x[vec[i + 1]]), 2) + pow((y[vec[i]] - y[vec[i + 1]]), 2));
		}
		sum += dist;
		++cnt;
    } while (next_permutation(vec.begin(), vec.end()));
	cout << sum / cnt << endl;
}

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


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

int main() {
	int A;
	int B;
   int C;
   int D;
   int E;
  cin >> A;
  cin >> B;
 C = A+B;
 D = A-B;
 E = A*B;
  if(C>D &&C>E){
    cout << C << endl;
  }
  else if(D>C &&D>E){
    cout << D << endl;
  }
  else if(E>C &&E>D){
    cout << E << endl;
  }
    else if(C==D&&C>E){
    cout << C << endl;
  }  
  else if(D==E&&D>C){
    cout << D << endl;
  }
  else if(E==C&&E>D){
    cout << E << endl;
  }
  else if(A==0&&B==0){
    cout << '0' << endl;
  }

  }


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;

#define INF 1e18
#define int long long

signed main() {
    int q, h, s, d; cin >> q >> h >> s >> d;
    int n; cin >> n;

    int a = min(4 * q, min(2 * h, s));
    int b = min(d, 2 * a);
    int ans = (n / 2) * b + (n % 2) * a;

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


Measured memory_bytes: 256
K = int(input())

A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(A[K-1])

Measured memory_bytes: 9088
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();
        int[] a = sc.IntArray();

        int answer = a.Max() - a.Min();

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#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;



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string g;
	int y, m, d;
	while (cin >> g) {
		if (g == "#")break;
		cin >> y >> m >> d;
		if (y > 31) {
			g = "?";
			y -= 30;
		}
		else if (y == 31) {
			if (m > 4) {
				g = "?";
				y -= 30;
			}

		}
		cout << g << " " << y << " " << m << " " << d << endl;
	}
}


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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

#define INF 1000000000000000000LL
#define MOD 1000000007
#define writeln(n) cout<<n<<endl
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
//vector<tuple<long long, long long, long long>>vec;

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 dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

const int inf=100000000;

using Edge = pair<int,int>;
using Graph = vector<vector<Edge> >;

int N;

Graph G;
vector<int> res;

// v を c に塗る。p は v の親
void dfs(int v, int p, int c)
{
    res[v] = c;
    for (auto e : G[v]) //何をしている？
    {
        if (e.first == p) continue;
        if (e.second & 1) dfs(e.first, v, 1-c);
        else dfs(e.first, v, c);
    }
}

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    cin>>N;
    G.assign(N, vector<Edge>());
    for (int i = 0; i < N-1; ++i)
    {
        int u, v, w; cin >> u >> v >> w;
        --u, --v; //u,v1つずつ減らす
        G[u].push_back(Edge(v, w));
        G[v].push_back(Edge(u, w));
    }

    res.assign(N, 0);
    dfs(0, -1, 1);
    for (auto v : res) cout << v << endl;
}

Measured memory_bytes: 8960
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner s=new Scanner(System.in);
  int n=s.nextInt();
  String slime=s.next();
  List<Character> color=new ArrayList<>();
  for(int i=0;i<n;i++){
    color.add(slime.charAt(i));
  }
  int cnt=color.size();
  int ans=color.size();
  for(int i=0;i<ans-1;i++){
 if(color.get(i).equals(color.get(i+1))){
 cnt--;
 }
  }
 System.out.println(cnt);
}
}

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

int main()
{
	long long int i, n, ans, count;
	cin >> n;
	string s;
	vector <string> v;
	for(i=0; i<n; i+=1)
	{
		cin >> s;
		sort(s.begin(), s.end());
		v.push_back(s);
	}
	sort(v.begin(), v.end());
	s=v[0];
	ans=0; count=1;
	for(i=1; i<n; i+=1)
	{
		if(s==v[i])
			count+=1;
		else
		{
			ans+=(count*(count-1))/2;
			s=v[i];
			count=1;
		}
	}
	ans+=(count*(count-1))/2;
	cout << ans << endl;
}

Measured memory_bytes: 5748
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll n;
    cin >> n;
    vll p(n);
    REP(i, n) cin >> p[i];
    ll res = 1, cur = p[0];
    REP(i, n - 1) {
        if (p[i + 1] > cur) continue;
        cur = p[i + 1];
        res++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 1792
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var p = MakePList(n);
        var a = new int[n + 1];
        for (int i = 2; i <= n; i++)
        {
            for (int j = 0; j < p.Count(); j++)
            {
                int x = i;
                while (x % p[j] == 0)
                {
                    a[p[j]]++;
                    x /= p[j];
                }
            }
        }
        long ans = 1;
        for (int i = 0; i <= n; i++)
        {
            ans *= a[i] + 1;
            ans %= 1000000007;
        }
        Console.WriteLine(ans);
    }
    static List<int> MakePList(int n)
    {
        var ret = new List<int>();
        ret.Add(2);
        for (int i = 3; i <= n; i += 2)
        {
            for (int j = 0; j < ret.Count(); j++)
            {
                if (i % ret[j] == 0) break;
                else if (j == ret.Count() - 1) ret.Add(i);
            }
        }
        return ret;
    }
}

Measured memory_bytes: 11220
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
#define EPS 1e-9
int H[50];
double SH[50];
int r;
bool ok(double t){
  for(int d=20-r;d+1<=20+r;++d){
    double sh1 = SH[d]-r+t;
    double sh2 = SH[d+1]-r+t;
    double sh = max(sh1,sh2);
    if(sh > H[d]) return false;
  }
  return true;
}
int main(){
  int n;
  while(cin>>r>>n , r||n){
    for(int d=-r;d<=r;++d){
      SH[d+20]=sqrt(r*r-d*d);
    }
    for(int i=0;i<50;++i) H[i]=0;
    while(n--){
      int x1,x2,h;
      cin>>x1>>x2>>h;      
      x1+=20;x2+=20;
      for(int j=x1;j+1<=x2;++j) H[j]=max(H[j],h);
    }
    double a=0,b=50;
    for(int i=0;i<50;++i){
      double t = (a+b)/2.0;
      if(ok(t)) a=t;
      else b=t;
    }
    printf("%lf",(a+b)/2);
    cout << endl;
  }
  return 0;
}

Measured memory_bytes: 1220
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
using namespace std;
int main() {
    int A,B,C,X;
    cin >> A >> B >> C>> X;
    int count =0;
    int total_price;
    for(int i=0;i<=A;i++){
        for(int j=0;j<=B;j++){
            for(int k=0;k<=C;k++){
                total_price = 500 * i + 100 * j + 50 * k;
                if(total_price == X){
                    count = count + 1;
                }
            }
        }
    }
    cout << count << endl;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
#include<stdio.h>
#include<string.h>
using namespace std;
#define ll  long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define rep(i,t,n) for(int i=t;i<n;i++)
#define nd "\n"
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>




/*ll power(ll x,ll t){
if(t<=0){
    return 1;
}
ll y=(power(x,t/2));
y=(y*y)%ma;
if(t%2)
    y=(y*x)%ma;
return y;

}*/
/*ll ph[100001];
void E_phi(int n){

ph[0]=0;
ph[1]=1;
for(int i=2;i<=n;i++){
    ph[i]=i;
}
for(int i=2;i<=n;i++){
    if(ph[i]==i){
        for(int j=i;j<=n;j+=){
            ph[j]-=ph[j]/i;
        }
    }
}


}*/
/*string s,t;
vector<int>  z_fun(string s){

int n = (int) s.length();
    vector<int> z(n);
    for (int i = 1, l = 0, r = 0; i < n; ++i) {
        if (i <= r)
            z[i] = min (r - i + 1, z[i - l]);
        while (i + z[i] < n && s[z[i]] == s[i + z[i]])
            ++z[i];
        if (i + z[i] - 1 > r)
            l = i, r = i + z[i] - 1;
    }
    return z;
}*/

/*struct st{
ll sum,pre,suf,ans;
st(){}
st(ll k){
ans=k,pre=k,suf=k,sum=0;
}

};
ll t[4*200001+4];
ll a[200001];
ll lazy[4*200001+4];
ll mx=1e14;



void push(int ind){
int l=2*ind+1,r=2*ind+2;
t[l]+=lazy[ind];
t[r]+=lazy[ind];
lazy[l]+=lazy[ind];
lazy[r]+=lazy[ind];
lazy[ind]=0;

}

void build(int ind,int l,int r){
if(l==r){
    t[ind]=a[l];
return;
}
int mid=(l+r)/2;
build(2*ind+1,l,mid);
build(2*ind+2,mid+1,r);

  t[ind] =min(t[ind*2+1] , t[ind*2+2]);



}
ll query(int ind,int l,int r,int p,int q){

if(l>q || r<p )
    return mx;
    int mid=(l+r)/2;

if(l>=p && r<=q )
    {
      return t[ind];
    }
    push(ind);
ll x=query(2*ind+1,l,mid,p,q);
ll y=query(2*ind+2,mid+1,r,p,q);


return min(x,y);
}

void update(int ind,int l,int r,int p,int q,int val){
if(l>q || r<p )
    return;

if(l>=p && r<=q )
    {
      t[ind]+=val;
      lazy[ind]+=val;
      return;
    }
push(ind);
int mid=(l+r)/2;
    update(2*ind+1,l,mid,p,q,val);
     update(2*ind+2,mid+1,r,p,q,val);
    t[ind]=min(t[2*ind+1],t[2*ind+2]);



}


ll mod(ll a){
if(a>=0)
    return a;
else return -a;
}
*/


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

string s;
cin>>s;
if(s[s.size()-1]=='s'){
    s.pb('e');
    s.pb('s');
}
else s.push_back('s');
cout<<s<<endl;

}


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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    int n, cnt = 1;
    string s;
    cin >> n >> s;
    for (int i = 1; i < n; ++i) if (s.at(i) != s.at(i - 1)) ++cnt;
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 512
n = int(input())
d = {}

for _ in range(n):
    s = input()
    if(s in d):d[s] += 1
    else:d[s] = 1

d = sorted(d.items(),key=lambda x:(x[1],x[0]),reverse=True)

m = d[0][1]
l = []
for i in range(len(d)):
    if(d[i][1] < m):break
    l.append(d[i][0])
l.sort()
for r in l:print(r)

Measured memory_bytes: 57436
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

int main(void) {
  char s[MAX];
  scanf("%s", s);
  int check[3] = {0};
  rep(i, 0, 3) check[(int)(s[i] - 'a')] = 1;
  int ans = 1;
  rep(i, 0, 3) ans &= check[i];
  printf(ans ? "Yes" : "No");
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define maxn 200005
#define N 2005
#define LL long long
using namespace std;
const LL mo=1e9+7;

LL f[N<<1][N<<1];
int n;
LL a[maxn],b[maxn];
LL inv[maxn];
LL fac[maxn];
LL ans;

LL ksm(LL a,LL k){
	if(!k)return 1ll;
	return (k&1)?ksm(a*a%mo,k>>1)*a%mo:ksm(a*a%mo,k>>1);
}

LL C(int x,int y){
	return (inv[x]*inv[y-x]%mo)*fac[y]%mo;
}

int main(){
	fac[0]=1;
	for(int i=1;i<=10000;i++){
		fac[i]=fac[i-1]*i%mo;
	}
	inv[10000]=ksm(fac[10000],mo-2);
	for(int i=10000-1;i>=0;i--)inv[i]=inv[i+1]*(i+1)%mo;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%lld%lld",&a[i],&b[i]);
	}
	for(int i=1;i<=n;i++){
		f[N-a[i]][N-b[i]]++;
	}
	for(int i=1;i<N*2;i++){
		for(int j=1;j<N*2;j++){
			f[i][j]+=f[i-1][j]+f[i][j-1];
			f[i][j]%=mo;
		}
	}
	for(int i=1;i<=n;i++){
		ans+=f[N+a[i]][N+b[i]];
		ans%=mo;
	}
	for(int i=1;i<=n;i++){
		ans-=C(2*a[i],2*a[i]+2*b[i]);
		ans%=mo;
	}
	ans=(ans+mo)%mo;
	ans=ans*inv[2]%mo;
	printf("%lld\n",ans);
	
}

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



int main(){
	ll n;
	ll cont = 0;
	cin>>n;
	if(n%2 == 1){
		cout<<cont;
		return 0;
	}
	else{
		ll k = n/2;
		ll p = 5;

	while(k/p>0){
		cont += k/p;
		p *=5;
	}

	cout<<cont;
	
		return 0;
	}

	}


		
	


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

int c[3][3];
int d1[3][2];
int d2[3][2];

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

    for(int i=0;i<3;i++)for(int j=0;j<3;j++)cin>>c[i][j];

    bool ans=true;

    for(int i=0;i<3;i++)for(int j=0;j<2;j++)
    {
        d1[i][j]=c[i][j+1]-c[i][j];
        d2[i][j]=c[j+1][i]-c[j][i];
    }

    for(int i=0;i<2;i++)
    {
        ans&=d1[0][i]==d1[1][i]&&d1[1][i]==d1[2][i];
        ans&=d2[0][i]==d2[1][i]&&d2[1][i]==d2[2][i];
    }

    puts(ans?"Yes":"No");

    return 0;
}


Measured memory_bytes: 3668
#include "bits/stdc++.h"
using namespace std;

int n,m;
set<int> d;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin>>n;
	for(int i=0;i<n;i++){
		cin>>m;
		d.insert(m);
	}
	cout<<d.size();
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include<map>
#include<cstring>
#include<iomanip>
#include <string>
#include <vector>	
#include<unordered_map>
#include<unordered_set>
using namespace std;


typedef long long unsigned llu;
typedef long double ld;
#define ll long long
#define PI 3.14159265358979323846
#define For(i, a, b) for (int i = a, sz = (int)b; i < sz; i++)
#define rFor(i, a, b, c) for (int i = (a); i >= (b); i -= (c))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fill(a, b) memset(a, b, sizeof(a))
#define IO ios_base::sync_with_stdio(false), cin.tie(0),cout.tie(0)
const int mod = 1000000007;
const ll inf = 1000000000009;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) { return a*b/gcd(a,b);}

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

int main()
{
	IO;
	int n{};
	cin>>n;
	vector<int>v(n);
	For(i,0,n)cin>>v[i];
	sort(all(v));
	if(n==3)cout<<"1\n";
	else
	{
		ll ans{};
		For(i,0,n)
		{
			For(j,0,i)
			{
				For(k,0,j)
				{
					if((v[k] != v[j] && v[i] != v[j]) && v[k]+v[j]>v[i])ans++;
				}
			}
		}
		cout<<ans<<'\n';
	}
	//system("pause");
	return 0;	
}

Measured memory_bytes: 3652
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        if (s.matches(".*keyence$")) {
            System.out.println("YES");
        } else if (s.matches("^k.*eyence$")) {
            System.out.println("YES");
        } else if (s.matches("^ke.*yence$")) {
            System.out.println("YES");
        } else if (s.matches("^key.*ence$")) {
            System.out.println("YES");
        } else if (s.matches("^keye.*nce$")) {
            System.out.println("YES");
        } else if (s.matches("^keyen.*ce$")) {
            System.out.println("YES");
        } else if (s.matches("^keyenc.*e$")) {
            System.out.println("YES");
        } else if (s.matches("^keyence.*$")) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}

Measured memory_bytes: 21844
import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
# AB = np.array([np.array(input().split(), np.int)
AB = np.array(AB)
# tAB = list(zip(*AB))
# print(AB)
tAB = AB.T
# print(tAB)
# print()
A = tAB[0]
B = tAB[1]
A.sort()
B.sort()

# print(A, B)

if N%2 == 0:
    midA1 = A[N//2-1]
    midA2 = A[N//2]
    midB1 = B[N//2-1]
    midB2 = B[N//2]

    midmidA = (midA1+midA2)/2
    midmidB = (midB1+midB2)/2
    res = int((midmidB-midmidA)/(0.5) + 1)
    print(res)

    # d = defaultdict(int)

    # for val1 in range(midA1, midB1+1):
    #     for val2 in range(midA2, midB2+1):
    #         val = (val1 + val2)/2
            # d[val] += 1
    # print(len(d.keys()))
    
else:
    midA = A[N//2]
    midB = B[N//2]
    print(midB-midA+1)

Measured memory_bytes: 66548
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL; // VL a(n);
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VL> VLL; // VII a(n,VI(m)) n * m
typedef pair<ll, ll> PL;
typedef map<ll, ll> MP; // MP a;
typedef vector<pair<ll, ll>> PS; // PS a(n);

template <class T, class U>
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)

int main() {
  ll n,k,m,x=0,y=0,z = 0,h=0,w=0,ans=0,sum = 0, Max = -1, Min = 3e9+1;
  string t;
  bool ok=true; 
  cin >> n >> h;
  PS a(n),c(n);
  rep(i,n){
    cin >> x >> y;
    a[i] = make_pair(x,y);
  }

  sort(ALL(a));
  Max = a[n-1].first;

  rep(i,n){
    c[i].first = a[i].second;
    c[i].second = a[i].first;
  }
  sort(RALL(c));

  rep(i,n){
    if(Max < c[i].first){
      h -= c[i].first;
      ans++;
    }
    if(h<=0){
      pri(ans);
      return 0; 
    }
  }

  while(h>0){
    h -= Max; 
    ans++;
  } 
  pri(ans);
  return 0;
}

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

#define pb push_back
#define pf push_front
#define ar array
typedef long long ll;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	char c;
	int s=0;
	while(cin>>c) {
		s = (s + c-'0')%9;
	}

	if(s) {
		cout << "No\n";
	}
	else
		cout << "Yes";
}


Measured memory_bytes: 3608