akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define int long long
    #define lb long double
    #define f(i,a,b) for(int i=a;i<=b;i++)
    #define fd(i,a,b) for(int i=a;i>=b;i--)
    #define vi vector<int>
    #define mii map<int,int>
    #define pii pair<int,int>
    #define si set<int>
    #define pb push_back
    #define mk make_pair
    #define fi first
    #define se second
    #define fv(i,v) for(auto i=v.begin();i!=v.end();++i)
    #define fdv(i,v) for(auto i=v.rbegin();i!=v.rend();++i)
    #define print(a,n) f(i,1,n) cout<<a[i]<<" "; cout<<endl;
    #define printv(v) for(auto iv: v) cout<<iv<<" "; cout<<endl;
    #define all(v) v.begin(),v.end()
    #define r(a,n) ll a[n+1]; f(i,1,n) cin>>a[i];
    #define pi 3.141592653589793238
    const int mod=998244353;
    const int inf=1e18;
    //bool vis[1000+1]={};
    const int MAXN=1e5+1;
    int spf[MAXN];
    map<pii,int> m1,m2;

    ll power(ll x, unsigned ll y)
    {
        ll res = 1;
        while (y > 0)
        {
            if (y & 1)
                res = res*x;
            y = y>>1;
            x = x*x;
        }
        return res;
    }

    bool isPrime(int n)
    {
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }
        void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)
            spf[i] = i;
        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;
        for (int i=3; i*i<MAXN; i++)
        {
            if (spf[i] == i)
            {
                for (int j=i*i; j<MAXN; j+=i)
                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }

    int lcm(int a, int b)
    {
        return (a*b)/__gcd(a,b);
    }
    signed main()
    {
        int t=1;
        //cin>>t;
        while(t--)
        {
            int x,n;
            cin>>x>>n;
            r(a,n);
            mii m;
            f(i,1,n)
            m[a[i]]=1;
            int l=x,r=x;
            bool c=0;
            while(m[l]>0&&m[r]>0)
            {
                if(m[l-1]>0)l--;
                else if(m[l-1]==0){cout<<l-1<<endl;c=1;break;}
                if(m[r+1]>0)r++;
                else if(m[r+1]==0){cout<<r+1<<endl;c=1;break;}
            }
            if(c==0)cout<<x<<endl;
        }
    }


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

int main(){
  string S,T;
  cin >> S >> T;
  int ans=0;
  for(int i=0;i<S.size();i++){
    if(S[i]!=T[i]) ans++;
  }
  cout << ans << endl;
  return 0;
}


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

#define contraints 101

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

	//set double matrix to 2
	int i, j, Adj[contraints][contraints];
	for (i = 0; i != n; i++) {
		for (j = 0; j != n; j++) {
			Adj[i][j] = 0;
		}
	}

	//check onlinejudge for notation
	int k, u, v_k;
	for (i = 0; i != n; i++) {
		scanf("%d %d", &u, &k);

		for (j = 0; j != k; j++) {
			scanf("%d", &v_k);
			Adj[u - 1][v_k - 1] = 1;
		}
	}

	//printing
	for (i = 0; i != n; i++) {
		for (j = 0; j != n; j++) {
			printf("%d", Adj[i][j]);
			if (j != n - 1) {
				printf(" ");
			}
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 2056
import fractions

N = int(input())
a = list(map(int, input().split()))
l = a[0]
for i in range(1,N):
  l = l * a[i] // fractions.gcd(l, a[i])
m = l-1
fm = 0
for i in range(N):
  fm += m % a[i]
print(fm)

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int N; cin >> N;
	vector<int> v(N);
	map<int, int> mp;
	for (int i = 0; i < N; i++) {
		cin >> v[i];
		mp[v[i]]++;
	}

	ll ori = 0;
	for (auto p : mp) {
		if (p.second > 1) {
			ori += 1LL * p.second * (p.second - 1) / 2;
		}
	}

	for (int i = 0; i < N; i++) {
		ll minus = 0, plus = 0;
		if (mp[v[i]] > 1) minus = 1LL * mp[v[i]] * (mp[v[i]] - 1) / 2;
		if (mp[v[i]] - 1 > 1) plus = 1LL * (mp[v[i]] - 1) * (mp[v[i]] - 2) / 2;
		cout << ori - minus + plus << '\n';
	}
	return 0;
}


Measured memory_bytes: 9344
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <unordered_set>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
static const int INF = 1000010000;
static const int NIL = -1;
static const int MOD = 1000000007;
 
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define SORT(v) sort(v.begin(), v.end());
#define pb push_back
#define mp make_pair
#define np next_permutation
#define pq priority_queue
 
int gcd(int a, int b) { int c; while (b != 0) { c = a%b; a = b; b = c; }return a; }
int lcm(int a, int b) { int c = gcd(a, b); a /= c; return a*b; }
int nCr(int a, int b) { int i, r = 1; for (i = 1; i <= b; i++) { r *= (a + 1 - i); r /= i; }return r; }
int pow(int a, int b) { int i, r = 1; for (i = 1; i <= b; i++) { r *= a; }return r; }
long long llpow(long long a, long long b) { long long i, r = 1; for (i = 1; i <= b; i++) { r *= a; }return r; }
long long llgcd(long long a, long long b) { long long c; while (b != 0) { c = a%b; a = b; b = c; }return a; }
long long lllcm(long long a, long long b) { long long c = llgcd(a, b); a /= c; return a*b; }
long long llnCr(long long a, long long b) { long long i, r = 1; for (i = 1; i <= b; i++) { r *= (a + 1 - i); r /= i; }return r; }
 
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
 
int main(){
    ll x;
    cin >> x;
    ll k = x / 11;
    if(x % 11 == 0) cout << k * 2 << endl;
    else if(x % 11 < 7) cout << k * 2 + 1 << endl;
    else cout << k * 2 + 2 << endl;
}

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


int main(){
  int n;
  cin>>n;
  vector<tuple<string,int,int>> a;
  
  for(int i=1;i<=n;i++){
    string s;
    int p;
    cin>>s>>p;
    p=-p;
    a.push_back(tie(s,p,i));
  }
  sort(a.begin(),a.end());
 for(int i=0;i<n;i++) cout<<get<2>(a.at(i))<<endl;
}

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

int H, W, K;
int dp[8][101];
int line[8];

void makeline(int j){
  for(int i=0; i<8; i++){
    line[i]=j%2;
    j/=2;
  }
}

bool separate(int j){
  for(int i=0; i<7; i++)
    if(line[i]==1&&line[i+1]==1)
      return false;
  return true;
}

int main(){
  cin >> H >> W >> K;
  if(W == 1) {
    cout << 1 << endl;
    return 0;
  }
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  
  for(int i=1; i<=H; i++){
    for(int j=0; j<1<<(W-1); j++){
      makeline(j);
      if(separate(j)){
        for(int k=0; k<W; k++){
          int addk=k;
          if(k!=W-1) if(line[k]==1) addk=k+1;
          if(k!=0) if(line[k-1]==1) addk=k-1;
          dp[k][i]+=dp[addk][i-1];
          dp[k][i]%=1000000007;
        }
      }
    }
  }
  
  cout << dp[K-1][H] << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n, a[101], i=0, j=0;

	
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);

		if (a[i] % 2 == 0)
		{
			if (a[i] % 3 == 0 || a[i] % 5 == 0)
			{

			}
			else
			{
				j++;
			}
		}
	}
	if (j == 0)
	{
		printf("APPROVED");
	}
	else
	{
		printf("DENIED");
	}



		
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S1, S2;
    cin >> N >> S1 >> S2;
    ll mod = 1e9 + 7;
    ll ans = 0;
    if(S1[0] == S2[0]){
        ans += 3;
    }else{
        ans += 6;
    }
    rep(i,1,N){
        if(S1[i-1] == S2[i-1] && S1[i] == S2[i]){
            ans *= 2;
        }else if(S1[i-1] == S2[i-1] && S1[i] != S2[i]){
            ans *= 2;
        }else if(S1[i-1] != S2[i-1] && S1[i] != S2[i]){
            if(S1[i-1] != S1[i]){
                ans *= 3;
            }
        }else if(S1[i-1] != S2[i-1] && S1[i] == S2[i]){
            ans *= 1;
        }
        ans %= mod;

    }
    print(ans);


}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var s string
	fmt.Scan(&s)

	//総当たり
	sum := 0
	str := ""

	for i := 0; i < (1 << uint(3)); i++ {
		tmp := uint(i)
		sum, _ = strconv.Atoi(s[0:1])
		str = s[0:1]

		for j := 1; j <= 3; j++ {
			n, _ := strconv.Atoi(s[j : j+1])
			if tmp&1 == 1 {
				sum += n
				str += fmt.Sprintf("+%d", n)
			} else {
				sum -= n
				str += fmt.Sprintf("-%d", n)
			}

			tmp = tmp >> 1
		}

		if sum == 7 {
			str += "=7"
			break
		}

	}

	fmt.Println(str)
}


Measured memory_bytes: 512
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,l,r) for(int i=(l),i##_len=(r);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
const int INF = 1e9;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const ll MOD = 10e9+7LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)
//時間が厳しいとき使う
#define INI(...) int __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
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;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#define YN(e) cout << ((e) ? "YES" : "NO") << endl
#define yn(e) cout << ((e) ? "Yes" : "No") << endl
#pragma endregion RegionDefs

void solve()
{
    IN(k, n);
    VIN(ll, v, n);
    ll m = k - v[n-1] + v[0];
    reps(i, 1, n)
    {
        chmax(m, v[i] - v[i-1]);
    }
    cout << k - m << endl;
}

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

    solve();

    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include "algorithm"
#include "vector"


using namespace std;

const int N = 205;




int main() {
    int n,a,i;
    cin>>n;
    vector<pair<int,int>> v;
    for(i=0;i<n;i++){
        cin>>a;
        v.push_back({a,i+1});
    }

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

    for(i=0;i<n;i++) cout<<v[i].second<<" ";


    return 0;
}

Measured memory_bytes: 1780
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const static ll INF = 1e15;
// __uint128_t
//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}




int main(){
    ll N; cin >> N;
    if(isPrime(N)){
        cout << 1 << endl;
        return 0;
    }
    map<ll, ll> M;
    for(ll i = 2; i <= N; i++ ){
        if(!isPrime(i)) continue;
        bool flag = false;
        while(N % i == 0){
            flag = true;
            N /= i;
            M[i]++;
        }
        if(flag && isPrime(N)){
            M[N]++;
            N = 1;
            break;
        }
        if(N == 1) break;
    }
    ll ans = 0;
    for(auto m : M){
        ll cnt = 1;
        while(1){
            if(m.second >= cnt) {
                m.second -= cnt;
                cnt++;
                ans++;
            }
            else break;
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 3636
# https://atcoder.jp/contests/abc119/tasks/abc119_c
N, *ABC = gets.split.map(&:to_i)
l = []
N.times do
  l << gets.to_i
end

cost = 10 ** 9
[0, 1, 2, 3].repeated_permutation(N).each do |arys|
  temp_cost = 0
  length = [0, 0, 0] # a,b,c
  mp = [0, 0, 0] # a,b,c

  N.times do |i|
    if arys[i] != 3
      length[arys[i]] += l[i]
      mp[arys[i]] += 10
    end
  end
  next if mp.any? { |m| m == 0 }

  3.times do |i|
    temp_cost += mp[i] + (length[i] - ABC[i]).abs
  end

  cost = cost > temp_cost ? temp_cost : cost
end

p cost - 30

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

int main(){

    int N,P;
    cin >> N >> P;
    vector<vector<long long>> dp(N+1,vector<long long>(2));
    dp[0][0] = 1;//0個の整数の和は0
    dp[0][1] = 0;

    for(int i=1;i<=N;i++){
        int A;
        cin >> A;
        
        if (A%2 == 0){
            dp[i][0] = dp[i-1][0]*2;
            dp[i][1] = dp[i-1][1]*2;
        }else{
            dp[i][0] = dp[i-1][1] + dp[i-1][0];
            dp[i][1] = dp[i-1][0] + dp[i-1][1];
        }
    }
  
    cout << dp[N][P] << endl;
  
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val (D, G) = readLine()!!.split(" ").map(String::toInt)
    val PCD = Array(D) { readLine()!!.split(" ").map(String::toInt).let { it[0] to it[1] } }
    val P = PCD.map(Pair<Int, Int>::first)
    val C = PCD.map(Pair<Int, Int>::second)

    var res = Long.MAX_VALUE
    // コンプリートボーナスの組み合わせをBit全探索する
    for (bit in 0..(1 shl D)) {
        var sum = 0L
        var num = 0L
        for (i in 0 until D) {
            if (bit and (1 shl i) > 0) {
                val p = P[i]
                val c = C[i]
                sum += c + p * 100 * (i + 1)
                num += p
            }
        }

        // コンプリートボーナスの組み合わせで総合スコアをG点以上にできていれば、比較して次へ
        if (sum >= G) {
            res = Math.min(res, num)
        } else {
            // 高得点から順に
            for (i in D - 1 downTo 0) {
                // コンプリートボーナスの組み合わせだったらスキップ
                if (bit and (1 shl i) > 0) {
                    continue
                }
                // コンプリートボーナスはもらわない
                for (j in 0 until P[i]) {
                    if (sum >= G) {
                        break
                    }
                    sum += 100 * (i + 1)
                    ++num
                }
            }
        }
        res = Math.min(res, num)
    }
    println(res)
}



Measured memory_bytes: 38116
#include"bits/stdc++.h"
using ll=long long; 
using ld=long double; 
#define rep(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
const int mod=1e9+7; 
int main()
{
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout); 
  #endif
  ll a,b,c,d; cin>>a>>b>>c>>d; 
  cout<<max({a*c,a*d,c*b,b*d}); 
}

Measured memory_bytes: 3636
#define _DEBUG 1

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

const long long MOD = 1000000007;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define check(s)
#endif

#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll fatorial(ll N, ll result) {
  if (N <= 1) {
    return result % MOD;
  } else {
    return fatorial(N - 1, (N * result) % MOD);
  }
}

void solve(ll N, ll M) {
  ll result;

  if (abs(N - M) > 1) {
    result = 0;
  } else if (abs(N - M) == 1) {
    ll a, b;
    if (N < M) {
      a = fatorial(N, 1);
      b = fatorial(M, 1);
    } else {
      b = fatorial(M, 1);
      a = fatorial(N, 1);
    }
    result = (a * b) % MOD;
  } else { // N = M
    ll a = fatorial(N, 1);
    result = ((a * a) * 2) % MOD;
  }
  cout << result << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  ll N;
  scanf("%lld", &N);
  ll M;
  scanf("%lld", &M);
  solve(N, M);
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int n,i,count=0;
  scanf("%d",&n);
  char s[n+1];
  scanf("%s",s);
  for(i=0;i<n-2;i++)
    if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C')
      count++;
  printf("%d\n",count);
  return 0;
}


Measured memory_bytes: 128
using namespace std;
#include<bits/stdc++.h>
#define int long long
#define pb push_back 
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define repa(i,a,b) for (int i=a; i<=b; i++)
#define repd(i,b,a) for (int i=b; i>=a; i--)
#define endl "\n"
//debugging
#define debug1(a) cout<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define debug3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
#define debug4(a,b,c,d) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl;

const int N = 1e+6+5;
int big = 1e+18+3;
int mod = 1e+9+7;

signed main()
{
    IOS;
    
    int n;
    cin>>n;
    int ar[n+1];

    map<int,int>freq;

    repa(i,1,n)
    {
        cin>>ar[i];
        freq[ar[i]]++;
    }   

    int ans = 0;

    for (auto it:freq)
        ans+=((it.ss-1)*(it.ss))/2;

    repa(i,1,n)
    {
        int buf = ans;

        buf-=((freq[ar[i]]-1)*freq[ar[i]])/2;
        buf+=((freq[ar[i]]-2)*(freq[ar[i]]-1) )/2;

        cout<<buf<<endl;
    }
}

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

int main()
{
	int n, a[100];
	cin >> n;
	for (int i = 0; i<n; i++) {
		cin >> a[i];
	}
	for (int i = n - 1; i>-1; i--) {
		if (i != n - 1)cout << " ";
		cout << a[i] ;
	}
	cout << endl;

	return 0;
}





Measured memory_bytes: 3100
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<string>
#include<cstring>
#include<time.h>
#include<array>
#include<iomanip>
#include<list>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<bitset>
#include <queue>
#include <map>


using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;


//BDD,ZDD,kdtree, bdtree,bicalc, bolonoy, doloney,chinesemod,segmenttree,daikusutora, saidairyuu, 2bugurahu, heirokenshutu, topologicalsort, kyourenketuseibun


#define PRI(s) cout << s << endl
#define PRIY PRI("Yes")
#define PRIN PRI("No")

int ctoi(char c) {
	switch (c)
	{
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default:
		cout << "ERR_ctoi" << endl;
		return -1;
	}
}
//最大公約数
template<typename T>
constexpr T gcd(T a, T b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}

//最小公倍数
template<typename T>
constexpr T lcm(T a, T b)
{
	return a * b / gcd(a, b);
}
int main() {
	string ret;
	for (int i = 0; i < 3; ++i) {
		string s; 
		cin >> s;
		ret += s[i];
	}
	PRI(ret);
	return 0;
}

Measured memory_bytes: 3556
import java.util.*;

public class Main{
	//0438 start
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n == 0)break;
			int [] data = new int[n+1];
			for(int i = 1; i <= n;i++){
				data[i] = sc.nextInt();
			}
			double b  = sc.nextDouble();
			int r = sc.nextInt();
			double v = sc.nextDouble();
			double e = sc.nextDouble();
			double f = sc.nextDouble();
			
			double [][] dp = new double[n][n+1];
			int INF = 1 << 24;
			for(int i = 0; i < n; i++){
				Arrays.fill(dp[i], INF);
			}
			
			dp[0][0] =0;
			
			for(int i = 0; i < n; i++){
				for(int j = 0; j < n; j++){
					if(dp[j][i] == INF) continue;
					
					
					//sonomama
					double sum = 0.0;
					for(int k = data[i]; k < data[i+1]; k++){
						int x  = k - data[j];
						double value;
						if(x >= r){
							value = 1.0 / (v - e * (x - r));
						}
						else{
							value = 1.0 / (v - f * (r - x));
						}
						//System.out.println("x = " + x + " value = " + value + " i = " + i);
						sum += value;
					}
					dp[j][i+1] = Math.min(dp[j][i+1], sum + dp[j][i]);
					
					//keiyu
					double sum2 = 0.0;
					for(int k = data[i]; k < data[i+1]; k++){
						int x = k - data[i];
						double value;
						if(x >= r){
							value = 1.0 / (v - e * (x - r));
						}
						else{
							value = 1.0 / (v - f * (r - x));
						}
						sum2 += value;
					}
					sum2 += b;
					dp[i][i+1] = Math.min(dp[i][i+1], sum2 + dp[j][i]);
				}
			}
			double min = INF;
			for(int i = 0; i < n; i++){
				min = Math.min(min, dp[i][n]);
			}
			
			//debug
//			for(int i = 0; i < n; i++){
//				for(int j = 0; j <= n; j++){
//					System.out.printf("%.4f ",dp[i][j]);
//				}
//				System.out.println();
//			}
			
			System.out.printf("%.4f\n",min);
		}
	}
	
	public static void main(String[] args) {
		new Main().doit();
	}
}

Measured memory_bytes: 13000
n = int(input())
s = []

for i in range(n):
  s.append(list(map(int,input().split())))

ans_x = -1
ans_y = -1
ans_h = -1

for i in s:
  if(i[2] > 0):
    check_x,check_y,check_h = i
    break

for x in range(101):
  for y in range(101):
    flg = True
    H = check_h + abs(check_x - x) + abs(check_y - y)
    if(H <= 0):
      flg = False
      break

    else:
      for i in range(n):
        h = max( ( H - abs(s[i][0] - x) - abs(s[i][1] - y) ) ,0)
        if(h != s[i][2]):
          flg = False
          break
    if flg:
      ans_y = y
      ans_h = H
      break

  if flg:
    ans_x = x
    break

print("{} {} {}".format(ans_x,ans_y,ans_h))

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

int main(){
	int n;
	cin >> n;
	vector<int> d(n);
	rep(i,n) cin >> d[i];
	sort(d.begin(),d.end());
	cout << d[n/2] - d[n/2-1]<< endl;
}

// cout << fixed << setprecision(15) <<  << endl;

Measured memory_bytes: 3780
/*
ID: wangjun30
TASK:
LANG: C++
*/
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
	double val,n,k;
	cin>>n>>k;
	for(int i=1;i<=n;i++){
		double q=1;
		for(int j=i;j<k;j*=2)
			q/=2.0;
		val+=q;
	}
	cout<<fixed<<setprecision(9)<<val/n;
	return 0;
}

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

#define MOD 1000000007



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

  long long ans = 0;
  if(abs(n-m) <= 1){
    ans++;
    for(int i = 1;i <= n;i++){
      ans = (ans * i) % MOD;
    }
    for(int i = 1;i <= m;i++){
      ans = (ans * i) % MOD;
    }
    if(n == m) ans = (ans * 2) % MOD;
  }

  cout << ans << endl;


  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main (){
    int a,b,c,d,e;
    cin>>a>>b>>c;
    swap(a,b);
    swap(a,c);
    cout<<a<<' '<<b<<' '<<c<<endl;
      return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int yen, gohyaku, go, happy;
  gohyaku = 0;
  go = 0;
  happy = 0;
  
  scanf("%d",&yen);
  
  while(yen >= 500){
    yen = yen - 500;
    gohyaku = gohyaku + 1;
  }
  while(yen >= 5){
    yen = yen - 5;
    go = go + 1;
  }
  
  happy = 1000 * gohyaku + 5 * go;
  
  printf("%d\n",happy);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
int SIZE(string s){ return (int)s.size(); }

int main(){
    cout << setprecision(16);
    int n; cin >> n;
    map<int,int> m;
    rep(i,n){
        int x; cin >> x;
        m[x-1]++; m[x]++; m[x+1]++;
    }
    int ans = 0;
    rep(i,1e5) ans = max(ans, m[i]);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4992
import heapq

n = int(input())
data = list(map(int, input().split()))
data.sort(reverse=True)

q = []
heapq.heappush(q, -data[1])
heapq.heappush(q, -data[1])
result = data[0]

for i in range(2, n):
    result += -heapq.heappop(q)
    heapq.heappush(q, -data[i])
    heapq.heappush(q, -data[i])

print(result)

Measured memory_bytes: 99124
/**
 *   author: sahushivam
 *   created: 22 December 2019 (Sunday)  17:37:38
**/
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1e18
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define int long long

void solve(){
	int a,b; cin>>a>>b;
	int g=__gcd(a,b);
	int ans= (a*b)/g;
	cout<<ans;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int dp[50];
int a[50], b[50];
int m[50][50];
int N, M;
void recursive(int n) {
	dp[n] = 1;
	for(int i = 0; i < N; i++) {
		if(dp[i]) continue;
		if(m[n][i]) {
			recursive(i);
		}
	}
}
int main() {
	cin >> N >> M;
	for(int i = 0; i < N; i++) {
		for(int j = 0; j < N; j++) {
			m[i][j] = 0;
		}
	}
	for(int i = 0; i < M; i++) {
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
		m[a[i]][b[i]] = 1;
		m[b[i]][a[i]] = 1;
	}
	int ans = 0;
	for(int i = 0; i < M; i++) {
		m[a[i]][b[i]] = m[b[i]][a[i]] = 0;
		for(int j = 0; j < N; j++) dp[j] = 0;
		recursive(0);
		int flag = 1;
		for(int j = 0; j < N; j++) {
			flag *= dp[j];
		}
		if(!flag) ans++;
		m[a[i]][b[i]] = m[b[i]][a[i]] = 1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
n,m = map(int,input().split())
h = list(map(int,input().split()))
a = []
b = []
for i in range(m):
    abuf,bbuf = map(int,input().split())
    a.append(abuf)
    b.append(bbuf)
    
t = [0]*n
for i in range(m):
    if h[a[i]-1] > h[b[i]-1]:
        t[b[i]-1] = 1
    elif h[a[i]-1] < h[b[i]-1]:
        t[a[i]-1] = 1
    else:
        t[b[i]-1] = 1
        t[a[i]-1] = 1

total=0
for s in t:
    if s == 0:
        total += 1
print(total)

Measured memory_bytes: 22152
open System
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f

    let readInts() =
        read string
        |> Seq.toArray
        |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

module Util =
    let strRev (s: string): string =
        s
        |> Seq.rev
        |> Seq.map string
        |> String.concat ""

    let inline roundup (x: ^a) (y: ^a): ^a =
        let one = LanguagePrimitives.GenericOne
        (x + y - one) / y


[<RequireQualifiedAccess>]
module ModIntInner =

    let inline init (x: ^a) (modulo: int64): int64 =
        let x = (int64 x) % modulo
        match x with
        | _ when x < 0L -> x + modulo
        | _ when x >= modulo -> x - modulo
        | _ -> x

    let inline add (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = (int64 rhs) % modulo
        init (l + r) modulo

    let inline sub (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = (int64 rhs) % modulo
        init (l - r) modulo

    let inline mul (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = (int64 rhs) % modulo
        init (l * r) modulo

    let inline inverse (a: ^a) (modulo: int64): int64 =
        let mutable (a, b, u, v) = (int64 a, modulo, 1L, 0L)
        while b > 0L do
            let t = a / b
            a <- a - (t * b)
            let tmp = a
            a <- b
            b <- tmp
            u <- u - (t * v)
            let tmp = u
            u <- v
            v <- tmp
        init u modulo

    let inline div (lhs: ^a) (rhs: ^b) (modulo: int64) =
        let l = (int64 lhs) % modulo
        let r = inverse rhs modulo
        init (l * r) modulo

    let inline pow (a: ^a) (n: ^b) (modulo: int64) =
        let mutable (res, a, n) = (1L, int64 a, int64 n)
        while n > 0L do
            if (n &&& 1L) = 1L then res <- res * a % modulo
            a <- a * a % modulo
            n <- n >>> 1
        res

type ModInt =  {
    modulo : int64
} with
    member __.Add(l: int64, r: int64) =
        let m = __.modulo
        let l = ModIntInner.init l m
        let r = ModIntInner.init r m
        ModIntInner.add l r m

    member __.Sub(l: int64, r: int64) =
        let m = __.modulo
        let l = ModIntInner.init l m
        let r = ModIntInner.init r m
        ModIntInner.sub l r m

    member __.Mul(l: int64, r: int64) =
        let m = __.modulo
        let l = ModIntInner.init l m
        let r = ModIntInner.init r m
        ModIntInner.mul l r m

    member __.Div(l: int64, r: int64) =
        let m = __.modulo
        let l = ModIntInner.init l m
        let r = ModIntInner.init r m
        ModIntInner.div l r m

[<EntryPoint>]
let main _ =
    let n = read int
    let modint = { ModInt.modulo = int64 1e9 + 7L }
    let mutable ans = 1L
    for i in 1..n do
        ans <- modint.Mul(ans, int64 i)
    printfn "%d" ans
    0 // return an integer exit code


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

int n,a,b,i,tmp,tmphsl;
long long total;

int main(){
    total=0;
    scanf("%d%d%d",&n,&a,&b);
    for(i=1;i<=n;i++){
        tmp=i;
        tmphsl=0;
        while(tmp>0){
            tmphsl+=(tmp%10);
            tmp/=10;
        }
        if(tmphsl>=a&&tmphsl<=b){total+=i;}
    }
    cout<<total<<"\n";
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>

std::string lunlun;

void CreateLunlun(int &k, int digit, int dMax)
{
	char x = lunlun[digit - 1];
	int min = x == '0' ? 0 : -1;
	int max = x == '9' ? 0 : 1;
	for (int i = min; i <= max; i++) {
		lunlun[digit] = x + i;
		if (dMax > digit) {
			CreateLunlun(k, digit + 1, dMax);
		}
		else {
			k--;
		}
		if (k == 0) {
			return;
		}
	}
}

const std::string& GetLunlun(int k)
{
	int digit = 0;
	while (true) {
		lunlun.resize(digit + 1);
		for (char i = '1'; i <= '9'; i++) {
			lunlun[0] = i;
			if (digit > 0) {
				CreateLunlun(k, 1, digit);
			}
			else {
				k--;
			}
			if (k == 0) {
				return lunlun;
			}
		}
		digit++;
	}
}

int main()
{
	int k;
	std::cin >> k;
	
	std::cout << GetLunlun(k) << std::endl;
	
	return 0;
}


Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#include <list>
#define MOD 1000000007
#define INF 1000000000
typedef long long ll;
using namespace std;
typedef pair<int,int> P;

int main(void){
    
    int n;
    cin>>n;
    ll l[87];
    l[0]=2;
    l[1]=1;
    for(int i=2;i<=n;i++){
        l[i]=l[i-1]+l[i-2];
    }
    cout<<l[n]<<endl;
    return 0;
}


Measured memory_bytes: 256
import math
N, HP = map(int, input().split())
S, Strong = [], 0
for i in range(N):
    a, b = map(int, input().split())
    S.append((a, b))
    if a > Strong:
        Strong = a

Use, TotalT = [], 0
for i in range(N):
    if S[i][1] >= Strong:
        Use.append(S[i][1])
        TotalT += S[i][1]

if TotalT < HP:
    cut = math.ceil((HP - TotalT)/Strong)
    print(len(Use) + cut)
else:
    Use.sort(reverse = True)
    i = 0
    while HP > 0:
        HP -= Use[i]
        i += 1
    print(i)

Measured memory_bytes: 17716
N,K=[int(s) for s in input().split()]
A=[int(s) for s in input().split()]
F=[int(s) for s in input().split()]
A.sort()
F.sort(reverse=1)


def success(x):
  suc_sum=0
  for i in range(N):
    a=x//F[i]
    if A[i]>a:
      suc_sum+=A[i]-a
  if suc_sum<=K:
    return True
  else:
    return False

def bisearch():
  bi_max=10**12
  bi_a=0
  bi_b=bi_max
  while bi_b-bi_a>1:
    c=(bi_a+bi_b)//2
    if success(c):
      bi_a,bi_b=[bi_a,c]
    else:
      bi_a,bi_b=[c,bi_b]
  return [bi_a,bi_b]

a,b=bisearch()
if success(a):
  print(a)
else:
  print(b)    

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

using namespace std;
using ll = long long int;
using ii = pair<int, ll>;
using li = pair<ll, int>;
using vi = vector<int>;
using vii = vector<ii>;
using graph = vector<vii>;

const ll MOD =  1000000007;
const int INF= 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 16;
const double PI = 3.14159265359;
const double EPS = 0.000000001;
ll cost[1<<16], dp[1<<16], adj[20][20];
int lg[1<<16];
int main() {
    int n, m, k;
    scanf("%d", &n);
    for (int i = 0; i<n; ++i) {
        for (int j = 0; j<n; ++j) {
            scanf("%lld", &adj[i][j]);
        }
    }
    int mask = 1<<n; 
    for (int i = 2; i<mask; ++i) {
        lg[i] = lg[i>>1]+1;
    }
    for (int i = 1, j, u; i<mask; ++i) {
        cost[i] = cost[i-(i&-i)];
        j = i-(i&-i);
        u = lg[i&-i];
        while (j) {
            cost[i] += adj[u][lg[j&-j]];
            j -= j&-j;
        }
    }
    ll ans;
    for (int i = 1; i<mask; ++i) {
        ans = 0;
        for (int j = i; j>0; j = (j-1)&i) {
            ans = max(ans, cost[j] + dp[i-j]);
        }
        dp[i] = ans;
    }
    printf("%lld\n", dp[mask-1]);
}


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




int main(){
    string S;
    cin>>S;
    int N=S.size();
    for (int i=0;i<(N-1)/2;i++){
        if (S.at(i)!=S.at(N-1-i)){
            cout<<"No"<<endl;
            return 0;
        }
    }
    for(int i=0;i<(N+3)/4;i++){
        if (S.at(i)!=S.at((N-3)/2-i)){
            cout<<"No"<<endl;
            return 0;
        }
    }
    for(int i=0;i<(N+3)/4;i++){
        if (S.at((N+1)/2+i)!=S.at(N-1-i)){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrepa(i,a,n) for(int i=(n)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1e9+7
#define MOD 1e9+7
#define max3(a,b,c) max(a,max(b,c)) 
#define mix3(a,b,c) mix(a,mix(b,c))

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

int main(){
   
    int n,w;cin>>n>>w;
    vi weight(n+1,0),val(n+1,0);
    repa(i,1,n+1)cin>>weight[i]>>val[i];

    vvl dp(n+1,vl(w+1,0));

    repa(i,1,n+1){
        rep(j,w+1){
            if(j>=weight[i]){
                dp[i][j] = max(dp[i-1][j],dp[i-1][j-weight[i]]+val[i]);
            }else{
                dp[i][j] = dp[i-1][j];
            }
            // cout<<"dp["<<i<<"]["<<j<<"] = "<<dp[i][j]<<endl;
        }
    }

    cout << dp[n][w] << endl;
    
    return 0;
}

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

typedef long long ll;

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

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

int main() {
    string S,T;
    cin >> S >> T;
    
    int t = T.size(), s = S.size();
    int ans = 0;
    for ( int left = 0; left <= s - t; ++left ){
        int num = 0;
        //cout << "L " << left << endl;
        //cout << "L+t " << left+t << endl;
        for ( int i = 0; i < t; ++i){
            if ( S[left+i] == T[i] ) ++num;
        }
        //cout << ans << endl;
        ans = max(ans,num);
    }
    cout << t - ans << endl;
    return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll          long long
#define pb          push_back
#define ppb         pop_back
#define endl        '\n'
#define mii         map<ll,ll>
#define msi         map<string,ll>
#define mis         map<ll, string>
#define rep(i,a,b)    for(ll i=a;i<b;i++)
#define repr(i,a,b) for(ll i=b-1;i>=a;i--)
#define trav(a, x)  for(auto& a : x)
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define vii         vector<pair<ll, ll>>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define DEBUG       cerr<<"/n>>>I'm Here<<</n"<<endl;
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl;
#define what_is(x)  cerr << #x << " is " << x << endl;
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace __gnu_pbds;
using namespace std;
#define PI 3.141592653589793
#define N  201
void solve()
{
    string s,t;
    cin >> s >> t;
    if ((s.length()+1)==(t.length()) and s==t.substr(0,s.length()))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return;
}
int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("input.txt","r",stdin);
    #endif
    ll int TEST=1;
    //cin >> TEST;
    while(TEST--)
    {
        solve();
    }
}


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

using namespace std;
int main(){
    int n;
    cin >> n;
    if(n<1200) cout << "ABC" << endl;
    else if(n<2800 && n>=1200) cout << "ARC" << endl;
    else cout << "AGC" << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <stdio.h>
int main (void) 
{
    int n,k;
    char s[11];
    scanf("%d",&n);
    scanf("%s",s);
    scanf("%d",&k);
    for (int i =0 ; i < n; i++) {
        if(s[k -1] != s[i])    s[i] = '*';
    }
    printf("%s",s);
    return 0;
}

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

#define FOR(i,start,end) for(int i=start; i<(int)(end); i++)
#define REP(i,n) FOR(i,0,n)
#define SIZE_OF_ARRAY(array)  (sizeof(array)/sizeof((array)[0]))

template<class T> void print(const T& value) { cout << value << "\n"; }

int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);

    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);

    if(x < y && y < z) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}



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

int main(void){
    int n;
    cin >> n;
    
    int t[100];
    int sum = 0;
    int i;
    for(i = 0; i < n; i++){
        cin >> t[i];
        sum += t[i];
    }
    
    int m;
    cin >> m;
    
    int p, x;
    for(i = 1; i <= m; i++){
        cin >> p >> x;
        cout << sum - t[p - 1] + x << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

int main() {
    int n, a, b;
    cin >> n;
    if (n == 1) {
        cout << "Hello World" << endl;
    } else {
        cin >> a >> b;
        cout << a + b << endl;
    }

    return 0;
}


Measured memory_bytes: 256
fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let k: usize = iter.next().unwrap().parse().unwrap();

    let mut p_toss = 0f64;
    for i in 1..(n+1) {
        let nr_toss = ((k as f64)/(i as f64)).log2().ceil();
        let nr_toss = if nr_toss < 0f64 { 0f64 } else { nr_toss };
        p_toss += 0.5f64.powf(nr_toss);
    }

    let ans = p_toss / (n as f64);

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

Measured memory_bytes: 4352
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
class Solve{
    public Solve(){}
    StringBuilder sb;
    public static int Main(){
        new Solve().Run();
        return 0;
    }
    void Run(){
        sb = new StringBuilder();
        Calc();
        Console.Write(sb.ToString());
    }
    void Calc(){
        string[] str = Console.ReadLine().Split(' ');
        int m = Math.Max(int.Parse(str[0]),int.Parse(str[2]));
        int M = Math.Min(int.Parse(str[1]),int.Parse(str[3]));
        int count = M - m;
        if(count < 0){
            count = 0;
        }
        sb.Append(count+"\n");
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
 
#define endl '\n'
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define epool(i, m, n) for (ll i = m; i >= n; i--)
#define mod 1000000007
#define mod2 998244353
#define vi vector<ll>
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x,0;
#define all(v) v.begin(),v.end()
const ll INF=1e18;
const double PI=4*atan(1);

#define SpeedForce                    \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;

ll mpow(ll base,ll exp);
void solve();
ll POW(ll base,ll exp);
ll gcd(ll a,ll b);

ll modInverse(ll n) { 
    return mpow(n, mod-2); 
}
 
ll nCr(ll n, ll r){ 
   if (r==0) 
      return 1; 
    ll fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = (fac[i-1]*i)%mod; 
    return ((fac[n]* modInverse(fac[r]) % mod * 
            modInverse(fac[n-r]) % mod)%mod)%mod; 
}

int32_t main(){
    SpeedForce
    ll i = 0,j = 0;

    int t;
    t=1;
    //cin >> t;
    while (t--){
        //cout << fixed << setprecision(10);
        solve();
    }
}



void solve(){
    ll r;
    cin >> r;
    cout << r*r << endl;

}

ll POW(ll base,ll exp){
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base);
        base = ((ll)base * base);
        exp >>= 1;
    }
    return result;
}

ll mpow(ll base, ll exp){
    base %= mod;
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base) % mod;
        base = ((ll)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

ll gcd(ll a, ll b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

Measured memory_bytes: 3660
#include<iostream>
using namespace std;
 
int main(void){
  int t,n,s,f,sum;
  while(true){
    cin>> t;
    sum = 0;
    if(t ==0)
    break;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> s >> f;
        sum = sum + (f-s);
    }
    if(sum >= t) {
        cout << "OK" << endl;
    }
    else {
        cout << t-sum << endl;
    }
  }
}


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

typedef long long ll;
const int MAXN = 1e5 + 10;
int N; ll L, T;
ll A[MAXN];
int c;

int main() {
	register int i;
	scanf("%d%lld%lld", &N, &L, &T);
	for(i = 1; i <= N; ++i) {
		ll x, w;
		scanf("%lld%lld", &x, &w); w = w == 2 ? -1 : w;
		x = x + w * T;
		if(x > 0) c += x / L, c %= N;
		if(x < 0) c += (x + 1) / L - 1, c %= N;
		A[i] = (x % L + L) % L;
	}
	c = (c + N) % N;
	sort(A + 1, A + N + 1);
	for(i = c + 1; i <= N; ++i) printf("%d\n", A[i]);
	for(i = 1; i <= c; ++i) printf("%d\n", A[i]);
	return 0;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(a) int(a.size())
#define clr(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int N=6e3+10;
const int mod=0;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
char s[N];
int n,f[N][N],a[N],b[N],A=0,B=0,c[N];
string getstr(int f[]) {
    string ret;
    for(int i=1;i<=2*n;i++)
        if(f[c[i]]) ret+=s[i];
    return ret;
}
int main() {
    n=gi(),scanf("%s",s+1);
    for(int i=1;i<=2*n;i++) {
        if(s[i]=='a') a[++A]=i,c[i]=A;
        else b[++B]=i,c[i]=B;
    }
    f[n][n]=1;
    for(int i=n-1;i;i--) {
        f[i][i]=1;
        if(a[i]<b[i]) {
            int mx=0;
            for(int j=a[i];j<=b[i];j++) chkmax(mx,c[j]);
            for(int j=i+1;j<=n;j++) f[i][j]=f[mx+1][j];
        }
        else {
            int tot=0,mx=0;
            for(int j=b[i];j<=a[i];j++) {
                if(c[j]<i) continue;
                f[i][c[j]]=1,chkmax(mx,c[j]);
                s[j]=='b'?++tot:--tot;
            }
            for(int j=a[i]+1;j<=2*n;j++) {
                if(s[j]=='b') {
                    if(tot==0) f[i][c[j]]=f[mx+1][c[j]];
                    else ++tot,chkmax(mx,c[j]),f[i][c[j]]=1;
                }
                else {
                    if(tot==0) f[i][c[j]]=f[mx+1][c[j]];
                    else --tot,f[i][c[j]]=1;
                }
            }
        }
        if(getstr(f[i])<getstr(f[i+1])) memcpy(f[i],f[i+1],sizeof(f[i]));
    }
    cout<<getstr(f[1]);
    return 0;
}


Measured memory_bytes: 71936
#include <iostream>
#include <cstdint>
#include <vector>

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

	uint32_t n;
	std::cin >> n;
	std::vector<uint32_t> h(n);
	for (uint32_t &i : h) {
		std::cin >> i;
	}

	uint32_t best = 0;
	uint32_t cur = 0;
	for (uint32_t i = h.size() - 2;i < h.size();i--) {
		if (h[i] >= h[i + 1]) {
			cur++;
			best = std::max(best, cur);
		} else {
			cur = 0;
		}
	}
	std::cout << best << "\n";

}


Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {

	public static void main(String[] args) throws IOException {
		try(final Scanner sc = new Scanner(System.in)){
			final double T = sc.nextDouble();
			final int X = sc.nextInt();
			
			System.out.printf("%.09f\n", T / X);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}

Measured memory_bytes: 22484