akhauriyash/Code-Regression huggingface dataset:
N,K = input().split(' ')
N = int(N)
K = int(K)

childs = [ int(input()) for _ in range(N)]
min_sub = 10**9
childs.sort()

for n in range(K-1,N):
    min_sub = min(min_sub, childs[n]-childs[n-(K-1)])

print(min_sub)

Measured memory_bytes: 7384
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define all(v) v.begin(),v.end()
#define sz size()
#define mp make_pair
#define pb push_back
#define rep(p,a,b) for(ll p=a ; p<b ; p++)
#define rap(p,a,b) for(ll p=a ; p<=b ; p++)
#define per(p,a,b) for(ll p=a ; p>=b ; p--)
#define F first
#define S second
using namespace std;

typedef vector <ll> vll;
typedef vector <ld> vld;
typedef pair< ll ,ll > pll;


int main()
{
    ll t,i,j,k,ans,n;

    //cin>>t;
    t=1;
    while(t--)
    {
        map<string,ll> m;
        string s1,s2,s3;
        ll x,y;
        cin>>s1>>s2>>x>>y>>s3;

        if(s1==s3)x--;
        else y--;
        cout<<x<<" "<<y;
        
    }
    
    return 0;
}

Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    long long int n,x;
    std::cin >> n;
    std::vector<long long int> v,w;

    for (long long int i = 0; i < n; i++) {
        std::cin >> x;
        v.push_back(x);
        w.push_back(x);
    }

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

    auto n1 = v[v.size()/2-1], n2 = v[v.size()/2];
    for (long long int i = 0; i < n; i++) {
        if (w[i] <= n1) std::cout << n2 << std::endl;
        else std::cout << n1 << std::endl;
    }

    return 0;
}

Measured memory_bytes: 5476
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
int inf = 1000000000;

int main(void) {

  string s; int a, b;
  vector< pair<string, pair<int, int> > > ans;
  while( cin >> s >> a >> b ){
    bool f = false;
    for(int i=0; i<ans.size(); i++){
      if( ans[i].first == s ){
        f = true;
        ans[i].second.second += 200 * a + 300 * b;
        ans[i].second.first += a + b;
      }
    }
    if( !f ) ans.push_back( make_pair(s, make_pair(a+b, 200*a + 300*b)) );
  }
  for(int i=0; i<ans.size(); i++){
    cout << ans[i].first << " " << ans[i].second.first << " " << ans[i].second.second << endl;
  }

  return 0;
}

// EOF

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

signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, 0, n){
        cin >> a[i];
        a[i] -= i;
    }
    sort(a.begin(), a.end());
    int b = a[n / 2];
    int ans = 0;
    rep(i, 0, n){
        ans += abs(a[i] - b);
    }
    cout << ans << endl;
}

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;


int main() {
    int L,R,d; cin >> L >> R >> d;
    int l=0;
    FOR(i,1,L){
        if(i%d==0)l++;
    }
    int r=0;
    FOR(i,1,R+1) if(i%d==0) r++;
    cout<< r - l << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
int main(void){
	int n,a[100000],x,i;
	long long ans=0;
	scanf("%d %d",&n,&x);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<n-1;i++){
		if(a[i]+a[i+1]>x){
			int tmp=a[i]+a[i+1]-x;
			ans+=tmp;
			if(a[i+1]<tmp){
				a[i+1]=0;
			}
			else{
				a[i+1]-=tmp;
			}
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 512
//nani?
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>
#define pi acos(-1);
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define f(i,a,b) for( int i = a; i < b ; i++ ) 
#define sor(a) sort( a.begin(), a.end() )
#define rsor(a) sort( a.rbegin(), a.rend() )
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
//#define inf 1LL<<62
typedef long long ll;
typedef double ld;
using namespace std;
const ll inf=1e10;
const ll MOD=1e9+7;
const ll mod=998244353;
// ac cmtr;
const ll MAX_N = 1e5+5;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << endl;}
 
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1<<" | ";
  __f(comma+1, args...);}
#else
#define trace(...)
#endif
//---------------------------

bool ga(string a){
    string x= a;
    ll cont=0;
    f(i,0,a.size()){
        if(a[i]==x[a.size()-1-i]) cont++;
    }
    if(cont==a.size()) return 1;
    return 0;

}


int main(){
    fastio;
    string a;
    cin>>a;
  //string b= reverse(a.begin(),a.end());
    string l= a.substr(0,a.size()/2);
    if(ga(l) && ga(a) ) cout<<"Yes"<<endl;
  	else cout<<"No"<<endl;


}



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


int main() {
  int N;
  long int D;
  cin >> N >> D;
  int Ans=0;
  vector<long int>zahyo(2*N);
  for(int i=0;i<2*N;i++){
    cin >> zahyo.at(i);
  }
  
  for(int i=0;i<2*N;i=i+2){
    if(zahyo.at(i)*zahyo.at(i)+zahyo.at(i+1)*zahyo.at(i+1) <=D*D){
    Ans++;
  	}
  }
    cout << Ans;
  
}


Measured memory_bytes: 6420
#if defined(LOCAL)
const double _max_double_error = 1e-9;
#include "testutils.h"
#define L(x...) (debug(x, #x))
#define I(x, ...) (x)
#define C(x...) CHECK(x)
#else
#define L(x, ...) (x)
#define I(x, ...) (x)
#define C(x, ...) ;
#endif
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <bitset>
#include <chrono>

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ii = pair<int, int>;
using lu = unsigned long long;
using l = long long;
using vs = vector<string>;
using vii = vector<ii>;
using vl = vector<l>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vlu = vector<lu>;
using ll = pair<l, l>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using mll = unordered_map<l, l>;
using sl = unordered_set<l>;
const l      INF = numeric_limits<l>::max();
const double EPS = 1e-10;
const double PI = 3.14159265358979323846;
const l      e0 = 1, e3 = 1000, e5 = 100000, e6 = 10 * e5, e7 = 10 * e6,
        e8 = 10 * e7, e9 = 10 * e8;
const char lf = '\n';
#define all(x) begin(x), end(x)
#define F(a, b, c) for (l a = l(b); a < l(c); a++)
#define B(a, b, c) for (l a = l(c) - 1; a >= l(b); a--)
#define VVL(x, a, b, i) vvl x(a, vl(b, l(i)));
#define VVVL(x, a, b, c, i) vvvl x(a, vvl(b, vl(c, l(i))));

void solve(istream &in, ostream &out);
void solve_brute(istream &, ostream &);
bool interactive_judge(istream &, istream &, ostream &);
bool generate_random(l, ostream &);
bool solution_checker(istream &, istream &, istream &, ostream &);
int  main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
#if defined(LOCAL)
  tst::test_init(argc, argv);
  // _generate_random_test = generate_random;
  // _solve_brute = solve_brute;
  // _judge = interactive_judge;
  // _custom_solution_checker = solution_checker;
  tst::maybe_run_tests(cin, cout);
#else
  solve(cin, cout);
#endif
}
const l MOD = e9 + 7;  // end of template

void solve(istream &in, ostream &out) {
  l n;
  in >> n;
  vvl v;
  if (n % 2) {
    vl t(1,n);
    v.emplace_back(t);
    n--;
  }
  F(i, 0, n / 2) {
    v.emplace_back(vl({i + 1, n - i}));
  }
  vll z;
  F(i, 0, v.size()) {
    F(j, i + 1, v.size()) {
      for (auto x : v[i]) for (auto y : v[j]) z.emplace_back(x, y);
    }
  }
  out << z.size() << lf;
  for (auto xy : z) out << xy.first << ' ' << xy.second << lf;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
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; }
//get the biggest element.
template<typename KeyType, typename ValueType>
std::pair<KeyType,ValueType> get_max( const std::map<KeyType,ValueType>& x ) {
  using pairtype=std::pair<KeyType,ValueType>;
  return *std::max_element(x.begin(), x.end(), [] (const pairtype & p1, const pairtype & p2) {
        return p1.second < p2.second;
  });
}
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;

int main() {
  int x, n;
  cin >> x >> n;
  vector<int> dis(102);
  rep(i, 102) dis[i] = abs(x - i);

  rep(i, n) {
    int x;
    cin >> x;
    dis[x] = -1;
  }

  int ans = 1000;
  int ans_idx = 0;
  for (int i = 0; i < dis.size(); i++) {
    if (dis[i] == -1) continue;
    if (ans > dis[i]) {
      ans = dis[i];
      ans_idx = i;
    }
  }
  cout << ans_idx << endl;

  return 0;
}


Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		while(s.hasNext()){
			int[] a = new int[8];
			int[] b = new int[8];
			int hit = 0;
			int blow = 0;
			for(int i=0 ; i<4 ; i++)
				a[i] = s.nextInt();
			for(int i=0 ; i<4 ; i++){
				b[i] = s.nextInt();
				if(a[i] == b[i])
					hit += 1;
			}
			for(int i=0 ; i<4 ; i++){
				for(int j=0 ; j<4 ; j++){
					if(a[i]==b[j]&&i!=j)
						blow += 1;
				}
			}
			System.out.println(hit+" "+blow);
		}
    }
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
  public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll 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;
}
 
ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}


void solve(std::string S){
    if(S.size()==2){
        cout << S << endl;
    }else{
        cout << S[2] << S[1] << S[0] << endl;
    }
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
# coding:utf-8

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


def inpl(): return list(map(int, input().split()))


S = input()

A = [-INF for _ in range(len(S))]
C = A[:]
Q = A[:]

A[0] = 1 if S[0] == 'A' else 0
C[0] = 1 if S[0] == 'C' else 0
Q[0] = 1 if S[0] == '?' else 0

for i in range(1, len(S)):
    A[i] = A[i - 1] + 1 if S[i] == 'A' else A[i - 1]
    C[i] = C[i - 1] + 1 if S[i] == 'C' else C[i - 1]
    Q[i] = Q[i - 1] + 1 if S[i] == '?' else Q[i - 1]

# TLEになるので3^X%MODを予め計算
pow_three = [1]
for i in range(Q[-1]):
    tmp = pow_three[-1] * 3
    tmp %= MOD
    pow_three.append(tmp)

ans = 0
for i in range(1, len(S) - 1):
    if S[i] == 'A' or S[i] == 'C':
        continue

    # A, B, Cの個数
    tmp = Q[i - 1] + Q[-1] - Q[i]
    if tmp < 0: tmp = 0
    ans += A[i - 1] * (C[-1] - C[i]) * pow_three[tmp]
    # ?, B, Cの個数
    tmp = Q[i - 1] - 1 + Q[-1] - Q[i]
    if tmp < 0: tmp = 0
    ans += Q[i - 1] * (C[-1] - C[i]) * pow_three[tmp]
    # A, B, ?の個数
    tmp = Q[i - 1] + Q[-1] - Q[i] - 1
    if tmp < 0: tmp = 0
    ans += A[i - 1] * (Q[-1] - Q[i]) * pow_three[tmp]
    # ?, B, ?の個数
    tmp = Q[i - 1] + Q[-1] - Q[i] - 2
    if tmp < 0: tmp = 0
    ans += Q[i - 1] * (Q[-1] - Q[i]) * pow_three[tmp]

    ans %= MOD

print(ans)


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

using ll = long long;
using ld = long double;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
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;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int n;
    cin >> n;
    if (n == 3) {
        cout << "2 5 63" << EOL;
        return;
    } else if (n == 4) {
        cout << "2 5 20 63" << EOL;
        return;
    } else if (n == 5) {
        cout << "2 5 20 30 63" << EOL;
        return;
    }

    vector<int> v{2, 3, 4, 6};
    vector<int> ans;
    int t = 0;
    int c = 0;
    int p = 0;
    while (c < n) {
        REP(i, 4) {
            ans.emplace_back(6 * p + v[i]);
            t += 6 * p + v[i];
            c++;
            if (c >= n) break;
        }
        if (c % 4 == 0) p++;
    }
    if (t % 6 == 2) {
        ans.erase(ans.begin() + 4);
        ans.emplace_back(6 * p + 6);
    } else if (t % 6 == 3) {
        ans.erase(ans.begin() + 5);
        ans.emplace_back(6 * p + 6);
    } else if (t % 6 == 5) {
        ans.erase(ans.begin() + 5);
        ans.emplace_back(6 * p + 4);
    }
    REP(i, sz(ans)) cout << ans[i] << (i == n - 1 ? EOL : ' ');
}


Measured memory_bytes: 640
N = int(input())
S = input()
ans1 = S.count("#")#全部..........にするために必要な変更数
ans2 = S.count(".")#全部##########にするために必要な変更数
#ここから下は、....###########にするための変更数を累積和で求める。
L =[0]*(N+1)
for i in range(N):
    if S[i] == "#":
        L[i+1] = L[i] + 1
    else:
        L[i+1] = L[i]
ans3 = N
for i in range(1,N+1):
    if ans3 > 2*L[i]+N-i-L[N]:
        ans3 =  2*L[i]+N-i-L[N]
print(min(ans1,ans2,ans3))

Measured memory_bytes: 11144
import sys
sys.setrecursionlimit(10 ** 5 + 5)
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
x, y = [0] * M, [0] * M
from_x = [[] for _ in range(N)]
memo = [-1] * N
ans = 0

def length(i):
	if memo[i] >= 0:
		return memo[i]
	else:
		if len(from_x[i]) == 0:
			memo[i] = 0
			return memo[i]
		else:
			ret = 0
			
			for j in from_x[i]:
				tmp = length(j) + 1
				if tmp > ret:
					ret = tmp
					
			memo[i] = ret
			return ret

for i in range(M):
	x[i], y[i] = map(int, input().split())
	from_x[y[i] - 1].append(x[i] - 1)

for i in range(N):
	tmp = length(i)
	if tmp > ans:
		ans = tmp

print(ans)


Measured memory_bytes: 164016
import math
for i in range(50):
	n,l,r=map(int,input().split())
	if n==0 and l==0 and r==0:
		break
	else:
		a=[]
		for ii in range(n):
			a.append(int(input()))
		ans=0
		

		for k in range(l,r+1):

			for s in range(math.ceil(n/2)):
				if k%a[2*s]==0:
					ans+=1
					break
				elif 2*s+1==n :
					break
				elif k%a[2*s+1]==0:
					break
				elif s==math.ceil(n/2)-1 and n%2==0:
					ans+=1
					break
				else:
					continue

					


		print(ans)



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

using ll = long long;
using vi = vector<ll>;
using vvi = vector<vi>;
using pii = pair<ll, ll>;

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

  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }

  ll ntmp = n;
  ll nsqrt = sqrtl(n);
  ll ret = 0;

  for (int i = 2; i <= nsqrt; ++i) {
    ll tmp = i;
    while (ntmp % tmp == 0) {
      ++ret;
      ntmp /= tmp;
      tmp *= i;
      if (ntmp == 0) break;
    }
    while (ntmp % i == 0 && ntmp > 0) {
      ntmp /= i;
      if (ntmp == 0) break;
    }
    if (ntmp == 0) break;
  }

  if (ntmp == n) {
    cout << 1 << endl;
  } else {
    cout << ret + (ntmp > 1) << endl;
  }
  return 0;
}


Measured memory_bytes: 3640
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! p {
    ($($x:expr),*) => {
        $(println!("{:?}", $x);)*
    };
}
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        #[allow(unused_mut)]
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! {
        n:usize,
         s:[String;n]
    }
    let mut a = vec![vec![0; 1]; n];
    for i in 0..s.len() {
        a[i] = s[i].bytes().collect();
        a[i].sort();
    }
    a.sort();

    let mut cnt: i64 = 0;
    let mut mlt = 0;

    for i in 0..n - 1 {
        if a[i] == a[i + 1] {
            cnt += 1;
            
        } else {
            mlt += (cnt*(cnt+1))/2;
            
            cnt = 0;
        }
    }
    mlt += (cnt*(cnt+1))/2;
    p!(mlt);
}


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

typedef long long LL;

int main()
{
	int a,b;
	cin>>a>>b;
	for(int i=1;;i++)
	{
		if(i*8/100>a||i/10>b)
		{
			cout<<(-1)<<endl;
			break;
		}
		if(i*8/100==a&&i/10==b)
		{
			cout<<i<<endl;
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	a, b, x := float64(nextInt()), float64(nextInt()), float64(nextInt())

	e := a*a*b - x
	if x < a*a*b/2 {
		fmt.Println(90.0 - math.Atan(2*x/(b*b*a))*180/math.Pi)
	} else {
		fmt.Println(math.Atan(2*e/(a*a*a))*180/math.Pi)
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
int main() {
	// your code goes here
	int k;
	cin>>k;
	string s;
	cin>>s;
	if(s.size()>k){
		cout<<s.substr(0,k)+"... "<<endl;
	}
	else
	cout<<s<<endl;
	return 0;
}

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

vector<int> g[5001010];
int h[5010100];

map<pair<int, int>, int> idx1;
map<int, pair<int, int>> idx2;

int main() {
    ll v;
    cin >> v;

    int cur = 1;
    rep(i, v) {

        pair<int, int> prev(-1, -1);

        rep(j, v-1) {
            int a;
            cin >> a;
            a--;
            int x = i, y = a;

            if (x > y) {
                swap(x, y);
            }

            pair<int, int> p(x, y);
            if (idx1[p] == 0) {
                idx1[p] = cur;
                idx2[cur++] = p;
            }

            if (prev.first != -1) {
                g[idx1[prev]].push_back(idx1[p]);
                h[idx1[p]]++;
            }

            prev = p;
        }
    }

    queue<int> st;
    ll n = v*(v-1)/2;

    for (int i=1; i<=n; ++i) if (h[i] == 0) st.push(i);

    vector<int> ans;
    while (st.size()) {
        int i = st.front(); st.pop();
        ans.push_back(i);
        for (auto& j : g[i]) {
            h[j]--;
            if (h[j] == 0) st.push(j);
        }
    }

    //cerr << ans.size() << endl;

    if (ans.size() != n) {
        cout << -1 << endl;
        return 0;
    }

    ll ret = 1;
    bitset<1010> used;
    rep(i, ans.size()) {
        pair<int, int> p = idx2[ans[i]];
        int x = p.first, y = p.second;
        if (used[x] or used[y]) {
            used.reset();
            ret++;
        }
        used[x] = used[y] = 1;
    }

    cout << ret << endl;

    return 0;
}


Measured memory_bytes: 200824
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  vector<string> da(n);
  for(int i=0;i<n;i++){
    cin >> da[i];
  }
  sort(da.begin(),da.end());
  for(int i=0;i<n;i++){
    cout << da[i];
  }
  cout << endl;
}

Measured memory_bytes: 256
module ABC082

	! <module>s to import
	use, intrinsic :: iso_fortran_env


	! require all variables to be explicitly declared
	implicit none


	! accessibility of <subroutine>s and <function>s in this <module>
	public  :: ABC082_A


	! contained <subroutine>s and <function>s are below
	contains


	subroutine ABC082_A

		! variables for this <subroutine>
		integer( kind= INT16 ) :: a, b

		! STEP.01
		! read out the target positive integers
		read *, a, b

		! STEP.02
		! output the result
		write( unit=OUTPUT_UNIT, fmt='(I0)', advance='yes' ) (a+b)/2 + mod( a+b, 2 )

		! STEP.END
		return

	end subroutine ABC082_A

end module ABC082


program main

	! <module>s to import
	use, non_intrinsic :: ABC082

	! require all variables to be explicitly declared
	implicit none

	call ABC082_A


end program main


Measured memory_bytes: 768
import math
from decimal import Decimal
from sys import stdin


def get_result(data):
    A, B = data
    return A * int(B * 100) // 100


if __name__ == '__main__':
    data = stdin.readline().rstrip().split(' ')
    data = [int(data[0]), Decimal(data[1])]
    result = get_result(data)
    print(result)


Measured memory_bytes: 10088
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let n: usize = input();
    let mut a: Vec<i64> = (0..n).map(|_| input()).collect();
    let mut b: Vec<i64> = (0..n).map(|_| input()).collect();
    let mut c: Vec<i64> = (0..n).map(|_| input()).collect();
    a.sort();
    b.sort();
    c.sort();

    let mut ans = 0;
    for i in 0..n {
        let u = bsearch(&a, b[i]);
        let v = bsearch(&c, b[i] + 1);
        ans += u * (n - v);
    }
    println!("{}", ans);
}

fn bsearch(v: &Vec<i64>, k: i64) -> usize {
    let mut l = -1;
    let mut r = v.len() as i64;
    while (r - l).abs() > 1 {
        let m = (l + r) / 2;
        if v[m as usize] >= k {
            r = m;
        } else {
            l = m;
        }
    }
    r as usize
}


Measured memory_bytes: 8444
/*huzaifa242 copyright*/
#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926535897932384626
#define mod 1000000007
#define MAX 1003
int dp[MAX][MAX];
string s[MAX];
int md(int x)
{
    while(x<0)
    x+=mod;
    return x%mod;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifdef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);  
    #endif
    int i,j,n,m;
    cin>>n>>m;
    memset(dp,0,sizeof(dp));
    for(i=0;i<n;i++)
    {
        cin>>s[i];
    }
    for(i=n-1;i>=0;i--)
    {
        for(j=m-1;j>=0;j--)
        {
            if(i==n-1 && j==m-1)
            dp[i][j]=1;
            else if( s[i][j]=='#')
            dp[i][j]=0;
            else if(i==n-1)
            dp[i][j]=md(dp[i][j+1]);
            else if(j==m-1)
            dp[i][j]=md(dp[i+1][j]);
            else
            dp[i][j]=md(dp[i+1][j]+dp[i][j+1]);
        }
    }
    /*for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        cout<<dp[i][j]<<" ";
        cout<<"\n";
    }*/
    cout<<md(dp[0][0])<<"\n";
    return 0;
}

Measured memory_bytes: 5248
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastReader scan = new FastReader();
		int a = scan.nextInt(), b = scan.nextInt(), c = scan.nextInt(), d = scan.nextInt();
		int total = c * b;
		total += (a-c)*d;
		total = (a*b) - total;
		System.out.println(total);
	}
	
	static int ca(int n, String s) {
		boolean[] b = new boolean[n];
		int count = 0;
		for(int i = 0; i < n; i++) {
			if(s.charAt(i) == '<') count++;
			else break;
		}
		return count;
	}
	
	static int cb(int n, String s) {
		boolean[] b = new boolean[n];
		int count = 0;
		for(int i = n-1; i >= 0; i--) {
			if(s.charAt(i) == '>') count++;
			else break;
		}
		return count;
	}
	
	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }

}


Measured memory_bytes: 23124
h, w = map(int, input().split())
s = [input() for _ in range(h)]
ans = []
for i in range(h):
    buf = []
    for j in range(w):
        if s[i][j] == '.':
            cnt = 0
            for r in range(max(0, i - 1), min(h, i + 2)):
                for c in range(max(0, j - 1), min(w, j + 2)):
                    if s[r][c] == '#':
                        cnt += 1
            buf += [cnt]
        else:
            buf += ['#']
    buf = list(map(str, buf))
    ans.append(buf)
for _ in ans:
    print(''.join(_))

Measured memory_bytes: 3188
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuestionC
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] aStrings = Console.ReadLine().Split(' ');
            List<decimal> aList = new List<decimal>();
            foreach(string aString in aStrings)
            {
                aList.Add(decimal.Parse(aString));
            }
            decimal[] a = aList.ToArray();

            decimal aTotal = 0;
            foreach(int num in a)
            {
                aTotal = aTotal + num;
            }

            decimal sum = 0;
            for(int firstIndex = 0; firstIndex < n - 1; firstIndex++)
            {
                aTotal = aTotal - a[firstIndex];
                sum = (sum + a[firstIndex] * aTotal) % (decimal)(Math.Pow(10, 9) + 7);
            }

            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 56112
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::<i32>();
    let i = read::<i32>();

    println!("{}", n-i+1);
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#include<boost/variant.hpp>
using namespace std;
typedef long long ll;
typedef vector<boost::variant<bool, ll, int, string, double, char*, const char*>> any;
template<typename T> inline void pr(const vector<T> &xs){
	for(int i=0; i<xs.size()-1; i++) cout<<xs[i]<<" ";
	(xs.empty()?cout:(cout<<xs[xs.size()-1]))<<endl;
}
#ifdef DEBUG
#define debug(...) pr(any{__VA_ARGS__})
#define debugv(x) pr((x))
#else
#define debug(...)
#define debugv(x)
#endif

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

	cout << (N-1)/2 << endl;

	return 0;
}


Measured memory_bytes: 256
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<vector>
#define N 210000
#define pb push_back
using namespace std;
struct node{int y,nex;}a[2*N];
int e[N][2],len,fir[N],n,sa,sb,dep[N],dfn[N],las[N],id,f[N],p[N],tail,d[N],ans;
bool b[N],v[N];
vector<int> A[N];
void ins(int x,int y)
{
    a[++len].y=y;a[len].nex=fir[x];fir[x]=len;
}
void dfs(int x,int fa)
{
    f[x]=fa;
    dfn[x]=++id;
    dep[x]=dep[fa]+1;
    for(int k=fir[x];k;k=a[k].nex)
    {
        int y=a[k].y;
        if(y==fa) continue;
        dfs(y,x);
    }
    las[x]=id;
}
bool check(int x,int y)
{
    if(dep[x]>dep[y]) swap(x,y);
    if(dfn[x]<=dfn[y] && las[x]>=dfn[y])
    {
        if(dep[y]-dep[x]>2) return 1;
        return 0;
    }
    if(f[x]==f[y]) return 0;
    return 1;
}
void bfs()
{
    v[sa]=1;p[1]=sa;tail=1;
    for(int i=1;i<=tail;i++)
    {
        int x=p[i],siz=A[x].size();
        for(int k=0;k<siz;k++)
        {
            int y=A[x][k];
            d[y]=d[x]+1;
            if(d[y]<dep[y] && v[y]==0) {v[y]=1;p[++tail]=y;}
        }
    }
}
int main()
{
    scanf("%d%d%d",&n,&sa,&sb);
    for(int i=1;i<n;i++) scanf("%d%d",&e[i][0],&e[i][1]);
    for(int i=1;i<n;i++)
    {
        int x,y;scanf("%d%d",&x,&y);
        ins(x,y);ins(y,x);
    }
    dfs(sb,0);
    for(int i=1;i<=n;i++) dep[i]--;
    for(int i=1;i<n;i++)
    {
        int x=e[i][0],y=e[i][1];
        if(check(x,y)) 
            b[x]=b[y]=1;
        else A[e[i][0]].pb(e[i][1]),A[e[i][1]].pb(e[i][0]);
    }
    bfs();
    for(int i=1;i<=n;i++) 
    {
        if(v[i] && b[i]) {printf("-1\n");return 0;}
        if(v[i]) ans=max(ans,dep[i]*2);
    }
    printf("%d\n",ans);
    return 0;
}

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

int main(){
	int N;
	cin >> N;
	vector<int> T(N);
	vector<int> S(N);
	for (int i = 0;i < N;i++) {
		cin >> T[i];
	}
	for (int i = 0;i < N;i++) {
		cin >> S[i];
	}
	vector<int> mxs(1, 0);
	for (int i = 0;i < N;i++) {
		while (T[i]) {
			mxs.push_back(S[i]);
			T[i]--;
		}
	}
	mxs.push_back(0);
	int k = mxs.size();
	double al[110][20010];
	double ans = 0;
	for (int i = 0;i < 102;i++) {
		for (int j = 0;j < k;j++) {
			if (i == 0)	break;
			if (al[i - 1][j] < 1 || mxs[j] < i) {
				al[i][j] = 0;
			}
			else {
				al[i][j] = 1;
			}
		}
		for (int j = 0;j < k;j++) {
			if (i == 0) {
				al[i][j] = 1;
				continue;
			}
			if (al[i][j] == 0)
				continue;
			if (al[i][j - 1] == 0)
				al[i][j] /= 2;
			if (al[i][j + 1] == 0)
				al[i][j] /= 2;
			ans += al[i][j];
		}
	}
	printf("%lf\n",ans);
}

Measured memory_bytes: 17152
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout <<(#x)<<" is "<<(x)<<endl
#define debug cout <<"hi"<<endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
const int MOD=1e9+7;
const int INF32=1<<30;
const ll INF64=1LL<<60;

void solve(){
  int n; cin >>n;
  vector<ll>v(1000001,0);
  for(int i=1; i<=n; i++){
    for(int j=i; j<=n; j+=i) v[j]++;
  }
  int ans=0;
  for(int i=1; i<n; i++) ans+=v[i];
  cout <<ans;
}

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


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

int main() {
	//Problema A
	int x;
	int n;
	cin>>x;
	cin>>n;
	vector<bool> lista(201,true);
	vector<int> v(n);
	int pos1,pos2;
	pos1=x;
	pos2=x;
	for(int i=0;i<n;i++)
	{
		cin>>v[i];
		lista[v[i]]=false;
	}
	bool a1=false;
	bool a2=false;
	if(lista[x]==true) 
	{
		cout<<x<<endl;
		return 0;
	}
	while(a1==false)
	{
		if(lista[pos1-1]==true) a1=true;
		pos1--;
	}
	while(a2==false)
	{
		if(lista[pos2+1]==true) a2=true;
		pos2++;
	}
	if(abs(x-pos1)<=abs(x-pos2)) cout<<pos1<<endl;
	else cout<<pos2<<endl;
	return 0;
}

Measured memory_bytes: 3560
n=int(input())
def kazu(a):
    return (a%10, int(str(a)[0]))
cnt=[[0]*10 for i in range(10)]
for i in range(1,n+1):
    p,q=kazu(i)
    cnt[p][q]+=1
ans=0
for i in range(1,10):
    for j in range(1,10):
        ans+=cnt[i][j]*cnt[j][i]
print(ans)

Measured memory_bytes: 3064
#include <stdio.h>

long long int FuncPutGCD(const long long int a, const long long int b);

int main(void)
{
	long long int a, b;
	int i;

	scanf("%lld %lld", &a, &b);
	printf("%lld\n", FuncPutGCD(a, b));

	return 0;
}

long long int FuncPutGCD(const long long int a, const long long int b)
{
	long long int buf[2], temp;

	if (a == b) {
		return a;
	} else if (a > b) {
		buf[0] = a;
		buf[1] = b;
	} else if (a < b) {
		buf[0] = b;
		buf[1] = a;
	}

	while ((buf[0] % buf[1]) != 0) {
		temp = buf[1];
		buf[1] = buf[0] % buf[1];
		buf[0] = temp;
	}

	return buf[1];
}

Measured memory_bytes: 596
//code by lynmisakura.wish to be accepted
/****************************/
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<vector>
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
/***************************/
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<pair<int,int>> vpi;

const long long Mod = 998244353;
const long long mod = 1000000007;
const long long INF = 10000000000000;

#define pb push_back
#define mp make_pair
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
	
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }

#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
/***************************/
int n,q;
string s;
char t[200010],d[200010];
int over(int x){
	int p = x;
	rep(i,q){
		int dd = 0;
		if(t[i] == s[p]){
			if(d[i] == 'R') dd++;
			else dd--;
		}
		p += dd;
		if(p < 1) return -1;
		if(p > n) return 1;
	}
	return 0;
}
int main(void){
	cin >> n >> q >> s;
	rep(i,q){
		cin>>t[i]>>d[i];
	}
	s.insert(s.begin(),'?');
	s.push_back('?');
	//左から落ちる最右点を求める
	int l = 0,r = n+1;
	int mid;
	rep(i,100){
		mid = (l+r)/2;
		if(over(mid) >= 0){
			r = mid;
		}else{
			l = mid;
		}
	}
	//cout << l << " " << mid << " " << r << endl;
	int left_bound;
	if(over(r) == -1) left_bound = r; else left_bound = l;
	//右から落ちる最左点を求める
	l = 0,r = n+1;
	rep(i,100){
		mid = (l+r)/2;
		if(over(mid) <= 0){
			l = mid;
		}else{
			r = mid;
		}
	}
	int right_bound;
	if(over(l) == 1) right_bound = l; else right_bound = r;
	//cout << left_bound << " " << right_bound << endl;
	cout << right_bound - left_bound - 1<< endl;
	return 0;
}

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

int main(){
	string n;
	string r = "yuiophjklnm";
	string l = "qwertasdfgzxcvb";
	while (1){
		cin >> n;
		if (n[0] == '#') break;
		int cnt = 0;
		int hand = 2; //0:right 1:left 2:unknown
		int flg;
		for (int i = 0; i < n.length(); i++){
			flg = 0;
			//??????????????£???????????´???
			if (hand == 0){
				for (int j = 0; j < r.length();j++){
					if (n[i] == r[j]){
						flg = 1;
						break;
					}
				}
				if (flg == 0){
					hand = 1;
					cnt++;
				}
			}
			//????????\???????????£???????????´???
			else{
				for (int j = 0; j < l.length(); j++){
					if (n[i] == l[j]){
						flg = 1;
						break;
					}
				}
				if (flg == 0){
					if (hand == 2){
						hand = 0;
						continue;
					}
					hand = 0;
					cnt++;
				}
				if (hand == 2){
					hand = 1;
				}
			}
		}
		cout << cnt << endl;
	}
	return 0;
}

Measured memory_bytes: 1188
#include<bits/stdc++.h>
#include<ctype.h>
# define pb push_back
#define fst first
#define sec second
#define For(i,a,b) for(int i=a;i<b;i++)
#define ll long long int
#define ull unsigned long long int
#define mod 1000000007
#define fo(i,n) for(ll i=0;i<n;i++)
#define endl "\n"
#define rev(i,n) for(ll i=n-1;i>=0;i--)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define boolsize 1000001
#define pi pair<ll,ll>
#define vi vector<ll>
#define vii vector<pi>
using namespace std;
template<typename T>
void showvector(vector <T> v)
{
    for(T x:v)
        cout<<x<<" ";
    cout<<endl;

}
template<typename T>
void showvector1(vector <T> v)
{
    ll n=v.size();
    fo1(i,n-1)
        cout<<v[i]<<endl;

}
template<typename T>
void showset(set <T> s)
{
    for(T x: s)
        cout<<x<<" ";
    cout<<endl;
}
template<class T>
void showvectorpair(vector<T> v)
{
    for(auto it=v.begin();it!=v.end();it++)
        cout<<it->first<<" "<<it->second<<endl;
    cout<<endl;
}
template<typename T,typename P>
void showmap(map <T,P> m)
{
    for(auto it=m.begin();it!=m.end();it++)
        cout<<it->first<<" "<<it->second<<endl;
    cout<<endl;
}
template<typename T>
bool comp(T a,T b)
{
    return (a>b);
}
template<class T>
bool comppair(T a,T b)
{
    if(a.first==b.first)
        return(a.second>b.second);
    return (a.first>b.first);
}
bool sameparity(ll a,ll b)
{
    return (a%2==b%2);
}
bool difparity(ll a,ll b)
{
    return !(a%2==b%2);
}
bool isprime(ll x)
{   if(x<=1)
     return false;
    for(ll i=2;i<=sqrt(x);i++)
    {
        if(x%i==0)
            return false;
    }
    return true;
}
bool iseven(ll x)
{
    return !(x%2);
}
bool isodd(ll x)
{
    return (x%2);
}
/// check for test case before submitting
void vfun()
{
    ll n,k;
    cin>>n;
    vector <ll> v(n);
    fo(i,n)
    cin>>v[i];

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("inputh.txt", "r", stdin);
    freopen("outputh.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0); ///cant use scanf, printf
    cin.tie(0);cout.tie(0); /// no longer auto flush cout before each cin, remove for interactive
    //cout << fixed << setprecision(11); /// no scientific output
    ll test=1;
    //cin>>test;
    while(test--)
    {
        ll n;
        cin>>n;
        vi v;
        ll x,flag=0,cnt=0;
        fo(i,n)
        {
            cin>>x;
            if(x%4==0)
                cnt++;
            else if(x%2==0)
                flag=1;
            else
                v.pb(x);
        }
        ll siz=v.size();
        if(siz==0)
            {cout<<"Yes";return(0);}
        if(flag==1)
            siz+=1;
        if(cnt>=siz-1)
            cout<<"Yes";
        else cout<<"No";



//         if(vfun())
//            cout<<"YES\n";
//         else
//            cout<<"NO\n";
    }
}
///before sub
/// check for value of zero and single input in array
///loop vars,1LL in mult, equal, one, bounds, int v ll, endl, finish taking inputs
/// check whether test cases are given or not





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

int main(){

	int N, M;
	list<int> D; // difficulties
	list<int> T; // questions
	cin >> N;
	int tmp;
	
	for(int i=0; i<N; i++){
		cin >> tmp;
		D.push_back(tmp);
	}	
	D.sort();

//	for(list<int>::iterator it = D.begin(); it != D.end(); it++){
//		cout << *it << endl;

//	}

	cin >> M;

	// 問題数が足りない場合は問答無用でNO
	if(N < M){
		cout << "NO" << endl;
		return 0;
	}

	// 問題数が足りる場合
	int difficulty = 0;
	for(int i=0; i<M; i++){
		cin >> difficulty; // 問題の難易度		
		T.push_back(difficulty);
	}
	T.sort();


	bool is_able = true;
	// 必要なすべての問題について
	list<int>::iterator d_it = D.begin();
	list<int>::iterator t_it = T.begin();
	while(is_able && d_it != D.end() && t_it != T.end()){
		// d_itが必要な難易度(t_it)を指していた場合
		if(*d_it == *t_it){
			d_it++;
			t_it++;
		} 
		else if(*d_it < *t_it){ // d_itが必要な難易度を下回る場合
			d_it++;
		}else if(*d_it > *t_it){ 
			is_able = false;
		}
	}

	if(is_able)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;

	return 0;
}


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

using namespace std;

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

    for(int a = 0; a < 4; a++){
        if(x - a * 7 < 0){
            cout << "No" << endl;
            break;
        }
        if((x - a * 7) % 4 == 0){
            cout << "Yes" << endl;
            break;
        }else if(a == 3) cout << "No" << endl;
    }
    return 0;
}

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

typedef long long LL;
typedef long double LD;
const int N = 6, M = 50 * 6 + 10;
int n, C, l[N], L[N];

LL dp[1 << N][M]; // dp[S][j] : use S cover [0, j]

LL solve(int k) {
	std::memset(dp, 0, sizeof dp), dp[0][L[n - 1]] = 1;
	int len = C * k, mask = ~(-1 << n - 1);
	for (int i = 0; i < len; ++i)
		for (int j = 0; j < n - 1; ++j)
			for (int S = 0; S <= mask; ++S) if (!(S >> j & 1)) {
				for (int l = i; l <= len; ++l)
					dp[S | 1 << j][std::max(l, std::min(i + L[j], len))] += dp[S][l];
			}
	return dp[mask][len];
}

int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n >> C;
	for (int i = 0; i < n; ++i) std::cin >> l[i];
	std::sort(l, l + n);
	LD ans = 0;
	for (int k = 1; k <= n; ++k) {
		for (int i = 0; i < n; ++i) L[i] += l[i];
		LD ret = solve(k);
		for (int l = 1; l <= n; ++l) if (l != k) ret /= k - l;
		ans += ret;
	}
	std::cout << std::fixed << std::setprecision(16) << ans * pow(C, 1 - n) << '\n';
	return 0;
}

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

int
main(int argc, char* argv[]) {
  int N;
  cin >> N;
  int L[N];
  int i,j,k,ans;
  int len1,len2,len3;
  ans = 0;
  for(i = 0; i < N; i++){
    cin >> L[i];
  }
  for(i = 0; i < N; i++){
    for(j = i+1; j < N; j++){
      for(k = j+1; k < N; k++){
        len1 = L[i];
        len2 = L[j];
        len3 = L[k];
        if(len1 != len2 && len2 != len3 && len3 != len1){
          if((len3+len2)>len1 && (len1+len2)>len3 && (len3+len1)>len2){
            ans++;
        }
        }
     }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define enld endl

int main() {
	lint A, B, X;
	cin >> A >> B >> X;
	lint ans = 0;
	if (A == 0) {
		ans = B / X + 1;
	}
	else {
		ans = B / X - (A - 1) / X;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

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

        int result = 0;
        if (a >= 13) {
            result = b;
        } else if (6 <= a && a <= 12) {
            result = b / 2;
        }
        
        System.out.println(result);
    }
}


Measured memory_bytes: 35756
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

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

	string a;
	cin >> a;

	vector<int> x(N);
	for (int i = 0; i < N; i++) {
		x[i] = a[i] - '0';
		x[i]--;
	}

	int xs = 0;
	for (int i = 0; i < N; i++) {
		int tmp = x[i] % 2;
		if (((N - 1) & i) != i)tmp *= 0;
		xs += tmp;
	}
	if (xs % 2 == 1) {
		cout << 1 << endl;
		return 0;
	}

	bool f = 0;
	for (int i = 0; i < N; i++) {
		if (x[i] == 1)f = true;
	}
	if (f) {
		cout << 0 << endl;
		return 0;
	}

	
	int xs_ = 0;
	for (int i = 0; i < N; i++) {
		int tmp = x[i] / 2;
		if (((N - 1) & i) != i)tmp *= 0;
		xs_ += tmp;
	}
	if (xs_ % 2 == 1) {
		cout << 2 << endl;
	}
	else {
		cout << 0 << endl;
	}
}

Measured memory_bytes: 5252
#include <stdio.h>
int main(void){
  int n;
  int a,b,c;
  scanf("%d",&n);
  
  a=n/100;
  b=(n%100)/10;
  c=n%10;
  
  if(a==7 || b==7 || c==7 ){
    printf("Yes");
  }else{
    printf("No");
  }
  
  return 0;
}

Measured memory_bytes: 1704
import java.util.Arrays;
import java.util.Scanner;

public class Main
{
	public static void main(String arg[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[] = new int[8];

		while(n>0)
		{ 
			String  b = sc.next();
			int max =0;
			int min =0;
			int sum=0;
			for(int i=0; i<8; i++)
			{
				a[i]=Integer.valueOf(b.charAt(i))-48;
			}
			Arrays.sort(a);
			for(int i=1; i<= 8; i++)
			{
				max += a[i-1]* fact(i);	
			}
			for(int i=7;i>=0; i--)
			{
				min +=a[i]*fact(8-i);
			}
			System.out.println(max-min);
			n--;
		}
	}
	public static int fact(int n)
	{
		if(n == 1)
			return 1;
		return fact(n-1)*10;
	}


}

Measured memory_bytes: 11000
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)
	j := -1
	k := -1
	for i, c := range s {
		if c == 'C' && j < 0 {
			j = i
		}
		if c == 'F' {
			k = i
		}
	}
	if j >= 0 && j < k {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512