akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    string s,t;cin>>s>>t;
    ll n=s.size(),m=t.size();
    vector<ll> a(n+1,0) , b(m+1,0);
    for(ll i=0;i<n;i++)a[i+1]=1 + (s[i]=='B');
    for(ll i=0;i<m;i++)b[i+1]=1 + (t[i]=='B');
    for(ll i=1;i<=n;i++)a[i]+=a[i-1];
    for(ll i=1;i<=m;i++)b[i]+=b[i-1];
    ll q;cin>>q;
    while(q--){
        ll l1,r1,l2,r2;cin>>l1>>r1>>l2>>r2;
        if( (a[r1]-a[l1-1]+3)%3 == (b[r2]-b[l2-1]+3)%3 )cout<<"YES\n";
        else cout<<"NO\n";
    }
}

Measured memory_bytes: 2512
#include <stdio.h>
#include <string.h>
int main(void){
	char tex[30];
	int pat[2][10000],p;
	for(p=0;p<10000;p++){
		pat[0][p]=0;pat[1][p]=0;
	}
	while(fgets(tex,30,stdin)!=NULL){
		if(tex[0]=='\n')break;
		sscanf(tex,"%d,%*d",&p);
		pat[0][p]++;
		pat[1][p]=1;

	}
	while(fgets(tex,30,stdin)!=NULL){
		sscanf(tex,"%d,%*d",&p);
		pat[0][p]++;
		if(pat[1][p]==1)pat[1][p]=2;
	}
	for(p=0;p<10000;p++){
		if(pat[1][p]==2)printf("%d %d\n",p,pat[0][p]);
	}
	return 0;
}

Measured memory_bytes: 680
def keisan(x):
  if x==1:
    return 300000
  elif x==2:
    return 200000
  elif x==3:
    return 100000
  else:
    return 0

X,Y=map(int,input().split())
ans=keisan(X)+keisan(Y)
if X==Y==1:
  ans+=400000
print(ans)


Measured memory_bytes: 9060
#pragma GCC optimize("Ofast")
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int INF=1e10;
int MOD=1e9+7;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
}
int kurai(int a,int b){
  int m=pow(10,b),n=pow(10,b-1);
  return (a%m)/n;
}
int ketawa(int a){
  int k=0;
  rep(i,keta(a)){
  k+=kurai(a,i+1);
  }
  return k;
}
int gcd(int a,int b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
int mid(int a,int b,int c){
  vector<int> k(3);
  k[0]=a;k[1]=b;k[2]=c;
  sort(all(k));
  return k[1];
}
bool sosuu(int a){
  bool b=1;
  if(a<=1)
    return 0;
  else{
  rep1(i,sqrt(a)-1){
  if(a%(i+1)==0)
  b=0;
  }
  return b;
  }
}
int modpow(int a,int b,int m=MOD){
 if(!b)return 1; if(b&1)return modpow(a,b-1,m)*a%m;
 int memo = modpow(a,b>>1,m);
 return memo*memo%m;
}
int fact_mod(int n) {
    int f=1; 
for(int i=2;i<n+1;i++) f=f*(i%MOD)% MOD;
    return f;
}
int mod_pow(int x,int n) {
    int res=1;
    while(n>0){
        if(n&1) res=(res*x)%MOD; 
        x=(x*x)%MOD;        
n>>=1; 
    }
    return res;
}
int c_mod(int n, int r) {
    if(r>n-r) r=n-r;
    if(r==0) return 1;
    int a=1;
    rep(i,r) 
a=a*((n-i)%MOD)%MOD;
    int b=mod_pow(fact_mod(r), MOD-2);
    return (a%MOD)*(b%MOD)%MOD;
}
signed main(){
  string a;
  cin>>a;
  int b=1;
  rep(i,a.size()-1){
  if(a[i]==a[i+1]&&a[i]=='R')
    b++;
  }
  if(a=="SSS")
    b=0;
  out(b);
}

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

int StoI(string a){
  int res=0;
  for(int i=a.size()-1;i>=0;i--)res=res*10+a[i];
  return res;
}

int main(){
  string a,b;
  int k;
  cin>>a>>b>>k;
  reverse(a.begin(),a.end()),reverse(b.begin(),b.end());
  int n=a.size();
  for(int i=b.size();i<n;i++) b+='0';
  
  int ans=-1;
  for(int bit=0;bit<(1<<n);bit++){
    string num;
    if(__builtin_popcount(bit)<=k)
      for(int i=0,borrow=0;i<n;i++){
	if(a[i]-borrow>=b[i]) num+=(a[i]-borrow-b[i]),borrow=0;
	else num+=(a[i]-borrow+10-b[i]),borrow=1;
	if((bit>>i)%2)borrow=0;
      }
    ans=max(ans,StoI(num));
  }
  cout <<ans<<endl;
  return 0; 
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

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


int main(){
    ll D;
    cin>>N>>D>>A;
    vector<P> xh(N);
    rep(i,N) {
        cin>>xh[i].fi>>xh[i].se;
        xh[i].fi += D + 10;
    }
    sort(ALL(xh));
    class BIT{
            ll n;
      		unordered_map<ll, ll> bitree;
        public:
        	BIT(unsigned long _n){
              n = _n;
            }
        	void add(ll id, ll x){
              while(id <= n){
                bitree[id] += x;
                id += id & -id;
              }
              return;
            }
        	ll sum(ll id){
              ll temp = 0;
              while(id > 0){
                temp += bitree[id];
                id -= id & -id;
              }
              return temp;
            }
      };
    BIT bit(D * 3 + 20 + 1e+9);
    ll ans = 0;
    rep(i,N){
        ll need = xh[i].se - (bit.sum(xh[i].fi + D) - bit.sum(xh[i].fi - D - 1)) * A;
        if(need > 0) {
            ll tnum = (need + A - 1) / A;
            ans += tnum;
            bit.add(xh[i].fi + D, tnum);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 141400
#include<bits/stdc++.h>
using namespace std;
#include <numeric> 
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"
#define int long long int
#define mod 1000000007
#define INT_BITS 16
#define inf 1000000099
#define pi 3.141592
#define watch(x) cout<<(#x)<<"="<<(x)<<"\n" 
#define pb push_back




int32_t main()
{
  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
  #endif
      int n;
      cin>>n;
      int a[n];
      int b[n];
      for (int i = 0; i < n; ++i)
      {
          cin>>a[i]>>b[i];
      }    
      sort(a,a+n);
      sort(b,b+n);
      int max,min;
      if(n%2!=0)
      {
         min=a[n/2];
         max=b[n/2];
      }
      else
      {
        min=a[n/2]+a[n/2-1];
      
        max=b[n/2]+b[n/2-1];
        
      }  

      cout<<max-min+1<<endl;
      

}

Measured memory_bytes: 6744
#include<stdio.h>
#define min(x,y)(x<y?x:y)
int ans = 999;
int func(int n,int res){
  int A[6]={ 59049, 6561, 729, 81, 9, 1};
  int B[9]={279936, 46656, 7776, 1296, 216, 36, 6, 1};
  int a,b,i;
  if(n <6){
    return ans=min(ans,res+n);
  }

  res++;
  for(i=0;A[i]>n;++i)1;a=A[i];
  for(i=0;B[i]>n;++i)1;b=B[i];
  //  printf("%d %d\n",a,b);
  func(n-a,res);
  func(n-b,res);
}

int main(){
  int N;
  scanf("%d",&N);
  printf("%d\n",func(N,0));
}

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

long long ans(int x) {
  long long y = 1;
  for(int i = 0; i < x / 2; i++){
    y *= 2;
    y %= 1000000007;
  }
  return y;
}

int main() {
  int n;
  cin >> n;
  
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
  }
  
  sort(a.begin(), a.end());
  
  bool ok = true;
  if(n % 2 == 0){
    for(int i = 0; i < n; i++){
      if(a.at(i) != i + ((i + 1) % 2)){
        ok = false;
        break;
      }
    }
  }
  else{
    if(a.at(0) != 0) ok = false;
    for(int i = 1; i < n; i++){
      if(a.at(i) != i + (i % 2)){
        ok = false;
      break;
      }
    }
  }
  
  if(!(ok)) cout << 0 << endl;
  else{
    cout << ans(n) << endl;
  }
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
map<string,int>mp;
int main(){
	mp["SUN"]=0;
	mp["MON"]=1;
	mp["TUE"]=2;
	mp["WED"]=3;
	mp["THU"]=4;
	mp["FRI"]=5;
	mp["SAT"]=6;
	string s;cin>>s;
	cout<<7-mp[s];
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a,b,c,d,x,y,z;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	x=a+b+c+d;
	y=x/60;
	z=x%60;
	printf("%d\n",y);
	printf("%d\n",z);
	return 0;
}

Measured memory_bytes: 2688
def main():
    N = int(input())
    B = [int(number) for number in input().split()]
    A = [B[0]]
    for i in range(N-1):
        if B[i] < A[i]:
            A[i] = B[i]
        A.append(B[i])
    print(sum(A))


if __name__ == '__main__':
    main()


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

int N, a[10] = {0}, ans = -1000000000, F[100][10], P[100][11];

void eval() {
	int sum = 0;

	for (int i = 0; i < 10; i++) {
		if (a[i] == 1)break;
		if (i == 9)return;
	}

	for (int n = 0; n < N; n++) {
		int m = 0;
		for (int i = 0; i < 10; i++) {
			if (F[n][i] == a[i] && a[i] == 1)
				m++;
		}
		sum += P[n][m];
	}
	ans = max(ans, sum);
}

void dfs(int p)
{
	if (p == 10) {
		eval();
		return;
	}

	a[p] = 0; dfs(p + 1);
	a[p] = 1; dfs(p + 1);
}

int main()
{
	cin >> N;

	for (int n = 0; n < N; n++) {
		for (int nn = 0; nn < 10; nn++) {
			cin >> F[n][nn];
		}
	}

	for (int n = 0; n < N; n++) {
		for (int nn = 0; nn < 11; nn++) {
			cin >> P[n][nn];
		}
	}

	dfs(0);

	cout << ans << endl;

	return 0;
}

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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#define itrout(x) for(int i=0;i<x.size();i++) {cout << x[i] << (i==x.size()-1 ? "\n" : " ");}
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define debugbit(x, n) cerr << #x << " = " << bitset<n>(x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define debugbit(x, n)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(long long T, std::vector<long long> N, std::vector<long long> M, std::vector<long long> A, std::vector<long long> B){
    rep(i,0,T) cout << atcoder::floor_sum(N[i], M[i], A[i], B[i]) << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    long long T;
    scanf("%lld",&T);
    std::vector<long long> N(T-1-0+1);
    std::vector<long long> M(T-1-0+1);
    std::vector<long long> A(T-1-0+1);
    std::vector<long long> B(T-1-0+1);
    for(int i = 0 ; i < T-1-0+1 ; i++){
        scanf("%lld",&N[i]);
        scanf("%lld",&M[i]);
        scanf("%lld",&A[i]);
        scanf("%lld",&B[i]);
    }
    solve(T, std::move(N), std::move(M), std::move(A), std::move(B));
    return 0;
}


Measured memory_bytes: 5236
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
constexpr bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
constexpr bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << "\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll k;
  cin >> k;
  string s;
  cin >> s;
  if(SZ(s)<=k){
    print(s);
  }else{
    print(s.substr(0, k)+"...");
  }
}


Measured memory_bytes: 3644
#include<bits/stdc++.h>
#include <cstdio>   
#define pb          push_back 
#define endl        "\n"
#define mostrar(x,y) cout<<x<<" "<<y<<endl;
#define f           first
#define s           second
#define mod         1000000007
#define EPS         1e-9
using namespace std;
typedef pair<int,int> ii;
typedef pair<pair<int,int>,int> iii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef long long ll;
 
vi numeros;


int main(){
    ofstream out("output.txt");
    
    
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n*a,b)<<endl;


    return 0;
}
 
 







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

int main() {
  int N, l, r;
  int x = 0;
  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> l >> r;
    x += (r - l) + 1;
  }
  cout << x << endl;
}

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

public class Main {
  private static long solve(int n, int p, int[] a) {
    long[] answer = new long[]{1, 0};
    for (int a0 : a) {
      long[] nextAnswer = new long[2];
      if (a0 % 2 == 0) {
        nextAnswer[0] = 2 * answer[0];
        nextAnswer[1] = 2 * answer[1];
      } else {
        nextAnswer[0] = answer[1] + answer[0];
        nextAnswer[1] = answer[1] + answer[0];
      }
      answer = nextAnswer;
    }
    return answer[p];
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int p = reader.nextInt();
    int[] a = reader.nextIntArray(n);
    out.println(solve(n, p, a));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public int[] nextIntArray(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLongArray(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
}

class Algorithm {
  private static void swap(Object[] list, int a, int b) {
    Object tmp = list[a];
    list[a] = list[b];
    list[b] = tmp;
  }
  
  public static <T extends Comparable<? super T>> boolean nextPermutation(T[] ts) {
    int rightMostAscendingOrderIndex = ts.length - 2;
    while (rightMostAscendingOrderIndex >= 0 &&
        ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostAscendingOrderIndex + 1]) >= 0) {
      rightMostAscendingOrderIndex--;
    }
    if (rightMostAscendingOrderIndex < 0) {
      return false;
    }
    
    int rightMostGreatorIndex = ts.length - 1;
    while (ts[rightMostAscendingOrderIndex].compareTo(ts[rightMostGreatorIndex]) >= 0) {
      rightMostGreatorIndex--;
    }
    
    swap(ts, rightMostAscendingOrderIndex, rightMostGreatorIndex);
    for (int i = 0; i < (ts.length - rightMostAscendingOrderIndex - 1) / 2; i++) {
      swap(ts, rightMostAscendingOrderIndex + 1 + i, ts.length - 1 - i);
    }
    return true;
  }
}



Measured memory_bytes: 22228
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0))
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a))
#define Reverse(a) reverse(All(a))
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define Lower(a,t) lower_bound(All(a),t)
using namespace std;
void Debug(auto a);


signed main(){
    int n;
    cin >> n;
    string a;
    cin >> a;
    int b = 0;
    int r = 0;
    REP(i,n){
        if(a[i] == 'R'){
            r++;
        }
        else{
            b++;
        }
    }
    if(r>b){
        cout << "Yes" << endl;
    }
    else{
        cout<<"No" << endl;
    }

    return 0;
}



void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}


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

int main() {
  int N, pointer = 1, counter = 1;
  bool notendby2 = true;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  for (; counter < N + 1; counter++) {
    pointer = a.at(pointer - 1);
    if (pointer == 2) {
      notendby2 = false;
      cout << counter << endl;
      break;
    }
  }
  if (notendby2) {
    cout << -1 << endl;
  }
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		String[] str = line.split(" ");
		int X = Integer.parseInt(str[0]);
		int A = Integer.parseInt(str[1]);
		if (X < A) {
			System.out.println(0);
		}
		else {
			System.out.println(10);
		}
	}
}


Measured memory_bytes: 21204
function main(input) {
  let args = input.split('\n');
  let x = 0;
  let [a, v] = args[x++].split(' ');
  let [b, w] = args[x++].split(' ');
  let t = BigInt(args[x++]);
  let maxA = BigInt(a) + BigInt(v) * t;
  let maxB = BigInt(b) + BigInt(w) * t;
  let minA = BigInt(a) - BigInt(v) * t;
  let minB = BigInt(b) - BigInt(w) * t;
  if (maxA < maxB || minA > minB) {
    console.log('NO');
  } else {
    console.log('YES');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29628
import java.util.*;
import java.awt.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(in);
        int n=sc.nextInt();
        int[] v=new int[n];
        HashMap<Integer,Integer> mapE=new HashMap<>();
        HashMap<Integer,Integer> mapO=new HashMap<>();
        HashMap<Integer,Integer> map=new HashMap<>();
        for (int i = 0; i < n; i++) {
            v[i]=sc.nextInt();
            map.put(v[i], map.getOrDefault(v[i], 0)+1);
            if(i%2==0){
                mapE.put(v[i],mapE.getOrDefault(v[i], 0)+1);
            }else{
                mapO.put(v[i], mapO.getOrDefault(v[i],0)+1);
            }
        }
        
        int Emax=0,Omax=0;
        for(int k:mapE.keySet()){
            Emax=max(Emax,mapE.get(k));
        }
        for(int k:mapO.keySet()){
            Omax=max(Omax,mapO.get(k));
        }
        int tmpE=0,tmpO=0;
        for(int k:mapE.keySet()){
            if(mapE.get(k)==Emax)tmpE=k;
        }
        for(int k:mapO.keySet()){
            if(mapO.get(k)==Omax)tmpO=k;
        }
        int Emax2=0,Omax2=0;
        for(int k:mapE.keySet()){
            if(k!=tmpO)Emax2=max(Emax2,mapE.get(k));
        }
        for(int k:mapO.keySet()){
            if(k!=tmpE)Omax2=max(Omax2,mapO.get(k));
        }
        out.println(min(n-Omax-Emax2,n-Omax2-Emax));
    }
}


Measured memory_bytes: 68648
import fractions
a,b,c,d = map(int,input().split())
cc = b//c - (a-1)//c
dd = b//d - (a-1)//d
lcm = c*d // fractions.gcd(c,d)
gcd = b//lcm - (a-1)//lcm
print(b-a+1-(cc+dd-gcd))

Measured memory_bytes: 5048
def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return list[mid]
        if guess > item:
            high = mid -1
        else:
            low = mid + 1

    return None

#10**5までの素数リストを作成

mx_int = 10**5
import math
li = [True for i in range(mx_int+1)]

for i in range(2,int(math.sqrt(mx_int))+1):
    if (li[i]):
        j = 2
        while (i*j <= mx_int):
            li[i*j] = False
            j+= 1

li2 = []
for i in range(2,mx_int+1):
    if li[i]:
        li2.append(i)

li3 = []
for i in range(len(li2)):
    if (binary_search(li2,(li2[i]+1)//2)):
        li3.append(li2[i])
li3.append(0)

ans = []
flg = 0
for i in range(mx_int+1):
    if i == li3[flg]:
        flg += 1
    ans.append(flg)

    
q = int(input())
for i in range(q):
    l,r = map(int,input().split())
    print(ans[r]-ans[l-1])

Measured memory_bytes: 5504
#include <bits/stdc++.h>
#define FOR(v, a, b) for(int v = (a); v < (b); ++v)
#define FORE(v, a, b) for(int v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(int v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define ITR(it, c) for(auto it = (c).begin(); it != (c).end(); ++it)
#define RITR(it, c) for(auto it = (c).rbegin(); it != (c).rend(); ++it)
#define EXIST(c,x) ((c).find(x) != (c).end())
#define LLI long long int
#define fst first
#define snd second

#ifdef DEBUG
#include <misc/C++/Debug.cpp>
#else
#define dump(x) ((void)0)
#endif

#define gcd __gcd

using namespace std;
template <class T> constexpr T lcm(T m, T n){return m/gcd(m,n)*n;}

template <typename I> void join(ostream &ost, I s, I t, string d=" "){for(auto i=s; i!=t; ++i){if(i!=s)ost<<d; ost<<*i;}ost<<endl;}
template <typename T> istream& operator>>(istream &is, vector<T> &v){for(auto &a : v) is >> a; return is;}
template <typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){is >> p.first >> p.second; return is;}

template <typename T, typename U> bool chmin(T &a, const U &b){return (a>b ? a=b, true : false);}
template <typename T, typename U> bool chmax(T &a, const U &b){return (a<b ? a=b, true : false);}
template <typename T, size_t N, typename U> void fill_array(T (&a)[N], const U &v){fill((U*)a, (U*)(a+N), v);}

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

  int N;
  while(cin >> N){
    vector<string> s(N); cin >> s;

    int ans = 0;

    for(auto &t : s){
     REP(i,(int)t.size()-1){
	if(t[i]=='A' and t[i+1]=='B') ++ans;
      }
    }

    int A=0, B=0, BA=0;

    for(auto &t : s){
      if(t.front() == 'B' and t.back() == 'A') ++BA;
      else{
	if(t.front() == 'B') ++B;
	if(t.back() == 'A') ++A;
      }
    }

    dump(A);
    dump(B);
    dump(BA);

    ans += max(0,BA-1);
    if(BA){
      if(A){
	++ans;
	--A;
      }
      if(B){
	++ans;
	--B;
      }
    }

    ans += min(A,B);


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


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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

ll T[100005][35];
ll S[100005];

int main()
{
    int N, C;
    cin >> N >> C;
    REP(i, N)
    {
        int s, t, c;
        cin >> s >> t >> c;
        c--;
        T[s][c]++;
        T[t][c]--;
    }
    ll max = 0;
    REP(i, 100005)
    {
        REP(j, C)
        {
            if (T[i][j] > 0)
                S[i - 1]++;
            else if (T[i][j] < 0)
                S[i]--;
        }
        if (i > 0)
            S[i] += S[i - 1];
    }
    REP(i, 100005)
    {
        max = std::max(max, S[i]);
    }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 28416
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=1LL<<60;
const double EPS = 1e-10;
const ll mod=1000000007;

ll dp[3010][3010]={};

int main(void){
    string s,t;
    cin>>s>>t;
    for(int i=0;i<s.size();i++){
        for(int j=0;j<t.size();j++){
            if(s[i]==t[j]) dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+1);
            dp[i+1][j+1]=max(dp[i+1][j+1],dp[i+1][j]);
            dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j+1]);
        }
    }
    string ans="";
    int i=s.size(),j=t.size();
    while(i>0&&j>0){
        if(dp[i][j]==dp[i-1][j]) i--;
        else if(dp[i][j]==dp[i][j-1]) j--;
        else{
            ans=s[i-1]+ans;
            i--,j--;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 74224
#include <bits/stdc++.h>
using namespace std;
 
int s(int n) {
  int tot = 0;
  while (n) {
    tot += n % 10;
    n /= 10;
  }
  return tot;
}
 
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
 
  int n;
  cin >> n;
  string ans = (n % s(n)) ? "No" : "Yes";
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
s=gets.chomp.to_s.chars
sum=0
[0, 1].repeated_permutation(s.size-1) do |bits|
  j=0
  x=[]
  k=0
  bits.each do |i|
    if i==1 then
      x << s[j..k].join.to_s
      j=k+1
    end
    k+=1
  end
  x << s[j..s.size-1].join.to_s
  sum+=x.map(&:to_i).inject(:+)
end
puts sum

Measured memory_bytes: 2172
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin>>N;
    long long int a[N];
    int i,c=0;
    for( i=0;i<N;i++)
    {
        cin>>a[i];
    }
    for( i=0;i<N-1;i++)
    {
        if(a[i]<a[i+1])
            a[i+1]--;
        if(a[i]<=a[i+1])
            c++;
    }
    if(c==N-1)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


Measured memory_bytes: 1024
#include <iostream>

int main(void)
{
  int a, b, k;
  std::cin >> a >> b >> k;
  int last = 0;
  for (int i = 0; i < k; ++i)
  {
    last = a + i;
    if (last <= b)
    {
	    std::cout << last << std::endl;
    }
  }
  for (int i = 0; i < k; ++i)
  {
    int c = b - k + i + 1;
    if (last < c)
    {
	    std::cout << c << std::endl;
    }
  }
}

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

using namespace std;

#define PB	push_back
#define ALL(x)	(x).begin(), (x).end()
#define ALLR(x)	(x).rbegin(), (x).rend()
#define MP	make_pair

#define debug(args...) { string _s = #args; replace(ALL(_s), ',', ' '); stringstream ss(_s); cerr << endl;_debug(ss, args); }
#define _rg auto it = next(v.begin()); it != v.end(); it++
#define _input ostream& operator <<(ostream& out

template<typename T, typename U>
_input, const pair<T, U>& p) {
	out << "(" << p.first << ", " << p.second << ")";
	return out;
}

#define cont(c) template<typename T> _input, const c<T>& v) { \
					if (v.empty()) return out; \
					out << "[" << *v.begin(); \
					for (_rg) out << ", " << *it; \
					out << "]"; return out; \
				}
				
#define cont2(c) template<typename T, typename U> _input, const c<T, U>& v) { \
					if (v.empty()) return out; \
					out << "[" << *v.begin(); \
					for (_rg) out << ", " << *it; \
					out << "]"; return out; \
				}

cont(vector) cont(set) cont(multiset) cont(queue) cont2(map)

template<typename T, size_t n, typename= enable_if_t<!is_same<T, char>::value>>
_input, const T(&v)[n]) {
	if (n == 0) return out;
	out << "[" << v[0];
	for (int i = 1; i < (int)n; i++) out << ", " << v[i];
	out  << "]"; return out;
}

template<typename T, typename... Ts>
void _debug(stringstream& ss, const T &arg) {
	string name; ss >> name;
	cerr << name << " = " << arg << endl;
}

template<typename T, typename... Ts>
void _debug(stringstream& ss, const T& arg, const Ts&... args) {
	string name; ss >> name; 
	cerr << name << " = " << arg << ", ";
	if (is_class<T>::value || is_array<T>::value) cerr << endl;
	_debug(ss, args...);
}

#define FAST_IO ios::sync_with_stdio(false); cin.tie(0)

#define int long long int

typedef pair<int, int> ii;
typedef pair<pair<int, int>, int> iii;
typedef vector<int> vi;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef unsigned long long ull;

const int INF = LONG_LONG_MAX>>1;
const int NINF = LONG_LONG_MIN/2;
const double PI = 3.141592653589793238;

int32_t main() {
	FAST_IO;

	int a, b;
	cin >> a >> b;
	
	cout << a*b << endl;
}
// g++ -Wall -Wextra -Wshadow -fsanitize=undefined -std=c++17


Measured memory_bytes: 3616
#include <bits/stdc++.h>
typedef long long ll;

using namespace std;

const ll inf=1000000007;

inline int read()
{
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9')
    {
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x*f;
}

int main()
{
    int n, x, t;
    scanf("%d%d%d",&n,&x,&t);
    int bi=n/x;
    if(n%x!=0)
    {
        bi++;
    }
    cout << bi*t << endl;
    return 0;
}


Measured memory_bytes: 3760
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n >> x;
  ll mi = LINF;
  rep(i, n) {
    cin >> a;
    mi = min(mi, a);
    x -= a;
    ans++;
  }
  ans += x / mi;
  Cout(ans);
  return 0;
}

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

#define gc getchar 
#define pc putchar
#define fRead	freopen("input.txt","r",stdin) 
#define fWrite	freopen ("output.txt","w",stdout)
#define LL              long long
#define PI              acos(-1.0)
#define pb              push_back
#define pii             pair<int,int>
#define pLL             pair<LL,LL>
#define f              	first
#define s              	second
#define FastRead        ios_base::sync_with_stdio(0);cin.tie(0)
#define vi              vector <int>
#define vL              vector <LL>

using namespace std;
#define scani2(a,b) scani(a) , scani(b)
#define scani3(a,b,c) scani(a), scani(b), scani(c)
#define scani4(a,b,c,d) scani(a), scani(b), scani(c), scani(d)
#define scani5(a,b,c,d,e) scani(a), scani(b), scani(c), scani(d) , scani(e)
template <typename T> T scani(T &n){n = 0;bool negative = false;char c = gc();while( c < '0' || c > '9'){if(c == '-') negative = true;c = gc();}while(c >= '0' && c <= '9'){n = n*10 + c-48;c = gc();}if(negative) n = ~(n-1);return n;}
template <typename T> void write(T n,int type = true){if(n<0) {pc('-');n = -n;}if(!n) {pc('0');if(type==32) pc(' '); else if(type) pc('\n'); return;}char buff[22];int len = 0;while(n) buff[len++] = n%10+48,n/=10;for(int i=len-1;i>=0;i--) pc(buff[i]);if(type==32) pc(' '); else if(type) pc('\n');}
int scans(char *a){int i=0;char c = 0;while(c < 33) c = gc();while(c > 33){a[i++] = c;c = gc();}a[i] = 0;return i;}
const int MOD = 1e9 + 7;


int main() {
	int a,b,c,d; scani4(a,b,c,d);
	write(max(0,min(b,d) - max(a,c)));
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
  
void outline(int n) 
{
  for(int i=0;i<n;i++) {
    cout << "#";
  }
  cout<<endl;
}
int main() {
  int H, W;
  vector<string> c(0);
  cin>>H>>W;
  for(int i=0;i<H;i++) {
    string x;
    cin >> x;
    c.push_back(x);
  }
  outline(W+2);
  for(int i=0;i<H;i++) {
    cout<<"#"<<c.at(i)<<"#"<<endl;
  }
  outline(W+2);
}


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

int main(){
    int n,k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n) cin >> a.at(i);
    sort(a.begin(),a.end());
    int ans = 0;
    rep(i,k) ans += a.at(i);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#ifdef __DEBUG__
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 1,-1, 1,-1};
int dy[]={0, 1, 0, -1, 1, 1,-1,-1};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const map<T, S> p) { for (auto el : p) cout << "[" << el.first << ";" << el.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const deque<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const set<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int N;
string S;
void input(){
    fast_io();
    cin >> N >> S;
}

int solve(){
    int ans = 0;
    int x = 0;
    for (int i = 0; i < N; i++)
    {
        if(S[i]=='I') x++;
        else x--;
        ans = max(ans,x);
    }
    cout << ans << endl;
    
    return 0;
}   

int main()
{
    input();
    solve();
    return 0;
}

Measured memory_bytes: 256
// Sun May 17 14:33:59 IST 2020      
#include <bits/stdc++.h>        
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define forn(ii,a,b)        for(int ii = (int)a ; ii < (int)b  ; ii++ )
#define debug(x)           cerr << #x << " " << x << " -- \n"
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define int64              long long    
#define MOD                998244353 
#define pb                 push_back
#define f1                 first 
#define s1                 second    
#define all(x)             (x).begin(),(x).end() 
#define precise(x)         cout << fixed << setprecision(12) << x << '\n'; 
#define tough_nut          numeric_limits<int64>::min()
const double pi = 3.141592653589793238;
using namespace std ;     
using namespace __gnu_pbds;
 
typedef tree<pair <int,int>,null_type,less<pair <int,int>>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
const int N = 1e6+3; 
const int INF = INT_MAX;
struct comp{
    bool operator()(const int A,const int& B )const{
        return A > B; 
    }
};    
int tests(){   
    int n ;
    cin >> n ;
    vector <int> a(n),b(n);
    for(auto &x: a)
        cin >> x;
    for(auto &x: b)
        cin >> x ; 
    vector <int> p ;
    for(int i = 1 ; i <= n ; i++)
        p.push_back(i);
    int c = 0 ;
    vector <int> ans ;
    do{
        if(p == a || p == b)
            ans.push_back(c);
        c++ ;

    } while(next_permutation(all(p)));
    if(ans.size() == 1) 
        return cout << 0 ,0;
    cout << abs(ans[0]-ans[1]) << '\n';
    return 0;
}  
int32_t main(){
    I__O ;     
    int cases = 1 ;  
    // cin >> cases ;  
    while(cases--){    
        tests(); 
    }
    return 0 ; 
}
 
// -Wall -Wextra -O2
// -pedantic -std=c++11
// -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

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

int main(int argc, const char * argv[]) {
    int n;
    cin >> n;
    int N = n;
    int Sn = 0;
    int cache;
    for(int i = 9; i >= 0; i--){
        cache = (n / ((int)pow(10,i)));
        Sn += cache;
        n -= (cache * (int)pow(10, i));
    }
    if(N % Sn == 0){
        cout << "Yes";
    }else{
        cout << "No";
    }
}



Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        String sa = "";
        String sb = "";
        for(int i = 0;i < b;i++){
            sa += String.valueOf(a);
        }
        for(int i = 0;i < a;i++){
            sb += String.valueOf(b);
        }
        System.out.println(a>=b?sb:sa);
    }
}

Measured memory_bytes: 21972
import math
X=int(input())
if X==2:
  print(2)
  exit()
i=X
while i>0:
  flag=True
  for j in range(2,int(math.sqrt(i))+2):
    if i%j==0:
      flag=False
      break
  if flag==True:
    print(i)
    exit()
  i+=1

Measured memory_bytes: 3060
package main
 
import (
	"fmt"
)
 
func pow(x, n, mod int64) int64 {
	if n == 0 {
		return 1
	}
	xx := x * x % mod
	r := pow(xx, n/2, mod)
	if n%2 == 1 {
		r = x * r % mod
	}
	return r
}
 
const mod = 1e9 + 7
 
func main() {
	var n int
	fmt.Scan(&n)
 
	fmt.Println(3 * n * n)
 
}

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, a[101010], b[101010], c[101010];
i64 bc[101010], d[101010];
void solve(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	for(int i = 0; i < n; i++){
		cin >> b[i];
	}
	for(int i = 0; i < n; i++){
		cin >> c[i];
	}
	sort(a,a+n);
	sort(b,b+n);
	sort(c,c+n);
	
	int A = 0,B = 0,C = 0;
	i64 ans = 0;
	for(; B < n; B++){
		while(C < n && b[B] >= c[C]) C++;
		bc[B] = n-C;
	}
	for(int i = n-1; i >= 0; i--){
		d[i] = d[i+1] + bc[i];
	}
	B = 0;
	for(; A < n; A++){
		while(B < n && a[A] >= b[B]) B++;
		ans += d[B];
	}
	cout << ans << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 3072
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;

using namespace std;

int main(void){
    string S;
    cin >> S;
    ll len = S.length();
    ll filt = 1000000007;
    ll DP_TABLE[100005][13];
    MEMSET(DP_TABLE, 0);
    DP_TABLE[0][0] = 1;
    ll nxt;
    rep(i, len){
        if(S[i] == '?'){
            rep(t, 10){
                rep(j, 13){
                    nxt = (10*j+t)%13;
                    DP_TABLE[i+1][nxt] += (DP_TABLE[i][j]%filt);
                }
            }
        } else{
            rep(j, 13){
                nxt = (10*j+(S[i]-'0'))%13;
                DP_TABLE[i+1][nxt] += (DP_TABLE[i][j]%filt);
            }
        }
     }
    cout << (DP_TABLE[len][5]%filt) << endl;
    return 0;
}


Measured memory_bytes: 10624
#include <iostream> 
using namespace std; 
int main() 

{ 
   int i, h, m, s; 
   cin >> i; 
   h=i/60/60; 
   m=i/60-h*60; 
   s=i-h*60*60-m*60; 
  cout<< h << ":" << m << ":" << s << endl; 
   return 0; 
} 


Measured memory_bytes: 3084
#include <stdio.h>

typedef struct
{
	int flip;//裏表??boolでもOK??
	long long rotate;
} Query;

long long n, k, q;

Query tree[(1 << 20) * 2];//20回左シフトして2倍??

void  build(long long _n);
Query merge(Query a, Query b);
void  update(Query data, long long i);
Query sum(void);

int main()
{
	long long _n;
	long long a;

	//区間の個数、カードの枚数、命令の個数
	scanf("%lld %lld %lld", &k, &_n, &q);

	build(_n);

	for (long long i = 0; i < _n; i++) 
	{
		scanf("%lld", &a);//カード（山札）の数字
		Query data = { 0, 0 };//構造体宣言初期化

		if (a == 0)
		{
			data.flip = 1;//裏返ったらflipを1にする
		}
		else
		{
			data.rotate = -a;
		}

		update(data, i);
	}

	for (long long i = 0; i < q; i++) 
	{
		long long left, right;
		Query l, r;
		scanf("%lld %lld", &left, &right);
		left--;
		right--;

		l = tree[left + n - 1];
		r = tree[right + n - 1];

		update(l, right);
		update(r, left);


		Query total = sum();

		long long num;
		if (total.rotate < 0) total.rotate = k + total.rotate;
		num = 1 + total.rotate;

		if (total.flip) 
		{
			if (num == 1)
			{
				num *= -1;
			}
			else
			{
				num = ((k + 2) - num) * -1;
			}
		}

		printf("%lld\n", num);
	}
	return 0;
}

void  build(long long _n)//カードの枚数引数
{
	n = 1;//グローバル変数

	while (n < _n) //n<3である限り続く
	{
		n *= 2;//n==4になる
	}

	for (long long i = 0; i < 2 * n; i++) 
	{
		tree[i] = (Query){ 0, 0 }; //tree[0]～tree[7]まで作成
	}

	return;
}

Query merge(Query a, Query b)
{
	Query x;

	x.flip = (a.flip + b.flip) % 2;

	if (b.flip)//裏表判別
	{
		x.rotate = (b.rotate - a.rotate) % k;//表
	}
	else 
	{
		x.rotate = (a.rotate + b.rotate) % k;//裏
	}

	return x;
}

void update(Query data, long long i)
{
	i += n - 1;//

	tree[i] = data;//グローバルtree[]にdata格納

	while (i != 0) 
	{
		i = (i - 1) / 2;
		tree[i] = merge(tree[i * 2 + 1], tree[i * 2 + 2]);
	}

	return;
}

Query sum(void)
{
	return tree[0];
}



Measured memory_bytes: 5948
#include<stdio.h>
#include<stdlib.h>

int main()
{
    int H,W;
    while(1)
    {
         scanf("%d %d",&H,&W);
         if(H == 0 && W == 0)
              exit(0);
         for(int i=0;i<H;i++)
         {
              for(int j=0;j<W;j++)
              {
                   printf("#");
              }
              printf("\n");
         }
         printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2052
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N,M; cin>>N>>M;
    vint x(M); REP(i,M) cin>>x[i];
    sort(ALL(x));

    if(N>=M){
        cout<<0<<endl;
        return 0;
    }

    vint l(M-1);
    REP(i,M-1) l[i]=x[i+1]-x[i];
    sort(ALL(l),greater<int>());

    int ans=x[M-1]-x[0];
    REP(i,N-1) ans-=l[i];
    cout<<ans<<endl;
 
}


Measured memory_bytes: 1792
#include <stdio.h>          // printf(), scanf()
#include <stdbool.h>

#define MAX_M 7
#define MAX_N 1000

int m;
int a[MAX_M];
int b[MAX_M];

int
solve(int n)
{
	int dp[MAX_M + 1][MAX_N + 1];

	for (int i = 0; i <= m; ++i)
	{
		for (int j = 0; j <= n; ++j)
			dp[i][j] = 0;
	}

	dp[0][0] = 1;
	for (int i = 0; i < m; ++i)
	{
		for (int j = 0; j <= n; ++j)
		{
			if (dp[i][j] != 0)
			{
				int s = j;
				for (int k = b[i]; k >= 0 && s <= n; --k, s += a[i])
					dp[i + 1][s] += dp[i][j];
			}
		}
	}

	return dp[m][n];
}

int
main(int argc, char **argv)
{
	while (true)
	{
		scanf("%d", &m);
		if (m == 0)
			break;

		for (int i = 0; i < m; ++i)
			scanf("%d%d", &a[i], &b[i]);

		int g;
		int n;
		scanf("%d", &g);
		for (int i = 0; i < g; ++i)
		{
			scanf("%d", &n);
			printf("%d\n", solve(n));
		}
	}

	return 0;
}


Measured memory_bytes: 1704
import java.util.*;

public class Main {
	static class Range {
		int size;
		long lv, rv;
		int lp, rp;
		public Range(int size, long lv, long rv) {
			this.size = size;
			this.lv = lv;
			this.rv = rv;
		}
		
	}
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
 
		int N = sc.nextInt();
		long[] A = new long[N];
		for(int i=0; i<N; i++)
			A[i] = sc.nextLong();
		
		long[][] dp = new long[2][];
		
		dp[0] = dp(A);
		long[] B = new long[A.length];
		for(int i=0; i<N; i++)
			B[i] = A[N-1-i];
		dp[1] = dp(B);
		
		long ans = Long.MAX_VALUE;
		for(int i=0; i<=N; i++)
			ans = Math.min(ans, dp[0][i]+dp[1][N-i]+i);
		
		System.out.println(ans);
		sc.close();
	}
	
	public static long[] dp(long[] A) {
		int N = A.length;
		long[] ans = new long[N+1];
		
		LinkedList<Range> list = new LinkedList<>();
		ans[N] = 0;
		for(int i=N-1; i>=0; i--) {
			ans[i] = ans[i+1];
			list.push(new Range(1, A[i], A[i]));
			
			while(list.size() > 1) {
				Range cur = list.pop();
				if(compare(cur.rv, cur.rp, list.peek().lv, list.peek().lp)<=0) {
					list.push(cur);
					break;
				}
				Range next = list.pop();
				while(compare(cur.rv, cur.rp, next.lv, next.lp)>0) {
					next.lp+=2;
					next.rp+=2;
					ans[i] += 2*next.size;
				}
				cur.size += next.size;
				cur.rv = next.rv;
				cur.rp = next.rp;
				list.push(cur);
			}
		}
 
		return ans;
	}
	
	public static int compare(long lv, int lp, long rv, int rp) {
		int pdiff = lp-rp;
		if(pdiff>=0) {
			if(pdiff>=30)
				return 1;
			else
				return Long.compare(lv<<pdiff, rv);
		} else {
			if(pdiff<=-30)
				return -1;
			else
				return Long.compare(lv, rv<<(-pdiff));
		}
	}
}


Measured memory_bytes: 103416
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std;

signed main(){
    cin.tie(0); 
    ios::sync_with_stdio(false);
    int a,b,c;
    cin >> a >> b >> c;
    if(a + b + c >= 22){
        cout << "bust\n";
    }else{
        cout << "win\n";
    }
    return 0;
}


Measured memory_bytes: 256