akhauriyash/Code-Regression huggingface dataset:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

h, w, k = MAP()
c = [STR() for _ in range(h)]
ans = 0
for i in range(2 ** h):
    for j in range(2 ** w):
        cnt = 0
        for y in range(h):
            for x in range(w):
                if c[y][x] == '#' and (i >> y) & 1 and (j >> x) & 1:
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

Measured memory_bytes: 73756
/* Bismillahir Rahmanir Rahim
There is no god without Allah*/
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ul;
#define pi acos(-1)
#define ll long long
#define ull unsigned long long
#define vec vector<ll>
#define f1(i,n) for(i=1;i<n;i++)
#define test   ll ttt;cin>>ttt;while(ttt--)
long long int i,j;
using namespace std;

int main()
{
    int x;cin>>x;
    if(x>=30)cout<<"Yes\n";
    else cout<<"No\n";

}
// Alhamdulillah


Measured memory_bytes: 3620
n = int(input())

def x(n):
    c = 0
    for i in range(1, n+1):
        if n % i == 0:
            c += 1

    return c

ans = 0

for i in range(1, n+1, 2):
    if x(i) == 8:
        ans += 1

print(ans)

Measured memory_bytes: 3060
n,m,l = gets.split.map(&:to_i)
a = Array.new(n).map { Array.new(m, 0) }
b = Array.new(m).map { Array.new(l, 0) }

n.times do |i|
  tmp = gets.split.map(&:to_i)
  m.times do |mi|
    a[i][mi] += tmp[mi]
  end
end

m.times do |i|
  tmp = gets.split.map(&:to_i)
  l.times do |li|
    b[i][li] += tmp[li]
  end
end

n.times do |ni|
  ans = ""
  l.times do |li|
    sum = 0
    m.times do |mi|
      sum += a[ni][mi] * b[mi][li]
    end
    ans << "#{sum} "
  end
  puts ans.chop!
end

Measured memory_bytes: 9232
#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    
    int m;
    cin >> m;
    
    int l = 1;
	int r = n;
	
	for (int i = 1; i <= m; i++) {
		int tl;
		cin >> tl;
		int tr;
		cin >> tr;
        
		if (l < tl) l = tl;
		if (tr < r) r = tr;
	}
	
	if (r < l) {
		cout << "0" << endl;
	} else {
		cout << r - l + 1;
	}

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  int x = 700;
  cin >> s;
  for (int i = 0; i < 3; i++) {
    if(s.at(i) == 'o') {
      x += 100;
    }
  }
  cout << x << endl;
}
      

Measured memory_bytes: 256
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

N = int(input())
A = list(map(int, input().split()))
MAX = 10**18

if 0 in A:
    print(0)
    exit()

res = 1
for a in A:
    res *= a
    if res > MAX:
        print(-1)
        exit()
    
print(res)

Measured memory_bytes: 22356
#include<iostream>
#include<cmath>
#include<vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main()
{
    int n,m;
    int num;
    int max=0;
    vector<int> a;
    cin >> n >>m;
    for(int i=0; i < m; i++){
        cin >> num;
        a.push_back(num);
    }

    std::sort(a.begin(),a.end());

    for(int i=0; i < m ; i++){
        if( (a[i+1] - a[i]) > max){
            
            max = a[i+1] - a[i];
        }
    }

    if(max < (a[0] + (n-a[m-1]) )){
        max = (a[0] + (n-a[m-1]));
    }

    cout << n - max <<endl;

    return 0;
}

Measured memory_bytes: 1400
x,n=map(int,input().split())
p=list(map(int,input().split()))
a=[]
b=[]
for i in range(0,102):
  if i not in p:
    a.append(i)
#a=set(a)

for i in a:
  b.append(abs(x-i))
#print(a)
idx = b.index(min(b))

print(a[idx])

Measured memory_bytes: 9192
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
#define INF 999999999
typedef long long ll;
using namespace std;
int main() {
    int n, m;
    cin >> n >> m;
    cout << (n-1)*(m-1) << "\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define until(x) while(!(x))
#define unless(x) if(!(x))
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
#define pc __builtin_popcount

int ar[100005];
map<int,int> mp;

int32_t main(){
	//freopen("test.txt","r",stdin);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>ar[i];
		mp[ar[i]]++;
	}
	sort(ar+1,ar+n+1);
	/*cout<<mp.size()<<"\n";
	for(auto x: mp){
		cout<<(x.first)<<" "<<(x.second)<<"\n";
	}*/
	if(mp.size()==3 && ((n%3)==0)){
		if(mp[ar[1]]==mp[ar[n]] && mp[ar[1]]==mp[ar[(n+1)/2]]){
			if((ar[1]^ar[n])==(ar[(n+1)/2])){
				cout<<"Yes";
				return 0;
			}
		}
	}
	if(mp.size()==2){
		if(mp[ar[1]]==mp[ar[n]]/2 && ar[1]==0){
			cout<<"Yes";
			return 0;
		}

	}
	if(mp.size()==1){
		if(ar[1]==0){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
}


Measured memory_bytes: 5632
#include<cstdio>

using namespace std;

int main(){
    int n, x;
    scanf("%d %d", &n, &x);
    int m[n];
    int mn = 10000, sm = 0;
    for(int i = 0; i < n; i++){
        scanf("%d", &m[i]);
        if (mn > m[i]) mn = m[i];
        sm += m[i];
    }
    int ans = n;
    x -= sm;
    while (x >= mn){
        x -= mn;
        ans++;
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 128
N = int(input())
edge = []
nlist = [[] for i in range(N)]
for i in range(N-1):
    u, v, w = map(int,input().split())
    u, v = u-1, v-1
    edge.append([u,v,w])
for u, v, w in edge:
    nlist[u].append([v,w])
    nlist[v].append([u,w])
visit = [False]*N
ans = [0]*N

def dfs(v):
    S = []
    visit[v] = True
    S.append([v,0])
    while S:
        v = S.pop()
        if v[1] % 2 == 0:
            ans[v[0]] = 0
        else:
            ans[v[0]] = 1
        for index, w in nlist[v[0]]:
            if not visit[index]:
                visit[index] = True
                S.append([index,v[1]+w])
                
dfs(0)
for a in ans:
    print(a)

Measured memory_bytes: 56148
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();

    let n: i64 = s.trim().parse().unwrap();

    for i in 1..10 {
        if n%i==0 && n/i<10 {
            println!("Yes");
            return;
        }
    }
    println!("No");
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  int n;
  cin >> n;
  vi a(n), b(n);
  rep(i, n) {
    int p;
    cin >> p;
    p--;
    a[p] = 2e4 * (p + 1);
    b[p] = 8e8 + i - a[p];
  }
  rep(i, n) cout << a[i] << (i == n - 1 ? '\n' : ' ');
  rep(i, n) cout << b[i] << (i == n - 1 ? '\n' : ' ');
}

Measured memory_bytes: 768
package main

import (
	"fmt"
	"sort"
)

func main() {
	var p,q,r int
	fmt.Scan(&p, &q,&r)

	ds := make([]int,3)
	ds[0] = p
	ds[1] = q
	ds[2] = r

	sort.IntSlice(ds).Sort()
	fmt.Println(ds[0] + ds[1])
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll LINF = 1LL << 60;

struct Book {
    int c, a[12];
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n, m; ll x;
    cin >> n >> m >> x;
    vector<Book> v(n);
    for(int i=0;i<n;++i) {
        cin >> v[i].c;
        for(int j=0;j<m;++j) {
            cin >> v[i].a[j];
        }
    }

    ll min_cost = LINF;
    for(int bi=0;bi<(1<<n);++bi) {
        vector<ll> sum_a(m, 0);
        ll sum_cost = 0LL;
        for(int i=0;i<n;++i) {
            if(bi & (1 << i)) {
                sum_cost += v[i].c;
                for(int j=0;j<m;++j) {
                    sum_a[j] += v[i].a[j];
                }
            }
        }

        bool ok = true;
        for(int j=0;j<m;++j) {
            if(sum_a[j] < x) {
                ok = false;
                break;
            }
        }

        if(ok) {
            min_cost = min(min_cost, sum_cost);
        }
    }

    cout << ((min_cost == LINF) ? -1LL : min_cost) << endl;
}

Measured memory_bytes: 3624
use std::io::*;
use std::str::FromStr;

fn main() {
	let s: String = read();
	let s: Vec<char> = s.chars().collect();
	let ans = if s[2] == s[3] && s[4] == s[5] { "Yes" } else { "No" };
	println!("{}", ans);
}

fn read<T: FromStr>() -> T {
	let stdin = stdin();
	let stdin = stdin.lock();
	let token: String = stdin
		.bytes()
		.map(|c| c.expect("failed to read char") as char)
		.skip_while(|c| c.is_whitespace())
		.take_while(|c| !c.is_whitespace())
		.collect();
	token.parse().ok().expect("failed to parse token")
}



Measured memory_bytes: 4352
a = int(input())
b = int(input())
c = int(input())
n = int(input())
co = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i + 100*j + 50* k == n:
                co += 1
print(co)


Measured memory_bytes: 3060
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

//Code Short
#define REP(i,n) for(int i = 0;i < n;++i)
#define PB(s) push_back(s)
#define DSORT(n) sort(n.begin(),n.end())
#define QECHO(n) cout << n
#define QECHOS(n) cout << n << " "

//Define Math
const double EPS = 1e-10;
const double PI  = acos(-1.0);

using namespace std;
typedef long long ll;
/* prototype */
int EDSum(ll);//各桁の和
vector<int> SOE(int,int);//素数 (Min,Max)
int MinCM(int,int);//最小公倍数(num1,num2)
int MaxCD(int,int);//最大公約数(num1,num2)
vector<int> igets(int);//cin * N
ll nPr(ll,ll); //(n,r)
ll nE(ll); //(n)
ll nCr(ll,ll); //(n,r)

void solve(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int sum = a+b-c-d;
    if(sum==0)cout << "Balanced" << endl;
    else if(0<sum)cout << "Left" << endl; else cout << "Right" << endl;
}

int main(void){cin.tie(0);ios::sync_with_stdio(false);solve();}
int EDSum(ll number) {
  int ans = 0;
  while (1) {
    ans += number % 10;
    number /= 10;
    if (number == 0) break;
  }
  return ans;
}

vector < int > SOE(int min, int max) {
  if (min < 2) min = 2;
  vector < int > int_array;
  for (int i = min; i <= max; i++) int_array.push_back(i);
  vector < int > sosu;
  double stop = sqrt(max);
  while (true) {
    sosu.push_back(int_array.front());
    int_array.erase(int_array.begin());
    if (stop < (double)(sosu.back())) break;
    for (int i = 0; i < (int) int_array.size(); i++) {
      if (int_array[i] % sosu.back() == 0)
        int_array.erase(int_array.begin() + i);
    }
  }
  sosu.insert(sosu.end(), int_array.begin(), int_array.end());
  return sosu;
}

int MinCM(int a, int b) {
  int c = a * b;
  if (a < b)
    swap(a, b);
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return c / b;
}

int MaxCD(int a, int b) {
  if (a < b)
    swap(a, b);
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
vector < int > igets(int N) {
  vector < int > A;
  int temp;
  for (int i = 0; i < N; ++i) {
    cin >> temp;
    A.push_back(temp);
  }
  return A;
}

ll nPr(ll n, ll r) {
  ll ans = 1;
  r = n - r;
  while (n != r) {
    ans *= n;
    --n;
  }
  return ans;
}

ll nE(ll n) {
  return nPr(n, n);
}

ll nCr(ll n, ll r) {
  if (r == 0) return -1;
  else {
    if (0 != n - r && n - r < r) r = n - r;
    return nPr(n, r) / nE(r);
  }
}

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

int S, h, m, s;

int main() {
    cin >> S;
    h = S / 3600;
    m = (S % 3600) / 60;
    s = (S % 3600) % 60;
    cout << h << ":" << m << ":" << s << endl;
    
    return 0;
}


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

#define rep(i, s, n) for (Int i = s; i < (Int)(n); i++)
#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
 
double EPS = 1e-10;
Int INF = 1e18;
int inf = 1e9;
Int mod = 1e9+7;

Int n, m;
vector<pair<Int, Int>> G[100001];
Int d[100001];

bool check = true;

void rec(Int x) {
    rep(i, 0, G[x].size()) {
        Int to = G[x][i].fi;
        if (d[to] == INF) {
            d[to] = d[x] + G[x][i].se;
            rec(to);
        } else {
            if (d[to] != d[x] + G[x][i].se) {
                check = false;
            }
        }
    }
}

int main() {
    cin >> n >> m;
    rep(i, 0, m) {
        Int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        G[a].emplace_back(b, c);
        G[b].emplace_back(a, -c);
    }
    rep(i, 0, n) d[i] = INF;
    rep(i, 0, n) {
        if (d[i] != INF) continue;
        d[i] = 0;
        rec(i);
        if (not check) {
            //rep(j, 0, n) cout << d[j] << " "; cout << endl;
            dump("No");
            return 0;
        }
    }
    dump("Yes");
    return 0;
}

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

#define F first 
#define S second

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

const int N = 200010, M = 110;

int n, flag;
string s;
deque<char> S;

int main()
{
	cin >> s >> n;
	for (auto c : s) S.push_back(c);
	
	while (n -- )
	{
		int t;
		cin >> t;
		if (t == 1) flag ^= 1;
		else
		{
			int f;
			char c;
			cin >> f >> c;
			if (f == 1)
			{
				if (flag) S.push_back(c);
				else S.push_front(c);
			}
			else
			{
				if (flag) S.push_front(c);
				else S.push_back(c);
			}
		}
	}
	
	if (flag) reverse(S.begin(), S.end());
	
	for (auto c : S) cout << c;
	puts("");
	
    return 0;
}

Measured memory_bytes: 896
A, B, K = map(int, input().split())

for i in range(K):
    if i % 2 == 0:
        tmp_1, tmp_2 = A, B
    else:
        tmp_1, tmp_2 = B, A
    if tmp_1 % 2 == 1:
        tmp_1 -= 1
    half = int(tmp_1 / 2)
    tmp_2 += half
    tmp_1 = half
    if i % 2 == 0:
        A, B = tmp_1, tmp_2
    else:
        A, B = tmp_2, tmp_1

print(A, B)

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

int main() {

  string S, T, U;
  int A, B;
  
  cin >> S >> T;
  cin >> A >> B;
  cin >> U;
  
  if ( U == S ) {
	A--;
  } else if ( U == T ) {
	B--;
  }
  
  cout << A << ' ' << B << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

int main() {
    int a, b, c;
    std::cin >> a >> b >> c;

    const auto d = 100*a + 10*b + c;
    const auto ret = (d % 4 == 0) ? "YES" : "NO";

    std::cout << ret << std::endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<math.h>
int main(void)
{
	int a,s,d,f,g;
	char z[2];
	scanf("%d %c %d",&a,&z[0],&s);
	if(z[0]=='+')
		d=a+s;
	if(z[0]=='-')
		d=a-s;
	printf("%d\n",d);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  int N; cin >> N;
  vector<ll> A(N); rep(i,N) cin >> A[i];
  sort(rall(A));
  ll ans = 0;
  rep(i,N) ans+=A[i/2];
  cout << ans-A[0] << endl;
  return 0;
}


Measured memory_bytes: 4844
#include <iostream>

using namespace std;

int main()
{
  int m, d;
  while(1){
    cin >> m >> d;
    if(m == 0 && d == 0){
      break;
    }else{
      int n = d - 1;
      for(int i = m - 1; i > 0; i--)
	if(i >= 8)
	  if(i & 1)
	    n += 30;
	  else
	    n += 31;
	else if(i == 2)
	  n += 29;
	else
	  if(i & 1)
	    n += 31;
	  else
	    n += 30;
      switch(n % 7){
      case 0 : cout << "Thursday" << endl; break;
      case 1 : cout << "Friday" << endl; break;
      case 2 : cout << "Saturday" << endl; break;
      case 3 : cout << "Sunday" << endl; break;
      case 4 : cout << "Monday" << endl; break;
      case 5 : cout << "Tuesday" << endl; break;
      case 6 : cout << "Wednesday" << endl; break;
      }
    }
  }
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define repm(i, a, b) for (ll i = (ll)(a); i > (ll)(b); i--)
#define all(v) v.begin(), v.end()
#define rall(x) (x).rbegin(), (x).rend()
#define pll pair<long long, long long>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vc vector<char>
#define vvc vector<vc>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<long long>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
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;}
//snippets:tmp,cl,cvl,cs,co,coy,con,cov,setp
const ll mod=1e9+7;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string t;
    cin >> t;
    string p;
    cin >> p;
    ll pkey=0;
    ll count=0;
    rep(i,t.size()){
        if(pkey!=p.size()-1&&t[i]==p[pkey]){
            pkey++;
        }
        else if(pkey!=0){
            if(t[i]==p[pkey-1]){
                cout<<"no"<<endl;
                return 0;
            }
        }
    }
    if(pkey==p.size()-1)cout << "yes" << endl;
    else cout << "no" << endl;
}


Measured memory_bytes: 4324
import java.util.Scanner;
public class Main{
    
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
            int w = sc.nextInt();
            int n = sc.nextInt();
            int[] stick = new int[w];
            for(int i = 0; i < stick.length; i++){
                stick[i] = i + 1;
            }
            
            int a, b;
            
            for(int i = 0; i < n; i++){
                String line = sc.next();
                String[] num = line.split(",");
                a = Integer.parseInt(num[0])-1;
                b = Integer.parseInt(num[1])-1;
                int tmp = stick[a];
                stick[a] = stick[b];
                stick[b] = tmp;
            }

            for(int i = 0; i < stick.length; i++){
                System.out.println(stick[i]);
            }
        
    }
}


Measured memory_bytes: 25976
module Main where

import Data.List as List
import qualified Data.Vector.Unboxed as V
import qualified Data.ByteString.Char8 as BS
import Control.Monad as M
import Data.Maybe as Maybe

main :: IO ()
main =
    solve =<< getInts

getInt :: IO Int
getInt = read <$> BS.unpack <$> BS.getLine

{-
splitLine :: IO [BS.ByteString]
splitLine = BS.words <$> BS.getLine

getInts :: IO (V.Vector Int)
getInts = V.fromList <$> List.map fst <$> Maybe.mapMaybe BS.readInt <$> splitLine
-}
getInts :: IO (V.Vector Int)
getInts = V.fromList <$> List.map fst <$> Maybe.mapMaybe BS.readInt <$> replicateM 3 BS.getLine

solve :: V.Vector Int -> IO ()
solve v = print $ (\a -> div (a - 1 + v V.! 2) a) $ max (v V.! 0) (v V.! 1)


Measured memory_bytes: 380
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define P pair<ll, ll>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define pp pair<ll, pair<ll, ll>> 
#define fi first
#define se second

void print(Vl vec){
    rep(i, 0, sz(vec)){
        if(i) cout << " ";
        cout << vec[i];
    }
    coel;
}

////////////////////////////////////////////////////////
ll n, a, b, c; 
ll ans = INF;
Vl l;
ll sum = 0;

void saiki(ll x, ll y, ll z, ll w, ll cost){
    if(w == n){
        if(x==0 || y==0 || z==0) return;
        cost += abs(a-x)+abs(b-y)+abs(c-z);
        chmin(ans, cost);
    }else{
        saiki(x+l[w], y, z, w+1, x ? cost+10 : cost);
        saiki(x, y+l[w], z, w+1, y ? cost+10 : cost);
        saiki(x, y, z+l[w], w+1, z ? cost+10 : cost);
        saiki(x, y, z, w+1, cost);
    }
}

int main() {
    cin >> n >> a >> b >> c;
    l.resize(n);
    rep(i, 0, n) cin >> l[i];
    rep(i, 0, n) sum += l[i];

    saiki(0, 0, 0, 0, 0);
    co(ans);

    return 0;
}


Measured memory_bytes: 256
let scan_int () = Scanf.scanf " %d" (fun x -> x)
let scan_floats () = Scanf.scanf " %f %f" (fun x y -> (x, y))
let print_float n = Printf.printf "%.12f\n" n
let scan_array len read_func = Array.init len (fun _ -> read_func())

let rec sum_of_dist xy i j n ret =
  if i >= n then ret
  else if j >= n then sum_of_dist xy (i+1) (i+2) n ret
  else
    let x1, y1 = xy.(i) in
    let x2, y2 = xy.(j) in
    let dist = sqrt ((x2-.x1)*.(x2-.x1) +. (y2-.y1)*.(y2-.y1)) in
    sum_of_dist xy i (j+1) n (ret+.dist)

let () =
  let n = scan_int() in
  let xy = scan_array n scan_floats in
  let sum = sum_of_dist xy 0 1 n 0.0 in
  print_float (sum *. 2.0 /. (float n))

Measured memory_bytes: 4480
n=int(input())
if n%2==0:
  print(n*(n-2)//2)
  for i in range(1,n):
    for j in range(i+1,n+1):
      if i+j==n+1:
        continue
      print(i,j)
else:
  print(n*(n-1)//2-(n-1)//2)
  for i in range(1,n):
    for j in range(i+1,n+1):
      if i+j==n:
        continue
      print(i,j)

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 30)
#define MOD 1000000007
//int dy[4] = {-1,0,0,1};
//int dx[4] = {0,1,-1,0};


int main(){

  int h,w,n;
  cin >> h >> w >> n;
  int a = max(h,w);
  cout << (n+a-1)/a << endl;

  

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define INS(x) x.begin(),x.end()
    

    
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    long double l;
    cin>>l;

    cout<<setiosflags(ios::fixed)<<setprecision(12)<<powl((l/3),3)<<'\n';

    return 0;
}

Measured memory_bytes: 512
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void PR(bool f){
  cout << (f ? "YES" : "NO") << "\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll a, v, b, w, t;
  cin >> a >> v >> b >> w >> t;
  
  PR(abs(b-a) <= t*(v-w));
}


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

typedef long long ll;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    int A, B, C, K;
    cin >> A >> B >> C >> K;
    int sum = 0;
    while (K > 0) {
        if (A > 0) {
            sum++;
            A--;
        }
        else if (B > 0) {
            B--;
        }
        else {
            sum--;
        }
        K--;
    }
    cout << sum;
}


Measured memory_bytes: 3628
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

ll dp[2001] = {0, 0, 0, 1, 1, 1};

signed main()
{
	ll S; cin >> S;
	FOR(i, 6, S){
		dp[i] = (dp[i-1] + dp[i-3])%MOD;
	}
	cout << dp[S] << endl;
}


Measured memory_bytes: 3648
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    char[] S = sc.next().toCharArray();
    List<Character> d = new ArrayList<Character>();
    for(char c : S){
      d.add(c);
    }
    for(char i = 'a'; i <= 'z'; i++){
      if(!d.contains(i)){
        System.out.println(i);
        return;
      }
    }
    System.out.println("None");
  }
}


Measured memory_bytes: 26728
import io
import sys

def solve(x,y):
    return x+y//2

def readQuestion():

    line1 = sys.stdin.readline().rstrip()
    list1 = line1.split(" ")
    return int(list1[0]),int(list1[1])

def main():
    n,x = readQuestion()
    answer = solve(n,x)
    print(answer)
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <iostream>
#include <string>

using namespace std;


int main(){
int n;
  
  cin >>n;
  
  long long int ans = 0;
  
  for(int i=0;i<=n;i++){
    if(i % 3 !=0 && i % 5 != 0){
      ans += i;
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3636
package main

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

var n int
var count int
var saveX int
var saveY int
var saveZ int
var memo map[int]int
var memoString map[string]bool
func Strings (x int,y int,z int) bool{
	ints := []int{x,y,z}
	sort.Ints(ints)
	strins := make([]string,3)
	for i:= 0; i<3; i++ {
		strins[i] = strconv.Itoa(ints[i])
	}
	text := strings.Join(strins,"")
	if _,ok := memoString[text]; !ok {
		memoString[text] = true
		return true
	} else {
		return false
	}
}
func main() {
	scan_init()
	n = scanInt()
	memo = map[int]int{}
	memoString = map[string]bool{}
	count = 0
	saveX = 1
	saveY = 1
	saveZ = 1
	keisan(1,1,1,n)
	bfs(1,1,1,n)
	for i:= 1; i<=n; i++ {
		if val,ok := memo[i]; ok {
			fmt.Println(val)
		} else {
			fmt.Println(0)
		}
	}
	//fmt.Println(memo)
	// fmt.Println(memo)
	// x(1+y)+ y(1+z)+ z(1+x)
	// ルール付きBFSで見ていく
}
func keisan (x int, y int, z int, check int) bool {
	sum := x*x + y*y + z*z + x*y + y*z + z*x
	if !Strings(x,y,z) {
		return false
	}
	if _,ok := memo[sum]; !ok && sum <= check{
		//　種類計算
		count = 0
		if x == y && y == z {
			//　一つ
			count ++
		} else if x == y || x == z || z == y {
			// 二つ
			count += 3
		} else {
			count += 6
		}
		// fmt.Println(x,y,z)
		memo[sum] = count
		return true
	} else if sum <= check{
		count = 0
		if x == y && y == z {
			//　一つ
			count ++
		} else if x == y || x == z || z == y {
			// 二つ
			count += 3
		} else {
			count += 6
		}
		memo[sum] += count
		return true
	}
	return false
}
func bfs (x int , y int , z int, checkN int) {
	// x<= y<= z
	if (y > x && keisan(x+1,y,z,checkN)) {
		bfs(x+1,y,z,checkN)
	}
	if (z > y && keisan(x,y+1,z,checkN)) {
		bfs(x,y+1,z,checkN)
	}
	if (checkN >= z && keisan(x,y,z+1,checkN)) {
		bfs(x,y,z+1,checkN)
	}
}

var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 9012
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef int ll;
typedef long double ld;
const ll N = 200005;
char en = '\n';
ll inf = 1e16;
ll mod = 1e9 + 7;
ll power(ll x, ll n, ll mod) {
  ll res = 1;
  x %= mod;
  while (n) {
    if (n & 1)
      res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}

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

  ll h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;

  ll t1 = h1 * 60 + m1;
  ll t2 = h2 * 60 + m2;

  ll val = t2 - t1;

  cout << val - k << en;

  return 0;
}

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

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int 	LL;
typedef vector<LL> 		VL;
#define si(n) cin>>n
#define dout(n) cout<<n<<"\n"
#define DRT() int t; si(t); while(t--)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//# define M_PI           3.14159265358979323846264338327950288
// DSU
void IO(){
	#ifndef ONLINE_JUDGE
    freopen("../input.txt", "r", stdin);
    freopen("../output.txt", "w", stdout);
	#endif
	srand(chrono::steady_clock::now().time_since_epoch().count());
	off;
}

int main(){
	IO();
	LL l,r,d;
	cin>>l>>r>>d;
	LL ans = r/d - (l-1)/d;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3544
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;

using namespace std;

const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

int f(ll a, ll b) {
	if (b > a) swap(a, b);

	int rtv = 0;
	while (a > 0) {
		a /= 10;
		++rtv;
	}

	return rtv;
}

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

	ll n;
	cin >> n;
	int ans = _MOD;
	for (ll i = 1; i*i <= n; ++i) {
		if (n%i == 0) {
			ans = min(ans, f(i, n / i));
		}
	}

	cout << ans << "\n";

	return 0;
}



Measured memory_bytes: 256
#include <stdio.h>

void size_determine(int a, int b){
    if (a < b)
        printf("a < b\n");
    else if (a > b)
        printf("a > b\n");
    else if (a == b)
        printf("a == b\n");
}

int main(void){
    int a = 0;
    int b = 0;
    scanf("%d %d", &a, &b);
    size_determine(a, b);

    return 0;
}



Measured memory_bytes: 2032
// https://atcoder.jp/contests/abc177/tasks/abc177_e
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define CEIL(a, b) ((a - 1) / b + 1)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

const int SZ = 1e6;

// エラトステネスの篩
template <int N> struct Prime {
    bitset<N + 1> b;
    Prime() : b() {
        // trueで初期化
        b.flip();
        b[0] = b[1] = false;
        for (int i = 2; i <= N; ++i) {
            if (b[i]) {
                for (int j = i * i; j <= N; j += i) {
                    b[j] = false;
                }
            }
        }
    }
};
// SZ = 1e6 だと10ms
Prime<SZ> prime;

void solve() {
    int N;
    cin >> N;
    vector<int> A(N), D(SZ + 1);
    for (auto &x : A) {
        cin >> x;
        // 同じ数が重複するケースを考慮
        D[x]++;
    }
    // trueなら "pairwise coprime"
    bool pc = true;

    REP(i, SZ) {
        // 素数の場合
        if (prime.b[i]) {
            int cnt = 0;
            for (int now = i; now <= SZ && cnt <= 1; now += i) {
                cnt += D[now];
            }
            // 共通の素数を含むのでgcd(ALL) >= i
            if (cnt >= 2) {
                pc = false;
                break;
            }
        }
    }
    if (pc) {
        cout << "pairwise coprime" << endl;
    } else {
        int g = A[0];
        for (auto &x : A) {
            g = gcd(g, x);
        }
        if (g == 1)
            cout << "setwise coprime" << endl;
        else
            cout << "not coprime" << endl;
    }
}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}


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

int main(void){
  int i;
  char S[100];
  
  scanf("%s", S);
  
  for(i=0;i<strlen(S);i++)
    S[i] = 'x';
  
  printf("%s\n", S);
  
  return 0;
}

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

struct node {
    int left = -1;
    int right = -1;
    int parent = -1;
};

void preorder(vector<node> &tree, int idx) {
    cout << ' ' << idx;
    if (tree.at(idx).left != -1) preorder(tree, tree.at(idx).left);
    if (tree.at(idx).right != -1) preorder(tree, tree.at(idx).right);
}

void inorder(vector<node> &tree, int idx) {
    if (tree.at(idx).left != -1) inorder(tree, tree.at(idx).left);
    cout << ' ' << idx;
    if (tree.at(idx).right != -1) inorder(tree, tree.at(idx).right);
}

void postorder(vector<node> &tree, int idx) {
    if (tree.at(idx).left != -1) postorder(tree, tree.at(idx).left);
    if (tree.at(idx).right != -1) postorder(tree, tree.at(idx).right);
    cout << ' ' << idx;
}

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

    int n;
    cin >> n;
    vector<node> tree(n);
    for (int i = 0; i < n; ++i) {
        int id, l, r;
        cin >> id >> l >> r;
        if (l != -1) {
            tree.at(id).left = l;
            tree.at(l).parent = id;
        }
        if (r != -1) {
            tree.at(id).right = r;
            tree.at(r).parent = id;
        }
    }
    for (int i = 0; i < n; ++i) {
        if (tree.at(i).parent == -1) {
            cout << "Preorder" << endl;
            preorder(tree, i);
            cout << endl;
            cout << "Inorder" << endl;
            inorder(tree, i);
            cout << endl;
            cout << "Postorder" << endl;
            postorder(tree, i);
            cout << endl;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
typedef long long int uli;
int main(){
  int k,s;
  int ans=0;
  cin>>k>>s;
  for(int a=0;a<=k;a++){
    for(int b=0;b<=k;b++){
      int c=s-a-b;
      if(0<=c && c<=k){
        ans++;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, x);
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

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

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

int main(void) {
  int a, b, c;
  cin >> a >> b >> c;
  ((b - a == c - b) ? (cout << "YES" << endl) : (cout << "NO" << endl));
  return 0;
}

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

cnt = 0

for i, b in enumerate(B):

    if b >= A[i]:
        cnt += A[i]
        b -= A[i]

        if b >= A[i+1]:
            cnt += A[i+1]
            A[i+1] = 0
        else:
            cnt += b
            A[i+1] -= b
    else:
        cnt += b
print(cnt)


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

int main(){
    int n;
    string s;
    cin >> n >> s;
    int a = 0, b = 0;
    rep(i,n) if(s[i] == 'R') a++; //境界が一番左の時
    int ans = a;
    rep(i,n){//境界の位置をひとつづつずらす 全通り
        if(s[i] == 'R') a--;//赤だったら変える必要がないので
        else b++;
        int now = max(a,b);
        ans = min(ans,now);
    }
    cout << ans << endl;
    return 0;
}

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

namespace ProgramingStudying2
{
    class Program
    {

        static void Main(string[] args)
        {
            var d = int.Parse(Console.ReadLine());
            if(d == 25)
            {
                Console.WriteLine("Christmas");
            }
            if (d == 24)
            {
                Console.WriteLine("Christmas Eve");
            }
            if (d == 23)
            {
                Console.WriteLine("Christmas Eve Eve");
            }
            if (d == 22)
            {
                Console.WriteLine("Christmas Eve Eve Eve");
            }

        }
    }
}


Measured memory_bytes: 27460
res = 0
a = []
a.append(list(map(int, input().split())))
a.append(list(map(int, input().split())))
a.append(list(map(int, input().split())))
for j in range(2):
  s = a[0][j] - a[0][j+1]
  t = a[1][j] - a[1][j+1]
  u = a[2][j] - a[2][j+1]
  if s == t and t == u:
    res = res + 1
for j in range(2):
  s = a[j][0] - a[j+1][0]
  t = a[j][1] - a[j+1][1]
  u = a[j][2] - a[j+1][2]
  if s == t and t == u:
    res = res + 1
if res == 4:
  print("Yes")
else:
  print("No")

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

int main() {
  int n, cnt = 0;
  cin >> n;
  
  for (int i = 1; i < n; i++) {
    for (int j = 1; j <= n/i; j++) {
        if ( i * j < n ) {
            cnt++;
        }
    }
   }
  
    cout << cnt << endl;
}


Measured memory_bytes: 3640
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = []
B = []
for i in range(M):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

L = [1] * N
for i in range(M):
    if H[A[i] - 1] == H[B[i] - 1]:
        L[A[i] - 1] = 0
        L[B[i] - 1] = 0
    elif H[A[i] - 1] > H[B[i] - 1]:
        L[B[i] - 1] = 0
    else:
        L[A[i] - 1] = 0
print(sum(L))


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

using namespace std;

int main(){
	long long int n,total=0;
	vector<long long int> v;

	cin>>n;

	for(int i=0;i<n;i++){
		long long int a;
		cin>>a;
		v.push_back(a);
	}


	sort(v.begin(),v.end());

	for(int i=0;i<n;i++){
		total+=v[i];
	}

	cout<<v[0]<<" "<<v[n-1]<<" "<<total<<endl;

	return 0;

}

Measured memory_bytes: 3268
#include "bits/stdc++.h"
using namespace std;

long gcd(long x, long y){
    long p1,p2;
    long tmp;
    if(x<y){
        p1 = x;
        p2 = y;
    }
    else{
        p1 = y;
        p2 = x;
    }
    while(1){
        tmp = p2%p1;
        if(tmp==0){break;}
        p2 = p1;
        p1 = tmp;
    }
    return p1;
}

long lcm(long x, long y){
    return x*y/gcd(x,y);
}

int main(){
    long n,m;
    cin >> n >> m;
    string s,t;
    cin >> s >> t;

    long l = lcm(m,n);
    long ans = l;

    long n_ = l/n;
    long m_ = l/m;

    for(long i=0;i<gcd(n,m);i++){
        long a = i*m_;
        long b = i*n_;
        if(s[a]!=t[b]){
            ans = -1;
            break;
        }
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

int main() {
    ll n;
    cin >> n;
    const int MAX = 12;
    ll num = 1;
    string ans = "";
    rep(i, MAX) {
        if (n/num == 0) continue;
        int m = (n/num)%26;
        if (m == 0) ans += 'z';
        else ans += (char)(m+'a'-1);
        n -= num;
        num *= 26;
    }
    reverse(all(ans));
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3596
import           Control.Monad

denominator = 10^9 + 7

main = do
    l <- getLine
    let n:k:_ = map read $ words l :: [Int]
    forM (solve n k) $ \a -> print $ a `mod` denominator

factorial x = factorials !! x

factorials = 1 : zipWith (*) factorials [1..]

combination n k = do
    let a = factorial n
    let b = factorial k
    let c = factorial (n - k)
    a `div` (b * c)

solve' n k i
    | x < i = 0
    | otherwise = do
        let a = combination x i
        let b = combination (k - 1) (i - 1)
        a * b
    where
        x = n - k + 1

solve n k = do
    let f = solve' n k
    map f [1..k]


Measured memory_bytes: 4476
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

int main() {
    int64_t n;
    cin >> n;

    vector<int64_t> a(n), b(n);
    for (auto&& aa : a) {
        cin >> aa;
    }
    for (auto&& bb : b) {
        cin >> bb;
    }

    vector<vector<int64_t>> dp(
            1uL << n, vector<int64_t>(n, numeric_limits<int64_t>::max()));
    for (auto k : irange(0uL, 1uL << n)) {
        bitset<18> bs(k);

        for (auto i : irange(0L, n)) {
            if (!bs[i]) {
                continue;
            }

            auto v = (bs.count() - 1 - i + 2 * n) % 2 == 0 ? a[i] : b[i];

            auto prev = (bs ^ decltype(bs)(1uL << i));
            if (prev.none()) {
                dp[k][i] = 0;
                continue;
            }
            for (auto j : irange(0L, n)) {
                if (dp[prev.to_ulong()][j] == numeric_limits<int64_t>::max()) {
                    continue;
                }

                auto v2 = (prev.count() - 1 - j + 2 * n) % 2 == 0 ? a[j] : b[j];

                if (v < v2) {
                    continue;
                }

                int64_t m = dp[prev.to_ulong()][j];
                for (auto l : irange(i + 1, n)) {
                    if (bs[l]) {
                        ++m;
                    }
                }

                if (m < dp[k][i]) {
                    dp[k][i] = m;
                }
            }
        }
    }

    auto m = *min_element(dp.back().begin(), dp.back().end());

    if (m == numeric_limits<int64_t>::max()) {
        cout << -1 << endl;
    } else {
        cout << m << endl;
    }
}

Measured memory_bytes: 47360