akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long int lint;

#define PI acos(-1)
#define INF64 1LL << 60
#define INF32 1 << 29
#define LIMIT(d_in, d_min, d_max) max(d_min, min(d_max, d_in))
#define all(a) (a).begin(), (a).end()
#define INV ((long long int)1000000007)

using namespace std;

vector<pair<int, int>> Factorization(int N)
{
	vector<pair<int, int>> factorization;

	int rest_N = N;
	for (int j = 2; j <= (int)sqrt(N); j++)
	{
		if (rest_N % j == 0)
		{
			int tmp = 0;
			for (; rest_N % j == 0;)
			{
				rest_N /= j;
				tmp++;
			}
			factorization.push_back(make_pair(j, tmp));
		}
		if (rest_N == 1)
			return factorization;
	}
	factorization.push_back(make_pair(rest_N, 1));

	return factorization;
}

void execute()
{
	int N;
	cin >> N;
	vector<int> prime(N + 1, 0);
	int count_3 = 0;
	int count_5 = 0;
	int count_15 = 0;
	int count_25 = 0;
	int count_75 = 0;

	for (int i = 2; i <= N; i++)
	{
		vector<pair<int, int>> fac = Factorization(i);

		for (int j = 0; j < fac.size(); j++)
		{
			prime[fac[j].first] += fac[j].second;
		}
	}

	for (int i = 2; i <= N; i++)
	{
		if ((3 - 1) <= prime[i])
			count_3++;
		if ((5 - 1) <= prime[i])
			count_5++;
		if ((15 - 1) <= prime[i])
			count_15++;
		if ((25 - 1) <= prime[i])
			count_25++;
		if ((75 - 1) <= prime[i])
			count_75++;
	}

	/*
	cout << count_3 << endl;
	cout << count_5 << endl;
	cout << count_15 << endl;
	cout << count_25 << endl;
	cout << count_75 << endl;
	*/

	int ans = 0;
	ans += count_5 * (count_5 - 1) * (count_3 - 2) / 2;
	ans += count_25 * (count_3 - 1);
	ans += count_15 * (count_5 - 1);
	ans += count_75;
	cout << ans << endl;
	return;
}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	execute();

	int stop;
	cin >> stop;

	return 0;
}

Measured memory_bytes: 256
import java.util.*;


public class Main {

    private static final int INF = Integer.MAX_VALUE;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = sc.nextInt();

        if(x >= a){
            System.out.println(10);
        }else{
            System.out.println(0);
        }
    }
}


Measured memory_bytes: 22228
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    int n, k;
    scanf("%d %d", &n, &k);
    int a[n];
    rep(i, 0, n){
        scanf("%d", &a[i]);
    }
    int cnt = 1;
    n -= k;
    k--;
    cnt += (n+k-1) / k;
    printf("%d", cnt);

    return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int t = scanner.nextInt();
		long sum = 0;
		int[] x = new int[n];
		for(int i=0;i<n;i++){
			x[i] = scanner.nextInt();
			if(i != 0){
				if(x[i-1] + t > x[i]){
					sum += x[i] - x[i-1];
				}else{
					sum += t;
				}
			}
		}
		sum += t;
		System.out.println(sum);

	}

}


Measured memory_bytes: 64492
S = gets.chomp


b = S[0..1].to_i
a = S[2..4].to_i

a_is_month = false
if a >= 1 && a <= 12
  a_is_month = true
end
b_is_month = false
if b >= 1 && b <= 12
  b_is_month = true
end

if a_is_month && b_is_month
  puts 'AMBIGUOUS'
elsif a_is_month
  puts 'YYMM'
elsif b_is_month
  puts 'MMYY'
else
  puts 'NA'
end




Measured memory_bytes: 1788
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String a = sc.nextLine();
        a = a.replace(" ", "");
        int num = Integer.parseInt(a);
        int n = (int)Math.sqrt(num);
        if(n*n==num) System.out.println("Yes");
        else System.out.println("No");
    }
}

Measured memory_bytes: 22612
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <functional>
#include <utility>
#include <queue>
#include <vector>
#include <string>
#include <stack>
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
typedef long long int ll;
const ll  MOD = 1000000007;
typedef pair<ll,ll> P;
const ll INF = 100100100100100100;
const ll V_MAX = 500;

ll d[V_MAX][V_MAX];
ll V;
ll cp_d[V_MAX][V_MAX];
ll ans;
bool f[V_MAX][V_MAX];
void warshall_floyd(){
  rep(k,V){
    rep(i,V){
      rep(j,V){
        if(!f[i][j] && i > j && i != k && j != k && d[i][j] == d[i][k] + d[k][j]){
          //cerr << i << " " << j << " " << k << endl;
          ans -= d[i][j];
          f[i][j] = true;
          f[j][i] = true;
        }
        d[i][j] = min(d[i][j],d[i][k] + d[k][j]);
      }
    }
  }
}

int main(){
  cin >> V;
  rep(i,V){
    rep(j,V){
      cin >> d[i][j];
      cp_d[i][j] = d[i][j];
      if(i>j) ans += d[i][j];
    }
  }
  warshall_floyd();
  rep(i,V){
    rep(j,V){
      if(d[i][j] != cp_d[i][j]){
        cout << "-1" << endl;
        return 0;
      }
    }
  }
  cout << ans << endl;
}


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

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

	int N, t[101], M, p[100], x[100];
	cin >> N;
	int sum = 0;
	for (int i = 1; i < N + 1; i++) {
		cin >> t[i];
		sum += t[i];
	}
	cin >> M;
	for (int i = 0; i < M; i++) {
		cin >> p[i] >> x[i];
	}
	for (int i = 0; i < M; i++) {
		cout << sum - t[p[i]] + x[i] << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

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

	if (A[A.length() - 1] == B[0] && B[B.length() - 1] == C[0]) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}


	
}


Measured memory_bytes: 3600
#include <iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<limits.h>
#include<queue>
#include<set>


#define MOD 1000000007
#define DEBUG 0


using namespace std;

long long int modpow(long long int a, int n) {

	if (n == 0)return 1;
	if (n == 1) return a;

	long long int wk = modpow(a, n / 2);

	long long int ret = 0;
	if (n % 2 == 0) {
		ret = 1;
	}
	else {
		ret = a;
	}

	return (((ret * wk) % MOD) * wk) % MOD;

}

long long int gcd(long long int a, long long int b) {
	long long int tmp;
	if (a < b) {
		tmp = a;
		a = b;
		b = tmp;
	}

	long long int r = a % b;

	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}

	return b;
}

long long int lcm(long long int a, long long int b) {

	long long int wk_int;

	wk_int = (a * b) % MOD;
	
	long long int ret;

	ret = (wk_int * modpow(gcd(a, b), MOD - 2)) % MOD;

	return ret;

}

bool isPrime(int n) {
	if (n == 1)return false;
	if (n == 2)return true;

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

	return true;
}



bool comp(const pair<long long int, vector<int>> a, const pair<long long int, vector<int>> b) {
	if (a.first != b.first) {
		return a.first < b.first;
	}
	else {
		return a.second < b.second;
	}

}





int solve(string str) {

	if (str == "") {
		return solve("3") + solve("5") + solve("7");
	}
	
	long long int num = stoi(str);

	if (num >= 1e9)return 0;
	
	



}
	





int main(){

	int n;
	cin >> n;
	int ans = 0;


	if (n < 2) {
		ans = 1;
	}
	else if (n < 4) {
		ans = 2;
	}
	else if (n < 8) {
		ans = 4;
	}
	else if (n < 16) {
		ans = 8;
	}
	else if (n < 32) {
		ans = 16;
	}
	else if (n < 64) {
		ans = 32;
	}
	else {
		ans = 64;
	}
	
	cout << ans << endl;

	return 0;
}



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

int main() {
    ll n, a, b,ret=0;
    cin >>n>>a>>b;
    ll tmp = n / (a+b); // 0 < (a+b) <= 10^18
    ret = a * tmp;
    ret += ((n - tmp * (a+b))>=a) ? a : n - tmp * (a+b);
    /*
    while (n>0) {
        ret += (n>=a) ? a : n;
        n = n - a - b;
    }
    */
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
struct point{int x;int y;};
int i,j,k,count1=0,count2=0;

int main(){
    int n,a,b,i=0;
    string result="nothing";
    cin>>n>>a>>b;
    while(result=="nothing"){
        i++;
        if(b!=a+1){
            a++;
        }else{
            a--;
            if(a==0)result="Borys";
        }
        if(a!=b-1){
            b--;
        }else{
            b++;
            if(b==n+1)result="Alice";
        }
        if(i>=2*n)result="DRAW";
    }
    cout<<result<<endl;
}

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

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

	int N, M;
	scanf("%d %d", &N, &M);
	if (N >= M) {
		printf("0");
		return 0;
	}

	vector<int> A(M);
	for (int i = 0; i < M; i++) {
		scanf("%d", &A[i]);
	}

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

	vector<int> B(M - 1);
	for (int i = 0; i < M - 1; i++) {
		B[i] = A[i + 1] - A[i];
	}
	sort(B.begin(), B.end());

	int result = A[M - 1] - A[0];
	// printf("%d\n", result);
	for (int i = 0; i < N - 1; i++) {
		result -= B[M - 2 - i];
	}
	printf("%d", result);
	return 0;
}

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

fn main() {
    let i = stdin();
    let mut o = Vec::new();
    run(&mut i.lock(), &mut o);
    stdout().write_all(&o).unwrap();
}

fn run<R: BufRead, W: Write>(i: &mut R, o: &mut W) {
    let hwd = read_vec(i);
    let (h, w, d) = (hwd[0], hwd[1], hwd[2]);
    let wh = w * h;
    let mut a_to_xy = vec![(0, 0); wh + 1];
    for y in 0..h {
        let a: Vec<usize> = read_vec(i);
        for x in 0..w {
            a_to_xy[a[x]] = (x, y);
        }
    }
    fn abs_sub(x0: usize, s1: usize) -> usize {
        (x0 as isize - s1 as isize).abs() as usize
    }

    let mut mps = vec![0; wh + 1];
    for i in 1..wh + 1 - d {
        let xy0 = a_to_xy[i];
        let xy1 = a_to_xy[i + d];
        mps[i + d] = mps[i] + abs_sub(xy0.0, xy1.0) + abs_sub(xy0.1, xy1.1);
    }
    std::mem::drop(a_to_xy);

    let q = read(i);
    for _ in 0..q {
        let lr = read_vec(i);
        let (l, r): (usize, usize) = (lr[0], lr[1]);
        let mp = mps[r] - mps[l];
        writeln!(o, "{}", mp).unwrap();
    }
}

fn read_line<R: BufRead>(i: &mut R) -> String {
    let mut line = String::new();
    i.read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn read<T: FromStr, R: BufRead>(i: &mut R) -> T {
    read_line(i).parse().ok().unwrap()
}
fn read_vec<T: FromStr, R: BufRead>(i: &mut R) -> Vec<T> {
    read_line(i)
        .split(' ')
        .map(|x| x.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 6396
#include <stdlib.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmin(T& a, T b) {
    if (a >= b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;   
}

int main() {
    int s;
    cin>>s;
    cout<<s*s*s<<endl;
}





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

int main(){
	
	int N, M, k, l, menor, x, y;

	scanf("%d %d", &N, &M);

	int m1[N][3], m2[M][3], v[M];

	for (int i = 0; i < N; ++i)
		scanf("%d%d", &m1[i][0], &m1[i][1]);

	for (int i = 0; i < M; ++i)
		scanf("%d%d", &m2[i][0], &m2[i][1]);

	for (int i = 0; i < N; ++i){
		x=m1[i][0]-m2[0][0];
		y=m1[i][1]-m2[0][1];
		if(x<0) x = x*(-1);
		if(y<0) y = y*(-1);
		k = x+y;
		menor = 0;
		for (int j = 1; j < M; ++j){
			x=m1[i][0]-m2[j][0];
			y=m1[i][1]-m2[j][1];
			if(x<0) x = x*(-1);
			if(y<0) y = y*(-1);
			l = x+y;
			if (k > l){
				menor = j;
				k=l;
			}
		}
		printf("%d\n",menor+1);
	}


	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 1000000000000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { int to, cost; };

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

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

// mod. m での a の逆元 a^{-1} を計算するよ！
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}


//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b, ll int m) {
	ll int ans = 1;
	for (ll int i = 0; i < b; i++) {
		ans *= a - i;
		ans %= m;
	}
	for (ll int i = 1; i <= b; i++) {
		ans *= modinv(i, m);
		ans %= m;
	}
	return ans;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}
	int size(int a) {
		return par[root(a)];
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

int b_s(vector<llint>& a, llint key) {
	int left = -1;
	int right = a.size();
	while (right - left > 1) {
		int mid = left + (right - left) / 2;
		if (a[mid] > key)right = mid;
		else left = mid;
	}
	return right;
}
int main() {
	int n;
	cin >> n;
	hei(llint) a(n);
	rep(i, 0, n)cin >> a[i];
	sort(a.begin(), a.end());
	reverse(a);
	llint ans = 0;
	priority_queue<llint,vector<llint>> queue;
	queue.push(a[1]);
	ans += a[0];
	rep(i, 2, n) {
		if (i == 2) {
			ans += queue.top();
			queue.push(a[i]);
			queue.push(a[i]);
		}
		else {
			ans += queue.top();
			queue.pop();
			queue.push(a[i]);
			queue.push(a[i]);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6940
from collections import Counter
from copy import deepcopy
def main():
    s = list( input())
    N = len(s)
    C = Counter(s)
    ans = 100
    for i in range(26):
        S = deepcopy(s)
        a = chr( ord("a") + i)
        t = N
        c = C[a]
        if c == 0:
            continue
        # print(a, t, c)
        while t > c:
            t -= 1
            for j in range(t):
                if S[j] != a and S[j+1] == a:
                    S[j] = a
                    c += 1
            if S[t] == a:
                c -= 1
        # print( a, N-t)
        if N-t < ans:
            ans = N-t
    print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 3444
// abc047_b
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    int W, H, N;
    cin >> W >> H >> N;

    vector<vector<int>> S(H, vector<int>(W, 1));

    REP(k, N){
        int x, y, a;
        cin >> x >> y >> a;
        if (a == 1){
            REP(i, H) REP(j, x) S[i][j] = 0;
        } else if (a == 2){
            REP(i, H) REPN(j, x, W) S[i][j] = 0;
        } else if (a == 3){
            REP(i, y) REP(j, W) S[i][j] = 0;
        } else if (a == 4){
            REPN(i, y, H) REP(j, W) S[i][j] = 0;
        }
    }

//    REP(i, H) print(S[i]);

    int ans = 0;
    REP(i, H) REP(j, W){
        ans += S[i][j];
    }
    print(ans);


    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 5001;
const int INF = 1e18 + 7;
int n, A, B;
int a[N];
int p[N][N];
int sum(int x1, int y1, int x2, int y2) {
    if (x2 < x1 || y2 < y1) return 0;
    return p[x2][y2] - p[x2][y1 - 1] - p[x1 - 1][y2] + p[x1 - 1][y1 - 1];
}   
int dp[N];
signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    cin >> n >> A >> B;
    int R = A; 
    int L = B;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        p[i][a[i]] = 1;
    }   
    bool sorted = 1;
    for (int i = 1; i <= n - 1; ++i) {
        sorted &= a[i] < a[i + 1];
    }   
    if (sorted) {
        cout << "0\n";
        exit(0);
    }   
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= n; ++j) {
            p[i][j] += p[i - 1][j] + p[i][j - 1] - p[i - 1][j - 1];
        }   
    }   
    for (int i = 1; i <= n; ++i) {
        dp[i] = 0;
        for (int j = 1; j < i; ++j) {
            if (a[j] < a[i]) {
                dp[i] += min(L, R);
            }   
            else {
                dp[i] += R;
            }   
        }
        for (int j = 1; j < i; ++j) {
            if (a[j] < a[i]) {
                dp[i] = min(dp[i], dp[j] + sum(j + 1, a[j], i - 1, a[i]) * min(L, R) + sum(j + 1, 1, i - 1, a[j]) * L + sum(j + 1, a[i], i - 1, n) * R);
            }   
        }   
    }  
    int ans = INF;
    for (int i = 1; i <= n; ++i) {
        int nn = dp[i];
        for (int j = i + 1; j <= n; ++j) {
            if (a[j] < a[i]) {
                nn += L;
            }   
            else {
                nn += min(L, R);
            }   
        }   
        ans = min(ans, nn);
    }   
    cout << ans << '\n';
}   

Measured memory_bytes: 195712
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b,c = LI()

    return min(c,b//a)



print(main())




Measured memory_bytes: 5460
#include<iostream>
#include<string>
using namespace std;
bool judge_even_or_not(int a[]) {
	for (int i(0); i < 26; i++) {
		if (a[i] % 2 == 1)return false;
	}
	return true;
}
int main(void) {
	//入力
	string w;
	cin >> w;
	int cnt[26];
	//cntを初期化
	for (int i(0); i < 26; i++) {
		cnt[i] = 0;
	}
	//a~zの個数をカウント
	for (int i(0); i < w.size(); i++) {
		cnt[(int)w[i] - 97]++;
	}
	//処理
	if (judge_even_or_not(cnt))cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pi acos(-1)
#define pb push_back
using namespace std;
typedef pair<int,int> p;
typedef long long ll;

int main(){
	int n;
	cin>>n;
	cout<<"ABC"<<n<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()

int main() {
    int n,a=0,b=0,c=0;
    cin>>n;
    vector<string>p(n);
    rep(i,n){
        cin>>p[i];
        if(p[i]=="AC")a++;
        else if(p[i]=="WA")b++;
        else if(p[i]=="TLE")c++;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<b<<endl;
    cout<<"TLE x "<<c<<endl;
    cout<<"RE x "<<n-a-b-c<<endl;
    
    
	return 0;
}


Measured memory_bytes: 6340
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T>
using vec = std::vector<T>;

int main() {
    int N;
    cin >> N;
    vec<int> A(N + 2);
    A[0]     = 0;
    A[N + 1] = 0;
    rep(i, N) cin >> A[i + 1];
    ll sum = 0;
    for (int i = 1; i <= N + 1; ++i) {
        sum += abs(A[i] - A[i - 1]);
    }
    for (int i = 1; i <= N; ++i) {
        if (A[i] >= A[i - 1] && A[i + 1] >= A[i]) {
            cout << sum << endl;
        } else if (A[i - 1] >= A[i] && A[i] >= A[i + 1]) {
            cout << sum << endl;
        } else {
            int dec = abs(A[i - 1] - A[i]) + abs(A[i] - A[i + 1]);
            int pul = abs(A[i - 1] - A[i + 1]);
            cout << sum - dec + pul << endl;
        } 
    }
}


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

signed main() {
	ios_base::sync_with_stdio(0);

	int a, b, c, k;
	cin >> a >> b >> c >> k; 

	int cnt = 0;
	while (b <= a) {
		b <<= 1;
		cnt++;
	}
	while (c <= b) {
		c <<= 1;
		cnt++;
	}
	if (cnt <= k) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
	return 0;
}

Measured memory_bytes: 3692
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
n = int(input())
b = [int(input()) for i in range(n)]

p1 = [False]*3
p2 = [False]*3
p3 = [False]*3

for i in b:
  if i in a1:
    p1[a1.index(i)] = True
  if i in a2:
    p2[a2.index(i)] = True
  if i in a3:
    p3[a3.index(i)] = True
    
if all(p1) or all(p2) or all(p3):
  print("Yes")
  exit()
  
for i in range(3):
  if all([p1[i],p2[i],p3[i]]):
    print("Yes")
    exit()
  
if all([p1[0],p2[1],p3[2]]):
  print("Yes")
  exit()
  
if all([p1[2],p2[1],p3[0]]):
  print("Yes")
  exit()
  
print("No")

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
using namespace std;
string s[101];
int n,l;
int main()
{
    cin>>n>>l;
    for(int i=1;i<=n;i++)
        cin>>s[i];
    sort(s+1,s+n+1);
    for(int i=1;i<=n;i++)
        cout<<s[i];
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG //エラーを出すためのおまじない
#include <bits/stdc++.h>
//#include <cstdlib>  // abs() for integer
#include <cmath>    // abs() for float, and fabs()
#include <math.h>
using namespace std;
#define coYES cout << "YES" << endl
#define coNO cout << "NO" << endl
#define coYes cout << "Yes" << endl
#define coNo cout << "No" << endl
#define coyes cout << "yes" << endl
#define cono cout << "no" << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  string s;
  cin >> s;
  map<char, int> alphabet;
  string alpha = "abcdefghijklmnopqrstuvwxyz";
  rep(i, 26) {
    alphabet[alpha.at(i)] = 0;
  }
  int size = s.size();
  rep(i, size) {
    alphabet.at(s.at(i))++;
  }
  bool flag = true;
  rep(i, 26) {
    if (alphabet.at(alpha.at(i)) == 0) {
      cout << alpha.at(i) << endl;
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "None" << endl;
  }
}


Measured memory_bytes: 3704
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {
//		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//		String W	 = in.readLine();
//		int num = Integer.parseInt(W.split(" ")[0]);

		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();

		String ans = "NG";

		for(int i = A;i<=B ; i++) {
			if(i%K ==0) {
				ans="OK";
				break;
		}


		}

		System.out.println(ans);



	}

	//	//二分探索
	//k <= num となる最小の配列要素kのインデックスを返す
	static private int binarySearch(long num, long[] orderedArray){
		int lowerBorder = -1;
		int upperBorder = orderedArray.length;
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedArray[mid]<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//二分探索
	//k <= num となる最小のList要素kのインデックスを返す
	static private int binarySearch(long num, ArrayList<Long> orderedList){
		int lowerBorder = -1;
		int upperBorder = orderedList.size();
		int mid;

		while(upperBorder - lowerBorder >1) {
			mid = (upperBorder + lowerBorder)/2;
			if(orderedList.get(mid)<=num) {
				lowerBorder = mid;
			}else {
				upperBorder = mid;
			}
		}
		return lowerBorder;
	}

	//aとbの最小公倍数を求める
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	public static long gcd(long a, long b) {
        return b == 0 ? a: gcd(b, a % b);
	}



}


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

using namespace std;

int main(int argc, char *argv[])
{
    int N;
    cin >> N;
    vector<int> q(N);
    vector<vector<long>> dp(N + 1, vector<long>(N + 1));
    for (int i = 0; i < N; i++) {
        cin >> q[i];
//        dp[i][i] = q[i];
    }
    vector<long> S(N);
    S[0] = q[0];
    for (int i = 1; i < N; i++) {
        S[i] = S[i - 1] + q[i];
    }
    auto sum = [&](int i, int j) -> long {
        if (i > j) return 0;
        return S[j] - (i == 0 ? 0 : S[i - 1]);
    };
    for (int i = N - 1; i >= 0; i--) {
        for (int j = i; j < N; j++) {
            dp[i][j] = max(q[i] + sum(i + 1, j) - dp[i + 1][j],
                           q[j] + sum(i, j - 1) - (j == 0 ? 0 : dp[i][j - 1]));
        }
    }
    cout << 2 * dp[0][N - 1] - sum(0, N - 1) << endl;
    return 0;
}


Measured memory_bytes: 70784
#include <iostream>
#include <vector>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;


int main(){
  int n;
  cin >> n;
  vector<vector<int>> v(n);
  int ans = 0;
  rep(i, n){
    int a;
    cin >> a;
    a--;
    v[a].push_back(i);
    for(auto m: v[i]){
      if(m == a) ans++;
    }
  }
  cout << ans << endl;
}



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

int main(){
    string s;
    while(true){
        cin >> s;
        if(s[0] == '0') break;
        else {
            int ans = 0;
            for(int i = 0; i < s.size(); i++){
                ans += s[i] - '0';
            }
            cout << ans << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3212
//! 尺卂乃卂.卂ﾌ乇乇ㄒ
#include<bits/stdc++.h>
//#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
//Using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> Ordered_set;

#define ll              long long
#define int             long long
#define ld             long double
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define vii             vector<vi>
#define vip            vector<pii>
#define mii             map<int,int>
#define mip             map<pair<int,int>,int>
#define mic             map<char,int> 
#define all(v)          v.begin(),v.end()  
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define lb(x)           (x&(-x))
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
#define itr(it,v)          for(auto it:v)
#define show(arr,n)     for(int i=0;i<n;i++) cout<<arr[i]<<" "; cout<<"\n";
#define fi(i,n)         for(int i=0;i<n;i++)
#define fir(i,k,n)       for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ff               first 
#define ss               second
#define deb(x) cout << #x << "=" << x << endl
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define check(x) (x && cout<<"Yes\n")||(cout<<"No\n");
#define fin(s)          freopen(s,"r",stdin);  
#define fout(s)         freopen(s,"w",stdout);

const ld pi = 3.141592653589793238462643383279502884;
const int xd[]={-1,0,1,0};
const int yd[]={0,-1,0,1};
int XX[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
int YY[] = { -1, 0,  1, -1, 1, -1, 0, 1 };

int expo(int a,int b,int m);
int mmi(int a,int m);
void ipgraph(int m);

const int N=5*(1e5)+10;
vii adj(N);
int a[N];

void  solve(){

}
int32_t main()
{
    FIO
    int n,k; cin>>n>>k;
    fi(i,n){
        cin>>a[i];
    }
    double prev=0;
    double sumz=0.0;
    for(int i=0;i<n;i++){
        sumz+=log(a[i]);
        if(i>=k){
            sumz-=log(a[i-k]);
            if(sumz>prev) cout<<"Yes\n";
            else cout<<"No\n";
            prev=sumz;
        }
        else prev=sumz;
    }
    return 0;

}

void ipgraph(int m){
    int i, u, v;
    while(m--){
          cin>>u>>v;
         u--, v--;
    adj[u].pb(v);
    adj[v].pb(u);
    }
}
int expo(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return a;
    int val=(expo(a,b/2,m)*expo(a,b/2,m))%m;
    if(b & 1) return (val*a)%m;
    else return val;
}
int mmi(int a,int m){
    return expo(a,m-2,m);
}

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

constexpr int64_t INF = 1'010'000'000'000'000'017LL;
constexpr int64_t MOD = 1'000'000'007LL;
constexpr double EPS = 1e-12;
constexpr double PI = 3.14159265358979323846;

#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

void findFactors(uint64_t number, list<uint64_t> &factors){
  uint64_t val = sqrt(number);
  for (uint64_t i = 2; i <= val; i++){ // 他の素数で割っていく
    while (number % i == 0){
      number /= i;
      factors.push_back(i);
	}
  }
  if(number != 1){
    factors.push_back(number);
  }
}

signed main() {
  uint64_t n;
  cin >> n;
  list<uint64_t> factors;
  findFactors(n,factors);
  
  uint64_t totalCount = 0;
  while(factors.size()>0) {
  	bool isFirst = true;
    uint64_t val = 0;
    uint64_t factCount = 0;
  	for(auto factor: factors){
      if(isFirst){
        val = factor;
        isFirst = false;
        factCount++;
      }
      else if(val==factor){
        factCount++;
      }
  	}
    for(int j=0;j<factCount;j++){
      factors.pop_front();
    }
    uint64_t currCount = 1;
    while(factCount>=currCount){
      for(int j=0;j<currCount;j++){
      	n /= val;
      	factCount--;
      }
      totalCount++;
      currCount++;
    }
  }
  cout << totalCount << endl;
  return 0;
}

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

int gcd(int x, int y) {
  if (x<y) swap(x,y);
  while (y != 0) {
    x %= y;
    swap(x, y);
  }
  return x;
}

int main() {
  int N;
  cin >> N;
  //vector<vector<char>> d(H, vector<char>(W));
  vector<int> A(N+1);
  for (int i=1; i<=N; i++) cin >> A.at(i);
  vector<int> L(N+1);
  L.at(0)=0;
  vector<int> R(N+2);
  R.at(N+1)=0;
  for (int i=1; i<=N; i++) {
    L.at(i) = gcd(L.at(i-1), A.at(i));
    //cout << i << ":" << L.at(i) << endl;////
  }
  for (int i=N; i>0; i--) {
    R.at(i) = gcd(R.at(i+1), A.at(i));
    //cout << i << ":" << R.at(i) << endl;////
  }
  int c=0;
  for (int i=1; i<=N; i++) {
    c=max(c, gcd(L.at(i-1), R.at(i+1)));
    //cout << i << ":" << c << endl;////////
  }
  cout << c << endl;
  return 0;
}


Measured memory_bytes: 1408
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

n = int(ri())
dic = {'AC': 0,'WA': 0,'TLE': 0,'RE': 0}
for i in range(n):
    s = ri()
    dic[s]+=1
print('AC x '+str(dic['AC']))
print('WA x '+str(dic['WA']))
print('TLE x '+str(dic['TLE']))
print('RE x '+str(dic['RE']))

Measured memory_bytes: 69856
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
signed main(){
  int a;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  int ans=10000000000;
  rep1(i,100){
    int t=0;
    rep(j,a){
  t+=pow(b[j]-i,2);
  }
    chmin(ans,t);
    }
  cout<<ans<<endl;
}

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

struct Card {
	char suit, value;
};
// ???????????????
void bubble(struct Card A[], int n) {
	// ?????°??????????????§?????????
	int flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			// ?????¢???????????????????´?
			if (A[j].value < A[j - 1].value) {
				swap(A[j], A[j - 1]);
				flag = 1;
			}
		}
	}
}
// ???????????????
void selection(struct Card A[], int n) {
	for (int i = 0; i < n; i++) {
		int minj = i;
		for (int j = i; j < n; j++) {
			if (A[j].value < A[minj].value)
				minj = j;
		}
		if (i != minj)
			swap(A[i], A[minj]);
	}
}
// ???????????????????¨?????????????????????????????????±????????¶?????????????????\?????????????¨???????
bool isStable(struct Card C1[], struct Card C2[], int n) {
	for (int i = 0; i < n; i++) {
		if (C1[i].suit != C2[i].suit)
			return false;
	}
	return true;
}
// ?????°??????
void print(struct Card C[], int n) {
	for (int i = 0; i < n; i++) {
		printf("%c%c%c", C[i].suit, C[i].value, i == n - 1 ? '\n' : ' ');
	}
}
int main() {
	Card C1[100], C2[100];
	int n;
	
	scanf("%d", &n);
	getchar();
	for (int i = 0; i < n; i++) {
		scanf("%c%c", &C1[i].suit, &C1[i].value);
		getchar();
		C2[i] = C1[i];
	}
	// ??????C1??°???????????????????????????C2??°??????????????????????????¶?????????????????????????????±???
	// ???????????\???????????????????¨????
	bubble(C1, n);
	selection(C2, n);

	print(C1, n);
	printf("Stable\n");
	print(C2, n);
	if (isStable(C1, C2, n))
		printf("Stable\n");
	else
		printf("Not stable\n");

	return 0;
}

Measured memory_bytes: 3228
N=int(input())
S=input()
cnt_max=0

for i in range(1,N-1):
  cnt=0
  A=set(S[:i])
  B=S[i:]
  for a in A:
    if a in list(B):
      cnt+=1
  if cnt_max<cnt:
    cnt_max=cnt

print(cnt_max)

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

using namespace std;

string temp = ".#";

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

  string Low, High;
  bool left = false;
  bool right = false;

  for(char c : temp) {
    for(char d : temp) {
      for(char e : temp) {
        for(char f : temp) {
          string U = Low + string(1, c) + string(1, d);
          string E = High + string(1, e) + string(1, f);
          cout << U << endl;
          cout << E << endl;
          char cc;
          cin >> cc;
          if(cc == 'T') {
            Low = U;
            High = E;
            goto foo;
          }
        }
      }
    }
  }
  while(Low.size() < N) {
    if(!left) {
      for(char c : temp) {
        for(char e : temp) {
          string U = Low + string(1, c);
          string E = High + string(1, e);
          cout << U << endl;
          cout << E << endl;
          string cc;
          cin >> cc;
          if(cc == "T") {
            Low = U;
            High = E;
            goto foo;
          } else if(cc == "end") {
            return (0);
          }
        }
      }
    }
    left = true;

    if(!right) {
      for(char c : temp) {
        for(char e : temp) {
          string U = string(1, c) + Low;
          string E = string(1, e) + High;
          cout << U << endl;
          cout << E << endl;
          string cc;
          cin >> cc;
          if(cc == "T") {
            Low = U;
            High = E;
            goto foo;
          } else if(cc == "end") {
            return (0);
          }
        }
      }
    }
    foo:;
  }
}


Measured memory_bytes: 596
#include <iostream>
#include <map>
#include <queue>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#pragma warning (disable: 4996)

string S, T, U; int A, B;

int main() {
	cin >> S >> T;
	cin >> A >> B;
	cin >> U;
	if (S == U) A--;
	if (T == U) B--;
	cout << A << " " << B << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n,c,a,b;
  cin>>n;
  cin>>c;
  b=0;
  for(int i=0;i<c;i++){
    cin>>a;
    b=b+a;
  }
  a=b/(n+1);
  if(b%(n+1)!=0)
    a=a+1;
  cout<<a<<endl;
  return(0);
}

    



Measured memory_bytes: 3104
Sstr = list(input())
l = len(Sstr)
final_ans = 0
for i in range(2 ** (l-1)):
    ans = list(Sstr[0])
    for j in range(l - 1):
        if (i >> j) & 1:
            ans.append('+')
            ans.append(Sstr[j+1])
        else:
            ans.append(Sstr[j + 1])
    final_ans += eval(''.join(ans))
print(final_ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(void){
   ll H;
   cin >> H;
   ll cnt=0;
   while(H>0){
       H-=pow(2,cnt);
       cnt++;
   }
   
   
   ll ans;
   ans=pow(2,cnt)-1;
   cout << ans << endl;
}


Measured memory_bytes: 3992
#pragma region kyomukyomupurin

/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-05-01 15:26:42
 **/

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

using namespace std;

using int64 = long long;

template <class T>
using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int flag = 0;
  for (auto e : vec) os << (flag++ ? ", " : "{") << e;
  return os << (vec.empty() ? "{}" : "}");
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int flag = 0;
  for (auto e : st) os << (flag++ ? ", " : "{") << e;
  return os << (st.empty() ? "{}" : "}");
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int flag = 0;
  for (auto e : mp) os << (flag++ ? ", " : "{") << e;
  return os << (mp.empty() ? "{}" : "}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

#pragma endregion kyomukyomupurin

class Combination {
 public:
  static constexpr int mod_ = 1000000007;
  static constexpr int n_ = 2000 + 5;

  Combination() { build(); }

  std::array<int64, n_> fact_;
  std::array<int64, n_> inv_;
  std::array<int64, n_> finv_;

  // return nCk
  int64 get(int n, int k) const noexcept {
    if (n < k || n < 0 || k < 0) return 0;
    return fact_[n] * (finv_[k] * finv_[n - k] % mod_) % mod_;
  }

 private:
  void build() noexcept {
    fact_[0] = 1;
    fact_[1] = 1;
    finv_[0] = 1;
    finv_[1] = 1;
    inv_[1] = 1;
    for (int i = 2; i < n_; ++i) {
      fact_[i] = fact_[i - 1] * i % mod_;
      inv_[i] = mod_ - inv_[mod_ % i] * (mod_ / i) % mod_;
      finv_[i] = finv_[i - 1] * inv_[i] % mod_;
    }
  }
};

Combination kyomu;

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

  int n, k; cin >> n >> k;

  cout << kyomu.get(n + k - 1, n) << endl;

  return 0;
}


Measured memory_bytes: 3260
#include <iostream>
#include <numeric>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <iomanip>
#include <cmath>

using namespace std;
typedef long long ll;

double distance(double xi, double yi, double xj, double yj) {
    return sqrt((xi - xj) * (xi - xj) + (yi - yj) * (yi - yj));
}

int main() {
    int N;
    vector<double> X(N), Y(N);
    cin >> N;
    vector<int> range_n(N);
    iota(range_n.begin(), range_n.end(), 0);
    for (int i = 0; i< N; i++) {
        cin >> X[i] >> Y[i];
    }

    double ans = 0; int c = 0;
    do {
        c++;
        for (int i = 1; i < N; i++) {
            int city1 = range_n[i-1];
            int city2 = range_n[i];
            ans += distance(X[city1], Y[city1], X[city2], Y[city2]);
        }
    } while (next_permutation(range_n.begin(), range_n.end()));
    cout << std::setprecision(12) << ans / c << endl;
}

Measured memory_bytes: 768
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.StringTokenizer;
class Graph {
    private int v;
    private LinkedList<Integer>[] adj_lists;
    private int[] maxLens;
    //node starts from 1;
    Graph (int v){
        this.v = v;
        adj_lists = new LinkedList[v + 1];
        maxLens = new int[v + 1];
        for (int i = 1; i < v + 1; i++){
            adj_lists[i] = new LinkedList<Integer>();
            maxLens[i] = -1;
        }
    }

    public void addEdge(int source, int dest){
        adj_lists[source].add(dest);
        //adj_lists[dest].add(source);
    }

    public LinkedList<Integer> getAdjs(int node){
        return adj_lists[node];
    }

//    public boolean isEnd(int node){
//        return adj_lists[node].isEmpty();
//    }

    public int DFS(int node){

        if (maxLens[node] != -1){
            return maxLens[node];
        }else{
            int maxlen = 0;
            for (int child : getAdjs(node)){
              maxlen = Math.max(maxlen, 1 + DFS(child));
          
            }
            maxLens[node] = maxlen;
            return maxlen;
        }
    }

    public int findLongestPath(){
        int maxLen = 0;
        for (int i = 1; i < adj_lists.length; i++ ){

            maxLen = Math.max(DFS(i),maxLen);
        }
        return maxLen;
    }

}

public class Main{




 public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st;
        PrintWriter pw = new PrintWriter(System.out);
 
        st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
 
        Graph g = new Graph(n);
 
        for(int i=0 ; i<m ; i++) {
            st = new StringTokenizer(br.readLine());
            int u = Integer.parseInt(st.nextToken());
            int v = Integer.parseInt(st.nextToken());
            g.addEdge(u, v);
        }
 
        int ans = g.findLongestPath();
        pw.print(ans);
        
        
        
        
        
        
        
        pw.flush();
        pw.close();
    }

}


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

using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;


int32_t main() {
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    
    
    ini(n);
    ini(n1);
    vi x;
    vi x1;
    FOR(i,0,n){
        ini(morty);
        ini(morty1);
        x.push_back(morty);
        x1.push_back(morty1);
    }
    sort(all(x1),greater<int>());
    int tmp = *max_element(all(x));
    int tmp1 = 0;
    FOR(i,0,n){
        if(x1[i]<=tmp)break;
        n1-=x1[i];
        tmp1++;
        if(n1<=0){
            out(tmp1);
            return 0;
        }
       // out(n1);
    }
    out((n1-1)/tmp+1+tmp1);
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}


Measured memory_bytes: 2036