akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cctype>
#include <queue>
#include <map>
#include <set> 
#include <bitset>
#include <cmath>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)

int main () {
    
    string s; cin >> s;
    int n = s.length(); 

    if(s[0] != 'A') {
        cout << "WA" << endl;
        return 0;
    } 

    if(!islower(s[1]) || !islower(s[n-1])) {
        cout << "WA" << endl;
        return 0;
    } 

    bool flag = true;
    int c = 0;
    for (int i = 2; i < n-1; i++) {
        if(s[i] == 'C') {
            c += 1;
        } else if(!islower(s[i])) {
            cout << "WA" << endl;
            return 0;
        } 
    }
    
    if(c != 1) {
        cout << "WA" << endl;
        return 0;
    } else {
        cout << "AC" << endl;
        return 0;
    } 
}





Measured memory_bytes: 256
import fractions
from functools import reduce

N, X = map(int, input().split())
if N == 1:
    x = abs(X - int(input()))
    print(x)
else:
    x = list(map(int, input().split()))
    x = list(map(lambda i: abs(X - i), x))
    print(reduce(fractions.gcd, x))

Measured memory_bytes: 16280
#!/usr/bin/env ruby

require 'set'

class Hash
  def push(key, value)
    self[key] = [] if self[key] == nil
    self[key].push(value)
  end
end

class Array
  def lower_bound(value)
    left = -1;
    right = self.length;
    while left + 1 < right
      mid = left + (right - left) / 2;
      if self[mid] >= value
        right = mid
      else
        left = mid
      end
    end
    right
  end

  def unique
    res = [self.first]
    each_cons(2) do |a, b|
      if a != b
        res.push(b)
      end
    end
    res
  end
end

def get_ints
  gets.chomp.split.map(&:to_i)
end

def get_ints_minus_one
  get_ints.map { |x| x - 1 }
end

def get_int
  gets.chomp.to_i
end

A, B = get_ints

if A * B % 2 == 0
  puts 'No'
else
  puts 'Yes'
end


Measured memory_bytes: 14444
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
using namespace std;

typedef long long int ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;
using namespace std;

string s;
int main() {
    //freopen("input.txt", "r", stdin) ;
    //freopen("output.txt", "w", stdout) ;
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL) ;
    cin>>s;
    int maxv=0;
    for(int i=0;i<s.length();i++){
        if(s[i]=='R'){
        int j=i;
        for(;j<s.length() && s[j]=='R';j++);
        maxv=j-i;
        i=j;
        }
    }
    cout<<maxv;
    return 0;
}




Measured memory_bytes: 3624
#include <stdio.h>
int main(){
	int n,k,x,y,sum;
	scanf("%d %d %d %d", &n, &k, &x, &y);
	if(n>k) sum=k*x+(n-k)*y;
	else sum=n*x;
	printf("%d\n", sum);	
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define all(x)  (x).begin(), (x).end()
using namespace std;

int main(){
  vector<int> vec{0, 111+1, 222+1, 333+1, 444+1, 555+1, 666+1, 777+1, 888+1, 999+1};
  int n;
  cin >> n;
  cout << (*upper_bound(all(vec), n) )-1 << endl;
  return 0;
}


Measured memory_bytes: 256
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n,k = m()

a = l()

for i in range(k,n):
	if a[i] > a[i-k]:
		print("Yes")
	else:
		print("No")


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

using namespace std;
using ll = long long;

int main(int argc, const char *argv[]) {
  ll x, ans = 0;
  cin >> x;

  vector<ll> cnts(x + 1, 0);
  for (ll i = 1; i <= x; ++i) {
    for (ll j = i; j <= x; j += i) {
      cnts[j]++;
    }
  }

  for (int i = 1; i <= x; ++i) {
    ans += i * cnts[i];
  }

  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 81324
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using static System.Math;

class P
{
    static void Main()
    {
        long[] nmd = Console.ReadLine().Split().Select(long.Parse).ToArray();
        //差ひとつ分がその数になる確率。(/n^2)
        Console.WriteLine(((double)((nmd[0] - nmd[2]) * (nmd[2] == 0 ? 1 : 2) * (nmd[1] - 1))) / (nmd[0] * nmd[0]));
    }
}

Measured memory_bytes: 13268
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#define mp make_pair
#define pb push_back
using namespace std;

namespace Header_Template {
  typedef long long li;
  template<class T>inline void read(T &x) {
    x = 0;
    T tmp = 1;
    char c = getchar();
    while ((c < '0' || c > '9') && c != '-') c = getchar();
    if (c == '-') tmp = -1, c = getchar();
    while (c >= '0' && c <= '9')
      x = (x << 1) + (x << 3) + c - '0', c = getchar();
    x *= tmp;
  }
  template<class T>inline void Max(T &x, T y) {
    if (y > x) x = y;
  }
  template<class T>inline void Min(T &x, T y) {
    if (y < x) x = y;
  }
}
using namespace Header_Template;

const int N = 3e5 + 10;
int n, a[N];
vector<pair<int, int> > g;
vector<int> tmpl, tmpr;

int main(void) {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]);
  for (int l = 1; l <= n;) {
    if (a[l] == l) {
      ++l;
      continue;
    }
    int pos = l;
    for (int r = l; r + 2 <= n; r += 2, pos = r)
      if (a[r + 1] != r + 1 || a[r + 2] == r + 2) break;
    g.pb(mp(l, pos));
    l = pos + 1;
  }
  bool ans = 1;
  for (pair<int, int> now : g) {
    int l = now.first, r = now.second;
    //printf("%d %d\n", l, r);

    int mn = 1e9, mx = 0;
    for (int i = l; i <= r; ++i)
      Min(mn, a[i]), Max(mx, a[i]);
    if (mn != l || mx != r) ans = 0;
    
    tmpl.clear(), tmpr.clear();
    for (int i = l; i <= r; i += 2) {
      if (a[i] < i) tmpl.pb(a[i]);
      if (a[i] > i) tmpr.pb(a[i]);
    }
    for (int i = 1; i < (int)tmpl.size(); ++i)
      if (tmpl[i] < tmpl[i - 1]) ans = 0;
    for (int i = 1; i < (int)tmpr.size(); ++i)
      if (tmpr[i] < tmpr[i - 1]) ans = 0;
  }
  puts(ans ? "Yes" : "No");

  return 0;
}


Measured memory_bytes: 7536
from functools import reduce
from bisect import bisect

def soinsuu_bunkai(n):
    ret = {}
    p = 2
    while p * p <= n:
        while n % p == 0:
            ret[p]= ret[p]+1 if p in ret else 1
            n //= p
        p += 1
    if n != 1:
        ret[n] = 1
    return ret   
    
def make_triangle(n):
    cnt = 0
    sum_ = 0
    for i in range(1,n+1):
        sum_ += i
        if sum_ > n:
            break
        else:
            cnt += 1
    return cnt    

dic = soinsuu_bunkai(int(input()))
ans = 0
for k,v in dic.items():
    ans += make_triangle(v)  
print(ans)

Measured memory_bytes: 9544
n = int(input())
d = list(map(int, input().split()))
mod = 998244353
dic = {}
if d[0]:
    print(0)
else:
    for di in d:
        if di not in dic:
            dic[di] = 0
        dic[di] += 1
    dists = list(dic.keys())
    dists.sort()
    ans = 1
    l = [dic[dist] for dist in dists]
    if l[0] != 1:
        print(0)
    elif dists != list(range(len(dists))):
        print(0)
    else:
        for l1, l2 in zip(l, l[1:]):
            ans = ans * (l1 ** l2) % mod
        print(ans)


Measured memory_bytes: 18700
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() []int {
	n := readInt()
	return readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

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

func minUint(a, b uint) uint {
	if a < b {
		return a
	}
	return b
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minUint64(a, b uint64) uint64 {
	if a < b {
		return a
	}
	return b
}

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

func maxUint(a, b uint) uint {
	if a < b {
		return b
	}
	return a
}
func maxInt64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxUint64(a, b uint64) uint64 {
	if a < b {
		return b
	}
	return a
}

func absInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
func main() {
	defer stdout.Flush()
	a := readInt()
	b := readInt()
	c := readInt()
	d := readInt()

	println(maxInt(a*b, c*d))
}


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




int main()
{
    #ifdef jamil993
     // freopen("input.txt" , "rt" , stdin ) ;
    #endif // jamil993
    int n ;
    cin >> n ;
    int k ;
    cin >> k ;

    map < int , int > mp  ;
    map < int , int > :: iterator it  ;
    vector < int > v ;
    int sum = 0 ;

    for(int i = 0 ; i < n ; i++)
    {
        int a ;
        cin >> a ;
        mp[a] ++ ;
    }

    for(it = mp.begin() ; it != mp.end() ; it++)
    {
        v.push_back(it->second) ;
    }
    int sz = v.size() ;

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

    for(int i = 0 ; i < max(0, sz - k) ; i++)
    {
        sum += v[i] ;
    }
    cout << sum << endl ;


}



Measured memory_bytes: 10748
// https://atcoder.jp/contests/abc061/tasks/abc061_b

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

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> ctr(n, 0);
    for (int i = 0; i < m; i++)
    {
        int a, b;
        cin >> a >> b;
        ctr[--a]++;
        ctr[--b]++;
    }
    for (int i = 0; i < n; i++)
    {
        cout << ctr[i] << endl;
    }
    return 0;
}


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

int min(int a, int b) {
	return a < b ? a : b;
}

int f[42][410][410];

int main() {
	const int inf = INT_MAX;

	int n, ma, mb;
	int arr[40][3];
	int i, j, k;


	scanf("%d%d%d", &n, &ma, &mb);

	for (i = 1; i <= n; i++) {
		for (j = 0; j < 3; j++) {
			scanf("%d", &arr[i][j]);
		}
	}

	for (i = 0; i <= n; i++) {
		for (j = 0; j < 410; j++) {
			for (k = 0; k < 410; k++) {
				f[i][j][k] = inf;
			}
		}
	}

	f[0][0][0] = 0;

	for (i = 0; i < n; i++) {
		for (j = 0; j <= 400; j++) {
			for (k = 0; k <= 400; k++) {
				if (f[i][j][k] == inf) continue;

				f[i + 1][j][k] = min(f[i][j][k], f[i + 1][j][k]);

				if (j + arr[i+1][0] <= 400 && k + arr[i+1][1] <= 400){
					f[i + 1][j + arr[i + 1][0]][k + arr[i + 1][1]] = min(f[i + 1][j + arr[i + 1][0]][k + arr[i+1][1]], f[i][j][k] + arr[i+1][2]);
				}
			}
		}
	}

	int tmp = inf;
	for (i = 1; i <= 400; i++) {
		for (j = 1; j <= 400; j++) {
			if (i*mb == j*ma) {
				tmp = min(tmp, f[n][i][j]);
			}
		}
	}

	if (tmp == inf) tmp = -1;
	printf("%d", tmp);

	return 0;
}


Measured memory_bytes: 27136
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout<< (x) << " "
int main(){
    int a,b,c,k;
    cin>>a>>b>>c>>k;
    if(a>=k){co(k);return 0;}
    if(a+b>=k){co(a);return 0;}
    co(a-min(c,(k-(a+b))));
}


Measured memory_bytes: 3572
H,W = map(int,input().split())
if H==1 or W==1:
    cnt = 1
elif W%2==0:
    w = W//2
    cnt = w*(H//2*2+H%2)
else:
    w = W//2
    cnt = (w+1)*(H//2+H%2)+w*(H//2)
print(cnt)

Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int W = sc.nextInt();
        
        if (S <= W) {
           System.out.println("unsafe"); 
        } else {
            System.out.println("safe"); 
        }
    }
}


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

const long long MOD = 1e9+7;

long long pow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1) res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}

long long f(long long a, long long b) {
    long long c = a + b;
    long long x = 1, y = 1, z = 1;
    for (int i = 0; i < c; ++i) {
        x *= c - i;
        x %= MOD;
        if (i < a) {
            y *= a - i;
            y %= MOD;
        }
        if (i < b) {
            z *= b - i;
            z %= MOD;
        }
    }
    long long res = x * pow(y, MOD-2) % MOD;
    res *= pow(z, MOD-2);
    res %= MOD;
    return res;
}

int main() {
    int x, y;
    cin >> x >> y;
    long long a, b;
    a = 2*y - x;
    b = 2*x - y;
    if (a%3!=0 || b%3!=0 || a<0 || b<0) {
        cout << 0 << endl;
        return 0;
    }
    a /= 3;
    b /= 3;
    long long ans = f(a, b);
    cout << ans << endl;
    return 0;
}

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

typedef long long ll;

ll combin(int n, int r){
    if(r == 0){
        return 1;
    }else{
        return combin(n-1,r-1)*n/r;
    }
}

int main(){
    int n, p;
    cin >> n >> p;
    vector<int> v(2,0);
    for(int i=0; i<n; i++){
        int a;
        cin >> a;
        v.at(a%2)++;
    }
    ll ans = (ll)pow(2,v.at(0)), c = 0;
    if(p == 0){
        for(int i=0; i<=v.at(1); i+=2){
            c += combin(v.at(1), i);
        }
    }else{
        for(int i=1; i<=v.at(1); i+=2){
            c += combin(v.at(1), i);
        }
    }
    ans *= c;

    cout << ans << endl;

    return 0;
}

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

typedef long long ll;

int main() {
    int ans = 0;
    string s;
    cin >> s;

    int cnt;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
            cnt++;
        } else  {
            if (ans < cnt) {
                ans = cnt;
            }
            cnt = 0;
        }
    }
    if (cnt > ans) {
        ans = cnt;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3636
/**
 *    author:  lets
 *    created: 2020-06-07 18:08:54 JST
 **/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> cnt(n - 1, 0);
  for (int i = 0; i < n - 1; i++) {
    string t = s.substr(0, i + 1);
    string u = s.substr(i + 1);
    map<char, bool> ct, cu;
    for (auto tt : t) {
      ct[tt] = 1;
    }
    for (auto uu : u) {
      cu[uu] = 1;
    }
    for (auto ctt : ct) {
      if (cu.count(ctt.first) == 1) cnt[i]++;
    }
  }
  cout << *max_element(cnt.begin(), cnt.end()) << '\n';
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		
		int n;
		n = sc.nextInt();
		
		sc.close();
		
		int tmp = n, tmp2 = n, i = 10000;
		int count = 0;
		while(tmp > 0) {
			i /= 10;
			tmp /= i;
			tmp2 -= tmp * i;
			if(tmp == 2)
				++count;
			tmp = tmp2;
		}
		
		System.out.println(count);
	}

}


Measured memory_bytes: 22996
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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;
}

const int inf = INT_MAX;
const int MOD = 1000000007;
const long long INF = LLONG_MAX;

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

int A, B, C;

int main() {
  cin >> A >> B >> C;
  if (C >= A && C <= B) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}


Measured memory_bytes: 3644
S = input()

if S != S[::-1]:
    print('No')
    exit()


l = len(S)

v = S[:int((l - 1) / 2)]

if v != v[::-1]:
    print('No')
    exit()

x = int((l + 3) / 2)

v = S[x - 1:]

if v != v[::-1]:
    print('No')
    exit()

print('Yes')


Measured memory_bytes: 3064
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	static ArrayList<Integer> ans;
	static int r;
	static long s;
	static int n;
	static long realans=0;
	public static void solve(int n)
	{
		int d=0;
		for(int ii=0;ii<Math.min(n, r);ii++)
		{
			if(ans.get(ii)>=0)continue;
			d+=ans.get(ii);
		}
		
		s-=d;
		realans=Math.max(realans,s);
	}
	public static void main(String args[])
	
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		
		int k=scan.nextInt();
		ans=new ArrayList<Integer>();
		int ar[]=new int[n];
		for(int i=0;i<n;i++)
		{
			ar[i]=scan.nextInt();
			
		}
		for(int i=1;i<=Math.min(n, k);i++)
		{
			for(int l=0;l<=i;l++)
			{
				ans=new ArrayList<Integer>();
				 s=0;
				for(int j=0;j<l;j++)
				{
					ans.add(ar[j]);
					s+=ar[j];
				}
				for(int h=n-1;h>=n-i+l;h--)
				{
					ans.add(ar[h]);
					s+=ar[h];
				}
				Collections.sort(ans);
				
				
				 r=k-i;
				solve(i);
				
			}
			
		}
		System.out.println(realans);
	}
}


Measured memory_bytes: 23764
#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            line.pop();
            line
        }
    )
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let iter = line.split_whitespace();
            iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    )
}

fn solve(k: u64) -> Vec<u64> {
    if k == 0 {
        return vec![3,3,3,3]
    }

    if k == 1 {
        return vec![1,1,5]
    }

    if k <= 50 {
        return vec![k;k as usize]
    }

    let add = k / 50;
    let r = k % 50;

    if r == 0 {
        return vec![50+add-1;50]
    }

    let min_num = (50 + add) - 50 + (50 - r - 1);
    let max_num = (50 + add) + (50 - r);

    let mut ret = Vec::new();

    for _ in 0..r {
        ret.push(max_num);
    }

    for _ in r..50 {
        ret.push(min_num);
    }

    return ret
}

fn main() {
    let k = parse_line!(u64);

    let v = solve(k);

    println!("{}", v.len());
    println!("{}", v.iter().map(|a| a.to_string()).collect::<Vec<String>>().join(" "));
}

#[test]
fn solve_test() {
    assert_eq!(solve(50 as u64 * 1e16 as u64), vec![]);
    assert_eq!(solve(50), vec![]);
}


Measured memory_bytes: 4352
from collections import Counter

n,t=map(int,input().split())
*a,=map(int,input().split())

m=[None]*n
used=[False]*n

for i in range(n)[::-1]:
    if i==n-1:
        m[i]=a[i]
    else:
        m[i]=max(m[i+1],a[i])

c=Counter([m[i]-a[i] for i in range(n)])
print(c[max(c.keys())])


Measured memory_bytes: 75392
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI acos(-1.0)
#define test() int t; cin>>t; while(t--)
#define ll long long int
int mod = 1e9 + 7;
int main()
{
	IOS;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int x, n;
	cin >> x >> n;
	if (n == 0) {
		cout << x << endl;
		return 0;
	}
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i <= x; i++) {
		for (int pol : { -1, 1}) {
			int cur = x + i * pol;
			if (count(a.begin(), a.end(), cur) == 0) {
				cout << cur << endl;
				return 0;
			}
		}
	}
	return 0;
}


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

#define col first
#define cn second

typedef pair<int, int> PR;

pair<int, int> puyo[10000+10] , tmp;

int sum;


int chek(int , /*PR[10000 + 10],*/ int ,int,int);


int main()
{
	int n;
	int pn=0;

	int a;

	int i;

	int sa=0;

	while (cin >> n, n != 0)
	{
		sa = 0;
		sum = n;
		pn = 0;

		cin >> a;
		puyo[pn].col = a;
		puyo[pn].cn = 1;


		for (i = 1; i < n; i++)
		{
			cin >> a;

			if (puyo[pn].col == a)
			{
				puyo[pn].cn++;
			}
			else
			{
				pn++;
				puyo[pn].col = a;
				puyo[pn].cn = 1;
			}
		}

		pn++;

		for (i = 1; i < pn - 1; i++)
		{

			if (puyo[i].cn == 3)
			{
				if (puyo[i + 1].col == puyo[i - 1].col && puyo[i + 1].cn + puyo[i - 1].cn >= 5)
				{
					//tmp = puyo[i + 1];
					//puyo[i + 1].cn--;

					sa = 3 + puyo[i + 1].cn + puyo[i - 1].cn;

					sum = min(sum, n - chek(pn, i - 2, i + 2, sa));
					//puyo[i + 1] = tmp;
				}
			}

			if( puyo[i+1].cn==1 && puyo[i].col == puyo[i+2].col )
			{
				if (puyo[i].cn + puyo[i + 2].cn >= 3)
				{
					//puyo[i + 1].cn--;
					sa = 1 + puyo[i].cn + puyo[i + 2].cn;

					sum = min(sum, n - chek(pn, i - 1, i + 3, sa));
					
				}
			}
/*
			if (puyo[i - 1].cn == 1 && puyo[i].col == puyo[i - 2].col)
			{
				if (puyo[i].cn + puyo[i - 2].cn >= 3)
				{
					//puyo[i - 1].cn--;
					sa = 1 + puyo[i].cn + puyo[i - 2].cn;

					sum = min(sum, n - chek(pn, i - 3, i + 1, sa));
				}
			}
*/
			
		}
		
		cout << sum << endl;
	}
	return 0;
}


int chek(int pn/*, PR tp[10000 + 10]*/, int go, int ba , int sa)
{
	if (puyo[go].col == puyo[ba].col && puyo[go].cn + puyo[ba].cn >= 4)
	{
		sa += puyo[go].cn + puyo[ba].cn;

		if (go - 1 >= 0 && ba + 1 < pn)
		{
			return chek(pn, go - 1, ba + 1, sa);
		}

	}

	return sa;
}

Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
int main ()
{
    string n;
    cin >> n;
    if (n=="V" || n=="C" || n=="X" || n=="Z" || n=="B" || n=="N" || n=="M" || n=="A" || n=="S" || n=="D" || n=="F" || n=="G" || n=="H" || n=="J" || n=="K" || n=="L" || n=="Q" || n=="W" || n=="E" || n=="R" || n=="T" || n=="Y" || n=="U" || n=="I" || n=="O" || n=="P")
        cout << "A" << endl;
    else
        cout << "a" << endl;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
int main()
{
	#define int long long
	string s;
	cin >> s;
	int n = s.size();
	int dp[n];
	dp[0] = 0;
	for(int i = 1; i < n; i++)
	{
		if(s[i] == s[i-1])
		{
			if(s[i] == '0')
			{
				s[i] = '1';
			}
			else if(s[i] == '1')
			{
				s[i] = '0';
			}
			dp[i] = dp[i-1]+1;
		}
		else
		dp[i] = dp[i-1];
	}
	cout << dp[n-1] << "\n";
	return 0;
}

Measured memory_bytes: 1280
n, m = gets.split.map(&:to_i)
answers = n.times.map do
  inputs = gets.split
  inputs[1..-1].map(&:to_i)
end

results = (0..m).to_a
answers.each_with_index do |ans, idx|
  results.select! { |r| ans.include?(r) }
end

puts results.count


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

using namespace std;

int main()
{
	string s1,s2;
	cin>>s1>>s2;
	int cnt =0;
	
	for(int i=0; i<s1.size(); i++)
	{
		if(s1[i] == s2[i])
		{
			cnt++;
		}
	}
	cout<<cnt<<endl;
	return  0;
}

Measured memory_bytes: 256
#include <cstdio>

int read()
{
  int x=0,f=1;
  char ch=getchar();
  while((ch<'0')||(ch>'9'))
    {
      if(ch=='-')
        {
          f=-f;
        }
      ch=getchar();
    }
  while((ch>='0')&&(ch<='9'))
    {
      x=x*10+ch-'0';
      ch=getchar();
    }
  return x*f;
}

const int maxn=200;
const int mod=998244353;

struct point
{
  int x,y;
};

point p[maxn+10];
int n,ans;

int quickpow(int a,int b,int m)
{
  int res=1;
  while(b)
    {
      if(b&1)
        {
          res=1ll*res*a%m;
        }
      a=1ll*a*a%m;
      b>>=1;
    }
  return res;
}

int in_line(point a,point b,point c)
{
  return (b.y-a.y)*(c.x-a.x)==(c.y-a.y)*(b.x-a.x);
}

int main()
{
  n=read();
  for(int i=1; i<=n; ++i)
    {
      p[i].x=read();
      p[i].y=read();
    }
  for(int i=1; i<=n; ++i)
    {
      for(int j=i+1; j<=n; ++j)
        {
          int cnt=0;
          for(int k=j+1; k<=n; ++k)
            {
              if(in_line(p[i],p[j],p[k]))
                {
                  ++cnt;
                }
            }
          ans+=quickpow(2,cnt,mod);
          if(ans>=mod)
            {
              ans-=mod;
            }
        }
    }
  ans+=n+1;
  if(ans>=mod)
    {
      ans-=mod;
    }
  ans=quickpow(2,n,mod)-ans;
  if(ans<0)
    {
      ans+=mod;
    }
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

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

	Int N;
	cin >> N;

	Int a = 0;
	Int b = 0;
	vector<Int> temp(N);
	for (Int i = 0; i < N; i++) {
		cin >> temp[i];
	}

	sort(temp.begin(), temp.end(), greater<Int>());

	for (Int i = 0; i < N; i++) {
		if (i%2) {
			b += temp[i];
		}
		else {
			a += temp[i];
		}
	}
	cout << a-b << "\n";
}


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

int main() {
	string N;
	cin >> N;
	int ans = 0;
	for (int i = 0; i < 4; i++) {
		int tmp = N[i] - '0';
		if (tmp == 2)ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
  
# Function to return LCM of two numbers 
def lcm(a,b): 
    return int((a*b) // gcd(a,b)) 

A, B, C, D = map(int, input().split())

x1 = int(A//C)
x2 = int(A//D)
x3 = int(A//lcm(C,D))

y1 = int(B//C)
y2 = int(B//D)
y3 = int(B//lcm(C,D))

result = int(B-y1-y2+y3-(A-x1-x2+x3))
if(A%C!=0 and A%D!=0):
	result+=1
print(result)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
    int q;
    cin >> q;
    vector<int> a;
    while(q--){
        int u;
        cin >> u;
        if(u == 0) {
            int x;
            cin >> x;
            a.push_back(x);
        }else if(u == 1) {
            int p;
            cin >> p;
            cout << a[p] << '\n';
        }else{
            a.pop_back();
        }
    }
}


Measured memory_bytes: 3824
#include <cstdio>

int main(void) {

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

  int a[N];

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

  int cnt = 0;
  for(int i = 0; i < N; i++) {
    if(a[a[i]] == i) cnt++;
  }

  printf("%d\n", cnt/2);

}

Measured memory_bytes: 512
#include<stdio.h>
#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>
 
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//pair sort
bool compare_by_b(pair<LL, LL> a, pair<LL, LL> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}


void solve(long long N, std::vector<long long> V, std::vector<long long> C){
    int ans =0;
    for(LL i=0; i < 2<<(N+1); i++){
        int X=0,Y=0;
        for(int j=0; j<N; j++){
            int bit = 1<<j;
            if((bit & i)!=0){
                X+=V[j];Y+=C[j];
            }
        }
        ans=max(ans, X-Y);
    }
    cout<<ans<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> V(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&V[i]);
    }
    std::vector<long long> C(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&C[i]);
    }
    solve(N, std::move(V), std::move(C));
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i)
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(a > b){ a = b; return 1; } return 0; }
int main()
{
  int n; cin >> n;
  set<int> st;
  for (int j = 2; j <= 150; ++j) {
    st.insert(j*j);
  }
  map<int,int> mp;
  for (int j = 2; j <= 150; ++j) {
    mp[j*j] = j;
  }  
  rep1(i,n) {
    int res = 0;
    for (int j = 2; j <= 150; ++j) {
      for (int k = 2; k <= 150; ++k) {
	int l = 2*i - j*j - k*k;
	if(l <= 0) continue;
	if(st.find(l) == st.end()) continue;
	l = mp[l];
	if(j + k - l > 0 && (j + k - l) % 2 == 0) {
	  if(j - k + l > 0 && (j - k + l) % 2 == 0) {
	    if(-j + k + l > 0 && (-j + k + l) % 2 == 0) {
	      res++;
	    }
	  }
	}
      }
    }
    cout << res << "\n";
  }
  return 0;
}


Measured memory_bytes: 3584
//  Created by conan1024hao in 2020.
//  Copyright © 2020 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao Twitter/QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 10e16
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp1(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}

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

//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????统一类型        memset()!!!!!!!!!!!!       ペナを減らせ!!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    string s;
    cin>>s;
    string ss="";
    if(s.length()<4){
        cout<<"No"<<endl;
        return 0;
    }
    ss+=s[0];ss+=s[1];ss+=s[2];ss+=s[3];
    if(ss=="YAKI")cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------







Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define mp make_pair
#define pb push_back
#define EB emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

#define MAXN 200100

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

ll H,W,A,B;

ll fact[MAXN],inv_fact[MAXN];

void init(){
    fact[0] = 1;
    for(ll i=1;i<MAXN;i++) fact[i] = (fact[i-1] * i) % mod;
    for(ll i=0;i<MAXN;i++) inv_fact[i] = mod_pow(fact[i],mod-2);
}

int main(){
    init();
    cin>>H>>W>>A>>B;

    //rep(i,MAXN) cout << i << " " << fact[i] << endl;

    ll ans = 0;
    for(ll i=B;i<W;i++){
        ll n = H-A-1+i;
        ll r = i;
        ll tmp1 = fact[n];
        tmp1 *= inv_fact[r];
        tmp1 %= mod;
        tmp1 *= inv_fact[n-r];
        tmp1 %= mod;
        n = A-1+W-1-i;
        r = A-1;
        ll tmp2 = fact[n];
        tmp2 *= inv_fact[r];
        tmp2 %= mod;
        tmp2 *= inv_fact[n-r];
        tmp2 %= mod;
        ll tmp = (tmp1*tmp2) % mod;
        ans = (ans + tmp) % mod;
    }
    cout << ans << endl;
}


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


int main()
{
  int a[3];
  int count=0;
  for(int i=0;i<3;i++) cin >> a[i];
  sort(a,a+3);
  for(int j=1;j<3;j++)
  {
    count += a[j] - a[j-1];
  }
  cout <<count<<endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
import java.io.*;
 
class Main
{
    public static void main (String[] args) throws java.lang.Exception
    {
        String u, nl = System.getProperty("line.separator");
        StringBuilder
            p = new StringBuilder(1000),
            d = (new StringBuilder(100)).append('.'),
            s = (new StringBuilder(100)).append('#'),
            k = (new StringBuilder(100)).append('#');
        Scanner r = new Scanner(System.in);
        d.append(d).append(d).append(d).append(d);
        s.append(s).append(s).append(s).append(s);
        int h, w, ww = d.length();
        while (0 != ((h = r.nextInt()) | (w = r.nextInt()))) {
            while (w > ww) {
                d.append(d);
                s.append(s);
                ww = d.length();
            }
            p.append(u = s.substring(0, w)).append(nl);
            k.setLength(1);
            k.append(d.substring(2, w)).append('#').append(nl);
            while (2 != h--) {
                p.append(k);
            }
            p.append(u).append(nl).append(nl);
        }
        System.out.print(p);
    }
}

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

/** Problem0048 : Class **/
int main()
{
	double input;
	string output;
	while (cin >> input) {
		if (input <= 48.0)
			output = "light fly";
		else if (input <= 51.0)
			output = "fly";
		else if (input <= 54.0)
			output = "bantam";
		else if (input <= 57.0)
			output = "feather";
		else if (input <= 60.0)
			output = "light";
		else if (input <= 64.0)
			output = "light welter";
		else if (input <= 69.0)
			output = "welter";
		else if (input <= 75.0)
			output = "light middle";
		else if (input <= 81.0)
			output = "middle";
		else if (input <= 91.0)
			output = "light heavy";
		else
			output = "heavy";
		
		cout << output << endl;
	}
	return 0;
}

Measured memory_bytes: 1224
import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        long n = Long.parseLong(br.readLine());
        long a = Long.parseLong(br.readLine());
        long b = Long.parseLong(br.readLine());
        long c = Long.parseLong(br.readLine());
        long d = Long.parseLong(br.readLine());
        long e = Long.parseLong(br.readLine());
        
        long[] abcde = {a, b, c, d, e};
        Arrays.sort(abcde);
        
        /*long[] num = new long[7];
        num[1] = n;
        
        int t = 0;
        while (true) {
            if (num[6] == n) break;
            
            if (num[5] > 0) {
                num[6] += Math.min(e, num[5]);
                num[5] -= Math.min(e, num[5]);
            }
            if (num[4] > 0) {
                num[5] += Math.min(d, num[4]);
                num[4] -= Math.min(d, num[4]);
            }
            if (num[3] > 0) {
                num[4] += Math.min(c, num[3]);
                num[3] -= Math.min(c, num[3]);
            }
            if (num[2] > 0) {
                num[3] += Math.min(b, num[2]);
                num[2] -= Math.min(b, num[2]);
            }
            if (num[1] > 0) {
                num[2] += Math.min(a, num[1]);
                num[1] -= Math.min(a, num[1]);
            }
            
            t++;
        }*/
        
        System.out.println((long)Math.ceil((double)n/abcde[0])+4);
    }
}





Measured memory_bytes: 21716
#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <set>
using namespace std;
const int MOD = 1000000007;
const int INF = 1e9;
typedef long long ll;

int main(){
    int n,m;
    cin >> n >> m;

    vector<int> l(m);
    vector<int> r(m);

    for(int i = 0;i<m;i++){
        cin >> l[i] >> r[i];
    }

    int maxans=0;
    int minans=n;

    for(int i = 0;i<m;i++){
        maxans = max(maxans,l[i]);
        minans = min(minans,r[i]);
    }

    
    if(minans-maxans+1<=0){
        cout << 0 << endl;
    }
    else{
        cout << minans-maxans+1 << endl;
    }
    

}

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

using namespace std;

using ll = long long;

const long long MOD = 1e9+7;

#define ALL(A) A.begin(),A.end()

void ALLIN1_NUMBER(vector<ll>& V)
{
    for(auto& x : V)
    {
        cin >> x;
    }
}

void ALLOUT_NUMBER(vector<ll> V)
{
    ll N = V.size();
    for(ll i=0;i<N;i++)
    {
        cout << V[i];
        if(i<N-1) cout << ' ';
    }
    cout << endl;
}

class Mll
{
    public:
    ll x;

    Mll() : x(0){}
    Mll(ll x=0) : x((x%MOD+MOD)%MOD){}

    Mll operator-() const
    {
        return Mll(-x);
    }

    Mll& operator+=(const Mll& A)
    {
        if((x += A.x) >= MOD) x -= MOD;
        return *this;
    }
    Mll& operator-=(const Mll& A)
    {
        if((x += MOD - A.x) >= MOD) x -= MOD;
        return *this;
    }
    Mll& operator*=(const Mll& A)
    {
        (x *= A.x) %= MOD;
        return *this;
    }
    
    Mll operator+(const Mll& A)
    {
        Mll res(*this);
        return res+=A;
    }
    Mll operator-(const Mll& A)
    {
        Mll res(*this);
        return res-=A;
    }
    Mll operator*(const Mll& A)
    {
        Mll res(*this);
        return res*=A;
    }
    
    Mll pow(ll t) const // t乗
    {
        if(t==0) return 1;
        Mll A = pow(t>>1);
        A *= A;
        if(t&1) A *= *this;
        return A;
    }

    // for prime mod
    Mll inv() const
    {
        return pow(MOD-2);
    }
    Mll& operator/=(const Mll& A)
    {
        return (*this) *= A.inv();
    }
    Mll operator/(const Mll& A) const
    {
        Mll res(*this);
        return res/=A;
    }

    friend ostream& operator<<(ostream& os, const Mll& M)
    {
        os << M.x;
        return os;
    }
};

vector<Mll> ALLIN_MLL(ll N)
{
    vector<ll> numbers_ll(N);
    ALLIN1_NUMBER(numbers_ll);

    vector<Mll> numbers_Mll;
    for(ll i=0;i<N;i++)
    {
        Mll add(numbers_ll[i]);
        numbers_Mll.push_back(add);
    }

    return numbers_Mll;
}

template<class T>
void OUT0(T N)
{
    cout << N << endl;
}

static const double pi = acos(-1.0);

double Cos(double D)
{
    return cos(pi/180 * D);
}

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

    while(A>=B)
    {
        B*=2;
        K--;
    }
    while(B>=C)
    {
        C*=2;
        K--;
    }

    if(K>=0) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
#define add(x,y)(x=(x+y)%MOD)

void f(ll n){
	if(n==0)return;
	n--;
	f(n/26);
	putchar('a'+(n%26));
}

int main(){
	ll n;
	scanf("%lld",&n);
	f(n);
}

Measured memory_bytes: 1664
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    x1, y1, x2, y2 = map(int, input().split())
    diff_x = x2 - x1
    diff_y = y2 - y1
    r = [x2 - diff_y, y2 + diff_x, x1 - diff_y, y1 + diff_x]
    print(*r, sep= ' ')
if __name__ == '__main__':
    main()

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

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPr(i, n) for(int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for(int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for(int i = (n); i >= (m); --i)
#define MP make_pair
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x, 0, sizeof(x))
#define FILL(x, y) memset(x, y, sizeof(x))
#define MM(x) memset(x, -1, sizeof(x))
#define ALL(x) (x).begin(), (x).end()
#define DB(x) cerr << #x << " = " << x << endl
#define DB2(x, y)                                                              \
    cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define DEBUG                                                                  \
    int x12345;                                                                \
    cin >> x12345;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const long long MOD = 1e9 + 7;
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;
}

///////////////////////////////////////////////
/// 🍈( '-' 🍈 |AC|
int main() {
    string S;
    cin >> S;
    if (S == "ARC") puts("ABC");
    else puts("ARC");
}

Measured memory_bytes: 3624