akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define foreach(i,v) for(auto&& i: v)
#define all(x) (x).begin(), (x).end()

typedef std::vector< std::string > VS;
typedef std::vector<int> VI;
typedef long long ll;

template <class C> C& mini(C& a, C b) { if (b < a) a = b; return a; }
template <class C> C& maxi(C& a, C b) { if (a < b) a = b; return a; }

using namespace std;

template <typename T> void read(T& x) { x.read(); }
template <typename T> void read(vector<T>& v) { for (T& x: v) read(x); }
template <typename X, typename Y> void read(pair<X, Y>& p) { read(p.first); read(p.second); }
template <> void read(int& x) { scanf("%d", &x); }
template <> void read(unsigned int& x) { scanf("%u", &x); }
template <> void read(long long& x) { scanf("%lld", &x); }
template <> void read(unsigned long long& x) { scanf("%llu", &x); }
template <typename T> void readv(vector<T>& v) { int N; read(N); v.resize(N); read(v); }
template <typename T, typename ...Ts> void read(T& x, Ts&... args) { read(x); read(args...); }

#define MOD 1000000007


int main(int argc, const char* argv[]) {
    VI A;
    readv(A);
    ll ret = 1;
    int cnt[3] = {};
    foreach (a, A) {
        int f = 0;
        for (int j = 0; j < 3; j++)
            if (cnt[j] == a) {
                if (!f)
                    cnt[j]++;
                f++;
            }
        ret = ret * f % MOD;
    }
    printf("%lld\n", ret);
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int s1[100005],s2[100005];
int main()
{
	string s,t;
	cin>>s>>t;
	s=" "+s;t=" "+t;
	int n=s.size(),m=t.size();
	for(int i=1;i<n;i++)if(s[i]=='A')s1[i]=s1[i-1]+1;else s1[i]=s1[i-1]+2;
	for(int i=1;i<m;i++)if(t[i]=='A')s2[i]=s2[i-1]+1;else s2[i]=s2[i-1]+2;
	int q;
	cin>>q;
	while(q--)
	{
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		int ss1=s1[b]-s1[a-1];
		int ss2=s2[d]-s2[c-1];
		if(ss1%3!=ss2%3)puts("NO");else puts("YES");
	}
	return 0;
}

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

int main(){
    ll n,k;
    cin>>n>>k;
    ll t=n/k;
    ll mn=min(abs(t*k-n),abs((t+1)*k-n));
    cout<<mn<<endl;
    return 0;
}

Measured memory_bytes: 256
def divisible_count(n):
    # 約数の個数
    divisors = 0
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1
    return divisors


n = int(input())
print(sum(divisible_count(x) == 8 for x in range(1, n+1, 2)))

Measured memory_bytes: 3188
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>
#include <cassert>
#include <bitset>
#include <stack>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define EL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using Graph = std::vector<std::vector<int> >;
const int INF = 1e17;
/* libraries */

// ceil of a/b
inline int ceildiv(int a, int b) { return (a+b-1)/b; }


signed main() {
	int a,b,c,d;
	std::cin >> a >> b >> c >> d;
	if(ceildiv(c,b)<=ceildiv(a,d)) {
		print("Yes");
	} else print("No");
	return 0;
}


Measured memory_bytes: 3676
A, B, M = [int(s) for s in input().split()]
Alist = [int(s) for s in input().split()]
Blist = [int(s) for s in input().split()]
minimum = min(Alist) + min(Blist)
for i in range(M):
  xi, yi, c = [int(s) for s in input().split()]
  xi = xi-1
  yi = yi-1
  attempt = Alist[xi] + Blist[yi] - c
  if minimum >= attempt:
    minimum = attempt
print(minimum)

Measured memory_bytes: 18488
#include <iostream>
#include <string>
using namespace std;
int main(){
     string S;
     int Day=0;
     cin >> S;
     if (S=="SUN")Day=7;
     if (S=="MON")Day=6;
     if (S=="TUE")Day=5;
     if (S=="WED")Day=4;
     if (S=="FRI")Day=2;
     if (S=="THU")Day=3;
     if (S=="SAT")Day=1;
     cout << Day <<endl;
}


Measured memory_bytes: 3620
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, double> pid;
typedef pair<double, int> pdi;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
//const int MOD = (int)1e9 + 7;
const int MOD = 998244353;

const double EPS = 1e-9;

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

	int N, S;
	cin >> N >> S;

	vector<int> A(N);
	rep(i, 0, N)cin >> A[i];

	vector<int> DP(3010, 0);
	DP[0] = 1;
	rep(i, 0, N)
	{
		rrep(j, 0, 3010)
		{
			DP[j] = (DP[j] * 2) % MOD;
			if (j - A[i] >= 0)
			{
				DP[j] += DP[j - A[i]];
				DP[j] %= MOD;
			}
		}
	}

	cout << DP[S] << endl;

	return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

int main(){
  using namespace std;
  int n, k;
  cin>>n>>k;
  int a[n];
  REP(i, n) cin>>a[i];
  
  int ans[n];
  REP(i, n) ans[i] = a[i];
  if(k >= 41){
    REP(i, n) cout << n << ' ';
    cout << endl;
    return 0;
  }
  REP(_, k){
    vector<int> temp(n, 0);
    REP(i, n){
      int l = max(0, i - ans[i]);
      int r = min(n - 1, i + ans[i]);
      temp[l]++;
      if(r + 1 < n) temp[r + 1]--;
    }
    REPP(i, n - 1) temp[i] += temp[i - 1];
    REP(i, n) ans[i] = temp[i];
  }
  REP(i, n) cout << ans[i] << ' ';
  cout << endl;  
  return 0;
}


Measured memory_bytes: 5960
import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			if (n == 0)
				break;
			Team[] teams = new Team[n];
			for(int i = 0;i<n;i++){
				String name = scanner.next();
				int win =0;
				int lose = 0;
				for(int j = 0;j<n-1;j++){
					int a = scanner.nextInt();
					if(a==0)
						win++;
					else if(a==1)
						lose++;
				}
				teams[i] = new Team(name, win, lose);
			}
			Arrays.sort(teams);
			for(Team t:teams)
				System.out.println(t.name);
			
			

		}
	}

	class Team implements Comparable<Team> {
		String name;
		int win;
		int lose;
		
		


		public Team(String name, int win, int lose) {
			super();
			this.name = name;
			this.win = win;
			this.lose = lose;
		}




		@Override
		public int compareTo(Team o) {
			if (this.win == o.win)
				return this.lose - o.lose;
			return o.win - this.win;
		}

	}
}

Measured memory_bytes: 23300
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String str;
    int count = 0;

    for(int i=1; i<=n; i++){
      str = String.valueOf(i);
      if(str.length()%2!=0){
        count += 1;
      }

    }
    System.out.println(count);
  }
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll a,b,x;
    cin>>a>>b>>x;
    YES(a<=x && a+b>=x)
    return  0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
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;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}
template<class T>inline void outs(vector<T> V){int n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}
inline void solve(void){
  ld N,M;in(N,M);
  vector<ll>A(N);ins(A);
  ld sum=0;
  rep(i,N)sum+=A[i];
  ll cnt=0;
  rep(i,N)if(A[i]>=sum/(4*M))cnt++;
  out(cnt>=M?"Yes":"No");
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
dict_ = dict()
[exec("dict_['{0}'] = dict_.get('{0}', 0) + 1".format(input())) for _ in range(int(input()))]
[exec("dict_['{0}'] = dict_.get('{0}', 0) - 1".format(input())) for _ in range(int(input()))]
print(max(max(dict_.values()), 0))


Measured memory_bytes: 3060
//abc149_a.cpp
//Sun Jan 12 11:17:03 2020

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	string s,t;
	cin >> s >> t;

	cout << t << s << endl;
//	printf("%.4f\n",ans);
}

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

int main()
{
  int n;
  cin >> n;
  
  vector<int> a(n);
  
  for(int i = 0; i < n; i++)
    cin >> a.at(i);

  int l = 0, r = n - 1, ans = 0;
  int i = 0;
  while(i < n){
    if(ans >= 0){
      ans -= a.at(r);
      r--;
    }
    else if(ans < 0){
      ans += a.at(l);
      l++;
    }
    i++;
  }
  
  cout << abs(ans) << endl;
  
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
using namespace std;
long long n, m, dp[305][305][305], mod = 1000000007;
long long solve(long long pos, long long rec1, long long rec2) {
	if (rec1 + rec2 > n)return 0;
	if (pos == m) {
		if (rec1 == n && rec2 == 0)return 1;
		return 0;
	}
	if (dp[pos][rec1][rec2] >= 1)return dp[pos][rec1][rec2] - 1;
	long long ret = 0;
	ret += solve(pos + 1, rec1 + rec2, 0)*rec1;
	ret += solve(pos + 1, rec1, rec2)*rec2;
	ret += solve(pos + 1, rec1, rec2 + 1)*(n - rec1 - rec2); ret %= mod;
	dp[pos][rec1][rec2] = ret + 1;
	return ret;
}
int main() {
	cin >> n >> m;
	cout << solve(0, 1, 0) << endl;
	return 0;
}

Measured memory_bytes: 217344
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#include <cmath>

using namespace std;

int power(int m){
	int ret = 1;
	for(int i=1;i<=m;i++){
		ret *= 100;
	}
	return ret;
}

int main(void){
	int d, n;
	cin >> d >> n;
	if(n!=100){
		cout << n * power(d) << endl;
	}else{
		cout << power(d) * 101 << endl;
	}
	return 0;
}

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

int main(){
  int N;
  cin >> N;
  vector<long long> L(N+1);
  L.at(0) = 2;
  L.at(1) = 1;
  for(int i=2;i<N+1;i++){
    L.at(i) = L.at(i-1) + L.at(i-2);
    
  }
  cout << L.at(N) << endl;
  
}

Measured memory_bytes: 256
require 'set'
N, M, *rest = $stdin.read.split.map(&:to_i)
EDGES = Hash.new{|h, k| h[k] = Set[]}
rest.each_slice(2) do |a, b|
  EDGES[a] << b
  EDGES[b] << a
end

$pre = Array.new(N+1)
$low = Array.new(N+1)

$n_bridges = 0
def solve(node:, next_pre:, from:)
  $pre[node] = next_pre
  $low[node] = next_pre
  EDGES[node].each do |node2|
    if $low[node2]
      next if node2 == from
      $low[node] = $low[node2] if $low[node2] < $low[node]
    else
      solve(node: node2, next_pre: next_pre+1, from: node)
      $low[node] = $low[node2] if $low[node2] < $low[node]
      if $low[node2] == $pre[node2]
        $n_bridges += 1
      end
    end
  end
end

solve(node: 1, next_pre: 0, from: nil)
p $n_bridges


Measured memory_bytes: 2044
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset

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

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

	int sum = A + B + C;
	string result = "";
	if (sum < 22) {
		result = "win";
	}
	else {
		result = "bust";
	}
	cout << result << endl;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
A=set(a);B=set(b)
if len(A)!=len(a) or len(B)!=len(b):
  print(0)
else:
  c=1;cn=0;cm=0
  for k in range(m*n,0,-1):
    if k in A and k in B:
      cn+=1;cm+=1
    elif k in A:
      c*=cm;cn+=1
    elif k in B:
      c*=cn;cm+=1
    else:
      c*=cm*cn-m*n+k
    c=c%(10**9+7)
  print(c)

Measured memory_bytes: 3188
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <locale>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <vector>

const long long int INF = 1e9;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define Rep(i, n) for(int i = 1; i <= (int)(n); i++)
#define llrep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define llRep(i, n) for(ll i = 1; i <= (ll)(n); i++)

using namespace std;

struct Point{
	int x,y;
};

bool vector_finder(std::vector<ll> vec, ll number) {
    auto itr = std::find(vec.begin(), vec.end(), number);
    size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return true;
    }
  else { // 発見できなかったとき
    return false;
    }
}

ll factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
    }
    return ans;
}

ll extended_factorial(ll N){
    ll ans = 1;
    llRep(i,N){
        ans *= i;
        ans %= (ll)(1e9+7);
    }
    return ans;
}

vector<ll> Eratosthenes(ll N){
    bool arr[N+1];
    //initialization
    arr[0] = false;
    arr[1] = false;
	for(ll i = 2; i < N+1; i++){
		arr[i] = true;
	}
    //eratosthenes
	for(ll i = 2; i <= sqrt(N); i++){
		if(arr[i]){
			for(ll j = 0; i * (j + 2) <= N; j++){
				arr[i *(j + 2)] = false;//not prime number
			}
		}
	}
    vector<ll> prime;
    llRep(i,N){
        if (arr[i]==true){
            prime.push_back(i);
        }
    }
    return prime;
}

char alphabet[] = {
    'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'
};

// 二分探索
// llrep(i,N){
//     b = B[i];
//     auto cntA = lower_bound(A.begin(), A.end(), b);//イテレータなのでそのままllに変換とかはできない
//     auto cntC = upper_bound(C.begin(), C.end(), b);
//     ll cntA_ll = distance(A.begin(), cntA);
//     ll cntC_ll = C.size() - distance(C.begin(), cntC);
//     cnt += (cntA_ll * cntC_ll);
// }


int main(){
    int X,A;
    cin >> X >> A;
    if (X < A){
        cout << 0 << endl;
    }else{
        cout << 10 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#if 0

#endif

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<int(n);++i)
using namespace std;
template<class A>void p(A a){cout << (a) << endl;}
template<class A,class B>void p(A a,B b){cout << a << " "  ;p(b);}
template<class A,class B,class C>void p(A a,B b,C c){cout << a << " " ;p(b,c);}
template<class A,class B,class C,class D>void p(A a,B b,C c,D d){cout << a << " " ;p(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for copy
// for(int i=0;i<N;++i) {

int main(void) {
  set<int> S;
  int N;cin>>N;
  REP(i,N) {
    int A; 
    cin>>A;
    S.insert(A);
  }
  if (S.size() == N) {
    p("YES");
  } else {
    p("NO");
  }
  return 0;
}



Measured memory_bytes: 9600
import sys
from operator import itemgetter
import math

sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    A, B, C, D = mi()
    A -= 1
    CD_lcm = C * D // math.gcd(C, D)
    ans = B - B//C - B//D + B//CD_lcm
    ans -= A - A//C - A//D + A//CD_lcm
    print(ans)
    return

main()


Measured memory_bytes: 9132
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<iterator>
#include<complex>
#include<stack>
#include "stdio.h"
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const long long mod_const = 1e9+7;
using MIte = multimap<long, long, greater<long> >::iterator;

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

	// long long?
	long long H, W;
	cin >> H >> W;

	vector<vector<char> > vvA;
	rep(i, H) {
		vector<char> vtmp(W);
		bool black = false;
		rep(j, W) {
			cin >> vtmp[j];
			if (vtmp[j] == '#') black = true;
		}
		if (black) {
			vvA.push_back(vtmp);
		}
	}


	vector<vector<char> > vvA2(W);
	for (int i = 0; i != W; ++i) {
		vector<char> vtmp(vvA.size());
		for (int j = 0; j != vvA.size(); ++j) {
			vtmp[j] = vvA[j][i];
		}
		vvA2[i] = vtmp;
	}

	vector<vector<char> > vvA3;
	for (int i = 0; i != W; ++i) {
		bool black = false;
		for (int j = 0; j != vvA.size(); ++j) {
			if (vvA2[i][j] == '#') black = true;
		}
		if (black) {
			vvA3.push_back(vvA2[i]);
		}
	}

	vector<vector<char> > vvA4(vvA.size());
	for (int i = 0; i != vvA.size(); ++i) {
		vector<char> vtmp(vvA3.size());
		for (int j = 0; j != vvA3.size(); ++j) {
			vtmp[j] = vvA3[j][i];
		}
		vvA4[i] = vtmp;
	}

	rep(i, vvA4.size()) {
		rep(j, vvA3.size()) {
			cout << vvA4[i][j];
		}
		cout << endl;
	}
	
	return 0;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;

#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 1LL << 20;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { 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; }

void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}


void execute()
{
    ll A, B, N;
    cin >> A >> B >> N;

    ll x;
    if(N < B){
        x = N;
    }else{
        x = B - 1;
    }
    ll v = (A*x/B)-A*(x/B);

   cout << v << endl;
}


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

class UnionFind
{
    int par[100002], rank[100002];
    
public:
    UnionFind(int n){
        for(int i = 0; i < n; i++){
            par[i] = i;
            rank[i] = 0;
        }
    }
    
    int find(int i){
        if(i == par[i]) return i;
        return par[i] = find(par[i]);
    }
    
    bool same(int i, int j){
        return par[i] == par[j];
    }
    
    void unite(int i, int j){
        if(same(i, j)) return;
        i = find(i), j = find(j);
        if(rank[i] < rank[j]) par[i] = j;
        else{
            par[j] = i;
            if(rank[i] == rank[j]) rank[i]++;
        }
    }
};

int main()
{
    int n, m;
    cin >> n >> m;
    int a[100002], b[100002];
    vector<int> v[100002];
    for(int i = 0; i < m; i++){
        cin >> a[i] >> b[i];
        v[a[i]].push_back(b[i]);
        v[b[i]].push_back(a[i]);
    }
    UnionFind uf(n + 1);
    vector<int> p1;
    int now = 1;
    while(true){
        bool ifend = true;
        for(int next : v[now]){
            if(!uf.same(now, next)){
                ifend = false;
                p1.push_back(next);
                uf.unite(now, next);
                now = next;
                break;
            }
        }
        if(ifend) break;
    }
    vector<int> p2;
    now = 1;
    while(true){
        bool ifend = true;
        for(int next : v[now]){
            if(!uf.same(now, next)){
                ifend = false;
                p2.push_back(next);
                uf.unite(now, next);
                now = next;
                break;
            }
        }
        if(ifend) break;
    }
    int l1 = p1.size();
    int l2 = p2.size();
    cout << l1 + l2 + 1 << endl;
    for(int i = l2 - 1; i >= 0; i--){
        cout << p2[i] << " ";
    }
    cout << 1 << " ";
    for(int i = 0; i < l1; i++){
        cout << p1[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 8312
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int x, y, z;
  cin >> x >> y >> z;
  cout << z << " " << x << " " << y << endl;
  return 0;
}

Measured memory_bytes: 256
package main
 
import "fmt"
 
func main() {
	N, Q := 0, 0
	S := ""
	fmt.Scan(&N, &Q)
	fmt.Scan(&S)
	s := make([]int, N+1)
	s[0] = 0
	for i := 0; i < N; i++ {
		if i+1 < N && S[i] == 'A' && S[i+1] == 'C' {
			s[i+1] = s[i] + 1
		} else {
			s[i+1] = s[i]
		}
	}
 
	for i := 0; i < Q; i++ {
		l, r := 0, 0
		fmt.Scan(&l, &r)
		l--
		r--
		fmt.Println(s[r] - s[l])
	}
}

Measured memory_bytes: 8196
#include <stdio.h>

int main(){
  int i,n,H[251];

  scanf("%d",&n);
  for(i=1;i<=n;i++)scanf("%d",&H[i]);

  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,H[i]);
    if(i!=1)printf("parent key = %d, ",H[i/2]);
    if(2*i>n&&2*i+1>n){
      printf("\n");
      continue;
    }
    else if(2*i+1>n){
      printf("left key = %d, \n",H[2*i]);
      continue;
    }
    else printf("left key = %d, right key = %d, ",H[2*i],H[2*i+1]);
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 600
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
c = Counter(a)

ans = 0
for i in a:
    if c[i] == 0:
        continue
    c[i] -= 1
    k = 1<<i.bit_length()
    j = k-i
    if j in c and c[j] > 0:
        ans += 1
        c[j] -= 1
print(ans)

Measured memory_bytes: 33296
#include<bits/stdc++.h>
#define ll long long
using namespace std;
signed main(){
  ll a,b,c,x,cun=0;
  cin>>a>>b>>c>>x;
  for(ll i=0;i<=a;i++){
    for(ll j=0;j<=b;j++){
      for(ll k=0;k<=c;k++){
        if(500*i + 100*j + 50*k == x){
          cun++;
        }
      }
    }
  }
  cout<<cun<<"\n";
  return 0;
}

Measured memory_bytes: 256
import math
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("YES")
    elif q == 0:print("NO")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def printrow(a):
    for i in a:
        print(i)
"""
#decomment when needed
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
"""
n = ip()
a = []
for i in range(5):
    a.append(ip())
if min(a)>=n:
    print(5)
    exit(0)
ans = n//min(a)
if n%min(a):
    ans+=1
print(ans+4)

Measured memory_bytes: 14468
#include <stdio.h>
#include <vector>
using namespace std;

int n, k, m, add;

void kan()
{
    vector<int> ls;
    for (int i = 0; i < n; i++)
    {
        ls.push_back(i);
    }

    ls.erase(next(ls.begin(), add));
    n--;
    for (;;)
    {
        if (ls.size() == 1)
            break;
        add += k - 1;
        add = add % n;
        ls.erase(next(ls.begin(), add));
        n--;
    }
    for (int x : ls)
    {
        printf("%d\n", x + 1);
    }
}

int main()
{
    for (;;)
    {
        scanf("%d %d %d", &n, &k, &m);
        if (n == 0 && k == 0 && m == 0)
        {
            return 0;
        }
        add = m - 1;
        kan();
    }
}


Measured memory_bytes: 2752
import java.util.Scanner;

public class Main {

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

		String verdict = null;

		if (a < b && b < c) {
			verdict = "Yes";
		} else {
			verdict = "No";
		}
		System.out.println(verdict);
	}

}


Measured memory_bytes: 26404
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define EACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class Value>using vec = vector< Value >;
using ll = long long;
using P = pair< long long, long long >;
#define fi first
#define se second
#define el endl
#pragma endregion

void Main();

int main(){
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}
void Main(){
    ll N, D, X;
    cin >> N >> D >> X;
    REP(i, N){
        int A;
        cin >> A;
        X+=1+((D-1)/A);
    }
    cout << X << el;
}



Measured memory_bytes: 764
n,k=map(int,input().split())
s=list(input())

if s[k-1]=="A":
    s[k-1]="a"
if s[k-1]=="B":
    s[k-1]="b"
if s[k-1]=="C":
    s[k-1]="c"
s="".join(s)
print(s)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = (int)(a); i <= (int)(n); ++i)
#define rrep(i, a, n) for (int i = (int)(a); i >= (int)(n); --i)
#define debug(x) cerr << #x << " = " << x << "\n"
#define debugv(x) \
  rep(f, 0, (x.size() - 1)) cerr << x[f] << (f == (x.size() - 1) ? "\n" : " ")
#define all(x) x.begin(), x.end()
#define int long long
using namespace std;
typedef pair<int, int> pii;
const int INF = ((1LL << 30) + (1LL << 29));
const int MOD = 1000000007;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
int N, M, K;
vector<int> A, B;
string S, T;
vector<char> SS, TT;
void input() {
  int i, j, k, x, y;
  string s;

  cin >> S;
  cin >> T;
}
void solve() {
  int ts = T.size();
  SS.resize(S.size());
  TT.resize(T.size());
  rep(i, 0, S.size() - 1) { SS[i] = S[i]; }
  rep(i, 0, T.size() - 1) { TT[i] = T[i]; }

  bool matched = false;
  rrep(i, SS.size() - 1, 0) {
    bool mc = true;
    if (i + ts - 1 < SS.size()) {
      rrep(j, ts - 1, 0) {
        if (SS[i + j] != '?' && SS[i + j] != TT[j]) {
          mc = false;
        }
      }
      if (mc) {
        matched = true;
        rep(j, 0, ts - 1) { SS[i + j] = TT[j]; }
      }
    }
    if (matched) break;
  }
  if (matched) {
    rep(i, 0, SS.size() - 1) { cout << (SS[i] == '?' ? 'a' : SS[i]); }
    cout << endl;
  } else {
    cout << "UNRESTORABLE" << endl;
  }
}
signed main() {
  input();
  solve();
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pipii;

void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> v;
  while(v.size() < k) {
    v.push_back(1);
    n--;
  }
  while(n) {
    v[0]++;
    n--;
  }
  cout << v[0] - v.back() << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
using namespace std;
int N, K, h[200010];
long long ans;
int main() {
    int i;
    scanf("%d%d", &N, &K);
    for(i = 1; i <= N; ++i) {
        scanf("%d", &h[i]);
    }
    sort(h + 1, h + N + 1);
    for(i = 1; i <= N - K; ++i) ans += h[i];
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 896
#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    map<char,int> m;
    string s;cin>>s;
    for(int i=0;i<4;i++) m[s[i]]++;
    if(m.size()!=2||m[s[0]!=2]) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 3584
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
template <class T>
T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T>
T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T>
T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}
template <class T>
bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A, B, C;
    cin >> A >> B >> C;
    cout << min(C, B / A) << endl;
    return 0;
}


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

int main(){
    int N;
    cin >> N;
    vector<int> data(N);
    rep(i,N) cin >> data.at(i);
    int high=0;
    string ans="Yes";
    for (int j=0;j<N;j++){
        if ((data.at(j)-1) >= high ){
            high = data.at(j)-1;
        }else if(data.at(j)  >=high){
            high = data.at(j);
        }else{
            ans = "No";
            break;
        }
    }
    cout << ans << endl;
}

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

#define       pb                 push_back
#define       mx                 200005
#define       MOD                1000000007
#define 	  optimize           ios::sync_with_stdio(0);cin.tie(0);
#define 	  inf                0x3f3f3f3f
#define       READ               freopen("in.txt", "r", stdin);
#define       WRITE              freopen("out.txt", "w", stdout);

using namespace std;

typedef       long long int      ll;
typedef       vector<int> 	     vi;

int main()
{
    string a, b;
    int ans=0;
    
    cin >> a >> b;
    
    for(int i = 0; i < 3; i++)
    {
        if(a[i]==b[i]) ans++;
    }
    cout << ans << endl;


    return 0;
}


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

int ansmin, ansmax;
int used[9];
	
int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(a >= 3200){
			ansmax++;
			used[8] = true;
		} else if(!used[a/400]){
			ansmin++;
			ansmax++;
			used[a/400] = true;
		}
	}
	
	if(ansmin == 0 && used[8]) ansmin = 1;
	cout << ansmin << " " << ansmax << endl;
	
	return 0;
}

Measured memory_bytes: 384
import math


if __name__ == "__main__":

    while(True):
        n = int(input())

        if n == 0:
            break

        param = input().split(" ")
        scores = [int(a) for a in param]

        average = sum(scores)/len(scores)
        variance = sum([(a - average)**2 for a in scores])/len(scores)
        stddev = math.sqrt(variance)

        print(str(stddev))



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

ll dp[100005];
ll arr[100005];

int main() {
    ll n,k;
    cin>>n>>k;
    for(ll x=0; x<n; x++)cin>>arr[x];
    dp[0]=0;
    if(n==2){
        cout<<abs(arr[0]-arr[1]);
    }
    else {
        ll i;
        dp[1]=abs(arr[1]-arr[0]);
        for(ll x=2; x<n; x++){
            dp[x]=dp[x-1]+abs(arr[x]-arr[x-1]);
            i=k-1;
            for(ll y=x-2; y>=0 && i; y--,i--){
                dp[x]=min(dp[x],dp[y]+abs(arr[x]-arr[y]));
            }
            //cout<<dp[x]<<" ";
        }
        cout<<dp[n-1];
    }
    return 0;
}


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

#define pb         push_back

typedef long long ll;
const ll INF = 1000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;

int main(void) {
	
	int n;
	set<int> p;
	int pos[200005];
	long long ans = 0;

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

	p.insert(-1);
	p.insert(n);
	for(int i=1; i<=n; i++){
		auto l = --p.lower_bound(pos[i]);
		auto r = p.upper_bound(pos[i]);
		ans += (long long)i* (abs((*l) - pos[i])) * (abs((*r) - pos[i]) );
		p.insert(pos[i]);
	}

	cout << ans<< endl;

	

	return 0;
}


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


int main(){
  int n;
  cin >> n;
  int ma,mi;
  ma=-1;
  mi=100000;
  for(int i=0;i<n;++i){
    int a;
    cin >> a;
    ma=max(ma,a);
    mi=min(mi,a);
  }
  cout << ma-mi << endl;
  return 0;
}


Measured memory_bytes: 3524
import sys
def main():
    input = sys.stdin.readline
    AB = list(map(int, input().split()))
    A = AB[0]
    B = AB[1]

    ans = 0
    cnt = 1
    while cnt < B:
        ans += 1
        cnt = A * ans - ans + 1
        #print(ans)
        #print(cnt)
    print(ans)
if __name__ == '__main__':
    main()

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

using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define PRINT(item) cout << (item) << endl;
#define PRINT_VEC(V)                                                           \
    for (auto v : (V))                                                         \
        cout << v << ' ';
const int MOD = 1000000007;
/* cout << fixed << setprecision(10) << decimal << endl; */

int main() {
    /* code */
    int A, B;
    cin >> A >> B;
    FOR(i, 1, 10001) {
        int a = i * 0.08;
        int b = i * 0.10;
        if (a == A && b == B) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
function Main(input) {
	input = input.split(" ");
  	const N = Number(input[0]) // 参加回数
  	const R = Number(input[1]) // 表示レーティング
    
    if(N >= 10) {
      console.log(R)
    } else {
      const def = 100 * (10 - N)
      const innnerRating = R + def
      console.log(innnerRating)
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main() {
  int A, B;
  cin >> A >> B;
  
  int a1 = A / 10000, a2 = (A / 1000) % 10, a3 = (A / 100) % 10;
  int b1 = B / 10000, b2 = (B / 1000) % 10, b3 = (B / 100) % 10;
  
  int C, D;
  C = 10001 * a1 + 1010 * a2 + 100 * a3;
  D = 10001 * b1 + 1010 * b2 + 100 * b3;
  
  if (A > C) {
    if (a3 < 9) {
      a3++;
    }
    else if (a3 == 9 && a2 < 9) {
      a3 = 0, a2++;
    }
    else {
      a1++, a2 = 0, a3 = 0;
    }
  }
  
  if (B < D) {
    if (b3 > 0) {
     b3--;
    }
    else if (b3 == 0 && b2 > 0) {
      b3 = 9, b2--;
    }
    else {
      b3 = 9, b2 = 9, b1--;
    }
  }
  cout << 100 * (b1 - a1) + 10 * (b2 - a2) + (b3 - a3) + 1 << endl;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n,k;
  cin>>n>>k;
  k--;
  vector<Int> as(n);
  for(Int i=0;i<n;i++) cin>>as[i];

  Int zero=0;
  vector<Int> pos,neg;
  for(Int a:as){
    if(a==0) zero++;
    if(a>0) pos.emplace_back(abs(a));
    if(a<0) neg.emplace_back(abs(a));
  }
  sort(pos.begin(),pos.end());
  sort(neg.begin(),neg.end());

  // return |{i | p * vs[i] <= x}|
  auto calc=
    [&](Int p,Int x,auto &vs){
      Int l=-1,r=vs.size();
      while(l+1<r){
        Int m=(l+r)>>1;
        if(p*vs[m]<=x) l=m;
        else r=m;
      }
      return r;
    };

  // negative
  if(k<(Int)pos.size()*(Int)neg.size()){
    Int l=-1e18-100,r=0;
    while(l+1<r){
      Int m=(l+r)>>1;

      Int cnt=0;
      for(Int p:pos)
        cnt+=(Int)neg.size()-calc(p,abs(m)-1,neg);

      if(cnt>k) r=m;
      else l=m;
    }
    cout<<r<<endl;
    return 0;
  }
  k-=(Int)pos.size()*(Int)neg.size();

  // zero
  if(k<zero*(n-zero)+zero*(zero-1)/2){
    cout<<0<<endl;
    return 0;
  }
  k-=zero*(n-zero)+zero*(zero-1)/2;

  // cout<<k<<endl;
  if(0){
    vector<Int> vs;
    for(Int i=0;i<(Int)pos.size();i++)
      for(Int j=0;j<i;j++)
        vs.emplace_back(pos[i]*pos[j]);

    for(Int i=0;i<(Int)neg.size();i++)
      for(Int j=0;j<i;j++)
        vs.emplace_back(neg[i]*neg[j]);

    sort(vs.begin(),vs.end());
    cout<<vs[k]<<endl;
  }

  // positive
  {
    Int l=0,r=1e18+100;
    while(l+1<r){
      Int m=(l+r)>>1;

      Int cnt=0;
      for(Int p:pos){
        cnt+=calc(p,m,pos);
        if(p*p<=m) cnt--;
      }
      for(Int p:neg){
        cnt+=calc(p,m,neg);
        if(p*p<=m) cnt--;
      }
      cnt/=2;

      // cout<<m<<":"<<cnt<<endl;
      if(cnt>k) r=m;
      else l=m;
    }
    cout<<r<<endl;
  }
  return 0;
}


Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  long long a,b,c;
  cin>>a>>b>>c;
  if(c-a-b>0&&4*a*b<(c-a-b)*(c-a-b)) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  
  
}

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

signed main() {
	string s;
	int q;
	deque<string> ans;
	bool reversed = false;
	cin >> s >> q;
	ans.push_back(s);
	for (int i = 0; i < q; ++i) {
		int t;
		cin >> t;
		if (t == 1) {
			reversed = !reversed;
		}
		else {
			int f;
			string c;
			cin >> f >> c;
			if (f == 1) {
				if (reversed)ans.push_back(c);
				else ans.push_front(c);
			}
			else {
				if (reversed)ans.push_front(c);
				else ans.push_back(c);
			}
		}
	}
	if (reversed) {
		for (auto it = ans.rbegin(); it != ans.rend(); ++it) {
			reverse((*it).begin(), (*it).end());
			cout << (*it);
		}
	}
	else {
		for (auto it = ans.begin(); it != ans.end(); ++it) {
			cout << (*it);
		}
	}
	cout << endl;
}

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

int main() {
	// your code goes here
	int a, b;
	cin>>a>>b;
	
	if(a > 0) {
		cout<<"Positive";
	} else if( b < 0) {
		(b-a+1)%2 == 0 ? cout<<"Positive": cout<<"Negative" ;
	} else {
		cout<<"Zero";
	}
	
	
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int n,t,x,y,lt,lx,ly,flag=1;
	cin>>n;
	lt=0;
	lx=0;
	ly=0;
	while(n--){
		cin>>t>>x>>y;
		if((abs(x-lx)+abs(y-ly))<=t-lt){
			if(((t-lt)-(abs(x-lx)+abs(y-ly)))%2==0){
				
			}
			else{
				flag=0;
			}
		}
		else{
			flag=0;
		}
		lt=t;
		lx=x;
		ly=y;
	}
	if(flag==1){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}

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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)((n)-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p){
    return o << "(" << p.first << ", " << p.second << ")";
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int n; cin >> n;
    vl x(n),y(n),p(n);
    rep(i,n) cin >> x[i] >> y[i] >> p[i];

    vvl dx(1<<n, vl(n, INFL));
    vvl dy(1<<n, vl(n, INFL));
    rep(bit,1<<n){
        rep(i,n){
            dx[bit][i] = abs(x[i]);
            dy[bit][i] = abs(y[i]);
            rep(j,n){
                if(bit>>j & 1) dx[bit][i] = min(dx[bit][i], abs(x[i]-x[j]));
                if(bit>>j & 1) dy[bit][i] = min(dy[bit][i], abs(y[i]-y[j]));
            }
        }
    }

    vl ans(n+1, INFL);
    rep(biti,1<<n){
        ll bitcnt = __builtin_popcountll(biti);
        // 部分集合の列挙 O(3^n)
        rrep(bitj,1<<n){
            bitj &= biti;
            ll cost = 0;
            rep(k,n){
                if(!((biti>>k) & 1)){
                    cost += min(dx[bitj][k], dy[biti-bitj][k]) * p[k];
                }
            }
            ans[bitcnt] = min(ans[bitcnt], cost);
        }
    }
    rep(i,n+1) cout << ans[i] << endl;
    return 0;
}

Measured memory_bytes: 12896
import qualified Data.ByteString.Char8 as C
import qualified Data.Vector.Unboxed as V

main = sol <$> readLn <*> get >>= put

get = V.unfoldr (C.readInt . C.dropWhile (<'0')) <$> C.getLine

put = putStrLn . unwords . map show . V.toList

sol n v = V.generate n ((v V.!) . f) where
  f i = abs (2*i-n) - if i<(n+1) `div` 2 then 1 else 0

Measured memory_bytes: 13268