akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FI first
#define SE second
#define PB push_back
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define co(i) cout<<(i)<<endl
#define fcout cout<<fixed<<setprecision(10)
#define uni(i) i.erase(unique(i.begin(), i.end()), i.end());
#define all(i) i.begin(),i.end()
#define pint pair<int, int>
#define vint vector<int>
using namespace std;

const int INF=1e9+7;
const int MOD=1e9+7;
//const int MOD=998244353;

int N,W;
int w[100],v[100];
ll dp[100001];

int main(){
	cin>>N>>W;
	FOR(i,0,N){
		cin>>w[i]>>v[i];
	}
	fill(dp,dp+100001,(ll)1e17);
	dp[0]=0;
	FOR(i,0,N){
		ROF(j,v[i],100001){
			dp[j]=min(dp[j],dp[j-v[i]]+w[i]);
		}
	}
	ll ans=1e17;
	ROF(i,0,100001){
		if(dp[i]<=W){
			ans=i;
			break;
		}
	}
	co(ans);
}


Measured memory_bytes: 1024
import sys
H, W, M = map(int, sys.stdin.readline().split())
hlst = {}
wlst = {}
hwlst = []

for i in range(M):
    h, w = sys.stdin.readline().split()
    if h in hlst:
        hlst[h] += 1
    else:
        hlst[h] = 1

    if w in wlst:
        wlst[w] += 1
    else:
        wlst[w] = 1

    hwlst.append([h, w])

h = max(hlst.values())
w = max(wlst.values())
hmax = [i for i in hlst if hlst[i] == h]
wmax = [i for i in wlst if wlst[i] == w]
num = len(hmax)*len(wmax)
ans = h + w -1


for i in hwlst:
    if hlst[i[0]] == h and wlst[i[1]] == w:
        num -= 1

if num == 0:
    print(ans)
else:
    print(ans+1)


Measured memory_bytes: 98232
#include <iostream>

using namespace std;

int main(void) {

  int num = 0;
  int N;
  int A;
  int B;

  cin >> N >> A >> B;

  while (true) {
    if (A + 1 != B) {
      A = A + 1;
      ++num;
    } else {
      if (A == 1) {
        cout << "Borys" << endl;
        return 0;
      } else {
        A = A - 1;
        ++num;
      }
    }

    if (B - 1 != A) {
      B = B - 1;
      ++num;
    } else {
      if (B == N) {
        cout << "Alice" << endl;
        return 0;
      } else {
        B = B + 1;
        ++num;
      }
    }

    if (num > 1000) {
      cout << "Draw" << endl;
      return 0;
    }
    
  }
}


Measured memory_bytes: 632
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int N;
  while (cin >> N) {
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
      cin >> A[i];
    }
    sort(A.begin(), A.end());
    int t = 0;
    ll sum = 0;
    for (int i = 0; i < N - 1; i++) {
      sum += A[i];
      if (2 * sum < A[i + 1]) {
        t = i + 1;
      }
    }
    int ans = N - t;
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(v) v.begin(), v.end()
#define vl vector<ll>
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
const int N=100005;
void solve()
{
    ll n,k=1,m=0,i=1,j,x,y,l,r;
    ll ans=0,sum;
    cin>>n;
    ll a[N]{},dp[N]{};
    for(i=1;i<=n;i++) cin>>a[i];
    dp[2]=dp[1]+abs(a[2]-a[1]);
    for(i=3;i<=n;i++)
    {
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
    }
    cout<<dp[n];
}
int main()
{
    ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
     #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif 
    int t=1;
    //cin>>t;
    while(t--)solve();
    return 0;
}

Measured memory_bytes: 5212
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define MOD llong(1e9+7)
#define MAX int(2 * 1e5 +5)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define pi acos(-1.0)
#define int llong
#define INF llong(1e17)
template<class T> bool chmax(T &a,  T b) {if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a,  T b) {if(a>b){a=b; return 1;} return 0;}
bool Add(int &a,int b){a = (a + b) % MOD;}
void myprint(int* A,int A_num){
   REP(i,A_num) cout << A[i] << " ";
   cout << endl;
}

signed main(){
    int n,k;
    cin >> k;
    n = 50;
    int A[n];
    
    REP(i,n) A[i] = n-1 + int(k / n);
    REP(i,k%n){
        A[i] += n;
        REP(j,n){
            if(j != i) A[j] -= 1;
        }
    }        
    

    cout << n << endl;
    REP(i,n) cout << A[i] << " ";
    cout << endl;
}

Measured memory_bytes: 256
n, m ,x= list(map(int,input().split()))

a = list(map(int,input().split()))

counta = 0
countb = 0

for i in range(0,x+1):
    counta += a.count(i)
for i in range(x+1,n):
    countb += a.count(i)

print(min(counta,countb))


Measured memory_bytes: 3064
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        
        int ans = c - a + b;
        if(ans < 0) ans = 0;
        
        System.out.println(ans);
    }
}


Measured memory_bytes: 22740
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<ctime>
#include<set>

using namespace std;
using ll = long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ti = clock();
  // start-----------------------------------------------
  int n; cin >> n;
  vector<int> s(n);
  for(auto &i:s) cin >> i;
  int q; cin >> q;
  vector<int> t(q);
  for(auto &i:t) cin >> i;
  int ans = 0;
  for(auto i:t){
    if(binary_search(s.begin(), s.end(), i)) ans++;
  }
  cout << ans << endl;

  // end-----------------------------------------------
  // cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}



Measured memory_bytes: 3288
#include<bits/stdc++.h>
using namespace std;
int s[10001]={0};
int main() {
	long long n;
	cin >> n;
	int s[10001]={0};
	for(int x=1;x*x<=10000;++x){
		for(int y=1;y*y<=10000;++y){
			for(int z=1;z*z<=10000;++z){
				long long a=x*x+y*y+z*z+x*y+y*z+z*x;
				if(a<=10000){
					s[a]++;
				}
			}
		}
	}
	for(int i = 1;i<=n;++i){
		cout << s[i]<< endl;
	}
	return 0;
}

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

#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define rep(i, n) repi(i, 0, n)
#define all(x) (x).begin(), (x).end()

using pii = pair<int, int>;

inline void Main() {
  // code
  int n,d[(int)1e5];
  cin >> n;
  rep(i, n) cin >> d[i];
  sort(d,d+n);
  cout << d[n/2] - d[n/2-1] << endl;
}

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(20);
  Main();
  return 0;
}


Measured memory_bytes: 640
epochs = int(input())
patterns = ['S', 'H', 'C', 'D']
checker = {pattern: [True]*13 for pattern in patterns}
for i in range(epochs):
    pattern, num = input().split()
    num = int(num)
    checker[pattern][num-1] = False
 
for pattern in patterns:
    for i in range(13):
        if checker[pattern][i]:
            print(pattern, i+1)

Measured memory_bytes: 7668
H, W = gets.split.map(&:to_i)

def solve1(h, w)
  (w%3 == 0) ? 0 : h
end

def solve2(h, w)
  # xxxxxxx  |a
  # xxxxxxx  |
  # oooo###
  # oooo###
  # ----
  #   b
  ret = Float::INFINITY
  for a in (h/3)..((h/3)+1)
    for b in (w/2)..(w/2+1)
      areas = [w*a, b*(h-a), (w-b)*(h-a)]
      ans = areas.max - areas.min
      ret = ans if ans < ret
    end
  end
  ret
end

p [solve1(H,W), solve1(W,H), solve2(H,W), solve2(W,H)].min



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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    int foo, bar;
    foo = bar = 0;
    for (int i = 0; i < (int) s.size(); i++) {
        foo += (i % 2 == 0 && s[i] != '1');
        foo += (i % 2 == 1 && s[i] != '0');
        bar += (i % 2 == 0 && s[i] != '0');
        bar += (i % 2 == 1 && s[i] != '1');
    }
    cout << min(foo, bar) << '\n';
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<long long,long long>
#define mod 1000000007
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

ll power(ll a,ll b){
	ll ans=1;
	while(b>0){
		if(b%2!=0){
			ans=(ans*a)%mod;
		}
		a=(a*a)%mod;
		b>>=1;
	}
	return ans;
}

int main() {
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		int n;
		cin>>n;
		int a[n];
		for(int i=0;i<n;i++)
		cin>>a[i];
		int ma=1,cnt=1;
		for(int i=1;i<n;i++){
			if(a[i]>a[i-1]){
				cnt=0;
			}
			cnt++;
			ma=max(ma,cnt);
		}
		cout<<ma-1;
	}
	return 0;
}

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

int main() {
  int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
  int xsub = x2 - x1, ysub = y2 - y1;
  int x3 = x2 - ysub, y3 = y2 + xsub;
  int x4 = x3 - xsub, y4 = y3 - ysub;
  printf("%d %d %d %d\n", x3, y3, x4, y4);
}

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

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size())

#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange

#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}

void solve() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll ans;
    ans = a * c;
    chmax(ans, a*d);
    chmax(ans, b*d);
    chmax(ans, b*c);
    cout << ans << endl; 
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 3632
function Main(input){
	input=input.trim().split("\n");
	let line, a, b, op, ans;
	for (let i = 0; i < input.length -1; i++){
		line = input[i].split(" ");
		a = parseInt(line[0],10);
		b = parseInt(line[2],10);
		op = line[1];
		if (op == '+') {
			ans = a + b;
		} else if (op == '-') {
			ans = a - b;
		} else if (op == '*') {
			ans = a * b ;
		} else if (op == '/') {
			ans = a / b | 0;
		}
		console.log(ans);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 15408
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp_AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();

            if(N % 2 == 1)
            {
                Console.WriteLine("No");
                return;
            }

            string T1 = S.Substring(0, N / 2);
            string T2 = S.Substring(N / 2, N / 2);

            if(T1 == T2)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 11092
N, A, B = map(int, input().split())

if N == 1:
    if A == B:
        print(1)
    else:
        print(0)
else:
    if A > B:
        print(0)
    else:
        n_min = A * (N - 1) + B
        n_max = A + B * (N - 1)
        print(n_max - n_min + 1)

Measured memory_bytes: 2940
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

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

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

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    vector<int> a;
    int K;

    void input() {
        a.resize(3);
        rep(i, 0, 3)cin >> a[i];
        cin >> K;


    }

    void solve() {
        input();
        sort(all(a));
        rep(i,0,K){
            a.back() <<= 1;
        }

        int ans = accumulate(all(a),0);
        cout << ans << endl;

    }
};


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

    Solve().solve();


    return 0;
}


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

int main(){
	long long  n;
  	cin >> n;
    set <string> s;
  	string a;
    for(int i = 0; i < n; i++){
    	cin >> a;
    	s.insert(a);
    }
  	cout << s.size() << endl;
}


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

typedef long long ll;

int main(void) {
	ll N, M, L, ans;

	cin >> N >> M;
	L = M / 2;
	if (N >= L)
		ans = L;
	else
		ans = (N + L) / 2;

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


Measured memory_bytes: 256
import os, sys, re, math

(N, M) = [int(n) for n in input().split()]

successes = [0] * N
penalties = [0] * N
for i in range(M):
    (p, s) = [n for n in input().split()]
    if s == 'AC':
        successes[int(p) - 1] = 1
    else:
        if successes[int(p) - 1] == 0:
            penalties[int(p) - 1] += 1

for i in range(N):
    if successes[i] == 0:
        penalties[i] = 0

print('%s %s' % (sum(successes), sum(penalties)))


Measured memory_bytes: 11268
#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
	int N; cin >> N;
	vector<string>c(N);
	for (int i = 0; i < N; i++) {
		if (i == 0) cin >> c.at(i);
		else {
			cin >> c.at(i);
			if (c.at(i).at(0) != c.at(i - 1).back()) {
				cout << "No" << endl;
				return 0;
			}
			for (int j = 0; j < i; j++) {
				if (c.at(i) == c.at(j)) {
					cout << "No" << endl;
					return 0;
				}
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}

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 = sc.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < h.length; i++) {
			h[i] = sc.nextInt();
		}
		
		int ans = 0;
		int cnt = 0;
		for (int i = 0; i < h.length; i++) {
			if (i + 1 == n) {
				ans = Math.max(ans, cnt);
				break;
			}
			if (h[i] >= h[i + 1]) {
				cnt++;
				continue;
			}
			
			ans = Math.max(ans, cnt);
			cnt = 0;
		}
		
		System.out.println(ans);
		
	}
}

Measured memory_bytes: 50980
# include <bits/stdc++.h>
# define sz(x) (int)((x).size())
# define f first 
# define s second
# define pb push_back
# define ub upper_bound
# define lb lower_bound
# define all(x) x.begin(), x.end()
# define pqueue priority_queue
# define Speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
# define rep(i,n) for(int i=0;i<n;++i)
# define forn(i,n) for(int i=1;i<=n;++i)

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

# define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
# define debug cerr<<"ERROR"<<endl
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

template<class T> void umin(T &a,T b){a=min(a,b);}
template<class T> void umax(T &a,T b){a=max(a,b);}

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

const int dx[]={1,0,-1,0,-1,-1,1,1};
const int dy[]={0,1,0,-1,-1,1,-1,1}; 
const int inf=1e9,mod=1e9+7,N=2e5+5;

void solve(){
	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j){
			if(i*j>=n)break;
			ans++;
		}
	}
	cout<<ans;
}

int main(){
 	Speed();
	int T=1; 
	//cin>>T;	
	while(T--)solve();
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for (i = 0; i < n; ++i) 
#define REP(i,k,n) for (i = k; i <= n; ++i) 
#define repr(i,k,n) for (i = k; i >= n; --i) 
#define F first;
#define S second;
#define PB push_back;
#define MP make_pair;
// #define ll long long;
#define show(x) cerr << #x << " is " << x << endl;

using namespace std;

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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    int len;
    cin >> len;
    string s;
    cin >> s;
    int n = s.size();
    if(n&1) {
        cout << "No\n";
        return 0;
    }
    // ll res = t*t;
    // cout << res << endl
    for(int i = 0; i < n/2; ++i){
        if(s[i] != s[i + n/2]){
            cout << "No\n";
            return 0;
        };
    } 
    cout << "Yes\n" << endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1142&lang=jp>
 問題文============================================================
 =================================================================
 解説=============================================================
 
 ================================================================
 */
ll solve(){
    ll res = 0;
    string S; cin >> S;
    set<string> trains;
    for(int i = 0; i <= S.length();i++){
        string sub1 = S.substr(0,i),sub2 = S.substr(i);
        trains.insert(sub1+sub2); trains.insert(sub2+sub1);
        reverse(sub1.begin(),sub1.end());
        trains.insert(sub1+sub2); trains.insert(sub2+sub1);
        reverse(sub2.begin(),sub2.end());
        trains.insert(sub1+sub2); trains.insert(sub2+sub1);
        reverse(sub1.begin(),sub1.end());
        trains.insert(sub1+sub2); trains.insert(sub2+sub1);
    }
    return res = trains.size();
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int T; cin >> T;
    while(T--){
        cout << solve() << endl;
    }
    return 0;
}



Measured memory_bytes: 3300
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
using namespace std;
vector<bool>prime_list() {
    vector<bool>primes(100004, true);
    primes[0] = false;
    primes[1] = false;
    int n=2;
    for (int i=2; i<=100004; i++) {
        if (primes[i]) {
            for (int j=2; j*i < 100004; j++) {
                primes[i*j] = false;
            }
        }
    }

    return primes;
}
int main() {
    int N;
    cin >> N;
    vector<bool> primes = prime_list();
    int num = 0;
    for (int i=N; i < 100004; i++) {
        if (primes[i]) {
            num = i;
            break;
        }
    }

    cout << num << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main (void) {
    int     i, j;
    int     n;
    char    s[10001];
    int     s_len;

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

    s_len = strlen(s);
    for ( i=0; i<s_len; i++ ) {
        for ( j=0; j<n; j++ )
        {
            if ( s[i] == 'Z' )
                s[i] = 'A';
            else
                s[i]++;
        }
    }

    printf("%s\n", s);
    return EXIT_SUCCESS;
}


Measured memory_bytes: 128
#include<math.h>
#include<string>
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
class Point
{
    public:
    double x, y;

    Point(double x = 0, double y = 0): x(x), y(y) {}

    Point operator + (Point p) {return Point(x + p.x, y + p.y); }
    Point operator - (Point p) {return Point(x - p.x, y - p.y); }
    Point operator * (double a) {return Point(x * a, y * a);}
    Point operator / (double a) {return Point(x / a, y / a);}

    double abs() {return sqrt(norm());}
    double norm() {return x * x + y * y;}
    
    bool operator < (const Point &p) const {
        return x != p.x ? x < p.x : y < p.y;
    }

    bool operator == (const Point &p) const{
        return equals(x, p.x) && equals(y, p.y);
    }
};typedef Point Vector;

double dot(Vector a, Vector b){
    return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b){
    return a.x * b.y - a.y * b.x;
}

string ccw(Point p0, Point p1, Point p2){
    Vector a = p1 - p0, b = p2 - p0;
    if (cross(a, b) > EPS) return "COUNTER_CLOCKWISE";
    if (cross(a, b) < -EPS) return "CLOCKWISE";
    if (dot(a, b) < -EPS) return "ONLINE_BACK";
    if (a.norm() < b.norm()) return "ONLINE_FRONT";
    return "ON_SEGMENT";
}
#include<iostream>
int main(){
    int x0, y0, x1, y1, x2, y2, q;
    cin >> x0 >> y0 >> x1 >> y1 >> q;
    Point p0 = Point(x0, y0), p1 = Point(x1, y1);
    for (int i = 0; i < q; i++)
    {
        cin >> x2 >> y2;
        Point p2 = Point(x2, y2);
        cout << ccw(p0, p1, p2) << endl;
    }
    
}


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

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    string s,t;
    while (cin >> s >> t) {
        const int n = s.size();
        const int m = t.size();
        map<char,VI> pos;
        FOR(i,0,n)
            pos[s[i]].push_back(i);
        bool good = true;
        FOR(i,0,m) if (pos[t[i]].empty())
            good = false;
        if (!good)
            cout << -1 << endl;
        else {
            int i = 0, j = 0; LL ans = 0;
            while (j < m) {
                const VI& A = pos[t[j]];
                /*
                 * lower_bound(ALL(A),v) finds the first postion p that
                 * A[p] >= v. same as N N N Y Y Y .. A[p] increasing
                 *                          |
                 */
                auto x = lower_bound(ALL(A),i);
                if (x == A.end()) {
                    ans += n-i; i = 0;
                }
                else {
                    j++; ans += *x-i+1; i = *x+1;
                }
            }
            cout << ans << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 1228
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "l    ", long, "r");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long n, k;
    scan(n, k);
    auto ary = new long[](MAX);
    foreach (_; iota(n))
    {
        long a, b;
        scan(a, b);
        ary[a] += b;
    }
    long ans, s;
    foreach (i; iota(MAX))
    {
        s += ary[i];
        if(s >= k)
        {
            ans = i;
            break;
        }
    }
    writeln(ans);
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


Measured memory_bytes: 10876
/*
      author : nishi5451
      created: 12.08.2020 00:24:15
*/

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


int main(){
    string s;
    cin >> s;
    s.insert(4," ");
    cout << s << endl;

    return 0;
}   

Measured memory_bytes: 3532
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second
#define mp make_pair
 
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N, K, A[int(2e5 + 5)], cnt[int(2e5 + 5)];

int main(){
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", A + i);

  for (int i = 1; i <= K; i++){
    fill(cnt, cnt + N + 1, 0);
    for (int j = 1; j <= N; j++){
      int start = max(0, j - A[j]);
      int goal = min(N, j + A[j]);
      cnt[start]++; cnt[goal + 1]--;
    }

    bool flag = true;
    for (int j = 1; j <= N; j++){
      cnt[j] += cnt[j - 1];
      A[j] = cnt[j];
      if (A[j] != N) flag = false;
    }
    if (flag) break;
  }

  printf("%d", A[1]);
  for (int i = 2; i <= N; i++) printf(" %d", A[i]);
  printf("\n");

  return 0;
}


Measured memory_bytes: 5280
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
int main(void){
    string s;
    cin>>s;
    int ans = 0;
    rep(i, s.size()){
        if(i%2==0){
            if(s[i] == 'p') ans--; 
        }
        else{
            if(s[i] == 'g') ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

using namespace std;

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

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

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

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int n,d;
int a[252521];

int dat[252521];
vi vs[252521];
int root(int x){
  return dat[x]<0 ? x : dat[x]=root(dat[x]);
}
bool unite(int a, int b){
  a=root(a);b=root(b);
  if(a==b)return false;
  if(a!=b){
    if(dat[a]>dat[b])swap(a,b);
    dat[a] += dat[b]; dat[b] = a;
    for(int x : vs[b]){
      vs[a].push_back(x);
    }
    vs[b].clear();
  }
  return true;
}

const int N = 1<<18;
const ll INF = 1ll<<60;
struct segtree{
  vector<pll> seg;
  segtree(){seg.assign(2*N-1, pll(INF,INF));}
  void set(int x, ll v){
    seg[x+N-1] = pll(v, x);
    x += N-1;
    while(x>0){
      x = (x-1)/2;
      seg[x] = min(seg[2*x+1], seg[2*x+2]);
    }
  }
  pll qmin(int l, int r, int a, int b, int k){
    if(r<=a || b<=l)return pll(INF,INF);
    if(l<=a && b<=r)return seg[k];
    int m = (a+b)/2;
    return min(qmin(l,r,a,m,2*k+1), qmin(l,r,m,b,2*k+2));
  }
  pll qmin(int l, int r){return qmin(l,r,0,N,0);}
};

int main(){
  scanf("%d%d",&n,&d);
  REP(i,n)scanf("%d",a+i);
  
  fill(dat,dat+n,-1);
  REP(i,n)vs[i].push_back(i);

  segtree seg1, seg2;
  REP(i,n)seg1.set(i,(ll)a[i] - (ll)i*d);
  REP(i,n)seg2.set(i,(ll)a[i] + (ll)i*d);

  ll ans = 0;
  while(-dat[root(0)] != n){
    vector<pair<pii,ll>> es;
    REP(i,n)if(root(i)==i){
      pii e = pii(-1,-1);
      ll minv = INF*4;
      for(int x : vs[i]){
        seg1.set(x,INF);
        seg2.set(x,INF);
      }
      for(int x : vs[i]){
        pll P = seg1.qmin(0,x);
        ll v = P.first + a[x] + (ll)x*d;
        if(v < minv){
          minv = v;
          e = pii(x,P.second);
        }
        P = seg2.qmin(x+1,n);
        v = P.first + a[x] - (ll)x*d;
        if(v < minv){
          minv = v;
          e = pii(x,P.second);
        }
      }
      for(int x : vs[i]){
        seg1.set(x,(ll)a[x] - (ll)x*d);
        seg2.set(x,(ll)a[x] + (ll)x*d);
      }
      es.push_back(make_pair(e,minv));
    }
    for(auto PP : es){
      pii P = PP.first;
      ll v = PP.second;
      if(unite(P.first, P.second)){
        ans += v;
      }
    }
  }
  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 39840
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int N;
int h[100010];

int dp[100010];

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

	dp[0] = 0;
	dp[1] = abs(h[1] - h[0]);

	for (int i = 2; i < N; i++)
	{
		dp[i] = min(dp[i - 2] + abs(h[i] - h[i - 2]), dp[i - 1] + abs(h[i] - h[i - 1]));
	}

	cout << dp[N - 1] << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>
    
int main()
{
    int n;
    
    scanf("%d", &n);
    
    int a[n], i;
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    
    for (i = 0; i < n / 2; i++) {
        int tmp = a[i];
        a[i] = a[n - i - 1];
        a[n - i - 1] = tmp;
    }
    for (i = 0; i < n; i++) {
        printf("%d", a[i]);
        if (i < n - 1) {
            putchar(' ');
        }
    }
    putchar('\n');
    
    return 0;
}

Measured memory_bytes: 600
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
#include <tuple>

#define DEBUG(x) cout<<#x<<": "<<x<<endl

using namespace std;

int main(){

	long N, Q;
	string S;


	cin >> N >> Q;
	cin >> S;

	long A[N+1];

	A[0] = 0;
	for(long i = 1; i < N; i++){
		if(S[i] == 'C' && S[i-1] == 'A') A[i] = A[i-1]+1;
		else A[i] = A[i-1];
	}

	A[N] = A[N-1];

	for(long i = 0; i < Q; i++){
		int l, r;
		cin >> l >> r;
		
		cout << A[r-1] - A[l-1] << endl;
	}

	return 0;
}


Measured memory_bytes: 1920
s = input()

cnt = 1
pre = s[0]
i = 1
while i < len(s):
    if i == len(s)-1 and s[i] == pre:
        break
    elif s[i] == pre:
        pre = s[i:i+2]
        i += 2
        cnt += 1
    else:
        pre = s[i]
        i += 1
        cnt += 1

print(cnt)

Measured memory_bytes: 3500
#include <algorithm>
#include <array>
#include <climits> // INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX, ULLONG_MAX
#include <cmath>
#include <cstdint>
#include <cstring> // memset
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

#define ALL(x) (x).begin(), (x).end()
#define INF 1e9
#define LOG(x) cout << #x << " = " << (x) << endl
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)

using namespace std;

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vector<long long> a, b;

    REP(i, n) {
        long long ai;
        cin >> ai;
        a.push_back(ai);
    }
    REP(i, n) {
        long long bi;
        cin >> bi;
        b.push_back(bi);
    }

    long long d1 = 0;
    long long d2 = 0;
    long long odd = 0;
    REP(i, n) {
        long long diff = a[i] - b[i];
        if (diff >= 0)
            d2 += diff;
        else {
            d1 += -diff;
            if (diff % 2 != 0) {
                odd++;
            }
        }
    }

    long long m = min(d2, (d1 - odd) / 2);
    d1 -= 2 * m;
    d2 -= m;
    
    cout << ((d1 < d2 || (odd > 0 && d2 > 0)) ? "No" : "Yes") << endl;
    
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main() {
	int N;
	cin >> N;
	int answer;
	if (N <= 104) answer = 0;
	else if (N <= 134) answer = 1;
	else if (N <= 164) answer = 2;
	else if (N <= 188) answer = 3;
	else if (N <= 194) answer = 4;
	else answer = 5;
	cout << answer << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define endl "\n"
using namespace std;


int main() {
ll n;
cin>>n;
vector<ll> a;
for(auto i=0;i<n;i++)
{
    ll o;
    cin>>o;
    a.pb(o);
}
sort(a.rbegin(),a.rend());
ll sum=0;
sum+=a[0];
ll k=1;
for(auto i=1;i<n-1;i++)
{

    sum+=a[k];
   
    if(i%2==0)
    k++;
}

cout<<sum;
}

Measured memory_bytes: 5304
#include<iostream>
#include<algorithm>
using lint=int64_t;
using namespace std;

int main()
{
	int N,K;
	string S;

	cin >> N >> K;
	cin >> S;

	int cnt=0;
	for(int i=0;i<S.size()-1;i++)
	{
		if(S[i]==S[i+1])
			cnt++;
	}

	cout << min(cnt+2*K,N-1) << endl;
	return 0;
}



Measured memory_bytes: 512
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

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

  int N;
  cin >> N;
  vector<int> A(N, 0);
  for (int i = 0; i < N; ++i) {
    cin >> A.at(i);
  }

  std::sort(A.begin(), A.end());
  const int max = A[N-1];

  vector<bool> check(max+1, true);

  for (int i = 0; i < N; ++i) {
    if(!check[A[i]]) {
      continue;
    }
    if (A[i] * 2 > max) {
      break;
    }
    for (int k = 2 * A[i]; k <= max; k+=A[i]) {
      check[k] = false;
    }
  }
  int count = 0;
  for (int i = 0; i < N; ++i) {
    if (i < N - 1 && A[i+1] == A[i]) {
      check.at(A[i]) = false;
    }
    if (check[A[i]]) {
      ++count;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 4216
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
import bisect
import numpy as np
import math
from collections import deque
from collections import defaultdict
from math import gcd

N = int(input())
A = list(map(int, input().split()))
left = defaultdict(int)
right = defaultdict(int)
for i in range(N):
    num = i + 1
    left[A[i]+num] += 1
    right[-A[i]+num] += 1

ans = 0
for k, v in left.items():

    ans += right[k]*v

print(ans)

Measured memory_bytes: 88144
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, x;
    cin >> n >> x;
    int d[x + 1][x + 1];
    rep(i, 1, x + 1) {
        rep(j, 1, x + 1) {
            cin >> d[i][j];
        }
    }
    int c[n][n];
    int c0[x + 1] = {};
    int c1[x + 1] = {};
    int c2[x + 1] = {};
    rep(i, 0, n) {
        rep(j, 0, n) {
            cin >> c[i][j];
            if ((i + j + 2) % 3 == 0) c0[c[i][j]]++;
            if ((i + j + 2) % 3 == 1) c1[c[i][j]]++;
            if ((i + j + 2) % 3 == 2) c2[c[i][j]]++;
        }
    }

    int ans = INF;
    rep(i, 1, x + 1) {
        rep(j, 1, x + 1) {
            rep(k, 1, x + 1) {
                if (i == j || j == k || k == i) continue;
                int sum = 0;
                rep(l, 1, x + 1) {
                    sum += c0[l] * d[l][i];
                    sum += c1[l] * d[l][j];
                    sum += c2[l] * d[l][k];
                }
                ans = min(ans, sum);

            }
        }
    }

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


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

int main()
{
	int n;
	scanf("%d", &n);
	getchar_unlocked();

	unordered_set<long> d;

	while (n--) {
		long c = getchar_unlocked();
		long t = 0;
		while (getchar_unlocked() != ' ')
			;
		for (int i = 0, c; (c = getchar_unlocked()) != '\n'; i++)
			t += (c - 'A' + 1) << 3 * i;
		switch(c) {
		case 'i':
			d.insert(t); break;
		case 'f':
			puts((d.find(t) != d.end() ? "yes" : "no"));
		}
	}
}


Measured memory_bytes: 16840
s = list(input())
ans = 0
count = 0
for i in range(len(s)):
  if s[i] == 'A' or s[i] == 'T' or s[i] == 'C' or s[i] == 'G':
    count += 1
    if ans < count:
      ans = count
  else:
    count = 0
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<list>
#include<vector>
using namespace std;

int main() {
	int a;
	cin >> a;
	for (int b = 0; b < a; b++) {
		int c, d, e;
		cin >> c >> d >> e;
		int s = e;
		for (int f = 1; f < c; f++) {
			if (f % 3 == 0) {
				s += 200;
			}
			else {
				s += 195;
			}
		}
		if (c % 3 == 0) {
			s += (d - 1) * 20;
		}
		else {
			for (int x = 1; x < d; x++) {
				if (x & 1)s += 20;
				else s += 19;
			}
		}
		cout << 196471-s << endl;
	}
}

Measured memory_bytes: 3080
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef pair<int,int> P;
//int const INF=1001001001;
//ll const INF=1001001001001001001;
ll const MOD=1000000007;

string S;

int main(){
    cin>>S;
    int N=S.size();

    int cnt=1;
    rep(i,N-1) if(S[i]!=S[i+1]) cnt++;

    int ans=cnt-1;

    cout<<ans<<endl;
}

Measured memory_bytes: 3744
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define MSET(x,y) memset(x,y,sizeof(x))
#define M 55
using namespace std;
int n,X[M],Y[M];
map<pair<int,int>,int> mp;
int main()
{
    while (~scanf("%d", &n)) {
        mp.clear();
        REP(i,1,n) scanf("%d %d",&X[i],&Y[i]);
        
        REP(i,1,n)REP(j,1,n)if(i!=j) {
            mp[make_pair(X[i]-X[j], Y[i]-Y[j])]++;
        }

        if (n==1) {
            puts("1");
            continue;
        }
        int ans = 2000000000;
        for (auto i:mp) ans = min(ans, n-i.second);
        printf("%d\n", ans);
    }
    return 0;
}


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

const int INF = 1<<28;
const int MAXM = 101;
const int MAXN = 101;
int M, N;
int low[MAXM][MAXN], high[MAXM][MAXN];

int main() {
  for(; cin >> M >> N; ) {
    fill(low[0], low[MAXM], -INF);
    fill(high[0], high[MAXM], INF);
    for(int i = 0; i < M; ++i) {
      int K; cin >> K;
      for(int j = 0; j < K; ++j) {
        int s, v; string op;
        cin >> s >> op >> v;
        --s;
        if(op == "<=") high[i][s] = min(high[i][s], v);
        if(op == ">=") low[i][s] = max(low[i][s], v);
      }
    }

    try {
      vector<int> s, t;
      for(int i = 0; i < M; ++i) {
        for(int k = 0; k < N; ++k) {
          if(low[i][k] > high[i][k]) throw "No";
        }
        for(int j = 0; j < M; ++j) {
          if(i == j) continue;
          for(int k = 0; k < N; ++k) {
            if(high[i][k] < low[j][k]) {
              s.push_back(i);
              t.push_back(j);
            }
          }
        }
      }
      
      vector<int> w(M, 0);
      for(int k = 0; k < M; ++k) {
        bool update = false;
        for(int i = 0; i < s.size(); ++i) {
          if(w[t[i]] > w[s[i]] - 1) {
            w[t[i]] = w[s[i]] - 1;
            update = true;
          }
        }
        if(!update) throw "Yes";
        if(k+1 == M) throw "No";
      } 
    } catch(const char *s) {
      cout << s << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 2260
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int k = sc.nextInt();
    String s = sc.next();
    ArrayList<Integer> list1 = new ArrayList<Integer>();
    ArrayList<Integer> list2 = new ArrayList<Integer>();
    for(int i = 0; i < s.length(); i++) {
      if(i == 0) {
        if(s.charAt(i) == '1') list1.add(i);
      } else {
        if((s.charAt(i) == '1') && (s.charAt(i - 1) == '0')) list1.add(i);
      }
    }
    for(int i = 0; i < s.length(); i++) {
      if(i == s.length() - 1) {
        if(s.charAt(i) == '1') list2.add(i);
      } else {
        if((s.charAt(i) == '1') && (s.charAt(i + 1) == '0')) list2.add(i);
      }
    }
    Collections.sort(list1);
    Collections.sort(list2);
    int ans = 0;
    if(list1.size() == 0) {
      ans = n;
    } else {
      if(list1.get(0) == 0){
        if(list1.size() <= k) {
          ans = n;
        } else {
          ans = Math.max(ans, list2.get(k) + 1);
          for(int i = k + 1; i < list1.size(); i++) {
            ans = Math.max(ans, list2.get(i) - list1.get(i - k) + 1);
          }
        }
      } else {
        if(list1.size() <= k - 1) {
          ans = n;
        } else {
          ans = Math.max(ans, list2.get(k - 1) + 1);
          for(int i = k; i < list1.size(); i++) {
            ans = Math.max(ans, list2.get(i) - list1.get(i - k) + 1);
          }
        }
      }
      int p = list2.size();
      if(list2.get(p - 1) == n - 1) {
        if(p <= k) {
          ans = n;
        } else {
          ans = Math.max(ans, n - 1 - list1.get(p - 1 - k) + 1);
          for(int i = p - 2 - k; i >= 0; i--) {
            ans = Math.max(ans, list2.get(i + k) - list1.get(i) + 1);
          }
        }
      } else {
        if(p <= k - 1) {
          ans = n;
        } else {
          ans = Math.max(ans, n - 1 - list1.get(p - k) + 1);
          for(int i = p - 1 - k; i >= 0; i--) {
            ans = Math.max(ans, list2.get(i + k) - list1.get(i) + 1);
          }
        }
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 29228
#include <bits/stdc++.h>
#define MOD 10000
#define tam 301024
#define F first
#define pb push_back

#define S second
#define INF 1E9 +7
#define ll long long 
#define offset tam/2
#define forr(i, b, e)     for(ll i = b; i < e; i++)
#define fore(i, b, e) forr(i,b,e)
using namespace std;
typedef pair<int,int> ii;

int main()
{
    char s;
    cin>>s;
    s=s+1;
    cout<<s<<endl;
}   

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <cstdio>
#include <iomanip>
#include <tuple>
#include <stack>
using namespace std;
typedef long long ll;

int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}

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

int main(){
    ll a,b,c,d,e,m,n,o1=0,o2=0,o3=0,p,q,r,x,y,z,max1=0,ans=0,o=0;
    string s,t,u;
    cin>>a>>b>>c>>d;
    if(a==c)cout<<0<<endl;
    else cout<<1<<endl;
}






Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <list>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(d) string(1,d)
#define prll(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  string s;
  cin >> s;
  ll c = 0;
  ll ss = 0;
  rep(i,0,s.sz){
    if(s[i]=='S'){
      ss++;
    }
    else{
      if(ss>0){
        c++;
      }
      ss--;
    }
    if(ss<0)ss=0;
  }
  cout << s.sz-c*2 << endl;
  return 0;
}


Measured memory_bytes: 640
import math

S = int(input())
m = 10 ** 9 + 7
ans = 1
a, mod = divmod(S, 3)
if S // 3:
    mx = S // 3
else:
    mx = S // 3 + 1

if S < 3:
    print(0)
    exit()


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


for i in range(2, mx + 1):
    ans = (ans + combinations_count(S - 2 * i - 1, i - 1)) % m

print(ans)


Measured memory_bytes: 9200
import numpy as np

n,m=map(int,input().split())
a=np.zeros([n,n])
b=np.zeros([m,m])
map_ = {".":1,"#":-1}

for i in range(n):
  temp = list(input())
  temp = [map_[c] for c in temp]
  a[i,:] = np.array(temp)
  
for i in range(m):
  temp = list(input())
  temp = [map_[c] for c in temp]
  b[i,:] = np.array(temp)

flag=False
for i in range(n-m+1):
  for j in range(n-m+1):
    temp_a = a[i:i+m,j:j+m]
    check=np.sum(temp_a*b,axis=1)
    check=np.sum(check,axis=0)
    if check==m*m:
      flag=True
      break
    else:
      pass
if flag:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 12516