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

namespace ConsoleApp72 {
    class Program {
        static void Main(string[] args) {
            long N = int.Parse(Console.ReadLine());
            long[] T = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long M = long.Parse(Console.ReadLine());
            var P = new long[M];
            var X = new long[M];

            for(long i = 0; i < M; i++){
                var st = Console.ReadLine().Split().Select(long.Parse).ToArray();
                P[i] = st[0] - 1;
                X[i] = st[1];
            }

            long sum = T.Sum();

            //Console.WriteLine(sum);

            for (long i = 0; i < M; i++) {
                //Console.WriteLine(X[i]);
                //Console.WriteLine(T[P[i] - 1]);
                Console.WriteLine(sum + X[i] - T[P[i]]);
            }


        }
    }
}


Measured memory_bytes: 11348
//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=nxt[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)
using namespace std;
inline int read()
{
	char ch=getchar();int ret=0,f=1;
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}

inline void print(string name,int *arr,int len){
	rep(i,1,len) printf("%s[%d]=%d\n",name.c_str(),i,arr[i]);puts("");
}
inline void print(string name,int a){
	printf("%s=%d\n",name.c_str(),a);puts("");
}

typedef long long ll;
const int INF=1<<30;

const int maxn=1000000+10;
int a[maxn],b[maxn];

int main()
{
	int n;cin>>n;
	rep(i,1,n+1) cin>>a[i];
	rep(i,1,n) cin>>b[i];
	ll ans=0;
	rep(i,1,n)
	{
		rep(j,0,1)
			if(a[i+j]){
				int d=min(b[i],a[i+j]);
				b[i]-=d;
				a[i+j]-=d;
				ans+=d;	
			}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 4736
#include<iostream>
#include<limits.h>
#include<vector>
#include<assert.h>

using namespace std;

int main(void) {
    int n,k;
    bool com = false;
    bool ans = false;
    cin >> n >> k;
    int a[n];
    int i;
    for (i=0; i<n; i++) {
        cin >> a[i];
    }
    int min = INT_MAX;
    int max = 0;
    for (i=0; i<n; i++) {
        if (a[i] > max) {
            max = a[i];
        }
        if (a[i] < min) {
            min = a[i];
        }
    }
    while (!com) {
        for (i=0; i<n; i++) {
            if (a[i]%min != 0) {
                break;
            }
        }
        if (i == n) {
            com = true;
        }
        min--;
    }
    min++;
    while (k <= max) {
        if (k == max) {
            ans = true;
            break;
        }
        max -= min;
    }
    if (!ans) cout << "IM";
    cout << "POSSIBLE"<< endl;
    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;
     
public class Main{
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
     
     String O = scan.next();
     String E = scan.next();
     
     char[] o = O.toCharArray();
     char[] e = E.toCharArray();

     for(int i = 0; i < E.length(); i++){
        System.out.print(o[i]);  
        System.out.print(e[i]);  
     }
     if(O.length() != E.length()){
          System.out.print(o[O.length()-1]);  
     }
     System.out.println();  
	}
}


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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
 
typedef long long ll;
typedef pair<int, int> ii;

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

	map<ll, int> mp;	

	rep(i, n){
		ll a, b;
		cin >> a >> b;
		mp[a]++;
		mp[b];
		mp[b+1]--;
	} 
	
	ll num = 1;
	ll ans = 1;
	for(auto it = mp.begin(); it != mp.end(); it++){
		//cout << it->second << endl;
		num += it->second;
		if(num >= it->first) ans = max(ans, min(it->first, num));
	}
	//cout << endl;
	cout << ans - 1 << endl;
	

	return 0;
}

Measured memory_bytes: 8936
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <ccomplex>
#include <unordered_map>
#include <cstring>
#include <iostream>
#include <numeric>
#include <sstream>
#include <set>
#include <tuple>
#include <iomanip>

using namespace std;
#define MAX 1LL << 60

typedef long long ll;

#define rep(i, s, e) for(ll i = s; i < e; i++)
#define reft0(i, j) setfill('0') << setw(i) << j

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(){
    ll N, W;
    ll w[110], v[110];


    cin >> N >> W;
    rep (i, 0, N){
        cin >> w[i] >> v[i];
    }
    ll ans[110][100010];
    rep(i, 0, 110){
        rep(ii, 0, 100010){
            ans[i][ii] = MAX;
        }
    }
    ans[0][0] = 0;
    rep(cntN, 0, N){
        rep(sum_v, 0, 100010){
            if (sum_v - v[cntN] >= 0){
                chMin(ans[cntN + 1][sum_v], ans[cntN][sum_v - v[cntN]] + w[cntN]);
            }
            chMin(ans[cntN + 1][sum_v], ans[cntN][sum_v]);
        }
    }
    ll ansW = 0;
    rep(ii, 0, 100010){
        if (ans[N][ii] <= W)ansW = ii;
    }
    cout << ansW << endl;

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	// cout<<setprecision(10)<<fixed;
	int a, p;
	cin>>a>>p;
	cout<<(a*3+p)/2<<'\n';
	return 0;
}


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

int days[13][32];

std::string whatday(int m, int d) {
	switch (days[m][d]) {
	case 0:
		return "Monday";
	case 1:
		return "Tuesday";
	case 2:
		return "Wednesday";
	case 3:
		return "Thursday";
	case 4:
		return "Friday";
	case 5:
		return "Saturday";
	case 6:
		return "Sunday";
	}
	return "";
}

int main() {
	int day = 3;
	for (int i = 1; i < 13; i++) {
		for (int j = 1; j < 32; j++) {
			days[i][j] = day;
			day = (day+1) % 7;
			if (i == 2 && j == 29) break;
			if (i == 4 && j == 30) break;
			if (i == 6 && j == 30) break;
			if (i == 9 && j == 30) break;
			if (i == 11 && j == 30) break;
		}
	}
	int m, d;
	while (std::cin >> m >> d) {
		if (m == 0) break;
		std::cout << whatday(m, d) << std::endl;
	}
	return 0;
}


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

ll gcd(ll a, ll b) {
	return b ? gcd(b, a % b) : a;
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

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

	vector<int> vi(n);
	ll sum = 0;
	ll ans = 1e20;

	for (int i = 0; i < n; i++) {
		cin >> vi[i];
		sum += vi[i];
	}
	
	ll now = 0;
	for (int i = 0; i < n; i++) {
		now += vi[i];
		if (i + 1 < n) {
			ans = min(ans, abs(sum - 2 * now));
		}
	}

	cout << ans << endl;
}


Measured memory_bytes: 1152
n, m = map(int,input().split())
a = []
b = []

for i in range(n):
    a.append(list(map(int,input().split())))
for i in range(m):
    b.append(list(map(int,input().split())))

for i in range(n):
    ans = 10000000000000
    for j in range(m):
        x = abs(a[i][0]-b[j][0]) + abs(a[i][1]-b[j][1])
        if x < ans:
            ans = x
            y = j
    print(y+1)

Measured memory_bytes: 39280
// Contest: AtCoder Beginner Contest 176 (https://atcoder.jp/contests/abc176)
// Problem: C: Step (https://atcoder.jp/contests/abc176/tasks/abc176_c)


// region boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cplusplus >= 201703L
#   define all(a)      begin(a),end(a)
#   define sz(x)       ((int)size(x))
#else
#   define all(a)      (a).begin(),(a).end()
#   define sz(x)       ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __cplusplus >= 201703L
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9 + 5;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18 + 5;
MAYBE_UNUSED static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
//endregion

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

    int n; cin >> n;
    vi a(n);
    trav(ai, a) cin >> ai;

    ll mx = 0, s = 0;
    trav(ai, a) {
        if (ai < mx)
            s += mx - ai;
        else
            mx = ai;
    }

    cout << s << '\n';
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> PII;

const int MM = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 2e6 + 10;

int n, m;

void prework(){

}

void read(){

}
char s[1000];

void solve(int casi){
//	cout << "Case #" << casi << ": ";
	scanf("%s", s);
	puts(s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I' ? "Yes" : "No");
}

void printans(){

}


int main(){
//	std::ios::sync_with_stdio(false);
	prework();
	int T = 1;
//	cin>>T;
	for(int i = 1; i <= T; i++){
		read();
		solve(i);
		printans();
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

int N,M,odd,A[MX];
vi B;

void ad(int x) {
    if (x) B.pb(x);
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin >> N >> M;
    F0R(i,M) {
        cin >> A[i];
        if (A[i]&1) odd ++;
    }
    if (N == 1) {
        cout << A[0] << "\n" << 1 << "\n" << A[0];
        exit(0);
    }
    if (M == 1) {
        cout << A[0] << "\n" << 2 << "\n" << A[0]-1 << " 1\n";
        exit(0);
    }
    F0R(i,M) if (A[i]&1) {
        swap(A[i],A[0]);
        break;
    }
    FOR(i,1,M) if (A[i]&1) {
        swap(A[i],A[M-1]);
        break;
    }
    if (N % 2 == 0) {
        if (odd > 2) {
            cout << "Impossible";
            exit(0);
        } 
    } else {
        if (odd > 1) {
            cout << "Impossible";
            exit(0);
        }
    }
    F0R(i,M) cout << A[i] << " ";
    cout << "\n";
    F0R(i,M) {
        if (i == 0) ad(A[i]+1);
        else if (i == M-1) ad(A[i]-1);
        else ad(A[i]);
    }
    cout << sz(B) << "\n";
    for (int i: B) cout << i << " ";
}

// read the question correctly (is y a vowel? what are the exact constraints?)
// look out for SPECIAL CASES (n=1?) and overflow (ll vs int?) ARRAY OUT OF BOUNDSS

Measured memory_bytes: 256
# for #!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion
class union_find:
    def __init__(self, n):
        self.n = n
        self.rank = [0]*n
        self.parent = [int(j) for j in range(n)]
    
    def union(self,i,j):
        i = self.find(i)
        j = self.find(j)
        if self.rank[i] == self.rank[j]:
            self.parent[i] = j
            self.rank[j] += 1

        elif self.rank[i] > self.rank[j]:
            self.parent[j] = i
        else:
            self.parent[i] = j

    def find(self, i):
        temp = i
        if self.parent[temp] != temp:
            self.parent[temp] = self.find(self.parent[temp])
        return self.parent[temp]
from math import log2, ceil
def main():
# Enter your code here. Read input from STDIN. Print output to STDOUT
    # for t in range(int(input())):
        
        # n = int(input())
        n,k  =[int(j) for j in input().split()]
        ans=0
        for i in range(n):
            a,b = [int(j) for j in input().split()]
            if(a**2+b**2<=k**2):
                ans+=1
        print(ans)
        # print(m)
        


        # n,k,z  =[int(j) for j in input().split()]
        



if __name__ == "__main__":
    main()

Measured memory_bytes: 77724
#include<bits/stdc++.h>
using namespace std;
int main(){
    string input;
    long long ans=0;
    cin>>input;
    for(int i=1;i<input.length();i++){
        if(input[i-1]!=input[i])  ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????


		Scanner scan = new Scanner(System.in);
		
		for (int i = 1; i > 0; i++) {
			int x = scan.nextInt();
			if(x == 0) {
				break;
			}
			else{
				System.out.println("Case " + i + ": " + x);
			}
		}
	}

}

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

using namespace std;
typedef pair<int, int> P;

int par[2][200001];

void init(int n) {
  for (int i = 1; i <= n; i++) {
    par[0][i] = par[1][i] = i;
    }
}

int find(int i, int x) {
  if (par[i][x] == x) return x;
  return par[i][x] = find(i, par[i][x]);
}

void unite(int i, int x, int y) {
  x = find(i, x);
  y = find(i, y);
  if (x != y) par[i][x] = y;
}

int main(void) {
  int n, K, L, x, y;
  cin >> n >> K >> L;

  init(n);
  for (int i = 0; i < K; i++) {
    cin >> x >> y;
    unite(0, x, y);
  }
  for (int i = 0; i < L; i++) {
    cin >> x >> y;
    unite(1, x, y);
  }

  map<P, int> mp;
  for (int i = 1; i <= n; i++) {
    mp[P(find(0, i), find(1, i))]++;
  }

  for (int i = 1; i <= n; i++) {
    if (i != 1) cout << " ";
    cout << mp[P(find(0, i), find(1, i))];
  }
  cout << endl;
  
  return 0;
}

Measured memory_bytes: 13568
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

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

using namespace std;

int main()
{
  string S;
  cin >> S;
  
  int ans = 0;
  int cnt = 0;
  for(char a: S)
  {
    switch(a)
    {
        case 'A':
        case 'T':
        case 'C':
        case 'G':
        	cnt++;
        	break;
        
      default:
        cnt = 0;
        break;
    }
    
    ans = max(ans,cnt);
  }
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), ", ", cout) << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, string sep = " ", ostream &os = cout)
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p)
{
    os << '(' << p.first << ", " << p.second << ')';
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), ", ", os) << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, N);
    AIN(ll, x, N);
    vii p(N);
    REP(i, N)
    {
        p[i] = {x[i], i + 1};
    }
    SORT(p);
    vi h, t;
    for (auto [_, i] : p)
    {
        REP(j, i - 1)
        {
            h.push_back(i);
        }
        REP(j, N - i)
        {
            t.push_back(i);
        }
    }
    FOR(e, t)
    {
        h.push_back(e);
    }
    vi a(N * N);
    REP(i, N)
    {
        a[x[i] - 1] = i + 1;
    }
    ll j = 0;
    REP(i, N * N)
    {
        if (a[i] == 0)
        {
            a[i] = h[j];
            ++j;
        }
    }
    REP1(k, N)
    {
        ll c = 0;
        REP(i, x[k - 1])
        {
            c += a[i] == k;
        }
        if (c != k)
        {
            OUT("No");
            return 0;
        }
    }
    OUT("Yes");
    JOUT(ALL(a)) << endl;
}

Measured memory_bytes: 8180
from string import ascii_lowercase as alph

def gen_pattern(N, pre=""):
  for c in alph[:ord(max(pre or "\x60"))-0x5f]:
    pattern = pre+c
    if len(pattern) == N:
      yield pattern
    else:
      yield from gen_pattern(N, pattern)

for pattern in gen_pattern(int(input())):
  print(pattern)


Measured memory_bytes: 4984
// ABC142_A
#include <iostream>
#include <string>
#include <vector>
#include <iterator>  // std::prev(iter, n) n 個分デクリメントしたイテレータ
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;
using ll = long long;

#define REP(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define MIN(vec) min_element(vec.begin(), vec.end())  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(vec.begin(), vec.end())
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(vec.begin(), vec.end(), 0LL)  // 0 は初期値
#define pll pair<ll, ll>
#define F first
#define S second
const ll INF = 1LL<<60;  // 10^18（const int inf   = 1<<29;）

int main() {
    // input(sunippets: inpv, inpn, inps)
    ll N;
    cin >> N;
    
    // calculation
    ll odd = (N+1)/2;
    double p = (double)odd/(double)N;
    
    cout << setprecision(10) << p << "\n";
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <string>

using namespace std;

int main() {

	int a, b;
	cin >> a >> b;

	if (a <= 8 && b <= 8) {
		cout << "Yay!" << endl;
	}
	else {
		cout << ":(" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <set>
#include <stdio.h>
#include <cmath>
#include <queue>
#include <cmath>
#include <math.h>

typedef long long ll;
using namespace std;

int main(void){
    int R;
    cin >> R;
    printf("%.13f\n",2*M_PI*R);
}



Measured memory_bytes: 3720
#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp>
using namespace std;
using ll=long long;

int main() {
  ll a,b,c;
  cin >> a >> b >> c;
  if(a+b>=c)
  cout << "No" << endl;
  else{
    if(2*powl(a*b,0.5)<c-a-b)
    cout << "Yes" << endl;
    else
    cout << "No" << endl;
  }
}



Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//get the biggest element.
template<typename KeyType, typename ValueType>
std::pair<KeyType,ValueType> get_max( const std::map<KeyType,ValueType>& x ) {
  using pairtype=std::pair<KeyType,ValueType>;
  return *std::max_element(x.begin(), x.end(), [] (const pairtype & p1, const pairtype & p2) {
        return p1.second < p2.second;
  });
}
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;

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

  rep(i, 5) {
    if (a[i] == 0) cout << i + 1 << endl;
  }
  return 0;
}


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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; i++) cin >> A[i];

    multiset<int> ms;
    for(auto a : A)
    {
        if(ms.empty() || *ms.begin() >= a) ms.insert(a);
        else
        {
            auto itr = ms.lower_bound(a);
            if(itr == ms.end() || *itr >= a) itr--;
            ms.erase(itr);
            ms.insert(a);
        }
    }
    cout << ms.size() << endl;

    return 0;
}


Measured memory_bytes: 8220
#include <iostream>
#include <cmath>
#include <string>
#include <string.h>
#include <cstdlib>
#include <iomanip>
#include <stdio.h>

using namespace std;

int main(){

        int n,b,f,r,v;
        int room[4][3][10];
        memset(room,0,sizeof(room));

        scanf("%d\n",&n);

        for(int i=0;i<n;i++){
                scanf("%d %d %d %d\n",&b,&f,&r,&v);
                room[b-1][f-1][r-1] += v;
        }

        for(int i=0;i<4;i++){
                for(int j=0;j<3;j++){
                        for(int k=0;k<10;k++){
                                printf(" %d",room[i][j][k]);
                        }
                        putchar('\n');
                }
                if(i<3)
                        puts("####################");
        }


        return 0;
}


Measured memory_bytes: 3212
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			if (n == 0)
				break;
			int sum = 0;
			int index = -1;

			for (int i = 0; i < 12; i++) {
				int a = scanner.nextInt();
				int b = scanner.nextInt();
				sum += a - b;
				if (sum >= n) {
					index = i + 1;
					sum = Integer.MIN_VALUE;
				}
			}
			System.out.println(index == -1 ? "NA" : index);
		}
	}
}

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

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define INF  numeric_limits<int>::max()
#define NINF numeric_limits<int>::min()
#define N_MAX 1000000
#define M_MAX 1000000

using namespace std;
using ll = long long;

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

    int N, M;

    std::cin >> N >> M;
    vector<pair<int, int>> drink_info_v;
    REP(i, N) {
        int a, b;
        std::cin >> a >> b;
        drink_info_v.push_back(make_pair(a, b));
    }
    sort(drink_info_v.begin(), drink_info_v.end());

    ll cnt = 0;
    ll ans = 0;
    for(auto drink_info : drink_info_v) {
        ll price = drink_info.first;
        ll num   = drink_info.second;
        if(num < M - cnt) {
            ans += price * num;
            cnt += num;
        }
        else {
            ans += price * (M - cnt);
            break;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}


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

int main(void){
	int k,x;
	scanf("%d%d",&k,&x);
	for(int i=x-k+1;i<=x+k-1;i++){
		printf("%d%c",i,i==(x+k-1)?'\n':' ');
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String[] args){
		int n,m;
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt();
		m = sc.nextInt();
		if(n > m){
			int tmp = m;
			m = n;
			n = tmp;
		}
		for(int i = 0;i < m; ++i){
			System.out.printf("%d",n);
		}
	}
}

Measured memory_bytes: 21844
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod= 998244353 ;

int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    int m = 3*n;
    vector<int> low, mid, high;
    priority_queue<int,vector<int>,greater<int>> r,g,b;
    rep(i,m){
        if(s[i]=='G')g.push(i);
        if(s[i]=='R')r.push(i);
        if(s[i]=='B')b.push(i);
    }
    rep(i,n){
        int f = 0;
        if(g.top()<r.top()&&g.top()<b.top()){
            low.push_back(g.top());f=1;
        }
        else if(r.top()<g.top()&&r.top()<b.top()){
            low.push_back(r.top());f=2;
        }
        else if(b.top()<r.top()&&b.top()<g.top()){
            low.push_back(b.top());f=4;
        }
        if(f==1){
            if(r.top()<b.top()){
                mid.push_back(r.top());f=3;
            }
            else {
                mid.push_back(b.top());f=5;
            }
        }
        if(f==2){
            if(g.top()<b.top()){
                mid.push_back(g.top());f=3;
            }
            else {
                mid.push_back(b.top());f=6;
            }
        }
        if(f==4){
            if(r.top()<g.top()){
                mid.push_back(r.top());f=6;
            }
            else {
                mid.push_back(g.top());f=5;
            }
        }
        if(f==3)high.push_back(b.top());
        if(f==5)high.push_back(r.top());
        if(f==6)high.push_back(g.top());
        g.pop();r.pop();b.pop();
    }
    ll ans = 1;
    rep(i,n){
        ll cnt = lower_bound(low.begin(),low.end(),mid[i])-low.begin();
        ans = ans * (cnt-i) %mod;
    }
    rep(i,n){
        ll cnt = lower_bound(mid.begin(),mid.end(),high[i])-mid.begin();
        ans = ans * (cnt-i) %mod;
    }
    rep(i,n)ans = ans * (i+1) %mod;
    cout<<ans<<endl;
    return 0;
}

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

int n,k,w[100000];

//?????????P???????????????k??°?????¨?????????????????????????????????
int loadNum(int P){
	int l_num=0,t_num=0,t=0;
	for(int i=0;i<n;i++){
		if(w[i] > P){
			return l_num;
		}else if((w[i] + t) > P){
			t = w[i];
			t_num++;
			if(t_num == k) return l_num;
		}else{
			t += w[i];
		}
		l_num++;
	}
	return n;
}

int binarySearch(){
	int left=0,right=1000000000;
	while(right-left>1){
		int mid = (left + right)/2;
		if(loadNum(mid) < n){
			left = mid;
		}else{
			right = mid;
		}
	}
	return right;
}

int main(){
	cin>>n>>k;
	for(int i=0;i<n;i++){
		cin>>w[i];
	}
	int ans;
	ans = binarySearch();
	cout<<ans<<endl;
	return 0;
	
}

Measured memory_bytes: 1548
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
s,t = list(map(str, stdin.readline().rstrip().split()))
ans = ''
for i in range(N):
	ans += s[i] + t[i]
print(ans)


Measured memory_bytes: 41584
//////////////////////////////
//////////////////////////////
////                      ////
////  Please give me AC!  ////
////  Please give me AC!  ////
////                      ////
//////////////////////////////
//////////////////////////////
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const int MOD=1e9+7;
const long double Pi=acos(-1);
using  P=pair<ll,ll>;
ll gcd(ll a,ll b){//aとbの最大公約数を返す
  if(a%b==0){return b;}
  else{return gcd(b,a%b);}
}
ll lcm(ll a,ll b){//aとbの最小公倍数を返す
  return a*b/gcd(a,b);
}
ll pow(ll x,ll y){//x^yを返す
  ll tmp=x,res=1;
  while(y){
    if(y%2){res=res*tmp%MOD;}
    y>>=1;
    tmp=tmp*tmp%MOD;
  }
  return res;
}
ll nature(ll a){//絶対値を返す
  if(a>=0){return(a);}
  else{return(-1*a);}
}
ll prime(ll a){//素数なら1を返す
  if(a==2){return 1;}
  else if(a%2==0 || a==1){return 0;}
  for(ll i=3;i*i<=a;i+=2){if(a%i==0){return 0;}}
  return 1;
}
int main(){
  ll X,K;
  cin>>K>>X;
  ll a=max((ll)-1000000,X-(K-1));
  ll b=min((ll)1000000,X+(K-1));
  for(ll i=a;i<=b;i++){
    cout<<i<<" ";
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

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

  int num0,num1,num2;

  if(X>Y){
    num0=2*Y*C+A*(X-Y);
    num2=2*X*C;
  }
  else{
    num0=2*X*C+B*(Y-X);
    num2=2*Y*C;
  }

  num1=A*X+B*Y;

  cout<<min(num0,min(num1,num2))<<endl;

  return 0;
}


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

#define rep(i,s,e) for(int i = (s);i <= (e);i++)

int n;
int p;
vector<int> a;
vector<int> mod;

typedef long long i64;

i64 dp[100][2];

int main()
{
    cin >> n >> p;
    a.assign(n + 1 , 0);
    mod.assign(n + 1,0);
    rep(i,1,n) cin >> a[i];
    rep(i,1,n) mod[i] = a[i] % 2;

    dp[0][0] = 1;
    rep(i,1,n)
    {
        rep(j,0,1)
        {
            dp[i][j] += dp[i - 1][j];
            dp[i][j] += dp[i - 1][j ^ mod[i]];
        }
    }

    cout << dp[n][p] << endl;
    
}

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

int main() {
  unsigned int N;
  cin >> N;

  string N_str = to_string(N);
  unsigned int SN = 0;
  for (size_t i = 0; i < N_str.length(); ++i) {
    SN += N_str[i] - '0';
  }

  if (N % SN == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <limits>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (ap).end()

using ll = long long;
constexpr ll INF = std::numeric_limits<ll>::max()>>2;

ll N;
ll dp[100010];

int main()
{
  scanf( "%lld", &N );

  std::fill( dp, dp+N+1, INF );

  dp[0] = 0;
  repi( i, 1, N+1 )
  {
    dp[i] = std::min( dp[i], dp[i-1]+1 );

    ll p = 1;
    for( int j = 1; i-p >= 0; ++j )
    {
      p *= 6;

      if( i-p < 0 )
        break;

      dp[i] = std::min( dp[i], dp[i-p]+1 );
    }

    p = 1;
    for( int j = 1; i-p >= 0; ++j )
    {
      p *= 9;

      if( i-p < 0 )
        break;

      dp[i] = std::min( dp[i], dp[i-p]+1 );
    }
  }

  printf( "%lld\n", dp[N] );
  
  return 0;
}

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

int n,q;
string s;
char t[200010],d[200010];

int solve(int now){
    for(int i=0;i<q;i++){
        if(s[now]==t[i]){
            if(d[i]=='L') now--;
            else now++;
            if(now==-1) return -1;
            else if(now==n) return 1;
        }
    }
    return 0;
}

int main(){
    cin>>n>>q;
    cin>>s;
    for(int i=0;i<q;i++){
        cin>>t[i]>>d[i];
    }

    long long int low=-1,up=n,mid;
    while(up-low>1){
        mid=(up+low)/2;
        //上半分か下半分の条件を求める
        //上半分の時
        if(solve(mid)<1){
            low=mid;
        }
    
        //下半分の時
        else{
            up=mid;
        }
    }
    int ans=n;
    ans-=n-low;

    low=-1,up=n;
    while(up-low>1){
        mid=(up+low)/2;
        //上半分か下半分の条件を求める
    
        //上半分の時
        if(solve(mid)==-1){
            low=mid;
        }
    
        //下半分の時
        else{
            up=mid;
        }
    }
    ans-=low;
    cout<<ans<<endl;


}




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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif

    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    tx -= sx;
    ty -= sy;

    char xp, xm, yp, ym;

    // 右上
    if (tx > 0 && ty > 0) {
        xp = 'R';
        xm = 'L';
        yp = 'U';
        ym = 'D';
    }
    // 右下
    else if (tx > 0 && ty < 0) {
        xp = 'R';
        xm = 'L';
        yp = 'D';
        ym = 'U';
    }
    // 左下
    else if (tx < 0 && ty < 0) {
        xp = 'L';
        xm = 'R';
        yp = 'D';
        ym = 'U';
    }
    // 左上
    else {
        xp = 'L';
        xm = 'R';
        yp = 'U';
        ym = 'D';
    }

    string ans;

    tx = abs(tx);
    ty = abs(ty);

    for (int i = 0; i < ty; i++) {
        ans += yp;
    }
    for (int i = 0; i < tx; i++) {
        ans += xp;
    }
    for (int i = 0; i < ty; i++) {
        ans += ym;
    }
    for (int i = 0; i < tx; i++) {
        ans += xm;
    }

    ans += xm;

    for (int i = 0; i < ty + 1; i++) {
        ans += yp;
    }
    for (int i = 0; i < tx + 1; i++) {
        ans += xp;
    }

    ans += ym;
    ans += xp;

    for (int i = 0; i < ty + 1; i++) {
        ans += ym;
    }
    for (int i = 0; i < tx + 1; i++) {
        ans += xm;
    }

    ans += yp;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

int main(){
    int m1, d1, m2, d2;
    std::cin >> m1 >> d1 >> m2 >> d2;

    int ans = 0;
    if(m1 != m2){
        ans = 1;
    }

    std::cout << ans << std::endl;

    return 0;
}

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

using std::cin;
using std::cout;
using std::endl;
using std::string;

string in;


int main()
{


	in = "mmemewwemewww";
	cin >> in;

	if(in.find("mewmew", 0) != string::npos)
	{
		cout << "Rabbit" << endl;
		return 0;
	}


	while(true)
	{
		bool changed = false;

		//replace
		string from = "mew";
		string to = "";


		std::string::size_type pos = 0;
	    while(pos = in.find(from, pos), pos != std::string::npos) {
        	in.replace(pos, from.length(), to);
        	pos += to.length();
			changed  = true;
    	}


		//mew???2?????\????¶???????, replace??????????????£??????Rabbit
		if(in.find("mewmew", 0) != string::npos || !changed)
		{
			cout << "Rabbit" << endl;
			break;
		}

		//mew???""???????????°Cat
		if(in == "mew" || in == "")
		{
			cout << "Cat" << endl;
			break;
		}
	}


	return 0;
}

Measured memory_bytes: 3208
object Main extends App {
var loop = readLine.split(" ")(1).toInt
var word = readLine
var count : Array[Int] = new Array(word.size)
	for(i <- 1 to word.size - 1) {
    	count(i) = 
     		if(word(i-1)=='A' && word(i)=='C') count(i - 1) + 1 
    		else count(i - 1)
    }
  	for(i <- 0 to loop - 1) {
      var position = readLine.split(" ")
    	println(count(position(1).toInt - 1) - count(position(0).toInt - 1))
    }
}

Measured memory_bytes: 46736
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll 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;

const int INF = 1001001001;

int main(void){
  vector<int> a(3);
  REP(i, 3) cin >> a[i];
  sort(ALLr(a));
  int ans = 0;
  REP(i, 2) ans += abs(a[i+1] - a[i]);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O2") // "Ofast" for REAL FAST
// #pragma GCC optimization ("unroll-loops")

// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-label"

#include <bits/stdc++.h>
#define DEBUG 1

using namespace std;

#define rep(i, a, b) for (i = (a); i < (b); i++)
#define trav(a, x) for (auto & a : x)
#define all(x) (x).begin (), (x).end ()
#define rall(x) (x).rbegin (), (x).rend ()
#define sz(x) (int) (x).size ()
#define FASTIO cin.sync_with_stdio (0); cin.tie (0); cin.exceptions (cin.failbit);

typedef long long ll;

typedef pair <int, int> pii;
#define f first
#define s second
#define mp(x, y) make_pair (x, y)

typedef vector <int> vi;
#define pb(x) push_back (x)

#define ddcout if (DEBUG) cout
#define ddprintf(fmt, ...) if (DEBUG) printf (fmt, ##__VA_ARGS__)

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x3f3f3f3f3f3f3f3f;
const int  INFi  =  0x3f3f3f3f;
const ll   MAXN  =  1e+6+7; // UPDATE

int main ()
{
    FASTIO;
    ll i, j, c;
    scanf ("%lld", &i);
    if (i < 10 || i%2)
        printf ("0\n");
    else
    {
        for (c = (i /= 10), j = 5; i/j >= 1; j *= 5)
            c += i / j;
        printf ("%lld\n", c);
    }

    return 0;
}


Measured memory_bytes: 256
import copy
N = int(input())
C = [[int(i) for i in input().split()] for i in range(N)]
pq_list = []
min_score = N
for i in range(N):
    for j in range(N):
        if(i == j):
            continue
        p = C[i][0] - C[j][0]
        q = C[i][1] - C[j][1]
        pq_list.append([p, q])

for i in range(len(pq_list)):
    score = N
    p = pq_list[i][0]
    q = pq_list[i][1]
    if(p >= 0):
        C.sort(key=lambda x: x, reverse=True)
    else:
        C.sort(key=lambda x: x, reverse=False)
    for j in range(N-1):
        for k in range(j+1, N):
            if((C[j][0] == C[k][0] + p) and (C[j][1] == C[k][1] + q)):
                score += -1
                break
    min_score = min(min_score, score)
    
print(min_score)

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Console.WriteLine("{0}",N == 1 ? "Hello World" : (A + B).ToString());
	}
	int N;
	int A,B;
	public Sol(){
		N = ri();
		if(N == 2){
			A = ri();
			B = ri();
		}
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11220
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_nl = lambda: list(map(int, readline().split()))
in_na = lambda: map(int, read().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():
    N = in_n()

    for a in range(1, 3500):
        for b in range(a, 3500):
            t1 = N * a * b
            t2 = 4 * a * b - N * (a + b)
            if t2 == 0:
                continue
            else:
                c = t1 / t2
                if c.is_integer() and 1 <= c:
                    print(a, b, int(c))
                    exit()


if __name__ == '__main__':
    main()


Measured memory_bytes: 9236
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

N, K = (int(i) for i in input().split())
A = [int(i) for i in input().split()]
bit = Bit(2000)
ans = 0
hist = [0] * 3
for i in range(min(K, 3)):
    for j in range(N):
        ans = ans + i*N + j - bit.sum(A[j])
        bit.add(A[j], 1)
    hist[i] = ans
if K <= 3:
    print(ans)
else:
    ans = hist[0]
    a = (hist[1] - hist[0])
    d = (hist[2] - hist[1]) - (hist[1] - hist[0])
    ans = ans + (K-1) * (2*a + (K-2)*d) // 2
    print(int(ans % (1000000007)))

Measured memory_bytes: 3188
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    Norg = N

    ans = []

    N -= 1
    while N >= 26:
        ans.append(N % 26)
        N = N // 26 - 1

    ans.append(N)

    ansstr = []
    for i, a in enumerate(ans[::-1]):
        ansstr.append(chr(ord("a") + a))
    print("".join(ansstr))

if __name__ == '__main__':
    main()


Measured memory_bytes: 8980
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    s = S()
    if s == "ABC":
        return "ARC"

    return "ABC"


print(main())





Measured memory_bytes: 10896