akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>

using namespace std;

typedef long long LL;

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

const int N = 2100 + 10;
const double eps = 1e-8;

int n, m;
int from[N], to[N], w[N];
int dist[N], deg[N], next[N];
long double a[N][1200];
vector<pair<int, int> > adj[N];

void bfs()
{
	queue<int> que;
	que.push(0);
	dist[0] = 0;
	for( ; que.size(); ) {
		int u = que.front();
		que.pop();
		for(int e = 0; e < adj[u].size(); ++ e) {
			int v = adj[u][e].first;
			dist[v] = max(dist[v], dist[u] + adj[u][e].second);
			-- deg[v];
			if (deg[v] == 0) {
				que.push(v);
			}
		}
	}
}

void solve() {
	for(int i = 0; i < n; ++ i) {
		adj[i].clear();
		dist[i] = -1;
		deg[i] = 0;
	}
	for(int i = 0; i < m; ++ i) {
		scanf("%d%d%d", from + i, to + i, w + i);
		adj[from[i]].push_back(make_pair(to[i], w[i]));
		++ deg[to[i]];
	}
	bfs();
	
	int row = n + m + m;
	int col = n - 2 + m;
	for(int i = 0; i <= row; ++ i) {
		for(int j = 0; j <= col + 1; ++ j) {
			a[i][j] = 0;
		}
	}
	for(int i = 1; i <= m; ++ i) {
		a[0][i + n - 2] = 1;
	}
	for(int i = 1; i <= n - 2; ++ i) {
		a[i][i] = 1;
	}
	int cur = n - 2;
	for(int i = 0; i < m; ++ i) {
		++ cur;
		a[cur][i + n - 1] = 1;
	}
	for(int i = 0; i < m; ++ i) {
		++ cur;
		a[cur][0] += dist[to[i]] - dist[from[i]] - w[i];
		if (from[i]) {
			a[cur][from[i]]--;
		}
		if (to[i] != n - 1) {
			a[cur][to[i]]++;
		}
		a[cur][n - 1 + i]--;
	}

	/*
	for(int i = 0; i <= cur; ++ i) {
		for(int j = 0; j <= col; ++ j) {
			cout << a[i][j] << ' ';
		}
		cout << endl;
	}
	*/

	n = cur;
	m = col;
	while(1) {
		int i;
		for(i = 1; i <= m + 1; ++ i)
			if (a[0][i] > eps) break;
		if (i > m) break;
		double Min = 1e30;
		int k;
		for(int j = 1; j <= n; ++ j)
			if (a[j][i] < -eps && a[j][0] / -a[j][i] < Min)
			{
				Min = a[j][0] / -a[j][i];
				k = j;
			}
		double t = -1. / a[k][i];
		a[k][i] = -1;
		for(int j = 0; j <= m; ++ j) 
			a[k][j] = a[k][j] * t;
		int tt = -1;
		for(int j = 0; j <= m; ++ j)
			if (fabs(a[k][j]) > eps)
			{
				next[j] = tt;
				tt = j;
			}
		for(int j = 0; j <= n; ++ j) {
			if (j == k) continue;
			t = a[j][i];
			a[j][i] = 0;
			int p = tt;
			while(p != -1)
			{
				a[j][p] = a[j][p] + t * a[k][p];
				p = next[p];
			}
		}
	}
	printf("%d\n", (int)(a[0][0]+1e-2));
}

int main() {
	for( ; cin >> n >> m; ) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 40728
while True:
    n, x = map(int, input().split())
    if n == 0 and x == 0:
        break
    
    count = 0
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            for k in range(j + 1, n + 1):
                if i + j + k == x:
                    count += 1
    print(count)



Measured memory_bytes: 5592
n = gets.to_i
a = gets.split.map(&:to_i).sort.reverse
e = []
tmp = 0
a.each{|a_|
  break if e.size == 2
  if tmp == a_
      e << tmp
      tmp = 0
  else
    tmp = a_
  end
}

p e.size == 2 ? e[0] * e[1] : 0

Measured memory_bytes: 12040
N = int(input())

flag = False
ans = 0
for _ in range(N):
    x, y = map(int, input().split())
    if x == y:
        ans += 1
        if ans >= 3:
            flag = True
    else:
        ans = 0
if flag:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9168
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-6;


using namespace std;

typedef complex<double> Point;

double dot(const Point& a, const Point& b)
{
	return a.real()*b.real() + a.imag()*b.imag();
}
double cross(const Point& a, const Point& b)
{
	return a.real()*b.imag() - a.imag()*b.real();
}
double distance_line_point(const Point& a, const Point& b, const Point& point)
{
	return abs(cross(a-b, point-b) / abs(a-b));
}
double distance_linesegment_point(const Point& a, const Point& b, const Point& point)
{
	if (dot(b-a, point-a) < Eps)
		return abs(a-point);
	else if (dot(a-b, point-b) <Eps)
		return abs(b-point);
	else
		return distance_line_point(a, b, point);
}
bool is_in_triangle(const Point* triangle, const Point& point)
{
	double t[3];
	for (int i = 0; i < 3; ++i)
		t[i] = cross(triangle[(i+1)%3] - triangle[i], point - triangle[i]);

	return t[0] >= 0 && t[1] >= 0 && t[2] >= 0
		|| t[0] <= 0 && t[1] <= 0 && t[2] <= 0;
}
bool is_in_triangle(const Point& a, const Point& b, const Point& c, const Point& point)
{
	Point t[3] = { a, b, c };
	return is_in_triangle(t, point);
}

int main()
{
	int n;
	scanf("%d", &n);
	while (n--)
	{
		Point p[5];
		for (int i = 0; i < 5; ++i)
		{
			int a, b;
			scanf("%d %d", &a, &b);
			p[i] = Point(a, b);
		}

		if (is_in_triangle(p, p[3]) != is_in_triangle(p, p[4]))
			puts("OK");
		else
			puts("NG");
	}

	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int n, ans = 0;
int x[25], y[25], r[25], c[25];
bool memo[1<<24];

bool overlap(int i, int j){
    return (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]) < (r[i]+r[j]) * (r[i]+r[j]);
}

void dfs(VI f){
    int x = 0;
    REP(i,n) x += f[i] * (1<<i);
    if (memo[x]) return;
    memo[x] = 1;

    int res = 0;
    REP(i,n) res += f[i];
    ans = max(ans, res);

    VI top(n);
    REP(i,n){
        if (f[i]) continue;
        bool g = 1;
        REP(j,i){
            if (f[j]) continue;
            if (overlap(i,j)) g = 0;
        }
        top[i] = (!f[i] & g);
    }

    // REP(i,n) printf("%d ", f[i]);
    // cout << endl;

    REP(i,n) REP(j,i){
        if (!top[i] || !top[j] || c[i] != c[j]) continue;
        f[i] = f[j] = 1;
        dfs(f);
        f[i] = f[j] = 0;
    }
}

int main() {
    ifstream ifs("in.txt");
    while (cin >> n && n){
        VI f(n);
        ans = 0;
        REP(i,1<<n) memo[i] = 0;
        REP(i,n) cin >> x[i] >> y[i] >> r[i] >> c[i];

        dfs(f);

        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 19456
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input! {
        h: usize,
        w: usize,
        a: [chars; h],
    }
    for i in 0..w+2 {
        print!("#");
    }
    print!("\n");
    for i in 0..h {
        print!("#");
        for j in 0..w {
            print!("{}", a[i][j]);
        }
        print!("#\n");
    }
    for i in 0..w+2 {
        print!("#");
    }
}

Measured memory_bytes: 4476
using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Text.RegularExpressions;
    using System.Text;
    using System.Net;

     
    public class Program
    {
        public void Proc() {
            int[] inpt = Reader.ReadLine().Split(' ').Select(a=>int.Parse(a)).ToArray();
            int ans = inpt.Sum();

            if(ans>=10) {
                Console.WriteLine("error");
            } else {
                Console.WriteLine(ans);
            }



        }



        public class Reader {
            public static bool IsDebug = false;
            private static System.IO.StringReader SReader;
            private static string InitText = @"





5 5





";
            public static string ReadLine() {
                if(IsDebug) {
                    if(SReader == null) {
                        SReader = new System.IO.StringReader(InitText.Trim());
                    }
                    return SReader.ReadLine();
                } else {
                    return Console.ReadLine();
                }
            }
        }
        public static void Main(string[] args)
        {
            #if DEBUG
            Reader.IsDebug = true;
            #endif
            Program prg = new Program();
            prg.Proc();
        }
    }

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

const ll mod=1e9+7;
int main(){
    ll n,k;
    cin>>n>>k;
    ll res=0;
    for(ll i=k;i<=n+1;i++){
        ll first=i*(i-1)/2;
        ll final =(n*2-i+1)*i/2;
        ll add=final-first+1;
        res=(res+add)%mod;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 3644
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

struct UFTree(T)
{
    struct Node
    {
        T parent;
        T rank = 1;
    }

    this(T n)
    {
        nodes.length = n;
        sizes.length = n;
        foreach (i, ref node; nodes) {
            node = Node(i.to!T);
            sizes[i] = 1;
        }
    }

    bool unite(T a, T b)
    {
        a = root(a);
        b = root(b);

        if (a == b) return false;

        if (nodes[a].rank < nodes[b].rank) {
            sizes[nodes[a].parent] += sizes[nodes[b].parent];
            nodes[b].parent = nodes[a].parent;
        } else {
            sizes[nodes[b].parent] += sizes[nodes[a].parent];
            nodes[a].parent = nodes[b].parent;
            if (nodes[a].rank == nodes[b].rank) nodes[a].rank += 1;
        }

        return true;
    }

    bool is_same(T a, T b)
    {
        return root(a) == root(b);
    }

    T size(T i)
    {
        return sizes[root(i)];
    }

private:
    Node[] nodes;
    T[] sizes;

    T root(T i)
    {
        if (nodes[i].parent == i) return i;

        return nodes[i].parent = root(nodes[i].parent);
    }
}

alias C = Tuple!(int, "n", long, "x", long, "y");
alias D = Tuple!(int, "a", int, "b", long, "d");

C[10^^5+1] CS;
D[10^^5+1] DSX, DSY;

void main()
{
    auto N = readln.chomp.to!int;
    foreach (i; 0..N) {
        auto xy = readln.split.to!(long[]);
        auto c = C(i, xy[0], xy[1]);
        CS[i] = c;
    }
    sort!"a.x < b.x"(CS[0..N]);
    foreach (i; 0..N-1) {
        auto a = CS[i];
        auto b = CS[i+1];
        DSX[i] = D(a.n, b.n, b.x - a.x);
    }
    sort!"a.y < b.y"(CS[0..N]);
    foreach (i; 0..N-1) {
        auto a = CS[i];
        auto b = CS[i+1];
        DSY[i] = D(a.n, b.n, b.y - a.y);
    }
    sort!"a.d < b.d"(DSX[0..N-1]);
    sort!"a.d < b.d"(DSY[0..N-1]);

    auto uft = UFTree!int(N);

    long r;
    for (size_t i, j; i != N-1 && j != N-1;) {
        auto a = long.max, b = long.max;
        if (i < N-1) a = DSX[i].d;
        if (j < N-1) b = DSY[j].d;
        D d;
        if (a < b) {
            d = DSX[i++];
        } else {
            d = DSY[j++];
        }
        if (uft.is_same(d.a, d.b)) continue;
        uft.unite(d.a, d.b);
        r += d.d;
    }

    writeln(r);
}

Measured memory_bytes: 9852
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using static System.Console;
using static System.Math;
class Simple
{

    void Solve() {
        var S = io.String;
        var ans = S.ToCharArray().Distinct().Count() == 3;
        WriteLine(ans?"Yes":"No");
    }

    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) => new Simple().Stream();
    private void Stream() {
        //var exStdIn = new System.IO.StreamReader("stdin.txt");
        //SetIn(exStdIn);
        Solve();
        io.Flush();
    }
}

class SimpleIO
{
    string[] _nextBuffer;
    int _bufferCnt;
    char[] cs = new char[] { ' ', '"', ',' };
    StreamWriter sw = new StreamWriter(OpenStandardOutput()) {
#if DEBUG
        AutoFlush = true
#else
        AutoFlush = false
#endif
    };
    public SimpleIO() {
        _nextBuffer = new string[0];
        _bufferCnt = 0;
        SetOut(sw);
    }
    string Next() {
        if (_bufferCnt < _nextBuffer.Length) return _nextBuffer[_bufferCnt++];
        var st = ReadLine();
        while (st == "") st = ReadLine();
        _nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        _bufferCnt = 0;
        return _nextBuffer[_bufferCnt++];
    }
    public string String  => Next();
    public char   Char    => char.Parse(String);
    public int    Int     => int.Parse(String);
    public long   Long    => long.Parse(String);
    public double Double  => double.Parse(String);
    public void   Flush() => Out.Flush();
}


Measured memory_bytes: 13268
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();
		if(a < 0 && b < 0 && (b - a) % 2 == 0) {
			System.out.println("Negative");
		} else if(a < 0 && b < 0 && (b - a) % 2 == 1) {
			System.out.println("Positive");
		} else if(a <= 0 && b >= 0) {
			System.out.println("Zero");
		} else {
			System.out.println("Positive");
		}
	}
}


Measured memory_bytes: 21844
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long min = Long.MAX_VALUE;
        long total = 0;
        int negCt = 0;
        while(n-->0) {
            long q = in.nextLong();
            if( q <= 0 ) negCt++;
            q = Math.abs(q);
            min = Math.min(min, q);
            total += q;
        }
        if( (negCt&1) == 1 ) total -= min*2;
        System.out.println(total);
    }
}

Measured memory_bytes: 48548
using System;
using System.Collections.Generic;
             
public class Program
{
    public static void Main(string[] args)
    {
        new Program().Solve(new ConsoleInput(Console.In, ' '));
    }

    public void Solve(ConsoleInput cin)
    {
        int N =cin.ReadInt;
        int H = cin.ReadInt;
        int W = cin.ReadInt;
        Console.WriteLine((N - H + 1) * (N - W + 1));
    }
}

public class ConsoleInput
{
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public int ReadInt { get { return int.Parse(Read); }}
}

Measured memory_bytes: 11220
#include<stdio.h>
#include<string.h>

int main(void){
	char a[210],b[210],c[210];
	int H,h[110],i,j,n;
	while(1){
		scanf("%s",a);
		if(a[0]=='-')break;
		scanf("%d",&H);
		n=strlen(a);
		for(i=0;i<H;i++){
			scanf("%d",&h[i]);
		}
		for(i=0;i<H;i++){
			for(j=0;j<h[i];j++){
				b[j]=a[j];
				b[j+1]='\0';
			}
			for(j=h[i];j<=n-1;j++){
				c[j-h[i]]=a[j];
				c[j-h[i]+1]='\0';
			}
			strcat(c,b);
			strcpy(a,c);
			strcpy(b,"");
			strcpy(c,"");
		}
		printf("%s\n",a);
	}
	return 0;
}

Measured memory_bytes: 600
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric, std.container;

long P = 10^^9+7;
long[2001] F, RF;

long pow(long x, long n) {
    long y = 1;
    while (n) {
        if (n%2 == 1) y = (y * x) % P;
        x = x^^2 % P;
        n /= 2;
    }
    return y;
}

long inv(long x)
{
    return pow(x, P-2);
}

void init()
{
    F[0] = F[1] = 1;
    foreach (i, ref x; F[2..$]) x = (F[i+1] * (i+2)) % P;

    {
        RF[$-1] = 1;
        auto x = F[$-1];
        auto k = P-2;
        while (k) {
            if (k%2 == 1) RF[$-1] = (RF[$-1] * x) % P;
            x = x^^2 % P;
            k /= 2;
        }
    }
    foreach_reverse(i, ref x; RF[0..$-1]) x = (RF[i+1] * (i+1)) % P;
}

long comb(N)(N n, N k)
{
    if (k > n) return 0;
    auto n_b = F[n];    // n!
    auto nk_b = RF[n-k]; // 1 / (n-k)!
    auto k_b = RF[k];    // 1 / k!

    auto nk_b_k_b = (nk_b * k_b) % P; // 1 / (n-k)!k!

    return (n_b * nk_b_k_b) % P;  // n! / (n-k)!k!
}

long perm(N)(N n, N k)
{
    if (k > n) return 0;
    auto n_b = F[n];
    auto n_k_b = RF[n-k];
    return (n_b * n_k_b) % P;
}

void main()
{
    init();
    auto nk = readln.split.to!(long[]);
    auto N = nk[0];
    auto K = nk[1];
    N -= K;
    if (N < 0) {
        writeln(0);
    } else {
        writeln(comb(N+K-1, K-1));
    }
}


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

	}
	else
	{
		printf("No\n");
	}
	return 0;
}



Measured memory_bytes: 2000
/* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 

*/
/* }}} */

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()
#define X Fi
#define Y Se

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef double D;
typedef pair<D, D> P;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << '\n';
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}

/* }}} */

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

  while (n = in(), n != -1) {
    P p = mp(0.0, 0.0);
    D a = 0;
    REP(i, n) {
      p.X += cos(a);
      p.Y += sin(a);
      a = atan2(p.Y, p.X) + M_PI / 2;
    }
    cout << p.X << '\n' << p.Y << '\n';
  }

  return 0;
}

Measured memory_bytes: 1352
my ($X,$N) = split(/ /,<>);
my $s = <>;chomp $s;
my @dat = split(/ /,$s);
my %DB;

for(my $i=0;$i<=$#dat;$i++){
    $DB{$dat[$i]}=1;
}
 if(! defined($DB{$X})){ printf "%d",$X;exit;}

my $k=1;
while(){
    if(! defined($DB{$X-$k})){ printf "%d",$X-$k;exit;}
    if(! defined($DB{$X+$k})){ printf "%d",$X+$k;exit;}
    $k++;
}

Measured memory_bytes: 4848
#include<stdio.h>
int main(void)
{
    int h,w,n,a,max;
    //double aa;
    scanf("%d%d%d",&h,&w,&n);
    max=(h>w)?h:w;
    if(n%max)a=n/max+1;
    else a=n/max;
    printf("%d",a);
}


Measured memory_bytes: 128
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long x=sc.nextLong();
		long y=sc.nextLong();
		long xy=y/x;
		int n=0;
		while(xy>=(long)Math.pow(2,n)) {
			n++;
		}
		System.out.println(n);
	}
}

Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=1e5+7;
static ll MOD=1e9+7;
ll max(ll a, ll b) {return a>b?a:b;}
ll min(ll a, ll b) {return a<b?a:b;}

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

int main(void) {
  ll N, M;
  cin >> N;
  ll a[MAX];
  ll i;
  
  for(i=0; i<N; i++) {
    cin >> a[i];
  }
  
  ll ans=a[0];
  for(i=0; i<N; i++) {
    ans=gcd(ans, a[i]);
  }
  
  pt(ans);
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, pair<ll, ll> > P3;

const ll MOD = ll(1e9 + 7);
const ll LLINF = LLONG_MAX;
const int IINF = INT_MAX;
const int MAX_N = int(1e5) + 5;
const double EPS = 1e-8;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)

int main() {
    while(1){
        int n,m;
        cin >> n >> m;
        if(n==0)break;
        int a[105]{},res = 0;
        REP(i,n){
            int d,v;
            cin >> d >> v;
            a[d] = max(a[d],v);
        } 
        FOR(i,1,m+1){
            res += a[i];
        }
        cout << res << endl;
    }
    return 0;
}



Measured memory_bytes: 3088
N = int(input())
A = list(map(int, input().split()))
A_abs = []
for a in A:
    A_abs.append(abs(a))

ans = []
m = max(A_abs)
midx = A_abs.index(m)

print(2 * N - 2)

for i in range(N):
    if not i == midx:
        print(str(midx + 1) + ' ' + str(i + 1))

for i in range(N - 1):
    if A[midx] >= 0:
        print(str(i + 1) + ' ' + str(i + 2))
    else:
        print(str(N - i) + ' ' + str(N - i - 1))


Measured memory_bytes: 3064
package main
import (
  "fmt"
)
func main() {
  var n int
  fmt.Scan(&n)
  var s string
  fmt.Scan(&s)
  result := 0
  for i := 1; i < n; i++ {
    charMap := make(map[byte]bool)
    for j := 0; j < i; j++ {
      charMap[s[j]] = true
    }
    total := 0
    for j := i; j < n; j++ {
      if charMap[s[j]] {
        total++
        charMap[s[j]] = false
      }
    }
    if result < total {
      result = total
    }
  }
  fmt.Println(result)
}

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

using namespace std;

int main(){
    int n,q;
    cin>>n>>q;
    string s;
    cin>>s;
    vector<int> wa(n,0);
    for (int i = 1; i < n; ++i) {
        if(s[i-1]=='A'&&s[i]=='C'){
            ++wa[i];
        }
        wa[i]+=wa[i-1];
    }
    for (int i = 0; i < q; ++i) {
        int l,r;
        cin>>l>>r;
        --l;--r;
        cout<<wa[r]-wa[l]<<endl;
    }
    return 0;
}

Measured memory_bytes: 1408
#include <stdio.h>

int main(void) {
    int a, b, c;

    scanf("%d", &a);

    b = a / 60 / 60;
    a = a - b*60*60;
    c = a / 60;
    a = a - c*60;

    printf("%d:%d:%d\n", b, c, a);

    return 0;
}



Measured memory_bytes: 2100
#include <iostream>

int main(void) {
    u_int d;
    auto f_x = [](int x){ return x*x; };

    while (std::cin >> d) {
        u_int sum = 0;
        for (u_int i = 0; i + d <= 600; i += d) {
            sum += f_x(i) * d;
        }
        std::cout << sum << std::endl;
    }

    return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define forn(b) for(int i = 0; i < b; i++)
#define rforn(b) for(int i = b - 1 ;i >= 0; i--)
#define It(m) for(auto it = m.begin(); it != m.end(); it++)
#define N 500500
#define PI 3.14159265358979323846264338327950L
#define speed ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
const ll mod = (ll)1e9 + 7;
    
int main(){
    speed;
    int n; cin >> n;
    char previous = '~';
    int ans = 0;
    forn(n) {
        char c; cin >> c;
        if(c != previous) {
            ans++;
            previous = c;
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
void input(vector<int>&line){
    int N;
    cin>>N;
    line.resize(N);
    for(int i=0;i<N;++i){
        cin>>line[i];
    }
}
int func(vector<int>&,int,int);
int main(){
    vector<int> line;
    input(line);
    cout<<func(line,0,1)<<endl;
}

int func(vector<int>&line,int place,int num){
    if(place==line.size()){
        return num%2==0?1:0;
    }
    int res=0;
    for(int i=-1;i<=1;++i){
        int next = num * (line[place]+i);
        res+=func(line,place+1,next);
    }
    return res;
}

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

int n, m, ans;
unordered_map<int, int> mp;

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> m;
        ++mp[m];
    }
    for (auto [a, c] : mp) {
        if (c < a)
            ans += c;
        else
            ans += c - a;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 7156
// problem: "https://atcoder.jp/contests/abc142/tasks/abc142_d"
#include<bits/stdc++.h>
#define ll long long

using namespace std;

bool isPrime(ll n,vector<ll>&prime,vector<bool>&P)
{
    if(n == 1)
        return true;

    if(n < (ll)(1e6+1))
        return P[n];

    ll m = sqrtl(n);
    ll i;
    i = 0;
    while(i < prime.size() && prime[i] <= m)
    {
        if(n%prime[i] == 0)
            return false;

        i++;
    }

    return true;
}

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

    ll Min,Max;
    Min = min(a,b);
    Max = max(a,b);

    ll i,j;
    vector<bool>P((ll)(1e6+1),true);
    vector<ll>prime;

    P[0] = P[1] = 0;
    i = 2;
    while(i < (ll)(1e6+1))
    {
        prime.push_back(i);
        j = 2*i;

        while(j < (ll)(1e6+1))
        {
            P[j] = 0;
            j += i;
        }

        i++;
        while(i < (ll)(1e6+1) && P[i] == 0)
            i++;
    }

    vector<ll>div;
    ll m = sqrtl(Min);
    ll c = 0;

    for(i=1;i<=m;i++)
    {
        if(Min%i==0 && isPrime(i,prime,P))
            div.push_back(i);

        if(Min%i == 0 && Min/i > i && isPrime(Min/i,prime,P))
            div.push_back(Min/i);
    }

    for(i=0;i!=div.size();i++)
    {
        if(Max%div[i] == 0)
            c++;
    }

    // for(i=0;i!=div.size();i++)
    //     cout<<div[i]<<' ';


    cout<<c;

    return 0;
}


Measured memory_bytes: 1528
#include<iostream>
using namespace std;
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<cstdio>
#define MAX_N 100000

int parent[MAX_N];
int ranka[MAX_N];
void init(int n){
	for(int i=0;i<n;i++){
		parent[i]=i;
		ranka[i]=0;
	}
}
int Find(int x){
	if(parent[x]==x){
    return x;
  }else{
		parent[x]=Find(parent[x]);
		return parent[x];
	}
}
void Union(int x,int y){
	x=Find(x);
	y=Find(y);
	if(x==y)return;
	if(ranka[x]<ranka[y]){
    parent[x]=y;
  }else{
		parent[y]=x;
		if(ranka[x]==ranka[y])ranka[x]++;
	}
}
bool same(int x,int y){
	return Find(x)==Find(y);
}

int main(){
  int n;
  cin>>n;
  vector< pair<int,int> > x(n);
  vector< pair<int,int> > y(n);

  for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    x[i].first=a;
    x[i].second=i;
    y[i].first=b;
    y[i].second=i;
  }

  sort(x.begin(),x.end());
  sort(y.begin(),y.end());

  //cout<<x[0].first<<x[0].second<<endl;
  //vector< vector<int> > d(n,vector<int>(n,1000000001));
  vector< pair< int,pair<int,int> > > cost((n-1)*2);
  int j=0;
  for(int i=0;i<n-1;i++){
    int d2=x[i+1].first-x[i].first;
    //d[x[i].second][x[i+1].second]=min(d[x[i].second][x[i+1].second],d2);
    cost[j].first=d2;
    cost[j].second.first=x[i].second;
    cost[j].second.second=x[i+1].second;
    j++;
    d2=y[i+1].first-y[i].first;
    //d[y[i].second][y[i+1].second]=min(d[y[i].second][y[i+1].second],d2);
    cost[j].first=d2;
    cost[j].second.first=y[i].second;
    cost[j].second.second=y[i+1].second;
    j++;
    //cout<<d[x[i].second][x[i+1].second]<<endl;
    //cout<<d[y[i].second][y[i+1].second]<<endl;
  }
  sort(cost.begin(),cost.end());
  //for(int i=0;i<(n-1)*2;i++)cout<<cost[i].first<<" "<<cost[i].second.first<<" "<<cost[i].second.second<<endl;
  init(n);
  int ans=0;
  for(int i=0;i<(n-1)*2;i++){
    if(!same(cost[i].second.first,cost[i].second.second)){
      Union(cost[i].second.first,cost[i].second.second);
      ans+=cost[i].first;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 4992
ab = []
for i in range(3):
  p, q = map(int, input().split())
  ab.append(p)
  ab.append(q)
o, d = 0, 0
count = 0
for i in range(1, 5):
  if ab.count(i) == 2 or ab.count(i) == 1:
    count += 1
if count == 4:
  print('YES')
else:
  print('NO')

Measured memory_bytes: 9044
#include<stdio.h>
#include<limits.h>

int main() {

	int N, a[100], sum, ans, def;
	int i, j;

	scanf("%d", &N);
	for (i = 0; i < N; i++) {
		scanf("%d", &a[i]);
	}

	ans = INT_MAX;
	for (i = -100; i <= 100; i++) {
		sum = 0;
		for (j = 0; j < N; j++) {
			def = a[j] - i;
			sum += (def * def);
		}
		if (sum < ans) {
			ans = sum;
		}
	}

	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<string.h>
int main(){
  int n,i,j,a,b,count=0;
  char s[1000],tmp[1000],com[1000],t;

  scanf("%s %d",&s,&n);
  for(i=0;i<n;i++){
    count=0;
    scanf("%s",&com);
    if(strcmp(com,"replace") == 0){
      scanf("%d %d",&a,&b);
      scanf("%s",&tmp);
      for(j=0;j<=b-a;j++){
        s[a+j] = tmp[j];
        count++;
      }
    }
    else if(strcmp(com,"reverse") == 0){
      scanf("%d %d",&a,&b);
      while(a<b){
        t = s[a];
        s[a] = s[b];
        s[b] = t;
        a++;
        b--;
      }
    }
        else if(strcmp(com,"print") == 0){
      scanf("%d %d",&a,&b);
      for(j=a;j<=b;j++){
        printf("%c",s[j]);
      }
      printf("\n");
    }
  }
  return 0;
}




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

#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, list) for(auto i : list)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define fi first
#define se second
#define mp make_pair

using namespace std;

using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvb = vector<vb>;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll INFL = 1e14;

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

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

bool isPrime(ll n)
{
    for(int i = 2; i * i <= n; i++)
    {
        if(n % i == 0) return false;
    }
    return true;
}

signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    ll A, B, Q; cin >> A >> B >> Q;
    vl s(A+2), t(B+2), x(Q);
    REPS(i, A) cin >> s[i]; s[0] = -INFL; s[A+1] = INFL;
    REPS(i, B) cin >> t[i]; t[0] = -INFL; t[B+1] = INFL;
    REP(i, Q) cin >> x[i];

    REP(i, Q)
    {
        ll ans = INFL;
        ll s1, s2, t1, t2;
        s1 = *(upper_bound(ALL(s), x[i])-1);
        s2 = *upper_bound(ALL(s), x[i]);
        t1 = *(upper_bound(ALL(t), x[i])-1);
        t2 = *upper_bound(ALL(t), x[i]);
        chmin(ans, max(s2, t2)-x[i]);
        chmin(ans, x[i]-min(s1, t1));
        chmin(ans, 2*s2-x[i]-*(upper_bound(ALL(t), s2)-1));
        chmin(ans, 2*t2-x[i]-*(upper_bound(ALL(s), t2)-1));
        chmin(ans, x[i]+*upper_bound(ALL(t), s1)-2*s1);
        chmin(ans, x[i]+*upper_bound(ALL(s), t1)-2*t1);
        cout << ans << endl;
    }
}

Measured memory_bytes: 3712
#include <iostream>
#include <vector>
#include <bitset>
#include <set>
#include <algorithm>
#include <queue>
#include <map>
#include <assert.h>
 
 
using namespace std;
 
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, int> para;
const ll inf = 1e9 + 7;
const int maxN = 2e6 + 5;
const ll MOD = 1e9 + 7;
 
ll n, W, w[maxN], c[maxN], dp[101][maxN];

int main() {
	ios_base::sync_with_stdio(0);
	cin >> n >> W;
	ll sum = 0;
	REP(i, n) {
		cin >> w[i] >> c[i];
		sum += c[i];
	}
	sum++;
	REP(i, n) {
		REP(j, sum){
			dp[i][j] = inf;
		}
	}
	dp[0][0] = 0;
	dp[0][c[0]] = w[0];
	ll maxAns = 0;
	RI(i, n - 1) {
		dp[i][0] = 0;
		REP(j, sum) {
			dp[i][j] = dp[i - 1][j];
			if (j - c[i] >= 0 && dp[i - 1][j - c[i]] + w[i] <= W) {
				dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - c[i]] + w[i]);
			}
		}
	}
	FORD(i, sum - 1, 0) {
		if (dp[n - 1][i] != inf) {
			cout << i;
			break;
		}
	}
	return 0;
}


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

using ll = long long;
#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define INF 1e9
// constexpr ll INF = 1LL << 60;

int W = 5;
int main(){
  while(true){
    int H;
    cin >> H;
    if(H==0) break;
    vector<vector<int>> A(H, vector<int>(W));
    REP(i, H){
      REP(j, W){
        cin >> A[i][j];
      }
    }
    bool deleted = true;
    int ans = 0;
    while(deleted){
      deleted = false;
      REP(i, H){
        REP(j, W-2){
          if(A[i][j] != -1 && A[i][j] == A[i][j+1]&& A[i][j] == A[i][j+2]){
            deleted = true;
            int x = A[i][j];
            ans += x*3;
            A[i][j] = A[i][j+1] = A[i][j+2] = -1;
            FOR(k, j+3, W){
              if(x==A[i][k]){
                ans+=x;
                A[i][k] = -1;
              }
              else{
                break;
              }
            }
          }
        }
      }
      if(deleted){
        REP(j, W){
          REPR(i, H-2){
            if(A[i][j]==-1) continue;
            int h = i;
            while(h+1 < H && A[h+1][j] == -1){
              A[h+1][j] = A[h][j];
              A[h][j] = -1;
              h++;
            }
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}




Measured memory_bytes: 3148
#include<stdio.h>
#include<algorithm>
using namespace std;
bool v[1000001];
int d[7];
int main(){
	int a;
	scanf("%d",&a);
	while(a--){
		for(int i=0;i<1000001;i++)v[i]=0;
		int ret=0;
		int b;
		scanf("%d",&b);
		while(1){
			v[b]=true;
			if(b<10)break;
			int c=b;
			int i=0;
			while(c){
				d[i++]=c%10;
				c/=10;
			}
			int to=0;
			for(int j=0;j<i-1;j++){
				int e=0;
				int f=0;
				for(int k=j;k>=0;k--){
					e*=10;
					e+=d[k];
				}
				for(int k=i-1;k>j;k--){
					f*=10;
					f+=d[k];
				}
				to=max(to,e*f);
			}
			if(v[to]){
				ret=-1;
				break;
			}
			b=to;
			ret++;
		}
		printf("%d\n",ret);
	}
}

Measured memory_bytes: 2004
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){
	return b == 0 ? a:gcd(b,a%b);
}
ll lcm(ll a,ll b){
	return a/gcd(a,b)*b;
}

int main()
{
	ll a,b;
	cin >> a >> b;
	ll x = lcm(a,b);
	cout << x << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int[] cc = new int[]{512,256,128,64,32,16,8,4,2,1};
		
		while(stdIn.hasNext()) {
			boolean[] ck = new boolean[cc.length];
			int n = stdIn.nextInt();
			for(int i = 0; i < cc.length; i++) {
				if(n - cc[i] >= 0) {
					ck[i] = true;
					n -= cc[i];
				}
			}
			boolean check = false;
			for(int i = cc.length-1; i >= 0; i--) {
				if(ck[i]) {
					if(check) {
						System.out.print(" " +cc[i]);
					}
					else {
						System.out.print(cc[i]);
						check = true;
					}
				}
			}
			if(check) {
				System.out.println();
			}
			else {
				System.out.println(0);
			}
		}
	}
}

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

typedef long long ll;
//typedef ll int;
ll mod = 1000000007;


int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    unordered_map<string, ll> mp;
    string s;
    int n;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> s;
        sort(s.begin(), s.end());
        mp[s]++;
    }
    ll total = 0;
    for(auto i:mp){
        ll k = i.second;
        total += (k*(k-1))/2;
    }
    cout << total << endl;
}

Measured memory_bytes: 10660
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;

//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define pf push_front
#define pb push_back
#define pop_f pop_front
#define pop_b pop_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()

template <typename T> istream& operator>>(istream& in, vector <T>& a) {for (auto& i : a) in >> i; return in;}
template <typename T> ostream& operator<<(ostream& out, vector <T>& a)  {for (auto& i : a) out << i << " "; return out;}
template <typename T, typename U> void chkmin(T& a, U b) {if (a > b) a = b;}
template <typename T, typename U> void chkmax(T& a, U b) {if (a < b) a = b;}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    int k;
    string s;
    cin >> k >> s;
    if (sz(s) <= k)
        cout << s;
    else {
        string ans;
        forn (i, 0, k)
            ans += s[i];
        ans += "...";
        cout << ans;
    }
    return 0;
}

Measured memory_bytes: 3616
#include <stdio.h>

int main() {
    int N;
    scanf("%d", &N);
;
    if (N == 1) {
        printf("1\n");
        return 0;
    }
    long a = 3;
    long b = 1;
    long c = 2;
    for (int i = 0; i < N - 1; i++) {
        a = b + c;
        c = b;
        b = a;
    }
    printf("%ld\n", a);
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <tuple>
#include <algorithm>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <sstream> // std::stringstream
#include <bitset>  // std::bitset<N>
using namespace std;
long long int MOD = 1000000000 + 7;
using ll = long long;
ll LARGE = 1000000;


void print(vector<char>& v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i] << " ";
	}
	cout << endl;
}

int ncr(int n, int r) {
	int k1 = 1;
	int k2 = 1;
	for (int i = 0; i < r; ++i) {
		k1 *= (i + 1);
		k2 *= (n - i);
	}
	return k2 / k1;
}

int main() {
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5]) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}


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

#ifdef LOCAL
 #include <bits/debugger.hpp>
 #define __int64 __int64_t
#else 
 #define debug(a...) //
#endif

int main()
{
 ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
 char ch;
 cin >> ch;
 cout << (islower(ch) ? 'a' : 'A') << '\n';
 return 0;
}


Measured memory_bytes: 3608
// C++ program to count number of factors 
// of an array of integers 
#include <bits/stdc++.h> 
using namespace std; 

const int MAX = 10000001; 
int factor[MAX] = { 0 }; 
void generatePrimeFactors() 
{ 
    factor[1] = 1; 
    for (int i = 2; i < MAX; i++) 
        factor[i] = i; 
    for (int i = 4; i < MAX; i += 2) 
        factor[i] = 2;
    for (int i = 3; i * i < MAX; i++) { 
        if (factor[i] == i) { 
            for (int j = i * i; j < MAX; j += i) { 
                if (factor[j] == j) 
                    factor[j] = i; 
            } 
        } 
    } 
} 
long long int calculateNoOFactors(long long int n) 
{ 
    if (n == 1) 
        return 1; 

    long long int ans = 1; 
    long long int dup = factor[n]; 
    long long int c = 1; 
    long long int j = n / factor[n]; 
    while (j != 1) {  
        if (factor[j] == dup) 
            c += 1;
        else { 
            dup = factor[j]; 
            ans = ans * (c + 1); 
            c = 1; 
        } 
        j = j / factor[j]; 
    } 
    ans = ans * (c + 1); 

    return ans; 
} 
int main() 
{ 
    generatePrimeFactors(); 
    int n;cin>>n; 
    long long int ans=0;
    for (long long int i = 1; i <= n; i++) 
        ans+=i*calculateNoOFactors(i); 
    cout<<ans;
    return 0; 
} 


Measured memory_bytes: 42664
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>

using namespace std;

typedef long long ll;
typedef std::pair<int, int> ipair;
const int MAX_V = 100010;
const int MAX_LOG_V = 17;
vector<ipair> G[MAX_V];
int parent[MAX_LOG_V][MAX_V];
int depth[MAX_V];
vector<int> eulerT;
 
template<class T> class TREE {
 
   public:
      int k = 0;
      T distance[MAX_V];
      int begin[MAX_V * 2];
      int end[MAX_V * 2];
 
      // vertex, parent, depth, distance
      void dfs(int v, int p, int d, T l) {
         parent[0][v] = p;
         depth[v] = d;
         distance[v] = l;
         begin[v] = k;
         eulerT.push_back(v);
         k++;
         for (auto& g : G[v]) {
            if (g.first != p) {
               dfs(g.first, v, d + 1, l + g.second);
               eulerT.push_back(v);
               k++;
            }
         }
         end[v] = k;
      }
 
      void init(int V, int root) {
         dfs(root, -1, 0, 0);
         for (int k = 0; k + 1 < MAX_LOG_V; k++) {
            for (int v = 0; v < V; v++) {
               if (parent[k][v] < 0) parent[k + 1][v] = -1;
               else parent[k + 1][v] = parent[k][parent[k][v]];
            }
         }
      }
 
      int lca(int u, int v) {
         if (depth[u] > depth[v]) swap(u, v);
         for (int k = 0; k < MAX_LOG_V; k++) {
            // if k th digit of depth[v] - depth[u] is 1
            if ((depth[v] - depth[u]) >> k & 1) {
               v = parent[k][v];
            }
         }
         if (u == v) return u;
         for (int k = MAX_LOG_V - 1; k >= 0; k--) {
            if (parent[k][u] != parent[k][v]) {
               u = parent[k][u];
               v = parent[k][v];
            }
         }
         return parent[0][u];
      }
};


int main() {
   int N;
   cin >> N;
   int a, b;
   for (int i = 0; i < N - 1; i++) {
      cin >> a >> b;
      a--;
      b--;
      G[a].push_back(ipair(b, 1));
      G[b].push_back(ipair(a, 1));
   }

   TREE<int> tree;
   tree.init(N, 0);
   
   int cnt = 0;
   for (int i = 0; i < N; i++) {
      int from1 = tree.distance[i];
      int fromN = tree.distance[i] + tree.distance[N - 1] - 2 * tree.distance[tree.lca(i, N - 1)];
      if (from1 <= fromN) cnt++;
   }
   if (cnt > N - cnt) cout << "Fennec" << endl;
   else cout << "Snuke" << endl;
   return 0;
}


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

signed main() {
  int N,K;
  cin >> N >> K;
  int ans = 0;
  for(int i=0; i<N; i++) {
    int h; cin >> h;
    if(h>=K) ans++;
  }
  cout << ans << endl;

}


Measured memory_bytes: 256
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1)(n(2).readFileSync("/dev/stdin","UTF-8"))},function(e,t){e.exports=function(e){for(var t=e.split("\n")[0].split(""),n=t.length,r=0,o=0,u=0,i=0;i<n&&("T"==t[i]?(o+=1,u<r&&(u+=1)):r+=1,o!=n/2);i++);var f=n-2*u;console.log(f)}},function(e,t){e.exports=require("fs")}]);

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

#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (a); i >= (int)(b); i--)
#define all(x) (x).begin(), (x).end()
using i32 = int32_t;
using i64 = int64_t;
using f32 = float;
using f64 = double;
using P = pair<int, int>;

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

template <class T>
void dump_vec(const vector<T>& v) {
    auto len = v.size();
    rep(i, 0, len) {
        cout << v[i] << (i == (int)len - 1 ? "\n" : " ");
    }
}

struct FastIO {
    FastIO() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} FASTIO;

//---------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------

signed main() {
    string S;
    cin >> S;
    auto T = S;
    reverse(all(T));
    bool ok1 = T == S;

    int len = S.size();
    string a = "";
    rep(i, 0, (len - 1) / 2) {
        a += S[i];
    }
    string b = a;
    reverse(all(b));
    bool ok2 = a == b;

    string c = "";
    rep(i, (len + 3) / 2 - 1, len) {
        c += S[i];
    }
    string d = c;
    reverse(all(d));
    bool ok3 = c == d;
    // cout << a << " " << b << " " << c << " " << d << "\n";
    cout << (ok1 && ok2 && ok3 ? "Yes" : "No") << "\n";
}


Measured memory_bytes: 256