akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P,P> PP;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e5 + 5);
const double EPS = 1e-10;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()


int main() {
    int n;
    cin >> n;
    REP(i,n){
        string s;
        cin >> s;
        deque<char> train;
        train.push_back(s[0]);
        int pos = 0, l = 0, r = 0;
        for(int j=1;j*3<=int(s.size());j++){
            if(s[j*3-1]=='>'){
                if(pos==r){
                    train.push_back(s[j*3]);
                    r++;
                }
                pos++;
            }
            else{
                if(pos==l){
                    train.push_front(s[j*3]);
                    l--;
                }
                pos--;
            }
        }
        for(auto c : train){
            cout << c;
        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 3184
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

// https://ei1333.github.io/luzhiled/snippets/math/divisor.html
vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  reverse(ALL(ret));
  return (ret);
}

// <= val の要素数
int CountLowerE(const vll &vec, ll val){
    return distance(vec.begin(), upper_bound(ALL(vec), val));
}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n, k;
    cin >> n >> k;
    vll a(n);
    rep(i, n){
        cin >> a[i];
    }
    
    ll suma = accumulate(ALL(a), 0LL);
    vll div = divisor(suma);
    vll b(n);
    vll c(n);
    vll bacc(n);
    vll cacc(n);
    for(auto&& e : div){
        rep(i, n){
            b[i] = a[i] % e;
            c[i] = e - b[i];
        }
        sort(ALL(b));
        sort(ALL(c));
        ll acc = 0;
        rep(i, n){
            acc += b[i];
            bacc[i] = acc;
        }
        acc = 0;
        rep(i, n){
            acc += c[i];
            cacc[i] = acc;
        }
        ll f = CountLowerE(bacc, k)+CountLowerE(cacc, k);
        if(f >= n){
            cout << e << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
using namespace std;
 
int main(){
    ld n;
    cin >> n;
    ld ans = 2*n*3.14;
    cout << ans;
    return 0;
}
//                                     #!!{*[$um1t_Kum@r]*}!!#

Measured memory_bytes: 3792
import java.util.Scanner;

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

	public static void getCoins() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int coins = 0;
		int days = 0;
		while (coins < C) {
			days++;
			coins += A;
			if (days % 7 == 0) {
				coins += B;
			}
		}
		System.out.println(days);
	}
}



Measured memory_bytes: 26492
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <iomanip>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 2;
const int MOD = 1000000007;
typedef vector<ll> vl;
typedef vector<vl> vvl;

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

	int ans = 0;
	REP(i, N) {
		if (A[i] == B[i]) {
			if (A[i] == C[i]) {

			}
			else {
				ans++;
			}
		}
		else if (B[i] == C[i]) {
			ans++;
		}
		else if (A[i] == C[i]) {
			ans++;
		}
		else {
			ans++;
			ans++;
		}
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma region

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++)
#define _irep3(i, begin, end) for (register int i = (end)-1, i##_begin = (begin); i >= i##_begin; i--)
#define _rep2(i, n) _rep3(i, 0, n)
#define _irep2(i, n) _irep3(i, 0, n)
#define _overload3(_1, _2, _3, name, ...) name
#define rep(...) _overload3(__VA_ARGS__, _rep3, _rep2, )(__VA_ARGS__)
#define irep(...) _overload3(__VA_ARGS__, _irep3, _irep2, )(__VA_ARGS__)
#define out(x) cout << (x) << '\n';
#define debug(x) cerr << #x << " = " << (x) << " (line: " << __LINE__ << ") " << endl;

using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
using vvb = vector<vector<bool>>;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &pair) {
  cin >> pair.first >> pair.second;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[ ";
  rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i];
  os << " ]";
  return os;
}

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

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

void init() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(16);
}

#pragma endregion

#define MOD 1000000007
#define INF 2147483647

int main() {
  init();

  int N;
  cin >> N;
  vl A(N);
  cin >> A;

  vl cnt(N + 1, 0);
  rep(i, N) {
    cnt[A[i]]++;
  }

  ll sum = 0;
  rep(i, 1, N + 1) {
    sum += cnt[i] * (cnt[i] - 1) / 2;
  }

  rep(i, N) {
    out(sum - cnt[A[i]] * (cnt[A[i]] - 1) / 2 + (cnt[A[i]] - 1) * (cnt[A[i]] - 2) / 2);
  }
}


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

#define pb push_back
#define ff first
#define ss second
#define N 100005
#define inf 1000000009
#define ll long long
#define all(a) a.begin(),a.end()
#define mid(a,b) (a+b)/2
#define pii pair<int,int>

using namespace std;

int a,b;

int main()
{
	cin >> a >> b;
	if(b >= a) cout << "unsafe";
	else cout << "safe";
}


Measured memory_bytes: 3624
# coding: utf-8
# Your code here!

a,b,c = map(int, input().split())

s = int(c**0.5 +1)

li = []

for i in range(1,s+1):
    if c%i == 0:
        li.append(i)
        li.append(c//i)
        
li = list(set(li))

ans = 0
for i in li:
    if a <= i <= b:
        ans += 1
        
print(ans)


Measured memory_bytes: 5644
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()
X, Y = map(int,input().split())

c = 2
t = 4
ans ='No'

for i in range(0,X+1):
  if i *c + (X-i)*t == Y:
    ans= 'Yes'
    break

print(ans)

Measured memory_bytes: 61764
class Graph:
    def __init__(self, graph):
        self.graph = graph # residual graph
        self.part_1 = len(graph)
        self.part_2 = len(graph[0])
    
    # A DFS based recursive function that returns true if a matching for vertex u is possible
    def bpm(self, u, matchR, visited):
        for v in range(self.part_2):
            if self.graph[u][v] and visited[v] == False:
                visited[v] = True
                if matchR[v] == -1 or self.bpm(matchR[v], matchR, visited):
                    matchR[v] = u
                    return True
        return False

    # Returns maximum number of matching 
    def maxBPM(self):
        matchR = [-1] * self.part_2
        result = 0
        for i in range(self.part_1):
            visited = [False] * self.part_2
            if self.bpm(i, matchR, visited):
                result += 1
        return result

N = int(input())
reds = [tuple(map(int, input().split())) for _ in range(N)]
blues = [tuple(map(int, input().split())) for _ in range(N)]

edges = [[0 for _ in range(N)] for _ in range(N)]

for i in range(N):
    for j in range(N):
        if reds[i][0] < blues[j][0] and reds[i][1] < blues[j][1]:
            edges[i][j] = 1

g = Graph(edges)

print(g.maxBPM())

Measured memory_bytes: 3188
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same_check(self, x, y):
        return self.find(x) == self.find(y)

n, m = map(int, input().split())
p = [int(x) for x in input().split()]

uni =  UnionFind(n+1)
for i in range(m):
    x, y = map(int, input().split())
    uni.union(x, y)

cnt = 0

for i in range(n):
    if uni.same_check(p[i], i + 1):
        cnt += 1
print(cnt)


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

int main(){
  
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b) cout << c << endl;
  else if (a == c) cout << b << endl;
  else cout << a << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout << "Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
 
typedef long long ll;
typedef pair<int,int> P;
//typedef long long T;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
int main(){
    int n;
    std::cin >> n;
    std::vector<std::vector<int> >g(n);
    rep(i,n){
        int d,k;
        std::cin >> d>>k;
        d--;
        rep(j,k){
            int dd;
            std::cin >>dd;
            g[d].pb(dd-1);
        }
    }
    std::vector<int> di(n,-1);
    std::queue<int> q;
    di[0]=0;
    erep(i,g[0]){
        di[i]=1;
        q.push(i);
    }
    while(!q.empty()){
        int p=q.front();
        erep(i,g[p]){
            if(di[i]==-1){
                di[i]=di[p]+1;
                q.push(i);
            }
        }
        q.pop();
    }
    rep(i,n){
        ppri(i+1,di[i]);
    }
}


Measured memory_bytes: 3208
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cctype>
using namespace std;
#define LL long long
int N;
LL Ai[200005]={};
LL Xor[200005]={};
LL Sum[200005]={};
LL Ans=0;
int main()
{
	scanf("%d",&N);
	for(int i=1;i<=N;++i)
	{
		scanf("%lld",&Ai[i]);
		Sum[i]=Sum[i-1]+Ai[i];
		Xor[i]=Xor[i-1]^Ai[i];
	}
	for(int Left_Border=1,i=1;i<=N;++i)
	{
		while(Sum[i]-Sum[Left_Border-1]!=(Xor[i]^Xor[Left_Border-1]))++Left_Border;
		Ans+=(LL)(i-Left_Border+1);
	}
	printf("%lld",Ans);
	return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

//main code


int main(int argc, char const* argv[])
{
	LL n;
	cin >> n;
	VL a(n);
	cin >> a;
	VL ans(n,0);
	VVL yaku(n);
	for (int k = 2; k <= n; k++) {
		for(int i=1 ; i*i<=k ; ++i)
		{
			if(k%i == 0)
			{
				yaku[k-1].push_back(i);
				if(i!=1 && i*i!=k)
				{
					yaku[k-1].push_back(k/i);
				}
			}
		}
	}
	int m = 0;
	VL an;
	for (int i = n; i >= 1; i--) {
		if (ans[i-1] != a[i-1]) {
			ans[i-1] = a[i-1];
			m++;
			an.push_back(i);
			for (auto&& var : yaku[i-1]) {
				ans[var-1] += 1;
				ans[var-1] %= 2;
			}
		}
	}
	cout << m << endl;
	for (auto&& var : an) {
		cout << var << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 36344
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

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; }

using ll = long long;

ll K;
std::queue<ll> que;

int main()
{
  std::cin >> K;

  if( K <= 9 )
  {
    std::cout << K << std::endl;

    return 0;
  }

  rep( i, 9 )
    que.push( i+1 );

  rep( k, K )
  {
    ll x = que.front(); que.pop();

    if( k == K-1 )
    {
      std::cout << x << std::endl;

      return 0;
    }

    if( x%10 )
      que.push( x*10+(x%10)-1 );
    
    que.push( x*10+(x%10) );

    if( x%10+1 <= 9 )
      que.push( x*10+(x%10)+1 );
  }

  return 0;
}

Measured memory_bytes: 1792
#include<vector>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
inline int read(){
	int x=0,c=getchar(),f=0;
	for(;c>'9'||c<'0';f=c=='-',c=getchar());
	for(;c>='0'&&c<='9';c=getchar())
	x=(x<<1)+(x<<3)+c-'0';return f?-x:x;
}
inline void write(int x){
	if(x>9)write(x/10);
	putchar(x%10+'0');
}

const int mod = 1e9+7;
int pri[1005],cnt;
int n;
ll ans = 1;

void getpri(){
	pri[++cnt] = 2;
	for(int i = 3;i <= 1000;i++){
		pri[++cnt] = i;
		for(int j = 1;j < cnt && pri[j]*pri[j] <= i;j++)
			if(i%pri[j] == 0){
				--cnt;
				break;
			}
	}
}

int main(){
	getpri();
	n = read();
	// printf("%d\n",cnt);
	// for(int i = 1;i <= cnt;i++)
	// 	printf("%d ",pri[i]);
	for(int i = 1;i <= cnt;i++){
		int x = n,num = 0;
		while(x/pri[i] > 0){
			num += x/pri[i];
			x /= pri[i];
		}
		ans = ans*(num+1)%mod;
		// printf("%d %d\n",pri[i],num);
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
typedef long long ll;

#define rep(i, s, c) for (int i = s; i < c; i++)
#define MAX_N 100001
#define INF 1000000

int main()
{
    int a, b;
    cin >> a >> b;
    int diff = b - a;
    int ans = 0;
    rep(i, 1, diff)
    {
        ans += i;
    }
    cout << ans - a << endl;
}

Measured memory_bytes: 256
/*************************************************************************
	> File Name: 1.cpp
	> Author: Knowledge_llz
	> Mail: 925538513@qq.com 
	> Blog: https://blog.csdn.net/Pig_cfbsl 
	> Created Time: 2020/7/5 19:59:25
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define LL long long
using namespace std;
int read(){
	char x=getchar(); int u=0,fg=0;
	while(!isdigit(x)){ if(x=='-') fg=1; x=getchar(); }
	while(isdigit(x)){ u=(u<<3)+(u<<1)+(x^48); x=getchar(); }
	return fg?-u:u;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
#endif
	int n;
	cin>>n;
	n%=1000;
	if(!n) cout<<n;
	else cout<<1000-n;
	return 0;
}


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


int main()
{	
	double a,b;
	cin>>a>>b;
	cout<<(int)floor(a/b)<<endl;
	cout<<a-floor(a/b)*b<<endl;
	printf("%.8f\n", a/b);
	return 0;	
}



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


int main() {
	int a ,b; 
	cin >> a >> b ;
	
	for (int i = (b - a + 1); i <= (b + a - 1);i++) {
		cout << i ;
		if (i != (b + a - 1)) {
			cout << " ";
		}
		else {
			cout << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<cstdio>
#include<map>
#include<string>
 
using namespace std;
 
typedef pair<string,int> P;
 
bool judge(string str)
{
  for(int i=1;i<str.size();i++)
    if(str[0]!=str[i])return false;
  return true;
}
 
char getch(char c1, char c2)
{
  if(c1=='r'&&c2=='b'||c1=='b'&&c2=='r')return 'g';
  if(c1=='r'&&c2=='g'||c1=='g'&&c2=='r')return 'b';
  if(c1=='b'&&c2=='g'||c1=='g'&&c2=='b')return 'r';
}
 
int bfs(string str)
{
  queue<P> q;
  map<string,int> mat;
  q.push(P(str,0));
  while(!q.empty()){
    P p = q.front(); q.pop();
    string s=p.first;
    int n=p.second+1;
    if(mat[s])continue;
    if(judge(s)){
      return n-1;
    }
    mat[s]=n;
    for(int i=0;i<s.size()-1;i++){
      if(s[i]!=s[i+1]){
        string t=s;
        char ch=getch(t[i],t[i+1]);
        t[i]=t[i+1]=ch;
        q.push(P(t,n));
      }
    }
  }
  return -1;
}
 
int main(void)
{
  string str;
  while(cin>>str&&str!="0"){
    int res;
    res = bfs(str);
    if(~res)printf("%d\n",res);
    else puts("NA");
  }
  return 0;
}

Measured memory_bytes: 2208
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(300000)


def solve(N: int, A: "List[int]"):
    ret = 0
    for i in range(1, N):
        tmp = max(0, A[i - 1] - A[i])
        A[i] += tmp
        ret += tmp
    print(ret)
    return

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 93584
#!/usr/bin/env python3
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

def B():
    #4方向移動リスト
    ANS = []
    move = [[1, 0], [-1, 0], [0, 1], [0, -1]]
    while True:
        #wとhの受け取り
        w, h = LI()
        if w == h == 0:
            break
        #maze受け取り
        #入力された文字列を1行ずつリストに入れるのを2*h-1回
        field = SR(2 * h - 1)
        #チェック済みかどうかを判定するリスト
        check = [[True] * (2 * w - 1) for i in range(2 * h - 1)]
        #queueの性質を持つリスト
        next = deque()
        #スタート位置(0,0)
        next.append((0, 0))
        ans = 1
        flg = True#ゴールかどうかの判定フラグ

        while next and flg:#nextに要素あり、flg = true(ゴールでない)
            now = next#nowにnextのqueueリスト受け渡し
            next = deque()#nextは新しいqueueリストを持つ
            while now:#nowに要素あるなら
                x, y = now.pop()
                for mx, my in move:
                    nx, ny = x + mx, y + my#4方向に移動

                    if 0 <= nx < 2 * w - 1 and 0 <= ny < 2 * h - 1 and field[ny][nx] == '0' and check[ny+my][nx+mx]:#移動先が0かつもう一つ先がチェック済みでないなら
                            next.append((nx + mx, ny + my))#移動先のもう一つ先をnextのqueueにいれて
                            check[ny + my][nx + mx] = False#そこをチェック済みにする
                            if nx+mx == 2 * w - 2 and ny+my == 2 * h - 2:#ゴールなら
                                ANS.append(ans+1)#結果を出力
                                flg = False#ゴールした
                                next = deque()#空にしてwhile文から抜ける
                                now = deque()#上同様
                                break
            ans += 1
        if flg:#ゴールしなかった
            ANS.append(0)


    return ANS

if __name__ == '__main__':
    A = B()
    for i in range(len(A)):
        print(A[i])



Measured memory_bytes: 8380
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back

using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef unsigned long long int ull;
int MOD=1000000007;
int MOD2=998244353;
vector<int> bases;
const ll LLINF=1ll<<60;
const char en='\n';

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void yes() {cout<<"YES"<<en; exit(0);}
void no() {cout<<"NO"<<en; exit(0);}
inline int rund() {int x576363482791fuweh=rng();return abs(x576363482791fuweh)%RAND_MAX;}
template<class T>
void prVec(vector<T> w)
{
	cout<<w.size()<<endl;
	for (int i=0;i<int(w.size())-1;++i) cout<<w[i]<<' ';
	if (w.size()) cout<<w[w.size()-1]<<endl;
}

void M998()
{
	swap(MOD,MOD2);
}

ll raand()
{
	ll a=rund();
	a*=RAND_MAX;
	a+=rund();
    return a;
}

#define rand raand

ll raaand()
{
	return raand()*(MOD-7)+raand();
}

string to_upper(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A';
	return a;
}

string to_lower(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='A' && a[i]<='Z') a[i]+='a'-'A';
	return a;
}

ll sti(string a)
{
	ll k=0;
	for (int i=0;i<(int)a.size();++i)
	{
		k*=10;
		k+=a[i]-'0';
	}
	return k;
}

string its(ll k)
{
	if (k==0) return "0";
	string a;
	while (k)
	{
		a.push_back((k%10)+'0');
		k/=10;
	}
	reverse(a.begin(),a.end());
	return a;
}

ll min(ll a,int b)
{
	if (a<b) return a;
	return b;
}

ll min(int a,ll b)
{
	if (a<b) return a;
	return b;
}

ll max(ll a,int b)
{
	if (a>b) return a;
	return b;
}

ll max(int a,ll b)
{
	if (a>b) return a;
	return b;
}

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

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

template<class T,class K>
pair<T,K> mp(T a,K b)
{
	return make_pair(a,b);
}

inline int mult(ll a,ll b)
{
	return (a*b)%MOD;
}

inline int pot(int n,int k)
{
	if (k==0) return 1;
	ll a=pot(n,k/2);
	a=mult(a,a);
	if (k%2) return mult(a,n);
	else return a;
}

int divide(int a,int b)
{
	return mult(a,pot(b,MOD-2));
}

inline int sub(int a,int b)
{
	if (a-b>=0) return a-b;
	return a-b+MOD;
}

inline int add(int a,int b)
{
	if (a+b>=MOD) return a+b-MOD;
	return a+b;
}

bool prime(ll a)
{
	if (a==1) return 0;
	for (int i=2;i<=round(sqrt(a));++i)
	{
		if (a%i==0) return 0;
	}
	return 1;
}

ll has(string x)
{
	ll h1=0,h2=0;
	x=to_lower(x);
	for (char a: x)
	{
		h1*=bases[0];
		h1+=a-'a';
		h1%=bases[3];
		h2*=bases[1];
		h2+=a-'a';
		h2%=bases[4];
	}
	return h1*(MOD+13893829)+h2;
}

const int N=300010;
int n,cnt[N];
string h;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	for (int i=0;i<10;++i) bases.push_back((raand()%MOD+13893829)%MOD);
	cin>>n>>h;
	int res=1;
	for (auto c: h) ++cnt[c-'a'];
	for (int i=0;i<26;++i) res=mult(res,cnt[i]+1);
	cout<<sub(res,1);
}




Measured memory_bytes: 512
/*
g++ -std=c++11 -Wall -O2 -o main.exe main.cpp
./main.exe
*/

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <functional>
#include <algorithm>
#include <complex>
#include <numeric>
//最大公約数: gcd()
//最小公倍数: lcm()

#define ll long long int

using namespace std;

template <typename T>
void sortasc(vector<T> &v){ //vectorを昇順にソート
    sort(v.begin(), v.end(), std::greater<T>());
    return;
}

template <typename T>
void sortdesc(vector<T> &v){ //vectorを降順にソート
    sort(v.begin(), v.end(), std::less<T>());
    return;
}









int main(){
    string s;
    cin >> s;
    vector<int> b{0, 0, 0};

    for(int i = 0; i < 3; i++){
        switch(s[i]){
            case 'a':
                b[0] = 1;
                break;
            case 'b':
                b[1] = 1;
                break;
            case 'c':
                b[2] = 1;
        }
    }

    if(b[0] && b[1] && b[2]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
            #define ll long long
            #define f   first
            #define s   second
            #define pb          push_back
            #define mod        1000000007
            #define mod1       1000000009
            #define hell        998244353
            #define inf         1000000000000000000LL
            #define pi          3.14159265358979323
            #define N           1000050
            using namespace std;
            ll n,k,sum,q,res,m,val;
            ll x,y;
            void solve()    
            {   
                string s,s1;
                cin>>s;
                cin>>s1;
                n=s.size();
                vector<ll> adj[26];
                for(int i=0;i<n;i++)
                {
                    adj[s[i]-'a'].pb(i);
                }
                x=-1;
                ll cnt=0;
                m=s1.size();
                for(int i=0;i<m;i++)
                {
                    y=s1[i]-'a';
                    if(adj[y].size()==0)
                    {
                        cout<<"-1";return;
                    }
                    auto it=upper_bound(adj[y].begin(),adj[y].end(),x);
                    if(it==adj[y].end())
                    {
                        cnt+=(n-x+adj[y][0]);
                        x=adj[y][0];
                        
                    }
                    else
                    {
                        ll id=*it;
                        cnt+=(id-x);
                        //cout<<cnt<<id<<" ";
                        x=id;
                    }
                }
                cout<<cnt<<"\n";








            }
            int main()
            {   ios_base::sync_with_stdio(false);
                cin.tie(0);cout.tie(0);
                ll t=1;
                //cin>>t;
                for(int i=1;i<=t;i++)
                    solve();
                

            }            

Measured memory_bytes: 4524
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();

    let mut s1 = Vec::new();
    let mut s2 = Vec::new();

    s1 = s.trim().clone().chars().collect();
    s2 = s.trim().chars().rev().collect();

    if s1 == s2 {
        println!("Yes");
    } else {
        println!("No");
    }
}

Measured memory_bytes: 4352
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 1000000000000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { int to, cost; };

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

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

// mod. m での a の逆元 a^{-1} を計算するよ！
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}


//aCbをmod.mで割った余りを求める
ll int c(ll int a, ll int b, ll int m) {
	ll int ans = 1;
	for (ll int i = 0; i < b; i++) {
		ans *= a - i;
		ans %= m;
	}
	for (ll int i = 1; i <= b; i++) {
		ans *= modinv(i, m);
		ans %= m;
	}
	return ans;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}
	int size(int a) {
		return par[root(a)];
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

int main() {
	ll a;
	cin >> a;
	string s="";
	while(a){
		a--;
		s += (a % 26) + 97;
		a /= 26;
	}
	reverse(s);
	cout << s << endl;
	return 0;

}

Measured memory_bytes: 3620
n = gets.to_i

if n == 0 then
	puts 0
	exit
end

remain = []
if n > 0 then
	start = 4
	while n > 0
		remain << n % start
		n = n / start
	end
	remain = remain.map{ |x| [x,0]}.flatten << 0 << 0
else
	mod = n * -1 % (2)
	n = n / (-2)
	start = 4
	while n > 0
		remain << n % start
		n = n / start
	end
	remain = remain.map{ |x| [0,x]}.flatten << 0 << 0
	if mod >= 1 then
		remain[0] += 1
		remain[1] += 1
	end
end

remain.each_with_index{|r, i|
	if r == 2 then
		remain[i] = 0
		remain[i + 1] += 1
		remain[i + 2] += 1
	elsif r == 3 then
		remain[i] = 1
		remain[i + 1] += 1
		remain[i + 2] += 1
	elsif r == 4 then
		remain[i] = 0
		remain[i + 2] += 1
	end
}

print remain.reverse.drop_while{|x| x==0}.join("")

Measured memory_bytes: 1788
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;
		int numD = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();
			numD = scanner.nextInt();

			if (numA + numB == numC + numD) {
				System.out.println("Balanced");
			} else if (numA + numB > numC + numD) {
				System.out.println("Left");
			} else if (numA + numB < numC + numD) {
				System.out.println("Right");
			}

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numN = 0;
		int numA = 0;
		int numB = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();
			numA = scanner.nextInt();
			numB = scanner.nextInt();

			int res = 0;
			for (int i = 1; i <= numN; i++) {

				int wk = 0;
				int tmp = i;
				while (tmp != 0) {
					wk += tmp % 10;
					tmp /= 10;
				}
				if (numA <= wk && wk <= numB) {
					res += i;
				}

			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		long numX = 0;
		long numY = 0;

		try {
			scanner = new Scanner(System.in);
			numX = scanner.nextLong();
			numY = scanner.nextLong();

			long x = numX;
			int res = 0;
			while (x <= numY) {
				x *= 2;
				res++;
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define debug(val) cerr << "The value of " << #val << " is = " << val << '\n';
typedef long long ll;
typedef long double ld;
const ld pi = 4*atan((ld)1);
const ll mod = 1e9 + 7;
const ll inf = 922337203685477;
const ll nax = 0;

ll a, b, c, d;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	cin >> a >> b >> c >> d;
	ll ans = max({a * c, a * d, b * c, b * d});
	cout << ans << '\n';	
}



Measured memory_bytes: 3632
#!/usr/bin/python

ar = []
while True:
  tmp = [int(i) for i in input().split()]
  if tmp == [0,0]:
    break
  else:
    ar.append(tmp)

for i in range(len(ar)):
  for j in range(ar[i][0]):
    for k in range(ar[i][1]):
      print('#', end='' if k !=ar[i][1]-1 else '\n' if j != ar[i][0]-1 else '\n\n')

Measured memory_bytes: 9132
h,w=map(int,input().split())
n=int(input())
a=list(map(int,input().split()))
b=[w*[0]for _ in range(h)]
j=0
for i in range(n):
  for _ in range(a[i]):b[j//w][j%w]=i+1;j+=1
for i in range(h):print(*b[i][::1-2*(i%2)])

Measured memory_bytes: 3912
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const ll mod = 1e9 + 7;
ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}
const int IMAX = 3001;
ll fac[IMAX + 1], ifac[IMAX + 1];
int dp[3001];

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


	fac[0] = 1;
	rep1(i, IMAX) fac[i] = fac[i - 1] * i % mod;
	ifac[IMAX] = modpow(fac[IMAX], mod - 2);
	for (int i = IMAX; i > 0; i--) ifac[i - 1] = ifac[i] * i % mod;

	int N, A, B, C, D;
	scanf("%d %d %d %d %d", &N, &A, &B, &C, &D);
	dp[0] = 1;
	for (int i = A; i <= B; i++) {
		ll ic = modpow(ifac[i], C);
		for (int j = N - i * C; j >= 0; j--) {
			if (dp[j]) {
				int tmp = dp[j] * ic % mod;
				int p = C;
				for (int k = j + i * C; k <= min(j + i * D, N); k += i) {
					dp[k] += tmp * ifac[p++] % mod;
					if (dp[k] >= mod) dp[k] -= mod;
					tmp = tmp * ifac[i] % mod;
				}
			}
		}
	}
	printf("%lld", dp[N] * fac[N] % mod);

	Would you please return 0;
}

Measured memory_bytes: 256
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop,heapify
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

from itertools import accumulate
from functools import lru_cache

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]



class Node:
    def __init__(self,s,e):
        self.start=s
        self.end=e
        self.val = 0
        self.left=None
        self.right=None
 
def build(nums,l,r):
    if l == r:
        temp = Node(l,l)
        temp.val = nums[l]
    else:
        mid=(l+r)>>1
        temp=Node(l,r)
        temp.left=build(nums,l,mid)
        temp.right=build(nums,mid+1,r)
        temp.val = max(temp.left.val,temp.right.val)
    return temp

def update(root,start,value):
    if root.start == start == root.end:
        root.val = value
    elif root.start <= start and root.end >= start:
        update(root.left,start,value)
        update(root.right,start,value)
        root.val = max(root.left.val,root.right.val)





def query(root,start,end):
    if root.start>=start and root.end<=end:return root.val
    elif root.start>end or root.end<start:return -float('inf')
    else:
        temp1 = query(root.left,start,end)
        temp2 = query(root.right,start,end)
        return max(temp1,temp2)
        

    

N = val()
height = li()
beauty = li()

fenwick = build([0] * (N + 1), 0, N)


ans = 0

for i in range(N):
    curr = beauty[i] + query(fenwick, 0, height[i])
    ans = max(ans, curr)
    update(fenwick, height[i], curr)

print(ans)


Measured memory_bytes: 149128
#include <bits/stdc++.h>
 
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	long long int n,k,x;
	vector<long long int> v;
	cin>>n>>k;
	while(n--){
		cin>>x;
		v.push_back(x);
	}
	sort(v.begin(),v.end(),greater<int>());
	if(k>v.size()){
		cout<<0;
	}
	else{
		long long int sum=0;
		for(int j=k;j<v.size();j++){
			sum+=v[j];
		}
		cout<<sum;
	}
    return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
 
#define fi first
#define se second
#define endl '\n'
#define MOD(n,k) ( (n % k) + k ) % k
#define isOn(S, j) (S & (1 << j) )
#define setBit(S, j) (S | (1 << j ) )
#define LSB(S) (S & (-S))
 
int main () {   
    ios_base::sync_with_stdio(0); cin.tie(0);
 
    int x, a, b;
    cin >> x >> a >> b;
    if (abs(x-a) < abs(x-b))
        cout << "A" << endl;
    else
        cout << "B" << endl;
 
    return 0;
}  

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

int main(){
	string s;
	cin >> s;
 
	int n = s.length();
	for (int i = 0; i < n - 1; i++){
		if (s[i] == s[i + 1]){
			cout << i + 1 << " " << i + 2 << "\n";
			return 0;
		}
	}
 
	for (int i = 0; i < n - 2; i++){
		if (s[i] == s[i + 2]){
			cout << i + 1 << " " << i + 3 << "\n";
			return 0;
		}
	}
 
	puts("-1 -1");

	return 0;
}


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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = ll(1e9) + 7;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend())
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
   template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (a == 0) return 0; else if (b % 2 == 0) return (pow((a * a) % m, b / 2, m) % m); else return (pow((a * a) % m, b / 2, m) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

   ll dx[4]={1,0,-1,0};
   ll dy[4]={0,1,0,-1};

ll n;
VVi G;
Vi d;
typedef pair<ll, ll> Result;
Result visit(ll p, ll v, const VVi &g) {
  Result r(0, v);
  for(auto &e : g[v]) if (e != p) {
    Result t = visit(v, e, g);
    t.first ++;
    if (r.first < t.first) r = t;
  }
  return r;
}
ll diameter(const VVi &g) {
  Result r = visit(-1, 0, g);
  Result t = visit(-1, r.second, g);
  return t.first; // (r.second, t.second) is farthest pair
}
int main(){
  cin >> n;
  G.assign(n, Vi());
  REP(i, n - 1){
    ll a, b; cin >> a >> b; a--; b--;
    G[a].pb(b); G[b].pb(a);
  }
  ll D = diameter(G);
  cout << ((D % 3 == 1) ? "Second" : "First") << endl;
}


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

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s[3];
    rep(i, 0, 3) cin >> s[i];
    rep(i, 0, 3) cout << s[i][i];
    cout << endl;
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(N-1):
    minj=i
    for j in range(i+1,N):
        if A[j]<A[minj]:
            minj=j
    A[i],A[minj]=A[minj],A[i]
    if i!=minj:
        cnt+=1
print(*A)
print(cnt)


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

int main()
{
	ll a,b,x,ans;
	cin >> a >> b >> x;
	if(x<b)
	{
		x=x;
	}
	else
	{
		x=b-1;
	}
	ans=(a*x/b)-a*(x/b);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3604
function myout(text){console.log(text);}//standard output
function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	input = input.trim().split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  var len = parseInt(input[0]) - 1;
  var b = input[1].split(" ").map((a)=>Number(a));
  var output = b[0] + b[len - 1];
  for(var i = 0; i < len - 1; i++){
    output += Math.min(b[i], b[i + 1]);
  }
  myout(output);
}

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


Measured memory_bytes: 7372
#include<bits/stdc++.h>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define     __        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define     pi        acos(-1)
#define     ll        long long int
#define     f0(n)     for(int i=0;i<n;i++)
#define     mem(a)    memset(a,0,sizeof(a))
#define     mems(a)   memset(a,-1,sizeof(a))

int main()
{
   /* #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif  */
     __

    ll a,b,c,ans=0;
    cin>>a>>b>>c;
    if(b>=c) ans=b+c;
    else{
        ans=(2*b);
        c=(c-b);
        if(c<=a) ans+=c;
        else ans+=(a+1);
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256