akhauriyash/Code-Regression huggingface dataset:
<?php
fscanf(STDIN, "%d %d", $n, $m);

$as = explode(' ', trim(fgets(STDIN)));

$sum = array_sum($as);

arsort($as);

$result = true;
for ($i=0; $i < $m; $i++) {
  $a = array_shift($as);

  if ($a < 1/(4*$m)*$sum) {
    $result = false;
  }
}

if ($result) {
  echo 'Yes';
} else {
  echo 'No';
}


Measured memory_bytes: 4604
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long yen = 1000;
    long stock = 0;
    int n = sc.nextInt();
    int[] price = new int[n];
    for(int i = 0; i < n; i++){
      price[i] = sc.nextInt();
    }
    int day = 0;
    int mode = 1;
    while(day < n){
      int now_price = price[day];
      if(mode == 1){
        //買い時をさぐる
        if(day < n - 1 && price[day + 1] <= now_price){
          day++;
          continue;
        } else if(day + 1 != n){
          //全力で買う
          stock = yen / now_price;
          yen -= stock * now_price;
          mode = 0;
          day++;
        } else {
          day++;
        }
      } else {
        //売り時をさぐる
        if(day < n - 1 && price[day + 1] >= now_price){
          day++;
          continue;
        } else {
          //全力で売る
          yen += now_price * stock;
          stock = 0;
          mode = 1;
          day++;
        }
      }
    }
    System.out.println(yen);
  }
}

Measured memory_bytes: 35756
#include <stdio.h>
#include <iostream>
#include <vector>
#include <assert.h>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <sstream>
#include <memory.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
typedef long long ll;
int main()
{
	int m, n;
	cin >> m >> n;
	m -= n;
	double res = (((1 << n) - 1) / double(1 << n) * (n * 1900 + 100 * m) + (100 * m + 1900 * n) / double(1 << n)) / (1 - ((1 << n) - 1) / double(1 << n));
	printf("%d\n", int(round(res)));
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod=7+1e9;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
ll qpow(ll a,ll b,ll p){a%=p; ll ret=1;for(;b;b>>=1,a=a*a%p) if(b&1) ret=ret*a%p; return ret;}
ll getInv(ll x,ll p){return qpow(x,p-2,p);}
const double pi=acos(-1.0);
double solve(double a,double b,double r){
    return pow(a*a+b*b-2*a*b*cos(r),0.5l);
}
int main(){
    double a,b,h,m; cin>>a>>b>>h>>m;
    double r=abs(h/12.0*2*pi+m/60.0*pi/6.0-m/60.0*2*pi);
    printf("%.11lf\n",solve(a,b,r));
}

Measured memory_bytes: 4264
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll an=0,k,a,b,c;cin>>a>>b>>c>>k;
	if(k){an+=min(k,a);
		k-=min(k,a);}
	if(k)k-=min(k,b);
	if(k){an-=min(k,c);
		k-=min(k,c);}
	cout<<an;
}


Measured memory_bytes: 3508
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############
N,D = inputIL()

if N%(2*D+1) == 0:
  print(N//(2*D+1))
else:
  print(N//(2*D+1)+1)
  


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

int main() {
  string s;
  cin >> s;
  ll ans = 0;
  ll a = 0;
  rep(i, s.size() - 1) {
    if(s[i] == 'A')
      a++;
    else if(s[i] == 'B' && s[i + 1] == 'C') {
      ans += a;
      i++;
    } else
      a = 0;
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan = new java.util.Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        if(n == m){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 24020
#include <iostream>

const int MOD=1e9+7;

int cnt[256];

int main(){
  int N;
  std::string str;
  std::cin>>N>>str;
  for(char c:str){
    cnt[c]++;
  }
  int ans=1;
  for(int c='a';c<='z';c++){
    ans=ans*(cnt[c]+1LL)%MOD;
  }
  std::cout<<(ans+MOD-1)%MOD<<std::endl;
  return 0;
}


Measured memory_bytes: 512
n = int(input())
s = input()

white = s.count('.')
black = n - white
w = 0
b = 0
y = [white]
for i in range(n):
    if s[i] == '#':
        b += 1
    else: w += 1
    y.append(b+white-w)
    if w == white:
        break
print(min(y))

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



int main() {
    int N;
    cin >> N;
    vector<int> x(N,0);
    for(int i=0;i<N;i++)cin>>x[i];
    int res=INT32_MAX;
    for(int p=-1;p<102;p++){
        int total=0;
        for(int i=0;i<N;i++)total+=(x[i]-p)*(x[i]-p);
        res=min(total,res);
    }
    cout<<res;
    return 0;
}

Measured memory_bytes: 3548
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
sum_all = []
for i in range(n):
    if i < n-1:
        if a[i+1]-a[i]==1:
            sum_all.append(b[a[i]-1]+c[a[i]-1])
        else:
            sum_all.append(b[a[i]-1])
    else:
        sum_all.append(b[a[i]-1])
print(sum(sum_all))

Measured memory_bytes: 3064
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

aa = [1,2,3,4,5,6,7,8,9]

def f(p,x,m):
    a = [-1,0,1]
    for k in a:
        y = x+k
        if y >= 0 and y < 10:
            q = p+y*(10**m)
            if m == 0:
                aa.append(q)
            else:
                f(q,y,m-1)

for i in range(1,10):
    for j in range(1,10):
        f(j*(10**i),j,i-1)

n = ni()
print(aa[n-1])

Measured memory_bytes: 12020
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
typedef pair<int,int> P;
const int inf=1000000007;
const int MOD=1000000007;
int n;
string s;
signed main(){
  cin>>n;
  cin>>s;
  rep(i,n){
    s+="..";
  }
  int res=0;
  vector<vector<int>> color(3,vector<int>(3*n+1,0));
  for(int i=n-1;i>=0;i--){
    rep(j,3){
      color[j][i]=color[j][i+1];
    }
    if(s[i]=='R')color[0][i]++;
    if(s[i]=='G')color[1][i]++;
    if(s[i]=='B')color[2][i]++;
  }
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      if(s[i]=='R'){
        if(s[j]=='B'){
          res+=color[1][j+1];
          if(s[j+(j-i)]=='G')res--;
        }
        if(s[j]=='G'){
          res+=color[2][j+1];
          if(s[j+(j-i)]=='B')res--;
        }
      }
      if(s[i]=='G'){
        if(s[j]=='R'){
          res+=color[2][j+1];
          if(s[j+(j-i)]=='B')res--;
        }
        if(s[j]=='B'){
          res+=color[0][j+1];
          if(s[j+(j-i)]=='R')res--;
        }
      }
      if(s[i]=='B'){
        if(s[j]=='R'){
          res+=color[1][j+1];
          if(s[j+(j-i)]=='G')res--;
        }
        if(s[j]=='G'){
          res+=color[0][j+1];
          if(s[j+(j-i)]=='R')res--;
        }
      }
    }
  }
  cout<<res<<"\n";
  return 0;
}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;

void Main() {
    long double n, m, d; cin >> n >> m >> d;
    long double ans;
    if(d == 0) ans = (m - 1) / n;
    else ans = 2 * (n - d) * (m - 1) / (n * n);

    cout << ans << endl;
    return;
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Measured memory_bytes: 3772
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int r = sc.nextInt();

    if(r < 1200){
        System.out.println("ABC");
    }else if(r < 2800){
        System.out.println("ARC");
    }else{
        System.out.println("AGC");
    }
    
  

    
    
    


    


    
    


    
	}
}

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

const int D = 365;
vector<int> C(26), ans(D, 0), last(26,-1);
vector<vector<int>> S(D, vector<int>(26));

void debug1()
{
    //rep(i,26) cout << C[i] << " "; cout << endl;
    rep(i,D){
        rep(j,26) cout << S[i][j] << " "; cout << endl;
    }
}

void rand_init()
{
    rep(i,26) C[i] = rand() % 100;
    rep(i,D) rep(j,26) S[i][j] = rand() % 20000;
}
  

void input()
{
    int tmp;
    cin >> tmp;
    if(tmp == 0)
    {
      rand_init();
      return;
    }
    rep(i,26) cin >> C[i];
    rep(i,D)rep(j,26) cin >> S[i][j];
    //rep(i,D) cin >> ans[i]; rep(i,D) ans[i]--; //B,C問題用
}

void output()
{
    for(auto x : ans)
        cout << x+1 << "\n";
}

int calc(vector<int> &vec)
{
    int score = 0;
    rep(i,D)
    {
        int cur = vec[i];
        score += S[i][cur];
        last[cur] = i;
        rep(j,26)
        {
            score -= C[j] * (i - last[j]);
        }
        //cout << score << endl;
    }
    return score;
}

void greedy()
{
    rep(i,D)
    {
        rep(j,26)
        {
            if(S[i][j] > S[i][ans[i]])
            {
                ans[i] = j;
            }
        }
    }

}

void incremental()
{
    rep(t, 10000)
    {
        int d = rand() % D, q = rand() % 26;
        vector<int> old = ans;
        ans[d] = q;
        if(calc(ans) < calc(old))
        {
            ans = old;
        }
    }
}



void rand_test(int r)
{
    rep(q,r)
    {
        rand_init();
        //debug1();
        greedy();
        cout << calc(ans) << endl;
    }
}

int main()
{
    input();
    //rand_test(10);
    greedy();
    incremental();
    output();
    return 0;
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
#include <time.h>
#define int long long int
#define pb push_back
#define all(a) a.begin(), a.end()
#define scnarr(a, n) for (int i = 0; i < n; ++i) cin >> a[i]
#define vi vector<int>
#define si set<int>
#define pii pair <int, int>
#define sii set<pii>
#define vii vector<pii>
#define mii map <int, int>
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
using namespace chrono;
/* -------------------------------Solution Sarted--------------------------------------*/
//Constants
const int MOD = 1000000007; // 1e9 + 7
const int MAXN = 10000005; // 1e7 +5


bool isNotPrime[MAXN +1];
vi primes, spf(MAXN +1); // spf - Smallest prime factor of a number
void sieve(){
	memset(isNotPrime, 0, sizeof(isNotPrime));

	spf[1] = 1;
	for(int i = 2; i <= MAXN; i++)
		spf[i] = i;

	for(int i = 2; i <= MAXN; i+=2)
		spf[i] = 2;

	isNotPrime[0] = isNotPrime[1] = 1; 
	for(int i = 2; i*i <= MAXN; ++i){
		if(isNotPrime[i] == false){
			spf[i] = i;
			primes.push_back(i);
			for(int j = i*i; j <= MAXN; j += i){
				isNotPrime[j] = 1;
				if(spf[j] == j)
					spf[j] = i;
			}
		}
	}
}

mii prime_factorization(int val){
	mii res;
	while(val != 1){
		res[spf[val]]++;
		val /= spf[val];
	}
	return res;
}


int num_of_divisors(int n){
	mii count = prime_factorization(n);
	int ans = 1;
	for(auto itr: count){
		ans *= (itr.second +1); 
	}
	return ans;
}

void solve(){
	int n;
	cin >> n;
	int ans = 1;
	for(int i = 2; i <= n; ++i)
		ans += i*num_of_divisors(i);

	cout << ans << endl;

}

signed main()
{
	faster;
#ifndef ONLINE_JUDGE
	freopen("ip.txt", "r", stdin);
	freopen("op.txt", "w", stdout);
#endif
	// int t; cin >> t; while(t--)
	sieve();
		solve();
	return 0;
}


//Author : Ankit Raj
//Problem Link :

/*Snippets*/
/*
sieve - prime factorization using sieve and primes in range
zpower - pow with mod
plate - Initial template
bfs 
dfs
fenwik - BIT
binary_search
segment_tree
*/
	

Measured memory_bytes: 91048
import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()

N,M = na()
GATA = [0]*(N+1)
for i in range(M):
    L,R = na()
    GATA[L-1]+=1
    GATA[R]-=1
ans = 0
tt = 0
for i,t in enumerate(GATA):
    tt += t
    if tt == M:
        ans+=1
print(ans)

Measured memory_bytes: 4084
#include<bits/stdc++.h>
#define MAX 10001

class Edge {
public:
    int target, cost;
    Edge(int target = 0, int cost = 0) : target(target), cost(cost) {}
};

std::vector<Edge> G[MAX];
int V, maxv, idx;
int C[MAX], SEC[MAX];
bool visited[MAX];

void dfs(int current){
    visited[current] = true;
    for(unsigned long i = 0; i < G[current].size(); i++){
        int next = G[current][i].target;
        if(!visited[next]){
            C[next] = C[current] + G[current][i].cost;
            if (C[next] > maxv) {
                maxv = C[next];
                idx = next;
            }
            dfs(next);
        }
    }
}

void solve(){

    int x;
    for (int i = 0; i < V; i++) {
        visited[i] = false;
        C[i] = 0;
    }
    maxv = idx = 0;
    dfs(0);
    x = idx;
    for (int i = 0; i < V; i++) {
        visited[i] = false;
        C[i] = 0;
    }
    x = idx;
    maxv = idx = 0;
    dfs(x);
    for(int i = 0; i < V; i++) SEC[i] = C[i];

    for (int i = 0; i < V; i++) {
        visited[i] = false;
        C[i] = 0;
    }
    x = idx;
    maxv = idx = 0;
    dfs(x);
}
int main() {
    int source, target, cost;
    std::scanf("%d", &V);
    for(int i = 0; i < V-1; i++){
        std::scanf("%d %d %d", &source, &target, &cost);
        G[source].push_back(Edge(target, cost));
        G[target].push_back(Edge(source, cost));
    }
    solve();
    for(int i = 0; i < V; i++){
        std::printf("%d\n", std::max(SEC[i], C[i]));
    }
    return 0;
}



Measured memory_bytes: 4160
while True:
    H,W=map(int, input().split())
    if H==0 and W==0:
        break
    for i in range(H):
        for j in range(W):
            if i==j or (i-j)%2==0 or (j-i)%2==0:
                print("#", end="")
            else:
                print(".", end="")
        print()
    print()


Measured memory_bytes: 7008
n = int(input())
a_array, b_array, c_array = [list(map(int, input().split())) for _ in range(3)]
c_array.append(0)

sum = 0

for m in a_array:
    sum += b_array[m-1]

for i in range(n-1):
    if (a_array[i] + 1 == a_array[i+1]):
        sum += c_array[a_array[i]-1]

print(sum)



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

using namespace std;

int main(){
  int n,m,k;
  cin>>n>>m>>k;
  vector<long long> A(n+1,0),B(m+1,0);
  A[0]=B[0]=0;
  for(int i=1;i<n+1;i++){
	cin>>A[i];
    A[i]+=A[i-1];
  }

  for(int i=1;i<m+1;i++){
    cin>>B[i];
    B[i]+=B[i-1];
  }

  int j=m,sum=0;
  for(int i=0;i<=n;i++){
    if(A[i]>k)
      break;
    while(B[j]>k-A[i])
      j--;
    sum=max(sum,i+j);
  }
  cout<<sum;
  return 0;
}


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

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

    int ans = 0;

    do {
        if (n % 10 == 2) {
            ans++;
        }
    } while ((n /= 10) > 0);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    A, B = input_nums()
    ans = max(A+B, A-B)
    ans = max(ans, A * B)
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll=long long;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

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

    if(a+b==c || a+c==b || b+c==a) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

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

	for(int i=1;i<=9;i++){
		if(n%i==0){
			if(n/i <= 9 and 1 <= n/i) {cout<<"Yes"; return 0;}
		}
	}

	cout<<"No";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF LLONG_MAX/10
#define rep(i,n) for(int i=0;i<n;i++)
#define krep(i,k,n,m) for(int i=k;i<n;i+=m)
#define erep(i,k,n) for(int i=k;i<n;i++)
#define mod 1000000007
//最大公約数
int gcd(int s,int b){
    if(b==0)return s;
    return gcd(b,s%b);
}
signed main(){
    int n,a,b;
    cin>>n>>a>>b;
    int x[n];
    rep(i,n){
        cin>>x[i];
    }
    int sa=b/a;
    int ans=0;
    rep(i,n-1){
        if(sa>=x[i+1]-x[i]){
            ans+=(x[i+1]-x[i])*a;
        }
        else{
            ans+=b;
        }
    }
    cout<<ans<<endl;
}


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

void chmax(int& a, int b) {
  if (a < b) a = b;
}

int main() {
  string S;
  cin >> S;
  
  int N = S.size();
  vector<vector<int>> moji(26);
  
  for (int i = 0; i < 26; i++) {
    moji[i].push_back(-1);
  }
  
  for (int i = 0; i < N; i++) {
    moji[S[i] - 'a'].push_back(i);
  }
  
  
  for (int i = 0; i < 26; i++) {
    moji[i].push_back(N);
  }
  

  
  int ans = 1000;
  for (int i = 0; i < 26; i++) {
    int MAX = 0;
    //それぞれの文字についての最大の間隔を求める
    
    int M = moji[i].size();
    for (int j = 0; j < M-1; j++) {
      MAX = max(MAX, moji[i][j+1]-1-moji[i][j]);
      
    }
    
    ans = min(ans, MAX);

    
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 3632
import math
import sys
import itertools
import queue
from fractions import gcd

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

mod = 1000000007

"""
# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]

# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
"""

if __name__ == "__main__":
    K, X = map(int, sys.stdin.readline().split())
    ls = []
    for i in range(max(-1000000, X - K + 1), X):
        ls.append(i)
    for i in range(X, min(X + K, 1000001)):
        ls.append(i)

    print(*ls)

Measured memory_bytes: 5712
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    a = cino()
    l = cina()
    check = True
    suma = 1
    l.sort()
    if l[0]==0:
        print(0)
    else:
        for i in l:
            suma = suma*i
            if suma>1000000000000000000:
                check = False
                break
        if check:
            print(suma)
        else:
            print(-1)


if __name__ == '__main__':
    main()


Measured memory_bytes: 22728
from bisect import bisect_right, bisect_left
from collections import Counter, deque
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import groupby, permutations, combinations, product
from sys import stdin, stderr


# 最大公約数（ユークリッドの互除法）
# Python3.5 で math.gcd()が追加され、
# AtCoder環境と最新環境でパッケージが分かれてしまったので、自分で書いておく
def gcd(x, y):
    return x if y == 0 else gcd(y, x % y)


# 拡張ユークリッド互除法
# 正整数x, y について、a*x + b*y == gcd(x,y)なるa,bを返す。
# 特に、互いに素なるx, yについては a*x + b*y == 1 となる a, b。
def exgcd(x, y):
    if y == 0:
        return 1, 0
    a, b = exgcd(y, x % y)
    return b, a - (x // y) * b


# 最小公倍数
def lcm(x, y):
    m = gcd(x, y)
    return (x // m) * (y // m)


def main():
    n = int(input())
    ss = {}
    m = 0
    for i in range(n):
        s = input()
        if s not in ss:
            ss[s] = 0
        ss[s] += 1
        m = max(m, ss[s])
    ret = []
    for s in ss.keys():
        if ss[s] == m:
            ret.append(s)
    ret = sorted(ret)
    return "\n".join(ret)


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

Measured memory_bytes: 33504
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	list := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&list[i])
		if list[i] == 0 {
			fmt.Println(0)
			return
		}
	}

	result := 1
	for i := 0; i < n; i++ {
		result *= list[i]
		if result > 1000000000000000000 || result < list[i] {
			fmt.Println(-1)
			return
		}
	}
	fmt.Println(result)
}


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

int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,-1,1};
int w,h;

int dfs(int y, int x, set<char>& flag, vector<string>& m,vector<vector<int> >& used){


  if(y >= h || y < 0 || x >= w || x < 0) return 0; 
  if(used[y][x] == 1) return 0; // ??¢?´¢??????
  if(m[y][x] == 'B' || m[y][x] == 'W'){
    flag.insert(m[y][x]);
    return 0;
  }


  used[y][x] = 1;  
  int ans = 1;
  for(int i=0; i<4; i++){
    int nx = x + dx[i], ny = y + dy[i];
    ans += dfs(ny,nx,flag,m,used);
  }
  return ans;
}


int main(){

  while(1){
    cin >> w >> h;
    if(!w and !h) break;

    vector<string> m(h);
    for(int j=0; j<h; j++)
      cin >> m[j];

    int bl=0,wh=0;
    vector<vector<int> > used(h,vector<int>(w,0));
    for(int j=0; j<h; j++){
      for(int i=0; i<w; i++){
	if(m[j][i] == '.' and used[j][i] == 0){
	  set<char> flag;
	  int x = dfs(j,i,flag,m,used);
	  if(flag.size() == 1 and *flag.begin() == 'B')
	    bl += x;
	  if(flag.size() == 1 and *flag.begin() == 'W')
	    wh += x;
	}
      }
    }
    cout << bl << " " << wh << endl;
  }
  
}

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

namespace ForATCODER
{
    public class Program
    {
        public static void Main(string[] args)
        {
          //  long res = 0;
            //     long[] kn = s2iarray(Console.ReadLine().Split(' '));
            //   long[] an = s2iarray(Console.ReadLine().Split(' '));
            int r = s2i(Console.ReadLine());
            Console.WriteLine(r * 2 * Math.PI);


        }


        static int s2i(String s)
        {
            return Convert.ToInt32(s);
        }
        static void RESULT(double res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(long res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(ulong res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(int res)
        {
            Console.WriteLine(res);
        }
        static void RESULT(String res)
        {
            Console.WriteLine(res);
        }
        static String[] ReadLineAll(int count)
        {
            String[] res = new String[count];
            for (int i = 0; i < count; i++)
            {
                res[i] = Console.ReadLine();
            }
            return res;
        }

        static int[] s2iarray(String[] src)
        {
            int len = src.Length;
            int[] res = new int[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToInt32(src[i]);
            }
            return res;
        }
        static long[] s2larray(String[] src)
        {
            int len = src.Length;
            long[] res = new long[len];
            for (int i = 0; i < len; i++)
            {
                res[i] = Convert.ToInt64(src[i]);
            }
            return res;
        }
    }
}


Measured memory_bytes: 27624
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a);  
} 

int main(){
    long long int a, b;
    cin >> a >> b;
    cout << (a*b)/gcd(a, b);
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define rep(i, n) for(int i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

ll powmod(ll x, ll n) { // like pow(x, n)
  ll r = 1;
  while (n) {
    if (n & 1) {
      r = r * x % MOD;
    }
    x = x * x % MOD;
    n >>= 1;
  }
  return r;
}

ll dp[1000100][2];  // dp[i][s] .. i: position, s: equal or lower

int main(int argc, char** argv) {
  string L;
  cin >> L;
  int N = L.size();
  dp[0][0] = 1;
  rep(i, N) {
    { // a + b == 0
      if (L[i] == '0') {
        dp[i+1][0] = dp[i][0];
        dp[i+1][1] = dp[i][1];
      } else { // L[i] == '1', so ns is 1
        dp[i+1][1] = (dp[i][0] + dp[i][1]) % MOD;
      }
    }
    { // a + b == 1
      if (L[i] == '0') {
        // We can add only when s == 1
        (dp[i+1][1] += (dp[i][1] * 2) % MOD) %= MOD;
      } else { // L[i] == '1'
        (dp[i+1][0] += (dp[i][0] * 2) % MOD) %= MOD;
        (dp[i+1][1] += (dp[i][1] * 2) % MOD) %= MOD;
      }
    }
  }

  cout << (dp[N][0] + dp[N][1]) % MOD << endl;
}


Measured memory_bytes: 2048
#include<bits/stdc++.h>
#include <cstdio>
using namespace std;
#define ll  long long
#define PB push_back
#define ld long double
#define ff first
#define ss second
# define st(v) (v).begin(),(v).end()
const int dx[4] = {1,0,0,-1};
const int dy[4] = {0,-1,1,0};
const ll inf = 1e18 + 2 ;
const int nmax =2e5 + 5 ;
// C = (dp[j] + a[i]*a[i] + a[j] * a[j] )  m = (- 2 * a[j])
vector < pair < ll , ll > > hull(nmax);
int nhull ;
ll value ( ll xval , int hnum ){
    return xval * hull[hnum].ff + hull[hnum].ss ;
}
ld inter( int left , int right){
    return ((ld) hull[right].ss - hull[left].ss) / ((ld) hull[left].ff - hull[right].ff);
}
ll search (ll xval){
    if(nhull==1) return value(xval,0);
    if( value(xval,0) <= value(xval,1))
        return value(xval,0);
    if( value(xval,nhull-2) >= value(xval,nhull-1) )
        return value(xval,nhull-1);
    int lo = 1 , hi = nhull - 2 ;
    while( lo < hi ){
        int mid = (lo + hi + 1) /2 ;
        if( value(xval, mid-1) <= value(xval,mid)){
            hi = mid - 1;
        }
        else
            lo = mid ;
    }
    return value(xval,lo) ;
}
void add(pair < ll , ll > x){
    hull[nhull] = x ;
    while( nhull>= 2 && inter(nhull-2,nhull) >= inter(nhull-1,nhull)){
        hull[nhull-1] = hull[nhull] ;
        nhull--;
    }
    nhull++;
}
void solve( ){
     int n ;
     cin >> n ;
     ll c ;
     cin >> c ;
     vector < ll > a(n) ;
     for( int i = 0 ; i < n; i++) cin >> a[i] ;
     vector < ll > dp(n,inf);
     dp[0] = 0 ;
     add({-2*a[0],a[0]*a[0]});
     for( int i = 1 ; i < n ; i++){
//        for( int j = 0 ; j < i ; j++){
//            dp[i] = min(dp[i],dp[j]+(a[i]-a[j])*(a[i]-a[j]) + c);
//        }
        dp[i] = search(a[i]) + a[i]*a[i] + c ;
        add({-2*a[i] ,dp[i] + a[i] * a[i] });
     }
     cout << dp[n-1] ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int q=1;
    //cin >> q;
    for( int i = 0 ; i < q ; i++){
        solve();
    }
}


Measured memory_bytes: 6528
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;


int main()
{
	FILE *fin = NULL, *fout = NULL;
	//fin = freopen("input.txt", "r", stdin);
	//fout = freopen("output.txt", "w", stdout);
	
	char S[10]; scanf("%s", S);
	
	if (S[0] == S[1] || S[1] == S[2] || S[2] == S[3]){
		printf("Bad");
	}
	else{
		printf("Good");
	}

	//finalize
	if (NULL != fin) fclose(fin);
	if (NULL != fout) fclose(fout);

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ul unsigned long long int
#define ld long double
#define f(t) for(ll i =0;i<t;i++)
#define vi vector<int>
#define vl vector<ul>
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define inf 4e18
#define EPS 1e-3
#define PI 3.1415926535897932385
#define display(v) f(v.size())cout << v[i]<<" "
const double h = 1e-6;
const int MAX_  = 200005;
#define all(v) v.begin(),v.end()

inline ll mul(ll a, ll b){ return (a * 1ll * b) % MOD; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += MOD; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > MOD) c -= MOD; return c; }
ll sqr(ll x)
{
    return x*x;
}
 //////////////////////*********CODE***********/////////////////////
 //////////////////////////////////////////////////////////////////
struct graph
{
    vector<pair<int,int> > v;
};
int col[MAX_];
graph G[MAX_];
void  dfs(int start,int par = -1)
{
     for(int i =0;i<G[start].v.size();i++)
    {
        int u = G[start].v[i].ff;
        int w = G[start].v[i].ss;
        if(u != par)
        {
            if(w%2 == 0)
            {
                col[u] = col[start];
            }
            else
            {
                col[u] = 1-col[start];
            }
            dfs(u,start);
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;  cin>>n;
    memset(col,-1,sizeof(col));
    f(n-1)
    {
        int u,v,w;  cin>>u>>v>>w;
        G[u].v.pb({v,w});
        G[v].v.pb({u,w});
    }
    col[1] = 0;
    dfs(1);
    for(int i =1;i<=n;i++)cout << col[i] << "\n";

       
    return 0;
}
    


Measured memory_bytes: 11904
/***********************************************
 *                   _ooOoo_                   *
 *                  o8888888o                  *
 *                  88" . "88                  *
 *                  (| -_- |)                  *
 *                  O\  =  /O                  *
 *               ____/`---'\____               *
 *             .'  \\|     |//  `.             *
 *            /  \\|||  :  |||//  \            *
 *           /  _||||| -:- |||||-  \           *
 *           |   | \\\  -   * |    |           *
 *           | \_|  ''\---/''  |   |           *
 *           \  .-\__  `-`  ___/-. /           *
 *         ___`. .'  /--.--\  `. . __          *
 *      ."" '<  `.___\_<|>_/___.'  >'"".       *
 *     | | :  `- \`.;`\ _ /`;.`/ - ` : | |     *
 *     \  \ `-.   \_ __\ /__ _/   .-` /  /     *
 *======`-.____`-.___\_____/___.-`____.-'======*
 *                   `=---='                   *
 *^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

             佛祖保佑       永无BUG

   本程序已经经过开光处理，绝无可能再产生bug
 **********************************************/
#include<algorithm>
#include <iostream>
#include  <cstdlib>
#include  <cstring>
#include   <string>
#include   <vector>
#include   <cstdio>
#include    <queue>
#include    <stack>
#include    <ctime>
#include    <cmath>
#include      <map>
#include      <set>
#define ll long long
#define INF 0x3f3f3f3f
#define db1(x) cout<<#x<<"="<<(x)<<endl
#define db2(x,y) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<endl
#define db3(x,y,z) cout<<#x<<"="<<(x)<<", "<<#y<<"="<<(y)<<", "<<#z<<"="<<(z)<<endl
using namespace std;

int n1[100010],n2[100010];

const int maxn=1e5+10;

int main(void)
{
    #ifdef test
    freopen("in.txt","r",stdin);
    //freopen("in.txt","w",stdout);
    clock_t start=clock();
    #endif //test

    int a,b,m,m1,m2;scanf("%d%d%d",&a,&b,&m);m1=m2=maxn;
    for(int i=1;i<=a;i++)scanf("%d",&n1[i]),m1=min(n1[i],m1);
    for(int i=1;i<=b;i++)scanf("%d",&n2[i]),m2=min(n2[i],m2);
    int ans=m1+m2;
    for(int i=0;i<m;i++)
    {
        int x,y,z;scanf("%d%d%d",&x,&y,&z);
        ans=min(ans,n1[x]+n2[y]-z);
    }
    printf("%d\n",ans);


    #ifdef test
    clockid_t end=clock();
    double endtime=(double)(end-start)/CLOCKS_PER_SEC;
    printf("\n\n\n\n\n");
    cout<<"Total time:"<<endtime<<"s"<<endl;        //s为单位
    cout<<"Total time:"<<endtime*1000<<"ms"<<endl;    //ms为单位
    #endif //test
    return 0;
}


// ━━━━━━神兽出没━━━━━━
//      ┏┓       ┏┓
//     ┏┛┻━━━━━━━┛┻┓
//     ┃           ┃
//     ┃     ━     ┃
//     ????━????   ┃
//     ┃           ┃
//     ┃    ┻      ┃
//     ┃           ┃
//     ┗━┓       ┏━┛
//       ┃       ┃
//       ┃       ┃
//       ┃       ┗━━━┓
//       ┃           ┣┓
//       ┃           ┏┛
//       ┗┓┓┏━━━━━┳┓┏┛
//        ┃┫┫     ┃┫┫
//        ┗┻┛     ┗┻┛
//
// ━━━━━━感觉萌萌哒━━━━━━


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

int main(){
    int n,l;
    cin >> n >> l;
    string s[n];
    for(int i=0;i<n;i++){
        cin >> s[i];
    }
    sort(s,s+n);
    for(int i=0;i<n;i++){
        cout << s[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
void solve(){
	ll n,k;
	cin>>n>>k;
	vector<ll>a(n);
	for(ll i=0;i<n;i++) cin>>a[i];
	ll prod=1;
	sort(a.begin(),a.end());
	if(a[n-1]==0&&k%2==1) {cout<<0;return;}
	if(a[n-1]<0&&k&1){
		for(ll i=n-1;i>=n-k;i--){
			prod=(a[i]*prod)%mod;
		}
		cout<<((prod%mod)+mod)%mod;return;
	}
	ll i=0;ll j=n-1;
	if(a[n-1]>0&&k&1){
		prod=(prod*a[n-1])%mod;
		j--;k--;
	}
	k=k>>1;
	for(ll itr=0;itr<k;itr++){
		ll lprod=a[i]*a[i+1];
		ll rprod=a[j]*a[j-1];
		if(lprod>rprod){
			prod=prod*a[i]%mod*a[i+1]%mod;
			i+=2;
		}
		else{
			prod=prod*a[j]%mod*a[j-1]%mod;
			j-=2;
		}
	}
	if(prod<0) cout<<((prod%mod)+mod)%mod;
	else cout<<prod%mod;
} 
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);	 
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 4708
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

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

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 26;

int cnt[N];

int main() {
	string S;cin>>S;
	rep(i,S.size()) cnt[S[i]-'a']++;
	int i=-1;
	rep(j,N) if(cnt[j]==0) {i=j; break;}
	if(i==-1) cout<<"None"<<endl;
	else cout<<char('a'+i)<<endl;
}


Measured memory_bytes: 512
public class Main {
 public static void main(String[] args) {
    java.util.Scanner scanner = new java.util.Scanner(System.in);
    char x = scanner.next().charAt(0);
    char y = scanner.next().charAt(0);
    if (x > y) {
      System.out.println(">");
    } else if (x == y) {
      System.out.println("=");
    } else {
      System.out.println("<");
    }
 }
}

Measured memory_bytes: 23124
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt(),b = sc.nextInt(),c = sc.nextInt(),ans = 0;
        ans = a / ( b + c);
        ans = a % (b + c) < c ? ans-1 : ans;
        System.out.println(ans);
    }
}


Measured memory_bytes: 22868
#include <iostream>
typedef long long int lli;
using namespace std;
int main(void)
{
	lli N; cin >> N;
	lli ans = 0;
	if (N % 2 == 1) {
		cout << 0 << endl;
		return 0;
	}
	for (lli i = 10; N >= i; i*=5) {
		ans += N / i;

	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <climits>
#include <cstdio>
#include <cstdint>
#include <cstring>

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

using i32 = int32_t;
using u32 = uint32_t;
using f32 = float;
using f64 = double;
using i64 = int64_t; 
using u64 = uint64_t; 

#define SELECTER(_1, _2, _3, _4, _5, _6, _7, _8, SELECT, ...) SELECT

#define _FC1(func, type, _1)      func(type, _1);
#define _FC2(func, type, _1, ...) func(type, _1); _FC1(func, type, __VA_ARGS__);
#define _FC3(func, type, _1, ...) func(type, _1); _FC2(func, type, __VA_ARGS__);
#define _FC4(func, type, _1, ...) func(type, _1); _FC3(func, type, __VA_ARGS__);
#define _FC5(func, type, _1, ...) func(type, _1); _FC4(func, type, __VA_ARGS__);
#define _FC6(func, type, _1, ...) func(type, _1); _FC5(func, type, __VA_ARGS__);
#define _FC7(func, type, _1, ...) func(type, _1); _FC6(func, type, __VA_ARGS__);
#define _FC8(func, type, _1, ...) func(type, _1); _FC7(func, type, __VA_ARGS__);

#define _FCN(func, type, ...) SELECTER(__VA_ARGS__, _FC8, _FC7, _FC6, _FC5, _FC4, _FC3, _FC2, _FC1)(func, type, __VA_ARGS__);

constexpr const char *type2fmt(const char *fmt) {
  if(strcmp(fmt, "i32")) return "%d";
  if(strcmp(fmt, "u32")) return "%u";
  if(strcmp(fmt, "f32")) return "%f";
  if(strcmp(fmt, "f64")) return "%lf";
  if(strcmp(fmt, "i64")) return "%lld";
  if(strcmp(fmt, "u64")) return "%llu";
  if(strcmp(fmt, "char*")) return "%s";
  return "";
}

#define _R(type, _1) type _1; { type _t; scanf(type2fmt(#type), &_t); _1 = _t; }
#define _P(type, _1) { const type _t = (_1); printf(type2fmt(#type), _t); putchar('\n'); }

#define RI(...)   _FCN(_R, i32, __VA_ARGS__);
#define RUI(...)  _FCN(_R, u32, __VA_ARGS__);
#define RF(...)   _FCN(_R, f32, __VA_ARGS__);
#define RD(...)   _FCN(_R, f64, __VA_ARGS__);
#define RLL(...)  _FCN(_R, i64, __VA_ARGS__);
#define RULL(...) _FCN(_R, u64, __VA_ARGS__);

#define PI(...)   _FCN(_P, i32, __VA_ARGS__);
#define PUI(...)  _FCN(_P, u32, __VA_ARGS__);
#define PF(...)   _FCN(_P, f32, __VA_ARGS__);
#define PD(...)   _FCN(_P, f64, __VA_ARGS__);
#define PLL(...)  _FCN(_P, i64, __VA_ARGS__);
#define PULL(...) _FCN(_P, u64, __VA_ARGS__);
#define PS(...)   _FCN(_P, char*, __VA_ARGS__);

#define REP(n) for (int _i = 0; _i < n; _i++)

const u64 mod = 1000000007;

int main() {
  string s;
  cin >> s;
  PI(700 + ((s[0] == 'o') + (s[1] == 'o') + (s[2] == 'o')) * 100);
}


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

int main(){
    int n,l;
    cin >> n >> l;
    vector<string> s(n);
    for(int i=0;i<n;i++){
        cin >> s[i];
    }
    sort(s.begin(),s.end());
    for(int i=0;i<n;i++){
        cout << s[i];
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) find(rng(v),x)!=v.end()
#define incls(s,c) s.find(c)!=string::npos
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
//const long double EPS = 1e-14;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; scanf("%d",&x); return x;}
//template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main () {
  int n, k;
  cin >> n >> k;
  vi h(n);
  rep(i,n) cin >> h[i];
  sort(rrng(h));
  ll ans = 0;
  srep(i,k,n) ans += (ll)h[i];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long ll;
ll n, a[100005], x[100005];
vector<pair<ll,ll> > st;

int main()
{
	scanf("%lld",&n);
	for(ll i=1;i<=n;i++) {
		scanf("%lld",&a[i]);
		if(st.empty() || a[i] > st.back().X) {
			st.push_back({a[i], i});
		}
	}
	sort(a+1, a+1+n);
	ll prv = 0, cur = n, ans = 0, i = 1;
	for(auto &T : st) {
		ll L = T.X;
		for(; i<=n && a[i] <= L; i++) {
			ans += cur * (a[i] - prv);
			cur--; prv = a[i];
		}
		ans += cur * (L - prv);
		x[T.Y] = ans;
		prv = L; ans = 0;
	}
	for(ll i=1;i<=n;i++) printf("%lld\n",x[i]);
}


Measured memory_bytes: 4336
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>
#include<functional>
#include<iomanip>
#include<deque>

using namespace std;
typedef long long ll;

ll N;
vector<vector<char>> ans;

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) {
		char S[1030] = {};
		vector<char> vec;
		ans.push_back(vec);
		cin >> S;
		for (int j = 1; j < 1030; j++) {
			if (S[j] == 0)break;
			if (S[j] == '0' && S[j - 1] != '0') {
				for (int k = j - 1; k >= 0; k--) {
					if (S[k] != S[j - 1] || k == 0) {
						if (k == 0 && S[0] != '0')k--;
						switch (S[j - 1]) {
						case '1':
							switch ((j - k) % 5) {
							case 0:
								ans[i-1].push_back('?');
								break;
							case 1:
								ans[i-1].push_back(' ');
								break;
							case 2:
								ans[i-1].push_back('.');
								break;
							case 3:
								ans[i-1].push_back(',');
								break;
							case 4:
								ans[i-1].push_back('!');
							}
							break;
						case '2':
							ans[i-1].push_back('a' + (j - k - 2) % 3);
							break;
						case '3':
							ans[i-1].push_back('d' + (j - k - 2) % 3);
							break;
						case '4':
							ans[i-1].push_back('g' + (j - k - 2) % 3);
							break;
						case '5':
							ans[i-1].push_back('j' + (j - k - 2) % 3);
							break;
						case '6':
							ans[i-1].push_back('m' + (j - k - 2) % 3);
							break;
						case '7':
							ans[i-1].push_back('p' + (j - k - 2) % 4);
							break;
						case '8':
							ans[i-1].push_back('t' + (j - k - 2) % 3);
							break;
						case '9':
							ans[i-1].push_back('w' + (j - k - 2) % 4);
						}
						break;
					}
				}
			}
		}
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < ans[i].size(); j++)cout << ans[i][j];
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3016
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
ll c[25];int v[25];
int main(){
	ll n;
	scanf("%lld",&n);
	ll k=1;int m=1;
	while((k<<1)-1<=n){
		k<<=1;
		m++;
	}
	n-=(k-1);
//	printf("%lld\n",n);
	int l=m/2;
	c[0]=1;
	for(int i=1;i<=l;i++)c[i]=c[i-1]*(m-i+1)/i;
	int num=0;
	while(n){
		while(n>=c[l])v[l]++,n-=c[l],num++;
		l--;
	}
	printf("%d\n",m+2*num);
	int id=1;
	for(int i=0;i<m;i++){
		if(i<=m/2)for(int j=0;j<v[i];j++)printf("%d ",++id);
		printf("1 ");
	}
	while(id>1)printf("%d ",id--);
	puts("");
	return 0;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  
  int coin[510][510];
  
  for (int i = 1; i <= H; i++) { 
    for (int j = 1; j <= W; j++) {
      cin >> coin[i][j];
    }
  } 
  
  vector<int> memo;
  for (int i = 1; i <= H; i++) {
    if (i % 2) {
      for (int j = 1; j <= W; j++) {
        if(j <= W-1 && (coin[i][j] % 2 == 1)) {
          coin[i][j]--;
          coin[i][j+1]++;
          
          memo.push_back(i);
          memo.push_back(j);
          memo.push_back(i);
          memo.push_back(j+1);
        } else if (i < H && j == W && (coin[i][j] % 2 == 1)){
          coin[i][j]--;
          coin[i+1][j]++;
          memo.push_back(i);
          memo.push_back(j);
          memo.push_back(i+1);
          memo.push_back(j);
        }
      }
    } else {
      for (int j = W; j >= 1; j--) {
        if (j >= 2 && (coin[i][j] % 2 == 1)) {
          coin[i][j]--;
          coin[i][j-1]++;
          memo.push_back(i);
          memo.push_back(j);
          memo.push_back(i);
          memo.push_back(j-1);
        } else if (i < H && j == 1 && (coin[i][j] % 2 == 1)) {
          coin[i][j]--;
          coin[i+1][j]++;
          memo.push_back(i);
          memo.push_back(j);
          memo.push_back(i+1);
          memo.push_back(j);
        }
      }
    }
  }
  
  cout << memo.size() / 4 << endl;
  
  for (int i = 0; i < memo.size() / 4; i++) {
    cout << memo[4 * i] << " " << memo[4 * i+1] << " " <<
    memo[4 * i + 2] << " " << memo[4 * i + 3];
    cout << endl;
  }
  
}

Measured memory_bytes: 6292