akhauriyash/Code-Regression huggingface dataset:
//abc051,c
using System;

class Program
{
    static void Main(string[] args)
    {
        string solve=null;
        string[] input = System.Console.ReadLine().Split(' ');
        int sx = int.Parse(input[0]);
        int sy = int.Parse(input[1]);
        int tx = int.Parse(input[2]);
        int ty = int.Parse(input[3]);

        for (int j = 0; j < 2; j++)
        {
            if (j == 1)
            {
                solve += 'D';
                solve += 'R';
            }
            for (int i = 0; i < (tx - sx); i++)
            {
                solve += 'R';
            }

            for (int i = 0; i < (ty - sy); i++)
            {
                solve += 'U';
            }
            if (j == 1)
            {
                solve += 'U';
                solve += 'L';
            }

            if(j == 1)
            {
                solve += 'U';
                solve += 'L';
            }
            for (int i = 0; i < (tx - sx); i++)
            {
                solve += 'L';
            }

            for (int i = 0; i < (ty - sy); i++)
            {
                solve += 'D';
            }
            if (j == 1)
            {
                solve += 'D';
                solve += 'R';
            }
        }

        System.Console.WriteLine(solve);
    }
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) begin(r),end(r)
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

const ll mod = 1e9+7;
constexpr ll inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a,b;
  string s;
  cin >> a;
  deque<ll> v;
  rep(i,a){
    cin >> b;
    if(i % 2)
      v.push_back(b);
    else
      v.push_front(b);
  }
  if(a % 2 == 0) reverse(all(v));
  rep(i,a){
    if(i) cout << ' ';
    cout << v[i] ;
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 3840
n,m = list(map(int,input().split()))
a = [list(map(int,input().split())) for i in range(n)]
aa = sorted(a, key=lambda x:x[0])
pay = 0
drink = 0
for i in range(n):
    buy = 0
    while buy < aa[i][1]:
        pay += aa[i][0]
        buy += 1
        if drink + buy == m:
            break
    drink += buy
    if drink == m:
        break
print(pay) 

Measured memory_bytes: 29796
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <utility>
using namespace std;

int main()
{
    int a,b,c;
    cin >> a >> b >> c;
    if((a < c && c < b) || (b < c && c < a)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
#define ll long long

int main() {
	int n, t;
	scanf("%d %d", &n, &t);
	int ans = t, arr[n];
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	for (int i = 0 ; i < n-1 ; i++){
		ans += min (arr[i+1]-arr[i] , t);
	}
	cout << ans << endl;
}


Measured memory_bytes: 4452
x,y,a,b,c=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))
p.sort()
p.reverse()
q.sort()
q.reverse()
r.append(0)
r.sort()
r.reverse()
ct=0
P=p[0:x]
Q=q[0:y]
L=P+Q
L.sort()
R=0
for i in range(len(L)):
  if r[R]>L[i]:
    L[i]=r[R]
    if R<c:
      R+=1
print(sum(L))

Measured memory_bytes: 105580
def func(a, b, c)
  if a.odd? or b.odd? or c.odd?
    0
  else
    a, b, c=b/2+c/2, c/2+a/2, a/2+b/2
    func(a, b, c)+1
  end
end

a, b, c=gets.split.map(&:to_i)
if a==b and b==c
  if a.even?
    puts -1
  else
    puts 0
  end
else
  puts func(a, b, c)
end


# puts func(14, 14, 14)

=begin

r=10**9
cnt=Array.new(20){0}
1000000.times do
  a, b, c=rand(1..r), rand(1..r), rand(1..r)
  # puts "#{a} #{b} #{c}"
  next if a==b and b==c
  cnt[func(a, b, c)]+=1
end

p cnt

=end


Measured memory_bytes: 1788
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pint;

vector<pint> solve(vector<int> &a) {
  vector<int> cnt(100000+1,0);
  vector<pint> ans;
  REP(i, a.size()) {
    cnt[a[i]]++;
  }
  REP(i,cnt.size()) {
    ans.push_back(make_pair(cnt[i], i));
  }
  sort(ans.begin(), ans.end());
  reverse(ans.begin(), ans.end());
  return ans;
}

int main() {
  int n; cin>>n;
  vector<int> a, b;
  for(int i = 0; i < n; i++) {
    int v; cin>>v;
    if(i % 2 == 0) a.push_back(v);
    else b.push_back(v);
  }
  int ans = 1<<30;
  vector<pint> c = solve(a);
  vector<pint> d = solve(b);
  //  REP(i,5) cout << c[i].first << " " << c[i].second << endl;
  //  REP(i,5) cout << d[i].first << " " << d[i].second << endl;
  for(int i = 0; i < c.size(); i++) {
    int work1 = a.size() - c[i].first;
    if(work1 >= ans) break;
    for(int j = 0; j < d.size(); j++) {
      if(c[i].second == d[j].second) continue;
      int work2 = b.size() - d[j].first;
      int work = work1 + work2;
      //      cout << ans << " " << i << " " << j << " " << work1 << " " << work2 << endl;
      if(work < ans) ans = work;
      else break;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3308
#include <iostream>

using namespace std;


int main(void){
  int k, s, cnt=0;
  cin >> k >> s;

  for (int x=0; x<=k; x++) {
    for (int y=0; y<=k; y++) {
      int z=s-x-y;
      if (z>=0 && z<=k) cnt++;
    }
  }

  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <locale>
#include <iostream>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(),(x).end()

using namespace std;

using ll = long long;
using ld = long double;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template <typename T> int len(const T &x) { return x.size(); }

template<typename T>
vector<T> table(int n, T v) { return vector<T>(n, v); }

template <class... Args>
auto table(int n, Args... args) {
  auto val = table(args...);
  return vector<decltype(val)>(n, move(val));
}

struct yes_no : numpunct<char> {
  string_type do_truename()  const { return "YES"; }
  string_type do_falsename() const { return "NO"; }
};

ll solve(ll N) {
  if (N <= 1) return N;
  return solve(N / 2) * 2;
}

int main() {
  locale loc(locale(), new yes_no);
  cout << boolalpha << setprecision(12) << fixed;
  cout.imbue(loc);
	ll N;
	scanf("%lld", &N);
	cout << solve(N) << endl;
	return 0;
}


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

int f(int n) {
  if (n % 2 == 0) {
    return (n / 2);
  }
  else {
    return (3 * n + 1);
  }
}

int main() {
  int s;
  cin >> s;
  vector<int> a(1000005, 0);
  a.at(1) = s;
  set<int> st;
  st.insert(s);
  for (int i = 2; i < a.size(); i++) {
    a.at(i) = f(a.at(i - 1));
    if (st.count(a.at(i))) {
      cout << i << endl;
      break;
    }
    st.insert(a.at(i));
  }
  return 0;
}


Measured memory_bytes: 7208
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int k=n%10;
if(k==2 ||k==4 ||k==5||k==7||k==9)
cout<<"hon";
else if(k==3)
cout<<"bon";
else
cout<<"pon";
return 0;
}

Measured memory_bytes: 3604
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int A[] = new int[N];
		for(int i=0;i<N;i++) A[i]=sc.nextInt();
		sc.close();
		
		
		SegTree st = new SegTree(N);
		for(int i=0;i<N;i++) st.update(i, A[i]);
		int left = st.queryGcd(0,(N-1)/2,1,0,N);
		int right = st.queryGcd((N-1)/2,N,2,0,N);
		int ans = 0;
		for(int i=0;i<N;i++) {
			if(i<N/2) {
				int tmp = st.dat[(st.dat.length+1)/2 - 1 + i];
				st.update(i,right);
				ans = Math.max(ans,st.dat[0]);
				st.update(i, tmp);
			}
			else {
				int tmp = st.dat[(st.dat.length+1)/2 - 1 + i];
				st.update(i,left);
				ans = Math.max(ans,st.dat[0]);
				st.update(i, tmp);
			}
		}
		System.out.println(ans);
		
	}
}

class SegTree{
	int n;
	int dat[];
	SegTree(int x){
		n = 1;
		while(n<=x) {
			n*=2;
		}
		dat = new int[2*n-1];
	}
	
	void update(int x, int u) {
		x += n-1;
		dat[x] = u; 
		while(x>0) {
			x = (x-1)/2;
			dat[x] = gcd(dat[2*x+1], dat[2*x+2]);
		}
	}
	
	int queryGcd(int x, int y, int k, int l, int r) {
		if(x<r||y<l)return 0;
		else if(x<=l&&y<=r)return dat[k];
		else {
			int lres = queryGcd(x, y, 2*k+1, l, (l+r)/2);
			int rres = queryGcd(x, y, 2*k+1, (l+r)/2, r);
			return gcd(lres, rres);
		}
	}
	
	int gcd(int x,int y) {
		return y==0? x : gcd(y, x%y);
	}
}

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

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (a); i > (n); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto i = (x).rbegin(); i != (x).rend(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1LL << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) (((n) * ((n) + 1)) / 2)
#define pb(x, a) (x).push_back(a)
#define fb(x, a) (x).push_front(a)
#define eb(x, a) (x).emplace_back(a)
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class A, class B>
bool chmax(A &a, const B &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A, class B>
bool chmin(A &a, const B &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

signed main(void) {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int n;
  cin >> n;
  vector<int> x(n);
  arep(i, x) cin >> i;
  sort(all(x), greater<int>());

  int ans = 0;
  rep(i, 1, n) {
    ans += x[i / 2];
    // cout << x[i / 2] << ' ';
  }

  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 4764
use io::*;
use std::*;

fn solve(x: Vec<i64>) {
    for i in 0..x.len() {
        if x[i] == 0 {
            println!("{}", i + 1);
            return;
        }
    }

}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
fn main() {
    let con = read_string();
    let mut scanner = Scanner::new(&con);
    let mut x: Vec<i64> = vec![0i64; (5) as usize];
    for i in 0..(5) as usize {
        x[i] = scanner.next();
    }
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(move || solve(x)).unwrap().join().unwrap();
}

pub mod io {
    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}


Measured memory_bytes: 2224
#include <bits/stdc++.h>
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
#define rreps(i,n,s) for(int i=s;i>=n;i--)
#define MOD 1000000007
using ll = long long;
using namespace std;
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 (a>b) { a=b; return 1; } return 0; }

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
string n;
cin>>n;
if(n[0]=='9'||n[1]=='9')cout<<"Yes"<<endl;
else cout<<"No"<<endl;
//system("pause");
return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        sc.close();

        int n = s.length();
        int r = 0; 
        int l = n-1;
        int ans = 0;

        while(r <= l){
            int cntr = 0;
            int cntl = 0;
            while(s.charAt(r) == 'x' && r < n-1){
                r++;
                cntr++;
            }
            while(s.charAt(l) == 'x' && l > 0){
                l--;
                cntl++;
            }
            if(s.charAt(r) != s.charAt(l)){
                System.out.println(-1);
                return;
            } else {
                ans += Math.abs(cntr-cntl);
                r++;
                l--;
            }
        }
        System.out.println(ans);
   }
}

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

int main(void){
    string S;
    cin >> S;
    int min = INT32_MAX;
    for(int i=0; i<S.size()-2; i++){
        int sub = (int)abs(753-atoi(S.substr(i, 3).c_str()));
        if(sub < min){
            min = sub;
        }
    }
    cout << min;
    return EXIT_SUCCESS;
}

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

using namespace std;

const int N = 1e5+5;

int main()
{
	std::ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    string s;
    vector<string> q;
	 
    for(int i=0;i<n;i++){
    	cin >> s;
    	sort(s.begin(),s.end());
    	q.push_back(s);
	}
	sort(q.begin(),q.end());
	
//	cout << endl;
//	for(int i=0;i<q.size();i++){
//		cout << q[i] << endl;
//	}
//	cout << endl;
	
    long long ans = 0;
    long long nans = 1;
    
    for(int i=1;i<q.size();i++){
    	if(q[i]!=q[i-1]){
    		ans += nans*(nans-1)/2;
    		nans = 1;
		}else{
			nans++;
		}
	}
    ans += nans*(nans-1)/2;
    cout << ans << endl;
	    
	return 0;
}


Measured memory_bytes: 5748
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define INF 0x6fffffff
#define INFL 0x6fffffffffffffffLL

ll n;
vector<ll>	a(200001);

int main() {
	ll		b,c,h,i,j,k,l,m,x,y;
	ll		ans = 0;
	string	s;
	cin >> n;

	for(i=0;i<n;i++) cin >> a[i];
	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());
	ans = a[0];
	x = 2;

	for(i=2;i<n;i++) {
		ans += a[x/2];
		x++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll digsum(ll n){
    ll a=0;
    while (n) {
        a+=n%10;
        n/=10;
    }
    return a;
}
int main(){
    ll n;
    cin>>n;
    ll dis=1;
    ll cnt=1;
    while (n) {
        if(cnt*digsum(cnt+dis)<=(cnt+dis)*digsum(cnt)){
            cout<<cnt<<endl;
            n--;
            cnt+=dis;
        }
        else{
            dis*=10;
            cnt=(cnt/dis+1)*dis-1;
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main(){
	string a;
	int m=0x7f7f,n=-0x7f7f;
	getline(cin,a);
	for(int i=0;i<=a.length();i++){
		if(a[i]=='C'){
			m=i;
			break;
		}
	}
	for(int i=a.length();i>=0;i--){
		if(a[i]=='F'){
			n=i;
			break;
		}
	}
	if(n>m)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstdlib>
using namespace std;
const int MAXN=60,	MOD=1000000007;

int n;
long long int k,soma;

struct matriz
{
	long long int mat[MAXN][MAXN];

	matriz(int id=0)
	{
		for(int i=0;i<MAXN;i++)
			for(int j=0;j<MAXN;j++)
				mat[i][j]=(i==j) ? id : 0;
	}	

	matriz operator*(const matriz& b)const
	{
		matriz r;

		for(int i=0;i<MAXN;i++)
			for(int j=0;j<MAXN;j++)
				for(int k=0;k<MAXN;k++)
				{
					r.mat[i][j]+=(mat[i][k]*b.mat[k][j]);
					if(r.mat[i][j]>MOD)	r.mat[i][j]%=MOD;
				}

		return r;
	}
};

matriz id(1),a,resp;

void see(matriz v)
{
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)	printf("%lld ",v.mat[i][j]);
		printf("\n");
	}
	printf("________________\n");
}

matriz pot(long long int p)
{
	if(p==0)	return id;
	if(p==1)	return a;

	matriz aux=pot(p/2);
	aux=aux*aux;

	if(p%2==0)	return aux;

	aux=aux*a;
	return aux;
}

int main ()
{
	scanf("%d %lld",&n,&k);

	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			scanf("%lld",&a.mat[i][j]);

	resp=id;

//	see(resp);
/*
	for(int i=59;i>=0;i--)
	{
		resp=resp*resp;
		if(k&(1<<i))	resp=resp*a;
		printf("I : %d\n",i);
		see(resp);	
	}
*/
	resp=pot(k);

//	see(resp);

	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
		{
			soma+=resp.mat[i][j];
			if(soma>MOD)	soma%=MOD;		
		}

	printf("%lld\n",soma);
}

Measured memory_bytes: 5248
macro_rules! scan_sub {
    ( $itr:ident, $t:ty ) => {
        let mut buf = String::new();
        let $itr = {
            while buf.trim().len() == 0 {
                buf = String::new();
                std::io::stdin().read_line(&mut buf).unwrap();
            }
            buf.split_whitespace().map(|n| n.parse::<$t>().unwrap())
        };
    };
}

macro_rules! scan {
    ( $x:ident; Vec<$t:ty> ) => {
        scan_sub!(itr, $t);
        let $x = itr.collect::<Vec<_>>();
    };
    ( $( $x:ident ),*; $t:ty ) => {
        scan_sub!(itr, $t);
        let mut itr = itr;
        $(
            let $x = itr.next().unwrap();
        )*
    };
}

fn main() {
    scan!(a, b; usize);

    let a_min = ((a as f64) * 12.5).ceil() as usize;
    let a_max = (((a+1) as f64) * 12.5).floor() as usize;

    let b_min = b * 10;
    let b_max = (b+1) * 10;

    let s = if a_min < b_min {b_min} else {a_min};
    let g = (if a_max < b_max {a_max} else {b_max}) + 1;

    for i in s..g {
        let d = (i as f64 * 0.08).floor() as usize;
        let e = (i as f64 * 0.10).floor() as usize;

        if a == d && b == e {
            println!("{}", i);
            return;
        }
    }

    println!("-1");
}


Measured memory_bytes: 4352
#include <iostream>
using namespace std ;
int main()
{
	long n,i;
	char s[n+1];
	cin >> n;
	for(i=0;i<n;i++){
		cin >> s[i];
		if(s[i]=='Y'){
			cout << "Four" << endl;
			return 0;
		}
	} 
	cout << "Three" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <random>

using namespace std;

const long long LLINF = 9223372036854775807;
int main(){
    int n;
    long long w;
    cin >> n >> w;
    long long minW;
    vector<long long> w0,w1,w2,w3;
    for(int i=0;i < n; i++){
        long long weight,value;
        cin >> weight >> value;
        if(i==0){
            minW = weight;
        }
        switch(weight-minW){
            case 0:
                w0.push_back(value);
                break;
            case 1:
                w1.push_back(value);
                break;
            case 2:
                w2.push_back(value);
                break;
            case 3:
                w3.push_back(value);
                break;
        }
    }
    sort(w0.begin(), w0.end());
    sort(w1.begin(), w1.end());
    sort(w2.begin(), w2.end());
    sort(w3.begin(), w3.end());
    reverse(w0.begin(), w0.end());
    reverse(w1.begin(), w1.end());
    reverse(w2.begin(), w2.end());
    reverse(w3.begin(), w3.end());
    long long answer = 0;
    for(long long i=0;i<=(long long)w0.size();i++){
        for(long long j=0;j<=(long long)w1.size();j++){
            for(long long p=0;p<=(long long)w2.size();p++){
                for(long long q=0;q<=(long long)w3.size();q++){
                    if((i+j+p+q) * minW + j + p * 2 + q * 3 > w){
                        continue;
                    }
                    long long buf = 0;
                    for(long long a = 0; a < i ; a++){
                        buf += w0[a];
                    }
                    for(long long a = 0; a < j ; a++){
                        buf += w1[a];
                    }
                    for(long long a = 0; a < p ; a++){
                        buf += w2[a];
                    }
                    for(long long a = 0; a < q ; a++){
                        buf += w3[a];
                    }
                    answer = max(answer, buf);
                }
            }
        }
    }
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
#define LL long long int
using namespace std;
int main()
{
	LL x,y;
	cin>>x>>y;
	if(y%2==0 && x*4>=y && x*2<=y)
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}

}


Measured memory_bytes: 3636
class Tree

  def initialize(key)
    @key = key
    @left = nil
    @right = nil
  end

  def insert(k)
    if @key > k
      if !@left
        @left = Tree.new(k)
      else
        @left.insert(k)
      end

    else

      if !@right
        @right = Tree.new(k)
      else
        @right.insert(k)
      end
    end
  end

  def inorder(list)
    if @left
      list = @left.inorder(list)
    end

    list.push(@key)

    if @right
      list = @right.inorder(list)
    end
    return list
  end

  def preorder(list)

    list.push(@key)

    if @left
      list = @left.preorder(list)
    end

    if @right
      list = @right.preorder(list)
    end
    return list
  end

  def find(key, bool)
    if @key == key
      bool = "yes"
    else
      if @left && @key > key
        bool = @left.find(key, bool)
      end

      if @right && @key < key
        bool = @right.find(key, bool)
      end
    end
    return bool
  end
end

n = gets.chomp.to_i
head = nil
n.times do
  num = gets.to_s.chomp!
  if num == "print"
    puts " #{head.inorder([]).join(" ")}"
    puts " #{head.preorder([]).join(" ")}"
  else
    num = num.split
    if num[0].to_s == "insert"
      if head
        head.insert(num[1].to_i)
      else
        head = Tree.new(num[1].to_i)
      end
    else
      puts head.find(num[1].to_i, "no")
    end
  end
end

Measured memory_bytes: 56528
n = gets.to_i
ary = []
n.times do |i|
  ary[i] = gets.chomp
end
result = "Yes"
i = 1
for i in 1..n-1
  if ary[i].slice(0) != ary[i-1].slice(-1) || ary.uniq.size != ary.size
    result = "No"
    break
  end
end
puts result


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n,k; cin >> n >> k;
  vector<int> h;
  for(int i=0;i<n;i++){
    int a;cin >> a;
    h.push_back(a);
  }
  sort(h.begin(), h.end());
  long min = 1000000000;
  for(int i=0;i<n-k+1;i++){
    long dif = h.at(i+k-1)-h.at(i);
    if(dif<min){
      min = dif;
    }
  }
  cout << min << endl;
}

Measured memory_bytes: 892
n = int(input())
list = []
ans = 0
for i in range(n):
    a,b=input().split()
    list.append((float(a), b))
for i in range(n):
  if(list[i][1] == 'BTC'):
    ans += (list[i][0]) * 380000
  else:
    ans += (list[i][0])
print(ans)

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

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

        for (int i = A; i <= B; ++i) {
                if (i % K == 0) {
                        cout << "OK" << endl;
                        exit(0);
                }
        }
        cout << "NG" << endl;


}


Measured memory_bytes: 3620
#include <iostream>
#include <string>

using namespace std;
int main (){
    string S;
    cin >> S;
    bool flag1=false;
    bool flag2=false;
    bool flag3=true;
    int count=0;
    int cidx=0;
    if (S[0] =='A') flag1=true;
    for (int i = 2; i <= S.size()-2; i++){
        if(S[i]=='C'){
            if(count == 0){
                flag2=true;
                cidx=i;
            }
            else flag2=false;
        }
    }
    for (int i = 1; i < S.size(); i++){
        if(i!=cidx){
            if(S[i]-'a'< 0 || S[i]-'a'>'z'-'a') flag3=false;
        }
    }
    if(flag1*flag2*flag3) cout << "AC" << "\n";
    else cout << "WA" << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long int ll;

ll mod=1e9+7;
ll dp[202][100010]; //dp[i][j]:スタート時がjで最初のi個全ての順列を考えた時に得られる和の総和

int main(){
	int n,x; cin >> n >> x;
	vector<int> s(n);
	for(int i=0;i<n;i++){
		cin >> s[i];
	}
	sort(s.begin(),s.end());
	for(int i=0;i<=x;i++){
		dp[0][i]=i;
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<=x;j++){
			(dp[i+1][j]+=dp[i][j%s[i]])%=mod;
			(dp[i+1][j]+=dp[i][j]*i)%=mod;
		}
	}
	cout << dp[n][x] << endl;
}

Measured memory_bytes: 157952
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    string S;
    string T;
    cin >> S >> T;
    int len = S.size();
    vector<char> RS(26);
    vector<char> RT(26);
    rep(i,26){
        RS[i] = -1;
        RT[i] = -1;
    }
    bool possible = true;
    rep(i,len){
        if (RS[S[i] - 'a'] == -1){
            RS[S[i] - 'a'] = T[i] - 'a';
        }
        else{
            if (RS[S[i] - 'a'] != T[i] - 'a'){
                possible = false;
            }
        }
        if (RT[T[i] - 'a'] == -1){
            RT[T[i] - 'a'] = S[i] - 'a';
        }
        else{
            if (RT[T[i] - 'a'] != S[i] - 'a'){
                possible = false;
            }
        }
    }
    if (possible) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 904
import math
n,d = map(int,input().split())
li = [list(map(int,input().split())) for i in range(n)]
cnt = 0
sum_d = 0
for i in range(n):
    for j in range(n):
        if i<j:
            ans = math.sqrt(sum(abs(li[i][k]-li[j][k])**2 for k in range(d)))
            if ans.is_integer() == True:
                cnt+=1
print(cnt)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

int main() {
  vector<i64> a;
  read_n(a, 3);
  sort(begin(a), end(a));
  
  if (a[0] % 2 == 0 || a[1] % 2 == 0 || a[2] % 2 == 0) {
    cout << 0 << '\n';
  } else {
    cout << a[0] * a[1] << '\n';
  }
  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
 
string S;
bitset<30> bit;

int main(void){
	
	cin >> S;
	
	for(int i = 0; i < S.size(); ++i){
	    if(bit[(int)S[i]]) { printf("no\n"); return 0;}
	    else bit[(int)S[i]] = true;
	}
	printf("yes\n");
	
    return 0;
}

Measured memory_bytes: 256
n, q = gets.chop.split.map(&:to_i)
s = gets.chop
lr = []
q.times do
  lr << gets.chop.split.map(&:to_i)
end

cum_sum = []
cum_sum[0] = 0

n.times do |num|
  unless num == 0 then
    # cum_sum[num] = s[0, num+1].scan('AC').length

    if s[num-1, 2] == 'AC' then
      cum_sum[num] = cum_sum[num-1] + 1
    else
      cum_sum[num] = cum_sum[num-1]
    end
  end
end


for elm in lr do
  puts cum_sum[elm[1]-1]-cum_sum[elm[0]-1]
end


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

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define endl "\n"
#define ar array
#define pb push_back
#define sz(X) ((int)(X).size())
#define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
#define sort_unique(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define get_pos(c, x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define all(X) (X).begin(), (X).end()
#define  No cout<<"NO"<<endl;
#define  Yes cout<<"YES"<<endl;
#define  nl cout<<endl;

template<typename T>
ostream &operator+(ostream &out, const vector<T> &vec) {
    for (const auto &x : vec) {
        out << x << " ";
    }
    out << "\n";
    return out;
}

template<typename T>
ostream &operator*(ostream &out, const vector<T> &vec) {
    for (const auto &x : vec) {
        out + x;
    }
    return out;
}

template<typename T>
istream &operator>>(istream &in, vector<T> &vec) {
    for (auto &x : vec) {
        in >> x;
    }
    return in;
}
// DEBUG
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << ts(h); if (sizeof...(t)) cerr << ", ";
    DBG(t...); }

#ifdef _DEBUG // compile with -DLOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

template<class T>
bool ckmin(T &a, const T &b) { return b < a ? a = b, 1 : 0; }

template<class T>
bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }


const int mod = 1e9 + 7;
const int mod2 = 998244353;
const ll INF = 1e9 + 6;

ll add(ll a, ll b) {
    a += b;
    return a % mod;
}

ll mul(ll a, ll b) {
    a *= b;
    return a % mod;
}

inline ll power(ll x, ll y, ll p) {
    ll res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
inline ll modInverse(ll x,ll p){
    return power(x,p-2,p);
}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

const int MXN = 2e5+5;
int n;
int h[MXN];
ll cache[MXN];

ll dp(int idx){
    if(idx<1){
        return 1e9;
    }
    if(idx==1){
        return 0;
    }
    if(cache[idx]!=-1){
        return cache[idx];
    }
    ll &ans=cache[idx];
    ans=min(dp(idx-1)+abs(h[idx]-h[idx-1]),dp(idx-2)+abs(h[idx]-h[idx-2]));
    return ans;
}
void solve() {
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>h[i];
    }
    memset(cache,-1,sizeof cache);
    cout<<dp(n);
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
//#ifndef ONLINE_JUDGE
//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);
//#endif
    int t = 1;
     //cin>>t;
    while (t--)solve();
    // cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}
//look if it requires ll


Measured memory_bytes: 7920
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll INF = 3000000000000000000; //10^18
const int inINF = 1000000000; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

int main(){
    int L , R, d;
    cin >> L >> R >> d;
    int ans = 0;
    for (int i = L; i < R+1; i++) {
        if(i % d == 0){
            ans++;
        }
    }
    printf("%d\n", ans);
}

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

char str[1003];

int main() {
    int n;
    scanf("%s",str);
    n=strlen(str);
    if (str[n-1]=='s') {
        str[n]='e';
        str[n+1]='s';
    }
    else {
        str[n]='s';
    }
    printf("%s",str);
}

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

using namespace std;

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

    long long N;
    int L;

    cin >> N >> L;

    vector<string> v(N);
    for(int i = 0 ; i < N ; i++){
        string temp;
        cin >> temp;
        v.emplace_back(temp);
    }

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

    for(auto i : v){
        cout << i;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  
  vector<double>x(n);
  for(int i=0; i<n; i++) cin >> x[i];
  sort(x.begin(),x.end());
  
  for(int i=1; i<n; i++){
   for(int j=0; j<i+1; j++) x[j]/=2;
  }
  
  double sum=0;
  for(int i=0; i<n; i++) sum+=x[i];
  
  cout << sum << endl;
  
  return 0;
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	final int MAX_N = 123456;

	boolean[] prime;
	void run() {
		Scanner scan = new Scanner(System.in);
		prime = new boolean[MAX_N * 2 + 1];
		sieve();
		while (true) {
			int n = scan.nextInt();
			if (n == 0)
				return;
			int ans = 0;
			for (int i = n + 1; i <= n * 2; i++)
				ans += prime[i] ? 1 : 0;
			System.out.println(ans);
		}
	}
	void sieve() {
		prime[2] = true;
		for (int i = 3; i <= MAX_N * 2; i += 2)
			prime[i] = true;

		for (int i = 3; i < Math.sqrt(MAX_N * 2 + 1); i += 2) {
			if (!prime[i])
				continue;
			for (int j = i * 2; j <= MAX_N * 2; j += i)
				prime[j] = false;
		}
	}
	public static void main(String[] args) {
		new Main().run();
	}
}



Measured memory_bytes: 27472
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> num = new ArrayList<Integer>();
		ArrayList<String> param = new ArrayList<String>();

		while (sc.hasNext()) {
			if (sc.hasNextInt()) {
				num.add(sc.nextInt());
			} else {
				param.add(sc.nextLine());
			}
		}
		Method(num, param);
	}
	
	static void Method(ArrayList<Integer> num, ArrayList<String> param) {
		int total = 0;

		for(int i = num.get(0); i > 0; i--){
			total += i;
		}
		System.out.println(total);
	}
}

Measured memory_bytes: 21588
#include<iostream>
#include<cstdio>
using namespace std;
int i,j,t,m,x[200003]= {0},a,b,num=0,num1=0;
int main()
{
    cin>>t>>m;
    for(i=0; i<m; i++)
    {
        scanf("%d %d",&a,&b);
        if(a==1)
            x[b]++;
        if(b==t)
            x[a]++;
    }
    int flag=0;
    for(i=0; i<t; i++)
    {
        if(x[i]==2)
        {
            flag=1;
            break;
        }
    }
    if(flag==1)
        cout<<"POSSIBLE"<<endl;
    else
        cout<<"IMPOSSIBLE"<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ii pair<int,int>
#define iii pair<ii,int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vvi vector<vector<int> >
#define vs vector<string>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define nu 100000
#define mod 1000000007
#define inf pow(10,8)
#define h pow(10,-8)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

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

	vi a(n), b(n);

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

	for (int i = 1; i < n; ++i)
	{
		a[i] += a[i-1];
	}

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

	for (int i = n-2; i >= 0; --i)
	{
		b[i] += b[i+1];
	}	

	int ma = 0;

	for (int i = 0; i < n; ++i)
	{
		ma = max(ma, a[i]+b[i]);
		// cout << a[i]+b[i] << ' ';
	}

	cout << ma;
}

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

using namespace std;

//----------------------- Print Function ----------------------//

inline void print() {
    cout << '\n';
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

//------------------------- Libraries -------------------------//

//--------------------------- Solve ---------------------------//

int f(int x, int y, int z) {
    return x*x + y*y+ z*z + x*y + y*z + z*x;
}

void solve() {
    int N; cin >> N;
    map<int, int> mp;
    for (int x = 1; x <= 100; x++) {
        for (int y = 1; y <= 100; y++) {
            for (int z = 1; z <= 100; z++) {
                mp[f(x, y, z)]++;
            }
        }
    }

    for (int i = 1; i <= N; i++) {
        cout << mp[i] << '\n';
    }
}

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

    solve();

    return 0;
}

Measured memory_bytes: 5496
#include<bits/stdc++.h>
#include<cstring>
using namespace std;
int main()
{
  string s,t,u;
  int a,b;
  cin>>s>>t;
  cin>>a>>b;
  cin>>u;
  if(s.size()==u.size())
  {
    for(int i=0;i<s.size();i++)
    {
      if(s[i]!=u[i])
      {
        cout<<a<<" "<<b-1;
        return 0;
      }
    }
    cout<<a-1<<" "<<b;
  }
  else
    cout<<a<<" "<<b-1;
  return 0;
}

Measured memory_bytes: 256
# coding: utf-8
# Here your code !
import sys

def culc_division(x) :
    """
    ??\???x????´???°?????°??????????????§??????
    """
    culc_list = []
    for i in range(1,x+1) :
        if x % i == 0 :
            culc_list.append(i)
            
    return culc_list
    
in_std = list(map(int, sys.stdin.readline().split(" ")))
a = in_std[0]
b = in_std[1]
c = culc_division(in_std[2])

counter = 0
for idx in range(a, b+1):
    if idx in c:
        counter += 1
        
print(counter)

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

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;

int main() {
	ios_base::sync_with_stdio(false);

	string s;
	cin >> s;

	int k;
	cin >> k;

	vector<string> v;
	fori(i, 0, s.size()) {
		string cur = "";
		for(int j = i; j < (int) s.size() && (int) cur.size() < 5; j++) {
			cur += s[j];
			v.push_back(cur);
		}
	}

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

	v.erase(unique(v.begin(), v.end()), v.end());

	cout << v[k - 1] << '\n';

	return 0;
}


Measured memory_bytes: 1660
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		long N = reader.nextLong();
		long M = reader.nextLong();
		long ans = 1;
		if (Math.abs(N-M) > 1) {
			System.out.println(0);
			reader.close();
			return;
		}
		ans = consequentMultiply(N) * consequentMultiply(M);
		if (N == M) {
			ans *= 2;
		}

		System.out.println(ans % 1000000007);
		reader.close();

	}
	public static long consequentMultiply(long num) {
		long ans = 1;
		for (long i = num; i > 0; i--) {
			ans *= i;
			ans %= 1000000007;
		}
		return ans;

	}
}





Measured memory_bytes: 23252
h,w,k=map(int,input().split())
board=[list(input()) for _ in range(h)]
ans=0
for paint_h in range(2**h):
  for paint_w in range(2**w):
    cnt=0
    for i in range(h):
      for j in range(w):
        if (paint_h>>i)&1==0 and (paint_w>>j)&1==0:
          if board[i][j]=='#':
            cnt+=1
    if cnt==k:
      ans+=1
print(ans)

Measured memory_bytes: 9120
//#include <bits/stdc++.h>
 
#include <iostream>
#include <algorithm>
 
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <utility>
#include <array>
#include <complex>
#include <valarray>
 
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <chrono>
#include <random>
#include <numeric>
 
 
using namespace std;
#define int long long
 
typedef long long ll;
typedef unsigned long long ull;
//typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
 
const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const int INF = 1<<30;
const ll INFLL = 1LL<<62;
const double EPS = 1e-12;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
 
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod
#define inside(y, x, h, w) (0 <= (y) && (y) < (h) && 0 <= (x) && (x) < (w)) ? true : false

int x, y;

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
	cin >> x >> y;
	int yx = y/x;
	int cnt = 0;
	while (yx > 0) {
		yx/=2;
		cnt++;
	}
	cout << cnt  << endl;
}


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

int i,j,n,c,ans,flag[1000000];

int main(){
	while(scanf("%d",&n)!=EOF){
		if(n==0)break;ans=c=0;
		memset(flag,0,sizeof(int)*1000000);
		for(i=2;i<=1000000;i++){
			if(flag[i]==0){
				for(j=2;j*i<=1000000;j++){
					flag[j*i]=1;
				}
				ans+=i;c++;
			}
			if(n==c)break;
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 4312
#include <iostream>
#include <climits>
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))

using namespace std;

int main()
{
    string S;
    cin >> S;

    int ans = INT_MAX;
    int fav = 753;

    rep(i, S.length()-2)
    {
        int a = S.c_str()[i+0]-'0';
        int b = S.c_str()[i+1]-'0';
        int c = S.c_str()[i+2]-'0';
        int v = abs(fav - (a*100+b*10+c));
        ans = min(ans, v);
    }

    cout << ans << endl;

    return 0;
}


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

main(){
	int n;
	double ans;
	double a[110];
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	sort(a+1,a+1+n);
	ans = a[1];
	for(int i=2;i<=n;i++){
		ans += a[i];
		ans /= 2;
	}
	cout<<ans;
} 

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

const int mod = 1000*1000*1000 + 7;

#define MAXN 200*1000 + 5

int fact[MAXN];

int mul(int a, int b) {
	return (1LL * a * b) % mod;
}

void add_self(int& a, int b) {
	a += b;
	if(a >= mod) a -= mod;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	fact[0] = 1;
	for(int i = 1; i < MAXN; i++) {
		fact[i] = mul(i, fact[i-1]);
	}
	
	int n;
	string s;
	cin >> n >> s;
	n *= 2;
	vector<int> arr(n);
	if(s[0] == 'W') {
		cout << 0 << endl;
		return 0;
	}
	
	arr[0] = 1;
	for(int i = 1; i < n; i++) {
		if(s[i] == s[i-1]) {
			arr[i] = 1 ^ arr[i-1];
		} else {
			arr[i] = arr[i-1];
		}
		
	}

	
	int cnt = 0;
	for(int i = 0; i < n; i++) {
		if(arr[i]) cnt++;
		else cnt--;
		if(cnt < 0) {
			cout << 0 << endl;
			return 0;
		}
	}
	
	if(cnt > 0) {
		cout << 0 << endl;
		return 0;
	}
	
	int ans = 1;
	int L = 0, R = 0;
	for(int i = 0; i < n; i++) {
		if(arr[i]) {
			L++;
		} else {
			ans = mul(ans, L - R);
			R++;
		}
	}
	
	ans = mul(ans, fact[n/2]);
	cout << ans << endl;
}


Measured memory_bytes: 2196
a[100],i,k,m,t;main(n){while(scanf("%d%d",&n,&m),n){while(i<n*m)scanf("%d",&k),a[i++%m]+=k;n=m;while(n--){for(t=i=0;i<m;++i)t=t<a[i]?a[k=i]:t;printf("%d%c",k+1,n?32:10),i=a[k]=0;}}}

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

int main()
{
	int a;
	cin >> a;
	int b;
	cin >> b;
	int c;
	cin >> c;
	if (a < b && b < c){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	} 
	return 0;
}

Measured memory_bytes: 3076
#define _USE_MATH_DEFINES
#include <math.h>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

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

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
	string s; cin >> s;
	for (int i = 0; i < 12; ++i)
	{
		cout << s[i];
		if (i == 3) cout << ' ';
	}
	cout << endl;
}

Measured memory_bytes: 3552