akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

/*

*/

string s;
ll n,ans=999;

int main(void){
	cin>>s;
	rep(i,s.size()-2){
		ll a=atoi(s.substr(i,3).c_str());
		if(ans>abs(753-a))ans=abs(753-a);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
//g++ -std=c++14 test.cpp -o test.out
//問題URL
//https://atcoder.jp/contests/abc095/tasks/arc096_b
//参考：
//https://pitsbuffersolution.com/compro/atcoder/arc096d.php

//大まかな流れ
//まず反時計回りに寿司jをとりに行って、それから時計回りに引き返して寿司iを撮りにいく
//または
//まず時計回りに寿司iをとりに行って、それから反時計回りに引き返して寿司jを撮りにいく
//方法が解となる

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (LL)(1e18)+1;
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

LL N,C;
LL x[100001],v[100001];
 
LL ans = 0;

void solve(){
	//1~i番目までのカロリーの合計をdish_accum_clockwise[i]とおく
	vector<LL> dish_accum_clockwise(N+1,0);
	for(int i=1;i<=N;i++){
		dish_accum_clockwise[i] = dish_accum_clockwise[i-1] + v[i];
	}

	LL mx0 = 0;//まず反時計回りに行って、それから時計回りに引き返す用
	LL mx1 = 0;//まず時計回りに行って、それから反時計回りに引き返す用
	//地点0から見た、i番目の寿司について注目していく
	for(int i=N;i>=1;i--){
		//dish_accum_clockwise[i] = 1~i-1番目までのカロリーの合計
		//↑時計回りに1番目,2番目,...,i-1番目とi-1個分見ていくイメージ

		//dish_accum_clockwise[i]-x[i]+mx0
		//まず反時計回りにとある寿司をとりに行き、そこから時計回りに引き返して(ここまでがmx0)
		//寿司iをとりに行った時の総カロリー

		//dish_accum_clockwise[i]-2*x[i]+mx1
		//まず時計回りにとある寿司をとりに行き、そこから反時計回りに引き返して(ここまでがmx1)
		//寿司iをとりに行った時の総カロリー

		//このうち大きい方をansとする
		ans = max(ans,dish_accum_clockwise[i]-x[i]+mx0);//i=Nの時は必ずこれが選ばれる
		ans = max(ans,dish_accum_clockwise[i]-2*x[i]+mx1);

		//dish_accum_clockwise[N]-dish_accum_clockwise[i-1]
		// = i-1~N-1番目までのカロリーの合計
		//↑反時計回りにN-1番目,N-2番目,...,i-1番目とN-i+1個分見ていくイメージ
		//C-x[i] = 寿司iに、地点0から反時計回りに向かった時の距離
		//dish_accum_clockwise[N]-dish_accum_clockwise[i-1]

		//dish_accum_clockwise[N]-dish_accum_clockwise[i-1]-(C-x[i])
		//は、寿司iに、地点0から反時計回りに向かった時に得られる総カロリー

		//mx0には、地点0からj(0<=j<=i-1)番目の寿司をとりに行き、地点0に戻る時のカロリー摂取量
		//が入っている(ただしjは(0<=j<=i-1)のうち、max0が最大になるようなもの)
		mx0 = max(mx0,dish_accum_clockwise[N]-dish_accum_clockwise[i-1]-2*(C-x[i]));
		//mx1には、地点0からj(0<=j<=i-1)番目の寿司をとりに行くのカロリー摂取量
		//が入っている(ただしjは(0<=j<=i-1)のうち、mx1が最大になるようなもの)
		mx1 = max(mx1,dish_accum_clockwise[N]-dish_accum_clockwise[i-1]-(C-x[i]));
	}
	ans = max(ans,mx1);
}

int main(){
    cin >> N >> C;
    for(int i=1;i<=N;i++){
    	cin >> x[i] >> v[i];
    }
 
    solve();
 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
n = int(input())
l = list(map(int, input().split()))

# a+b>c かつ b+c>a かつ c+a>b

import itertools
work_list = list()
for i in itertools.combinations(l, 3):
    if i[0] != i[1] and i[0] != i[2] and i[1] != i[2]:
        work_list.append(i)

def check(set_value):
    if set_value[0] + set_value[1] > set_value[2] and \
       set_value[1] + set_value[2] > set_value[0] and \
       set_value[2] + set_value[0] > set_value[1]:
        return 'ok'
    else:
        return 'ng'
ans = 0
for i in work_list: 
    if check(i) == 'ok':
        ans += 1
print(ans)

Measured memory_bytes: 20440
D,N = map(int, input().split())

if D == 0:
    if N == 100:
        print(101)
    else:
        print(N)
elif D == 1:
    if N == 100:
        print(10100)
    else:
        print(N*100)
elif D == 2:
    if N == 100:
        print(1010000)
    else:
        print(N*10000)

Measured memory_bytes: 3064
#include<iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
	int n1,n2;
	cin>>n1>>n2;
	if(n1==1&&n2==2){
		cout<<"3"<<endl;
	}
	if(n1==2&&n2==1){
		cout<<"3"<<endl;
	}
	
	if(n1==1&&n2==3){
		cout<<"2"<<endl;
	}
	if(n1==3&&n2==1){
		cout<<"2"<<endl;
	}
	
	if(n1==3&&n2==2){
		cout<<"1"<<endl;
	}
	if(n1==2&&n2==3){
		cout<<"1"<<endl;
	}
	
	return 0;
}
 

Measured memory_bytes: 256
main = do
  _ <- getLine
  getLine >>= putStrLn . solve . input

-- 入力
input :: String -> [Int]
input = (map read) . words

-- 解答
solve xs = unwords . map show $ [foldr min infty xs, foldr max (-infty) xs, foldr (+) 0 xs]
  where infty = 1000001



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

int m[100010][10],dp[100010][10],n;

int solve(int id,int ult){
  if(id==n+1) return 0;
  if(dp[id][ult]!=-1) return dp[id][ult];
  if(ult==1) return dp[id][ult]=max(m[id][ult]+solve(id+1,2),m[id][ult]+solve(id+1,3));
  if(ult==2) return dp[id][ult]=max(m[id][ult]+solve(id+1,1),m[id][ult]+solve(id+1,3));
  return dp[id][ult]=max(m[id][ult]+solve(id+1,1),m[id][ult]+solve(id+1,2));
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  memset(dp,-1,sizeof(dp));
  cin>>n;
  for(int i=1;i<=n;i++){
    for(int j=1;j<=3;j++){
      cin>>m[i][j];
    }
  }
  cout<<max(solve(1,1),max(solve(1,2),solve(1,3)))<<"\n";
  return 0;
}

Measured memory_bytes: 12800
const BKRT = "\n";
const SPAC = " ";
const NOSP = "";

function Main(input){
	input = [].concat(...input.trim().split(BKRT).map(a=>a.split(SPAC)));
  var strShift = ()=>input.shift();
  var intShift = ()=>~~input.shift();
  
  return intShift()>999?"ABD":"ABC";
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
1000
`);

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

using namespace std ; 

int main () { 
	int  t ; 
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ;
	string s ; 
	cin >> s;  
	int fa = 0 ;
	int fb= 0 ; 
	for ( int i = 0 ; i < s.size() ; i ++ ){
		if ( s[i] == 'A' )
			fa++ ; 
		else
			fb++ ; 
	}
	if ( fa == 0 || fb == 0 )
		cout << "No" << endl ; 
	else 
		cout << "Yes" << endl ; 
}


Measured memory_bytes: 256
# ABC 112: B – Time Limit Exceede
n, t = [int(s) for s in input().split()]

c = []

for i in range(n):

    tmp = [int(s) for s in input().split()]

    if tmp[1] <= t:
        c.append(tmp[0])

print(min(c) if len(c) != 0 else 'TLE')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
typedef long long int ll;
using namespace std;
int main()
{
  int a,b,c,d,e,k;
  cin >> a >> b>> c>> d>> e >> k;
  if(e - a > k){
    cout << ":(" << endl;
  }else{
    cout << "Yay!" << endl;
  }
}


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

int main()
{
  int W, a, b;
  scanf("%d", &W);
  scanf("%d", &a);
  scanf("%d", &b);

  if (W>=abs(b-a)) {
    printf("0");
  }else{
    printf("%d",abs(W-abs(b-a)));
  }

  return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll a,b;
    cin >> a >> b;

    ll t = a-1;
    if(a == 0){
        t = 0;
    }

    ll first = 0;
    for(ll i = 2; i <= 50; i++){
        if(t%(1LL << i) < (1LL << i)/2){

        }else{
            if((t%(1LL << i))%2 == 0){
                first |= (1LL << (i-1));
            }
        }
    }

    ll end = 0;
    for(ll i = 2; i < 50; i++){
        if(b%(1LL << i) < (1LL << i)/2){

        }else{
            if((b%(1LL << i))%2 == 0){
                end |= (1LL << (i-1));
            }
        }
    }

    if(t%4 == 1 || t%4 == 2){
        first |= 1;
    }
    if(b%4 == 1 || b%4 == 2){
        end |= 1;
    }

    cout << (first^end) << endl;
    
    return 0;
}

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

int n, m;

int main() {
	scanf("%d%d", &n, &m);
	int x = (m+1)/2, y = m/2;
	for (int i = 1; i <= x; ++i) {
		printf("%d %d\n", i, 2*x+1-i);
	}
	for (int j = 1; j <= y; ++j) {
		printf("%d %d\n", 2*x+j, 2*x+2*y+2-j);
	}
}


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

int		main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s;
	rep(i, 2)
		cin >> s;
	char x = s.at(0);
	cout << "A" << x <<"C\n";
}


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

using namespace std;

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

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
  fastIO;
  int r, d, x;
  cin >> r >> d >> x;
  for(int i = 1; i <= 10 ; i ++ ){
    x = r * x - d;
    cout << x << "\n";
  }
  return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let a: i128 = sc.cin();
    let b: i128 = sc.fuck();
    put!((a * b) / 100);
}

use std::collections::VecDeque;
use std::io::{self, Write};
use std::str::FromStr;

struct Scanner {
    stdin: io::Stdin,
    buffer: VecDeque<String>,
}
impl Scanner {
    fn new() -> Self {
        Scanner {
            stdin: io::stdin(),
            buffer: VecDeque::new(),
        }
    }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.is_empty() {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn fuck(&mut self) -> i128 {
        let mut a = self.cin::<String>();
        a.retain(|c| c != '.');
        a.parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.cin::<String>().chars().collect()
    }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.cin()).collect()
    }
}


Measured memory_bytes: 2120
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
    int n;
    cin >> n;
    if (n == 3) {
        cout << "2 5 63" << endl;
        return 0;
    }
    if (n == 4) {
        cout << "2 5 20 63" << endl;
        return 0;
    }
    if (n == 6) {
        cout << "2 3 4 5 6 10" << endl;
        return 0;
    }
    n -= 5;
    long long co = 0;
    int w = 2, h = 3;
    bool b = true;
    for (int i = 0; i < 5000; i++) {
        int m = n - i * 3;
        if (m % 2 == 0 && m >= 0 && m < 5000) {
            h += i * 3;
            w += m;
            b = false;
            break;
        }
    }
    if (b) {
        for (int i = 2; i < 15000; i += 3) {
            int m = n - i;
            if (m % 2 == 0 && m >= 0 && m < 5000) {
                h += i;
                w += m;
                break;
            }
        }
    }
    int ans = 3;
    for (int i = 0; i < w; i++) {
        cout << ans << " ";
        ans += 6;
    }
    ans = 2;
    for (int i = 0; i < h; i++) {
        cout << ans;
        if (i != h - 1) {
            cout << " ";
        }
        ans += 2;
    }
    cout << endl;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
int a,b;
int s=1;
int main() {
    cin>>a>>b;
    if(a>0&&b>0){
        cout<<"Positive"<<endl;
	} 
	else if(max(a,b)>=0&&min(a,b)<=0||a==0||b==0){
        cout<<"Zero"<<endl;
	}    
	else{
        if((abs(min(a,b))-abs(max(a,b)))%2==0){
            cout<<"Negative"<<endl;
        }
		else{
            cout<<"Positive"<<endl;
        }
    }
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;


ll a[16][16];
ll dp[1<<16];

int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);

    int i,j;
    for(i=0; i<n; i++) {
        for(j=0; j<n; j++) {
            scanf("%lld", &a[i][j]);
        }
    }

    int mm=(1<<n);
    int z[17];
    int k;
    for(k=0; k<mm; k++) {
        int siz=0;
        for(i=0; i<n; i++) {
            if(k & (1<<i)) z[siz++]=i;
        }

        dp[k]=0;
        for(i=0; i<siz; i++) {
            for(j=i+1; j<siz; j++) {
                dp[k] += a[z[i]][z[j]];
            }
        }
    }

    for(k=0; k<mm; k++) {
        int siz=0;
        for(i=0; i<n; i++) {
            if(k & (1<<i)) z[siz++]=i;
        }
        ll max=0;
        int MM=(1<<siz)-1;
        for(i=0; i<MM; i++) {
            int tmp0=0;
            for(j=0; j<siz; j++) {
                if(i & (1<<j)) tmp0 |= (1<<z[j]);
            }
            ll val = dp[tmp0]+dp[k^tmp0];
            max = MAX(max, val);
        }
        dp[k] = max;
    }
    printf("%lld\n", dp[mm-1]);

    return 0;
}


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

using namespace std;
using ll = long long;

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

int main() {
  int a, b, x;
  cin >> a >> b >> x;

  double ans;
  if (a * a * b > 2 * x) {
    ans = atan((double)a * b * b / 2 / x);
  } else {
    ans = atan(2.0 / a * (b - (double)x / (a * a)));
  }
  printf("%.15f\n", ans * 180 / M_PI);
  return 0;
}


Measured memory_bytes: 512
using System;
using System.Linq;

namespace ABC135C
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            long[] a = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long[] b = Console.ReadLine().Split().Select(long.Parse).ToArray();

            long res = 0;
            for (int i = 0; i < n; i++)
            {
                long l = Math.Min(a[i] + a[i + 1], b[i]);
                res += l;
                if (l - a[i] > 0)
                {
                    a[i + 1] -= l - a[i];
                }
            }

            Console.WriteLine(res);
        }
    }
}



Measured memory_bytes: 37980
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
#include <complex>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;

typedef complex<double> Point;
const static double EPS = 1e-12;
const static int MAX_V = 501;

class UnionFindTree {
  int _par[501];
  int _rank[501];
public:
  UnionFindTree(int N){
    for(int i = 0; i < N; ++i){
      _par[i] = i;
      _rank[i] = 0;
    }
  }

  UnionFindTree(int par[501]){
    memcpy(_par,par,sizeof(int)*501);
    memset(_rank,0,sizeof(_rank));
  }

  int find(int u){
    if(_par[u] == u) return u;
    return find(_par[u]);
  }
  bool same(int u,int v){
    u = find(u);
    v = find(v);
    return (u == v);
  }

  bool unite(int u,int v){
    u = find(u);
    v = find(v);
    if(u == v) return false;
    
    if(_rank[u] < _rank[v]){
      _par[u] = v;
    }
    else{
      _par[v] = u;
      if(_rank[u] == _rank[v]) _rank[u]++;
    }
    return true;
  }
};

class Edge {
public:
  int from;
  int to;
  int cost;
  Edge(int from,int to,int cost) 
    : from(from), to(to), cost(cost) {}
  bool operator<(const Edge& e) const {
    return cost < e.cost;
  }
  bool operator>(const Edge& e) const {
    return cost > e.cost;
  }
};

int num_of_islands;
int num_of_pairs;

bool check_connect(UnionFindTree& uft){
  for(int i = 1; i < num_of_islands; i++){
    if(!uft.same(0,i)) return false;
  }
  return true;
}

int main(){
  while(~scanf("%d %d",&num_of_islands,&num_of_pairs)){
    vector<Edge> orig;
    int par[501];
    for(int i = 0; i <= 500; ++i){
      par[i] = i;
    }

    for(int i = 0; i < num_of_pairs; ++i){
      int from,to;
      int cost;
      scanf("%d %d %d",&from,&to,&cost);
      from--; to--;
      orig.push_back(Edge(from,to,cost));
    }

    UnionFindTree uft(par);
    sort(orig.begin(),orig.end());

    int sum = 0;
    bool used[50001] = {};
    for(int i = 0; i < orig.size(); ++i){
      if(uft.unite(orig[i].from,orig[i].to)){
        sum += orig[i].cost;
        used[i] = true;
      }
    }
    int res_cost = 0;
    int res_count = 0;

    for(int i = 0; i < orig.size(); ++i){
      if(!used[i]) continue;

      UnionFindTree uft2(par);
      int sum2 = 0;
      int prev = orig[i].cost;
      orig[i].cost = INF;

      for(int j = 0; j < orig.size(); ++j){
        if(orig[j].cost >= INF) continue;
        if(uft2.unite(orig[j].from,orig[j].to)){
          sum2 += orig[j].cost;
        }
      }
      orig[i].cost = prev;

      if(sum2 > sum || !check_connect(uft2)){
        res_cost += orig[i].cost;
        res_count++;
      }
    }
    printf("%d %d\n",res_count,res_cost);
  }
}

Measured memory_bytes: 1988
coin500 = int(input())
coin100 = int(input())
coin50 = int(input())
total = int(input())

ans = 0
for i_500 in range(coin500 + 1):
    for i_100 in range(coin100 + 1):
        for i_50 in range(coin50 + 1):
            if 500 * i_500 + 100 * i_100 + 50 * i_50 == total:
                ans += 1
print(ans)


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);

    while (in.hasNext()) {
      int N = in.nextInt();
      String s = in.next();

      int countR = 0;
      for (int i = 0; i < s.length(); ++i) {
        if (s.charAt(i) == 'R') {
          ++countR;
        }
      }

      if (countR > N - countR) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
    }
  }
}

Measured memory_bytes: 25300
import java.util.Scanner;

class Main
{
    static  int[]F = new int[45];

    public static void makeFibona()
    {
	F[0] = 1;
	F[1] = 1;

	for(int i = 2; i < F.length; i++)
	    F[i] = F[i - 2] + F[i - 1];
    }

    public static int Fibona(int n)
    {
	if(n == 0 || n == 1)
	    return F[n];

	return F[n];

    }
 
    public static void main(String[] args)
    {
	Scanner In = new Scanner(System.in);
 
	int N = In.nextInt();

	makeFibona();

	System.out.println(Fibona(N));
    }
}

Measured memory_bytes: 26372
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k,a[1005],sum=0;
cin>>n>>k;
for(int i=0;i<n;i++)
{
    cin>>a[i];
}
sort(a,a+n);
for(int i=0;i<k;i++)
{
    sum+=a[i];
}
cout<<sum;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N=1e5+5;

int n;
int a[N];

int32_t main()
{
	IOS;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	int sum=0;
	sort(a+1, a+n+1);
	for(int i=1;i<=n-1;i++)
		sum+=a[i];
	if(a[n]<sum)
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}


Measured memory_bytes: 256
///Astalavista Code........~CodeSlayer007
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define Br cout<<endl
#define int long long
#define fe first
#define se second
#define double long double
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define PT(x) cout << (x) << endl
#define last(x)  prev(x.end())
#define PTT(x) cout << (#x) << " is " << (x) << endl
#define lets_go ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
const int M = 1e9 + 7;
const int N = 2e5 + 10;
const int IM = 1e15 + 37;
const double PI = 3.1415926535897932384;
inline void PP(int n) { cout << n << " ";}
void PV(vi v) { for (int i = 0 ; i < v.size() ; i++) cout << v[i] << " " ; cout << endl;}
void PVV(vii v) {for (int i = 0 ; i < v.size() ; i++) cout << v[i].first << " " << v[i].second << endl;}
void PA(int v[], int n, int x = 0) { for (int i = x ; i < n + x; i++)cout << v[i] << ' ' ; cout << endl;}
void IN(int a[], int n, int x = 0) {for (int i = x; i < n + x; i++)cin >> a[i];}
inline void op() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
// <=================================================================================================================================
// <=================================================================================================================================


signed  main() {
    //op();
    lets_go

    int n, k;
    cin >> n >> k;
    int h[n + 10] = {0};
    IN(h, n, 1);
    int dp[n] = {0};
    for (int i = 2; i <= n; i++) {
        int j = i - 1, u = k;
        dp[i] = IM;
        while (j >= 1 && u--) {
            dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]));
            j--;
        }
    }
    int ans = dp[n];
    PT(ans);




    /**/
    return 0;
}

Measured memory_bytes: 5200
N=int(input())
X=input().split()
Y=[int(a) for a in X]
Z=sorted(Y)
a=Z[int(N/2-1)]
b=Z[int(N/2)]
for c in range(N):
    if Y[c]<=a:
        print(b)
    else:
        print(a)
        

Measured memory_bytes: 29504
#include<bits/stdc++.h>
using namespace std;
const int N=200005;
int n,a[N],m;

int main()
{
    scanf("%d%d",&n,&m); n*=2;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]),a[i]%=m;
    sort(a+1,a+n+1);
    int l=0,r=n/2,mid,best=n/2;
    while(l<=r)
    {
        mid=(l+r)>>1;
        int pos=mid<<1,bl=1;
        for(int i=pos+1;i<=n;i++)
        {
            int j=n-(i-pos)+1;
            if(j<i) break;
            if(a[i]+a[j]<m) bl=0;
        }
        if(bl) r=mid-1,best=mid;
        else l=mid+1;
    }
    int pos=best<<1;
    int ans=0;
    for(int i=1;i<=pos;i++)
    {
        int j=pos-i+1;
        if(j<i) break;
        ans=max(ans,(a[i]+a[j])%m);
    }
    for(int i=pos+1;i<=n;i++)
    {
        int j=n-(i-pos)+1;
        if(j<i) break;
        ans=max(ans,(a[i]+a[j])%m);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4492
#include<iostream>
#include<set>
#include <bitset>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include <cstdio>
#include<algorithm>
#include <sstream>
#include<string>
#include<string.h>
#include <cmath>
#include <iomanip>
#include <string>
#include<list>
#include <limits>
#include <numeric>
#include <type_traits>
#define int long long
#define ll long long
#define mod  1000000007
#define inf 1e17
#define rep(i,j,n) for(int i=j;i<n;i++)
#define P pair<int,int>
double pi = 3.141592653589793;
using namespace std;
//ここから始めよう
signed main(){
    int a;cin>>a;
    if(a<1200)cout<<"ABC"<<endl;
    else if(a<2800)cout<<"ARC"<<endl;
    else cout<<"AGC"<<endl;
    return 0;
}


Measured memory_bytes: 764
N = int(input())
A = [int(i) for i in input().split(" ")]

count = 1
key = 0
for i in range(N-1):
    if key == 0:
        if A[i+1] - A[i] > 0:
            key = 1
        elif A[i+1] - A[i] < 0:
            key = -1
        else:
            continue
    elif key == 1:
        if A[i+1] - A[i] < 0:
            key = 0
            count += 1
    else:
        if A[i+1] - A[i] > 0:
            key = 0
            count += 1
print(count)

Measured memory_bytes: 14252
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
  int n; cin >> n;
  int x; cin >> x;
  vector<ll> a(n); for (int i = 0; i < n; ++i) cin >> a[i];

  sort(a.begin(), a.end());
  int result = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] <= x) {
      result++;
      x -= a[i];
    }
  }
  if (result == n && x != 0) result--;
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<queue>
#include<stack> 
using namespace std;
typedef pair<int,int> pii;

int getEmpty(int n, stack<pii> *s){
    for(int i = 0; i < n; i++){
        if(s[i].empty())    return i;
    }
    return -1;
}

int getG(int n, stack<pii> *s, int now, int cnow){
    int ret = -1, diff = 1<<30;
    for(int i = 0; i < n; i++){
        if(s[i].size() == 2)    continue;
        int residual = s[i].top().first-now;
        if(residual >= cnow && residual-cnow < diff){
            ret = i;
            diff = residual-cnow;
        }
    }
    return ret;
}

int getS(int n, stack<pii> *s, int now, int cnow){
    int ret = -1, diff = 1<<30;
    for(int i = 0; i < n; i++){
        if(s[i].size() == 2)    continue;
        int residual = s[i].top().first-now;
        if(cnow-residual < diff){
            ret = i;
            diff = cnow-residual;
        }
    }
    return ret;
}

int main(){
    int m, n;
    while(cin >> m >> n, m+n){
        queue<pair<int,pii>> wait;
        stack<pii> park[m];
        vector<int> ans;
        priority_queue<int> t;
        for(int i = 0; i < n; i++){
            int x;  cin >> x;
            wait.push({i*10, {x, i+1}});
            t.push(-i*10);
        }
        while(!t.empty()){
            int now = -t.top();    t.pop();

            // leave
            for(int i = 0; i < m; i++){
                while(!park[i].empty() && park[i].top().first <= now){
                    ans.push_back(park[i].top().second);
                    park[i].pop();
                }
            }

            // park
            while(!wait.empty() && wait.front().first <= now){
                int tmp = getEmpty(m, park);    
                if(tmp != -1)   goto PARK;
                tmp = getG(m, park, now, wait.front().second.first);
                if(tmp != -1)   goto PARK;
                tmp = getS(m, park, now, wait.front().second.first);
                if(tmp != -1)   goto PARK;
                if(tmp == -1)   break;
                PARK:
                wait.front().second.first += now;
                park[tmp].push(wait.front().second);
                t.push(-wait.front().second.first);
                wait.pop();
            }
        }
        for(int i = 0; i < n; i++)  cout << ans[i] << " \n"[i==ans.size()-1];
    }
    return 0;
}


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

using namespace std;
int main(int argc, char const *argv[]) {
        int n /*１からｎまで*/, x; //　合計がｘになるように
        int comb = 0; // 組合せの数
        while(cin >> n >> x ) {
                if(n == 0 && 0 == x) break;
                for(int i = 1; i <= n; i++) {
                        for(int j = 1; j <= n; j++) {
                                if(i == j) break;
                                for(int k = 1; k <= n; k++ ) {
                                        if(k == i || k == j) break;
                                        if(i+j+k == x) comb++;
                                }
                        }
                }
                cout << comb << '\n';
                comb = 0;
        }

        return 0;
}



Measured memory_bytes: 3072
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int INF = (int)1e9 + 7;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    int n; cin >> n;
    vector<int> dp(n + 1, INF);
    dp[0] = 0;
    for (int i = 0; i < n; i++) {
        for (int pow6 = 1; i + pow6 <= n; pow6 *= 6) {
            chmin(dp[i + pow6], dp[i] + 1);
        }
        for (int pow9 = 1; i + pow9 <= n; pow9 *= 9) {
            chmin(dp[i + pow9], dp[i] + 1);
        }
    }
    cout << dp[n] << endl;
    return 0;
}

Measured memory_bytes: 640
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	cnt := 0
	for i := 0; i < n; i++ {
		var l, r int
		fmt.Scan(&l, &r)
		cnt += r - l + 1
	}
	fmt.Println(cnt)
}

Measured memory_bytes: 512
#include<stdio.h>
#define zyougen 150
int i, j, num, gyou, retu, kosuu, A[zyougen][zyougen]={0};
int point, min[zyougen], kyori,used[zyougen],box[zyougen]={0};

int nearest(int used[]){
 for(i=1; i<=num; i++){
   if (used[box[i]] == 1) {
     return box[i];
   }
 }
 return -1;
}

int main(){

 scanf("%d", &num);
 for(i=1; i<=num; i++){
   scanf("%d %d", &gyou, &kosuu);
   for(j=0; j<kosuu; j++){
     scanf("%d", &retu);
     A[gyou][retu] = 1;
   }
   min[i] = zyougen;
 }

 point = 1;
 used[point] = 1;
 min[point] = 0;
 j=0;

 while(point != -1){
   for(i=1; i<=num; i++){
     if (A[point][i] == 1) {
       kyori = min[point] + 1;
       if (min[i] > kyori) {
         min[i] = kyori;
       }
       if (used[i] == 0) {
         used[i] = 1;
         j++;
         box[j] = i;
       }
     }
   }
   used[point] = -1;
   point = nearest(used);
 }

 for(i=1; i<=num; i++){
   if(min[i] == zyougen){
     min[i] = -1;
   }
 }

 for(i=1; i<=num; i++){
   printf("%d %d\n", i, min[i]);
 }

 return 0;
}

Measured memory_bytes: 1824
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

int main(void){
  int n, k;
  string s;
  cin >> n >> s >> k;

  k --;

  char c;
  c = s.at(k);

  for(int i = 0; i < n; i ++){
    if(s.at(i) != c){
      s.at(i) = '*';
    }
  }

  cout << s << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, ll> Pl;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const int mod = 998244353;
const int INF = 1e+9;

ll mod_pow(ll x, int n){
    if(n == 0)      return 1;

    ll res = 1;
    while(n > 0){
        if(n & 1)   res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

struct Combination{
    int sz;
    vector<ll> fact;
    vector<ll> ifact;

    Combination(int sz = 1e+5) : sz(sz) {
        fact = vector<ll>(sz + 1);
        ifact = vector<ll>(sz + 1);

        fact[0] = 1;
        for(ll i = 1; i <= sz; ++i){
            fact[i] = fact[i - 1] * i % mod;
        }

        ifact[sz] = mod_pow(fact[sz], mod - 2);
        for(ll i = sz; i > 0; --i){
            ifact[i - 1] = ifact[i] * i % mod;
        }
    }

    ll get_combination(int n, int r){
        if(n < 0 || r < 0 || n < r)     return 0;

        return fact[n] * ifact[r] % mod * ifact[n - r] % mod;
    }
};

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

    ll n, a, b, k;
    cin >> n >> a >> b >> k;
    Combination c(n);
    ll res = 0;
    for(ll i = 0; i <= n; ++i){
        ll tmp = k - a * i;
        if(tmp < 0 || tmp % b != 0) continue;   // 点数
        tmp /= b;
        if(tmp > n)     continue;   // 枚数
        res = (res + ((c.get_combination(n, i) + mod) % mod * ((c.get_combination(n, tmp) + mod) % mod))) % mod;
    }
    cout << res << endl;
}

Measured memory_bytes: 4992
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int, int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))

int main(void){
	//木
	//どこか根を決めて、たどる。根からの距離を調べる
	//根から遠いもので数が書いてあるものを順番に調べていく。根に向かって進みつつ書ける数字を記録していく
	//すでに数が書いてあるところに出会ったら、偶奇をチェックして新しく書ける数字を計算してあげる
	//最終的に根まで来て矛盾がなければOK。適当に根の数字を決めて、また順番にたどっていく
	//書ける数字が記録されていなかったらとりあえず増やすか減らすかしておけば良い
	
	int n; cin >> n;
	vector<vector<int>> v(n);
	vector<mp> m(n, mp(-1, -1));
	vector<int> d(n, -1);
	vector<bool> u(n, false);
	rep(i, n-1){
		int ta, tb; cin >> ta >> tb; ta--; tb--;
		v[ta].push_back(tb);
		v[tb].push_back(ta);
	}
	
	queue<int> qq; qq.push(0); d[0] = 0;
	while(!qq.empty()){
		int p = qq.front(); qq.pop();
		rep(i, v[p].size()) if(d[v[p][i]] == -1){
			d[v[p][i]] = d[p] + 1;
			qq.push(v[p][i]);
		}
	}
	
	priority_queue<mp> q;	
	int k; cin >> k;
	rep(i, k){
		int tv, tp; cin >> tv >> tp; tv--;
		m[tv] = mp(tp, 0);
		q.push(mp(d[tv], tv));
	}
	
	while(!q.empty()){
		mp p = q.top(); q.pop();
		if(u[p.sec]) continue;
		u[p.sec] = true;
		rep(i, v[p.sec].size()){
			int e = v[p.sec][i];
			if(d[e] != p.fir - 1) continue;
			if(m[e] != mp(-1, -1)){
				mp ml = m[e], ms = m[p.sec]; ms.sec++;
				if((ml.fir+ml.sec)%2 != (ms.fir+ms.sec)%2){cout << "No" << endl; return 0;}
				int mi  = max(ml.fir - ml.sec, ms.fir - ms.sec);
				int ma  = min(ml.fir + ml.sec, ms.fir + ms.sec);
				if(ma < mi){cout << "No" << endl; return 0;}
				m[e] = mp((ma+mi)/2, (ma-mi)/2);
				q.push(mp(p.fir - 1, e));
			}else{
				m[e] = mp(m[p.sec].fir, m[p.sec].sec + 1);
				q.push(mp(p.fir - 1, e));
			}
		}
	}
	
	cout << "Yes" << endl; 
	
	vector<int> o(n, -1);
	qq.push(0); o[0] = m[0].fir + m[0].sec;
	while(!qq.empty()){
		int p = qq.front(); qq.pop();
		rep(i, v[p].size()) if(o[v[p][i]] == -1){
			int t = o[p] + 1;
			if(m[v[p][i]].fir != -1 && (m[v[p][i]].fir-m[v[p][i]].sec > t || t > m[v[p][i]].fir+m[v[p][i]].sec)) t -= 2;
			o[v[p][i]] = t;
			qq.push(v[p][i]);
		}
	}
		
	rep(i, n) cout << o[i] << endl;
		
	return 0;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int sum = a + b;
  if (sum % 2 == 0) {
    cout << sum / 2;
  } else {
    cout << sum / 2 + 1;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long n,a[224514]={0},s=0;
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i],s+=a[i];
	long ss=0,m=s;
	for(int i=0;i<n;i++)
	{
		m=min(m,abs(s-ss-ss));
		ss+=a[i];
	}
	cout<<m<<endl;
}

Measured memory_bytes: 2048
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var over3200 = 0;
            var checker = new bool[8];
            for (var i = 0; i < A.Length; i++)
            {
                var rate = A[i] / 400;
                if (rate < 8) checker[rate] = true;
                else over3200++;
            }
            var min = checker.Count(x => x);
            if (min == 0 && over3200 > 0)
            {
                min = 1;
                over3200--;
            }
            var max = min + over3200;

            Console.WriteLine($"{min} {max}");
        }
    }
}


Measured memory_bytes: 28316
/*
    Mbak Rose Dong
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,j,k,x,y,ans,curr,temp,m,h;
    int a,b;
    cin >> a >> b;
    cout << (a*3 + b)/2 << endl;
    return 0;
}


Measured memory_bytes: 256
/*
Author: Xjrjyy
LANG: C++
PROG: agc009_a.cpp
Mail: admin@xjrjyy.com
Blog: https://blog.xjrjyy.cn/
*/

#include <cstdio>
#include <cctype>
#include <vector>
#include <iostream>
#include <algorithm>

#define MAXN (100005 * 3)

int n;
int a[MAXN];
long long ans;

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n * 3; ++i)
    {
        scanf("%d", &a[i]);
    }
    std::sort(a, a + n * 3);
    for (int i = 1; i <= n; ++i)
    {
        ans += a[n * 3 - i * 2];
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 4860
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
 
class Program{
    static void Main(){
        int n = int.Parse(Console.ReadLine());
        LinkedList<int> ll = new LinkedList<int>();
        for (int i = 0; i < n; i++)
        {
            string[] order = Console.ReadLine().Split(' ');
            switch (order[0])
            {
                case "insert":
                    ll.AddFirst(int.Parse(order[1]));
                    break;
                case "delete":
                    ll.Remove(int.Parse(order[1]));
                    break;
                case "deleteFirst":
                    ll.RemoveFirst();
                    break;
                case "deleteLast":
                    ll.RemoveLast();
                    break;
            }
        }

        Console.WriteLine(string.Join(" ", ll.Select(elem => elem.ToString()).ToArray()));
    }
}

/*
public class LinkedList<T> : IEnumerable<T>{
    public class Node{
        T val;
        Node prev;
        Node next;
        int count;

        internal Node(T val, Node prev, Node next){
            this.val = val;
            this.prev = prev;
            this.next = next;
        }

        public T Value{
            get {return this.val;}
            set {this.val = value;}
        }

        public Node Next {
            get {return this.next;}
            internal set {this.next = value;}
        }

        public Node Previous{
            get {return this.prev;}
            set {this.prev = value;}
        }
    }

    Node dummy;

    public LinkedList(){
        this.dummy = new Node(default(T), null, null);
        this.dummy.Next = this.dummy;
        this.dummy.Previous = this.dummy;
    }

    public Node First{
        get { return this.dummy.Next; }
    }

    public Node Last{
        get { return this.dummy.Previous; }
    }


    public Node InsertAfter(Node n, T elem){
        Node m = new Node(elem, n, n,Next);
        n.Next.Previous = m;
        n.Next = m;
        count++;
        return m;
    }

    public Node InsertBefoure(Node n, T elem){
        Node m = new Node(elem, n, n.Next);
        n.Next.Previous = m;
        n.Next = m;
        count++;
        return m;
    }

    public Node Erase(Node n){
        if(n == this.dummy){
            return this.dummy;
        }
        n.Previous.Next = n.Next;
        n.Next.Previous = n.Previous;
        count--;
        return n.Next;
    }

    public Node InsertFirst(T elem){
        return InsertAfter(this.dummy, elem);
    }

    public Node InsertLast(T elem){
        return InsertBefoure(this.dummy, elem);
    }

    public void EraseFirst(){
        this.Erase(this.First);
    }
    public void EraseLast(){
        this.Erase(this.Last);
    }

    public int Count(){
        return this.count;
    }
}
*/

Measured memory_bytes: 83100
n=int(input())
if n==1:
	print(1)
	exit()
xy = sorted([list(map(int,input().split())) for i in range(n)])

#j-iの全組み合わせの差分を取る-①
m=0
for j in range(n):
	for i in range(n):
		if i==j:
			continue
		p = xy[j][0]-xy[i][0]
		q = xy[j][1]-xy[i][1]
		c = 0
		#全組み合わせで引き算をして①になったらカウント
		for k in range(n):
			for l in range(n):
				if k==l:
					continue
				if xy[l][0]-xy[k][0]==p and xy[l][1]-xy[k][1]==q:
					c+=1
		#最も多いものを採用
		m = max(m,c)
print(n-m)

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

int main() {
    long long A, B, N;
    cin >> A >> B >> N;
    long long x;
    if (B > N) x = N;
    else x = B - 1;
    cout << A * x / B - A * (x / B) << endl;
}

Measured memory_bytes: 3592
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;
typedef pair<ll, ll> Pll; 
#define PI 3.14159265

struct edge {
	int from, to;
	double cost;
	edge() {};
	edge(int a, int b, double c) {from=a, to=b, cost=c;}

	bool operator<(edge& rhs) {
		return cost > rhs.cost;
	}
};
vector<edge> e;

int x[10101];
int y[10101];
int n, m;
int par[10101];
int cnt[10101];

void init(int n)
{
	rep(i,0,n) {
		par[i] = i;
		cnt[i] = 1;
	}
}

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

void unite(int x, int y) 
{
	x = find(x);
	y = find(y);
	if (x == y) return;
	if (cnt[x] > cnt[y]) swap(x,y);
	par[x] = y;
	cnt[y] += cnt[x];
}

bool same(int x, int y) {
	return find(x) == find(y);
}

double kruskal()
{
	sort(all(e));
	init(n);
	double ret = 0;
	rep(i,0,len(e)) {
		if (!same(e[i].from, e[i].to)) {
			unite(e[i].from, e[i].to);
			ret += e[i].cost;
		}
	}
	return ret;
}

int main()
{
	double sum = 0;
	cin >> n >> m;
	rep(i,0,n) cin >> x[i] >> y[i];
	rep(i,0,m) {
		int a,b; cin>>a>>b;
		a--; b--;
		if (a>b) swap(a,b);
		double c = sqrt(abs(x[a]-x[b])*abs(x[a]-x[b]) + abs(y[a]-y[b])*abs(y[a]-y[b]));
		e.pb(edge(a,b,c));
		// printf("edge%d : a=%d b=%d c=%lf\n",i,a,b,c);
		sum += c;
	}
	double t = kruskal();
	printf("%.12lf\n",sum-t);
	return 0;
}

Measured memory_bytes: 3712
#include <iostream>
#include <utility>
#include <stdint.h>
#include <string>

using namespace std;

int main()
{
  int N;
  cin >> N;
  string S;
  cin >> S;

  if (N%2) {
    cout << "No" << endl;
    return 0;
  }

  cout << (S.substr(0,N/2) == S.substr(N/2, N/2) ? "Yes" : "No") << endl;

  return 0;
}


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

int main(){

  int i,j,n,minj,flag=0;
  char B[36][3],S[36][3],temp[3];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",B[i]);
    strcpy(S[i],B[i]);
  }
  //bubblesort
  for(i=0;i<n-1;i++){
    for(j=n-1;j>i;j--){
      if(atoi(&B[j][1])<atoi(&B[j-1][1])){
	strcpy(temp,B[j]);
	strcpy(B[j],B[j-1]);
	strcpy(B[j-1],temp);
      }
    }
  }
  //selectionsort
  for(i=0;i<n-1;i++){
    minj=i;
    for(j=i+1;j<n;j++){
      if(atoi(&S[j][1])<atoi(&S[minj][1])){
	minj=j;
      }
    }
    if(i!=minj){
      strcpy(temp,S[i]);
      strcpy(S[i],S[minj]);
      strcpy(S[minj],temp);
    }
  }


  //print
  for(i=0;i<n;i++){
    printf("%s",B[i]);
    if(i!=n-1)printf(" ");
  }
  printf("\nStable\n");

  for(i=0;i<n;i++){
    printf("%s",S[i]);
    if(i!=n-1)printf(" ");
  }
  printf("\n");

  //stable or not stable
  for(i=0;i<n;i++){
    if(strcmp(B[i],S[i])!=0)flag=1;
  }
  if(flag==1)printf("Not stable\n");
  else printf("Stable\n");

  return 0;
}

Measured memory_bytes: 624
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

sub1 = 0
sub2 = 0

for i in range(n):
    if a[i] > b[i]:
        sub1 += a[i] - b[i]
    else:
        sub2 += (b[i] - a[i]) // 2

if sub1 <= sub2:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 40560
#include<bits/stdc++.h> 
#define ll long long 
#define pb push_back
#define vec vector<int>
#define fo(i,n) for (int i = 0; i < n; i++)
#define so(v) sort(v.begin(), v.end())
#define fi first
#define se second
using namespace std;  




int main()
{
  int n;
  cin>>n;
 
    vector<int> a(n) ;
    int sum = 0 ;
    fo(i,n){
        cin >> a[i] ;
        sum+=a[i] ;
    }
    sort(a.begin(),a.end()) ;
    int mean = sum/n ;
    int ans = 0 ;
    int ans2 = 0 ;
    fo(i,n){
        ans+=(a[i]-mean)*(a[i]-mean) ;
    }
 
    fo(i,n){
        ans2+=(a[i]-(mean+1))*(a[i]-(mean+1)) ;
    }
 
    cout << min(ans,ans2) << endl ;
 
    return 0 ;


 
    
}



   

Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>

using namespace std;

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

typedef long long LL;
typedef vector<int> VI;

struct edge {
  int from, to, cost;
};

#define INF 10000000

void shortest_path(int s, int numv, int nume, vector<struct edge> &es, vector<int> &d) {
  REP(i, numv) {
    d[i] = INF;
  }
  d[s] = 0;
  while (1) {
    bool update = false;
    REP(i, nume) {
      struct edge e = es[i];
      if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) {
        d[e.to] = d[e.from] + e.cost;
        update = true;
      }
    }
    if (!update) break;
  }
}

int main() {
  int N, M;
  cin >> N >> M;
  vector<struct edge> es;
  REP(i, M) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    struct edge e1 = {3*u, 3*v+1, 1};
    struct edge e2 = {3*u+1, 3*v+2, 1};
    struct edge e3 = {3*u+2, 3*v, 1};
    es.push_back(e1);
    es.push_back(e2);
    es.push_back(e3);
  }
  int S, T;
  cin >> S >> T;
  S--;
  T--;
  vector<int> d(3*N);
  shortest_path(3*S, 3*N, 3*M, es, d);
  if (d[3*T] == INF) {
    cout << -1 << endl;
  } else {
    cout << d[3*T]/3 << endl;
  }
  return 0;
}


Measured memory_bytes: 8432
import math

MAX_N = 10**6+10

N = int(input())
A = list(map(int,input().split()))
B = [0] * MAX_N
for a in A:
    B[a] += 1

cnt = [0] * MAX_N
for i in range(2,MAX_N):
    for d in range(i, MAX_N, i):
        cnt[i] += B[d]

if N in cnt:
    print("not coprime")
else:
    for c in cnt:
        if c > 1:
            print("setwise coprime")
            exit()
    print("pairwise coprime")

Measured memory_bytes: 202412
#include <math.h>  /* M_PI */
#include <stdio.h> /* printf */
#include<iostream>
using namespace std;

int main(void)
{
	double r;
	cin >> r;
	printf("%f\n", M_PI*r*r);
	printf("%f\n", M_PI*r*2);
	
	return 0;
}

Measured memory_bytes: 3176