akhauriyash/Code-Regression huggingface dataset:
package main

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

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

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

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

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

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)

	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	aa := make([]int, n)
	b := make([]int, n)

	for i := 0; i < n; i++ {
		aa[i] = getNextInt(scanner)
	}

	l := 0
	r := n
	prev := r
	for i := n - 1; i >= 0; i-- {
		if prev == l {
			r--
			b[r] = aa[i]
			prev = r
			continue
		}
		b[l] = aa[i]
		l++
		prev = l
	}

	for i := 0; i < n; i++ {
		fmt.Fprint(writer, b[i])
		if i == n-1 {
			fmt.Fprintln(writer, "")
			break
		}
		fmt.Fprint(writer, " ")
	}

	writer.Flush()
}


Measured memory_bytes: 10496
import math
K = int( input() )

sum = 0
for i in range( 1, K+1 ):
  sum += i


for i in range( K ):
  for j in range( i + 1, K ):
    sum += 6 * math.gcd( i + 1, j + 1 )

for i in range( K ):
  for j in range( i + 1, K ):
    d = math.gcd( i + 1, j + 1 )
    for k in range( j + 1, K ):
      sum += 6 * math.gcd( d , k + 1 )
print( sum )


Measured memory_bytes: 9200
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		// 2 <= K <= N
		final int K = sc.nextInt();
		int[] a = new int[N];
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}
		// どこに1があってもAi間の境界の数(N-1)をまとまった要素K間の境界(K-1)で割ればいい
		int ans = (N-1)/(K-1);
		// あまりが出たときだけ切り上げればOK
		if ((N-1)%(K-1) != 0) { ans++; }
		System.out.println(ans);
	}
}


Measured memory_bytes: 51116
#include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>

using namespace std;
using namespace __gnu_cxx;

#define REP(i,n) for( (i)=0 ; (i)<(n) ; (i)++ )
#define rep(i,x,n) for( (i)=(x) ; (i)<(n) ; (i)++ )
#define REV(i,n) for( (i)=(n) ; (i)>=0 ; (i)-- )
#define FORIT(it,x) for( (it)=(x).begin() ; (it)!=(x).end() ; (it)++ )
#define foreach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define rforeach(it,c) for(__typeof((c).rbegin()) it=(c).rbegin();it!=(c).rend();++it)
#define foreach2d(i, j, v) foreach(i,v) foreach(j,*i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define SZ(x) ((int)(x).size())
#define MMS(x,n) memset(x,n,sizeof(x))
#define mms(x,n,s) memset(x,n,sizeof(x)*s)
#define pb push_back
#define mp make_pair
#define NX next_permutation
#define UN(x) sort(all(x)),x.erase(unique(all(x)),x.end())
#define CV(x,n) count(all(x),(n))
#define FIND(x,n) find(all(x),(n))-(x).begin()
#define ACC(x) accumulate(all(x),0)
#define PPC(x) __builtin_popcountll(x)
#define LZ(x) __builtin_clz(x)
#define TZ(x) __builtin_ctz(x)
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define low(x,i) lower_bound(all(x),i)
#define upp(x,i) upper_bound(all(x),i)
#define NXPOW2(x) (1ll << ((int)log2(x)+1))
#define PR(x) cout << #x << " = " << (x) << endl ;

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

const int OO = (int) 2e9;
const double eps = 1e-9;

#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif

const int N = 200005;

int sx, sy, ex, ey;
int n, m;
int x[N], y[N];
pii a[N];
int LIS[N];

bool ok(int x, int y) {
	int mnY = min(sy, ey), mxY = max(sy, ey);
	return (sx <= x && x <= ex && mnY <= y && y <= mxY);
}

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
//	freopen("in.txt", "rt", stdin);
//	freopen("out.txt", "wt", stdout);
#endif
	cin >> sx >> sy >> ex >> ey;
	if (sx > ex) {
		swap(sx, ex);
		swap(sy, ey);
	}
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i];
		if (ok(x[i], y[i])) {
			a[m++] = mp(x[i], y[i]);
		}
	}
	sort(a, a + m);
	if (sy > ey) {
		for (int i = 0; i < m; i++) {
			a[i].second *= -1;
		}
	}
	MMS(LIS, 0x3f);
	LIS[0] = -1e9;
	int mx = 0;
	for (int i = 0; i < m; i++) {
		int l = lower_bound(LIS, LIS + N, a[i].second) - LIS;
		mx = max(mx, l);
		LIS[l] = a[i].second;
	}
	double res = 0;
	if (mx < min(abs(sx - ex), abs(sy - ey)) + 1) {
		res = (abs(sx - ex) + abs(sy - ey)) * 100LL - mx * (20 - 5 * M_PI);
	} else {
		res = (abs(sx - ex) + abs(sy - ey)) * 100LL - (mx - 1) * (20 - 5 * M_PI) + (10 * M_PI - 20);
	}
	cout << fixed << setprecision(12) << res << endl;
	return 0;
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
ll mod=1000000007;

int main() {
  int n; cin >> n;
  //vector<int> v(n);
  int cnt=0;
  for(int i=0;i<n;++i){
    int t;cin>> t;
    if(t!=i+1) ++cnt;
  }
  if(cnt>2){
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }

  return 0;
}


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

int main() {
  int a,b;
  cin>>a>>b;
  int n;
  n=(a*b)%2;
  if(n==1){
      cout<<"Odd"<<endl;
    }
  else{
    cout<<"Even"<<endl;
  }
}


Measured memory_bytes: 3592
n = int(input())
min_a = 10**9+1
min_s = 0
max_a = 0
max_s = 0
for i in range(n):
  a,b = map(int, input().split())
  if a<min_a:
    min_a = a
    min_s = b
  if a>max_a:
    max_a = a
    max_s = b

cnt = max_a
cnt += max_s
print(cnt)


Measured memory_bytes: 9068
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#pragma 03
using namespace std;
using namespace __gnu_pbds;
// chctxdy
ll x[100005], y[100005];
int main(){
	ll a, b, m; cin >> a >> b >> m;
	for (ll i = 0; i < a; i++) cin >> x[i];
	for (ll i = 0; i < b; i++) cin >> y[i];
	ll mna = 1e18, mnb = 1e18;
	for (ll i = 0; i < a; i++) mna = min(mna, x[i]);
	for (ll i = 0; i < b; i++) mnb = min(mnb, y[i]);
	ll ans = mna + mnb;
	for (ll i = 0; i < m; i++){
		ll xx, yy, sub; cin >> xx >> yy >> sub;
		xx--; yy--; ans = min(ans, x[xx] + y[yy] - sub);
	}
	cout << ans << endl;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
constexpr double EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max()/2;
constexpr int MOD = 1e9+7;

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

    int n,res=0;cin>>n;
    for(int i=9;i<=n;i+=2){
        int cnt=0;
        for(int j=1;j<=i;j++){
            if(i%j==0) cnt++;
        }
        if(cnt==8) res++;
    }
    cout<<res<<endl;
}


Measured memory_bytes: 384
#include <stdio.h>
main(){
int a[10],b[3]={0,-1,-2},i;
for(i=0;i<10;i++){
scanf("%d",&a[i]);
}                       
for(i=0;i<10;i++){
if(a[i]>b[0]){
b[2]=b[1];
b[1]=b[0];
b[0]=a[i];
}
else if(a[i]>b[1]){
b[2]=b[1];
b[1]=a[i];
}
else if(a[i]>b[2]){
b[2]=a[i];
}
}
printf("%d\n",b[0]);
printf("%d\n",b[1]);
printf("%d\n",b[2]);
return 0;
}

Measured memory_bytes: 600
/**
 *      purpose : 
 *      author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *      created : 
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <functional>
#include <iomanip>
#include <random>
#include <utility>

using namespace std;

using int64 = long long;
#define debug(_) cerr << #_ << ": " << (_) << '\n'
template<typename T> inline void chmin(T &a, T b) { if (a > b) a = b; return; }
template<typename T> inline void chmax(T &a, T b) { if (a < b) a = b; return; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& vec) { os << '{'; for (size_t i = 0; i < vec.size(); ++i) { os << vec[i]; if (i != vec.size() - 1) os << ','; } os << '}'; return os; }
template<typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) { return os << '{' << p.first << " " << p.second << '}'; }

constexpr int INF = 1e9 + 5;

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

  int n; int64 a, b; cin >> n >> a >> b;
  vector<int64> h(n);
  for (int i = 0; i < n; ++i) {
    cin >> h[i];
  }

  // num 回攻撃するとして、各 h[i] に A を使う回数(x)を最小化
  // x * A + (num - x) * B >= h[i]
  // -> x * A - x * B >= h[i] - num * B
  // -> x >= (h[i] - num * B) / (A - B)
  // これの和が num 回以下であればよい

  auto ok = [&](int64 num) -> bool {
    int64 need = 0;
    for (int64 x : h) {
      need += max(0LL, (x - num * b + (a - b) - 1) / (a - b));
    }
    return need <= num;
  };
  
  int64 high = INF, low = 0;
  while (high - low > 1) {
    int64 mid = (high + low) / 2;
    if (ok(mid)) {
      high = mid;
    } else {
      low = mid;
    }
  }
  cout << high << endl;

  return 0;
}

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

//#define int long long
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}
typedef long long ll;

signed main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(m);
    int sum_m = 0;
    rep(i, m)
    {
        cin >> a[i];
    }

    rep(i, m)
    {
        sum_m += a[i];
    }

    if (sum_m <= n)
    {
        cout << n - sum_m << endl;
    }
    else
    {
        cout << "-1" << endl;
    }
    return 0;
}


Measured memory_bytes: 3640
import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
import numpy as np


def main():
	s=input().rstrip().decode("utf-8")
	ans=""
	for i in s:
		if i=="B":
			try:
				ans=ans[:-1]
			except:
				pass
		else:
			ans=ans+i
	print(ans)










if __name__ == "__main__":
	main()


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

#define ll long long

using namespace std;

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

    ll ans = 0;

    if(a == 0)
    {
        a = 1;
        ans++;
    }

    if(x > b)
        cout << ans << endl;
    else if(x >= a)
        cout << ans + b/x << endl;
    else
        cout << ans + b/x - (a-1)/x << endl;
}

Measured memory_bytes: 256
package main

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

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

//Main
const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		return sc
	}()
)

var N int

func main() {
	sc.Split(bufio.ScanWords)

	N = nextInt()
	A := make([]int, N)
	for i := 0; i < N; i++ {
		A[i] = nextInt()
	}

	r := 1
	for i := 0; i < N; i++ {
		if A[i]%2 == 0 {
			r *= 2
		} else {
			r *= 1
		}
	}
	fmt.Println(powInt(3, N) - r)
}


Measured memory_bytes: 1780
# S = input()
# N = int(input())
# A, B = map(int, input().split(' '))
# A = list(map(int, input().split(' ')))

A, B, C, K = map(int, input().split(' '))
result = 0

if A < K:
  result += A
  K -= A
else:
  result = K
  K -= A

if K > 0:
  if B < K:
    K -= B
  else:
    K -= B

if K > 0:
  if C < K:
    result -= C
    K -= C
  else:
    result -= K

print(result)


Measured memory_bytes: 9192
N = int(input())
A = []

tmp = input().split()

for i in range(N):
  A.append(int(tmp[i]))
    
A.sort()

hantei = True

for i in range(N-1):
  if A[i] == A[i+1]:
    hantei = False
    
if hantei == True:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 26812
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, x; cin >> a >> b >> c >> x;
    int ans = 0;
    rep (i, a + 1) {  rep (j, b + 1) {  rep (k, c + 1) {
        if (i*500 + j*100 + k*50 == x) ans++;
    }}}
    cout << ans << "\n";
    return 0;
}

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

int main()
{
	int64_t n, m;
	cin >> n >> m;
	vector<pair<int64_t, int64_t>> ps(n);
	for (auto &p : ps)
	{
		cin >> p.first >> p.second;
	}
	sort(ps.begin(), ps.end());
	int64_t ans = 0, count = 0;
	for (auto &p : ps)
	{
		if (m <= count)
		{
			break;
		}
		ans += p.first * min(m - count, p.second);
		count += min(m - count, p.second);
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

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

const char sp = ' ';
const char cmm = ',';
const int MOD = 1000000007;

using ll = long long;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}


ll dp[3001][3001];

int main(){

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

    int n;
    cin >> n;

    vector<int> a(n);
    rep(i, n) cin >> a[i];

    rep(i, n){
        dp[i][i] = 0LL;
    }

    for(int l = 1; l <= n; ++l){
        for(int i = 0; i+l <= n; ++i){
            int j = i+l;
            if((n-l)%2){
                dp[i][j] = min(dp[i+1][j] - a[i], dp[i][j-1] - a[j-1]);
            }
            else{
                dp[i][j] = max(dp[i+1][j] + a[i], dp[i][j-1] + a[j-1]);
            }
        }
    }

    ppp(dp[0][n]);






    return 0;
}


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

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v),v.end()));
#define DUMP(v) REP(i, (v).size()) { cout << v[i]; if (i != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vl v(n);
	REP(i, n)cin >> v[i];
	sort(ALL(v));
	REP(i, n - 1)v[i + 1] += v[i];
	int p = 0;
	REP(i, n - 1) {
		if (2*v[i] < v[i + 1]-v[i])p = i+1;
	}
	cout << n-p << endl;
	return 0;
}


Measured memory_bytes: 1024
"use strict";
function Main(input) {
  input = input.split("\n");
  var s = {
    "SUN": 7,
    "MON": 6,
    "TUE": 5,
    "WED": 4,
    "THU": 3,
    "FRI": 2,
    "SAT": 1,
  }
  console.log(s[input[0]]);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7500
class Tree():
    def __init__(self, n, edge):
        self.n = n
        self.tree = [[] for _ in range(n)]
        for e in edge:
            self.tree[e[0] - 1].append(e[1] - 1)
            self.tree[e[1] - 1].append(e[0] - 1)

    def setroot(self, root):
        self.root = root
        self.parent = [None for _ in range(self.n)]
        self.parent[root] = -1
        self.depth = [None for _ in range(self.n)]
        self.depth[root] = 0
        self.order = []
        self.order.append(root)
        stack = [root]
        while stack:
            node = stack.pop()
            for adj in self.tree[node]:
                if self.parent[adj] is None:
                    self.parent[adj] = node
                    self.depth[adj] = self.depth[node] + 1
                    self.order.append(adj)
                    stack.append(adj)

    def euler_tour(self):
        res = []
        begin = [None for _ in range(self.n)]
        end = [None for _ in range(self.n)]
        visited = [0 for _ in range(self.n)]
        visited[self.root] = 1
        stack = [self.root]
        while stack:
            node = stack.pop()
            if node >= 0:
                res.append(node)
                stack.append(~node)
                if begin[node] is None:
                    begin[node] = len(res) - 1
                for adj in self.tree[node]:
                    if visited[adj]:
                        continue
                    visited[adj] = 1
                    stack.append(adj)
            else:
                end[~node] = len(res)
                if ~node != self.root:
                    res.append(self.parent[~node])
        return res, begin, end


from bisect import bisect_left
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
E = [tuple(map(int, input().split())) for _ in range(N - 1)]

T = Tree(N, E)
T.setroot(0)

et, _, _ = T.euler_tour()
res = [None for _ in range(N)]
lis = []
rec = [None for _ in range(N)]
prev = None

for node in et:
    if res[node] is None:
        if not lis or A[node] > lis[-1]:
            lis.append(A[node])
        else:
            idx = bisect_left(lis, A[node])
            rec[node] = (idx, lis[idx])
            lis[idx] = A[node]
        res[node] = len(lis)

    else:
        if rec[prev] is not None:
            lis[rec[prev][0]] = rec[prev][1]
        else:
            lis.pop()

    prev = node

print('\n'.join(map(str, res)))

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

#define mod 1000000007
#define pb push_back
#define mp make_pair
#define PI 3.14159265358979323
#define debug(x) cout<<"Case "<<x<<": "
#define For(i,n) for(long long i=0;i<n;i++)
#define Frabs(i,a,b) for(long long i = a; i < b; i++)
#define Frabr(i,a,b) for(long long i = a; i >=b; i--)
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef long long int           ll;
typedef long double             ld;
typedef unsigned long long int ull;
typedef vector <int>            vi;
typedef vector <ll>            vll;
typedef pair <int, int>        pii;
typedef pair <ll, ll>          pll;
typedef vector < pii >        vpii;
typedef vector < pll >        vpll;
typedef vector <string>         vs;

//Handle:cyber_rajat


int main(int argc, char const *argv[])
{
	sync;
	ll n;
	cin>>n;
	ll a[n+5]={0},b[n+5]={0},c[n+5]={0},dp[n+5][3];
	for(ll i=1;i<=n;i++)
		cin>>a[i]>>b[i]>>c[i];
	dp[1][0]=a[1],dp[1][1]=b[1],dp[1][2]=c[1];
	for(ll i=2;i<=n;i++)
	{
		dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i];
		dp[i][1]=max(dp[i-1][0],dp[i-1][2])+b[i];
		dp[i][2]=max(dp[i-1][0],dp[i-1][1])+c[i];
	}
	cout<<max(dp[n][0],max(dp[n][1],dp[n][2]))<<endl;
	return 0;
}


Measured memory_bytes: 4992
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        final int N = Integer.parseInt(sc.next());
        final int K = Integer.parseInt(sc.next());
        long[] h = new long[N];
        for (int i = 0; i < N; i++) {
            h[i] = Long.parseLong(sc.next());
        }
        
        Arrays.sort(h); 
        long ans = 1000000000;
        for (int i = 0; i < N - K + 1; i++) {
            long min = h[i];
            long max = h[i + K - 1];
            ans = Math.min(ans, max - min);
        }
        
        out.println(ans);
        
        out.flush();
    }
}

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

#define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

vector<string> split(const string &s, char c) {
	vector<string> v; stringstream ss(s); string x;
	while (getline(ss, x, c)) v.push_back(x);
	return v;
}
#define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }
void err(vector<string>::iterator it) {}
template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
	cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
	err(++it, args...);
}

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

struct UF {
    vector<int> par, rk, sz;

    UF(int n) {
        par.resize(n + 1), rk.assign(n + 1, 0), sz.assign(n + 1, 1);
        for (int i = 0; i <= n; ++i) {
            par[i] = i;
        }
    }

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

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

    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y) return false;
        if (rk[x] < rk[y]) par[x] = y, sz[y] += sz[x];
        else {
            par[y] = x, sz[x] += sz[y];
            if (rk[x] == rk[y]) rk[x]++;
        }
        return true;
    }

	int size(int x) {
		x = find(x);
		return sz[x];
	}
};

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);

	int n, k, l; cin >> n >> k >> l;
	UF uf1(n);
	REPU(_, 0, k) {
		int p, q; cin >> p >> q;
		uf1.unite(p, q);
	}
	unordered_map<int, vector<int>> mp;
	REPU(i, 1, n + 1) {
		mp[uf1.find(i)].push_back(i);
	}
	UF uf2(n);
	REPU(_, 0, l) {
		int r, s; cin >> r >> s;
		uf2.unite(r, s);
	}
	unordered_map<int, vector<int>> sub;
	vector<int> ans(n + 1);
	FORE(it, mp) {
		auto& st = it->second;
		for (int v : st) sub[uf2.find(v)].push_back(v);
		FORE(i, sub) {
			auto& tmp = i->second;
			for (int u : tmp) ans[u] = tmp.size();
		}
		sub.clear();
	}
	REPU(i, 1, n + 1) {
		printf("%d%c", ans[i], " \n"[i == n]);
	}

	return 0;
}


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

using namespace std;

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

	string s;
	cin >> s;
	size_t a = s.find('A');
	size_t z = s.rfind('Z');
	cout << s.substr(a, z - a + 1).length() << '\n';

	return 0;
}



Measured memory_bytes: 788
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int ans;

		if (a < 6)
			ans = 0;
		else if (a >= 6 && a <= 12)
			ans = b / 2;
		else
			ans = b;
		System.out.println(ans);
	}
}


Measured memory_bytes: 23636
# -*- coding: utf-8 -*-
import numpy as np

A, B, M = input().split(" ")
a = np.array(input().split(" "), dtype=np.int64)
b = np.array(input().split(" "), dtype=np.int64)

x_list = []
for i in range(int(M)):
  temp = input().split(" ")
  x_list.append(temp)

x_np = np.array(x_list, dtype=np.int64)

# 候補1はa,bの最小値同士で足したもの
a_min = a.min()
b_min = b.min()
a_min_idx = np.argmin(a)
b_min_idx = np.argmin(b)

cand = x_np[(x_np[:,0]==a_min_idx)&(x_np[:,1]==b_min_idx)]
if cand.shape[0]>0:
  tgt_idx = np.argmax(cand, axis=0)[2]
  cand_payment1 = a_min + b_min - cand[tgt_idx,2]
else:
  cand_payment1 = a_min + b_min
  
# 候補2は割引して最安
val_list = []
for x,y,c in x_np:
  val_list.append(a[x-1] + b[y-1] - c)
  
val_np = np.array(val_list)
cand_payment2 = val_np.min()


if cand_payment1<cand_payment2:
  print(cand_payment1)
else:
  print(cand_payment2)
  

Measured memory_bytes: 62892
#include <iostream>
#include <algorithm>
#include <cctype>

using namespace std;

string puzzle[9];
int pl2id[9], pl2rot[9];

bool check(char a, char b) {
  return toupper(a) == toupper(b) && a != b;
}

int dfs(int k, bool *used) {
  if(k == 9) return 1;
  
  int ret = 0;
  for(int id=0; id<9; id++) {
    if(used[id]) continue;

    for(int rot=0; rot<4; rot++) {
      bool ok = true;
      // 上と一致
      if(k > 2) ok &= check(puzzle[id][(rot+1)%4], puzzle[pl2id[k-3]][(pl2rot[k-3]+3)%4]);
      // 左と一致
      if(k % 3) ok &= check(puzzle[id][rot], puzzle[pl2id[k-1]][(pl2rot[k-1]+2)%4]);
      
      if(ok) {
	pl2id[k] = id;
	pl2rot[k] = rot;
	used[id] = true;
	ret += dfs(k+1, used);
	used[id] = false;
      }
    }
  }
  
  return ret;
}

int main() {
  int n;
  cin >> n;
  while(n--) {
    for(int i=0; i<9; i++) {
      cin >> puzzle[i];
    }
    
    bool used[9] = {};
    cout << dfs(0, used) << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int main(void)
{
    int n; cin >> n;
    int out, hit, point;
    for (int i = 0; i < n; i++) {
        string tmp;
        out = 0;
        hit = 0;
        point = 0;
        while (out < 3) {
            cin >> tmp;
            if (tmp == "HIT") {
                hit++;
            } else if ( tmp == "OUT") {
                out++;
            } else if ( tmp == "HOMERUN") {
                point += hit + 1;
                hit = 0;
            }
            if( hit > 3 ) {
                hit--;
                point++;
            }
        }
        cout << point << endl;
    }

    return 0;
}

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

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define pii pair<ll , ll>
#define all(x) x.begin(),x.end()
#define nl "\n"
#define ump unordered_map
#define mtv(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)

vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out( 
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cout << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    stringstream ss; ss << H;
    cout << args[idx] << "- " << ss.str() << ", ";
    debug_out(args, idx + 1, LINE_NUM, T...);
}


void doit(){
    ll n,i,j,x,y;
    cin >> n >> x >> y;
    vector<ll>dist(n);
    rep(i,1,n+1){
        rep(j,i+1,n+1){
            if(x >= i && y <= j){ 
                ll in = min(j-i-1 , x-i+j-y)+1;
                // mtv(i,j,in);
                dist[in]++;
            }
            else {
                ll in = j-i;
                in = min({in,1+abs(i-x)+abs(j-y)});
                dist[in]++;
            }
        }
    }
    rep(i,1,n)cout << dist[i] << nl;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    // cin >> t;
    for(ll i = 1; i <= t; i++){
        doit();
    }
}


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

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

	if (A == 1) {
		if (B == 1)
			cout << "Draw" << endl;
		else
			cout << "Alice" << endl;
	}

	else if (B == 1)
		cout << "Bob" << endl;

	else if (A > B)
		cout << "Alice" << endl;

	else if (A < B)
		cout << "Bob" << endl;

	else
		cout << "Draw" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vl vector<ll>
#define fi first
#define se second
#define tc int t; cin>>t; while(t--)
#define mod 1000000007
#define pie 3.141592653589793
#define endl "\n"
using namespace std;

void fastio(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout<<fixed;
    cout.precision(20);
}

int main(){
    fastio();
	long double a,b;
	cin>>a>>b;
	long double h,m;
	cin>>h>>m;
	long double angle = abs((pie/360)*(60*h-11*m));
	long double ans = sqrt(pow(a,2)+pow(b,2)- 2*a*b*cos(angle));
	cout<<ans;
    return 0;
}

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

const int inf = 1e9;
const ll linf = 1e18;
const ll mod = 1e9 + 7;

int main()
{
    int N, L;
    cin >> N >> L;
    int min = inf;
    int sum = 0;
    for (int i = 1; i <= N; i++) {
        sum += (L + i - 1);
        if (abs(L + i - 1) < abs(min)) min = L + i - 1;
    }
    cout << sum - min << endl;
    return 0;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        a: i32, b: i32,
    }
    puts!("{}\n", if a <= 9 && b <= 9 { a * b } else { -1 });
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8572
#include<bits/stdc++.h>
using namespace std;
#define NL            "\n"
#define _SAD()        ios::sync_with_stdio(0),cin.tie(0), cout.tie(0);
#define SZ(s)         s.size()
#define SRT(x,y)      sort(x,x+y)
#define REV(a,b)      reverse(a,a+b)
#define VSRT(x)       sort(x.begin(),x.end())
#define VREV(x)       reverse(x.begin(),x.end())
int main()
{
    _SAD()
    int a,b,c,d,e,f,g,h,i;
    cin>>a>>b>>c>>d>>e>>f>>g>>h>>i;
    if((a-b!=d-e)||(a-b!=g-h)||(b-c!=e-f)||(b-c!=h-i)||(a-d!=b-e)||(a-d!=c-f)||(d-g!=e-h)||(d-g!=f-i))
    {
        cout<<"No"<<NL;
        return 0;
    }
    cout<<"Yes"<<NL;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

ll fac[200007],finv[200007],inv[200007];
void cominit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<200007;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}
ll com(ll n,ll k){
    if(n<k)return 0;
    if(n<0 || k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}
long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    cominit();
    ll n, m, k;
    cin >> n >> m >> k;
    ll ans = 0;
    for(ll i=0;i<n;i++){
    	for(ll j=0;j<m;j++){
    		ll u = n - 1 - i;
    		ll v = m - 1 - j;
    		ll num = 0;
    		num += (((i * (i + 1)) % mod) * m)%mod;
    		num += (((j * (j + 1)) % mod) * n)%mod;
    		num += (((u * (u + 1)) % mod) * m)%mod;
    		num += (((v * (v + 1)) % mod) * n)%mod;
    		num %= mod;
    		num *= com(n * m - 2, k - 2);
    		num %= mod;
    		ans += num;
    		ans %= mod;
    	}
    }
    ans *= modpow(4LL, mod - 2);
    ans %= mod;
    ans += mod;
    ans %= mod;

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


Measured memory_bytes: 4992
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")

//#include<bits/stdc++.h>
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

#define _USE_MATH_DEFINES
#define ll long long
#define ins Not Needed Thing
#define ull unsigned long long
#define ld long double
#define Accepted 0
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define sz(x) (int)(x.size())
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define SORRY FUL Accepted 
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0)
#define Toktama Kazakhstan 

using namespace std;

const double eps = 0.000001;
const ld pi = acos(-1);
const int maxn = 1e7 + 9;
const int mod = 1e9 + 7;
const ll MOD = 1e18 + 9;
const ll INF = 1e18 + 123;
const int inf = 2e9 + 11;
const int mxn = 1e6 + 9;
const int N = 3e5 + 123;                                          
const int PRI = 555557;
const int pri = 997;

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

int tests = 1;

int a, b, n = 100;
char s1[55][105];
 
char s2[55][105];
bool is = 0;
                            
vector < pair < int, int > > v1, v2;

inline void Solve () {
	//easy
	cin >> a >> b;

	for (int i = 0; i < 50; ++i) {
        for (int j = 0; j < 100; ++j) {
            s1[i][j] = '.';
            s2[i][j] = '#';
        }
    }
 
    -- a;
    -- b;
 
    for (int i = 1; i < 49; i += 2) {
        for (int j = 1; j < 99; j += 2) {
            if (a > 0) {
                s2[i][j] = '.';
                --a;
            }
 
            if (b > 0) {
                s1[i][j] = '#';
                --b;
            }
        }
    }
 
    printf("100 100\n");
 
    for (int i = 0; i < 50; ++i) {
        printf("%s\n", s1[i]);
    }
 
    for (int i = 0; i < 50; ++i) {
        printf("%s\n", s2[i]);
    }
}

int main () {
	SpeedForce;
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);	
	// cin >> tests;
	while(tests --) {
		Solve ();
		// Ee Zadrot
	}

	return Accepted; 
}

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

namespace Bcs
{
    class Program
    {
        static void Main( string[] args ) {

            var nm = Console.ReadLine().Split( ' ' ).Select( x => Int32.Parse( x ) ).ToArray();

            var n = nm[0];
            var m = nm[1];

            var students = new List<Pos>();

            for (Int32 i = 0; i < n; ++i) {
                var ab = Console.ReadLine().Split( ' ' ).Select( x => Int32.Parse( x ) ).ToArray();
                students.Add( new Pos(ab[0],ab[1]) );
            }

            var targets = new List<Pos>();
            for( Int32 i = 0; i< m; ++ i)
            {
                var cd = Console.ReadLine().Split( ' ' ).Select( x => Int32.Parse( x ) ).ToArray();

                targets.Add( new Pos( cd[0], cd[1] ) );
            }

            var costs = new List<Int64>();

            for (Int32 i = 0; i < n; ++i)
            {
                Int64 t = 1000000000;
                Int32 index = 0;
                var si = students[i];

                for (Int32 j = 0; j < m; ++j)
                {

                    var x = Math.Abs( targets[j].x - si.x );
                    var y = Math.Abs( targets[j].y - si.y );
                    var tt = x + y;

                    if (tt<t)
                    {
                        t = tt;
                        index = j;
                    }
                }

                Console.WriteLine( index + 1 );

            }

        }
    }

    class Pos
    {
        public Int32 x { get; private set; }
        public Int32 y { get; private set; }

        public Pos(Int32 x_, Int32 y_ ) {
            x = x_;
            y = y_;
        }
    }
}


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

int main() {
  int N;
  cin >> N;
  int H[N];
  for(int i = 0; i < N; i++) cin >> H[i];
  int counter = 0;
  int maxH = H[0];
  for(int i = 1; i < N; i++) {
    if(maxH <= H[i]) {
      counter++;
      maxH = H[i];
    }
  }
  cout << counter + 1 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7  
using ll = long long; 
using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;
ll const mod=998244353;
const ll MAX=300000;

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<(a+b)*c/2;
    return 0;
}

Measured memory_bytes: 3604
def main(n,d):
    #dを並び替え
    d.sort()
    #d[i]==d[i-1]の場合、使用できないのでcountをインクリメント
    count = 0
    for i in range(1, len(d)):
        if d[i-1] == d[i]:
            count += 1
    return n - count

n = int(input())
d = [input() for _ in range(n)]
print(main(n,d))

Measured memory_bytes: 3060
#include<stdio.h>
int main() {
	int a, b, c, d;
	scanf("%d %d", &a, &b);
	if (a >= b) {
	}
	else {
		printf("a < b\n",&a,&b);
	}
		if (a <= b) {
		}
		else {
			printf("a > b\n",&a,&b);
		}
			if (a != b) {
			}
			else {
				printf("a == b\n",&a,&b);
			}

			return 0;
}




Measured memory_bytes: 2688
#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle
{
int f[N2];
int space;
string path;
bool operator < (const Puzzle &p) const
{
for(int i=0;i<N2;i++)
{
if(f[i]==p.f[i]) continue;
return f[i]>p.f[i];
}
return false;
}
};

static const int dx[4]={-1,0,1,0};
static const int dy[4]={0,-1,0,1};
static const char dir[4]={'u','l','d','r'};

bool isTarget(Puzzle p)
{
for(int i=0;i<N2;i++)
if(p.f[i]!=(i+1)) return false;
return true;
}

string bfs(Puzzle s)
{
queue<Puzzle> Q;
map<Puzzle,bool> V;
Puzzle u,v;
s.path= "";
Q.push(s);
V[s]=true;

while(!Q.empty())
{
u=Q.front(); Q.pop();
if(isTarget(u)) return u.path;
int sx=u.space/N;
int sy=u.space%N;
for(int r=0;r<4;r++)
{
int tx=sx+dx[r];
int ty=sy+dy[r];
if(tx<0||ty<0||tx>=N||ty>=N) continue;
v=u;
swap(v.f[u.space],v.f[tx*N+ty]);
v.space=tx*N+ty;
if(!V[v])
{
V[v]=true;
v.path+=dir[r];
Q.push(v);

}
}
}
return "unsolvable";
}

int main()
{
Puzzle in;

for(int i=0;i<N2;i++)
{
cin >>in.f[i];
if(in.f[i]==0)
{
in.f[i]=N2;
in.space=i;
}
}
string ans=bfs(in);
cout << ans.size()<<endl;

return 0;
}



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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();
            int age = line[0], money = line[1];

            if (age >= 13)
            {
                Console.WriteLine(money);
            }
            else if (age >= 6)
            {
                Console.WriteLine(money/2);
            }
            else
            {
                Console.WriteLine(0);
            }
        }
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N, K;
    cin >> N >> K;
    int d;
    vector<int> sun(N, 0);
    for(int i = 0; i < K; i++){
        cin >> d;
        for(int i = 0; i < d; i++){
            int c;
            cin >> c;
            c--;
            sun[c]++;
        }
    }
    int count = 0;
    for(int i = 0; i < N; i++){
        if(sun[i] == 0) count++;
    }
    cout << count << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

Measured memory_bytes: 256
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vll vector<ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define pb push_back
#define eb emplace_back
#define mt make_tuple
#define MP make_pair
#define fs first
#define sc second
#define F first
#define S second
#define nl "\n"
#define asche cerr<<"Ekhane asche\n";
#define pf printf
#define sf scanf
#define mem(a,x) memset(a,x,sizeof(a))
#define SZ(v) (int)v.size()
#define all(v) v.begin(),v.end()
#define one(x) __builtin_popcount(x)
#define fout(x) fixed<<setprecision(x)
#define BeatMeScanf ios_base::sync_with_stdio(false)
//int dx[]={1,0,-1,0,1,-1,-1,1};
//int dy[]={0,1,0,-1,1,1,-1,-1};
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); deb(_it, args); }
void deb(istream_iterator<string> it) {}
template<typename T, typename... Args>
void deb(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    deb(++it, args...);
}
//template <typename T> using o_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
namespace IO
{
    #define in() ( { int a ; scanf("%d",&a); a; } )
    #define LL() ( { ll a ; scanf("%lld",&a); a; } )
       #define ULL() ( { ull a ; scanf("%llu",&a); a; } )
    #define DD() ({ double a; scanf("%lf", &a); a;})
    #define CC() ( { char a ; scanf("%c",&a); a; } )
    #define pf1(a) printf("%d\n",a)
    #define pf1ll(a) printf("%lld\n",a)
}
using namespace IO;

const int mod=1e9+7;
const int N=3e5+9;
const double eps=1e-9;
const double PI=acos(-1.0);
ll qpow(ll n,ll k) {ll ans=1;assert(k>=0);n%=mod;while(k>0){if(k&1) ans=(ans*n)%mod;n=(n*n)%mod;k>>=1;}return ans%mod;}


int32_t main()
{
    ll n=LL();
    ll ans=1e18;
    for(ll i=1;i*i<=n;i++) if(n%i==0) ans=min(ans,i+n/i-2);
    cout<<ans<<nl;
    return 0;
}
///Before submit=>
///    *check for integer overflow,array bounds
///    *check for n=1



Measured memory_bytes: 256