akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define int ll

const ll MOD = 1000000007;
const ll INF_LL = (ll)1000000007 * 1000000007;
const int INF_INT = (int)1000000007;
const double PI = 3.14159265358979323846;

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for (auto itr = (st).rbegin(); itr != (st).rend(); ++itr)

#define m0(x) memset((x), 0, sizeof((x)))
#define m1(x) memset((x), -1, sizeof((x)))

// xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define RALL(x) (x).rbegin(), (x).rend()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())     // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))  //最大値を求める
#define MIN(x) *min_element(ALL(x))  //最小値を求める
#define all(x) (x).begin(), (x).end()

//略記
#define pb emplace_back  // vectorヘの挿入
#define mp make_pair     // pairのコンストラクタ
#define F first          // pairの一つ目の要素
#define S second         // pairの二つ目の要素

#define BITCOUNT __builtin_popcount
#define BITCOUNT_LL(x) __builtin_popcountll(x)

#define perm(c)             \
  sort(all(c));             \
  for (bool c##p = 1; c##p; \
       c##p = next_permutation(all(c)))  //順列 123 132 213 231 312 321

#define BIT(n) (1LL << (n))

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ": " << (A) << std::endl;
#else
#define PRINT(A)
#endif

//入力高速化
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

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

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

signed main() {
  int X, Y;
  cin >> X >> Y;
  bool ok = false;
  rep(i, X+1) {
    if (((X - i) * 2 + i * 4) == Y) ok = true;
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3608
let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let rec iter i t_prev x_prev y_prev =
    if i = n then print_string "Yes"
    else
      let (t_next, x_next, y_next) = Scanf.scanf "%d %d %d\n" (fun t x y -> (t, x, y)) in
      let ok =
        let t = t_next - t_prev in
        let d = (abs (x_next - x_prev)) + (abs (y_next - y_prev)) in
        (t >= d) && ((t - d) mod 2 = 0)
      in
      if ok then iter (i + 1) t_next x_next y_next
      else print_string "No"
  in iter 0 0 0 0


Measured memory_bytes: 2688
/**
*    author:  boutarou
*    created: 05.07.2020 22:16:50
**/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < int(n); i++)
#define fcout cout << fixed << setprecision(15)
using lint = long long;
using P = pair<int, int>;

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

const double PI = 3.1415926535897932;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    lint n;
    lint ans = 0;
    cin >> n;
    vector<pair<lint, lint>> u(n - 1);
    rep(i, n - 1) {
        cin >> u[i].first >> u[i].second;
        u[i].first--; u[i].second--;
        if (u[i].first > u[i].second) swap(u[i].first, u[i].second);
    }
    rep(i, n) {
        ans += (1 + n - i) * (n - i) / 2;
    }
    rep(i, n - 1) {
        lint l = u[i].first + 1;
        lint r = n - u[i].second;
        ans -= l * r;
    }
    cout << ans << endl;
    
    return 0;
}

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

using namespace std;

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

constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;

//===


using Graph = std::vector<std::vector<int>>;


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

	int N;
	cin >> N;

	Graph g(N);
	int e = 0;

	if (N % 2 == 0) {
		for (int i = 0; i < N; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (j != N - 1 - i) {
					g[i].push_back(j);
					++e;
				}
			}
		}
	}
	else {
		for (int i = 0; i < N; ++i) {
			for (int j = i + 1; j < N; ++j) {
				if (j != N - 2 - i) {
					g[i].push_back(j);
					++e;
				}
			}
		}
	}


	cout << e << "\n";
	for (int i = 0; i < N; ++i) {
		for (const auto& to : g[i]) {
			cout << i + 1 << " " << to + 1 << "\n";
		}
	}

	return 0;
}

Measured memory_bytes: 384
#include <complex>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <cmath>
 
using namespace std;
 
typedef long double ldb;
typedef complex<ldb> P;
 
const ldb eps = 1e-8;
// math.hのM_PIでもOK?
const ldb pi = acos(-1);
// 誤差を考慮した比較 sig(a-b) のように使う
// ret<0 なら a<b, ret>0 なら a>b, ret=0 なら a=b
int sig(ldb a) {return (a<-eps)?-1:(a>eps)?1:0;}
// 誤差を考慮した比較
bool eq(ldb a,ldb b){return abs(a-b)<eps;}
// 内積
ldb dot(P a, P b) {
  return (a.real() * b.real() + a.imag() * b.imag());
}
// 外積
ldb cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
 
// 直線,線分 (半直線は未確認だけど線分で無限に長いものを作れば良さそう)
struct L {
  P a,b;
  L(){}
  L(P a,P b):a(a),b(b){}
  ldb len(){return abs(a-b);}
  P vec(){return b-a;}
};
 
// 線分abに対する点xの位置
enum CCW{FRONT = 1, RIGHT = 2, BACK = 4, LEFT = 8, ON = 16};
int ccw(L s, P p) {
  P a = s.vec();
  p -= s.a;
  ldb cr = cross(a, p);
  if (eq(cr, 0)) {
    if (sig(dot(a, p)) < 0) return BACK;
    if (sig(norm(a) - norm(p)) < 0) return FRONT;
    return ON;
  }
  return (cr > 0) ? LEFT : RIGHT;
}
 
// "線分"a と 点b の距離
double dLP2(L a,P b) {
  if ( dot(a.b-a.a, b-a.a) < eps ) return abs(b-a.a);
  if ( dot(a.a-a.b, b-a.b) < eps ) return abs(b-a.b);
  return abs(cross(a.b-a.a, b-a.a)) / abs(a.b-a.a);
}
 
int main(void)
{
  int n;
  ldb r;
  int done[111];
  ldb x[111],y[111],s[111],v[111];
  ldb vx[111],vy[111];
  for(;;) {
    scanf("%Lf%d",&r,&n); if( r+n == 0 ) break;
    for( int i = 0; i < n; i++ ) {
      scanf("%Lf%Lf%Lf%Lf",x+i,y+i,s+i,v+i);
      ldb ang = atan2(y[i],x[i]);
      vx[i] = -v[i]*cos(ang);
      vy[i] = -v[i]*sin(ang);
      done[i] = 0;
    }
    int res = 0;
    for(;;) {
      for( int i = 0; i < n; i++ ) {
        if( done[i] ) continue;
        ldb nx = x[i] + vx[i];
        ldb ny = y[i] + vy[i];
        ldb dist = dLP2(L(P(x[i],y[i]),P(nx,ny)),P(0,0));
        if( sig(dist-r) <= 0 ) {
          ++res;
          done[i] = 2;
        }
        x[i] = nx;
        y[i] = ny;
      }
      int mi = -1;
      for( int i = 0; i < n; i++ ) {
        if( done[i] ) continue;
        if( mi == -1 || sig(abs(P(x[i],y[i]))-abs(P(x[mi],y[mi]))) < 0 ) {
          mi = i;
        }
      }
      //printf("%d\n",mi);
      if( mi < 0 ) break;
      const ldb w = 1e7;
      P a = P(x[mi],y[mi]);
      a = a/abs(a);
      L l(a*r+a*eps,a*w);
      for( int i = 0; i < n; i++ ) {
        if( done[i] ) continue;
        ldb dist = dLP2(l,P(x[i],y[i]));
        //printf("%Lf %Lf %Lf\n",dist,x[i],y[i]);
        if( sig(dist-s[i]) <= 0 ){
          done[i] = 1;
        }
      }
      /*
      for( int i = 0; i < n; i++ ) {
        printf("%d:%c ",i,done[i]==0?'o':(done[i]==1?'x':'c'));
      }
      puts("");
      //*/
    }
    printf("%d\n",res);
  }
  return 0;
}

Measured memory_bytes: 1100
// includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>
#include <list>
#include <random>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for(int i=((int)(n)-1);i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
typedef pair<double, double> Pd;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;
const int mod = 1e9 + 7;

// solve
template <class T>bool chmax(T &a, const T &b){if(a < b){a = b; return 1;} return 0;}
template <class T>bool chmin(T &a, const T &b){if(a > b){a = b; return 1;} return 0;}


int main(int argc, char const* argv[])
{
  ll s;
  cin >> s;
  set<ll> st;
  st.insert(s);
  while(true){
    if(s % 2 == 0)s /= 2;
    else s = 3 * s + 1;
    if(st.find(s) == st.end())st.insert(s);
    else{
      cout << st.size() + 1 << endl;
      return 0;
    }
  }
	return 0;
}


Measured memory_bytes: 256
/**
 * ??¨????????????????????????????????????????????????????????????????????????????¨??????????
 */

#include <bits/stdc++.h>

using namespace std;

typedef struct Card
{
	char suit,value;
}Card;

// ????????????
void bubble(Card c1[], int N){
	bool flag = true;
	for (int i = 0; flag; ++i)
	{	
		flag = false;
		for (int j = N-1; j >= i+1; --j)
		{
			if(c1[j].value < c1[j-1].value) {
				swap(c1[j], c1[j-1]);
				flag = true;
			}
		}
	}
}

// ????????????
void selection(Card c2[], int N){
	int minj;
	for (int i = 0; i < N-1; ++i)
	{	
		minj = i;
		for (int j = i+1; j < N; ++j)
		{
			if(c2[j].value < c2[minj].value) minj = j;
		}
		swap(c2[i], c2[minj]);
	}
}

// ??????
void print(Card c[], int N){
	for (int i = 0; i < N; ++i)
	{
		if(i) printf(" ");
		cout << c[i].suit << c[i].value;
	}
	printf("\n");
}

// ??????????????????
bool isStable(Card c1[], Card c2[], int N){
	for (int i = 0; i < N; ++i)
	{
		if(c1[i].suit != c2[i].suit || c1[i].value != c2[i].value) return false;
	}
	return true;
}

int main(){
	//freopen("in.txt", "r", stdin);
	Card c1[100],c2[100];
	int N;
	while(cin >> N) {
	    for(int i = 0; i < N; i++) {
	    	cin >> c1[i].suit >> c1[i].value;
	    	c2[i] = c1[i];
	    }
	    bubble(c1, N);
	    selection(c2, N);
	    print(c1, N);
	    cout << "Stable" << endl;
	    print(c2, N);
	    if(isStable(c1, c2, N)){
	    	cout << "Stable" << endl;
	    } else cout << "Not stable" << endl;
	}
	return 0;
}

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

int main(){
    int X, N;
    cin >> X >> N;
    vector<int> p(N);
    rep(i, N) cin >> p[i];

    int diff = 0;
    int ans;
    int i;

    while(1){
        for(i = 0; i < N; i++){
            if (p[i] == X-diff){
                break;
            }
        }
        if (i == N){
            ans = X-diff;
            cout << ans << endl;
            return 0;
        }
        for(i = 0; i < N; i++){
            if (p[i] == X+diff){
                break;
            }
        }
        if (i == N){
            ans = X+diff;
            cout << ans << endl;
            return 0;
        }
        diff++;
    }
 

    return 0;
}

Measured memory_bytes: 3616
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int H,W;
        int i,j;
        while(true){
            H=sc.nextInt();
            W=sc.nextInt();
            if(H==0&&W==0) break;
            for(i=0;i<H;i++){
                for(j=0;j<W;j++){
                    if((i+j)%2==1){
                        System.out.print(".");
                    }else{
                        System.out.print("#");
                    }
                }
                System.out.println("");
            }
            System.out.println("");
        }
    }
}


Measured memory_bytes: 32884
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

int main() {
  ll n,c;
  cin>>n>>c;
  vector<P> v[c];
  rep(i,n){
    ll s1,t1,c1;
    cin>>s1>>t1>>c1;
    c1--;
    v[c1].push_back(make_pair(s1,t1));
  }
  vector<ll> C(100005,0);

  rep(i,c){
    //各チャンネルについて
    if (v[i].size()==0)continue;
    sort(v[i].begin(),v[i].end());
    ll now=-1;

    rep(j,v[i].size()){
      if (v[i][j].first>now){
        if (now>0)C[now]--;
        C[v[i][j].first-1]++;
        now=v[i][j].second;
      }
      else if (v[i][j].first==now){
        now=v[i][j].second;
      }
    }
    

    if (now>0)C[now]--;
  }

  ll ans=0;
  ll cnt=0;

  rep(i,100004){
    cnt+=C[i];
    ans=max(cnt,ans);
  }

  cout<<ans;

}


Measured memory_bytes: 3456
//Judge Status Summary

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define rep(i,x,y) for(ll i=x;i<y;i++)
#define irep(i,a) for(auto i = a.begin(); i != a.end(); ++i)
#define nvarep(n,a) ll n;cin>>n;vector<ll>a(n);rep(i,0,n)cin>>a[i]
#define vecrep(n,a,type) vector<type>a(n);rep(i,0,n)cin>>a[i]
#define lcm(a,b) (a/__gcd(a, b)*b)
#define range(a) (a).begin(),(a).end() 
#define pb push_back
#define mp make_pair
#define nnn "\n"
#define spa " "
using p = pair<ll, string>;
using garph = vector<vector<ll>>;
const int inf = 2147483647;//2*10^9
const ll INF = 9223372036854775807;//9*10^18

signed main (){
    int n;cin>>n;
    vector<int>ans(4,0);
    rep(i,0,n){
        string s;cin>>s;
        if(s=="AC")ans[0]++;
        else if(s=="WA")ans[1]++;
        else if(s=="TLE")ans[2]++;
        else if(s=="RE")ans[3]++;
    }
    cout<<"AC x "<<ans[0]<<nnn;
    cout<<"WA x "<<ans[1]<<nnn;
    cout<<"TLE x "<<ans[2]<<nnn;
    cout<<"RE x "<<ans[3]<<nnn;
    return 0;
}

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

#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9

using namespace std;

/**
 * calculate GCD(greatest common divisor)
 * @param a
 * @param b
 * @return
 */
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

/**
 * change minimum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T> inline bool changeMinimum(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * change maximum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T> inline bool changeMaximum(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * output answer
 * @tparam T
 * @param answer
 * @returna
 */
template<typename T>
T output(T answer) {
    cout << answer << endl;
    return 0;
}

/** ----from here ---------------------------------------------------------- */

int main() {

    int N;cin>>N;

    long long  ans = 0;
    for (int i = 1; i <= N; ++i) {
        for (int j = 1; j <=N ; ++j) {
            for (int k = 1; k <=N ; ++k) {
                ans += euclidean_gcd(i,euclidean_gcd(j,k));
            }
        }
    }

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

Measured memory_bytes: 3636
#include <iostream>
#include <bitset>
#include <algorithm>

using namespace std;

int main()
{
    //ios::sync_with_stdio(0);
	//cin.tie(NULL);
	const int MAX_VALUES = 101;
	bitset<MAX_VALUES> bits;
	bitset<MAX_VALUES> reversed;
	int x, n, t;
	cin >> x >> n;
    if (n == 0) {
        cout << x;
        exit(0);
    }
	for (int i = 0; i < n; i++) {
		cin >> t;
		bits.set(t);
		reversed.set(MAX_VALUES - 1 - t);
	}
    if (!bits[x]) {
        cout << x;
        exit(0);
    }
	bits.flip();
	reversed.flip();
	int rV = bits._Find_next(x);
	int lV = MAX_VALUES - 1 - reversed._Find_next(MAX_VALUES - 1 - x);
	int d1 = abs(rV - x);
	int d2 = abs(lV - x);
	if (d1 < d2) {
		cout << rV;
	}
	else if (d2 < d1) {
		cout << lV;
	}
	else {
		cout << min(rV, lV);
	}
	return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
#define LL long long
LL n, a, b, c, d;
bool ok;
int main () {
    scanf ("%lld%lld%lld%lld%lld", &n, &a, &b, &c, &d);
    for (LL k = 0; k <= n-1; k++) {
        LL m, M;
        M = k*d-(n-1-k)*c;
        m = k*c-(n-1-k)*d;
        if (b-a >= m && b-a <= M) {
            //printf ("%lld, %lld: %lld %lld", k, n-1-k, m, M);
            ok = true;
            break;
        }
    }
    if (ok) printf ("YES\n");
    else printf ("NO\n");
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        String S = sc.next();

        char[] alphabet = new char[26];
        char base = 'A';
        for(int i = 0; i < alphabet.length; i++) {
            alphabet[i] = base++;
        }
        StringBuilder sb = new StringBuilder();
        for(char c: S.toCharArray()) {
            for(int i = 0; i < alphabet.length; i++) {
                if(alphabet[i] == c) {
                    sb.append(alphabet[(i + N) % alphabet.length]);
                    break;
                }
            }
        }
        System.out.println(sb.toString());
    }

}


Measured memory_bytes: 25172
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

from heapq import heapify, heappush, heappop, heappushpop, heapreplace
from bisect import bisect_left, bisect_right

from math import atan, degrees

h, w, k = map(int, input().split())
ori = [list(map(int, list(input()))) for _ in range(h)]
ori.reverse()
ans = 0
for x in range(w):
    for y in range(h - 1):
        data = [[ori[i][j] for j in range(w)] for i in range(h)]
        for i in range(y, h - 1):
            data[i][x] = data[i+1][x]
        data[h-1][x] = 0
        score = 0
        lc = 1
        nxt = True
        while nxt:
            nxt = False
            for i in range(h):
                c = 1
                for j in range(1, w):
                    if data[i][j] != 0 and data[i][j] == data[i][j-1]:
                        c += 1
                    else:
                        if c >= k:
                            nxt = True
                            score += data[i][j-1] * c * lc
                            for l in range(j - c, j):
                                data[i][l] = 0
                        c = 1
                if c >= k:
                    nxt = True
                    score += data[i][w-1] * c * lc
                    for l in range(w - c, w):
                        data[i][l] = 0
            for j in range(w):
                z = 0
                for i in range(h):
                    if data[i][j] == 0:
                        z += 1
                    elif z > 0:
                        data[i-z][j] = data[i][j]
                        data[i][j] = 0
            lc *= 2
        ans = max(ans, score)
        if score == 0:
            break
print(ans)

Measured memory_bytes: 48988
#include <stdio.h>

int a[100000];

int main(void)
{
	int n;
	int ans;
	for(int i = 0; i < 100000; i++){
		a[i] = 1;
	}
	for(int i = 2; i < 100000; i++){
		if(a[i]){
			for(int j = i * 2;j < 100000; j = j + i){
					a[j] = 0;
			}
		}
	}
	scanf("%d",&n);
	while(n != 0){
		ans = 0;

		for(int i = 2; i <= n / 2; i++){
			if(a[i] == 1 && a[n - i] == 1){
				ans++;
			}
		}
		printf("%d\n",ans);
		scanf("%d",&n);
	}
	return 0;
}

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

int main() {
  char c;
  cin>>c;
  if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o'){
    cout<<"vowel"<<endl;
  }
  else{
    cout<<"consonant"<<endl;
  }
}



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

typedef long long ll;
typedef vector<long long> VLL;
typedef vector<pair<int,int>> VP;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define MOD (1e9+7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
/*--------------------------------------------*/

int N;
vector<int> ans;

void dfs(int d,int num){
  if(num == N){
    ans.PB(d);
    return;
  }
  int b,i;
  int a = (int)(log(N - num)/log(6));
  if(N != 59049){
	b = (int)(log(N - num)/log(9));
  }else{
    for(i = 0;pow(9,i) < N - num;i++) continue;
 	b = i;
  }
  
  if(a > 0) dfs(d+1,num + (int)(pow(6,a)));
  if(b > 0) dfs(d+1,num + (int)(pow(9,b)));
    
  if(a == 0 and b == 0){
    ans.PB(d + N - num);
    return;
  }
}

int main(){
  cin >> N;
      
  dfs(0,0);
    
  sort(ALL(ans));
  
  cout << ans[0] << endl;

}

  



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

using namespace std;

typedef long long ll;
typedef long double ld;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.setf(ios::fixed); cout.precision(20);
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int n, L;
    cin >> n >> L;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    vector <int> ans;
    for (int i = 0; i + 1 < n; ++i) {
        if (a[i] + a[i + 1] >= L) {
            ans.push_back(i);
            for (int j = i + 1; j + 1 < n; ++j) ans.push_back(j);
            for (int j = i - 1; j >= 0; --j) ans.push_back(j);
            break;
        }
    }
    if (ans.empty()) cout << "Impossible\n";
    else {
        cout << "Possible\n";
        reverse(ans.begin(), ans.end());
        for (int x : ans) cout << x + 1 << '\n';
    }
}

Measured memory_bytes: 1784
import math

a, b, x = map(int, input().split())

s = x / a

if s >= a * b / 2:
    h = (a * b - s) * 2 / a
    rad = math.atan2(h, a)
else:
    w = s * 2 / b
    rad = math.atan2(b, w)

print(rad / (2 * math.pi) * 360)


Measured memory_bytes: 9436
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, size_t size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, size_t size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,a,b) for(ll i=(a)-1;i>=(b);i--)

int main() {
    struct CostInfo {
        bool is_hori;
        ll cost;
    };
    ll W, H;
    cin >> W >> H;
    vector<CostInfo> costs;
    rep(i,0,W) {
        ll c;
        cin >> c;
        costs.push_back({true, c});
    }
    rep(i,0,H) {
        ll c;
        cin >> c;
        costs.push_back({false, c});
    }
    sort(costs.begin(), costs.end(), [](CostInfo lhs, CostInfo rhs){
        return lhs.cost < rhs.cost;
    });
    ll hori_cnt = 0;
    ll vert_cnt = 0;
    ll ans = 0;
    for (CostInfo ci : costs) {
        if (ci.is_hori) {
            ans += ci.cost * ((H+1) - vert_cnt);
            hori_cnt++;
        } else {
            ans += ci.cost * ((W+1) - hori_cnt);
            vert_cnt++;
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 6512
# https://atcoder.jp/contests/abc132/tasks/abc132_d

MOD = 10**9 + 7

class Facts:
    def __init__(self, mod=10**9+7, n_max=1):
        self.mod     = mod
        self.n_max   = n_max
        self.fact    = [1, 1]
        self.inv     = [0, 1]
        self.factinv = [1, 1]
        if 1 < n_max:
            self.setup_table(n_max)
 
    def cmb(self, n, r):
        if r < 0 or n < r:
            return 0
        if self.n_max < n:
            self.setup_table(n)
        return self.fact[n] * (self.factinv[r] * self.factinv[n-r] % self.mod) % self.mod
 
    def setup_table(self, t):
        for i in range(self.n_max+1,t+1):
            self.fact.append( self.fact[-1] * i % self.mod )
            self.inv.append( -self.inv[self.mod % i] * (self.mod // i) % self.mod )
            self.factinv.append( self.factinv[-1] * self.inv[-1] % self.mod )
        self.n_max = t


fact = Facts()
n, k = map(int, input().split())
for i in range(1, k + 1):
    ans = fact.cmb(n - k + 1, i) * fact.cmb(k - 1, i - 1)
    ans %= MOD
    print(ans)

Measured memory_bytes: 42736
#include<stdio.h>

int main(){
    int A,B,C,K;
    int totyu=0;
    int sai=0;
    scanf("%d %d %d %d",&A,&B,&C,&K);
    if(A-K>=0){
        printf("%d\n",K);
    }else{
        if(A+B-K>=0){
            printf("%d\n",A);
        }else{
            totyu = K-A-B;
            sai = A - totyu;
            //printf("%d\n",totyu);
            printf("%d\n",sai);
        }
    }
    return 0;
}

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

int ans;
int n;

int dfs(vector<int> &visited, vector<pair<int,int>> &v, int x, int num){
  visited[x] = 1;

  num++;
  if(num == n) ans++;
  
  for(auto p: v){
    if(p.first == x && visited[p.second] == 0)
      dfs(visited, v, p.second, num);
  }
  
  num--;
  visited[x] = 0;
}


int main(){
  int m;
  cin >> n >> m;
  
  vector<pair<int,int>> v;
  
  int x,y;
  for(int i=0; i<m; i++){
    cin >> x >> y;
    --x, --y;
    v.push_back(make_pair(x,y));
    v.push_back(make_pair(y,x));
  }
  
  vector<int> visited(n,0);
  
  dfs(visited, v, 0, 0);
  
  cout << ans << endl;
    
}

Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
from collections import Counter
c=Counter(a)
a=set(a)
ans=0
for aa in a:
  t=0
  t+=c[aa-1]
  t+=c[aa]
  t+=c[aa+1]
  ans=max(ans,t)
print(ans)
  

Measured memory_bytes: 14068
#!/usr/bin/env pypy3

import math
from collections import Counter
import array

class Sieve:
    def __init__(self, n=10**7+100):
        self.N = n

        self.nd = array.array('i', [1] * n)

        for i in range(2, n):
            for j in range(i, n, i): 
                self.nd[j] += 1
    
    def primes(self):
        return [i for i, e in enumerate(self.s) if e == -1 and i >= 2]

    def fastfactorize(self, n):
        assert(n <= self.N)

        ret = []

        while self.s[n] != -1:
            ret += [self.s[n]]
            n = n // self.s[n]

        ret += [n]

        return ret

    def isprime(self, n):
        if n < self.N:
            return self.s[n] == -1
        for p in self.PRIMES:
            if p*p > n:
                return True
            if n % p == 0:
                return False

    def numDivisors(self, n):
        if n == 1: return 1

        c = dict()

        for f in self.fastfactorize(n):
            if f not in c: c[f] = 0
            c[f] += 1

        ret = 1
        for p in c:
            ret *= (c[p] + 1)
        return ret

    def factorize(self, n):
        if n < self.N:
            return self.fastfactorize(n)
        
        for p in self.PRIMES:
            if p*p > n:
                break
            if n % p == 0:
                return [p] + self.factorize(n // p)

        return [n]

N = int(input())

sieve = Sieve()

ans = 0

for k in range(1, N+1):
    ans += k*sieve.nd[k]

print(ans)


Measured memory_bytes: 184688
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const ll mod = 1e9+7;
const int N=1e5+9;
int main()
{
    FASTINOUT;
    int x,a,b;
    cin>>x>>a>>b;
    cout<<min(a*x,b);
    return 0;
}


Measured memory_bytes: 256
function input()
  local inp = io.read()
  local r={}
  string.gsub(inp,"(%S+)", function (v) table.insert(r,tonumber(v)) end)
  return r
end

local n = tonumber(io.read())
local x = {}
local y = {}
local h = {}
for i=1,n,1 do
  local arr = input()
  x[i] = arr[1]
  y[i] = arr[2]
  h[i] = arr[3]
end
local cx,cy
local H = 1e9+7
for i=0,100,1 do
  for j=0,100,1 do
    cx=i
    cy=j
    local flag = true
    for k=1,n,1 do
      local dx = math.abs(cx-x[k])
      local dy = math.abs(cy-y[k])
      if h[k]~=0 then
        local Hi = h[k]+dx+dy
        H = Hi
      end
    end
    for k=1,n,1 do
      local dx = math.abs(cx-x[k])
      local dy = math.abs(cy-y[k])
      local Hi = h[k]+dx+dy
      if h[k]==0 then
        if H>Hi then
          flag = false
        end
      else
        if H~=Hi then
          flag = false
        end
      end
    end
    if flag then
      local res = tostring(cx).." "..tostring(cy).." "..tostring(H)
      print(res)
    end
  end
end
    

Measured memory_bytes: 376
#include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(x...) do { cout << "\033[32;1m " << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;
template<class T> void mkuni(vector<T>&v)
{
    sort(v.begin(),v.end());
    v.erase(unique(v.begin(),v.end()),v.end());
}
ll rand_int(ll l, ll r) //[l, r]
{
    static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
    return uniform_int_distribution<ll>(l, r)(gen);
}
template<class T>
void print(T x,int suc=1)
{
    cout<<x;
    if(suc==1) cout<<'\n';
    else cout<<' ';
}
template<class T>
void print(const vector<T>&v,int suc=1)
{
    for(int i=0;i<v.size();i++)
    print(v[i],i==(int)(v.size())-1?suc:2);
}
const int INF=0x3f3f3f;


int pos[2][2020];
int num[4020];
ll dp[2020][2020];
 
int w;
void add(int x,int p) { for(int i=x;i<=w;i+=i&-i) num[i]+=p;}

int sum(int x){int ans=0; for(int i=x;i>=1;i-=i&-i) ans+=num[i]; return ans;}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	int n;
	cin>>n;
	w=2*n;
	for(int i=1;i<=w;i++){
		char c;int x;
		cin>>c>>x;
		pos[c=='W'][x]=i;
		add(i,1);
	}
	pos[0][0]=pos[1][0]=w+1;
	for(int i=0;i<=n;i++){
		add(pos[0][i],-1);
		for(int j=0;j<=n;j++){
			add(pos[1][j],-1);
			if(i||j){
				dp[i][j]=1e15;
				if(i)
					dp[i][j]=min(dp[i][j],dp[i-1][j]+sum(pos[0][i]-1));
				if(j)
					dp[i][j]=min(dp[i][j],dp[i][j-1]+sum(pos[1][j]-1));
            }
		}
		for(int j=0;j<=n;j++){
			add(pos[1][j],1);
		}
	}
	cout<<dp[n][n]<<endl;
	return 0;

}

Measured memory_bytes: 35260
#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int A, B;

int main() {
	cin >> A >> B;
	if (A >= 13) {
		cout << B << endl;
	}
	else if (A >= 6) {
		cout << B / 2 << endl;
	}
	else {
		cout << 0 << endl;
	}
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
using namespace std;

//#include<bits/stdc++.h>

int main() {
	
	int a, b;
	cin >> a >> b;
	int t = 0;
	if (a%b)t++;
	cout << t << endl;

	return 0;

}

Measured memory_bytes: 256
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int h = Integer.parseInt(sc.next());
		int w = Integer.parseInt(sc.next());
		
		char[][] c = new char[h][w];
		
		for(int i = 0 ;i < h ;i++) {
			String s = sc.next();
			for(int j = 0 ; j< w ;j++) {
				c[i][j] = s.charAt(j);
			}
		}
		boolean [][]grid = new boolean[h][w];
		boolean []flag = new boolean [h];
		
		for(int i = 0 ;i < h ;i++) {
			boolean jdg = true;
			for(int j = 0 ; j < w ;j++) {
				if(c[i][j] == '#')
					jdg = false;
			}
			
			if(jdg) {
				flag[i] = true;
				for(int j = 0 ; j < w ;j++) {
					grid[i][j] = true;
				}
			}
		}
		
		for(int i = 0 ; i < w ; i++) {
			boolean jdg = true;
			for(int j = 0 ; j < h ; j++) {
				if(c[j][i] == '#')
					jdg = false;
			}
			if(jdg) {
				for(int j = 0 ; j < h ;j++) {
					grid[j][i] = true;
				}
			}
		}
		
		for(int i = 0 ; i < h ; i++) {
			for(int j = 0 ; j < w ; j++) {
				if(flag[i]) {
					break ;
				}
				if(grid[i][j]) {
					continue;
				}
				else {
				System.out.print(c[i][j]);
			}
		}if(!flag[i])
			System.out.println();
	}

}
	}


Measured memory_bytes: 25124
#include<bits/stdc++.h>
using namespace std;
int main(){
 char C11,C12,C13;
char C21,C22,C23;
  cin>>C11>>C12>>C13;
  cin>>C21>>C22>>C23;
 
  
  if(C11==C23&&C12==C22&&C13==C21){
    cout<<"YES"<<endl;
}
  else{
    cout<<"NO"<<endl;
  }
}

    
  


Measured memory_bytes: 256
//-------------
//include
//-------------
#include <map>
#include <list>
#include <cmath>
#include <vector>
#include <string>
#include <cctype>
#include <random>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
//-------------
//typedef
//-------------
typedef long long LL;
typedef  vector<int> VI;
typedef  pair<int, int> PII;
typedef  vector<int, int> VII;
typedef  map<string, int> MSI;
//-------------
//utillty
//-------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MK make_pair
#define PB push_back
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//-------------
//repetition
//-------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//-------------
//debug
//-------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumpl(x) REP(i,SZ(x))cerr<<i<<x<<"="<<x[i]<<endl;
const int MOD = 1000000007;
int main()
{
	int x, y;
	VI a = { 1, 3, 5, 7, 8, 10, 12 };
	cin >> x >> y;
	if (x == 2)
	{
		cout << "No" << endl;
		return 0;
	}
	if (y == 2)
	{
		cout << "No" << endl;
		return 0;
	}
	bool x_ok=0;
	bool y_ok=0;
	REP(i,7)
	{
		if (a.at(i) == x)x_ok = true;
		else if (a.at(i) == y)y_ok = true;
	}
	if (x_ok == y_ok)
	{
		cout << "Yes" << endl;
		return 0;
	}
	else
	{
		cout << "No" << endl;
		return 0;
	}
#ifdef _DEBUG
	while(1);
#endif
	return 0;
}

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

  
int main(){
  string s;
  cin >> s;
  int n;
  n=s.size();
  bool a=true;
  bool b=true;
  bool c=true;
  rep(i,n/2){
    if(s.at(i)==s.at(n-i-1)){
      a=true;
    }
    else if(s.at(i)!=s.at(n-i-1)){
      a=false;
      break;
    }
  }
  rep(i,(n-1)/4){
    if(s.at(i)==s.at((n-1)/2-i-1)){
      b=true;
    }
    else if(s.at(i)!=s.at((n-1)/2-i-1)){
      b=false;
      break;
    }
  }
   rep(i,(n-1)/4){
    if(s.at((n+3)/2+i-1)==s.at(n-i-1)){
      c=true;
    }
    else if(s.at((n+3)/2+i-1)!=s.at(n-i-1)){
      c=false;
      break;
    }
  }
   if(a && b && c) cout << "Yes" <<endl;
   else cout << "No" <<endl;         
         
  
 }
  
  

Measured memory_bytes: 256
import java.util.Scanner;

//Dungeon Quest II
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		int[][] move = {{-1,0},{0,1},{1,0},{0,-1}};
		while(true){
			int hp = sc.nextInt();
			int hpmax = sc.nextInt();
			if((hp|hpmax)==0)break;
			int r = sc.nextInt();
			int c = sc.nextInt();
			char[][] map = new char[r][c];
			for(int i=0;i<r;i++)map[i]=sc.next().toCharArray();
			int[] trap = new int[26];
			int T = sc.nextInt();
			for(int i=0;i<T;i++){
				trap[sc.next().charAt(0)-'A'] = sc.nextInt();
			}
			int S = sc.nextInt();
			int[] seq = new int[1000];
			int s = 0;
			for(int i=0;i<S;i++){
				char ch = sc.next().charAt(0);
				int dir = ch=='U'?0:ch=='R'?1:ch=='D'?2:3;
				int k = sc.nextInt();
				while(k--!=0)seq[s++]=dir;
			}
			int P = sc.nextInt();
			int[] p = new int[P];
			for(int i=0;i<P;i++)p[i]=sc.nextInt();
			int[][] dp = new int[s+1][1<<P];
			dp[0][(1<<P)-1] = hp;
			int ni = 0;
			int nj = 0;
			for(int i=0;i<s;i++){
				ni += move[seq[i]][0];
				nj += move[seq[i]][1];
				int damage = trap[map[ni][nj]-'A'];
				for(int j=(1<<P)-1;j>=0;j--){
					if(dp[i][j]==0)continue;
					for(int k=0;k<P;k++){
						if((j&(1<<k))==0)continue;
						int h = Math.min(dp[i][j]+p[k], hpmax);
						dp[i][j-(1<<k)] = Math.max(dp[i][j-(1<<k)], h);
					}
					if(dp[i][j]-damage>0)dp[i+1][j] = Math.max(dp[i+1][j], dp[i][j]-damage);
				}
			}
			boolean f = false;
			for(int j=0;j<1<<P;j++)if(dp[s][j]>0)f=true;
			System.out.println(f?"YES":"NO");
		}
	}

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

Measured memory_bytes: 0
import java.util.Scanner;
import java.util.Arrays;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        int n= scn.nextInt();
        String s = scn.next();
        int answer = 0;
        int[] check = new int[26];
        Arrays.fill(check, 0);
        for(int i=1;i<n;i++){
            String a=s.substring(0, i);
            String b=s.substring(i,n);
           // System.out.println(a+" : "+b);  //test
           int cnt=0;
           Arrays.fill(check, 0);
           for(int j=0;j<a.length();j++){
                for(int k=0;k<b.length();k++){
                    if(a.charAt(j)==b.charAt(k)){
                        if(check[Character.getNumericValue(a.charAt(j))-Character.getNumericValue('a')]==0) cnt++;
                        check[Character.getNumericValue(a.charAt(j))-Character.getNumericValue('a')]++;
                    }
                }
           }
           if(answer<cnt){
            answer = cnt;
           }
        }
        System.out.println(answer);
    }
}


Measured memory_bytes: 24020
n, a, b = map(int, input().split())
count = 0

for xx in range(1, n+1):
  x = str(xx)
  sum_x = 0
  for i in range(len(x)):
    sum_x += int(x[i])
  if sum_x >= a and sum_x <= b:
    count += xx
print(count)


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

int main() {
	long long int n;
	int k;
	cin >> n >> k;
	long long int a, b, c;
	for (int i = 0; i < k; i++) {
		cin >> a >> b;
		a = min(a, n+1-a);
		b = min(b, n+1-b);
		c = min(a, b);
		c = c%3;
		if (c == 0) {
			c = 3;
		}
		cout << c << endl;
	}
}

Measured memory_bytes: 1164
import java.util.*;

public class Main {
	public static void main(String [] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), p [] = new int [n], k = 0;
		for (int i = 0; i < n; p[i] = sc.nextInt(), i++);
		for (int i = n - 2; i > 0; k += (((p[i - 1] < p[i]) && (p[i] < p[i + 1])) || ((p[i - 1] > p[i]) && (p[i] > p[i + 1]))) ? 1 : 0, i--);
		System.out.println(k);
  	}
}

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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	ll n; 
	cin >> n;
	double pi = 3.141592653589;
	cout << n * 2.0 * pi;
}

Measured memory_bytes: 3752
//#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<map>
#include<unordered_map>
#include<functional>
#include<queue>
#include<set>
#include<stack>
#include<iomanip>
#include<algorithm>
#include<numeric>
#include<memory>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(a)   a.begin(),a.end()
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<T>>;
template<typename T =ll,typename U =ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;
template <int MOD>
struct ModInt {
    using lint = long long;
    int val;

    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };

    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt inv() const { return this->pow(MOD - 2); }

    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }
    ModInt pow(lint n) const {
        auto x = ModInt(1);
        auto b = *this;
        while (n > 0) {
            if (n & 1) x *= b;
            n >>= 1;
            b *= b;
        }
        return x;
    }

    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= x.inv(); }
    //
    ModInt operator++(int) {
        auto t = *this;
        *this += 1;
        return t;
    }

    ModInt operator--(int) {
        auto t = *this;
        *this -= 1;
        return t;
    }
    ModInt operator<<(const int n){
        return ModInt(*this)*ModInt(2).pow(n);
    }
    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }

    // I/O
    friend std::istream& operator>>(std::istream& is, ModInt& x) noexcept { return is >> x.val; }
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;

void b(){
    ll N; cin >> N;
    auto x = v<>(N,0);
    auto y = v<>(N,0);
    rep(i,N){
        cin >> x[i] >> y[i];
    }
    auto dis = map<p<>,ll>();
    rep(i,N){
        rep(j,N){
            if(i==j) continue;
            dis[p<>(x[i]-x[j],y[i]-y[j])]++;    
        }
    }

    ll _max = 0;
    for(auto i:dis){
        chmax(_max,i.second);
    }

    cout << N-_max<<endl;
    
}

int main(){
    b();
}

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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ld PI = 3.14159265359;

const ll MOD = (ll) 1e9 + 7;
const ll MAXN = (ll) 2e5 + 10;
const ll INF = (ll) 2242545357980376863;
const ld EPS = (ld) 1e-8;

ll cnt[MAXN];

int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll u;
	for(int i = 0; i<6;i++){
		cin>>u;
		cnt[u] ++;
		if(cnt[u] == 3) return cout << "NO",0;
	}
	cout << "YES";
	return 0;
}


/*

                                 ____              ,----..               ,----..
   ,---,                       ,'  , `.           /   /   \             /   /   \
  '  .' \                   ,-+-,.' _ |          /   .     :           /   .     :
 /  ;    '.              ,-+-. ;   , ||         .   /   ;.  \         .   /   ;.  \
:  :       \            ,--.'|'   |  ;|        .   ;   /  ` ;        .   ;   /  ` ;
:  |   /\   \          |   |  ,', |  ':        ;   |  ; \ ; |        ;   |  ; \ ; |
|  :  ' ;.   :         |   | /  | |  ||        |   :  | ; | '        |   :  | ; | '
|  |  ;/  \   \        '   | :  | :  |,        .   |  ' ' ' :        .   |  ' ' ' :
'  :  | \  \ ,'        ;   . |  ; |--'         '   ;  \; /  |        '   ;  \; /  |
|  |  '  '--'          |   : |  | ,             \   \  ',  /          \   \  ',  /
|  :  :                |   : '  |/               ;   :    /            ;   :    /
|  | ,'                ;   | |`-'                 \   \ .'              \   \ .'
`--''                  |   ;/                      `---`                 `---`
                       '---'

*/


Measured memory_bytes: 256
import Data.List
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)

test :: (Ord t, Num t) => t -> [(t, t)] -> String
test _ [] = "Yes"
test n ((t, l):xs)
    | n + t <= l = test (n+t) xs
    | otherwise  = "No"

f :: [(Int, Int)] -> String
f = test 0 . sortOn snd

main :: IO()
main = BC.getContents >>= putStrLn . f . map ((\[x,y] -> (x,y)) . map (fst . fromJust . BC.readInt) . BC.words) . tail . BC.lines


Measured memory_bytes: 82300
import java.util.Arrays;

public class Main {


  private static void solve() {
    int n = ni();
    int[] a = na(n);
    Arrays.sort(a);
    
    int left = 0;
    int right = n - 1;
    
    int[][] ret = new int[n - 1][2];
    int ptr = 0;
    while (a[left] < 0 && a[left + 1] < 0) {
      ret[ptr ++] = new int[] {a[right], a[left]};
      a[right] -= a[left];
      left ++;
    }
    
    while (right - left >= 2) {
      ret[ptr ++] = new int[] {a[left], a[right]};
      a[left] -= a[right];
      right --;
    }
    
    ret[ptr ++] = new int[] {a[right], a[left]};
    
    a[right] -= a[left];
    

    out.println(a[right]);
    for (int i = 0; i < ptr; i ++) {
      out.println(ret[i][0] + " " + ret[i][1]);
    }
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

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

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 53504