akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
// warm-up
public class Main {

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int H = sc.nextInt(), W = sc.nextInt(), i=0, j=0, n=H;
		char[][] g = new char[H][W];
		int[] row = {-1,1,0,0,-1,-1,1,1};
		int[] col = {0,0,-1,1,-1,1,-1,1};
		while (n-->0) {
			j=0;
			for (char ch : sc.next().toCharArray()) g[i][j++]=ch;
			i++;		
		}
		for (i=0; i<H; i++) {
			for (j=0; j<W; j++) {
				if (g[i][j]=='.') {
					int k = 0, t = 0;
					while (k<8) {
						if (i+row[k]>=0 && i+row[k]<H && j+col[k]>=0 && j+col[k]<W) {
							if (g[i+row[k]][j+col[k]]=='#') t++;
						}
						k++;
					}
					g[i][j] = (""+t).charAt(0);
				}
			}
		}
		for (char[] a: g) {
			for (char ch : a) System.out.print(ch);
			System.out.println();
		}
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}

Measured memory_bytes: 39296
local read = io.read
local N, x = read("*n", "*n")
local a = {}

local sum = 0
for i = 1, N do
	a[i] = read("*n")
	sum = sum + a[i]
end
if sum == x then
	print(N)
	os.exit()
end
sum = nil

local out = 0
table.sort(a)
for i = 1, N do
	local pre_x = x - a[i]
	if pre_x < 0 then
		out = i - 1
		break
	elseif i == N then
		out = N - 1
		break
	end
	x = pre_x
end

print(out)


Measured memory_bytes: 2732
//Date and time of submission: 
 
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=1e5+5;
ll A,B,C,D;
int main() {
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);
	cin>>A>>B>>C>>D;
	ll X=(A+D-1)/D;
    ll Y=(C+B-1)/B;
    if(X>=Y)
    cout<<"Yes\n";
    else
    cout<<"No\n";
	return 0;
}


Measured memory_bytes: 3604
#include <iostream>
#include <string>
#include <numeric>
#include <vector>

using namespace std;


class B {
	int N, M, X;
	vector<int> vec;

public:
	void solve()
	{
		cin >> N >> M >> X;
		vec.resize(N + 1);

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

		int costLeft{ accumulate(vec.begin(), vec.begin() + X, 0) };
		int costRight{ accumulate(vec.begin() + X, vec.end(), 0) };

		cout << ((costLeft < costRight) ? costLeft : costRight) << endl;
	}
};


int main()
{
	B solution;
	solution.solve();

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    for (int i = 0; i < 9; ++i) {
        string s; int a, b;
        cin >> s >> a >> b;
        cout << s << " " << a+b << " " << a*200+b*300 << "\n";
    }
    return 0;
}


Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define CEIL(a, b) ((a - 1) / b + 1)

void solve() {
    int N;
    cin >> N;
    int ans = 0;
    FOR(a, 1, N) {
        int b = (N - 1) / a;
        ans += b;
    }
    cout << ans << endl;
}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}


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

const int N=40;

int main(){
	while(1){
		int a, b, n, x, y;
		long f[17][17];
		
		scanf(" %d %d", &a, &b);
		if(a==0 && b==0) break;
		scanf(" %d", &n);
		
		//入力なしは-1
		for(int i=1; i<=a; ++i)
			for(int j=1; j<=b; ++j)
				f[i][j] = -1;

		//通れないところは0
		for(int i=0; i<n; ++i){
			scanf(" %d %d", &x, &y);
			f[x][y]=0;
		}
		
		
		//端を１で初期化(通れないところを除く)
		bool flag=true;
		for(int i=1; i<=a; ++i){
			if(flag && f[i][1]==-1) f[i][1]=1;
			else{
				flag=false;	
				f[i][1]=0;
			}	
		}
		
		flag=true;
		for(int i=2; i<=b; ++i){
			if(flag && f[1][i]==-1) f[1][i]=1;
			else{
				flag=false;	
				f[1][i]=0;
			}	
		}
		
		//左と下から足していく
		for(int i=2; i<=a; ++i){
			for(int j=2; j<=b; ++j){
				if(f[i][j]==-1){
					f[i][j] = f[i-1][j] + f[i][j-1];
				}
			}
		}
		
		/*
		//confirm
		for(int i=b; i>=1; --i){
			for(int j=1; j<=a; ++j){
				printf("%3ld", f[j][i]);
			}
			printf("\n");
		}
		*/
		
		printf("%ld\n", f[a][b]);
	}
	return 0;
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define per(i, n) for(int i = (n)-1; i >= 0; --i)
#define eee(a) (cerr << (#a) << ": " << (a) << endl);
#define ppp(a) (cout << (a) << endl); 
#define cop(a) for(auto x:(a)){cout << x << endl;}

using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using mint = map<int, int>;

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

constexpr char sp = ' ';
constexpr char cmm = ',';
constexpr int MOD = 1e9+7;
constexpr int INF = 1e9;
constexpr ll LINF = 1e18;
constexpr double phi = (1+sqrt(5))/2;
constexpr double pi = 3.14159265358979323846264338327950288;

ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
inline void Yes(){puts("Yes");}
inline void No(){puts("No");}
inline void Judge(bool b){b?Yes():No();}
inline void YES(){puts("YES");}
inline void NO(){puts("NO");}
inline void JUDGE(bool b){b?YES():NO();}
inline ll powmod(ll b, ll e){ll r=1;while(e>0){if(e&1)r=(r%MOD)*(b%MOD)%MOD;b=(b%MOD)*(b%MOD)%MOD;e>>=1;}return r;}
inline double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}
inline double d2r(double d){return d*pi/180;}
inline double r2d(double r){return r*180/pi;}

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    s<<'[';for(size_t i=0;i<v.size();++i){s << v[i];if(i < v.size()-1) s << ", ";}s<<']';return s;
}
struct __f{
    __f(){
        // comment this out when you use scanf or printf
        // cin.tie(0); ios::sync_with_stdio(0);
        cout<<fixed<<setprecision(15);
    }
};
bitset<100001> dp;
int main(){

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

    dp.set(0);
    
    for(int i = 1; i <= x; ++i){
        for(int y = 100; y <= 105; ++y){
            if(i-y >= 0 and dp.test(i-y)) dp[i] = dp[i] || dp[i-y];
        }
    }

    ppp(dp[x]);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void)
{
    int n,c,A=0,b,a1,b1,A1=100000;
    cin>>n;
    for(int i=0;i<n;i++){
        b1=A1*0.05;
        c=b1;
        b1/=1000;
        a1=b1*1000;
        if(c%1000!=0)a1+=1000;
        A1+=a1;
    }        cout<<A1<<"\n";
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<ll, ll> P;
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; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int h1,m1,h2,m2,k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int a=h1*60+m1;
  int b=h2*60+m2;
  cout << b-a-k<< endl;
  return 0;     
}


Measured memory_bytes: 3688
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    int n, maxint;
    maxint = 0;
    cin >> n;
    map<string,int> s;
    string tmps;
    for(int i=0;i<n;i++){
        cin >> tmps;
        if (s.count(tmps)){
            s[tmps] += 1;
        }else{
            s.insert({tmps, 1});
        }
        if (s[tmps] > maxint){
             maxint = s[tmps];
        }
    }
    vector<string> data;
    //for (const auto& [key, value] : s){
    for (const auto& x : s){

        //cout << key << "  " << value << endl;
        if (x.second == maxint){
            data.push_back(x.first);
        }
    }
    sort(data.begin(), data.end());
    for (int i=0;i<data.size();i++){
        cout << data[i] << endl;    
    }
    return 0;
}


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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    int N;
    cin >> N;
    int a[N + 1];
    for(int i = 1;i <= N;i++) {
        cin >> a[i];
    }
    int M = 0;
    for(int i = N;0 < i;i--) {
        int x = 0;
        for(int j = 2*i;j <= N;j += i) {
            x += a[j];
        }
        a[i] = (a[i] + x)%2;
        if(a[i]) {
            M++;
        }
    }

    cout << M << endl;
    for(int i = 1;i <= N;i++) {
        if(a[i]) {
            cout << i << " ";
        }
    }
    if(M != 0) {
        cout << endl;
    }
    return 0;
}



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

int main(){
  int n;
  cin >> n;
  vector<int>a(n);
  for(int i=0; i<n; ++i){
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  int sum;
  for(int i=0; i<n-1; ++i){
    sum += a[i];
  }
  cout << sum + a[n-1]/2 << endl;
}
  
  

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

int main(){
  char c;
  cin >> c ;
  if(c=='a' || c=='i' || c=='u' || c=='e' || c=='o'){
    cout << "vowel"  <<endl;
  }else{
    cout <<"consonant" <<endl;
  }
  
}


Measured memory_bytes: 3548
#include <iostream>
    #include <sstream>
    #include <iomanip>
    #include <cstdio>
    #include <cstdlib>
    #include <cmath>
    #include <cctype>
    #include <cstring>
    #include <vector>
    #include <list>
    #include <queue>
    #include <deque>
    #include <stack>
    #include <map>
    #include <set>
    #include <algorithm>
    #include <iterator>
    #include <bitset>
    #include <ctime>
    #include <complex>
    using namespace std;
     
    #define FOR(i,a,b) for(LL i = (a); i < (b); i++)
    #define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); i--)
    #define ITER(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
    #define FILL(a, value) memset(a, value, sizeof(a))
     
    #define SZ(a) (int)a.size()
    #define ALL(a) a.begin(),a.end()
    #define MP make_pair
    #define PB push_back
     
    typedef long long LL;
    typedef vector<int> VI;
    typedef pair<int,int> PII;
     
    const double PI = acos(-1.0);
    const int INF = 1000 * 1000 * 1000 + 7;
    const LL LINF = INF * (LL) INF;
     
    const int MAX = 705;
     
     
     
    map<pair<string, string>, int> M;
     
    int main()
    {
    	//freopen("In.txt", "r", stdin);
    	int n;
    	string s;
    	cin >> n >> s;
    	
    	FOR(msk, 0, 1 << n) {
    		string R = "", B = "";
    		FOR(i, 0, n) {
    			if (msk & (1 << i)) R += s[i];
    			else B += s[i];
    		}
    		M[MP(R, B)]++;
    	}
    	
    	LL ans = 0;
    	
    	FOR(msk, 0, 1 << n) {
    		string R = "", B = "";
    		FOR(i, 0, n) {
    			if (msk & (1 << i))R += s[n + n - i - 1];
    			else B += s[n + n - i - 1];
    		}
    		ans += M[MP(R, B)];
    	}
    	
    	cout << ans << endl;
    	
    	return 0;
    }

Measured memory_bytes: 91904
' Imports System.Collections.Generic
' Imports System.Linq
' Imports System.Text
' Imports System.Text.RegularExpressions

Class Main
    Public Shared Sub Main()
        Dim S = Console.ReadLine()
        Dim W = {"Sunny", "Cloudy", "Rainy"}
        Console.WriteLine(W((Array.IndexOf(W, S) + 1) Mod 3))
        Return
    End Sub
End Class

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

using namespace std;

int main()
{
	int n;
  	string s;
  	cin>>n>>s;
  	int cnt=0;
  	for(int i=0;i<s.size();i++)
    {
      if(s[i]=='R')
        cnt++;
    }
  	n=cnt;
  	for(int i=0;i<n;i++)
    {
    	if(s[i]=='R')
          cnt--;
    }
  	cout<<cnt<<endl;
}

Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  vll v(4, 0);
  for (ll i = 0; i < 6; i++) {
    ll a;
    cin >> a;
    v[a - 1]++;
  }
  ll cnt = 0;
  for (ll i = 0; i < 4; i++) {
    if (v[i] == 2) cnt++;
  }
  if (cnt == 2) YES();
  else NO();
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int p[][]=new int [10][10];
		for(int i=1; i<=n; i++) {
			int t = i%10;
			int s = f(i);
			p[s][t]++;
		}
		long ans = 0;
		for(int i=1; i<=n; i++) {
			int t = i%10;
			int s = f(i);
			ans += p[t][s];
		}
		System.out.println(ans);
		sc.close();
	}

	private int f(int x) {
		int b=0;
		while(x != 0) {
			b=x;
			x/=10;
		}
		return b;
	}
}


Measured memory_bytes: 23892
X1,Y1,X2,Y2 = list(map(int,input().split()))

X3 = X2 + -1*(Y2-Y1)
Y3 = Y2 + (X2-X1)
X4 = X3 + -1*(Y3-Y2)
Y4 = Y3 + (X3-X2)
print(X3,Y3,X4,Y4)


Measured memory_bytes: 38256
/*
      Ashraful Islam Paran
      16-September-2020
      12:32:31
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(n) for (int i = 0; i < n; i++)
#define fo(i, x, n) for (int i = x; i < n; i++)
#define fb(i, x, n) for (int i = n - 1; i >= x; i--)
#define w(t)  \
    int t;    \
    cin >> t; \
    while (t--)

typedef unsigned long long ull;
typedef vector<long long> vi;
#define msi map<string, long long>
#define mii map<long long, long long>
const int MX = 2e5 + 5;
const int mod = 1e9 + 7;
const int INF = 1e18;
#define pb push_back
#define endl "\n"
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(x) x.begin(), x.end()
#define ff first
#define ss second


void print(int a[], int n)
{
    for (int i = 0; i < n; i++)
    {
        cout << a[i] << " ";
    }
    cout << endl;
}

void print(vi &v)
{
    f(v.size())
    {
        cout << v[i] << " ";
    }
    cout << endl;
}

int p(int x,int y)
{
    int a=1;
    f(y)
    {
        a=a*x%mod;
    }
    return a;
}

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    // online submission
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin >> n;
    int ans=p(10,n)-2*p(9,n)+p(8,n);
    ans%=mod;
    if(ans<0)
    {
        ans+=mod;
    }
    cout<<ans<<endl;

    cerr << "Time Killed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s\n";
    return 0;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = a; i < b; i++)
#define re(i, n) fo(i, 0, n)
using namespace std;
typedef long long ll;
int main()
{
  int s, w;
  cin >> s >> w;

  if (s > w) cout << "safe" << endl;
  else cout << "unsafe" << endl;

  return 0;
}


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

int main (void){
    int a;
    cin >> a;
    if (a % 2 == 1){
    cout << fixed << setprecision(10) << ((double)a / (double)2 + 0.5 ) / (double)a << endl;
    } else{
    cout << fixed << setprecision(10) << ((double)a / (double)2 ) / (double)a << endl;    
    }
    return 0;
}



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

int N;
vector<int> g[201];
int col[201];
int d[201][201];
bool isBipartite(int u, int c) {
    col[u] = c;
    for (int v : g[u]) {
        if (col[v] == c) return false;
        if (col[v] == 0 and !isBipartite(v, -c)) return false;
    }
    return true;
}

void warshallfloyd() {
    for (int k=0; k<N; ++k) {
        for (int i=0; i<N; ++i) {
            for (int j=0; j<N; ++j) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}

int main() {
    cin >> N;
    fill(d[0], d[201], 1e8);
    rep(i, N) {
        string s;
        cin >> s;
        rep(j, N) {
            int a = s[j]-'0';
            if (a == 1) g[i].push_back(j);
            if (i == j) d[i][j] = 0;
            else {
                if (a == 1) d[i][j] = 1;
            }
        }
    }

    if (!isBipartite(0, 1)) {
        puts("-1");
        return 0;
    }

    warshallfloyd();

    int ma = 0;
    rep(i, N) rep(j, N) if (d[i][j] != 1e8) ma = max(ma, d[i][j]);
    cout << ma + 1 << endl;

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uld = unsigned long long;
const ll mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}
int main(){
    int n;
    cin >> n;
    int high[n];
    rep(i,n) cin >> high[i];
    int max_high = -1;
    int count = 0;
    rep(i,n){
        if(max_high <= high[i]) count++;
        max_high = max(max_high,high[i]);
    }
    cout << count << endl;
}

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

#define PI acos(-1)
#define all(a) a.begin(), a.end()
#define full(a, n) a, a + n
#define ma(type, size) (type *)malloc(sizeof(type) * size)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define f0(i, n) for (i = 0; i < (n); i++)
#define f1(i, n) for (i = 1; i < (n); i++)
#define f1n(i, n) for (i = 1; i <= (n); i++)
#define fab(i, a, b) for (i = (a); i <= (b); i++)
#define fr(i, b, a) for (i = (b); i >= (a); i--)

using namespace std;

/*
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
	tree_order_statistics_node_update> indexed_set;
//*/
typedef long long int ll;
typedef long int lo;

typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tll;

//* utility function
inline bool compare(ll i, ll j)
{
    return i < j;
}
//*/

//* function prototypes
template< typename T>
T gcd(T a, T b);
template< typename T>
T modpow(T number, T power, T mod_value);
//*/

//int row, column;
//int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//int dy[8] = {0, -1, -1, -1, 0, 1, 1, 1};
//int dx[4] = {1,  0, -1, 0};
//int dy[4] = {0, -1,  0, 1};
//ll p2[63] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592, 17179869184, 34359738368, 68719476736, 137438953472, 274877906944, 549755813888, 1099511627776, 2199023255552, 4398046511104, 8796093022208, 17592186044416, 35184372088832, 70368744177664, 140737488355328, 281474976710656, 562949953421312, 1125899906842624, 2251799813685248, 4503599627370496, 9007199254740992, 18014398509481984, 36028797018963968, 72057594037927936, 144115188075855872, 288230376151711744, 576460752303423488, 1152921504606846976, 2305843009213693952, 4611686018427387904};
#ifdef DEBUG
#endif // DEBUG

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ll number_of_test_case = 1, test_case;
    //cin >> number_of_test_case;
    for (test_case = 1; test_case <= number_of_test_case; test_case++)
    {
        ll i, j, n;
        ll arr[3];
        f0(i, 3)cin >> arr[i];

        sort(arr, arr+3);

        ll cnt = 0;

        cnt += (arr[1]-arr[0]+1)/2;
        arr[0] += cnt*2;
        if (arr[0] > arr[1])
        {
            cnt++;
            arr[1] += 1;
            arr[2] += 1;
        }
        cnt += arr[2]-arr[1];

        cout << cnt << endl;

    	//cout << "Test #" << test_case << ": ";
    	//cout << "Case " << test_case << ": ";
    }
    return 0;
}


template< typename T>
T gcd(T a, T b)
{
    if (b == 0)
        return a;
    return gcd(b, a%b);
}
template< typename T>
T modpow(T number, T power, T mod_value)
{
    if (power == 0)
        return 1%mod_value;
    ll u = modpow(number,power/2,mod_value);
    u = (u*u)%mod_value;
    if (power%2 == 1)
        u = (u*number)%mod_value;
    return u;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
long long unsigned int calc(long long unsigned int i){
	if (i==1)return 1;
	return (i * calc( i - 1 )) % (1000000007);
}
int main(){
	int n;
	long long unsigned int ans;
	scanf("%d",&n);
	ans=calc(n);
	printf("%lld",ans);
}


Measured memory_bytes: 1664
#include <stdio.h>          // printf(), getc()
#include <string.h>         // memcpy(), strstr()
 
#define MAX_L 100
const char NUL = '\0';
 
int
main(int argc, char** argv)
{
    char s[2 * MAX_L + 1];
    char t[MAX_L + 1];
    int len1, len2;
    int c;
 
    c = getc(stdin);
    len1 = 0;
    while (c != '\n' && c != EOF)
    {
        s[len1++] = c;
        c = getc(stdin);
    }
 
    c = getc(stdin);
    len2 = 0;
    while (c != '\n' && c != EOF)
    {
        t[len2++] = c;
        c = getc(stdin);
    }
 
    t[len2] = NUL;
    memcpy(&s[len1], s, len2);
    s[len1 + len2] = NUL;
 
    if (strstr(s, t) != NULL)
        printf("Yes\n");
    else
        printf("No\n");
 
    return 0;
}


Measured memory_bytes: 2148
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
typedef long long ll;
const int INF = 1e9;
const ll mod = 1000000007;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a * b / gcd(a, b);}
 
ll pow_kai(ll a, ll n) {
    ll x = 1;
    while(n > 0) {
        if(n&1) {
            x = x*a;
        }
        a = a*a;
        n >>= 1;
    }
    return x;
}


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

    string s;
    cin >> s;
    if (s=="AAA" || s=="BBB") {
        ct("No");
    }
    else {
        ct("Yes");
    }

}

Measured memory_bytes: 256
from decimal import *

A, B ,C = map(int, input().split()) 
A2 = Decimal(str(A ** Decimal("0.5")))
B2 = Decimal(str(B ** Decimal("0.5")))
C2 = Decimal(str(C ** Decimal("0.5")))

#A2 = Decimal(str(A ** float(0.5)))
#B2 = Decimal(str(B ** float(0.5)))
#C2 = Decimal(str(C ** float(0.5)))

#B2 = B ** float(0.5)
#C2 = C ** float(0.5)

#print(A2)
#print(B2)
#print(C2)


if A2 + B2 < C2 :
  print("Yes")
if A2 + B2  >= C2:
  print("No")


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

/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

using namespace std;

typedef long long ll;

ll d, l, r;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> l >> r >> d;
    cout << r / d - (l - 1) / d << "\n";
    return 0;
}


Measured memory_bytes: 3644
import sys
from copy import deepcopy

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def drop(H, W, G):
    for i in range(1, H):
        for j in range(W):
            if G[i][j] == 0 and G[i - 1][j] != 0:
                k = i
                for k in range(i, 0, -1):
                    if G[k][j] != 0:
                        break
                    G[k][j], G[k - 1][j] = G[k - 1][j], 0


def main():
    H, W, K = map(int, readline().split())
    G_init = [list(map(int, row.strip())) for row in readlines()]

    ans = 0
    for i in range(H):
        for j in range(W):
            G = deepcopy(G_init)
            G[i][j] = 0
            drop(H, W, G)

            current_ans = 0
            scale = 1
            while True:
                score = 0
                for row in G:
                    cnt = 1
                    for k in range(1, W):
                        if row[k] == row[k - 1]:
                            cnt += 1
                        else:
                            if cnt >= K and row[k - 1] != 0:
                                score += row[k - 1] * cnt
                                row[k - cnt : k] = [0] * cnt
                            cnt = 1
                    if cnt >= K and row[W - 1] != 0:
                        score += row[W - 1] * cnt
                        row[W - cnt : W] = [0] * cnt

                if score == 0:
                    break

                current_ans += score * scale
                scale *= 2
                drop(H, W, G)

            if current_ans > ans:
                ans = current_ans

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 54236
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	m := make(map[rune]bool)
	for _, v := range s {
		if m[v] {
			fmt.Println("no")
			return
		}
		m[v] = true
	}
	fmt.Println("yes")
}


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

using namespace std;

int n, k, h[100000], dp[100001];

int main(){
	cin >> n >> k;
	for(int i = 0; i < n; ++i) cin >> h[i];
	for(int i = 0; i < n; ++i) dp[i] = INT_MAX;
	dp[0] = 0;
	
	for(int i = 1; i < n; ++i){
		for(int j = i - k; j < i; ++j){
			if(j >= 0){
				dp[i] = min(dp[i], dp[j] + abs(h[i] - h[j]));
			}
		}
	}
	
	cout << dp[n-1] << endl;
}

Measured memory_bytes: 1024
N,M=map(int,raw_input().split())
F=[]
i=1
while i * i <= M:
    if M%i==0:
        F.append(i)
        if i*i!=M: F.append(M/i)
    i+=1

F.sort()    
ans=-1
for k in F:
    if (M/k-N>=0):
        ans=k
print(ans)


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

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

    if (op == "+")
    {
        cout << A + B << endl;
    }
    else if (op == "-")
    {
        cout << A - B << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxN = 100010;
int a[maxN];
int b[maxN];
int c[maxN];
ll ans = 0;

int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++)
	{
		int tmp;
		scanf("%d", &tmp);
		a[tmp]++;
	}
	for (int i = 1; i <= 100000; i++)
	{
		if (a[i] % 2 != 0)
		{
			b[i % m]++;
			a[i]--;
		}
		a[i] /= 2;
		c[i % m] += a[i];
	}
	for (int i = 1; i <= 100000; i++)
		ans += a[i];
	for (int i = 1; i < m; i++)
	{
		if (i + i == m) continue;
		int tmp1 = min(b[i], b[m - i]);
		ans += tmp1;
		b[i] -= tmp1;
		b[m - i] -= tmp1;
		int tmp2 = min(b[i], c[m - i] * 2);
		tmp2 /= 2;
		ans += tmp2;
		b[i] -= 2 * tmp2;
		c[m - i] -= tmp2;
	}
	ans += b[0] / 2;
	if (m % 2 == 0) ans += b[m/2]/2;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
#define PI 3.141592653589793
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}
int gcd(int a, int b){//ユークリッドの互除法
  if (a < b) gcd(b,a); //aの方がbよりでかいのが前提
  if (b == 0) return a; //aをbで割り切れたらreturn
  else gcd(b, a % b);
}
const int INF = 1<<30;
const int MOD = 1000000007;
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};

bool is_prime(ll num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main(){
  int n; cin >> n;
  vector<bool> p(100005,false),like(100005,false);
  vector<int> v(100005,0);

  rep(i,100005){
    if(is_prime(i)) p[i] = true;
  }
  rep(i,100005){
    if(i < 2) continue;
    if(i % 2 == 0) continue;
    if(p[i] && p[(i+1)/2]) like[i] = true; 
  }
  for(int i = 1; i < 100005;i++){
    int tmp = 0;
    if(like[i]) tmp = 1;
    v[i] = v[i-1] + tmp;
  }
  
  rep(i,n){
    int l,r; cin >> l >> r;
    cout << v[r] - v[l-1] << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1024
import java.util.*;
import java.io.*;

class Main {

    public static void main( String[] args ) {

	final Scanner stdin = new Scanner( System.in );

	while ( stdin.hasNextLine() ) {
	    final String input = stdin.nextLine();
	    
	    final boolean winO = win( 'o', input );
	    final boolean winX = win( 'x', input );

	    if ( winO ) {
		System.out.println( 'o' );
	    } else if ( winX ) {
		System.out.println( 'x' );
	    } else {
		System.out.println( 'd' );
	    }
	}	
    }

    static boolean win( char ch, String input ) {

	for ( int i = 0; i < 3; i++ ) {
	    int count = 0;
	    for ( int j = 0; j < 3; j++ ) {
		if ( input.charAt( 3 * i + j ) == ch ) {
		    count++;
		}
	    }
	    if ( count == 3 ) {
		return true;
	    }

	    count = 0;
	    for ( int j = 0; j < 3; j++ ) {
		if ( input.charAt( 3 * j + i ) == ch ) {
		    count++;
		}
	    }
	    if ( count == 3 ) {
		return true;
	    }	    
	}
	
	if ( input.charAt( 3 * 0 + 0 ) == ch &&
	     input.charAt( 3 * 1 + 1 ) == ch &&
	     input.charAt( 3 * 2 + 2 ) == ch ){
	    
	    return true;
	}
	
	if ( input.charAt( 3 * 2 + 0 ) == ch &&
	     input.charAt( 3 * 1 + 1 ) == ch &&
	     input.charAt( 3 * 0 + 2 ) == ch ){
	    
	    return true;		
	}
	return false;
    }
}

Measured memory_bytes: 17156
#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <set>
#include <utility>
#include <vector>
#include <list>
#include <algorithm>
#include <regex>
#include <cmath>
#include <map>
#include <iterator>
#include <climits>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <array>
#include <valarray>
#include <complex>
#include <random>
#include <functional>
#include <cassert>
#include <chrono>
#include <memory>

using namespace std;

#define int long long
//region TEMPLATE
#define double long double
typedef long long ll;
typedef unsigned long long ull;

template<typename T>
void __read(T &a) { cin >> a; }

template<typename T, typename ... Args>
void __read(T &a, Args &... args) {
    cin >> a;
    __read(args...);
}

#define make(t, ...) t __VA_ARGS__; __read(__VA_ARGS__)
#define makev(a, n) VI a(n); FOR(n) cin >> a[i];
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define FORIT(p) for(auto it = p.begin(); it != p.end(); it++)
#define FOR(b) for(signed i = 0; i <(b); i++)
#define FORE(i, l, r) for(int i = (l); i < (r); i++)
#define NFOR(i, n) for(int i = (((int) n)-1); i >= 0; i--)
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<pair<int, int>, int> PPII;
constexpr ll M7 = 1000000007ll;
constexpr ll M9 = 1000000009ll;
constexpr ll MFFT = 998244353ll;
template<class T>
void outv(T &a) { for (auto &x : a) cout << x << ' '; }
static mt19937 rnd(static_cast<unsigned>(chrono::steady_clock::now().time_since_epoch().count())); // NOLINT(cert-err58-cpp)
template<class T>
static auto __super_speed__ = (ios_base::sync_with_stdio(0), cin.tie(
        0)); // NOLINT(cert-err58-cpp,cppcoreguidelines-interfaces-global-init)
//endregion

const int MAXN = 200'000;
const int P = 10000 + rnd() % 1000;
int D[MAXN + 1];

void initial(){
    D[0] = 1;
    for(int i = 1; i <= MAXN; ++i){
        D[i] = (D[i - 1] * P) % M7;
    }
}

VI calc_hash(const VI& a){
    VI h(30);
    for(int b = 0; b < 30; ++b){
        for(int i = 0; i < a.size(); ++i){
            h[b] = (h[b] + ((a[i] >> b) & 1) * D[i]) % M7;
        }
    }
    return h;
}


int32_t main() {
    make(int, n);
    makev(a, n);
    makev(b, n);
    initial();
    auto ha = calc_hash(a);
    auto hb = calc_hash(b);
    int z = accumulate(D, D + n, 0ll) % M7;
    for(int i = 0; i < n; ++i){
        int X = a[i] ^ b[0];
        VI th = ha;
        for(int b = 0; b < 30; ++b){
            if ((X >> b) & 1){
                th[b] = (z - th[b] + M7) % M7;
            }
        }
        if (th == hb){
            cout << i << ' ' << X << '\n';
        }
        for(int b = 0; b < 30; ++b){
            if ((a[i] >> b) & 1){
                ha[b] = (ha[b] + D[i] * (D[n] + M7 - 1)) % M7;
            }
            hb[b] = hb[b] * P % M7;
        }
        z = z * P % M7;
    }

    return 0;
}

Measured memory_bytes: 8192
w, h, n = map(int,input().split())
ls = [[int(i) for i in input().split()] for j in range(n)]

x = list(range(0,w+1))
y = list(range(0,h+1))

for l in ls:
    if len(x)<=1 or len(y)<=1:
        break

    if l[2] == 2:
        x = [i for i in x if i <= l[0]]
    elif l[2] == 1:
        x = [i for i in x if i >= l[0]]
    elif l[2] == 4:
        y = [i for i in y if i <= l[1]]
    elif l[2] == 3:
        y = [i for i in y if i >= l[1]]

if len(x)<=1 or len(y)<=1:
    print(0)
else:
    x = max(x) - min(x)
    y = max(y) - min(y)
    print(x*y)


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

using namespace std;

int main(){
    long N, K;
    cin>>N>>K;
    vector<long> A(N), F(N);
    for(int i=0; i<N; ++i){
        cin>>A[i];
    }
    for(int i=0; i<N; ++i){
        cin>>F[i];
    }
    
    sort(A.begin(), A.end());
    sort(F.begin(), F.end());
    long mmax = 0;
    for(int i=0; i<N; ++i){
        mmax = max(A[i] * F[N-i-1], mmax);
    }

    long l = -1;
    long r = mmax;
    long m;
    while(l+1 < r){
        //cout<<l<<" "<<r<<endl;
        m = (l+r)/2;
        //cout<<m<<endl;
        long sum = 0;
        for(int i=0; i<N; ++i){
            sum += max(long(ceil((A[i] * F[N-i-1] - m)*1.0/F[N-i-1])), long(0));
        }
        if(sum > K){
            l = m;
        }else if(sum <= K){
            r = m;
        }else{
            //cout<<m<<endl;
            //return 0;
        }
    }

    cout<<r<<endl;

    return 0;
}

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		sc.close();
		
		char[] sElem = new char[s.length()];
		for(int i = 0;i < s.length();++i)
			sElem[i] = s.charAt(i);
		char[] tElem = new char[t.length()];
		for(int i = 0;i < t.length();++i)
			tElem[i] = t.charAt(i);
		Arrays.sort(sElem);
		Arrays.sort(tElem);
		
		boolean flag = true;
		for(int i = 0;i < s.length();++i) {
			if(sElem[i] < tElem[t.length()-1-i]) {
				flag = true;
				break;
			} else if(sElem[i] > tElem[t.length()-1-i]) {
				flag = false;
				break;
			} else if(i == t.length()-1) {
				flag = false;
				break;
			}
		}
		if(flag)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
}


Measured memory_bytes: 22356
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll x,c=0,i=0;
    cin>>x;
    ll val=x/500;
    c+=val*1000;
    x=x%500;
    val=x/5;
    c+=val*5;
    cout<<c;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(int (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;
template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
ll pow_mod(ll fi,ll se,ll mod){
  if(se==0){
    return 1;
  }
  if(se%2){
    return pow_mod(fi,se-1,mod)*fi%mod;
  }
  ll t=pow_mod(fi,se/2,mod);
  return t*t%mod;
}
template <class T>
vector<T> getv(ll n){
	vector<T> Vector_temp;
	rep(i,n){
		T input;
		cin >> input;
		Vector_temp.emplace_back(input);
	}
	return Vector_temp;
}
ll gcd(ll c,ll b){
    while(1){
        if(c%b!=0){
        ll tmp=b;
        b=c%b;
        c=tmp;
        }else{
            return b;
        }
    }
}

vector<pair<int,int>> Dir={{-1,0},{1,0},{0,1},{0,-1}};
/* <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3*/



int main(){
  ll n;
  ll ans=0;
  cin>>n;
  for(ll i=1;(i*i)<=n;i++){
    if(n%i==0){
      if((n/i-1)>i){
      ans+=(n/i-1);}
    }
  }
  op(ans);
  return 0;
}

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

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"


template <typename T, typename K> struct P {
	T a; K b;
};

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
vector <P <ll, ll> >prime_factorize( ll N );
ll pow( ll a, ll n );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
int main( void ){
	// initialize();
	int N; cin >> N;
	vector <int> vec( N + 1 ), ans( N + 1, 0 );
	rep( i, 1, N + 1 ){
		cin >> vec[ i ];
	}
	stack <int> st;
	rep_d( i, N + 1, 1 ){
		int cnt = 0, j = 2;
		for(int j = i; j <= N; j += i){
			cnt += ans[ j ];
		}
		if (( cnt % 2 ) != vec[ i ]){
			ans[ i ]++;
			st.push( i );
		}
	}
	cout << st.size() << endl;
	int num = st.size();
	rep( i, 0, num ){
		cout << st.top() << " ";
		st.pop();
	}
	cout << endl;
}

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

/*
 * @fn eratosthenes
 * @brief O(NloglogN)~=(N)
 * @param N: その数まで
 * @return 0 or 1 の配列 (boolは都合が悪い)
 */
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}

/*
 * @fn prime_factorize
 * @brief O(√N): 素因数分解
 * @param N: 素因数分解する数
 * @return vec: (a: 素数, b: 個数)
 */
vector <P <ll, ll> >prime_factorize( ll N ){
	vector <P <ll, ll> > vec;
	int lim = sqrt( N ) + 1;
	rep( i, 2, N + 1 ){
		if (i >= lim){
			vec.push_back( P <ll, ll>{N, 1} );
			break;
		}
		if (N % i == 0){
			vec.push_back( P <ll, ll>{i, 0} );
			while(N % i == 0){
				N /= i;
				vec.back().b++;
			}
		}
	}
	return vec;
}
/*
 * @fn pow
 * @brief a^n
 * @param a: 基数
 * @param n: 指数
 */
ll pow( ll a, ll n ) {
	ll res = 1;
	while (n > 0){
		if (n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

void initialize( void ){
	cout << fixed << setprecision( 10 );
}


Measured memory_bytes: 3072
import java.math.BigInteger;
import java.util.*;

public class Main {
	int INF = 1 << 29;
	
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			int a = sc.nextInt();
			int b = sc.nextInt();
			System.out.println(Math.min(a, b) + " " + Math.max(0, a + b - n));
			
		}
	}


	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

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

}


Measured memory_bytes: 21716
#include<iostream>
using namespace std;
int main(){
	long long n,k;
	int temp,count=0;

	cin >>n >>k;
	for(int i=0;i<n;i++)cin >>temp;
	temp=0;
	if((n-1)%(k-1)==0)count=(n-1)/(k-1);
	else {
		count=(n-1)/(k-1);
		count++;
	}
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stack>
#include <cstdlib>
#include <cstdio>
using namespace std;
stack <int> st;
int solve(string);
int main(){
  string str;
  while(cin>>str){
    if(str=="+"||str=="-"||str=="*"||str=="/")
      st.push(solve(str));
    else st.push(atoi(str.c_str()));
    if(getchar()=='\n'){
      cout << st.top() << endl;
      return 0;
    }
  }
}
int solve(string str){
  int b = st.top(); st.pop();
  int a = st.top(); st.pop();
  if(str=="+")return a+b;
  else if(str=="-")return a-b;
  else if(str=="*")return a*b;
  else if(str=="/")return a/b;
}


Measured memory_bytes: 3172
N, M, X = map(int, input().split())
book_costs = []
book_skills = []
INF = float("inf")

for i in range(N):
    tmp = list(map(int, input().split()))
    book_costs.append(tmp[0])
    book_skills.append(tmp[1:])

res = INF

for i in range(2 ** N):
    cost = 0
    skills = [0] * M
    for j in range(N):
        if ((i >> j) & 1) :
            cost += book_costs[j]
            for k in range(M):
                skills[k] += book_skills[j][k]
    
    if min(skills) >= X:
        res = min(res, cost)

if res == INF:
    print(-1)
else:
    print(res)


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

struct res {
  string s;
  int p, i;
  bool operator<(const res &that) const {
    if (s != that.s) return s < that.s;
    if (p != that.p) return p > that.p;
    return i < that.i;
  }
};

void solve() {
  int n; cin >> n;
  vector<res> r;
  rep(i, n) {
    string s;
    int p;
    cin >> s >> p;
    r.push_back({s, p, i + 1});
  }
  sort(all(r));
  rep(i, n) {
    cout << r[i].i << '\n';
  }
}


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

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

int main() {
    int a;
    string s;
    cin >> a >> s;

    cout << (3200 <= a ? s : "red") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(long long L){
    double x = (double)L / 3.0;
    double ans = x*x*x;
    cout<<setprecision(14)<<ans<<endl;
}

int main(){
    long long L;
    scanf("%lld",&L);
    solve(L);
    return 0;
}


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

#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define rng(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define rbf(i, v) for (auto& (i) : (v))
#define All(x) (x).begin(),(x).end()
#define cAll(x) (x).cbegin(),(x).cend()
#define COL(x) cout << x << endl
#define CO(x) cout << x
//#define int long long

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

const double PI = 3.141592653589793;
const int MOD = 1000000007;
const LL INF64 = INT64_MAX;
const int INF = INT_MAX;

inline constexpr int sqr(int x) { return (x * x); }
inline void printd(double x) { printf("%.10lf\n", x); }
inline void upsort(VI& x) { sort((x).begin(), (x).end()); }
inline void downsort(VI& x) { sort((x).begin(), (x).end(), greater<int>()); }
inline int absdiff(int a, int b) { return (a - b)*(1|((a - b)>>(8*sizeof(int))));}

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

	while (N != 0) {
		if (N % 10 == 7) {
			COL("Yes");
			return 0;
		}
		N /= 10;
	}
	COL("No");
	
	return 0;
}

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

#define io ios::sync_with_stdio(false)
#define pb push_back
#define pqueue priority_queue
#define fi first
#define se second
#define ls rt<<1
#define rs rt<<1|1
#define sz(x) (int)(x).size()
#define dbg(x) cout<<#x<<" --- "<<x<<endl
#define mst(x,a) memset(x,a,sizeof(x))
#define fin(a) freopen(a,"r",stdin)
#define fout(a) freopen(a,"w",stdout)
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll gcd(ll a,ll b){ return b==0?a:gcd(b,a%b); }
ll qpow(ll a,ll b,ll m){ ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r; }
const int inf=0x7fffffff;
const int maxn=4e5+10;
char a[maxn],b[maxn];

int main(){
	io;
	cin>>b;
	int l=200001,r=200000;
	for(int i=0;b[i]!='\0';i++)a[++r]=b[i];
	int q;cin>>q;
	bool f=false;
	while(q--){
		int op;cin>>op;
		if(op==1)f=!f;
		else {
			int x;char s[5];
			cin>>x>>s[0];
			if(f){
				if(x==1)a[++r]=s[0];
				else a[--l]=s[0];
			}
			else {
				if(x==1)a[--l]=s[0];
				else a[++r]=s[0];
			}
		}
	}
	if(f){
		for(int i=r;i>=l;i--)cout<<a[i];
	}
	else {
		for(int i=l;i<=r;i++)cout<<a[i];
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 896