akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Comparator;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        RedGreenApples solver = new RedGreenApples();
        solver.solve(1, in, out);
        out.close();
    }

    static class RedGreenApples {
        public void solve(int testNumber, Scanner in, PrintWriter out) {

            int x = in.nextInt();
            int y = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            List<Long> p = new ArrayList<>();
            List<Long> q = new ArrayList<>();
            List<Long> r = new ArrayList<>();
            for (int i = 0; i < a; i++) {
                p.add(Long.parseLong(in.next()));
            }
            for (int i = 0; i < b; i++) {
                q.add(Long.parseLong(in.next()));
            }
            for (int i = 0; i < c; i++) {
                r.add(Long.parseLong(in.next()));
            }
            p.sort(Comparator.reverseOrder());
            q.sort(Comparator.reverseOrder());

            PriorityQueue<Long> s = new PriorityQueue<>(a, (o1, o2) -> Long.compare(o2, o1));
            for (int i = 0; i < x; i++) {
                s.add(p.get(i));
            }
            for (int i = 0; i < y; i++) {
                s.add(q.get(i));
            }
            for (int i = 0; i < c; i++) {
                s.add(r.get(i));
            }
            long result = 0;
            for (int i = 1; i <= x + y; i++) {
                result += s.poll();
            }

            out.println(result);

        }

    }
}



Measured memory_bytes: 68920
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h,a;
  cin >> h >> a;
  int answer = 0;
  if(h % a == 0) {
    answer = h / a;
  }
  else {
    answer = h / a + 1;
  }
  cout << answer << endl;
}

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

const int N = 100005;

long long x[N], c[N], cc[N], cmx[N], ccmx[N], v[N];

int main() {
	int n; long long C;
	cin >> n >> C;
	for (int i = 1; i <= n; i++)cin >> x[i] >> v[i];
	for (int i = 1; i <= n; i++) {
		c[i] = c[i - 1] + v[i] - (x[i] - x[i - 1]);
		cmx[i] = max(cmx[i - 1], c[i]);
	}
	x[n + 1] = C;
	for (int i = n; i >= 1; i--) {
		cc[n - i + 1] = cc[n - i] + v[i] - (x[i + 1] - x[i]);
		ccmx[n - i + 1] = max(ccmx[n - i], cc[n - i + 1]);
	}
	long long ans = 0;
	for (int i = 0; i <= n; i++) {
		ans = max(ans, c[i] - x[i] + ccmx[n - i]);
		ans = max(ans, cc[i] - (C - x[n - i + 1]) + cmx[n - i]);
	}
	cout << ans << endl;
	return 0;
}

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

int main (void){
  string s;
  cin >> s;
  string ans;
  if(s == "Sunny"){
    ans = "Cloudy";
  } else if(s == "Cloudy"){
    ans = "Rainy";
  } else if(s == "Rainy"){
    ans = "Sunny";
  }
  cout << ans;
}


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;
const int INF = 1001001001;

int main(){
    int n;
    cin >> n;
    vector<ll> l(n);
    int ans = 0;
    rep(i,n) cin >> l.at(i);
    for(int i = 0;i < n;i++){
        for(int j = i+1;j < n;j++){
            for(int k = j + 1;k < n;k++){
                if(l.at(i) == l.at(j) || l.at(j) == l.at(k) || l.at(i) == l.at(k)) continue;
                if((l.at(i)+l.at(j) > l.at(k)) && (l.at(j)+l.at(k) > l.at(i)) && (l.at(k)+l.at(i) > l.at(j))) ans++;
            }
        }
    }
    cout << ans << endl;
}

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

public class Hello
{
    public static void Main()
    {
        hoge();
        //System.Console.ReadLine();
    }

    public static void hoge()
    {
        var vars = System.Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        var mCount = vars[2];

        var a = System.Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
        var b = System.Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

        var min = a.Min() + b.Min();

        for(int cnt = 0; cnt < mCount; cnt++)
        {
            vars = System.Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var nedan = a[vars[0]-1] + b[vars[1]-1] - vars[2];
            if(nedan < min)
            {
                min = nedan;
            }
        }

        System.Console.WriteLine(min);

    }
}



Measured memory_bytes: 38108
#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;

Int n, k;
string s;
Int ans;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n >> k >> s;
	for(size_t i=1; i<s.size(); ++i){
		if(k == 0) break;
		if(s[i] != s[0]){
			--k;
			for(size_t j=0; i+j<s.size() && s[i+j] != s[0]; ++j)
				s[i+j] = s[0];
		}
	}
	for(size_t i=0; i<s.size(); ++i){
		if(i == 0){
			if(s.size() == 1 || s[0] == 'L') continue;
			if(s[1] == 'R') ++ans;
		}else if(i+1==s.size()){
			if(s[i] == 'R') continue;
			if(s[i-1] == 'L') ++ans;
		}else{
			if((s[i] == 'R' && s[i+1] == 'R') || (s[i] == 'L' && s[i-1] == 'L')) ++ans;
		}
	}
	cout << ans << "\n";
}

Measured memory_bytes: 512
MAIN : {
	my $s1 = <STDIN>;
	chomp $s1;
	my ($a, $b) = split(" ", $s1);

	if ($b % $a == 0) {
		print STDOUT $a + $b, "\n";
	}
	else {
		print STDOUT $b - $a, "\n";
	}
}

__END__


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

using namespace std;

typedef long long ll;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    const int mod=1e9+7;
    ll n,k,a[2005],ans=0;
    cin>>n>>k;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int i=1;i<=n;i++)
    {
        int t=0;
        for(int j=i;j<=n;j++)
            if(a[i]>a[j])
                t++;
        ans+=t*k;
        t=0;
        for(int j=1;j<=n;j++)
            if(a[i]>a[j])
                t++;
        ans+=(k-1)*k/2%mod*t;
    }
    cout<<ans%mod<<endl;
    return 0;
}


Measured memory_bytes: 256
macro_rules! get {
    (Vec<$t:ty>) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let n = get!(usize);
    let p = get!(Vec<usize>);

    let ans = (1..(n-1)).map(|i|
        if (p[i - 1] < p[i] && p[i] < p[i + 1]) || (p[i - 1] > p[i] && p[i] > p[i + 1]) {
            1
        } else {
            0
        }
    ).sum::<usize>();

    println!("{}", ans);
}

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


def main():
    alpha = [int(input()) for _ in range(5)]
    k = int(input())

    for a in alpha:
        for b in alpha:
            if abs(a - b) > k:
                print(':(')
                exit()

    print('Yay!')


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
# coding: utf-8
eps=0.0001
n=int(input())
x_sum=0
y_sum=0
data=[]
for i in range(n):
    x,y=map(int,input().split())
    x_sum+=x
    y_sum+=y
    data.append((x,y))
x_sum/=n
y_sum/=n
if n%2!=0:
    print('NA')
    exit()

for i in range(n//2):
    if abs(((data[i][0]-x_sum)**2+(data[i][1]-y_sum)**2)**0.5\
    -((data[i+n//2][0]-x_sum)**2+(data[i+n//2][1]-y_sum)**2)**0.5)<=eps:
        pass
    else:
        print('NA')
        exit()

print(x_sum,y_sum)


Measured memory_bytes: 5672
#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    if(N <= 2){
        cout << 1 << endl;
        return 0;
    }
    int ans = 1;
    int nums[N];
    cin >> nums[0];
    int if_increase = 0;
    for(int i = 1; i < N; i++){
        cin >> nums[i];
        if(if_increase == 1 && nums[i - 1] > nums[i]){
            if_increase = 0;
            ans++;
        }else if(if_increase == -1 && nums[i - 1] < nums[i]){
            if_increase = 0;
            ans++;
        }else if(if_increase == 0 && nums[i - 1] < nums[i]){
            if_increase = 1;
        }else if(if_increase == 0 && nums[i - 1] > nums[i]){
            if_increase = -1;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int student;
	int bibs[101];
	int baton;
	int i, j;
	
	cin >> student;
	cin >> baton;
	
	for (i = 1; i <= student; i++){
		cin >> bibs[i];
	}
	for (j = 1; j <= baton; j++){
		for (i = 1; i + 1 <= student; i++){
			if (bibs[i] % j > bibs[i+1] % j){
				swap(bibs[i],bibs[i+1]);
			}
		}
	}
	
	for (i = 1; i <= student; i++){
		cout << bibs[i] << endl;
	}
	
	return (0);
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1LL<<60;
const int inf = 1e5;
//typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int main(){
  int n;  cin >> n;
  string s[n];
  rep(i,0,n){
    cin >> s[i];
  }
  int cnta=0, cntb=0, k=0;
  rep(i,0,n){
    if(s[i][0]=='B'&&s[i].back()=='A') k++;
    else if(s[i][0]=='B') cntb++;
    else if(s[i].back()=='A') cnta++;
  }
  int cntab = 0;
  rep(i,0,n){
    rep(j,0,s[i].size()-1){
      if(s[i][j]=='A'&&s[i][j+1]=='B') cntab++;
    }
  }
  int ans = 0;
  if(cnta==0 && cntb==0){
    ans = max(0, k-1) + cntab;
  }else{
    ans = min(cnta, cntb) + cntab + k;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 768
a = gets.to_i
b = []
for i in (1..10)
    if a % i == 0
        # p i
        # p a / i
        if i < 10 && a / i < 10
            # p i
            b.push(i)
        end
    end
end
# p b.empty?
if b.empty?
    puts "No"
else
    puts "Yes"
end

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


int main()
{
    for(int k=0;k<10;k++){
        string s,t;
        cin >> s >>t;
        int n=(int)s.size();
        int m=(int)t.size();
        int a[n+1][m+1];
        for(int i=0;i<n+1;i++)
            for(int j=0;j<m+1;j++)
                a[i][j]=0;
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                if(s[i]==t[j])
                    a[i+1][j+1]=a[i][j]+1;
        int ma=0;
        for(int i=0;i<n+1;i++){
            for(int j=0;j<m+1;j++)
                ma=max(ma,a[i][j]);
        }
        cout << ma << endl;
    }
    return 0;
}



Measured memory_bytes: 65688
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int y = sc.nextInt();

		int othousand = -1;
		int fthousand = -1;
		int tthousand = -1;

		for(int i=0; i<n+1; i++) {
			for(int j=0; j<n-i+1; j++) {
				if(10000*i+5000*j+1000*(n-i-j)==y) {
					tthousand=i;
					fthousand=j;
					othousand=(n-i-j);
				}
			}
		}

		System.out.println(tthousand + " " +fthousand + " " + othousand);

	}

}


Measured memory_bytes: 21844
#include<stdio.h>
int main(void)
{
    char s[100000];
    scanf("%s", s);

    int i, one = 0, zero = 0;
    for (i = 0; s[i] != '\0'; i++) {
        if (s[i] == '1')
            one++;
        else if (s[i] == '0')
            zero++;
    }

    //const int min = one > zero ? zero : one;
    int min;
    if (one > zero)
        min = zero;
    else
        min = one;

    printf("%d", min * 2);
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
static const int64_t mod=1000000007;
int64_t f(int64_t x,int64_t y){
if(y==0)
  return 1;
  else if(y%2==0)
    return (f(x,y/2)*f(x,y/2))%mod;
  else
    return (x*((f(x,y/2)*f(x,y/2))%mod))%mod;
}
int main(){
  int N;cin>>N;
  vector<int64_t>X(N);
  for(int i=0;i<N;i++)
    cin>>X.at(i);
  vector<int64_t>d(N-1);
  for(int i=0;i<N-1;i++)
    d.at(i)=X.at(i+1)-X.at(i);
  int64_t a=1;
  for(int64_t i=1;i<=N-1;i++)
    a=(a*i)%mod;
  int64_t ans=0;
  int64_t b=a;
  for(int i=0;i<N-1;i++){
  ans=(ans+b*d.at(i))%mod;
    b=(b+a*f(i+2,mod-2))%mod;
  }cout<<ans<<endl;
   return 0;
}

Measured memory_bytes: 4712
def inner_prod(vec_a, vec_b):
    from functools import reduce

    return reduce(lambda acc, tpl: acc + tpl[0] * tpl[1], zip(vec_a, vec_b), 0)


def generate_combinations(size, trunk, A=[]):
    if len(A) == size:
        return
    trunk.append(A + [0])
    trunk.append(A + [1])
    generate_combinations(size, trunk, A + [0])
    generate_combinations(size, trunk, A + [1])


n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))

comb = []
generate_combinations(n, comb)
for i in range(len(comb)):
    comb[i] += [0] * (n - len(comb[i]))

trunk = set()
for c in comb:
    trunk.add(inner_prod(A, c))

for m in M:
    print("yes" if m in trunk else "no")



Measured memory_bytes: 556640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
  int K, N;
  cin >> K >> N;
  vector<ll> A(N), B(N);
  rep(i, N) {
    cin >> A[i];
    if(i) B[i] = A[i] - A[i-1];
  }
  B[0] = A[0] + K - A[N-1];
  sort(all(B));
  cout << accumulate(all(B), 0LL) - B[N-1] << endl;
  return 0;
}



Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define deb(x) cout << #x << "=" << x << endl
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
int M=1e9+7,N=205001;

int mm(int x,int y){x%=M,y%=M;return (x*y)%M;}//Modular Multiply
int po(int x,int y){ if(!y)return 1;int a=po(x,y/2)%M;if(y%2)return mm(a,mm(a,x));return mm(a,a);}//(x**y)%M



void solve() {
	int n;
	cin>>n;
	cout<<n+n*n+n*n*n;
}


signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}





Measured memory_bytes: 3652
import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){

            long n = sc.nextLong();
            long m = sc.nextLong();

            if(n == 1 && m == 1){
                System.out.println(1);
            }else if(n == 1){
                System.out.println(m - 2);
            }else if(m == 1){
                System.out.println(n - 2);
            }else if(n == 2 || m == 2){
                System.out.println(0);
            }else if(n > 2 && m > 2){
                System.out.println((n - 2)*(m - 2));
            }

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}

Measured memory_bytes: 22740
#include <cstdio>
#include <iostream>
#include <array>
#include <vector>
#include <deque>
#include <string>
#include <algorithm>
#include <functional>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <utility>
#include <memory>
#include <valarray>
#include <climits>

using namespace std;

using ll = long long int;

#define loop(i, N) for (int i = 0; i < N; ++i)
#define scanInt(x) int x; scanf("%d", &x); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &x); getchar();
#define scanVecInt(A, N) vector<int> A(N); loop(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); loop(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanLLInt(Q);
    scanLLInt(H);
    scanLLInt(S);
    scanLLInt(D);
    scanLLInt(N);
    ll qhs = min({Q * 4, H * 2, S});
    ll result;
    if (qhs * 2 <= D){
        result = qhs * N;
    }else{
        result = D * (N / 2) + qhs * (N % 2);
    }
    printf("%lld\n", result);
}


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

int main()
{
    int a,b,x;
    while(~scanf("%d %d %d",&a,&b,&x))
    {
        if(a<=x&&(a+b)>=x)
        {
            printf("YES\n");
        }
        else
        {
            printf("NO\n");
        }
    }
    return 0;
}


Measured memory_bytes: 128
# frozen_string_literal: true

a, b = gets.split.map(&:to_i)

x1 = a / 0.08
x2 = b / 0.1
ans = -1
[x1, x2].min.floor.upto([(a + 1) / 0.08, (b + 1) / 0.01].max.floor) do |x|
  if (x * 0.08).floor == a && (x * 0.1).floor == b
    ans = x
    break
  end
end

puts ans


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

#define rep(i,a,b)                for(ll i=a;i<b;i++)
#define re(i,b)                for(ll i=0;i<b;i++)
#define repr(i,n)                for(ll i=n-1;i>=0;i--)
#define ll long long
#define ld long double
#define pll std::pair<ll, ll> 
#define ppll std::pair<pll, ll>
#define vll std::vector<ll> 
#define vpll std::vector<pll> 
#define vppll std::vector<ppll> 
#define mll std::unordered_map<ll, ll> 
#define mpll std::unordered_map<pll, ll>
#define mppll std::unordered_map<ppll, ll>
#define sll std::set<ll>
#define ff first
#define ss second
#define msll std::multiset<ll>
#define all(c) c.begin(), c.end()
#define allr(c) c.rbegin(), c.rend()
#define srt(x) sort(all(x))
#define rsrt(x) sort(allr(x))
#define eb emplace_back
#define pb push_back
#define s(yy) ll yy;cin>>yy
#define len length()
#define sz size()
const ll mod = 1e9 + 7;
const ll INF = 0x7FFFFFFFFFFFFFFF>>1;

/*#################################################### 
#                                                    #
#                     @author                        #
#                  Parth Lathiya                     #
#      https://www.cse.iitb.ac.in/~parthiitb/        #
#                                                    #
####################################################*/


int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    #ifdef PARTH_LATHIYA_HOME

        freopen("C_in.txt","r",stdin);
    
        ll ttt,bkkk;
        cin>>ttt;
        bkkk=ttt;
        while(ttt--) {
            cout<<"Testcase - "<<bkkk-ttt<<"\n";
    #endif

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

    s(n);
    s(m);

	ll ans=0;
    // 4 corners
    if(n==1 && m==1)
    	ans=1;
    else
	{
    	if(m-2>0 && n==1)
			ans+=(m-2);
		if(n-2>0 && m==1)
			ans+=(n-2);
		if(n-2>0 && m-2>0)
			ans+=(n-2)*(m-2);
    }
    cout<<ans<<endl;

//--------------------------------------------------------------------------------------
    
    #ifdef PARTH_LATHIYA_HOME
        cout<<"\n"; }
    #endif

    return 0;
}

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

class Program
{
    static void Main()
    {
        Read().ToList().ForEach(delegate (double v)
        {
            double x = v / 2;
            double n;
            while (Math.Abs((n = Math.Pow(x, 3)) - v) >= 0.00001 * v)
            {
                x -= (n - v) / (3 * Math.Pow(x, 2));
            }
            Console.WriteLine(x);
        });
    }

    private static IEnumerable<double> Read()
    {
        double line;
        while ((line = double.Parse(Console.ReadLine())) != -1)
            yield return line;
    }
}


Measured memory_bytes: 16288
#include<iostream>
using namespace std;
int main(){
    long long int n , m,k;
    cin >> n >> m >> k;
    
    if(k > n+m&&4*n*m<(k-n-m)*(k-n-m) ){
        cout << "Yes";
    }else{
        cout << "No";
    }
  return 0;
}


Measured memory_bytes: 256
use std::io;
use std::collections::HashMap;

fn read_line() -> String {
    let mut line = String::new();

    io::stdin().read_line(&mut line)
        .expect("Failed to read line");
    return line;
}
fn to_i(s: &str) -> i64 {
    return s.trim().parse()
        .expect("Please type a number!");
}
fn read_nums() -> Vec<i64>
{
    let line = read_line();
    let items: Vec<&str> = line.split(' ').collect();

    let mut nums: Vec<i64> = Vec::new();

    for item in items {
        nums.push(to_i(item));
    }
    return nums;
}


fn main() {
    //println!("start");
    let nab = read_nums();
    let n = nab[0];
    
    //println!("{}",n);
    let ret = 3*n*n;
    
    print!("{}", ret);
    
    
}   

Measured memory_bytes: 4352
#include <iostream>

using namespace std;
#include<cmath>
int main()
{int n,array[100],m,alice=0 ,bob=0,score=0;
cin>>n;
for(int i=0;i<n;i++)
    cin>>array[i];
    for(int j=0;j<n-1;j++){
    for(int i=0;i<n-1;i++)
{
if(array[i]<array[i+1])
{m=array[i];
array[i]=array[i+1];
array[i+1]=m;
}}}


for(int i=0;i<n;){int j=i+1;
  alice+=array[i];if(j<n)bob+=array[j];
i+=2;
 }
  score=abs(alice-bob);
  cout<<score;
    return 0;
}


Measured memory_bytes: 256
n = int(input())
ts = list(map(int, input().split()))
vs = list(map(int, input().split()))
vs.append(0)

ss = [ts[0]]
for i in range(1, n):
    ss.append(ss[-1])
    ss[-1] += ts[i]

ds = [[-1 for _ in range(101)] for _ in range(2)]
ds[0][0] = 0
i = 0
for t in range(1, ss[-1] + 1):
    vl = vs[i]
    ve = vs[i]
    if t == ss[i]:
        i += 1
        ve = min(ve, vs[i])
    for v in range(101):
        ds[t % 2][v] = -1
        if 0 <= ds[(t - 1) % 2][v]:
            if v < vl and v <= ve:
                ds[t % 2][v] = ds[(t - 1) % 2][v] + 4 * v + 1
            elif v == vl and v <= ve:
                ds[t % 2][v] = ds[(t - 1) % 2][v] + 4 * v
    for v in range(1, 101):
        if 0 <= ds[(t - 1) % 2][v] and v <= vl and v - 1 <= ve:
            ds[t % 2][v - 1] = max(ds[t % 2][v - 1], ds[(t - 1) % 2][v] + 4 * v - 2)
    for v in range(100):
        if 0 <= ds[(t - 1) % 2][v] and v < vl and v + 1 <= ve:
            ds[t % 2][v + 1] = max(ds[t % 2][v + 1], ds[(t - 1) % 2][v] + 4 * v + 2)

print(ds[ss[-1] % 2][0] / 4)

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

int main () {
  string S ;
  
  cin >> S ;
  
  if (S.at(0) == S.at(1) && S.at(1) == S.at(2) ){
    cout << "No" << endl ;
    
  }
  else {
    cout << "Yes" << endl ; 
    
  }
  
  
  
  
  
  
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define Would
#define you
#define please

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

	
	int A, B, C, D;
	cin >> A >> B >> C >> D;

	if (A + B < C + D) co("Right");
	else if (A + B > C + D) co("Left");
	else co("Balanced");

	Would you please return 0;
}

Measured memory_bytes: 256
import numpy as np

S = input()
T = input()

m = len(S)
n = len(T)
for i in range(m-n, -1, -1):
  if np.prod([s in [t, '?'] for s, t in zip(S[i:i+m], T)]):
    ans = S[:i] + T + S[i+n:]
    ans = ans.replace('?', 'a')
    break
else:
  ans = 'UNRESTORABLE'
print(ans)

Measured memory_bytes: 27124
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
#define PI 3.14159265358979
typedef long long int ll;

const double pi=3.1415;
ll absc(ll a,ll b){return (a-b>0?a-b:b-a);
}
ll mini(ll a,ll b){return (a>b?b:a);}
ll gcd(ll a,ll b){
	if(a<b)swap(a,b);
	return (a%b?gcd(a%b,b):b);
}
int main()
{
   ll a,b,c;
   cin>>a>>b>>c;
   ll ans=a/(b+c);
   ans=ans*b;
   ans+=min(b,a%(b+c));
   cout<<ans;
  }


Measured memory_bytes: 256
/*                  ___
               :                
               ;                
              :                 
              ;                 
             /                  
           o/                   
         ._/\___,                
             \                  
             /                   
             `      
	bug
*/
#define _CRT_SECURE_NO_WARNINGS

#include <bits/stdc++.h>

using namespace std;
#define PI 3.14159265359
#define eps 1e-8
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORN(i,a,b) for(int i=a;i<=b;i++)
#define REP(i,n) FOR(i,0,n)
typedef long long int ll;
const int INF = 1<<29;
typedef long long ll;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

double tick() { 
	static clock_t oldticks;
	clock_t newticks = clock();
	double diff = 1.0 * (newticks - oldticks) / CLOCKS_PER_SEC; 
	oldticks = newticks;
	return diff;
}

inline int toInt(string s){
	return atoi(s.c_str());
}

inline int gcd(int a,int b){
	return b==0?a:gcd(b,a%b);
}

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

inline bool isPrime(int n){
	ll j;
	j=sqrt(n);

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

int n;
bool dp[1005];

int main(){
	ios_base::sync_with_stdio(false); //Fast I/O
	cin.tie(NULL);
	//freopen("in.txt","r",stdin);
	//freopen("output.txt","w",stdout);	

	cin >> n;

	dp[0]=true;

	for(int i=0;i<=n;i++){
		if(dp[i]){
			dp[i+4]=true;
			dp[i+7]=true;
		}
	}

	if(dp[n])
		cout << "Yes\n";
	else
		cout << "No\n";

    //cerr << tick();

	return 0;
	
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node_struct{int p, l, r;}; /*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];

void print(int u){
 int i, c;
 printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);

 if(T[u].p == NIL) printf("root, ");
 else if(T[u].l == NIL) printf("leaf, ");
 else printf("internal node, ");

 printf("[");
 for (i=0, c = T[u].l; c != NIL; i++, c = T[c].r){
   if(i) printf(", ");
   printf("%d", c);
 }
 printf("]\n");

}

void calcDepth(int u, int p){
 D[u] = p;
 if(T[u].r != NIL) calcDepth(T[u].r, p);
 if(T[u].l != NIL) calcDepth(T[u].l, p+1);
}

int main(){
 int i, j, k;
 int n;
 int id, sib, child;
 int root = NIL;
 scanf("%d", &n);
 for(i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL;

 for(i=0; i<n; i++){
   scanf("%d %d", &id, &k);
   for(j = 0, sib = NIL; j<k; j++){ //子を入力する (input children)
     scanf("%d", &child);
     T[child].p = id;
     if(j == 0) T[id].l = child; //idの一番左の子 (the most left child of id)
     else T[sib].r = child; //左の兄弟に繋げる (connect to left sibling)
     sib = child;//次の子供の左の兄弟 (the left sibling of the next child)
   }
 }

 //根を求める (find the root)
 for(i=0; i<n; i++){
   if(T[i].p == -1) root = i;
 }

 //それぞれのノードの深さを求める (find depth of each node)
 calcDepth(root, 0);

 //出力 (output)
 for(i=0; i<n; i++) print(i);

 return 0;
}



Measured memory_bytes: 6376
#include <stdio.h>
 
int main(void)
{
    int a, b;
    scanf("%d %d", &a, &b);
    
    if (a >= -1000 && a <= 1000 && b >= -1000 && b <= 1000) {
        if (a < b) {
            printf("a < b\n");
        } else if (a > b) {
            printf("a > b\n");
        } else {
            printf("a == b\n");
        }
    }

    return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef double D;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef long double ld;

#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d %d",&x,&y)
#define rd3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define rl(x) scanf("%lld",&x)
#define rl2(x,y) scanf("%lld %lld",&x,&y)
#define rl3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define wd(x) printf("%d" ,x)
#define wd2(x,y) printf("%d %d",x,y)
#define wl(x) printf("%lld",x)
#define wl2(x,y) printf("%lld %lld",x,y)
#define PC(x) putchar(x)
#define GC() getchar()
#define NL printf("\n")
#define SP printf(" ")
 
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define F first
#define S second
#define MP make_pair
#define PB push_back

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define fr(i,s,e) for(int i=s;i<e;i++)
#define frl(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(int i=s-1;i>=e;i--)
#define frv(i,a) for(int i = 0;i<(int)a.size();i++)
#define frvr(i,a) for(int i = a.size()-1;i>=0;i--)
#define tr(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end();i++)

#define inf 10000000000000
#define mod 1000000007
#define maxn 100009
#define maxr 100009

void solve()
{
	ll a,b;
	rl2(a,b);
	if(a>=13)
		wl(b);
	else if(a>=6)
	{
		b=b/2;
		wl(b);
	}
	else
	{
		b=0;
		wl(b);

	}
	NL;
	return;
}
int main(){
	//sstd::ios::sync_with_stdio(false); cin.tie(NULL);
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <list>
#include <map>
#include <string>
#include <functional>
#include <math.h>
#include <utility>
#define INF 100000000
using namespace std;
typedef pair<int,int> P;
int n,m,p,q,r,ans;
vector<P> sheaf;
void Cut(int s,int l,int k){
	vector<P> sheaf2;
	int len;
	int divk=0;
	for(len=0;len<k;){
		P tmp=sheaf[divk++];
		len+=tmp.second-tmp.first+1;
	}
	divk--;
	int nk=sheaf[divk].first+k-(len-(sheaf[divk].second-sheaf[divk].first+1))-1;
	sheaf2.push_back(make_pair(nk,sheaf[divk].second));
	if(sheaf.begin()+divk!=sheaf.end())sheaf2.insert(sheaf2.end(),sheaf.begin()+divk+1,sheaf.end());
	int divs=0;
	for(len=0;len<s;){
		P tmp=sheaf[divs++];
		len+=tmp.second-tmp.first+1;
	}
	divs--;
	int ns=sheaf[divs].first+s-(len-(sheaf[divs].second-sheaf[divs].first+1))-1;
	if(divk-divs!=0)sheaf2.push_back(make_pair(ns,sheaf[divs].second));
	else sheaf2.push_back(make_pair(ns,nk-1));
	if(divk-divs>=2)sheaf2.insert(sheaf2.end(),sheaf.begin()+divs+1,sheaf.begin()+divk);
	if(sheaf[divk].first!=nk&&divk-divs!=0)sheaf2.push_back(make_pair(sheaf[divk].first,nk-1));

	if(sheaf[divs].first!=ns)sheaf2.insert(sheaf2.begin(),make_pair(sheaf[divs].first,ns-1));
	if(divs!=0)sheaf2.insert(sheaf2.begin(),sheaf.begin(),sheaf.begin()+divs);
	sheaf=sheaf2;
	return;
}
int main()
{
	while(cin>>n&&n){
		cin>>m>>p>>q>>r;
		ans=0;
		sheaf.clear();
		sheaf.push_back(make_pair(1,n));
		while(m--){
			int x,y;cin>>x>>y;
			Cut(1,n,y+1);
			Cut(n-y+1,n,n+x-y+1);
		}
		Cut(1,n,q+1);
		Cut(1,n,n+p-q);
		int len=0;
		for(int i=0;i<(int)sheaf.size()&&len!=q-p+1;i++){
			P tmp=sheaf[i];
			len+=tmp.second-tmp.first+1;
			if(r<tmp.first)continue;
			ans+=min(r,tmp.second)-tmp.first+1;
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1460
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = (ll)1e9+7;

const int N = (int)2e5 + 10;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    
    int n, k;
    cin >> n >> k;
    vector <ll> A(n);
    for (auto &it : A) {
        cin >> it;
    }
    sort(A.begin(), A.end()); 

    ll product = 1LL; 

    if (A[n - 1] == 0 && (k & 1))  {
        cout << 0 << endl;
        return 0;
    }
    if (A[n - 1] <= 0 && (k & 1)) { 
        for (int i = n - 1; i >= n - k; i--) 
            product = ((product % mod) * (A[i] % mod)) % mod; 
        cout << (product + mod) % mod << endl;
        return 0;
    } 

    int i = 0; 
    int j = n - 1; 
    if (k & 1) { 
        product = ((product % mod) * (A[j] % mod)) % mod; ; 
        j--; 
        k--; 
    } 
    k >>= 1; 
    for (int itr = 0; itr < k; itr++) { 
        ll left_product = A[i] * A[i + 1]; 
        ll right_product = A[j] * A[j - 1]; 
        if (left_product > right_product) { 
            product = ((product % mod) * (left_product % mod)) % mod;  
            i += 2; 
        } 
        else { 
            product = ((product % mod) * (right_product % mod)) % mod; 
            j -= 2; 
        } 
    } 
    cout << (product + mod) % mod << endl;
    return 0;
}

Measured memory_bytes: 4772
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s: &str = iterator.next().unwrap();

    if s.starts_with("keyence")
        || s.starts_with("keyenc") && s.ends_with("e")
        || s.starts_with("keyen") && s.ends_with("ce")
        || s.starts_with("keye") && s.ends_with("nce")
        || s.starts_with("key") && s.ends_with("ence")
        || s.starts_with("ke") && s.ends_with("yence")
        || s.starts_with("k") && s.ends_with("eyence")
        || s.ends_with("keyence")
    {
        return String::from("YES");
    }

    return String::from("NO");
}


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

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353 
#define MEM_SIZE 100010
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

void solve(void)
{ 
  int n;cin>>n;
  vector<pair<int,int> > vp;
  for (int i = 0; i < n; i++)
  {
    int x,l;
    cin>>x>>l;
    vp.emplace_back(x + l , x - l);
  }
  sort(ALL(vp));
  int res = 0;
  int pos = -1*INF;
  for (int i = 0; i < vp.size(); i++)
  {
    if(pos <= vp[i].second)
    {
      res ++;
      pos = vp[i].first;
    }
  }

  cout<<res<<endl;
  

  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 5296
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)

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

const int mod = 1000000007;
int h, w;
int res = INF;

void bun2(int hh, int ww) {
  int rem = hh*ww;
  int remm = h*w-rem;
  if (remm == 0) return;

  int hlow = (hh/2) * ww;
  int hhigh = (hh/2+1) * ww;
  int wlow = (ww/2) * hh;
  int whigh = (ww/2+1) * hh;

  if (hlow) {
    int mn = min(hlow, remm);
    int mx = max(remm, rem-hlow);
    res = min(mx-mn, res);
  }

  if (hhigh) {
    int mn = min(rem-hhigh, remm);
    int mx = max(remm, hhigh);
    res = min(mx-mn, res);
  }

  if (wlow) {
    int mn = min(wlow, remm);
    int mx = max(remm, rem-wlow);
    res = min(mx-mn, res);
  }

  if (whigh) {
    int mn = min(rem-whigh, remm);
    int mx = max(remm, whigh);
    res = min(mx-mn, res);
  }
}

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

  cin >> h >> w;

  bun2(h-h/3, w);
  bun2(h-(h/3+1), w);
  bun2(h, w-w/3);
  bun2(h, w-(w/3+1));

  cout << res << endl;
}


Measured memory_bytes: 504
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		sc.close();

		int a = l / 2019;
		int b = r / 2019;
		if (a < b) {
			System.out.println(0);
			return;
		}
		l %= 2019;
		r %= 2019;
		if (l >= r) {
			System.out.println(0);
			return;
		}

		int ans = Integer.MAX_VALUE;
		for (int i = l; i < r; i++) {
			for (int j = i + 1; j <= r; j++) {
				ans = Math.min(ans, i * j % 2019);
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23636
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
#define x first
#define y second
#define pb push_back
#define inf 10000000000000000
#define N 1000000007
#define speed ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.x<<','<< P.y<<')';}
template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}


signed main()
{
	speed
	string s1,s2;cin>>s1>>s2;
	int a,b;cin>>a>>b;
	string str;cin>>str;
	if(str==s1)
	{
		cout<<a-1<<" "<<b;
	}
	else{
		cout<<a<<" "<<b-1;
	}
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt64() int64 {
	var i int64
	if sc.Scan() {
		if num, err := strconv.ParseInt(sc.Text(), 10, 64); err == nil {
			i = num
		}
	}
	return i
}

func nextInt() int {
	var i int
	if sc.Scan() {
		if num, err := strconv.Atoi(sc.Text()); err == nil {
			i = num
		}
	}
	return i
}

func allLcm(slice []int64) int64 {
	a := slice[0]
	for i := 0; i < len(slice)-1; i++ {
		b := slice[i+1]
		a = lcm(a, b)
	}
	return a
}

func lcm(a, b int64) int64 {
	return a / gcd(a, b) * b
}

func gcd(a, b int64) int64 {
	if a%b != 0 {
		return gcd(b, a%b)
	} else {
		return b
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	var clocks = []int64{}
	n := nextInt()
	for i := 0; i < n; i++ {
		t := nextInt64()
		clocks = append(clocks, t)
	}
	fmt.Println(allLcm(clocks))
}


Measured memory_bytes: 1788
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}

using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1LL << 60;


const int MAX_N = 100010;

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, m; cin >> n >> m;
	VE a(n); rep(i, n)cin >> a[i];
	priority_queue<int>prique;
	rep(i, n)prique.push(a[i]);
	rep(i, m) {
		int tmp = prique.top(); prique.pop();
		tmp /= 2; prique.push(tmp);
	}
	int ans = 0;
	rep(i, n) {
		ans += prique.top(); prique.pop();
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2168
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//配列を一つずつ取り出す。
		String[] S = sc.next().split("");

		//3文字目と4文字目と5文字目6文字目の比較
		if(S[2].equals(S[3])&&(S[4].equals(S[5]))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		sc.close();
	}

}


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

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


fn main() {
    let n = read::<usize>();

    for i in 1..10 {
        for j in 1..10 {
            if i * j == n {
                println!("Yes");
                return;
            }
        }
    }
    println!("No");
}


Measured memory_bytes: 4352
#include <cstdint>
#include <iostream>
#include <string>

using namespace std;

int32_t main()
{
  uint32_t H, W;
  cin >> H >> W;

  for (uint32_t i = 0; i < W + 2; i++) {
    cout << "#";
  }
  cout << endl;

  for (uint32_t i = 0; i < H; i++) {
    string str;
    cin >> str;
    cout << "#" << str << "#" << endl;
  }

  for (uint32_t i = 0; i < W + 2; i++) {
    cout << "#";
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
import copy

N, M = map(int, input().split())

like = list(map(int, input().split()))
like.pop(0)
all_like = set()
for l in like:
	all_like.add(l)
    
for i in range(N-1):
  like = list(map(int, input().split()))
  like.pop(0)
  tmp = copy.deepcopy(all_like)
  for l in all_like:
    if l not in like:
      tmp.remove(l);
  all_like = tmp
print(len(all_like))

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

int main(int argc, const char * argv[]) {
    
    char W[11],T[101];
    int count=0,i;
    
    scanf("%s",W);
    
    while(1){
        scanf("%s",T);
        if(strcmp("END_OF_TEXT",T) == 0)break;
        for(i=0; i<101; i++){
            if('A'<=T[i] && T[i]<='Z'){
                T[i] = T[i]+ 32;  //大文字アルファベット + 32 = 小文字アルファベット
            }
        }
        if(strcmp(W, T) == 0)count++;
    }
    printf("%d\n",count);
    return 0;
}



Measured memory_bytes: 2044
<?php
$num = trim(fgets(STDIN));
$str = explode(" ", trim(fgets(STDIN)));

for($i = 1; $i <= $num; $i++){
    ($i == $num)?$format = "%s":$format = "%s ";
    printf("$format", $str[$num - $i]);
}
echo PHP_EOL;

Measured memory_bytes: 15228
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}
const int mod = 1000000007;

int main() {
    int n;
    cin >> n;
    vector<int>cnt(9);
    rep(i,n) {
        int a;
        cin >> a;
        int rate = a/400;
        if(rate>=8)rate = 8;
        cnt[rate]++;
    }
    int minv = 0;
    rep(i,8) {
        if(cnt[i]) minv++;
    }
    if(minv==0) minv++;
    int maxv = 0;
    rep(i,8) {
        if(cnt[i]) maxv++;
    }
    maxv += cnt[8];
    cout << minv << " " << maxv << endl;
    

}

Measured memory_bytes: 3548
#include<iostream>
#include<algorithm>
#include<cstring>
#include<stdio.h>
#include<cstdio>
#include<string.h>
#include<cmath>
using namespace std;
int lst[100010];
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> lst[i];
	}
	sort(lst, lst + n);
	if (n % 2 == 1) {
		if (lst[n / 2] == lst[n / 2 + 1]) {
			cout << 0 << endl;
		}
		else cout << 1 << endl;
	}
	else {
		cout << lst[n / 2] - lst[(n - 1) / 2] << endl;
	}
	return 0;
}

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

using namespace std;

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

	vector<string> vs = { "dream", "dreamer", "erase", "eraser" };
	string s;
	cin >> s;
	for (int i = (int) s.length() - 1; i >= 0; i--) {
		int cur;
		if (s[i] == 'r') {
			if (i < 5) {
				cout << "NO\n";
				return 0;
			}
			if (s[i - 2] == 'm') {
				cur = 1;
			} else {
				cur = 3;
			}
		} else if (s[i] == 'e') {
			cur = 2;
		} else if (s[i] == 'm') {
			cur = 0;
		} else {
			cout << "NO\n";
			return 0;
		}
		for (int j = (int) vs[cur].length() - 1; j >= 0; j--, i--) {
			if (vs[cur][j] != s[i]
			    || (i == 0 && j != 0)) {
				cout << "NO\n";
				return 0;
			}
		}
		i++;
	}
	cout << "YES\n";

	return 0;
}



Measured memory_bytes: 512
n,l=map(int,input().split())
a=list(map(int,input().split()))
last=-1
for i in range(n-1):
  if a[i]+a[i+1]>=l:
    last=i+1
if last==-1:
  print("Impossible")
else:
  print("Possible")
  for i in range(1,last):
    print(i)
  for i in range(len(a)-1,last-1,-1):
    print(i)


Measured memory_bytes: 14076
#include<iostream>
using namespace std;
int main()
{

  int n;
  int box;
  int sum[105] = {};
  int a[5000],b[5000];
  int c[5000],d[5000];
  int max,temp;
  int rank[105];
  int count = 0;

  cin >> n;
  box = (n*(n-1))/2;

  for( int i=1;i<=box;i++ ) cin >> a[i] >> b[i] >> c[i] >> d[i];
 
  for( int i=1;i<=box;i++ ){
    if( c[i] == d[i] ){
      sum[a[i]]++;
      sum[b[i]]++;
    }
    else if( c[i] > d[i] ) sum[a[i]] += 3;
    else if( c[i] < d[i] ) sum[b[i]] += 3;
  }

  for( int i=1;i<=n;i++ ){
    rank[i] = 1;
    for( int j=1;j<=n;j++ ){
      if( sum[i] < sum[j] ) rank[i]++;
    }
  }

  for( int i=1;i<=n;i++ ) cout << rank[i] << endl;

  return 0;

}



Measured memory_bytes: 3180