akhauriyash/Code-Regression huggingface dataset:
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <iostream>

const int kMaxN = 200000;
const int kMaxAi = 1000000000;
const int kSentinel = kMaxAi + 1;

void Merge(int A[], int left, int mid, int right,
           int L[], int R[], std::int64_t *cnt) {
  int i, j, k;
  int n1 = mid - left;
  int n2 = right - mid;
  for (i = 0; i < n1; ++i) { L[i] = A[left + i]; }
  for (i = 0; i < n2; ++i) { R[i] = A[mid + i]; }
  L[n1] = R[n2] = kSentinel;
  i = j = 0;
  for (k = left; k < right; ++k) {
    if (L[i] <= R[j]) {
      A[k] = L[i++];
    } else {
      A[k] = R[j++];
      *cnt += n1 - i;
    }
  }
}

void MergeSort(int A[], int left, int right,
               int L[], int R[], std::int64_t *cnt) {
  int mid;
  if (left + 1 < right) {
    mid = (left + right) / 2;
    MergeSort(A, left, mid, L, R, cnt);
    MergeSort(A, mid, right, L, R, cnt);
    Merge(A, left, mid, right, L, R, cnt);
  }
}

int main() {
  int n, i;
  std::scanf("%d", &n);
  int A[n];
  for (i = 0; i < n; ++i) { std::scanf("%d", &A[i]); }
  int L[n/2 + 1], R[n/2 + 1];
  std::int64_t cnt = 0;
  MergeSort(A, 0, n, L, R, &cnt);
  std::cout << cnt << std::endl;
}

Measured memory_bytes: 4696
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define revrep(i, n) for(ll i = (n)-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll max3(ll a, ll b, ll c){return max(a, max(b, c));};
ll min3(ll a, ll b, ll c){return min(a, min(b, c));};
ll max4(ll a, ll b, ll c, ll d){return max(max(a, b), min(c, d));};
ll min4(ll a, ll b, ll c, ll d){return min(min(a, b), min(c, d));};
ll max5(ll a, ll b, ll c, ll d, ll e){return max(max(a, b), max3(c, d, e));};
ll min5(ll a, ll b, ll c, ll d, ll e){return min(min(a, b), min3(c, d, e));};

const ll INFL = 1LL << 60;//10^18 = 2^60
const int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//ll MOD = 998244353;

vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};


ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}
ll pow_mod(ll x, ll k){
  x %= MOD; x += MOD; x %= MOD;
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}

ll inverse(ll x){return pow_mod(x, MOD - 2);};

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

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

ll kai_mod(ll x){
  if(x == 0) return 1;
  return x * kai_mod(x-1) % MOD;
}

/*
//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAXcomb; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
ll comb(int n, int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * finv[k] % MOD * finv[n-k] % MOD;
}
*/

ll N;
vector<ll> A, B;
void solve(){
  ll ans = 0;
  bool update = 1;
  while(update){
    update = 0;
    rep(i, N){
      if(B[i] - A[i] >= B[(i-1 + N) % N] + B[(i+1 + N) % N]){
        update = 1;
        ans += (B[i] - A[i]) / (B[(i-1 + N) % N] + B[(i+1 + N) % N]);
        B[i] -= (B[i] - A[i]) / (B[(i-1 + N) % N] + B[(i+1 + N) % N]) * (B[(i-1 + N) % N] + B[(i+1 + N) % N]);
      }
    }
  }
  bool end = 1;
  rep(i, N) if(A[i] != B[i]) end = 0;
  if(end){
    cout << ans << endl;
    return;
  }
  cout << -1 << endl;
}

int main(){
  cin >> N;
  A.resize(N), B.resize(N);
  rep(i, N) cin >> A[i];
  rep(i, N) cin >> B[i];
  solve();
}


Measured memory_bytes: 3456
def countNum(old,cnt):
    for i in range(len(old)):
        for j in range(1,len(old)):
            st=''
            for k in range(len(name)):
                if i+j*k>=len(old):
                    break
                st += old[i+j*k]
            if st==name:
                return cnt+1
    return cnt

n = input()
name = raw_input()
cnt = 0
kanban = [raw_input() for i in range(n)]
for old in kanban:
    cnt=countNum(old,cnt)
print cnt

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

template <class T, class F = multiplies<T>>
T power(T a, long long n, F op = multiplies<T>(), T e = {1}) {
  assert(n >= 0);
  while (n) {
    if (n & 1) e = op(e, a);
    if (n >>= 1) a = op(a, a);
  }
  return e;
}

template <unsigned M> struct modular {
  using m = modular;
  unsigned v;
  modular(long long a = 0) : v((a %= M) < 0 ? a + M : a) {}
  m operator-() const { return m() -= *this; }
  m& operator+=(m r) { if ((v += r.v) >= M) v -= M; return *this; }
  m& operator-=(m r) { if (v < r.v) v += M; v -= r.v; return *this; }
  m& operator*=(m r) { v = (uint64_t)v * r.v % M; return *this; }
  m& operator/=(m r) { return *this *= power(r, M - 2); }
  friend m operator+(m l, m r) { return l += r; }
  friend m operator-(m l, m r) { return l -= r; }
  friend m operator*(m l, m r) { return l *= r; }
  friend m operator/(m l, m r) { return l /= r; }
  friend bool operator==(m l, m r) { return l.v == r.v; }
  friend string to_string(m a) { return to_string(a.v); }
};

constexpr long long mod = 1e9 + 7;
using mint = modular<mod>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> ds;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      ds.push_back(i);
      ds.push_back(n / i);
    }
  }
  sort(begin(ds), end(ds));
  ds.erase(unique(begin(ds), end(ds)), end(ds));
  vector<mint> dp(ds.size());
  mint res;
  for (int i = 0; i < (int)ds.size(); ++i) {
    dp[i] = power(mint(m), (ds[i] + 1) / 2);
    for (int j = 0; j < i; ++j) {
      if (ds[i] % ds[j] == 0) {
        dp[i] -= dp[j];
      }
    }
    res += ds[i] & 1 ? dp[i] * ds[i] : dp[i] * ds[i] / 2;
  }
  cout << res.v << '\n';
}


Measured memory_bytes: 256
main = do
    a <-  getLine
    -- let year = take 4
    -- let day =  take 2 $  drop
    let temp = map (\x -> read x) $ split '/' a :: [Int]
    let isHeisei = ((temp !! 0) >= 2019) && ((temp !! 1) <= 4) && ((temp !! 2) <= 30)
    putStrLn $ if isHeisei then "Heisei" else "TBD"

split  :: Eq a => a -> [a] -> [[a]]
split p xs =  case dropWhile (\x -> x==p) xs of
                        [] -> []
                        xs' -> w : split p xs''
                            where (w, xs'') = break (\x -> x==p) xs'

Measured memory_bytes: 508
//Problem : https://vjudge.net/contest/306800#problem/U
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    int t;
    cin>>t;
	map<string, int> mp; 
 	string l, r;
    while(t--)
    {
		int op, v;
		string k;
      	cin>>op;
		if(op==0)
		{
			cin>>k>>v;
			mp[k] =  v;
		}
        else if(op==1)
		{
			cin>>k;
			map<string, int>:: iterator itr = mp.find(k);
			if (itr != mp.end()) 
				cout<< itr ->second<<endl;
			else
				cout<<0<<endl;
		}
		else if(op==2)
		{
            cin>>k;
			mp.erase(k);
		}
        else
		{
            map<string,int>::iterator it;
			cin>>l>>r;
            for(it = mp.lower_bound(l); it != mp.upper_bound(r); it++)
           		cout << it->first << " " << it->second << endl;
		}
    }
    return 0;
}


Measured memory_bytes: 27656
import sys
input = sys.stdin.readline
import numpy as np
from numba import njit


def read():
    D = int(input().strip())
    C = np.fromstring(input().strip(), dtype=np.int32, sep=" ")
    S = np.empty((D, 26), dtype=np.int32)
    for i in range(D):
        s = np.fromstring(input().strip(), dtype=np.int32, sep=" ")
        S[i, :] = s[:]
    M = 1000
    RD = np.random.randint(D, size=(M, ), dtype=np.int32)
    RQ = np.random.randint(26, size=(M, ), dtype=np.int32)
    DQ = np.stack([RD, RQ]).T
    return D, C, S, M, DQ


@njit
def diff_satisfaction(C, S, d, p, last):
    """d日目にコンテストpを開催するときの、満足度の更新量を求める
    """
    v = 0
    for i in range(26):
        v -= C[i] * (d - last[i])
    v += C[p] * (d - last[p])
    v += S[d, p]
    return v


@njit
def change_schedule(D, C, S, T, d, q, cumsat):
    """d日目のコンテストをqに変更する
    """
    p = T[d]
    dp1, dq1 = -1, -1
    dp3, dq3 = D, D
    for i in range(0, d):
        if T[i] == p: 
            dp1 = i
        if T[i] == q:
            dq1 = i
    for i in range(D-1, d, -1):
        if T[i] == p:
            dp3 = i
        if T[i] == q:
            dq3 = i
    cumsat = cumsat - S[d, p] + S[d, q] - C[p] * (dp3-d) * (d-dp1) + C[q] * (dq3-d) * (d-dq1)
    return cumsat


@njit
def greedy(D, C, S):
    T = np.zeros(D, dtype=np.int32)
    last = -np.ones(26, dtype=np.int32)
    cumsat = 0
    for d in range(D):
        max_p = 0
        max_diff = -999999999

        # select contest greedily
        for p in range(26):
            diff = diff_satisfaction(C, S, d, p, last)
            if diff > max_diff:
                max_p = p
                max_diff = diff
        
        # update schedule
        cumsat += max_diff
        T[d] = max_p
        last[max_p] = d
    return cumsat, T


@njit
def solve(D, C, S, M, DQ):
    cumsat, T = greedy(D, C, S)
    for i in range(M):
        d, q = DQ[i, :]
        newsat = change_schedule(D, C, S, T, d, q, cumsat)
        if newsat > cumsat:
            cumsat = newsat
            T[d] = q
    for t in T:
        print(t+1)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Measured memory_bytes: 118832
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>

#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>

#include <cmath>
#include <numeric>
#include <random>
#include <cstring>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <stack>

// type
#include <cstdint>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    int N;
    cin >> N;
    set<int> s;
    for (int i = 0; i< N; i++) {
        int a;
        cin >> a;
        if (s.find(a) != s.end()) {
            cout << "NO" << endl;
            return 0;
        }
        s.insert(a);
    }

    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 9600
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);

		int D = sc.nextInt();
		int N = sc.nextInt();

		int base=0;
		if(D==0) {
			base=1;
		}else if(D==1) {
			base=100;
		}else {
			base=100*100;
		}
		if(N==100)N++;
		int ans=N*base;
		pln(ans);
	}

	//以下テンプレート

	public static int[] extgcd(int a, int b) {

		int x0 = 1;
		int x1 = 0;

		int y0 = 0;
		int y1 = 1;

		while (b != 0) {
			int q = a / b;
			int r = a % b;

			int x2 = x0 - q * x1;
			int y2 = y0 - q * y1;

			a = b;
			b = r;

			x0 = x1;
			x1 = x2;

			y0 = y1;
			y1 = y2;
		}

		return new int[] { a, x0, y0 };

	}

	static int gcd(int a, int b) {

		if (b == 0)
			return a;

		if (a < b) {
			int t = a;
			a = b;
			b = t;
		}

		return gcd(b, a % b);

	}

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

	static void swap(int[] a) {
		int t;

		t = a[0];
		a[0] = a[1];
		a[1] = t;

		return;
	}

	static <T> void output(List<T> list) {

		for (int i = 0; i < list.size(); i++) {
			System.out.print(list.get(i));

			if (i != list.size() - 1) {
				System.out.print(" ");
			} else {
				nl();
			}
		}

	}

	static void output(String[][] str) {

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				print(str[i][j]);
			}

			nl();
		}

	}

	static void output(boolean flg, String Yes, String No) {

		if (flg) {
			pln(Yes);
		} else {
			pln(No);
		}

	}

	static void output(String[][] str, int digit) {

		String dig = "%" + String.valueOf(digit) + "s";

		for (int i = 0; i < str.length; i++) {
			for (int j = 0; j < str[i].length; j++) {
				System.out.printf(dig, str[i][j]);
			}
			nl();
		}

	}

	static void pln(String str) {
		System.out.println(str);
	}

	static void pln(int x) {
		System.out.println(x);
	}

	static void print(String str) {
		System.out.print(str);
	}

	static void print(int x) {
		System.out.print(x);
	}

	static void print(String str, int times) {
		for (int i = 0; i < times; i++) {
			print(str);
		}
	}

	static void print(int x, int times) {
		for (int i = 0; i < times; i++) {
			print(x);
		}
	}

	static void nl() {
		System.out.println();
	}

}


Measured memory_bytes: 23892
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    ll tapi(int sansin, int keta) {
        string s;
        while (sansin > 0) {
            int amari = sansin % 3;
            if (amari == 0) {
                s += '3';
            } else if (amari == 1) {
                s += '5';
            } else if (amari == 2) {
                s += '7';
            }


            sansin -= amari;
            sansin /= 3;
        }

        while (s.size() < keta) s += '3';

        reverse(all(s));
        ll ret = (ll) stol(s);
        return ret;
    }

    bool valid(ll num) {
        string s = to_string(num);
        bool san = false, go = false, nana = false;

        for (int i = 0; i < s.size(); ++i) {
            if (s[i] == '3') {
                san = true;
            } else if (s[i] == '5') {
                go = true;
            } else if (s[i] == '7') {
                nana = true;
            } else {
                cerr << "ijou" << endl;
            }
        }

        return san && go && nana;
    }


    void solve() {
        input();
        ll N;
        cin >> N;

        ll ans = 0ll;

        [&]() {
            for (int keta = 1;; ++keta) {
                for (int i = 0; i < (int) round(pow(3, keta)); ++i) {
                    ll tmp = tapi(i, keta);
//                    cerr << tmp << endl;
                    if (tmp > N) return;
                    if (valid(tmp)) {
                        ans++;
                    }
                }
            }
        }();



//        for (int i = 1;; ++i) {
//            ll tmp = tapi(i);
//            cerr << tmp << endl;
//            if (tmp > N) break;
//            if (valid(tmp)) {
//                ans++;
//            }
//        }
        cout << ans << endl;
    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		double z = (double)x / (double)y;
		String zz =  String.format("%.5f", z);
		System.out.println(x / y + " " + x % y + " " + zz);
	}
}

Measured memory_bytes: 26524
#include <stdio.h>

int main(){

    int n, digitos[3], qtd = 0;
    scanf("%d", &n);

    for(int i = 0; i < 3; ++i){
        digitos[i] = n%10;
        n = n/10;
    }

    for(int i = 0; i < 3; ++i){
        if(digitos[i] == 7){
            qtd++;
        }
    }

    if(qtd > 0){
        printf("Yes\n");
    } else{
        printf("No\n");
    }

    return 0;
}


Measured memory_bytes: 1660
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;
const long long temp=1e18;
int n;  long long a[1000],nzd,nzs;
int main()
{
    cin>>n;

  for (int i=1;i<=n;i++)    scanf("%lld",&a[i]);
  nzd=a[1];
  nzs=a[1];
  for (int i=2;i<=n;i++){
        nzd=__gcd(nzs,a[i]);
        nzs*=a[i]/nzd;
  }

  cout<<nzs<<endl;

return 0;
}


Measured memory_bytes: 256
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
 
#include <bits/stdc++.h>
inline int read() 
{
    int x = 0, f = 1; char ch = getchar();
    while (ch < '0' || ch > '9') {if (ch == '-') f = -1; ch = getchar();}
    while (ch >= '0' && ch <= '9') {x = (x << 1) + (x << 3) + (ch ^ 48); ch = getchar();}
    return x * f;
}

inline void write(int x)
{
    if(x<0){
    	putchar('-');
		x=-x;
	}
    if(x>9) 
		write(x/10);
    putchar(x%10+'0');
}
 
using namespace std;
 
int main()
{
#ifdef _MSC_VER
	freopen("e.in", "r", stdin);
#endif
	std::ios::sync_with_stdio(false);
	int n, m, c;
	n=read(),m=read(),c=read();
	vector<pair<int, int> > sx(n), sy(m);
	for (int i = 0; i < n; i++) {
		sx[i].second = i;
	}
	for (int i = 0; i < m; i++) {
		sy[i].second = i;
	}
	set<pair<int, int>> a;
	for (int i = 0; i < c; i++) 
	{
		int x, y;
		x=read(),y=read();
		--x;
		--y;
		++sx[x].first;
		++sy[y].first;
		a.insert(make_pair(x, y));
	}
	sort(sx.rbegin(), sx.rend());
	sort(sy.rbegin(), sy.rend());
	int ret = 0;
	for (const auto& gx : sx) 
	{
		for (const auto& gy : sy) 
		{
			int d = a.count(make_pair(gx.second, gy.second));
			ret = max(ret, gx.first + gy.first - d);
			if (d == 0) {
				break;
			}
		}
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 21912
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
    int n,m;
    cin>>n>>m;
    vector<int> p(m);
    vector<string> s(m);
    for(int i=0; i<m; i++) cin>>p[i]>>s[i];
    map<pair<int,string>,int> mp;
    int ac=0,wa=0;
    for(int i=0; i<m; i++){
        if(s[i]=="AC"&&mp[make_pair(p[i],s[i])]==0){
            ac++;
            wa+=mp[make_pair(p[i],"WA")];
        }
        mp[make_pair(p[i],s[i])]++;
    }
    cout<<ac<<" "<<wa<<endl;
}


Measured memory_bytes: 23296
#include <bits/stdc++.h>
using namespace std ;
#define MAXN 100010
int ans,maxx,cnt;
int a[MAXN] ;
int main() 
{
	int n,t;
    cin>>n>>t;
    for(int i=1;i<=n;i++) 
	    cin>>a[i];
    for( int i=n;i>=1;i--)
	 {
        maxx=max(a[i],maxx);
        ans=max(maxx-a[i],ans);
     }
    maxx=0;
    for(int i=n;i>=1;i--)
	 {
        maxx=max(a[i],maxx);
        if(maxx-a[i]==ans) 
		    cnt++;
    }
    cout<<cnt<<endl;
    return 0 ;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstdlib>
#include<utility>
#include<tuple>
#include<string>
#include<vector>
#include<numeric>
#include<algorithm>
#include<queue>
#include<deque>
#include<bitset>
#include<cmath>
#include<map>
#include<iomanip>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
#define rep(i, a, b) for(int i = a; i < b; i++)

int main() {
	
	int x1, y1, x2, y2;
	cin >> x1 >> y1 >> x2 >> y2;

	int dx = x2 - x1, dy = y1 - y2;

	cout << x2 + dy << " ";
	cout << y2 + dx << " ";
	cout << x1 + dy << " ";
	cout << y1 + dx << endl;

	return 0;
}


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


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

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	int rank[6];
	memset(rank, 0, sizeof(rank));
	while (n--)
	{
		double tall;
		scanf("%lf", &tall);
		int i;
		for (i = 0; i < 5 && tall >= 165.0+5*i; ++i)
			;
		++rank[i];
	}
	for (int i = 0; i < 6; ++i)
	{
		printf("%d:", i+1);
		for (int j = 0; j < rank[i]; ++j)
			putchar('*');
		printf("\n");
	}

	return 0;
}

Measured memory_bytes: 0
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<iomanip>
#include<sstream>
#include<cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
typedef long long int ll;
typedef long double ld;
const ll inf = (1 << 30);
const int MOD = 1000000007;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
}
int main() {
    int k, n; cin >> n >> k;
    vector<int> a(n); vector<bool> dp(100100,false);
    rep(i, n) cin >> a[i];
    req(i, k) {
        rep(j, n) {
            if (i - a[j] >= 0) dp[i] =(dp[i] || !dp[i - a[j]]);
        }
    }
    if (dp[k]) cout << "First" << endl;
    else cout << "Second" << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep2(i,x,n) for (int i = x; i < n; i++)
using ll = long long int;
int main() {
    int A,B; cin >> A >> B;
    cout << A*B << endl;
    return 0;
}

Measured memory_bytes: 3508
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
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;
	}
	return 0;
}


Measured memory_bytes: 256
/*
Author:
Prob:
Link:
Tag:
Comp:
*/

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

#define ll long long
#define ull unsigned long long
#define ii pair<int,int>
#define iii pair<ii, int>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define cl(a) a.clear()

#define vi vector<int>
#define vii vector<ii>

#define FOR(x,a,b) for (int x=a;x<=b;x++)
#define FOD(x,a,b) for (int x=a;x>=b;x--)
#define REP(x,a,b) for (int x=a;x<b;x++)
#define RED(x,a,b) for (int x=a;x>b;x--)

const int MAX = 1e6 + 10;
const int MAXN = 1e6 + 10;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-6;

int main(){
	// freopen("test.in", "rt", stdin);
	ios::sync_with_stdio(false);

	int n, x, prev = 0;
	ll cnt = 0;

	cin >> n;
	REP(i,0,n){
		cin >> x;
		if (x > prev+1){
			cnt += (x - 1)/(prev+1);
			prev = max(1, prev);
		}
		else
			prev = max(x, prev);
	}
	cout << cnt;

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<stdio.h>
#include<locale.h>
#include<set>
#include<stack>
#include<queue>
using namespace std;

int main()
{
int n;
long long int a[200005],s[200005];
scanf("%d",&n);
s[0]=0;
long long int z=0,x,ans=0;
for(int i=1;i<=n;i++)
{
	scanf("%lld",&a[i]);
	s[i]=max(s[i-1],a[i]);//s[i]はi人目までの高さの最大値
	x=max(z,s[i-1]-a[i]);
	ans+=x;
}
printf("%lld",ans);

}


Measured memory_bytes: 6968
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
 
int main(){
  vector<string> s(3);
  REP(i,3){
    cin>>s[i];
  }
  
  string ans="";
  REP(i,3){
    ans += s[i][i];
  }
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
ll a[200005];

ll labs(ll x){
	if(x<0LL)return -x;
	return x;
}

int main(void){
	scanf("%d",&n);
	ll sum=0;
	for(int i=0;i<n;i++){
		scanf("%lld",&a[i]);
		sum+=a[i];
	}
	ll ans=sum;
	ll sum2=0;
	for(int i=0;i+1<n;i++){
		sum2+=a[i];
		ll v1=sum-sum2;
		ans=min(ans,labs(sum2-v1));
	}
	printf("%lld\n",ans);
	return 0;
}


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

using namespace std;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, b, e) for (int i = (b); i <= (int)(e); i++)

const int N_MAX = 200005;
const int Q_MAX = 200005;
const int X_J_MAX = 10000;

int N, Q;
vector<int> tree[N_MAX];
vector<int> score(N_MAX, 0);
vector<int> ans(N_MAX, 0);

void dfs(int v, int pre, int sum)
{
  // printf("v = %d, sum = %d\n",v,sum);
  ans[v] += (sum + score[v]);
  for (int u : tree[v])
  {
    if (u != pre)
    {
      dfs(u, v, sum + score[v]);
    }
  }
}

void solve()
{
  scanf("%d%d", &N, &Q);
  REP(i, N - 1)
  {
    int a, b;
    cin >> a >> b;
    tree[a - 1].push_back(b - 1);
    tree[b - 1].push_back(a - 1);
  }
  REP(i, Q)
  {
    int c, d;
    cin >> c >> d;
    score[c - 1] += d;
  }
  dfs(0, -1, 0);
}

int main()
{
  solve();
  REP(i, N - 1)
  printf("%d ", ans[i]);
  printf("%d\n", ans[N - 1]);
  return 0;
}


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


int main()
{
  char a;
  cin >> a;
  if (a >= 'a' && a <= 'z')
    cout << 'a' << endl;
  else
    cout << 'A' << endl;
  return 0;
}

Measured memory_bytes: 3632
package main

import (
	"fmt"
	"strings"
)

func main() {

	var N, K int
	var S string
	fmt.Scan(&N, &K, &S)
	ans := ""
	for i := 0; i < N; i++ {
		if i == K-1 {
			ans += strings.ToLower(string(S[K-1]))
		} else {
			ans += string(S[i])
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1844
#include <iostream>

using namespace std;

int main()
{
	long long a, b, c, k;
	cin >> a >> b >> c >> k;

	if(k % 2 == 0) {
		if(a - b > 1000000000000000000) {
			cout << "Unfair" << endl;
		}
		else {
			cout << a - b << endl;
		}
	}
	else {
		if(b - a > 1000000000000000000) {
			cout << "Unfair" << endl;
		}
		else {
			cout << b - a << endl;
		}
	}
	
	return 0;
}

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

int main() {
	int n, r; cin >> n >> r;
    if (n < 10) cout << r + 100 * (10 - n) << endl;
    else cout << r << endl;
    
    return 0;
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
A = [INT() for _ in range(N)]

tmp = 0
cnt = 0
for i in range(N-1, -1, -1):
	tmp -= 1
	if i < A[i]:
		print(-1)
		exit()
	elif A[i] < tmp:
		print(-1)
		exit()
	elif tmp < A[i]:
		cnt += A[i]
		tmp = A[i]

print(cnt)


Measured memory_bytes: 18196
#include<bits/stdc++.h>
using namespace std;
#define reg register
typedef long long ll;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++)
static char buf[100000],*p1=buf,*p2=buf;
inline int read(void){
	reg char ch=getchar();
	reg int ans=0;
	while(ch<'0'||'9'<ch)ch=getchar();
	while('0'<=ch&&ch<='9')ans=10*ans+ch-'0',ch=getchar();
	return ans;
}

const int MAXN=1e5+5;
const int MAXM=2e5+5;

int n,m;
int a[MAXN],b[MAXN];
vector<int> V;
int c[MAXN],diff[MAXN];
int cnt,head[MAXN],to[MAXM<<1],w[MAXM<<1],Next[MAXM<<1];

inline void Add_Edge(reg int u,reg int v,reg int len){
	Next[++cnt]=head[u];
	to[cnt]=v;
	w[cnt]=len;
	head[u]=cnt;
	return;
}

bool vis[MAXN];
int tot,ans[MAXM];

inline int dfs(reg int u,reg int father,reg int x){
	vis[u]=true;
	reg int t=0;
	for(reg int i=head[u];i;i=Next[i]){
		reg int v=to[i];
		if(!vis[v])
			t^=dfs(v,u,i);
	}
	if(u==father)
		return t;
	if(diff[u]^t){
		ans[++tot]=w[x];
		return 1;
	}
	return 0;
}

int main(void){
	n=read(),m=read();
	for(reg int i=1;i<=n;++i){
		a[i]=read(),b[i]=read();
		V.push_back(a[i]);
	}
	sort(V.begin(),V.end());
	V.erase(unique(V.begin(),V.end()),V.end());
	for(reg int i=1;i<=n;++i){
		a[i]=lower_bound(V.begin(),V.end(),a[i])-V.begin()+1;
		c[a[i]]=b[i];
	}
	for(reg int i=1;i<=n;++i)
		diff[i]=c[i-1]^c[i];
	for(reg int i=1;i<=m;++i){
		static int L,R;
		L=read(),R=read();
		L=lower_bound(V.begin(),V.end(),L)-V.begin()+1;
		R=upper_bound(V.begin(),V.end(),R)-V.begin();
		if(L<=R){
			Add_Edge(L,R+1,i);
			Add_Edge(R+1,L,i);
		}
	}
	dfs(n+1,n+1,0);
	for(reg int i=1;i<=n;++i){
		if(vis[i])
			continue;
		if(dfs(i,i,0)!=diff[i]){
			puts("-1");
			exit(0);
		}
	}
	printf("%d\n",tot);
	sort(ans+1,ans+tot+1);
	for(reg int i=1;i<=tot;++i)
		printf("%d%c",ans[i],i==tot?'\n':' ');
	return 0;
}

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

int main(void){
    string s;
    cin >> s;
    int count = 0;
    int check = 0;

    if(s[0] == 'A'){
    for(int i = 0; i < s.length(); i++){
        if(s[i] >= 'a' && s[i] <= 'z'){
            count++;
        }
        if(s[i] == 'C'){
            if(i >= 2 && i <= s.length() - 2)
                check++;
        }
    }
    }
    if(count == s.length()-2 && check == 1)
        cout << "AC" << endl;
    else
        cout << "WA" << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
void File(){
	freopen("ARC92D.in","r",stdin);
	freopen("ARC92D.out","w",stdout);
}
#define REP(i,a,b) for(register int i=a;i<=b;++i)
#define DREP(i,a,b) for(register int i=a;i>=b;--i)
#define ll long long
const int maxn=2e5+10;
int n;
ll a[maxn],b[maxn],s[30][maxn],ans;
void cal(int p){
	REP(i,1,29){
		ll d=(1<<(i-1));
		ll t=a[p]%(d<<1);
		int pos1=lower_bound(s[i]+1,s[i]+n+1,d-t)-s[i];
		int pos2=lower_bound(s[i]+1,s[i]+n+1,2*d-t)-(s[i]+1);
		int pos3=lower_bound(s[i]+1,s[i]+n+1,3*d-t)-s[i];
		ans=ans^(pos2-pos1+1+n-pos3+1)%2*d;
		//cout<<p<<" "<<i<<" "<<pos1<<" "<<pos2<<" "<<pos3<<endl;
	}
}
int main(){
	//File();
	scanf("%d",&n);
	REP(i,1,n)scanf("%lld",&a[i]);
	REP(i,1,n)scanf("%lld",&b[i]);
	REP(i,1,29){
		int d=(1<<i);
		REP(j,1,n)s[i][j]=b[j]%d;
		sort(s[i]+1,s[i]+n+1);
	}
	REP(i,1,n)cal(i);
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 48640
#include<bits/stdc++.h>
#define MOD 998244353
#define INF 10000000000000001
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define vc vector
#define vll vector<long long>
#define pll pair<long long,long long> 
#define pb push_back
#define ll long long
#define all(v) v.begin(),v.end()
#define T ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define repr(i,n,a) for(ll i=n;i>(long long)a;--i)
#define MAX 1000005
using namespace std;
int main()
{
	ll n,cnt=0,ans=-1;
	cin>>n;
	ll ar[n];
	rep(i,0,n)
	cin>>ar[i];
	if(n==1)
	{
		cout<<"0";
		return 0;
	}
	rep(i,0,n-1)
	{
		if(ar[i]>=ar[i+1])
		cnt++;
		else
		{
			
			cnt=0;
		}
		ans=max(ans,cnt);
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#include<string.h>
using namespace std;
typedef long long int lli;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    lli x,y,i,a,flag;
    cin>>x>>y;
    for(i=0;i<=101;i++)
    {
        a=x-i;
        if(a>=0)
        {
            if(i*2+a*4==y)
            {
                flag=0;
                break;
            }
        }
        else
        {
            flag=1;
            break;
        }
    }
    if(flag==1)
        cout<<"No";
    else
        cout<<"Yes";
}

Measured memory_bytes: 3632
package main

import (
	"fmt"
)

func sumArray(arr []float64) float64 {
	total := 0.0
	for _, e := range arr {
		total += e
	}
	return total
}

func main() {
	var n, k, p int
	fmt.Scan(&n, &k)

	epectationMap := make(map[int]float64, 1000)
	total := 0
	for i := 1; i <= 1000; i++ {
		total += i
		epectationMap[i] = float64(total) / float64(i)
	}

	epectations := make([]float64, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&p)
		epectations[i] = epectationMap[p]
	}

	sum := 0.0
	for i := 0; i < k; i++ {
		sum += epectations[i]
	}

	max := sum
	for i := 1; i <= n-k; i++ {
		sum -= epectations[i-1]
		sum += epectations[i + k - 1]
		if max < sum {
			max = sum
		}
	}
	fmt.Println(max)
}


Measured memory_bytes: 4992
#include <stdio.h>
#include <math.h>
 
int main(void){
	int a,b,c,d;
	int hoge,piyo;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	
	if(a < c){
		if(c - a <= d){
			printf("Yes\n");
			return 0;
		}
	}else{
		if(a - c <= d){
			printf("Yes\n");
			return 0;
		}
	}

	if(a < b){
		hoge = b-a;
	}else{
		hoge = a- b;
	}

	if(b < c){
		piyo = c-b;
	}else{
		piyo = b-c;
	}	

	if(hoge <= d && piyo <= d){
		printf("Yes\n");
		return 0;
	}

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

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

int main(){
  int N;
  cin >> N;
  
  vector<int> X(N);
  for (int i = 0; i < N; i++){
    cin >> X.at(i);
  }
  
  int ans = 10000000;
  for (int i = 1; i <= 100; i++){
    
    int sum = 0;
    for (int j = 0; j < N; j++){
      sum += pow(X.at(j) - i, 2);
    }
    
    ans = min(ans, sum);
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3608
// AOJ1056 Ben Toh

#include <iostream>

using namespace std;

int main(){
	int n;
	double dp[100001];
	dp[0] = 0.0; dp[1] = 1.0; dp[2] = 1.5;
	for(int i=3;i<=100000;i++){
		dp[i] = 0.0;
		double cur = 1.0, mul = 0.5;
		for(int j=2;j<=min(i,100);j++){
			dp[i] += cur*(1-mul)*(j-1+dp[i-j]);
			cur *= mul;
			mul *= 0.5;
		}
		if(i<=100) dp[i] += cur*i;
	}
	while(cin >> n, n){
		printf("%.2lf\n", dp[n]);
	}
}

Measured memory_bytes: 1472
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = 0
for i in range(n):
    c += min(a[i]+a[i+1], b[i])
    a[i+1] -= max(min(b[i]-a[i], a[i+1]), 0)
print(c)

Measured memory_bytes: 19116
/*
* @author:  codancer
* @createTime:  2020-08-22, 19:53:59
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9+7;
#define pb push_back
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define fep(i,a,b) for(int i=(a);i>=(b);i--)
#define deb(x) cerr<<#x<<" = "<<(x)<<"\n"
typedef vector<int> VI;
typedef vector<ll> VII;
typedef pair<int,int> pii;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll Rand(ll B) {
	return (ull)rng() % B;
}
int main(){
	ll a,b,c;
	cin>>a>>b>>c;
	ll k=a/b+(a%b?1:0);
	cout<<k*c<<endl;
	return 0;
}

Measured memory_bytes: 3520
#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



int main() {
	
	int n, x;
	cin >> n >> x;
	vector<int>p(n);
	for (int i = 0; i < n; i++)cin >> p[i];
	sort(p.begin(), p.end());
	int t = 0;
	for (int i = 0; i < n; i++) {
		if (x >= p[i]) {
			x -= p[i];
			if (i == n - 1 && x)break;
			t++;
		}
	}
	cout << t << endl;


	return 0;

}

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

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define For1(i, n) for(int i = 1; i <= (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(ll, k);
    
    constexpr int n = 50;
    vc<ll> a(n, n-1 + k/n);
    For(i, k%n){
        For(j, n) if(j == i) a[j] += n; else a[j] --;
    }
    
    Cout(n);
    Couts(a);
}


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

int main()
{
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    while(1)
    {
        C = C - B;
        if(C <= 0)
        {
            cout << "Yes" << endl;
            break;
        }
        A = A - D;
        if(A <= 0)
        {
            cout << "No" << endl;
            break;
        }
    }
}


Measured memory_bytes: 3632
#include<iostream>
#include<algorithm>
#define MOD 1000000007
#define Nmax 2000010
using namespace std;

//***
long long inv[Nmax],fact[Nmax],invfact[Nmax];
void PRE(){
	inv[1]=fact[0]=invfact[0]=1;
	for(int i=1;i<Nmax;i++){
		if(i>1)inv[i]=(MOD-(MOD/i)*inv[MOD%i]%MOD)%MOD;
		fact[i]=fact[i-1]*i%MOD;
		invfact[i]=invfact[i-1]*inv[i]%MOD;
	}
}
long long C(int n,int k){
	return fact[n]*invfact[k]%MOD*invfact[n-k]%MOD;
}
//***

long long F(int a,int b){
	return C(a+b,a);
}

int main(){
	PRE();
	long long h,w,a,b,ans=0;
	cin>>h>>w>>a>>b;
	for(int i=0;i<h-a;i++){
		ans+=F(i,b-1)*F(w-b-1,h-i-1)%MOD;
		ans%=MOD;
	}
	cout<<ans<<endl;
	return 0;
}


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

int main()
{
    int i, j, k, n, r=0 ;
    string s ;
    cin >> s ;
    if(s[0]=='R')
        r++;
    for(i=1; i<3; i++)
    {
        if(s[i]=='R')
        {
            if(s[i-1]=='R')
                r++;
            else
             r=1;
        }
    }
    cout << r ;
    return 0;
}

Measured memory_bytes: 3620
n, m = map(int, input().split())

ans = []
if m % 2 == 0:
    for i in range(1, m // 2 + 1):
        ans.append((i, m - i + 2))
        ans.append((m + i + 1, 2 * m - i + 2))
else:
    for i in range(1, m // 2 + 1):
        ans.append((i, m - i + 2))
        ans.append((m + i + 1, 2 * m - i + 2))
    ans.append(((m + 1) // 2, (m + 1) // 2 + 1))

for a, b in ans:
    print(a, b)


Measured memory_bytes: 21180
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define all(v) v.begin(),v.end()
#define inf (int)(3e18)
#define P pair<int,int>
#define mod (int)(1e9+7)
#define mod2 998244353

template<class T> inline void chmin(T &a, T b) {
	a = min(a, b);
}
template<class T> inline void chmax(T &a, T b) {
	a = max(a, b);
}


signed main(){
	int a,b,c;cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (int)(n);i++)
using namespace std;
int64_t rockpoint;
int64_t scissorpoint;
int64_t paperpoint;

int getpoint(char hand){
  if(hand == 'r'){
    return paperpoint;
  }else if(hand == 's'){
    return rockpoint;
  }else if(hand == 'p'){
    return scissorpoint;
  }else{
    return 0;
  }
}
int main(){
  int64_t n,k,r,s,p;
  string t;
  cin >> n >> k;
  cin >> r >> s >> p;
  cin >> t;
  
  rockpoint = r;
  scissorpoint = s;
  paperpoint = p;
  
  int64_t maxpoint = 0;
  
  rep(i,n){
    if(i + k <= n - 1){
      if(t.at(i) == t.at(i+k)){
        maxpoint += getpoint(t.at(i));
        t.at(i+k) = 'x';
      }else{
        maxpoint += getpoint(t.at(i));
      }
    }else{
      maxpoint += getpoint(t.at(i));
    }
  }
  cout << maxpoint << endl;
}

Measured memory_bytes: 512
import collections
def solve():
    n = int(input())
    a = [int(input()) for _ in range(n)]

    c = collections.Counter(a)

    num = list(c.values())
    ans = 0
    for i in range(len(num)):
        if num[i]%2 == 1:
            ans += 1

    return ans

if __name__ == "__main__":
    print(solve())



Measured memory_bytes: 16636
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,k;
	cin>>a>>b>>k;

	for(int i=a;i<=min(b,a+k-1);i++){
		cout<<i<<endl;
    }
	for(int j=max(a+k,b-k+1);j<=b;j++){
		cout<<j<<endl;
	}
}

Measured memory_bytes: 256
#![allow(unused)]

//
// Based on EbTech's Scanner https://stackoverflow.com/q/56449027
//
struct Scanner<'a, R: std::io::BufRead> {
    reader: R,
    buf: String,
    iter: std::str::SplitWhitespace<'a>,
}

impl<'a, R: std::io::BufRead> Scanner<'a, R> {
    fn new(reader: R) -> Self {
        Self { reader, buf: String::new(), iter: "".split_whitespace() }
    }

    fn get_str(&mut self) -> &str {
        if let Some(t) = self.iter.next() {
            return t;
        }
        self.buf.clear();
        self.reader.read_line(&mut self.buf).expect("I/O error");
        self.iter = unsafe { std::mem::transmute(self.buf.split_whitespace()) };
        self.get_str()
    }

    fn get<T: std::str::FromStr>(&mut self) -> T {
        self.get_str().parse().ok().expect("Parse error")
    }
}

fn main() {
    let stdin = std::io::stdin();
    solve(Scanner::new(stdin.lock()));
}

fn solve<R: std::io::BufRead>(mut sc: Scanner<R>) {
    let s: String = sc.get();
    let t: String = sc.get();

    if t.starts_with(&s) {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define N 3001
using namespace std;
int w,h;
int dx[]={0,1,0,-1};//^>v<
int dy[]={-1,0,1,0};
vector<int> X,Y,d;
map<int,int> x,y;
int mp[N][N];

int compless(vector<int> A,map<int,int> &M){
  sort(A.begin(),A.end());
  int c=0;
  for(int i=0;i<A.size();i++)if(!M.count(A[i]))M[A[i]]=c++;
  return c;
}

int calc(int y,int x){
  bool used[N][N]={};
  int res=0;
  while(1){
    res++;
    int i=mp[y][x];
    used[y][x]=1;
    while(1){
      y+=dy[i],x+=dx[i];
      if(y<0||x<0||x>=w||y>=h)return res;
      if(mp[y][x]!=-1&&!used[y][x])break;
    }
  }
  assert(0);
}

int main(){
  int n;
  cin>>n;
  X.resize(n),Y.resize(n),d.resize(n);
  for(int i=0;i<n;i++){
    char ch;
    cin>>X[i]>>Y[i]>>ch;
    if(ch=='^')d[i]=0;
    if(ch=='>')d[i]=1;
    if(ch=='v')d[i]=2;
    if(ch=='<')d[i]=3;
  }
  h=compless(Y,y);
  w=compless(X,x);
  
  memset(mp,-1,sizeof(mp));
  for(int i=0;i<X.size();i++)mp[y[Y[i]]][x[X[i]]]=d[i];
  int ans=1;
  for(int i=0;i<n;i++)ans=max(ans,calc(y[Y[i]],x[X[i]]));
  cout <<ans<<endl;

  return 0;
}

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

int main() {
	int a, b, n, x, sum, ans;
	ans = 0;

	cin >> n >> a >> b;

	for (int i = 1; i <= n; i++) {
		sum = 0;

		x = i;

		while (x) {

			sum += x % 10;
			x /= 10;
		}

		if (a <= sum && sum <= b) {
			ans += i;
//			printf("%d\n", ans);
		}
	}
	cout << ans << endl;

	return 0;


}

Measured memory_bytes: 256
a,v = map(float,input().split())
b,w = map(float,input().split())
t = float(input())

if a<b:
    if b+w*t <= a+v*t:
      print('YES')
    else:
      print('NO')
else:
    if a-v*t <=	b-w*t:
      print('YES')
    else:
      print('NO')


Measured memory_bytes: 9112
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
#define endl '\n'
#define deb(x) cout << #x << " = " << x << endl;
const int inf = 1e9;

void solve(){
  int n;
  cin >> n;
  int h[n];
  vector<int>ans(n, inf);
  for(int i = 0; i < n; i++)
    cin >> h[i];
  ans[0] = 0;
  ans[1] = abs(h[0]-h[1]);
  for(int i = 2; i < n; i++) {
    ans[i] = min(ans[i],  ans[i-1] + abs(h[i]-h[i-1]));
    ans[i] = min(ans[i],  ans[i-2] + abs(h[i]-h[i-2]));
  }
  cout << ans[n-1] << endl;
}

int main(){
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		int t = 1, tt = 0;
		//cin >> t;
		while(t--){
			//tt++;
			//cout << "Case #" << t << ": ";
			solve();
		}
	return 0;
}


Measured memory_bytes: 4048
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)

if __name__ == "__main__":
    arr = input().split(" ")
    print(lcm(int(arr[0]), int(arr[1])))

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
const int INF = 100100100;
typedef long long ll;
 
int main() {
   int w,a,b;
   cin >> w >> a >> b;
   if(abs(a-b)<=w)
   cout << 0 << endl;
   else 
   cout << abs(a-b)-w << endl;
}

Measured memory_bytes: 256