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

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++) 
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = int(1e9) + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 200 * 1000 + 13;

int n, a, b, c, d;
string s;

bool read () {
	if (scanf("%d%d%d%d%d", &n, &a, &b, &c, &d) != 5)
		return false;
	static char buf[N];
	scanf("%s", buf);
	s = buf;
	--a, --b, --c, --d;
	return true;
}

bool can(int x, int y){
	fore(i, x, y)
		if (s[i] == '#' && s[i + 1] == '#')
			return false;
	return true;
}

void solve() {
	if (!can(b, d) || !can(a, c)){
		puts("No");
		return;
	}
	if (c < d){
		puts("Yes");
		return;
	}
	fore(i, max(0, b - 1), min(n - 2, d)){
		if (s[i] == '.' && s[i + 1] == '.' && s[i + 2] == '.'){
			puts("Yes");
			return;
		}
	}
	puts("No");
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
	
	int tt = clock();
#endif
	
	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

#ifdef _DEBUG
	while(read()) {	
#else
	if(read()) {
#endif
		solve();
		
#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}

Measured memory_bytes: 764
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int n, m;
vector<string> a;
int ans = 100100100;

int main(){
	scanf("%d %d", &n, &m);
	for(int i=0; i<n; i++){
		char t[m+1];
		scanf("%s", t);
		a.push_back(t);
	}

	for(int i=0; i<n-2; i++){
		for(int j=1; i+j<n-1; j++){
			for(int k=1; i+j+k<n; k++){
				int t = 0;
				for(int ii=0; ii<n; ii++){
					char s[2];
					if(ii <= i) s[0] = 'W';
					else if(ii <= i+j) s[0] = 'B';
					else s[0] = 'R';
					for(int jj=0; jj<m; jj++){
						if(a[ii][jj] != s[0]) t++;
					}
				}
				ans = min(ans, t);
			}
		}
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 2836
n=int(input())
csf=[list(map(int,input().split())) for _ in range(n-1)]
for i in range(n):
    t=0
    for j in range(i,n-1):
        c,s,f=csf[j]
        if t<s:
            t=s
        elif t%f>0:
            t+=f-t%f
        t+=c
    print(t)

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

int getmd(int a,int b,int c,int d){
    return abs(a-c)+abs(b-d);
}

int main(){
    int d;
    cin >> d;
    cout << d*d*d << endl;
    
    return 0;
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc106/tasks/abc106_b
#include <bits/stdc++.h>
using namespace std;
using P = pair<double, int>;
#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()

// 約数の列挙
vector<int64_t> divisor(int64_t n) {
    vector<int64_t> ret;
    for (int64_t i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n)
                ret.push_back(n / i);
        }
    }
    sort(begin(ret), end(ret));
    return (ret);
}

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, cnt = 0;
    cin >> n;
    if (n < 105) {
        cout << "0\n";
        return 0;
    } else {
        for (int i = 105; i <= n; i += 2) {
            auto t = divisor(i);
            if (t.size() == 8) {
                cnt++;
            }
        }
    }
    cout << cnt << endl;

    return 0;
}


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

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define all(v) (v).begin(),(v).end()

const int MOD = 1000000007;
const int N = 100005;
const double PI =4*atan(1);

ll dp[2][N];
ll w[105];
ll v[105];
ll n,W;


int main(){
    ios::sync_with_stdio(0);
    //freopen("baklava.in","r",stdin);
    cin.tie(0);
    cout.tie(0);
    //start
    cin >> n>> W;
    for(int i=0;i<n;i++){
    	cin >> w[i] >> v[i];
    }
    for(int i=0;i<=(ll)1e5;i++){
    	dp[0][i]=1e18;
    	dp[1][i]=1e18;
    }
    dp[0][0]=0;
    for(int i=1;i<=n;i++){
    	ll pos=i&1;
    	for(int j=0;j<=1000*i;j++){
    		dp[pos][j]=dp[pos^1][j];
    		//cout << v[i-1]<< endl;
    		if(j>=v[i-1] && dp[pos^1][j-v[i-1]]<1e18)dp[pos][j]=min(dp[pos][j],dp[pos^1][j-v[i-1]]+w[i-1]);
    	}
    }
    ll ans=0;
    for(int i=0;i<=(ll)1e5;i++){
    	//cout << dp[n&1][i] << endl;
    	if(dp[n&1][i]<=W){ans=i;}
    }
    cout << ans;

    return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>

int main(void)
{
  int n;
  scanf("%d", &n);
  long h[n];
  for (int i = 0; i < n; i++){
    scanf("%ld", &h[i]);
  }
  
  int max = 0, len = 0;
  for (int i = 1; i < n; i++){
    if (h[i - 1] >= h[i]) len++;
    else{
      if (len > max) max = len;
      len = 0;
    }
  }
  if (len > max) max = len;
  
  printf("%d", max);
  return 0;
}

Measured memory_bytes: 896
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <random>
#include <tuple>
#include <iomanip>
#include <cstring>

using namespace std;

typedef long long ll;
//typedef pair<int,int> Pint;
//typedef pair<ll, ll> P;
//typedef pair<ll, pair<ll, ll>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define revrep(i, n) for(ll i = (n-1); i >= 0; i--)
#define pb push_back
#define f first
#define s second
//const ll INFL = 1LL << 60;//10^18 = 2^60
const ll INFL = 1LL << 60;
const int INF = 1 << 30;//10^9
ll MOD = 1e9 + 7;
//ll MOD  = 998244353;
vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};

ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}
ll pow_mod(ll x, ll k){
  x %= MOD; x += MOD; x %= MOD;
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}
ll inverse(ll x){return pow_mod(x, MOD - 2);};

//最大公約数
ll gcd(ll a, ll b){
    if(b == 0) return a;
    return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll x, ll y){return x / gcd(x, y) * y;};

ll kai_mod(ll x){
  if(x == 0) return 1;
  return x * kai_mod(x-1) % MOD;
}

//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAXcomb; i++){
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
ll comb(int n, int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * finv[k] % MOD * finv[n-k] % MOD;
}


ll solve(ll l, ll r, vector<ll> &A){
  ll res = 0;
  ll mid = (l+r)/2;
  if(r - l == 1) return res;
  res += solve(l, mid, A);
  res += solve(mid, r, A);
  vector<ll> B;
  ll x = l, y = mid;
  while(x < mid || y < r){
    ll bs = B.size();
    if(x == mid){
      B.pb(A[y++]);
    }else if(y == r){
      res += bs - x + l;
      B.pb(A[x++]);
    }else{
      if(A[x] <= A[y]){
        res += bs - x + l;
        B.pb(A[x++]);
      }else{
        B.pb(A[y++]);
      }
    }
  }
  for(ll i = l; i < r; i++) A[i] = B[i-l];
  return res;
}


int main(void){
  ll N;
  cin >> N;
  vector<ll> A(N);
  rep(i, N) cin >> A[i];

  cout << solve(0, N, A) << endl;
  

}



Measured memory_bytes: 7536
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    }};

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input! {
        n: usize,
        h: [i64; n],
    }
    let mut dp = vec![0; n];
    for i in 1 .. n {
        let mut mi = dp[i - 1] + (h[i] - h[i - 1]).abs();
        if i >= 2 {
            mi = min(mi, dp[i - 2] + (h[i] - h[i - 2]).abs());
        }
        dp[i] = mi;
    }
    puts!("{}\n", dp[n - 1]);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 10620
#include <iostream>
#include <cstring>
#include <vector>
#include <map>
#include <string>
#include <algorithm>

 
using namespace std;

typedef long long ll;
typedef long double ld;
#define L(ID) ((ID*2)+1)
#define R(ID) ((ID*2)+2)
#define M(L,R) ((L+R)/2)
#define forr(start,end) for(int i = start; i < end; i++)
#define gap ' '
 
const int MAXN = 1e5 + 5;

ll largest(ll a, ll b){
	return (a<b)?b:a;
}
ll smallest(ll a, ll b){
	if(a < b)return a;
	return b;
}

int main(){
	int c[3][3];
	int a[3];
	int b[3];
	for(int i = 0; i < 3; ++i){
		for(int j = 0; j < 3; ++j){
			cin >> c[i][j];
		}	
	}
	for(a[0] = 0; a[0] <= 100; a[0]++){
		for(a[1] = 0; a[1] <= 100; a[1]++){
			for(a[2] = 0; a[2] <= 100; a[2]++){
				b[0] = c[0][0] - a[0];
        		b[1] = c[0][1] - a[0];
        		b[2] = c[0][2] - a[0];
        		bool correct = true;
        		for(int i = 0; i < 3; ++i){
        			for(int j = 0; j < 3; ++j){
        				if(c[i][j] != a[i] + b[j]){
        					correct = false;
        				}
         			}
        		}
        		if(correct){
        			cout << "Yes" << endl;
        			return 0;
        		}
			}
		}
	}
	cout << "No" << endl;

    return 0;
}


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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
    vector<ll>a(3);
    ll sum=0;
    for (int i = 0; i < 3; ++i) {
        cin >>a[i];sum+=a[i];
    }
    if(sum>=22)puts("bust");
    else puts("win");
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define ll long long
int main(){
    int x=0,xmax=0;
    int n,i;
    cin >> n;
    string s;
    cin >> s;
    for(i=0;i<n;i++){
      if(s[i]=='I')x++;else x--;
      xmax=max(x,xmax);
    }
    cout << xmax;
    return 0;
}


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

class modint {
  public:
    using ll = long long;
    ll num;
    static const ll MOD = 998244353;
    static vector<modint> factorial;

    modint(): num(0) {};
    modint(ll n_): num((n_ + MOD) % MOD) {}
    modint(const modint &r): num(r.num) {}
    // operator ll() const { return (num+MOD)%MOD; }
    operator ll() const { return num; }
    friend istream& operator>>(istream& is, modint &r){
        ll num_;
        is >> num_;
        r = num_;
        return is;
    }

    template <typename T>
    modint operator+(const T &r) const { return modint(num + (ll)r); }
    template <typename T>
    modint operator-(const T &r) const { return modint(num - (ll)r); }
    template <typename T>
    modint operator*(const T &r) const { return modint(num * (ll)r); }
    template <typename T>
    modint operator/(const T &r) const { return num * pow(r, MOD-2); }

    template <typename T>
    modint operator+=(const T &r) { return *this = *this + r; }
    template <typename T>
    modint operator-=(const T &r) { return *this = *this - r; }
    template <typename T>
    modint operator*=(const T &r) { return *this = *this * r; }
    template <typename T>
    modint operator/=(const T &r) { return *this = *this / r; }

    static modint pow(const modint &x, const ll &r) {
        if(r == 0) return 1;
        return pow(x*x, r/2) * modint(r&1 ? x : modint(1));
    }

    static modint fact(int n){
        if((int)factorial.size() <= n) {
            int size = factorial.size();
            factorial.resize(n+1);
            for (int k = size; k <= n; k++) {
                factorial[k] = factorial[k-1] * k;
            }
        }
        return factorial[n];
    }

    static modint C(int n, int r){
        return n >= r ? fact(n)/(fact(n-r)*fact(r)) : modint(0);
    }
};
vector<modint> modint::factorial = {1};
#define fact(n) modint::fact(n)
#define C(n,r) modint::C(n,r)
#define H(a,b) C(a+b, a)


int main(void){
    int n;
    cin >> n;
    modint sum = 0;
    for (int i = n/2+1; i <= n; i++) {
        sum += C(n,i) * modint::pow(2,n-i) * 2;
    }
    cout << modint::pow(3,n) - sum << endl;
    return 0;
}


Measured memory_bytes: 117504
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    if 13 <= A:
        print(B)
    elif 6 <= A <= 12:
        print(int(B / 2))
    elif A <= 5:
        print(0)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <cmath>
#include <climits>

int main () {
  int n;
  std::cin >> n;
  std::vector<int> a;
  for (int i = 0; i < n; i++)
  {
    int an;
    std::cin >> an;
    a.push_back(an);
  }
    long int ans = LONG_MAX;
    for (int i = -100; i < 101; i++)
    {
      long int sum = 0;
      for (int j = 0; j < n; j++)
      {
        sum += (i - a[j]) * (i - a[j]);
      }
      if (ans > sum) {
        ans = sum;
      }
    }
    std::cout << ans << "\n";
}

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

/*
void func(vector<bool> flag, double tmp, double x, double y)
{
    bool f = true;
    for(int i = 0; i < N; i++)
    {
        if(flag[i] == true) f = false;
    }
    if(f == true)
    {
        sum += tmp;
        return;
    }

    for(int i = 0; i < N; i++)
    {
        if(flag[i] == true)
        {
            double nx = p[i].first;
            double ny = p[i].second;
            tmp += (double)sqrt(pow(abs(nx-x),2)+pow(abs(ny-y),2));
            flag[i] = false;
            func(flag, tmp, nx, ny);
            flag[i] = true;
        }
    }
}
*/

int main()
{
    int N;
    cin >> N;
    vector<pair<double,double>> p(10);
    vector<int> idx;
    for(int i = 0; i < N; i++) idx.push_back(i);
    
    double sum = 0;
    vector<bool> flag(10, true);
    for(int i = 0; i < N; i++)
    {
        double x, y;
        cin >> x >> y;
        p[i] = make_pair(x, y);
    } 

    /*
    for(int i = 0; i < N; i++)
    {
        double x = p[i].first;
        double y = p[i].second;
        flag[i] = false;
        func(flag, 0.0, x, y);
        flag[i] = true;
    }
    */
    int a = 0;
    do
    {
        //cout << "---" << endl;
        for(int i = 0; i < N-1; i++)
        {
            //cout << p[i].first << " " << p[i].second << endl;
            double x = p[idx[i]].first;
            double y = p[idx[i]].second;
            double nx = p[idx[i+1]].first;
            double ny = p[idx[i+1]].second;
            sum += (double)sqrt(pow(abs(nx-x),2)+pow(abs(ny-y),2));
        }
        //cout << p[N-1].first << " " << p[N-1].second << endl;
    } while (next_permutation(idx.begin(), idx.end()));
    /*
    for(int i = 0; i < N-1; i++)
    {
        double x = p[i].first;
        double y = p[i].second;
        double nx = p[i+1].first;
        double ny = p[i+1].second;
        sum += (double)sqrt(pow(abs(nx-x),2)+pow(abs(ny-y),2));
    }
    */
    
    double kai = 1;
    for(int i = 1; i <= N; i++) kai *= (double)i;
    double ans = sum / kai;
    printf("%.10lf\n", ans);

    return 0;
}

Measured memory_bytes: 256
import numpy as np

MOD = 1000000007

def count_inv2(a):
    count = 0
    prev = a[a.shape[0] - 1]
    m = 1
    for j in range(a.shape[0] - 2, -1, -1):
        if prev > a[j]:
            count += m * (j + 1)
            prev = a[j]
            m = 1
        else:
            m += 1
    return count


def count_inv(a):
    count = 0
    for i in range(len(a)):
        for j in range(i + 1, len(a)):
            if a[i] > a[j]:
                count += 1
    return count


stdin = open(0, 'rb')
N, K = map(int, stdin.readline().split())
A = np.fromstring(stdin.readline(), dtype=np.int64, sep=' ')
x = count_inv(A)
y = count_inv2(np.sort(A))
ans = (K * x + K*(K - 1) // 2 * y) % MOD
print(ans)


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

int main() {
  string S,T;
  cin>> S >> T;
  sort(S.begin(),S.end());
  sort(T.begin(),T.end());
  reverse(T.begin(),T.end());
  if(S < T) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

#include <set>
#include <map>
#include <iomanip>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define all(x) (x).begin(),(x).end()

using ll = long long;

int main()
{
	int r;
	cin >> r;

	cout << r * 2 * 3.141592 << endl;

	return 0;
}


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

//解説参照
int main() {
	int n, k;
	cin >> n >> k;
	int a[100000];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	int x = 300000000;
	for (int i = 0; i < n - k + 1; i++) {
		int p = abs(a[i]) + abs(a[i] - a[i + k - 1]);
		int q = abs(a[i + k - 1]) + abs(a[i] - a[i + k - 1]);

		if (x > p) x = p;
		if (x > q) x = q;
	}

	cout << x << endl;

	return 0;
}

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

public class Main {

    public static void main(String[] args) throws InterruptedException {

        // 入力を取得
        Scanner sc = new Scanner(System.in);

        // 人数
        String str = sc.next();

        // スキャナーを閉じる
        sc.close();

        // 合計計算
        ArrayList<String> list = new ArrayList<String>();
        for (int i = 0; i < str.length(); i++) {
            // 文字列を取得
            if ("B".equals(Character.toString((str.charAt(i))))) {
                // 文字列がある場合は削除
                if (!list.isEmpty()) {
                    // 最後の文字を取り除く
                    list.remove(list.size() - 1);
                }
            } else {
                // 文字列を追加
                list.add(Character.toString(str.charAt(i)));
            }
        }

        // 文字出力
        String output = "";

        for (String obj : list) {
            output = output.concat(obj);
        }

        System.out.println(output);
    }
}


Measured memory_bytes: 8660
#include <iostream>
#include <string>
#include <math.h>

using namespace std;

int main(void)
{
    long long int sum=0,range=0,a1,b1,a2,b2;
    double ans=0.0,half;
    long long int m,n,o,i,j,k=0,money;
    //vector <int> v;
    //float f,g,h;
    //int c,d,big=0;
    string s,s1;
    cin>>s>>s1;
    cout<<s1<<s;
    return 0;
}





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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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

const int INF = 1e9;
const int MOD = 1e9 + 7;

int extGCD( int a, int b, int& x, int& y ){
    if( b != 0 ){
        int d = extGCD( b, a % b, y, x );
        y -= a / b * x;
        return d;
    }else{
        x = 1, y = 0;
        return a;
    }
}

signed main(){
    int a, b; cin >> a >> b;
    int x, y;
    extGCD( a, b, x, y );
    cout << x << " " << y << endl;
}


Measured memory_bytes: 3100
#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;



int main()
{
   
    int a, b;
    cin >> a >> b;
    int t = 0;
    while (a > 0) {
        t++;
        a -= b;
    }

    cout << t << endl;

    return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <queue>

using namespace std;
typedef long long ll;
#define MAX_N 200000
int L;
vector<ll> arr;
ll C1[MAX_N+10], C2[MAX_N+10], C3[MAX_N+10];
ll ans = 0, sum = 0;

struct S{
	S(int idx, ll data) : idx(idx), data(data) {}
	int idx;
	ll data;
	bool operator <(const S &a)const{
		return data<a.data;
	}
};
priority_queue<S> pq;

int main(){
	scanf("%d", &L);
	for(int i=0; i<L; i++){
		ll x;
		scanf("%lld", &x); arr.push_back(x);
		sum+=x;
	}ans = sum;
	for(int i=0; i<=L; i++){
		if(i==0)	C1[i] = 0;
		else{
			if(arr[i-1]==0){
				C1[i] = max((ll)0, C1[i-1]-2);
			}else{
				C1[i] = C1[i-1]+arr[i-1]-(arr[i-1]%2);
			}
		}
	}
	for(int i=L; i>=0; i--){
		if(i==L)	C2[i] = 0;
		else{
			if(arr[i]==0){
				C2[i] = max((ll)0, C2[i+1]-2);
			}else{
				C2[i] = C2[i+1]+arr[i]-(arr[i]%2);
			}
		}
	}
	for(int i=0; i<L; i++){
		if(arr[i]==0){
			C3[i] = -1;
		}else{
			C3[i] = arr[i] - ((arr[i]+1)%2);
		}
	}
	ll sum2 = 0;
	for(int i=0; i<=L; i++){
		pq.push({i, sum2+C2[i]});
		if(i!=L){
			sum2+=C3[i];
		}
	}
	sum2 = 0;
	for(int i=0; i<=L; i++){
		while(pq.top().idx<i)	pq.pop();
		ll now = C1[i] + pq.top().data - sum2;
		ans = min(ans, sum-now);
		if(i!=L){
			sum2+=C3[i];
		} 
	}
	/**for(int i=0; i<=L; i++){
		printf("%lld %lld %lld\n", C1[i], C2[i], C3[i]);
	}*/
	printf("%lld", ans);
	return 0;
}

Measured memory_bytes: 12656
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n,g=0,q=1000;
	cin>>n;
	int a[n+1];
	for(int i=1; i<=n; i++)	
		cin>>a[i];
	for(int i=1; i<n; i++)
	{
		if(a[i+1]>=a[i])
		{
			g+=q/a[i];
			q%=a[i];
		}
		else
		{
			q+=g*a[i];
			g=0;
		}
	}
	cout<<q+g*a[n];
	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++ )
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    int suma = 0;
    int sumb = 0;
    rep(i,n) cin >> a.at(i);
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    for(int i = 0;i<n; i += 2) suma += a.at(i);
    for(int i = 1; i < n; i+= 2) sumb += a.at(i);
    cout << suma - sumb << endl;
}

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

using namespace std;

int main()
{
    long long a,b,k,t,o;
    cin>>a>>b>>k;
    if(a>=k)
    {
        t=a-k;
        o=b;
    }
    else if(a<k&&a+b>=k)
    {
        t=0;
        o=b-(k-a);
    }
    else
    {
        t=0;
        o=0;
    }
    cout<<t<<" "<<o<<'\n';
    return 0;

}


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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

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 C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define MAX_N 100000
i64 N;
i64 A[MAX_N + 1]; // i-th cityにいるモンスターの数
i64 B[MAX_N]; // i-th 勇者が倒せるモンスターの数


i64 solve() {
  i64 cnt = 0;
  i64 num_killed;
  REP(i, N + 1) {
    if (i > 0) {
      num_killed = min(A[i], B[i-1]);
      cnt += num_killed;
      A[i] -= num_killed;
    }
    if (i < N) {
      num_killed = min(A[i], B[i]);
      cnt += num_killed;
      B[i] -= num_killed;
    }
  }
  return cnt;
}


int main() {
  cin >> N;
  REP(i, N + 1) {
    cin >> A[i];
  }
  REP(i, N) {
    cin >> B[i];
  }

  i64 cnt = solve();
  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 1792
n = int(input())
li = [int(input()) for _ in range(5)]

minMove = min(li)

import math
ans = math.ceil(n / minMove) + 4
# 4 5本の道があって、ボトルネックでかかる時間＋それ以外の経路にかかる時間
print(ans)


Measured memory_bytes: 2940
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

namespace TOPSIC
{
	public class Program
	{
		/// <summary>
		/// ABC 102
		/// </summary>
		public static void Main()
		{
			int n = int.Parse(ReadLine());
			var list = ReadLine().Split().Select(x => int.Parse(x))
				.ToList();

			// 高速化のために、累積和を先に求めておく
			var sum = new List<double>();
			sum.Add(list[0]);
			for(int i = 1; i<n; i++)
			{
				sum.Add(sum[i - 1] + list[i]);
			}

			// 目的は左右の合計の差の最小値を探すこと。
			double min = double.MaxValue;
			var list2 = new double[4];
			int leftIndex = 0;
			int rightIndex = 2;
			// 中央の区切り
			for (int i = 2; i < n - 1; i++)
			{
				// 左の区切り
				while (leftIndex < i
					&& Math.Abs(sum[i - 1] - 2 * sum[leftIndex + 1])
					 < Math.Abs(sum[i - 1] - 2 * sum[leftIndex]))
				{
					leftIndex++;
				}
				while (rightIndex < n - 1
					&& Math.Abs(sum[n - 1] - 2 * sum[rightIndex + 1] + sum[i - 1])
					< Math.Abs(sum[n - 1] - 2 * sum[rightIndex] + sum[i - 1]))
				{
					rightIndex++;
				}

				list2[0] = sum[leftIndex];
				list2[1] = sum[i - 1] - sum[leftIndex];
				list2[2] = sum[rightIndex] - sum[i - 1];
				list2[3] = sum[n - 1] - sum[rightIndex];
				var m = list2.Max() - list2.Min();
				if(m < min)
				{
					min = m;
				}
			}

			WriteLine(min);
		}
	}
}


Measured memory_bytes: 34576
//ここで手段を選ばないゲスな精神が？
//b11が遅いのはブレ？

//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();

	int A[1001][1000];
	rep1(i, N) {
		rep(j, N - 1) A[i][j] = getint();
		A[i][N - 1] = 0;
	}
	int* k[1001];
	rep1(i, N) k[i] = A[i];
	int k2[1001] = {};
	k2[0] = 1e9;
	vector<int> V;
	rep1(i, N) V.pb(i);

	int kotae = 0;
	while (V.size() && kotae < 80000) {
		kotae++;
		vector<int> kari;
		for (auto v : V) {
			if (k2[v] < kotae) {
				int a = *k[v];
				if (k2[a] < kotae && *k[a] == v) {
					kari.pb(v);
					k[v]++;
					k2[v] = kotae;
					kari.pb(a);
					k[a]++;
					k2[a] = kotae;
				}
			}
		}
		swap(V, kari);
	}

	int OK = 1;
	rep1(i, N) if (k[i] - A[i] != N - 1) OK = 0;
	if (kotae == 80000) printf("%d", N* (N - 1) / 2);
	else if (!OK) printf("-1"); 
	else printf("%d", kotae - 1);

	Would you please return 0;
}

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

int main() {
  int n,ans;
  cin >> n;
  ans = 0;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  
  int i=0;
  while(i<n){
    if(i==0 || vec.at(i) != vec.at(i-1)){
      int f=1;
      int k=i+1;
      while(k<n && vec.at(i) == vec.at(k)){
        f++;
        k++;
      }
      ans += f%2;
    }
    i++;
  }
  
  cout << ans << endl;
}

      


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

#define pb push_back
#define mp make_pair
#define clr(a, b) memset((a), (b), sizeof(a))
#define gcd(a, b) __gcd(a, b)

typedef unsigned int UI;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> pii;

const int mod = 1e9 + 7;
const int N = 2e5 + 10;
const int L = 30;

int n, t;
LL sum[N];
struct Pair{
	LL a, b;
	Pair(){}
	Pair(LL a, LL b):a(a),b(b){}
	bool operator < (const Pair &A)const{
		return A.a * (b + 1) + A.b < a * (A.b + 1) + b;
	}
};
vector<Pair> V;
vector<LL> G;

LL dp[N][L];

int main(){
	LL a, b;
	scanf("%d %d", &n, &t);
	for(int i=0; i<n; i++){
		scanf("%lld %lld", &a, &b);
		a++;
		if(a == 1){
			G.pb(b);
		} else {
			V.pb(Pair(a, b));
		}
	}

	sort(V.begin(), V.end());
	sort(G.begin(), G.end());

	for(int i=0; i<L; i++){
		dp[0][i] = t + 1;
	}
	dp[0][0] = 0;

	int m = V.size();
	for(int i=1; i<=m; i++){
		for(int j=L-1; j>0; j--){
			dp[i][j] = min(dp[i-1][j], (dp[i-1][j-1] + 1) * V[i-1].a + V[i-1].b);
		}
		dp[i][0] = dp[i-1][0];
	}

	sum[0] = 0;
	for(int i=0; i<G.size(); i++){
		sum[i+1] = sum[i] + G[i] + 1;
	}

	n = G.size() + 1;

	int ans = 0;
	for(int i=0; i<L; i++){
		if(dp[m][i] > t)	continue;
		int j = upper_bound(sum, sum+n, t - dp[m][i]) - sum;
		ans = max(ans, j + i - 1);
	}

	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 50924
def judge_lie(n): return sum([abs(n + 1 -2*i) for i in range(1, n+1)])
n = int(input())
import sys
a = list(map(int,sys.stdin.readline().split()))
if sum(a) != judge_lie(n):
    print(0)
else:
    print((2 ** (n//2) % (10 ** 9 + 7)))


Measured memory_bytes: 54636
#include <iostream>
#include <vector>

using namespace std;

int main(){
	vector<int> array;
	vector<int> ans;
	int i,x,max,min,sum,n;


	while(1){
	cin>>n;
	max = 0;
	min = 1000;
	if(n==0){
		for(i=0;i<ans.size();i++){
			cout<<ans[i]<< endl;
		}

		break;
	}
	array.clear();
	sum=0;

	for(i=0;i<n;i++){
		cin >> x;
		array.push_back(x);
	}
	for(i=0;i<n;i++){
		if(max<array[i]){
			max= array[i];
		}
	}
	for(i=0;i<n;i++){
		if(min>array[i]){
			min= array[i];
		}
	}
	for(i=0;i<n;i++){
		sum += array[i];
	}
	sum = sum-max-min;
	ans.push_back(sum/(n-2));  //2ひいた分だけ割る数を減らす 
	}

}

Measured memory_bytes: 1220
#import math
#=input()
n=int(input())
#=map(int,input().split())
a=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

ans = 1
if 0 in a:
    ans = 0
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10 ** 18:
            ans = -1
            break

print(ans)

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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const int T = 1e6 + 100;
bitset<T> crivo;
vector<ll> primes;

void init() {
    for(int i = 2; i < T; i++) {
        if(!crivo[i]) {
            primes.pb(i);
            for(int j = i+i; j < T; j += i) crivo[j] = 1;
        }
    }
}

int decop(ll x) {
    if(x == 1) return 1;
    int ans = 1;

    for(int i = 0; i < primes.size() and primes[i]*primes[i] <= x; i++) {
        if(x % primes[i] == 0) {
            ans++;
            while(x % primes[i] == 0) x /= primes[i];
        }
    }

    if(x > 1) ans++;
    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    init();
    ll a,b; cin >> a >> b;
    cout << decop(__gcd(a,b)) << endl;
    return 0;
}



Measured memory_bytes: 1528
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

ll mod(ll a){
  return (a % 1000000007);
}

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


int main(){
  ll n; cin >> n; ll ans = 0;
  
  if(n < 105) ans = 0;
  else if(n < 135) ans = 1;
  else if(n < 165) ans = 2;
  else if(n < 189) ans = 3;
  else if(n < 195) ans = 4;
  else ans = 5;
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
def examA():
    A, B = LI()
    if B%A==0:
        ans = A+B
    else:
        ans = B-A
    print(ans)
    return

def examB():
    N, M = LI()
    Flag = [0]*M
    for i in range(N):
        K = LI()
        for j in range(1,K[0]+1):
            Flag[K[j]-1] +=1
    ans = 0
    for i in Flag:
        if i==N:
            ans +=1
    print(ans)
    return

def gcd(x,y):
    if y==0:
        return x
    while(y!=0):
        x, y = y,x%y
    return x
def examC():
    N = I()
    A = LI()
    cur = A[0]
    for i in range(N-1):
        cur = gcd(cur,A[i+1])
    ans = cur
    print(ans)
    return

def examD():
    N, M = LI()
    A = LI(); A.sort()
    Matti = [2,5,5,4,5,6,3,7,6]
    D = {}
    for a in A:
        D[Matti[a-1]] = a
    D = sorted(D.items())
    #print(D)
    dp = [-inf]*(N+10)
    dp[0] = 0
    for i in range(N):
        for matti,num in D:
            dp[i+matti] = max(dp[i+matti],dp[i]+1)
    #print(dp[:N+1])
    D = sorted(D, key=lambda x: x[1], reverse=True)
    #print(D)
    used = []
    i = N
    for matti,num in D:
        while (i > 0):
            # print(i)
            # input()
            #print(i,matti,used)
            if i-matti<0:
                break
            if dp[i-matti]==dp[i]-1:
                used.append(num)
                i -= matti
            else:
                break
    #print(used)
    used.sort(reverse=True)
    ans = "".join(map(str,used))
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examD()


"""
31 2
5 8
"""

Measured memory_bytes: 10236
#include <iostream>
#include <queue>
#include <map>
#include <list>
#include <vector>
#include <string>
#include <stack>
#include <limits>
#include <climits>
#include <cassert>
#include <fstream>
#include <cstring>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <ciso646>
#include <set>
#include <array>
#include <unordered_map>
#include <unordered_set>

using namespace std;

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

#define inf 0x3f3f3f3f
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define VS vector<string>
#define VI vector<ll>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define pi 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE()freopen("out0.txt","w",stdout)
#define ll long long
#define ull unsigned long long
#define pii pair<ll,ll>
#define pcc pair<char,char>
#define pic pair<ll,char>
#define pci pair<char,ll>
#define eps 1e-14
#define FST first
#define SEC second
#define SETUP cin.tie(0), ios::sync_with_stdio(false), cout << setprecision(15)

namespace {
	struct input_returnner {
		ll N; input_returnner(ll N_ = 0) :N(N_) {}
		template<typename T> operator vector<T>() const { vector<T> res(N); for (auto &a : res) cin >> a; return std::move(res); }
		template<typename T> operator T() const { T res; cin >> res; return res; }
		template<typename T> T operator - (T right) { return T(input_returnner()) - right; }
		template<typename T> T operator + (T right) { return T(input_returnner()) + right; }
		template<typename T> T operator * (T right) { return T(input_returnner()) * right; }
		template<typename T> T operator / (T right) { return T(input_returnner()) / right; }
		template<typename T> T operator << (T right) { return T(input_returnner()) << right; }
		template<typename T> T operator >> (T right) { return T(input_returnner()) >> right; }
	};
	template<typename T> input_returnner in() { return in<T>(); }
	input_returnner in() { return input_returnner(); }
	input_returnner in(ll N) { return std::move(input_returnner(N)); }
}

ll MOD = 1e9 + 7;

void solve();

signed main() {
	SETUP;
	solve();
#ifdef _DEBUG
	system("pause");
#endif
	return 0;
}

#define int ll

void solve() {
	int X, Y; cin >> X >> Y;
	if (abs(X - Y) <= 1) {
		cout << "Brown" << endl;
	}
	else cout << "Alice" << endl;
}


Measured memory_bytes: 384
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>

using namespace std;

#line 2 "abc161_f.cpp"

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n)
        ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main() {
  ll n;
  cin >> n;
  vl nd = divisor(n);
  vl n1d = divisor(n - 1);
  ll ans = (ll)n1d.size();
  ans--;
  for (const auto d : nd) {
    if (d == 1)
      continue;
    ll tmp = n;
    while (tmp % d == 0) {
      tmp /= d;
    }
    if (tmp % d == 1) {
      ans++;
    }
  }
  cout << ans << endl;
}


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

namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine();
            var c = str.Count();
            var sb = new StringBuilder();
            for (int i = 0; i < c; i+=2)
            {
                sb.Append(str[i]);
            }
            Console.WriteLine(sb.ToString());
            Console.ReadLine();

        }
    }

}

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

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int s = sc.NextInt();

        List<int> nums = new List<int>();
        nums.Add(s);

        int answer = 0;
        for (int i = 2; i < 10000000; i++)
        {
            if (s % 2 == 0)
            {
                s = s / 2;
            }
            else
            {
                s = 3 * s + 1;
            }
            if (nums.Contains(s))
            {
                answer = i;
                break;
            }
            nums.Add(s);
        }

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		int K=sc.nextInt();
		int R=sc.nextInt();
		int S=sc.nextInt();
		int P=sc.nextInt();
		String T_sub = sc.next();
		String[] T = new String[N];
		String[] answer = new String[N];
		for(int i=0;i<N;i++) {
			T[i]=T_sub.substring(i,i+1);
		}
		
		int[] value= {R,S,P};
		String[] rps = {"r","s","p"};
		ArrayList<String> history_List = new ArrayList<String>();
		int[][] dp_list = new int[3][N];
		for(int i=0;i<3;i++) {
			for(int j=0;j<K;j++) {
				dp_list[i][j]=score_rsp(R,S,P,rps[i],T[j]);
			}
		}
		
		for(int i=0;i<K;i++) {
			for(int j=1;j<=(N-1-i)/K;j++) {
				for(int k=0;k<3;k++) {
					if(score_rsp(R,S,P,rps[k],T[i+K*j])>0) {
						dp_list[k][i+K*j]=value[k]+Math.max(dp_list[(k+1)%3][i+K*j-K],dp_list[(k+2)%3][i+K*j-K]);
					}else {
						dp_list[k][i+K*j]=Math.max(dp_list[(k+1)%3][i+K*j-K],dp_list[(k+2)%3][i+K*j-K]);
					}
					
				}
			}
		}
		int total=0;
		for(int i=0;i<K;i++) {
			total+=Math.max(dp_list[0][N-1-i], Math.max(dp_list[1][N-1-i],dp_list[2][N-1-i]));
		}
		System.out.println(total);
		
		
	}
	
	static int score_rsp(int R,int S,int P,String p1,String p2) {
		if(p1.equals("r") && p2.equals("r")) {
			return 0;
		}else if(p1.equals("r") && p2.equals("s")) {
			return R;
		}else if(p1.equals("r") && p2.equals("p")) {
			return 0;
		}else if(p1.equals("s") && p2.equals("r")) {
			return 0;
		}else if(p1.equals("s") && p2.equals("s")) {
			return 0;
		}else if(p1.equals("s") && p2.equals("p")) {
			return S;
		}else if(p1.equals("p") && p2.equals("r")) {
			return P;
		}else if(p1.equals("p") && p2.equals("s")) {
			return 0;
		}else if(p1.equals("p") && p2.equals("p")) {
			return 0;
		}else {
			System.out.println("score_rspの引数が間違っています。");
			return -1;
		}
	}

}


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

int n;
int r, t;

int main() {
	cin >> n;
	while (n--) {
		cin >> r >> t;
		
		int a = 5 * (t / 30) + (r / 100);
		if (r % 100 == 0 && t % 30 == 0) {	//1???
			cout << a << endl;
		}
		else if (r % 100 == 0) {	//2????????§??????
			cout << a << " " << a + 5 << endl;
		}
		else if (t % 30 == 0) {	//2???????????????
			cout << a << " " << a + 1 << endl;
		}
		else {	//4???
			cout << a << " " << a + 1 << " " << a + 5 << " " << a + 6 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1164
import java.util.Scanner;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.Arrays;
import java.util.Stack;

public class Main {
	static Scanner scn = new Scanner(System.in);
	static int max=Integer.MIN_VALUE;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
			int n,k,sum=9,max=0,j=0;
			n=scn.nextInt();
			if(n==1||n==2||n==3||n==4||n==5||n==6||n==7||n==8||n==9)
			{
				System.out.println("Yes");
				return;
			}
			int arr[]=new int[(int) Math.sqrt(n)+100];
			int brr[]=new int[(int) Math.sqrt(n)+100];
			for(int i=2;i*i<=n;i++,j++)
			{
				if(n%i==0)
				{	
						arr[j]=i;
						brr[j]=n/i;
				}
			}
			for(int i=0;i<Math.sqrt(n)+90;i++)
			{
				if(arr[i]*brr[i]==n && arr[i]<=9&&brr[i]<=9)
				{
					System.out.println("Yes");
					return;
				}
			}
			System.out.println("No");
			
	}
	
}


Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 30;
int dx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ans = 0;
  for (int i = 0; i <= 100; i++) {
    if (a <= i && i <= b && c <= i && i <= d) {
      ans++;
    }
  }
  cout << (ans ? ans - 1 : ans) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//g++ -std=c++11 

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 998244353

long long dp[200005];

int main(){
	ll N, K;
	cin >> N >> K;
	vector<pair<ll, ll> > LR(K);

	rep(i, K) {
		cin >> LR[i].first >> LR[i].second;
	}

	ll cur = 1;
	dp[0] = -1;
	ll ans = -1;

	rep(i, N) {
		rep(j, K) {
			ll l = LR[j].first;
			ll r = LR[j].second;
			if(i + l - 1 <= N) {
				dp[i + l - 1] += cur;
				dp[i + l - 1] %= DIV;
			}
			if(i + r <= N) {
				dp[i + r] -= cur;
				dp[i + r] += DIV;
				dp[i + r] %= DIV;
			}
		}
		if(i == N - 1) {
			ans = cur;
		}

		cur += dp[i];
		cur %= DIV;
	}

	cout << ans << endl;

}


Measured memory_bytes: 5188