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

using namespace std;

using ll = long long;

const long long MOD = 1e9+7;

#define ALL(A) A.begin(),A.end()

void ALLIN1_NUMBER(vector<ll>& V)
{
    for(auto& x : V)
    {
        cin >> x;
    }
}

void ALLOUT_NUMBER(vector<ll> V)
{
    ll N = V.size();
    for(ll i=0;i<N;i++)
    {
        cout << V[i];
        if(i<N-1) cout << ' ';
    }
    cout << endl;
}


class Mll
{
    public:
    ll x;

    Mll() : x(0){}
    Mll(ll x=0) : x((x%MOD+MOD)%MOD){}

    Mll operator-() const
    {
        return Mll(-x);
    }

    Mll& operator+=(const Mll& A)
    {
        if((x += A.x) >= MOD) x -= MOD;
        return *this;
    }
    Mll& operator-=(const Mll& A)
    {
        if((x += MOD - A.x) >= MOD) x -= MOD;
        return *this;
    }
    Mll& operator*=(const Mll& A)
    {
        (x *= A.x) %= MOD;
        return *this;
    }
    
    Mll operator+(const Mll& A)
    {
        Mll res(*this);
        return res+=A;
    }
    Mll operator-(const Mll& A)
    {
        Mll res(*this);
        return res-=A;
    }
    Mll operator*(const Mll& A)
    {
        Mll res(*this);
        return res*=A;
    }
    
    Mll pow(ll t) const // t乗
    {
        if(t==0) return 1;
        Mll A = pow(t>>1);
        A *= A;
        if(t&1) A *= *this;
        return A;
    }

    // for prime mod
    Mll inv() const
    {
        return pow(MOD-2);
    }
    Mll& operator/=(const Mll& A)
    {
        return (*this) *= A.inv();
    }
    Mll operator/(const Mll& A) const
    {
        Mll res(*this);
        return res/=A;
    }

    friend ostream& operator<<(ostream& os, const Mll& M)
    {
        os << M.x;
        return os;
    }
};

vector<Mll> ALLIN_MLL(ll N)
{
    vector<ll> numbers_ll(N);
    ALLIN1_NUMBER(numbers_ll);

    vector<Mll> numbers_Mll;
    for(ll i=0;i<N;i++)
    {
        Mll add(numbers_ll[i]);
        numbers_Mll.push_back(add);
    }

    return numbers_Mll;
}

ll ceil(ll dividend, ll divisor)
{
    return (dividend + divisor - 1) / divisor;
}

class UnionFind
{
    public:
    vector<ll> par;

    UnionFind(ll n) : par(n,-1){}

    ll root(ll x)
    {
        if(par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool same(ll x, ll y)
    {
        return root(x) == root(y);
    }

    void unite(ll x, ll y)
    {
        x = root(x); y = root(y);
        if(x==y) return;
        if(par[x] > par[y]) swap(x,y);
        par[x] += par[y];
        par[y] = x;
    }

    ll size(ll i)
    {
        return -par[root(i)];
    }
};


static const double pi = acos(-1.0);

double Cos(double D)
{
    return cos(pi/180 * D);
}

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

    if(S=="SSS") cout << "0" << endl;
    if(S=="SSR") cout << "1" << endl;
    if(S=="SRS") cout << "1" << endl;
    if(S=="SRR") cout << "2" << endl;
    if(S=="RSS") cout << "1" << endl;
    if(S=="RSR") cout << "1" << endl;
    if(S=="RRS") cout << "2" << endl;
    if(S=="RRR") cout << "3" << endl;

    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl

int main() {
    int sx, tx, sy, ty; cin >> sx >> sy >> tx >> ty;

    int x1 = tx - sx;
    int y1 = ty - sy;
    int x2 = x1 + 1;
    int y2 = y1 + 1;

    for(int i=0; i<y1; i++){
        cout << "U";
    }

    for(int i=0; i<x1; i++){
        cout << "R";
    }

    for(int i=0; i<y1; i++){
        cout << "D";
    }

    rep(i, x2) cout << "L";
    rep(i, y2) cout << "U";
    rep(i, x2) cout << "R";
    cout << "D";
    cout << "R";
    rep(i, y2) cout << "D";
    rep(i, x2) cout << "L";
    cout << "U";
    
    cout << endl;

}

Measured memory_bytes: 256
max,turaras[100000],times[100000],n,l;

int solve(int i){
	if(times[i]!=0)return times[i];
	int time=0;
	if(turaras[i]<turaras[i-1]&&i>0){
		time=solve(i-1);		
	}
	if(turaras[i]<turaras[i+1]&&i<n-1){
		time=fmax(time,solve(i+1));		
	}	
	return times[i]=time+l-turaras[i];
}

int main(){
	int i;
	scanf("%d%d",&n,&l);
	memset(times,0,sizeof(times));
	for(i=0;i<n;i++){
		scanf("%d",turaras+i);	
	}
	for(i=0;i<n;i++)max=fmax(max,solve(i));	
	max=!printf("%d\n",max);
}

Measured memory_bytes: 1152
using System;
using System.Collections.Generic;

namespace test
{
    class Program
    {

        static void Main(string[] args)
        {
            List<string> resultList = new List<string>();

            string input;
            while ((input = Console.ReadLine()) != null)
            {
                string[] inputArray = input.Split(',');
                List<int> inputList = new List<int>();
                foreach (string s in inputArray)
                {
                    inputList.Add(int.Parse(s));
                }

                int[] numArray = new int[14];
                List<int> pairList = new List<int>();
                List<int> threeList = new List<int>();
                List<int> fourList = new List<int>();
                foreach (int n in inputList)
                {
                    numArray[n]++;
                    switch (numArray[n])
                    {
                        case 2:
                            pairList.Add(n);
                            break;
                        case 3:
                            threeList.Add(n);
                            break;
                        case 4:
                            fourList.Add(n);
                            break;
                    }
                }

                inputList.Sort();
                bool straightFlag = false;

                if (inputList[4] - inputList[0] == 4 ||
                    (inputList[0] == 1 && inputList[1] == 10))
                {
                    straightFlag = true;
                }
                
                if (fourList.Count != 0)
                {
                    resultList.Add("four card");
                }
                else if (threeList.Count != 0 && pairList.Count == 2)
                {
                    resultList.Add("full house");
                }
                else if (pairList.Count == 0 && straightFlag)
                {
                    resultList.Add("straight");
                }
                else if (threeList.Count != 0)
                {
                    resultList.Add("three card");
                }
                else if (pairList.Count == 2)
                {
                    resultList.Add("two pair");
                }
                else if (pairList.Count == 1)
                {
                    resultList.Add("one pair");
                }
                else
                {
                    resultList.Add("null");
                }
            }

            foreach (string s in resultList)
            {
                Console.WriteLine(s);
            }

        }


    }
}

Measured memory_bytes: 5572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll x, y, a;
  in2(x, y);
  a = 1;
  while(x * 2 <= y){
    a++;
    x = x * 2;
  }
  out(a);
  memi;
}

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

int main() {
  int N;
  cin >> N;
  int ori_l, ori_h;
  ori_l = N / 1.08;
  ori_h = (N + 1) / 1.08;
  int ori = 0;
  while (ori_l <= ori_h) {
    int temp =  ori_l * 1.08 ;
    if (temp == N) {
      ori = ori_l;
      break;
    } else {
      ori_l++;
    }
  }
  if (ori == 0) {
    cout << ":(" << endl;
  } else {
    cout << ori << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std; 
int main() 
{
#ifdef ONPC
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);  
  long long a,b;cin>>a>>b;
 long long count=0;
  while(a>0)a/=b,count++;
  cout<<count;
 return 0;
}


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

// GNU C Compiler
//template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }


/*
--------------------------------------------

	type

--------------------------------------------
*/
using LL = long long;
using ULL = unsigned long long;
//using pair<T1, T2> = p12;

/*
--------------------------------------------

	container

--------------------------------------------
*/
#define PB emplace_back
#define MP make_pair 
#define SZ(a) int((a).size())

/*
--------------------------------------------

	repetition

--------------------------------------------
*/
#define REP(n) for(int i=0; i<n; i++)
#define REPj(n) for(int j=0; j<n; j++)
#define REPinit(a,n) for(int i=a; i<n; i++)
#define REPinitj(a,n) for(int j=a; j<n; j++)

//algorithm
//#define SORT(c) sort((c).begin(),(c).end())

/*
--------------------------------------------

	constant

--------------------------------------------
*/
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

/*

	Optimizer

*/
//#pragma GCC optimize("Ofast")

#define DIVISION (LL)1000000007

int main(int argc, char const *argv[]) {
  /* code */
  int N;
  cin >> N;

  LL power = 1;

  for (int i = 0; i < N; i++)
  {
    power *= (i+1);
    power %= DIVISION;
  }
  
  cout << power << endl;

  return 0;
}


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

const double PI  = 3.141592653589793238463;

int main() {
    vector<char> v(10);
    int last = 0;
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '0'){
            v[last] = '0';
            last++;
        }
        if(s[i] == '1'){
            v[last] = '1';
            last++;
        }
        if(s[i] == 'B' && last > 0){
            last--;
        }

    }
    for(int i = 0; i < last; i++){
        cout << v[i];
    }
    
        
    cout << endl;
}


Measured memory_bytes: 256
#import<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long LL;
LL i,j,k,m,n,x,y,z,a[200040];
main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>k;
	for(;i++<n;)cin>>a[i];
	for(i=k;i++<n;)
	{
		if(a[i]>a[i-k])cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

Measured memory_bytes: 5212
import scala.io.StdIn
object Main {
    def main(args: Array[String]): Unit = {
        val len = StdIn.readInt()
        val arr = StdIn.readLine().split(" ").map(_.toInt)
       insertionSort(len, arr)
    }
    def insertionSort(len: Int, arr: Array[Int]) = {
        println(arr.mkString(" "))
        for (seek <- (1 until len)) {
            val v = arr(seek)
            var ptr = seek - 1
            while (ptr >= 0 && arr(ptr) > v) {
                arr(ptr + 1) = arr(ptr)
                ptr -= 1
            }
            arr(ptr + 1) = v
            println(arr.mkString(" "))
        }
    }
}


Measured memory_bytes: 45552
#!/user/bin/python
# coding: UTF-8

N = str(raw_input())
N_list = list(N)

if N_list[0] == N_list[1] and N_list[0] == N_list[2]:
    ans = 'Yes'
elif N_list[1] == N_list[2] and N_list[1] == N_list[3]:
    ans = 'Yes'
else:
    ans = 'No'

print ans

Measured memory_bytes: 2568
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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; }


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    ll n;
    cin>>n;
    vector<ll> a(n);
    rep(i,n){
        cin>>a[i];
    }
    ll ans=0;
    
    while(1){
        vector<ll> b=a;
        ll s=0;
        rep(i,n){
            s+=a[i]/n;
        }
        if(s==0){
            cout<<ans<<endl;
            return 0;
        }
        ans+=s;
        rep(i,n){
            b[i]=a[i]%n+s-a[i]/n;
        }
        swap(a,b);
    }
    return 0;
}


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

#define INF 1 << 30
typedef long long ll;

ll dfs(string s);

ll N;

int main(){
  cin >> N;
  cout << dfs("") << endl;  
}

ll dfs(string s){ //文字列sで始まるN以下の七五三数の個数
  ll ret = 0;  
  if (s!="" && stoll(s) > N) {
    return 0;
  }
  if (s.find('3')!=string::npos && s.find('5')!=string::npos && s.find('7')!=string::npos) ret++;//七五三数なら＋１する
  ret += dfs(s+'3');
  ret += dfs(s+'5');
  ret += dfs(s+'7');
  return ret;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Program
{
    void Calc()
    {
        var sc = new Scanner();

        int x = sc.NextInt();
        int sam = x;
        sam *= x;
        sam *= x;
        Console.WriteLine(sam);
            
    }

    static void Main()
    {
        new Program().Calc();
    }

    class Scanner
    {
        string[] s = new string[0];
        int i = 0;
        char[] cs = new char[] { ' ' };

        public string Next()
        {
            if (i < s.Length) return s[i++];
            s = Console.ReadLine().Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return s[i++];
        }
        public int NextInt() { return int.Parse(Next()); }
        public long NextLong() { return long.Parse(Next()); }
        public double NextDouble() { return double.Parse(Next()); }
    }
}

Measured memory_bytes: 5608
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+5;
const int inf=0x3f3f3f3f;
int a[maxn];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++)
	{
		if(i%2==1&&a[i]%2==1)
			ans++;
	}
	cout<<ans<<endl;
	return 0;
}




Measured memory_bytes: 3648
#include <iostream>

using namespace std;

int main () {
  int w;

  while(cin >> w){
    bool space = false;

    for(int r = 0; r < 10; r++){
      if(w >> r & 1 == 1) {
        if(space)
          cout << ' ';
        else
          space = true;
        cout << (1 << r);
      }
    }

    cout << endl;
  }

}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
#define ld long double
#define ll long long
#define st first
#define nd second
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define pb push_back
using namespace std;

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n;
	cin>>n;
	vector<ll> a(n);
	for(int i=0; i<n; ++i) {
		cin>>a[i];
	}
	sort(a.rbegin(), a.rend());
	int cnt = n - 2;
	ll ans = a[0];
	for(int i=1; i<n; ++i) {
		if(cnt) {
			ans += a[i];
			cnt--;
		}
		if(cnt) {
			ans += a[i];
			cnt--;
		}
	}
	cout<<ans;
}


Measured memory_bytes: 4780
n = int(input())
inf = [list(map(int, input().split())) for i in range(n)]
inf = sorted(inf, key=lambda x : x[2])
x, y , h = inf[-1]
for cx in range(100, -1, -1):
    for cy in range(100, -1, -1):
        H = h + abs(cx - x) + abs(cy - y)
        if H < 1:
            continue
        for x1, y1, h1 in inf:
            if not h1 == max(H - abs(cx - x1) - abs(cy - y1), 0):
                break
        else:
            print(cx, cy, H, sep=' ')
            exit()

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// head

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

    int n;
    cin >> n;
    cout << (1000 - n % 1000) % 1000 << endl;
    return 0;
}


Measured memory_bytes: 3656
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<map>
using namespace std;

inline int read(){
	int x;char c;
	while((c=getchar())<'0'||c>'9');
	x=c-48;
	while((c=getchar())>='0'&&c<='9')x=x*10+c-48;
	return x;
}

int n,m;
map<int,int> a;

int main(){
	n=read();
	for(int i=1;i<=n;++i)
		++a[read()];
	m=read();
	for(int i=1;i<=m;++i){
		int x=read();
		if(a[x])
			--a[x];
		else{
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}

Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n , k ;
int memo[1001][1001];
ll doo (int last , int i )
{
    if( i == n ) return 1 ;
    ll ans =  0 ;
    if(memo[i][last] != -1 ) return memo[i][last] ;
    for(int j= 1 ; j <= k ; j++)
    {
        if(last != j)
           ans+= doo(j , i+1);
    }
    return memo[i] [last] = ans ;
}

int main()
{
	int x;
	set<int> s;
	for(int i = 0;i < 3; i++)
	{
	    
	cin >> x;
	s.insert(x);
	
	}
	cout << s.size() << endl;
}






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

int main(){
  using namespace std;
  long long n;
  cin>>n;
  long long temp = n;
  vector<long long> primes;
  vector<long long> es;
  for(long long i = 2; i <= 1000000; i++){
    if(!prime_(i)) continue;
    if(temp % i != 0) continue;
    primes.push_back(i);
    long long cnt = 0;
    while(temp % i == 0){
      temp /= i;
      cnt++;
    }
    es.push_back(cnt);
  }
  if(temp > 1){
    primes.push_back(temp);
    es.push_back(1);
  }
  int m = primes.size();
  long long ans = 0;
  REP(i, m){
    long long t = (long long)sqrt(2 * es[i]) - 1;
    while((t + 2) * (t + 1) <= 2 * es[i]) t++;
    ans += t;
  }
  cout << ans << endl; 
  return 0;
}

Measured memory_bytes: 3732
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#include <bitset>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main() {
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int i, n, d;
	cin >> n;
	vector<int> a(n);
	for (i = 0; i < n; i++) cin >> a[i];
	sort(full(a));
	if (n % 2 == 0) {
		for (i = 1; i < n; i += 2) {
			if (a[i - 1] != i || a[i] != i) {
				cout << 0 << endl;
				return 0;
			}
		}
	}
	else {
		if (a[0] != 0) {
			cout << 0 << endl;
			return 0;
		}
		for (i = 2; i < n; i += 2) {
			if (a[i - 1] != i || a[i] != i) {
				cout << 0 << endl;
				return 0;
			}
		}
	}
	d = 1;
	for (i = 0; i < n / 2; i++) {
		d *= 2;
		d %= PRIME;
	}
	cout << d << endl;
	return 0;
}


Measured memory_bytes: 640
a, b, k = map(int, input().split())
ans = set()
for i in range(a,a+k):
    if i <= b:
        ans.add(i)
for i in range(b-k+1,b+1):
    if i >= a:
        ans.add(i)
ans = list(ans)
ans.sort()
for i in range(len(ans)):
    print(ans[i])
    

Measured memory_bytes: 3064
#include <iostream>
#include <set>
using namespace std;
int main()
{
  int t,n,k,p,q;
  cin >> t;
  while(t--){
    cin >> n >> k;
    multiset<int,greater<int> > s;
    cin >> p;
    while(--n){
      cin >> q;
      s.insert(q - p);
      p = q;
    }
    while(--k && !s.empty()){
      s.erase(s.begin());
    }
    multiset<int>::iterator it = s.begin();
    while(it != s.end()){
      n += *it;
      it++;
    }
    cout << n << endl;
  }
  return 0;
}

Measured memory_bytes: 0
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func stringLineScan() string {
	sc.Scan()
	return sc.Text()
}

var ans int

func main() {
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(stringLineScan())
	ans := n
	for i := 0; i <= n; i += 9 {
		x, y := (n-i)/6*6, (n-i)%6
		a := strconv.FormatInt(int64(i), 9)
		b := strconv.FormatInt(int64(x), 6)
		for _, s := range a {
			t, _ := strconv.Atoi(string(s))
			y += t
		}
		for _, s := range b {
			t, _ := strconv.Atoi(string(s))
			y += t
		}
		if ans > y {
			ans = y
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1280
#include <iostream>
using namespace std;
int main(){
  long long a, b, k;
  cin >> a >> b >> k;
  if(a < k){
    k -= a;
    a = 0;
    b -= k;
    if(b < 0){
      b = 0;
    }
  }else{
    a -= k;
  }
  cout << a  << " " << b << endl;
  return 0;
}


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

int N,RB='R'+'B';

string reply;
char getreply(){
	cin >> reply;
	return reply[0];
}

void sendquestion(int s){
	int i;
	cout << "?";
	for(i=0; i<N; ++i){
		cout << " " << s+i;
	}
	cout << endl; cout.flush();
}

char c,ans[225];

int main(void){
	int i,j,p,l,r,m;
	cin >> N;
	l = 1; r = N+1;
	sendquestion(1); c = getreply();
	while(r-l>1){
		m = (l+r)/2;
		sendquestion(m);
		if(c == getreply()){
			l = m;
		}else{
			r = m;
		}
	}
	p = l;
	for(i=p; i<=p+N; ++i){
		cout << "?";
		for(j=p; j<=p+N; ++j){
			if(i==j){
				continue;
			}
			cout << " " << j;
		}
		cout << endl; cout.flush();
		ans[i-1] = RB-getreply();
	}
	for(i=1; i<=N*2; ++i){
		if(p<=i && i<=p+N){
			continue;
		}
		cout << "?";
		for(j=1; j<=p; ++j){
			if(i==j){
				continue;
			}
			cout << " " << j;
		}
		for(j=p+N; j<=N*2; ++j){
			if(i==j){
				continue;
			}
			cout << " " << j;
		}
		cout << endl; cout.flush();
		ans[i-1] = RB-getreply();
	}
	cout << "! ";
	for(i=0; i<N*2; ++i){
		cout << ans[i];
	}
	cout << endl; cout.flush();
	return 0;
}


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

int main (){
	int n,x,total=0,count = 1,l;
	cin>>n>>x;
	
	while (cin>>l){
		total += l; 
		if (x>=total)
			count++;
	}
	cout<<count<<'\n';
	return 0 ;
	
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i, m, n) for (int i = (m); (i) < (n); ++(i))
using namespace std;
template <class T>
void setmax(T &a, T const &b) {
    if (a < b) a = b;
}

template <class T>
void setmin(T &a, T const &b) {
    if (a > b) a = b;
}

template <typename T, typename X>
auto vectors(T a, X x) { return vector<T>(x, a); }

template <typename T, typename X, typename Y, typename... Zs>
auto vectors(T a, X x, Y y, Zs... zs) {
    auto cont = vectors(a, y, zs...);
    return vector<decltype(cont)>(x, cont);
}

// 実は、連続に並んだ二匹が狼/羊かを決めると、他は一意に決まるのでは？
// それで、矛盾なくできるか検証しよう

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

    vector<int> res(N);
    bool flg = false;
    for (int bit = 0; bit < (1 << 2); ++bit) {
        res[0] = (bit & 1) ? 1 : 0;
        res[1] = ((bit >> 1) & 1) ? 1 : 0;
        repeat_from(j, 2, N) {
            if (res[j - 1]) {
                if (S[j - 1] == 'o') {
                    res[j] = res[j - 2];
                } else {
                    res[j] = !res[j - 2];
                }
            } else {
                if (S[j - 1] == 'o') {
                    res[j] = !res[j - 2];
                } else {
                    res[j] = res[j - 2];
                }
            }
        }
        // N-1 と 0で矛盾がないか検証
        if (res[N - 1]) {
            if (S[N - 1] == 'o' && res[0] != res[N - 2]) continue;
            if (S[N - 1] == 'x' && res[0] == res[N - 2]) continue;
        } else {
            if (S[N - 1] == 'x' && res[0] != res[N - 2]) continue;
            if (S[N - 1] == 'o' && res[0] == res[N - 2]) continue;
        }
        if (res[0]) {
            if (S[0] == 'o' && res[1] != res[N - 1]) continue;
            if (S[0] == 'x' && res[1] == res[N - 1]) continue;
        } else {
            if (S[0] == 'x' && res[1] != res[N - 1]) continue;
            if (S[0] == 'o' && res[1] == res[N - 1]) continue;
        }
        flg = true;
        break;
    }

    if (flg) {
        for (int i = 0; i < N; ++i) {
            cout << (res[i] ? 'S' : 'W');
        }
        cout << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3824
#include <bits/stdc++.h>
 
using namespace std;
 
string query(int x) {
  cout << x << endl;
  fflush(stdout);
  string res;
  cin >> res;
  if (res == "Vacant") {
    exit(0);
  }
  return res;
}
 
int main() {
  int n;
  cin >> n;
  int i = 0;
  int j = n - 1;
  string x = query(0);
  string y = query(n - 1);
  while (true) {
    int k = (i + j) >> 1;
    string z = query(k);
    if ((z == x) != (i % 2 == k % 2)) {
      j = k;
      y = z;
    } else {
      i = k;
      x = z;
    }
  }
  return 0;
}

Measured memory_bytes: 852
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin>>s;
  int cnt=0;
  for(auto c:s)if(c=='p')cnt++;
  cout<<(int)s.length()/2-cnt<<endl;
  return 0;

}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i,i0,n) for(int i=i0;i<n;++i)
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define INF12 1000000000000 //10^12
#define INF9 1000000000 //10^9
#define MOD 10000007 //10^9+7

int N,L;
vector<string> S;
string ans = "";

int main() {
    cin >> N >> L;
    rep(i,0,N) {
        string s;
        cin >> s;
        S.push_back(s);
    }
    sort(ALL(S));
    for(auto v:S){
        ans += v;
    }
    cout << ans << endl;
    return 0;
}

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

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


Measured memory_bytes: 3100
<?php


$values=trim(fgets(STDIN));

$values=explode(" ",$values);

if($values[0]<$values[1]){
    if($values[1]<$values[2]){
        echo "Yes","\n";
    }else{
        echo "No","\n";
    }
}else{
    echo "No","\n";
}


?>


Measured memory_bytes: 9188
#include <stdio.h>

int main(void) {
	int i, n, a[101];
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
	}
	for (i = 0; i < n; i++)
	{
		printf("%d", a[n - i - 1]);
		if (i + 1 == n) break;
		else printf(" ");
	}
	printf("\n");
	return 0;
}


Measured memory_bytes: 2112
//code written by a living bruh moment
import java.io.*;
import java.lang.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.util.Random;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int n = in.nextInt();
        int m = in.nextInt();
        for(int i = 1; i<=3; i++){
            if(n!=i && m!=i){
                out.println(i);
            }
        }
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong()
        {
            return Long.parseLong(next());
        }
        public double nextDouble()
        {
            return Double.parseDouble(next());
        }
        public String nextLine()
        {
            try
            {
                return reader.readLine();
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
            return null;
        }
        public boolean hasNext()
        {
            String next=null;
            try
            {
                next=reader.readLine();
            }
            catch(Exception e)
            {
            }
            if(next==null)
            {
                return false;
            }
            tokenizer=new StringTokenizer(next);
            return true;
        }
    }
}

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

int main()
{
	ios_base::sync_with_stdio(NULL);
	cin.tie(NULL);
	cout.tie(NULL);
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5])
		cout << "Yes";
	else
		cout << "No";
	return 0;
}


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

int main(void){
  int w, h, n;
  int x, y, a;
  int white;
  int xmin = 0, ymin = 0;
  int xmax, ymax;

  cin >> w >> h >> n;

  xmax = w;
  ymax = h;

  for (int k = 0; k < n; k++){
    cin >> x >> y >> a;
    if ((a == 1) && (xmin < x)) xmin = x;
    else if ((a == 2) && (xmax > x)) xmax = x;
    else if ((a == 3) && (ymin < y)) ymin = y;
    else if ((a == 4) && (ymax > y)) ymax = y;
  }

  white = max(0, (xmax - xmin)) * max(0, (ymax - ymin));

  if (white <= 0) cout << 0 << endl;
  else cout << white << endl;

  return 0;
}

Measured memory_bytes: 256
/* Knapsack Again:

    Here, 1 <= N <= 100;
          1 <= W <= 10^9;
          1 <= w[i] <= W;
          1 <= v[i] <= 10^3;

    Maxm possible value is 10^5;
    so we make dp[i]: what is the minimum weight required for the i value.
*/

#include<bits/stdc++.h>
using namespace std;
const int inf=0x3f3f3f3f;

const int V=100005;
int main(){
    int N,W;
    cin>>N>>W;
    int w[N],v[N];
    for(auto i=0;i<N;++i){
        cin>>w[i]>>v[i];
    }

    int dp[V];
    memset(dp,inf,sizeof(dp));
    dp[0]=0;
    for(auto i=0;i<N;++i){
        for(auto j=100000;j>=v[i];j--){
            dp[j]=min(dp[j],dp[j-v[i]]+w[i]);
        }
    }

    int ans;
    for(auto i=100000;i>=0;--i){
        if(dp[i]<=W){
            ans=i;
            break;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  sort(a.begin(), a.end());
  cout << a[a.size()-1] - a[0] << endl;
  return 0;
}

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

using namespace std;

#define mod 1000000007
#define inf 1e18
#define ll long long
#define PI 3.1415926536

void printString(long long n)
{
  char str[1000];
  int i = 0;

  while (n > 0) {

    int rem = n % 26;

    if (rem == 0) {
      str[i++] = 'z';
      n = (n / 26) - 1;
    }
    else
    {
      str[i++] = (rem - 1) + 'a';
      n = n / 26;
    }
  }
  str[i] = '\0';

  reverse(str, str + strlen(str));
  cout << str << endl;

  return;
}

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


  long long n;
  cin >> n;
  printString(n);

  return 0;
}

Measured memory_bytes: 3612
//#pragma GCC optimize("03", "unroll-loops")
//#pragma GCC target("avx2")

#include <bits/stdc++.h>

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define FOR(i,n) for(i=0;i<n;i++)
#define FORn(i,j,n) for(i=j;i<n;i++)
#define pb push_back
#define unique_sort(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define vprint(v) for(auto t:v)cout<<t<<" "
#define endl "\n"

using namespace std;

typedef long long int lli;
typedef long int li;
typedef vector<lli> vli; 
typedef vector<int> vi; 
typedef vector<string> vs; 


const lli mod=1000000007;
const lli limit=1000000;


void fc(lli &x)
    {
        bool neg=false;
        register char c;
        x =0;
        c=getchar();
        if(c=='-')
        {
            neg = true;
            c=getchar();
        }
        for(;(c>47 && c<58);c=getchar())
            x = (x<<1) + (x<<3) +c -48;
        if(neg)
            x *=-1;
    }

int main() {

    fast()
    lli n,q,t;
    lli temp,temp1,temp2,temp3;
    lli i,j,k;
    string str;
    cin>>n;
    temp=0;
    for(i=1;i<=n;i++){
        if(i%3==0 || i%5==0)continue;
        temp+=i;
    }
    cout<<temp<<endl;
 
}

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

int main() {
    int H,W,p = 0;
    bool out = true;
    char A;
    cin >> H >> W;
    for(int i = 0;i < H;i++) {
        for(int t = 0;t < W;t++) {
            cin >> A;
            if(out) {
                if(t < p) {
                    if(A == '#') {
                        out = false;
                        break;
                    }
                    continue;
                }
                if(A == '#') {
                    p = t;
                }
            }
        }
    }
    cout << (out ? "Possible" : "Impossible") << endl;
}

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

map<char, int> mp;
string C = "ixcm";

int main() {
	mp['m'] = 3;
	mp['c'] = 2;
	mp['x'] = 1;
	mp['i'] = 0;
	int N;
	cin >> N;
	for (int t = 0; t < N; t++) {
		string S, T;
		cin >> S >> T;
		int A[4] = {}, B[4] = {};
		for (int i = 0; i < S.size();) {
			if ('2' <= S[i] && S[i] <= '9') {
				A[mp[S[i + 1]]] = S[i] - '0';
				i += 2;
			}
			else {
				A[mp[S[i]]] = 1;
				i += 1;
			}
		}
		for (int i = 0; i < T.size();) {
			if ('2' <= T[i] && T[i] <= '9') {
				B[mp[T[i + 1]]] = T[i] - '0';
				i += 2;
			}
			else {
				B[mp[T[i]]] = 1;
				i += 1;
			}
		}
		for (int i = 0; i < 4; i++) {
			A[i] += B[i];
			if (A[i] >= 10) A[i] -= 10, A[i + 1]++;
		}
		string ANS = "";
		for (int i = 3; i >= 0; i--) {
			if (A[i] == 0) continue;
			else if (A[i] == 1) ANS += C[i];
			else {
				ANS += '0' + A[i];
				ANS += C[i];
			}
		}
		cout << ANS << endl;
	}
}


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

using namespace std;

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

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

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

    vvi dp(s.size(),vi(t.size(),0));

    rep(i,s.size()){
        if(s[i]==t[0]){
            dp[i][0] = 1;
            repa(j,i+1,s.size()){
                dp[j][0] = 1;
            }
            break;
        }
    }

    rep(i,t.size()){
        if(s[0]==t[i]){
            dp[0][i] = 1;
            repa(j,i+1,t.size()){
                dp[0][j] = 1;
            }
            break;
        }
    }

    repa(i,1,s.size()){
        repa(j,1,t.size()){
            if(s[i]==t[j]){
                // cout<<s[i]<<endl;
                dp[i][j] = dp[i-1][j-1] + 1;
            }else{
                if(dp[i-1][j] > dp[i][j-1])
                    dp[i][j] = dp[i-1][j];
                else
                    dp[i][j] = dp[i][j-1];
            }
            // cout<<"dp["<<i<<"]["<<j<<"] = "<<dp[i][j]<<endl;
        }
    }

    string ans="";

    int i=s.size()-1,j=t.size()-1;
    while(dp[i][j]>0){
        // cout<<"dp["<<i<<"]["<<j<<"] = "<<dp[i][j]<<endl;
        if(s[i]==t[j]){
            ans = s[i] + ans;
            //ans[0] = ;
            if(dp[i][j]==1){
                break;
            }
            i--;
            j--;
        }else if(i==0){
            j--;
        }else if(j==0){
            i--;
        }else if(dp[i-1][j] > dp[i][j-1]){
            i--;
        }else{
            j--;
        }
    }

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

Measured memory_bytes: 35584
for(;~scanf("%d",&n),n;printf("%d\n",r))
    for(r=0;n;n--){
      scanf("%d%d%d%d",&x,&y,&z,&w),l=x+y+z;
      if(l<=60&&w<=2)r+=600;
      else if(l<=80&&w<=5)r+=800;
      else if(l<=100&&w<=10)r+=1000;
      else if(l<=120&&w<=15)r+=1200;
      else if(l<=140&&w<=20)r+=1400;
      else if(l<=160&&w<=25)r+=1600;
    }
  return 0;
}

Measured memory_bytes: 0
using System;
using System.Linq;

namespace ABC132
{
    class D2
    {
        static long[,] c;
        static long mod = 1000000007;
        static void Main(string[] args)
        {
            //input
            var nk = Console.ReadLine().Split().Select(long.Parse).ToArray();
            var n = nk[0]; var k = nk[1];
            init(n);
            //for i: 0 - k
            //n-k_C_i * n-1_C_i
            for (long i = 1; i <= k; i++)
            {
                if (n - k + 1 < i) Console.WriteLine(0);
                else Console.WriteLine((CalcCombination(n - k + 1, i) * CalcCombination(k - 1, i - 1)) % mod);
            }
        }

        public static long[,] init(long x)
        {
            c = new long[x + 5, x + 5];
            c[0, 0] = 1;
            for (long i = 1; i <= x; i++)
            {
                for (long j = 0; j <= i; j++)
                {
                    if (j == 0) c[i, j] = c[i - 1, j];
                    else c[i, j] = (c[i - 1, j] + c[i - 1, j - 1]) % mod;
                }
            }
            return c;
        }

        public static long CalcCombination(long n, long k)
        {
            return c[n, k];
        }

    }
}


Measured memory_bytes: 44244
import heapq


def min_mp_to_one(C):
    # calculate minimum magical power to change number to 1
    INF = 10**4
    min_mp = [INF for _ in range(len(C))]
    min_mp[1] = 0
    frontier = [(0, 1)]  # (mp, number)
    while len(frontier) > 0:
        mp, n = heapq.heappop(frontier)
        for next_n in range(len(C)):
            if next_n == n:
                continue
            if min_mp[next_n] > mp + C[next_n][n]:
                # use C[next_n][n] (not C[n][next_n])
                # because this procedure starts from 1 (opposite direction)
                min_mp[next_n] = mp + C[next_n][n]
                heapq.heappush(frontier, (min_mp[next_n], next_n))
    return min_mp


def main():
    H, W = list(map(int, input().split(' ')))
    C = [list(map(int, input().split(' '))) for _ in range(10)]
    A = [list(map(int, input().split(' '))) for _ in range(H)]
    min_mp = min_mp_to_one(C)
    ans = 0
    for h in range(H):
        for w in range(W):
            if A[h][w] == -1:
                continue
            ans += min_mp[A[h][w]]
    print(ans)


if __name__ == '__main__':
    main()


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

using namespace std;

#define FOR(i,s,e) for(int i=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp make_pair
#define mt make_tuple
#define t0(t) get<0>((t))
#define t1(t) get<1>((t))
#define t2(t) get<2>((t))

typedef long long ll;

int main() {
  string s;
  cin >> s;
  int n = (int)s.size();
  ll res = 0;
  REP(i,(1<<(n-1))) {
    ll t = 0, d = 0;
    REP(j,n) {
      d = d*10 + (s[j]-'0');
      if (j == n-1 || (i & (1<<j))) {
        t += d;
        d = 0;
      }
    }
    res += t;
  }
  fprintf(stdout, "%lld\n", res);
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int ans = Math.max(a * b, c * d);
        System.out.println(ans);
        sc.close();
    }
}

Measured memory_bytes: 23124
// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
//
// See the bottom of file for solution.
// -----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (N, A, B) = read!(usize, usize, usize);
    println!("{} {}", min(N, min(A, B)), max(N, A + B) - N);
}


Measured memory_bytes: 4352
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4")
#include<bits/stdc++.h>

#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi 3.1415926535897932
#define eps 0.000001

//#define int ll

using namespace std;

int n, m, k;

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

    for(int i = 0;i < s.size();i++)
    {
        if (s[i] == '9')
            s[i] = '1';
        else
            s[i] = '9';
    }

    cout << s;

    return 0;
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
typedef long long ll;

ll n,a[200000],b[200000];

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

	cin>>n;
	REP(i,n) cin>>a[i];
	REP(i,n) cin>>b[i];

	int ans=0;
	REP(i,30) {
		int c[n],cnt=0,mod=(1<<i);
		REP(j,n) c[j]=b[j]%(2*mod);
		sort(c,c+n);
		REP(j,n) {
			int tar=a[j]%(2*mod);
			if(tar<mod) cnt+=lower_bound(c,c+n,mod-tar)-c;
			cnt+=(lower_bound(c,c+n,3*mod-tar)-lower_bound(c,c+n,2*mod-tar));
		}
		if((n*n-cnt)&1) ans|=mod;
	}
	cout<<ans<<endl;

	return 0;
}


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

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

using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;

int main(int, char**)
{
    int a;
    cin >> a;

  	cout << a + a*a + a*a*a << endl;

    return 0;
}

Measured memory_bytes: 3644
#ABC 135, B
n = int(input())
P = [int(el) for el in input().split(' ')]

count = 0
for p, q in zip(P, range(1,n+1)):
    if p != q:
        count += 1

if count == 0 or count == 2:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 2940
n=int(input())
ina=list(map(int,input().split()))
a=[]
cnt=0
mi=9999999999
for i in range(n):
  tmp=ina[i]
  a.append(abs(tmp))
  if tmp<0:
    cnt+=1
  if mi>abs(tmp):
    mi=abs(tmp)
if cnt%2==0:
  print(sum(a))
else:
  print(sum(a)-mi*2)


Measured memory_bytes: 14224
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=2019;
int main()
{
	ll l,r;
	ll sum;
	sum=0x3f3f3f3f;
	scanf("%lld%lld",&l,&r);
	if(r-l>=2019)
	{
		printf("0\n");
	}
	else
	{
		for(ll i=l;i<=r;i++)
		{
			for(ll j=i+1;j<=r;j++)
			{
				if(sum>(i*j%mod))
				{
					sum=i*j%mod;
				}
			}
		}
		printf("%lld\n",sum);
	}
	return 0;
 } 

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

typedef long long ll;

#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define FORR(i,a,b) for(ll i=b-1;i>=a;i--)

#define vl vector<ll>
#define pll pair<ll,ll>

#define DEBUG(x) cout<<#x<<": "<<x<<endl

using namespace std;
/*}}}*/

int main() {
  ll a;
  string b;
  cin >> a >> b;
  ll BASE = 100;
  ll bl = 0;
  bl += (ll)(b[0]-'0')*100;
  bl += (ll)(b[2]-'0')*10;
  bl += (ll)(b[3]-'0')*1;
  ll ai = a/BASE;
  ll aj = a%BASE;
  ai *= bl;
  aj *= bl;
  aj /= BASE;
  ll ans = ai+aj;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3624
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import sys


def solve(n,y):
  for a in range(n+1):
    for b in range(n+2-a):
      if a+b > n:
        continue
      sm = 10000*a + 5000*b + 1000*(n-a-b)
      if sm == y:
        print(a,b,n-a-b)
        return
  print(-1,-1,-1)
  return

N,Y = map(int, input().split())
solve(N,Y)


Measured memory_bytes: 39536
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]
a = set(a)

dp = [0]*(N+100)
for i in range(N+1):
  if i == 0:
    dp[i] = 1
    continue
  if i in a:
    continue
  elif i-1 in a:
    dp[i] = dp[i-2]
  elif i-2 in a:
    dp[i] = dp[i-1]
  elif i-1 in a and i-2 in a:
    break
  else:
    dp[i] = dp[i-1] + dp[i-2]
  dp[i] = dp[i]%(7+10**9)
    
print(dp[N]%(7+10**9))

Measured memory_bytes: 13216