akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstring>
#include <cstdio>

using namespace std;

const int N = 1e5 + 100;

int n, m, dislike[10];

int main()
{
	scanf("%d%d", &n, &m);
	memset(dislike, 0, sizeof(dislike));
	while(m -- ) {
		int tmp;
		scanf("%d", &tmp);
		dislike[tmp] = true;
	}
	int i;
	for(i = n; i < 100000; i ++) {
		int t = i;
		bool is_suc = true;
		while(t) {
			int num = t % 10;
			t /= 10;
			if( dislike[num])
				is_suc = false;
		}
		if( is_suc)    break;
	}
	printf("%d\n", i);
	return 0;
} 

Measured memory_bytes: 3220
def ascan; gets.split.map(&:to_i); end

N,A,B,C = ascan
L = N.times.map{gets.to_i}.to_a.sort

ABC = [A,B,C].sort


def judge(l)
    best = 1e9
    l.sort.combination(3) do |c|
        a = (c[0]-ABC[0]).abs + (c[1]-ABC[1]).abs + (c[2]-ABC[2]).abs 
        best = [a, best].min
    end
    best + (N-l.size)*10
end

@best = 1e18

@h = {}
def dfs(l)
    
    @best = [@best, judge(l)].min
    return if l.size == 3
    
    l.size.times do |k|
        l2 = l[0...k]+l[(k+1)..-1]
        k.upto(l2.size-1) do |i|
            l2[i] += l[k]
            dfs(l2)
            l2[i] -= l[k]
        end
    end
    return
end

dfs(L)

p @best

Measured memory_bytes: 1788
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main{
	static Scanner s=new Scanner(System.in);

	void solve(){
		int n=gInt();
		
		int r=100000;
		for(int i:rep(1,n-1)) {
			r=Math.min(r,f(i)+f(n-i));
		}
		System.out.println(r);
	}

	private int f(int i){
		return (""+i).chars().map(o->o-'0').sum();
	}

	public static void main(String[] A){
		new Main().solve();
	}

	static int gInt(){
		return Integer.parseInt(s.next());
	}
	static long gLong(){
		return Long.parseLong(s.next());
	}
	static double gDouble(){
		return Double.parseDouble(s.next());
	}

	SupplyingIterator<Integer> ints(int n){
		return new SupplyingIterator<>(n,Main::gInt);
	}
	SupplyingIterator<Long> longs(int n){
		return new SupplyingIterator<>(n,Main::gLong);
	}
	SupplyingIterator<Double> doubles(int n){
		return new SupplyingIterator<>(n,Main::gDouble);
	}
	SupplyingIterator<String> strs(int n){
		return new SupplyingIterator<>(n,s::next);
	}

	Range rep(int i){
		return Range.rep(i);
	}
	Range rep(int f,int t,int d){
		return Range.rep(f,t,d);
	}
	Range rep(int f,int t){
		return rep(f,t,1);
	}
	Range rrep(int f,int t){
		return rep(t,f,-1);
	}

	IntStream REP(int v){
		return IntStream.range(0,v);
	}
	IntStream REP(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	IntStream INTS(int n){
		return IntStream.generate(Main::gInt).limit(n);
	}
	Stream<String> STRS(int n){
		return Stream.generate(s::next).limit(n);
	}

}
class SupplyingIterator<T> implements Iterable<T>,Iterator<T>{
	int			t;
	Supplier<T>	supplier;

	SupplyingIterator(int t,Supplier<T> supplier){
		this.t=t;
		this.supplier=supplier;
	}

	@Override
	public Iterator<T> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return t>0;
	}

	@Override
	public T next(){
		--t;
		return supplier.get();
	}

}
class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
	int to,cur,d;

	Range(int from,int to,int d){
		this.cur=from-d;
		this.to=to;
		this.d=d;
	}

	Range(int n){
		this(0,n-1,1);
	}

	@Override
	public Iterator<Integer> iterator(){
		return this;
	}

	@Override
	public boolean hasNext(){
		return cur+d==to||(cur!=to&&(cur<to==cur+d<to));
	}

	@Override
	public int nextInt(){
		return cur+=d;
	}

	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t,int d){
		return new Range(f,t,d);
	}
	static Range rep(int f,int t){
		return rep(f,t,1);
	}
	static Range rrep(int f,int t){
		return rep(f,t,-1);
	}

}

Measured memory_bytes: 48068
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = mod * mod;
typedef pair<int, int>P;
typedef pair<int, bool> sP;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef vector<vector<ll>> mat;
typedef vector<ll> vec;


void solve() {
	int n; cin >> n;
	vector<int> l(n);
	rep(i, n)cin >> l[i];
	sort(l.begin(), l.end());
	int ans = 0;
	rep(i, n)Rep(j, i + 1, n)Rep(k, j + 1, n)if(l[i] + l[j] > l[k])ans++;
	cout << ans << endl;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(7);
	//init();
	solve();
	//stop
	return 0;
}



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

typedef long long int LLI;

int K;
LLI as[114514];

int main() {
  scanf("%d", &K);
  for (int i=0; i<K; i++) {
    scanf("%lld", &as[i]);
  }

  LLI l = 2;
  LLI r = 2;
  for (int i=K-1; i>=0; i--) {
    LLI nl = (l/as[i]+(l%as[i] != 0))*as[i];
    LLI nr = (r/as[i]*as[i]) + as[i]-1;
    if (nl > nr) {
      puts("-1");
      return 0;
    }
    l = nl;
    r = nr;
  }
  printf("%lld %lld\n", l, r);
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(0);
	long long n,m,x,y,i,i1;
    cin>>n>>m;
    long long ans[n];
    for (i=0;i<n;i++)ans[i]=-1;
    for (i=0;i<m;i++){
        cin>>x>>y;
        x--;
        if (ans[x]==y||ans[x]==-1){
            ans[x]=y;
        }
        else {
            cout<<"-1\n";
            return 0;
        }
    }
    if (ans[0]==0){
        if (n==1)cout<<0;
        else cout<<"-1\n";
        return 0;
    }
    if (ans[0]==-1&&n==1)ans[0]=0;
    else if (ans[0]==-1)ans[0]=1;
    for (i=0;i<n;i++){
        if (ans[i]==-1)cout<<0;
        else cout<<ans[i];
    }
    
}

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

int c[10][10], m[10]; // m[i] : iから1へ書き変える最小コスト

void solve(int num, vector<int> vec, int cost){
    cost += c[num][vec.back()];
    vec.push_back(num);
    if(cost < m[num]){
        m[num] = cost;
    }
    for(int i=0;i<10;i++){
        bool flag = true;
        for(int j=0;j<vec.size();j++){
            if(vec.at(j) == i)
                flag = false;
        }
        if(flag)
            solve(i, vec, cost);
    }
}
 
int main(){
    int H, W;
    cin >> H >> W;
    for(int i=0;i<10;i++)
        for(int j=0;j<10;j++)
            cin >> c[i][j];
    int A[H][W];
    for(int i=0;i<H;i++)
        for(int j=0;j<W;j++)
            cin >> A[i][j];
    
    // m[i]の計算
    for(int i=0;i<10;i++)
        m[i] = INT_MAX;
    m[1] = 0;

    vector<int> vec;
    vec.push_back(1);
    for(int i=0;i<10;i++){
        if(i != 1)
            solve(i, vec, 0);
    }

  	/*
    for(int i=0;i<10;i++)
        cout << "m[i] : " << m[i] << endl;
	*/


    // コストの総和の計算
    ll ans = 0;
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(A[i][j] != -1)
                ans += m[A[i][j]];
        }
    }
    
    cout << ans << endl;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define endl '\n'
#define maxn 1005
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
const double PI = acos(-1.0);
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;


int main()
{
    FASTIO
    /*
    //double start_time = clock();
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
//*/
    int T;
    //cin >> T;
    T = 1;
    for (int cs = 1; cs <= T; cs++) {
        int a, b;
        cin >> a >> b;
        cout << (((b % a) == 0) ? (a + b) : (b - a))<<endl;
    }

    //double end_time = clock();
    //printf( "Time = %lf ms\n", ( (end_time - start_time) / CLOCKS_PER_SEC)*1000);
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
#define REP(i, n) for (int64_t i = 0; i < (int64_t)n; i++)
#define REP_FOR(i, a, b) for (int64_t i = (int64_t)a; i < (int64_t)b; i++)
#define REP_REV(i, a, b) for (int64_t i = (int64_t)a; i > (int64_t)b; i--)
#define FORALL(v) (v).begin(), (v).end()
#define mp(a, b) make_pair(a, b)
#define eb(x) emplace_back(x)
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef pair<int64_t, int64_t> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int64_t> vii;
typedef vector<vii> vvii;
const ll mod = 1e9 + 7;
const int64_t infi = 1147483600;
const ll infl = 4e18 + 5;
const char EOL = '\n';
//cout << fixed << setprecision(17) << res << endl;
const ll MOD = 998244353;

int main() {
    int target = 753;
    string s;
    cin >> s;
    vector<int> V;
    for (auto & c : s) {
        V.push_back((int)(c-'0'));
    }
    
    int res = 9999;
    auto n = V.size();
    for (int i = 0; i + 2 < n; ++i) {
        auto v = V[i] * 100 + V[i+1] * 10 + V[i+2];
        res = min(res, abs(v-target));
    }
    cout << res << endl;
}


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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

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

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

int main() {
  llong N, K;
  vector<vector<llong>> A;
  map<llong,llong> m;

  cin >> N >> K;
  A.resize(K);
  for (int i = 0; i < K; ++i) {
    llong d;
    cin >> d;
    A[i].resize(d);
    for (int j = 0; j < d; ++j) {
      cin >> A[i][j];
      m[A[i][j]]++;
    }
  }

  llong ans = 0;
  for (int i = 1; i <= N; ++i) {
    m[i];
    ans += m[i] == 0;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;

using namespace std;

ll count(ll bit){
    if(bit == 0) return 0;
    return count(bit >> 1) + (bit & 1);
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  ll N; cin >> N;
  vector<ll> A(N);
  vector<vector<ll>> x(N,vector<ll>(N,-1)), y(N,vector<ll>(N,-1));
  REP(i,N){
    cin >> A[i];
    REP(j,A[i]){
      cin >> x[i][j] >> y[i][j];
      x[i][j]--; // 0-indexed
    }
  }
  ll ans = 0,tmp = 0;
  bool flg = true;
  vector<ll> list(N);
  for (ll bit = 0; bit < (1 << N); ++bit) {
    	flg = true; tmp = 0;
    	list.resize(N,-1);
    	for(ll i = 0; i < N; ++i){
      		if(!(bit & (1 << i))) continue;
        	REP(j,A[i]){
                    ll t = x[i][j];
           			if(!y[i][j] && (bit >> t) & 1) flg = false;
                    if(y[i][j] && !((bit >> t) & 1)) flg = false;
      		}
  		}
    	if(flg) ans = max(ans,count(bit));
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 256
import math
a = list(map(int, input().split()))
x = [input().split() for i in range(a[0])]
ans =0
for i in range(a[0]-1):
    for k in range(i+1, a[0]):
        kyori=0
        for j in range(a[1]):
            kyori += (int(x[i][j])-int(x[k][j]))*(int(x[i][j])-int(x[k][j]))   
        if math.sqrt(kyori)==int(math.sqrt(kyori)):
            ans+=1
print(ans)

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

const int MOD = 998244353;
int dp[403][403] , A[403] , B[403] , jc[403] , inv[403] , N , S;

int poww(long long a , int b){
    int times = 1;
    while(b){
        if(b & 1) times = times * a % MOD;
        a = a * a % MOD; b >>= 1;
    }
    return times;
}

int main(){
    cin >> N; for(int i = 1 ; i <= N ; ++i){cin >> A[i] >> B[i]; S += A[i];}
    dp[0][0] = MOD - 1; jc[0] = 1;
    for(int i = 1 ; i <= 400 ; ++i) jc[i] = 1ll * jc[i - 1] * i % MOD;
    inv[400] = poww(jc[400] , MOD - 2);
    for(int i = 399 ; i >= 0 ; --i) inv[i] = inv[i + 1] * (i + 1ll) % MOD;
    for(int i = 1 ; i <= N ; ++i)
        for(int j = S ; j >= 0 ; --j)
            for(int k = 400 ; k >= 0 ; --k)
                if(dp[j][k])
                    for(int l = 0 , tms = 1 ; l < B[i] ; ++l , tms = 1ll * tms * A[i] % MOD)
                        dp[j + A[i]][k + l] = (dp[j + A[i]][k + l] - 1ll * tms * inv[l] % MOD * dp[j][k] % MOD + MOD) % MOD;
    int ans = 0;
    for(int i = 1 ; i <= S ; ++i){
        int val = poww(i , MOD - 2) , val1 = i == S ? 1 : 1ll * S * poww(i , MOD - 2) % MOD;
        for(int j = 0 ; j <= 400 ; ++j)
            ans = (ans + 1ll * dp[i][j] * jc[j] % MOD * poww(val , j) % MOD * val1) % MOD;
    }
    cout << ans; return 0;
}

Measured memory_bytes: 896
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>
#include <cassert>
#include <bitset>
#include <stack>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

#define int long long // at least int64 > 9*10^18
#define EL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using Graph = std::vector<std::vector<int> >;
const int INF = 1e17;
/* libraries */

constexpr int MOD = 1e9+7;
struct mint
{
	int v;
	mint():v(0){}
	mint(int v):v((v+MOD)%MOD){}
	mint operator-()const{ return mint(0) - *this; }
	mint& operator+=(const mint& a){ if((v+=a.v)>=MOD) v-=MOD; return *this; }
	mint& operator-=(const mint& a){ if((v+=MOD-a.v)>=MOD) v-=MOD; return *this; }
	mint& operator*=(const mint& a){ (v*=a.v)%=MOD; return *this; }
	mint& operator/=(const mint& a){ (*this) *= a.inv(); return *this; }
	mint operator+(const mint& a)const{ return mint(*this) += a; }
	mint operator-(const mint& a)const{ return mint(*this) -= a; }
	mint operator*(const mint& a)const{ return mint(*this) *= a; }
	mint operator/(const mint& a)const{ return mint(*this) /= a; }
	bool operator<(const mint& a)const{ return v < a.v; }
	bool operator==(const mint& a)const{ return v == a.v; }
	mint pow(int k)const{ mint r(1),t(v); while(k){ if(k&1) r*=t; t*=t; k>>=1; } return r; }
	mint inv()const{ return pow(MOD-2); }
	static mint comb(int n, int k) {
		if(n-k<k) k=n-k;
		mint num(1), dom(1);
		for(int i=0;i<k;i++) { num*=n-i; dom*=i+1; }
		return num/dom;
	}
};
std::istream& operator>>(std::istream&i,mint&a){ int t; i>>t; a=mint(t); return i; }
std::ostream& operator<<(std::ostream&o,const mint&a){ o<<a.v; return o; }


struct P
{
	int a, b;
	P(int x, int y) {
		int g = std::gcd(x,y);
		if(g!=0) x/=g, y/=g;
		a=x;b=y;
		if(a<0) {
			a*=-1;b*=-1;
		}
		if(a==0) b=std::abs(b);
	}
	bool operator<(const P rhs) const {
		if(a!=rhs.a) return a<rhs.a;
		return b<rhs.b;
	}
};

signed main() {
	int n;
	std::cin >> n;
	std::vector<std::pair<int,int> > a;
	std::map<P,int> map;
	rep(i,n) {
		int x,y;
		std::cin >> x >> y;
		a.emplace_back(x,y);
		map[P(x,y)]++;
	}
	mint ans=1;
	mint ans2=0;
	if(map.count(P(0,0))) {
		ans2+=map[P(0,0)];
		map[P(0,0)]=0;
	}
	for(auto x:map) {
		if(x.second==0) continue;
		mint mul=mint(2).pow(x.second);
		P rev(-x.first.b,x.first.a);
		mul+=mint(2).pow(map[rev]);
		mul-=1;
		map[rev]=0;
		ans*=mul;
	}
	print(ans+ans2-1);
	return 0;
}



Measured memory_bytes: 31084
#include <algorithm>
#include <cassert>
// #include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
// #include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

/*
unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
mt19937 g1.seed(seed1);
*/
using namespace std;

const double PI = 2 * acos(0);

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<pii, pii> ppiipii;
typedef pair<int, ppiipii> pippiipii;
typedef pair<int, pii> pipii;
typedef pair<pii, int> ppiii;
typedef pair<int, ppiii> pippiii;
typedef pair<int, ll> pill;
typedef pair<int, double> pid;
typedef pair<double, double> pdd;
typedef pair<double, pdd> pddd;
typedef pair<string, string> pss;
// note to self, the below two triggers someone
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef long double ld;

bool dp[1005];

int main() {
    int n;
    scanf("%d", &n);
    dp[0] = true;
    for(int i = 0; i <= n; i++) {
        if(dp[i]) dp[i+4] = true;
        if(dp[i]) dp[i+7] = true;
    }
    if(dp[n]) printf("Yes\n");
    else printf("No\n");
}


Measured memory_bytes: 256
#! env/bin/local python3
# -*- coding: utf-8 -*-


def seki(array1: list, array2: list):
    results = []
    for a in array1:
        if a in array2:
            results.append(a)
            array2.remove(a)
    return results


def main():
    n = int(input())
    sentences = []
    while True:
        try:
            sentences.append(sorted(input(), reverse=True))
        except EOFError:
            break

    pocket = sentences[0].copy()

    for n, sentence in enumerate(sentences):
        pocket = seki(pocket, sentence)

    print(''.join(sorted(pocket)))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9084
s = input()
ans = 1
for i in range(1,3):
    if s[3] != s[i]:
        ans = 0
if ans:
    print("Yes")
    exit()
ans = 1
for i in range(1,3):
    if s[0] != s[i]:
        ans = 0
if ans:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 38512
#include<stdio.h>
int main()
{
    int a,b,sum,n;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        sum=a+b;
        n=0;
        while(sum!=0)
        {
            sum=sum/10;
            n++;
        }
        printf("%d\n",n);
    }
    return 0;
}


Measured memory_bytes: 2044
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int[] numbers=new int[N];
        for(int i=0; i<N; i++) {
            numbers[i]=sc.nextInt();
        }
        sc.close();
        System.out.println(totalMoves(numbers));
    }

    private static String totalMoves(int x[]) {
        int biggest = 0;
        int sum = 0;
        for(int i = 0; i < x.length; i++) {
            if(x[i] > biggest) {
                biggest = x[i];
            }
            sum = sum + x[i];
        }

        sum = sum - biggest;
        if(sum > biggest) {
            return "Yes";
        }

        return "No";
    }

}




Measured memory_bytes: 23124
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define reads(s) string s; cin >> s;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define setprec cout << fixed << showpoint << setprecision(20);
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	string s, t;
	cin >> s >> t;
	int c = 0;
	
	FOR (i, 0, sz(s) - 1)
	    if (s[i] != t[i]) c++;
	    print(c);
	
}



















Measured memory_bytes: 3824
#pragma G++ optimize (2)
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <queue>
#define INF 0x3f3f3f3f
#define NO 30005
#define MO 100005
typedef long long ll;
using namespace std;
inline ll read()
{
	char ch = ' ', last;
	ll ans = 0;
	while (ch < '0' || ch > '9')
		last = ch, ch = getchar();
	while (ch >= '0' && ch <= '9')
		ans = ans * 10 + int(ch - '0'), ch = getchar();
	if (last == '-')
		return -ans;
	return ans;
}
void write(ll x)
{
	if (x >= 10)
		write(x / 10);
	putchar(x % 10 + '0');
}
//head

int cnt1, cnt2;
string x;
//variable

void init()
{
	cin >> x;
}
//functions

int main()
{
	init();
	for (int i = 0; i < x.length(); i++)
		if (x[i] == '0')
			cnt1++;
		else
			cnt2++;
	cout << 2 * min(cnt1, cnt2) << endl;
	return 0;
}
//main


Measured memory_bytes: 512
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define pii pair < int, int >
#define F first
#define S second
#define int  long long int
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
using namespace std;
/// age ye mosh dp ro baze dashti dp tedad baz shodeye baste nashode yadet nare !!
/// joooob zadam
const int N=2e2+100,mod=1e9+7;
ll dp[N];
int32_t main(){
    ll n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    if (n==1){
        cout << 3 << endl;
        return 0;
    }
    dp[0]=1;
    for (int i=1;i<=s.size();i++){
        if (s[i-1]==t[i-1]){
            if (i==1){
                dp[i]=3;
            }
            else{
                if (s[i-2]==t[i-2]){
                    dp[i]=dp[i-1]*2;
                }
                else{
                    dp[i]=dp[i-1];
                }
            }
            dp[i]%=mod;
        }
        //dp[i]%=mod;
        else{
            if (i==1){
                continue;
            }
            if (s[i-1]==s[i-2]){
                if (i==2){
                    dp[i]=6;
                }
                else{
                    if (s[i-3]==t[i-3]){
                        dp[i]=2*dp[i-2];
                        dp[i]%=mod;
                    }
                    else{
                        dp[i]=3*dp[i-2];
                        dp[i]%=mod;
                    }
                }
            }
            else{
                continue;
            }
        }
    }
    cout << dp[n];
}


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

using namespace std;

using ll = long long;
const int MAX = 50;
const int LAYERS = 2500;

int main() {
    int N, M, S;
    cin >> N >> M >> S;
    vector<vector<tuple<int, int, int>>> adj(N);
    for (int i = 0; i < M; i++) {
        int u, v, a, b;
        cin >> u >> v >> a >> b, u--, v--;
        adj[u].emplace_back(v, a, b);
        adj[v].emplace_back(u, a, b);
    }
    vector<int> Cs(N), Ds(N);
    for (int i = 0; i < N; i++) {
        cin >> Cs[i] >> Ds[i];
    }
    vector<ll> ans(N);
    set<pair<int, int>> vis;
    set<int> has;
    priority_queue<pair<ll, pair<int, int>>> pq;
    pq.push({0, {0, min(LAYERS, S)}});
    while (has.size() < N) {
        ll w;
        pair<int, int> ind;
        tie(w, ind) = pq.top();
        pq.pop();
        if (vis.count(ind))
            continue;
        vis.emplace(ind);
        int n, s;
        tie(n, s) = ind;
        if (!has.count(n)) {
            has.emplace(n);
            ans[n] = w;
        }
        pq.push({w - Ds[n], {n, min(LAYERS, s + Cs[n])}});
        for (auto edge : adj[n]) {
            int v, a, b;
            tie(v, a, b) = edge;
            if (a > s)
                continue;
            pair<int, int> nind = {v, min(LAYERS, s - a)};
            if (vis.count(nind))
                continue;
            pq.emplace(w - b, nind);
        }
    }
    for (int i = 1; i < N; i++) {
        cout << -ans[i] << endl;
    }
}


Measured memory_bytes: 11700
const MOD: usize = 998244353;

fn main() {
    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    let n: usize = sc.read();
    let s = sc.chars();

    let mut r = vec![];
    let mut g = vec![];
    let mut b = vec![];
    for i in 0..(3 * n) {
        match s[i] {
            'R' => r.push(i),
            'G' => g.push(i),
            'B' => b.push(i),
            _ => {}
        }
    }

    let mut left = vec![];
    let mut center = vec![];
    let mut right = vec![];

    for i in 0..n {
        let mut row = vec![r[i], g[i], b[i]];
        row.sort();
        left.push(row[0]);
        center.push(row[1]);
        right.push(row[2]);
    }

    let mut left_count = vec![0; n];
    left.reverse();
    for (i, &c) in center.iter().enumerate() {
        while let Some(l) = left.pop() {
            if l > c {
                left.push(l);
                break;
            }
        }
        let count = n - left.len();
        left_count[i] = count - i;
    }

    let mut right_count = vec![0; n];
    for (i, &c) in center.iter().enumerate().rev() {
        while let Some(r) = right.pop() {
            if r < c {
                right.push(r);
                break;
            }
        }

        let count = n - right.len();
        right_count[i] = count - (n - 1 - i);
    }

    let mut ans = 1;
    for i in 0..n {
        ans *= right_count[i];
        ans %= MOD;
        ans *= left_count[i];
        ans %= MOD;
        ans *= i + 1;
        ans %= MOD;
    }
    println!("{}", ans);
}

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: std::ops::Deref<Target = str>>(&mut self, s: S) {
        use std::io::Write;
        self.1.write(s.as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


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

int main() {
	long long N, Q;
	string S;
	cin >> N >> S >> Q;
	set<long long> ST[26];
	for (int i = 0; i < S.size(); i++) ST[S[i] - 'a'].insert(i);
	for (int i = 0; i < Q; i++) {
		long long A;
		cin >> A;
		if (A == 1) {
			long long B;
			char C;
			cin >> B >> C;
			B--;
			ST[S[B] - 'a'].erase(B);
			ST[C - 'a'].insert(B);
			S[B] = C;
		}
		else {
			long long L, R;
			cin >> L >> R;
			L--, R--;
			L--;
			long long COUNT = 0;
			for (int i = 0; i < 26; i++) {
				if (ST[i].upper_bound(L) != ST[i].upper_bound(R)) COUNT++;
			}
			cout << COUNT << endl;
		}
	}
}

Measured memory_bytes: 24196
import sys
import time
input = sys.stdin.readline
FREE = True
NOT_FREE = False

num = int(input())
Q = [list(map(int, input().split())) for i in range(num)]

row = [FREE]*8
col = [FREE]*8
dpos = [FREE]*15
dneg = [FREE]*15
chess_board = [['.' for i in range(8)] for j in range(8)]

def printBoard():
    for c in chess_board:
        print("".join(c))

def chess_init():
    for q in Q:
        i = q[0]
        j = q[1]
        chess_board[i][j] = 'Q'
        row[i] = col[j] = dpos[i+j] = dneg[i-j+7] = NOT_FREE

def putQueen(i):

    if(i == 8):
        printBoard()
        return
    
    row_idx = 0
    for j in range(8):
        if(row[j] == FREE):
            row_idx = j
            break

    for j in range(8):
        if(col[j] == NOT_FREE or dpos[row_idx+j] == NOT_FREE or dneg[row_idx-j+7] == NOT_FREE):
            continue
        # not free jya nai nara oku
        chess_board[row_idx][j] = 'Q'
        row[row_idx] = col[j] = dpos[row_idx+j] = dneg[row_idx-j+7] = NOT_FREE
        putQueen(i+1)
        # i+1 banme tansaku site kokoni kaette kitara
        # tansaku sippai = backtracking suru kara FREE ni modosu
        chess_board[row_idx][j] = '.'
        row[row_idx] = col[j] = dpos[row_idx+j] = dneg[row_idx-j+7] = FREE

if __name__ == "__main__":
    chess_init()
    # sudeni okareta koma igai no koma no tansaku suru
    putQueen(num)






Measured memory_bytes: 5644
import java.util.Scanner;
import java.util.Arrays;
class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        String A = scan.next();
        long[] cnt = new long[26];
        Arrays.fill(cnt, 0);
        for(int i=0;i<A.length();++i){
            cnt[A.charAt(i) - 'a']++;
        }
        long ans = ((long)A.length()*(long)(A.length()-1))/2 + 1;
        for(long num : cnt){
            ans -= (num*(num-1))/2;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 26812
n, a, b = map(int, input().split())

digit_sum_sum = 0
for num in range(1,n+1):
    digit_sum = 0
    for i in str(num):
        digit_sum += int(i)
    if a <= digit_sum <= b:
        digit_sum_sum += num
print(digit_sum_sum)


Measured memory_bytes: 2940
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace practice1
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string str = Console.ReadLine();
                string a;
                int answer = 0;
                if (str == "0") break;

                for(int i = 0; i < str.Length; i++)
                {
                    a = str[i].ToString();
                    answer += int.Parse(a);
                }
                Console.WriteLine(answer);
            }
        }
    }
}



Measured memory_bytes: 15912
#include<iostream>
#include<string>
#include<map>

using namespace std;;


bool unbalance(string s){
    map<char,unsigned int> score;
    unsigned int i;
    for (auto x : s){
        score[x]++;
        if (score[x] > s.length() / 2){
            return true;
        }
    }
    return false;
}

int main(){
    string input, s;
    bool flag = false;
    cin >> input;

    unsigned int i,j;
    for (j=2; j<=3; j++){
        for  (i=0; i<1+input.length()-j; i++){
            s = input.substr(i, j);
            if (unbalance(s)){
                cout << i + 1 << " " << i + j << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1" << endl;
    return 0;
}

Measured memory_bytes: 3768
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
const int N = 5e5 + 10;
struct INTV{
	int l, r, id;
	bool operator < (const INTV & other)
	{return l < other.l || (l == other.l && r < other.r);}
}intv[N];
int tr[N], nxt[N], t[N], ans[N], c[N];
#define lowbit(i) i&(-i)
void update(int x, int v)
{
	for(int i = x; i <= 5e5; i += lowbit(i))
		tr[i] += v;
}
int query(int x)
{
	int ans = 0;
	for(int i = x; i > 0; i -= lowbit(i))
		ans += tr[i];
	return ans;
}
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i = 1; i <= n; i++)
		scanf("%d", &c[i]);
	for(int i = 1; i <= m; i++)
	{
		scanf("%d%d", &intv[i].l, &intv[i].r);
		intv[i].id = i;
	}
	sort(intv + 1, intv + m + 1);
	//for(int i = 1; i <= m; i++)
		//printf("%d %d\n",intv[i].l, intv[i].r);
	for(int i = n; i > 0; i--)
	{
		nxt[i] = t[c[i]];
		t[c[i]] = i;
	}
	//for(int i = 1; i <= n; i++)
	//	printf("%d ", nxt[i]);
	//printf("\n");
	int j = 1;
	for(int i = 1; i <= n; i++)
		if(t[i])
			update(t[i], 1);
	for(int i = 1; i <= n; i++)
	{
		while(j <= m && intv[j].l == i)
		{
			ans[intv[j].id] = query(intv[j].r);
			j++;
		}
		update(i, -1);
		if(nxt[i])
			update(nxt[i], 1);
	}
	for(int i = 1; i <= m; i++)
		printf("%d\n", ans[i]);
	return 0;
}

Measured memory_bytes: 19328
//============================================================================
// Name        : AOJ.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>

using namespace std;
typedef long long ll;
int main(){

	ll a,b;
	char op;

	cin>>a>>op>>b;

	if(op=='+'){
		cout<<a+b<<endl;
	}
	if(op=='-'){
		cout<<a-b<<endl;
	}
	return 0;



}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <bitset>
#include <cmath>
#include <stack>
#include <iomanip>
#include <map>
#include <math.h>
typedef long long ll;
using namespace std;
const int MOD = 1000000007;

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

bool isPrime(int N)
{
    for(int i = 3; i <= sqrt(N); i++)
    {
        if(N%i == 0) return(false);
    }
    return(true);
}

int main()
{
    int N;
    cin >> N;
    if(N == 2)
    {
        cout << 2 << endl;
        return(0);
    }
    if(N % 2 == 0) N++;
    while(!isPrime(N))
    {
        N += 2;
    }
    cout << N << endl;
}

Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.math;

ulong gcd(ulong a, ulong b) {
  return b > 0 ? gcd (b, a % b) : a;
}

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

void run(ulong a, ulong b) {
  writefln("%d %d", gcd(a, b), lcm(a, b));
}

void main() {
  ulong[][] data;

  while(true) {
    auto input = readln();
    if(stdin.eof()) break;

    auto s = split(input);
    data ~= [to!ulong(s[0]), to!ulong(s[1])];
  }

  foreach(d; data) {
    run(d[0], d[1]);
  }
}

Measured memory_bytes: 980
#include<iostream>
using namespace std;
int main()
{
	int N, A[3][3], b[10];
	bool appear[3][3];
	for(int i=0;i<3;i++) {
		for(int j=0;j<3;j++) cin >> A[i][j];
	}
	cin >> N;
	for(int i=0;i<N;i++) cin >> b[i];
	for(int i=0;i<3;i++) {
		for(int j=0;j<3;j++) {
			appear[i][j] = false;
			for(int k=0;k<N;k++) {
				if(A[i][j] == b[k]) appear[i][j] = true;
			}
		}
	}
	string ANS = "No";
	for(int i=0;i<3;i++) {
		if(appear[i][0] and appear[i][1] and appear[i][2]) ANS = "Yes";
	}
	for(int i=0;i<3;i++) {
		if(appear[0][i] and appear[1][i] and appear[2][i]) ANS = "Yes";
	}
	if(appear[0][0] and appear[1][1] and appear[2][2]) ANS = "Yes";
	if(appear[0][2] and appear[1][1] and appear[2][0]) ANS = "Yes";
	cout << ANS << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
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 putchar putchar_unlocked
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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

	
	char S[200001]; 
	int N = fread(S, 1, 200001, stdin);
	if (S[N - 1] < 'a' || S[N - 1] > 'z') N--;

	int V[8000];
	*V = N;
	int kazu = 0;
	int A = 0;
	for (int i = N - 1; i >= 0; i--) {
		A |= 1 << *(S + i) - 'a';
		if (A == 67108863) {
			kazu++;
			*(V + kazu) = i;
			A = 0;
		}
	}

	A = 0;
	int flag = 0;
	int nai = 0;
	rep(i, N) {
		if (i == *(V + kazu)) {
			rep(j, 26) if (!(A >> j & 1)) {
				nai = j;
				break;
			}
			putchar('a' + nai);
			kazu--;
			flag = 1;
		}
		if (flag) {
			if (*(S + i) == 'a' + nai) {
				A = 0;
				flag = 0;
			}
		}
		else if (flag == 0) {
			A |= 1 << *(S + i) - 'a';
		}
	}
	rep(j, 26) if (!(A >> j & 1)) {
		putchar('a' + j);
		break;
	}
	putchar('\n');

	Would you please return 0;
}

Measured memory_bytes: 512
program main;
var
	a,b,c,d : longint;
begin
	readln(a,b,c,d);
    if a mod d > 0 then a := a div d + 1 else a := 1;
    if c mod b > 0 then c := c div b + 1 else c := 1;
    if a >= c 
    	then writeln('Yes')
        else writeln('No');
end.

Measured memory_bytes: 1348
#include <iostream>                                            
using namespace std;                                           
                                                               
int main() {                                                   
  int N;                                                       
  cin >> N;                                                    
  int A[N];                                                    
  for (int i=0; i<N; i++) {                                    
    cin >> A[i];                                               
  }                                                            
  bool f = true;                                               
  int ans = 0;                                                 
  while (f) {                                                  
    f = false;                                                 
    for (int j=N-1; j>=1; j--) {                               
      if (A[j]<A[j-1]) {                                       
        int v = A[j-1];                                        
        A[j-1] = A[j];                                         
        A[j] = v;                                              
        f = true;                                              
        ans++;                                                 
      }                                                        
    }                                                          
  }                                                            
  for (int i=0; i<N; i++) {                                    
    cout << (i==0?"":" ") << A[i] << flush;                    
  }                                                            
  cout << endl;                                                
  cout << ans << endl;                                         
  return 0;                                                    
}                      

Measured memory_bytes: 3120
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
	int n;
	cin >> n;
	string s;
	cin >> s;
	char c = '$';
	int ans = 0;
	rep(i, n) {
		if(s[i] == c) continue;
		c = s[i];
		ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public 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 x = sc.nextInt();
        int y = sc.nextInt();
        if(c * 2 >= a + b) {
            System.out.println(a * x + b * y);
            return;
        }
        List<Integer> array = new ArrayList<>();
        array.add(a * x + b * y);
        array.add(2 * c * Math.max(x, y));
        if(x > y) {
            array.add(2 * c * y + a * (x -y));
        }
        else {
            array.add(2 * c * x + b * ( y - x));
        }
        System.out.println(array.stream().mapToInt(Integer::valueOf).min().getAsInt());
    }
}




Measured memory_bytes: 26708
#include <iostream>

int main() {
    int a, b, x;
    std::cin >> a >> b >> x;

    if(a > x) {
        std::cout << "NO" << std::endl;
    } else if(a + b >= x) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <fstream>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef tuple<int, int, int> iii;
typedef vector<iii> viii;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;
typedef map<int, int> mii;
typedef map<int, string> mis;
typedef map<string, int> msi;
typedef set<int> si;
typedef set<ll> sl;
typedef map<ll, ll> mll;
typedef queue<int> qi;
typedef queue<ii> qii;
typedef vector<string> vs;
typedef pair<ll, ll> iil;
typedef vector<iil> viil;

#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0 ; i < n ; i++)
#define INF 1000000000

int n;
vi adj[2005];

vi runBFS(int v) {
    qii q;
    vi dst(n);
    bool vis[n];
    memset(vis, false, sizeof vis);
    q.push({v, 0});
    while (q.size() > 0) {
        ii ns = q.front();
        q.pop();
        int vt = ns.first;
        if (vis[vt]) {
            continue;
        }
        int ds = ns.second;
        dst[vt] = ds;
        vis[vt] = true;
        for (int a : adj[vt]) {
            if (vis[a]) {
                continue;
            }
            q.push({a, ds + 1});
        }
    }
    return dst;
}

void solve() {
    int s, w;
    cin >> s >> w;
    if (w >= s) {
        cout << "unsafe" << endl;
        return;
    }
    cout << "safe" << endl;
}

void querySolve() {
    int n;
    cin >> n;
    while (n--) {
        solve();
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    //querySolve();
    solve();
}


Measured memory_bytes: 3684
a,b,k = [int(i) for i in input().split()]

if a+k-1<b-k+1:
    for i in range(a,a+k):
        print(i)
    for i in range(b+1-k, b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)
        


Measured memory_bytes: 3060
N,T = map(int,input().split())
food = list(list(map(int,input().split()))for i in range(N))
DP = [[0]*(T) for i in range(N+1)]
for i in range(N):
    a,b = food[i]
    for j in range(min(a,T)):
        DP[i+1][j] = DP[i][j]
    for j in range(a,T):
        DP[i+1][j] = max(DP[i][j],DP[i][j-a]+b)
ans = 0
i = N
j = T-1
while i > 0 and j > 0:
    if DP[i][j] == DP[i][j-1]:
        j -= 1
    elif DP[i][j] == DP[i-1][j]:
        i -= 1
    else:
        food[i-1][1] = 0
        j -= food[i-1][0]
        i -= 1
food.sort(reverse=True,key= lambda x:x[1])
print(DP[-1][-1]+food[0][1])

Measured memory_bytes: 119640
#include<bits/stdc++.h>
using namespace std;
int main()
{

   long long N, K;

   while(cin >> N >> K) {
      long long b, ans = 0;
      if(K == 0){
         cout << N * N << endl;
         continue;
      }
      for(b = K + 1; b <= N; b++) {
         long long x = (K == 0)? 1 : K;
         ans += (b - x) * (N / b);

         long long low = N / b * b;
         low = low + K;
         if(low <= N)
            ans += N - low + 1;
         //cout << ans << endl;
      }

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


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

for i in range(M):
  a, b = map(int, input().split())
  g[a-1].append(b-1)
  g[b-1].append(a-1)

memo = {}
All_used = (1 << N) - 1

def dfs(v, used):
  if used == All_used:
    return 1
  key = (v, used)
  if key in memo:
    return memo[key]
  ans = 0
  for u in g[v]:
    if (used >> u) & 1 ==1:
      continue
    used ^= (1 << u)
    ans += dfs(u, used)
    used ^= (1 << u)
  memo[key] = ans
  return ans

print(dfs(0, 1))

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

int main(){
    int n,m;
    cin >> n >> m;
    unordered_map<int,int> r,c;
    vector<string> arr;
    for(int i = 0; i < n; ++i){
        string a;
        cin >> a;
        arr.push_back(a);
    }
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            if(arr[i][j] != '.')break;
            if(j+1 == m)r[i]++;
        }
    }
    for(int i = 0; i < m; ++i){
        for(int j = 0; j < n; ++j){
            if(arr[j][i] != '.')break;
            if(j+1 == n)c[i]++;
        }
    }
    int i = 0;
    int j = 0;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            if(r[i] == 0 && c[j] == 0)cout <<  arr[i][j];
        }
        if(r[i] == 0)cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <string>
#include <utility>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstring>
#include <complex>
#include <queue>
#include <stack>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl

using namespace std;

const int mod=1e9+7;

void run();

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

signed main(){
    init();
    run();
    return 0;
}

void run(){
  int a,b;
  cin>>a>>b;
  if(a>12)cout<<b<<endl;
  else if(a>5)cout<<b/2<<endl;
  else cout<<0<<endl;
}


Measured memory_bytes: 256