akhauriyash/Code-Regression huggingface dataset:
///////////////////////////////////////////////////////////
#include <algorithm>
#include <array>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
///////////////////////////////////////////////////////////
#define ll long long
#define ull insigned lon long
///////////////////////////////////////////////////////////
int absolute(int n);
void input(vector<int>& vec);
void print(vector<int> vec);
void upsort(vector<int>& vec);
void downsort(vector<int>& vec);
int maxvec(vector<int> vec);
int minvec(vector<int> vec);
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
int main()
{
    int N;
    int L;
    cin >> N >> L;
    vector<int> v(N);
    for (size_t i = 0; i < N; ++i) {
        v.at(i) = absolute(L + i);
    }
    int m = minvec(v);
    int n;
    for (size_t i = 0; i < N; ++i) {
        if (L + i == m || -L - i == m) {
            n = i;
        }
    }
    cout << N * (2 * L + N - 1) / 2 - L - n << endl;
    return 0;
}
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
int absolute(int n)
{
    if (n < 0) {
        return (-n);
    }
    return n;
}

void input(vector<int>& vec)
{
    for (size_t i = 0; i < vec.size(); ++i) {
        cin >> vec.at(i);
    }
}

void print(vector<int> vec)
{
    for (size_t i = 0; i < vec.size(); ++i) {
        cout << vec.at(i) << " ";
    }
    cout << endl;
}

void upsort(vector<int>& vec)
{
    sort(vec.begin(), vec.end());
}

void downsort(vector<int>& vec)
{
    sort(vec.begin(), vec.end(), greater<int>());
}

int maxvec(vector<int> vec)
{
    int m = vec.at(0);
    for (size_t i = 0; i < vec.size(); ++i) {
        m = max(m, vec.at(i));
    }
    return m;
}

int minvec(vector<int> vec)
{
    int m = vec.at(0);
    for (size_t i = 0; i < vec.size(); ++i) {
        m = min(m, vec.at(i));
    }
    return m;
}
///////////////////////////////////////////////////////////

Measured memory_bytes: 256
#include <stdio.h>
#include<stdlib.h>
#include <string.h>
#define length 100005
 
// プロセスを表す構造体
typedef struct aa{
    char name[100];
    int t;
} a;
 
// aと同じ構造で長さがlengthの構造体qを作る
a q[length];
int head, tail, n;
 
// 引数がaとxであり，xをqの末尾につけ，末尾を指すインデックスの数字を一つ増やし，あまりをだす
void enqueue(a x){
    q[tail] = x;
    tail = (tail + 1) % length;
}
 
// aの構造体でxを参照し，qの先頭をaのxに加え，先頭の大きさを一つ増やす
a dequeue() {
    a x = q[head];
    head = (head + 1) % length;
    return x;
}
 
int min(int a, int b) { return a < b ? a : b; } //最小値を返す
 
int main(){
    int e = 0;
    int c;
    int i, q1;
    a u;
    scanf("%d %d", &n, &q1);
 
    //すべてのプロセスをキューに順番に追加する
    for ( i = 1; i <= n; i++){
        scanf("%s",q[i].name);
        scanf("%d", &q[i].t);
    }
    head = 1; tail = n + 1;
 
    // シミュレーション
    while ( head != tail){
        u = dequeue();
        c = min(q1, u.t);  // qまたは必要な時間 u.t だけ処理を行う
        u.t -= c; // 残りの必要時間を計算
        e += c;  // 経過時間を加算
        if (u.t > 0) enqueue(u);  // 処理が完了していなければキューに追加
        else{
            printf("%s %d\n", u.name, e);  // 名前と経過時間を出力
        }
    }
 
    return 0;
}


Measured memory_bytes: 11888
# 1. 最大公約数を求める(ユークリッドの互除法)
# 2. 最大公約数を2と3以上の奇数で順次割っていくする（下から計算したら、素数判定は不要）
# 3. 2.の結果に含まれる数の種類の数＋１が答え

def main():
  a, b = map(int, input().split())
  while b != 0: a, b = b, a % b #最大公約数を求める
  print(num_facto(a) + 1)  
  
def num_facto(n):
  ans = 0
  
  if n == 1: return ans
  
  cursor = 2
  if n % cursor == 0: ans += 1
  while n % cursor == 0: n = n // cursor
  
  cursor = 3
  while cursor ** 2 <= n:
    if n == 1: break
    if n % cursor == 0: ans += 1
    while n % cursor == 0: n = n // cursor
    cursor += 2
  
  if n != 1: ans += 1
    
  return ans

if __name__ == "__main__":
  main()


Measured memory_bytes: 38512
N, X = map(int, input().split())
L = [int(x) for x in input().split()]
D = [0 for _ in range(N+1)]
cnt = 0

for i in range(1, N+1):
    D[i] = D[i-1] + L[i-1]

for d in D:
    if d <= X:
        cnt += 1
    else:
        break

print(cnt)

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

int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0; i<n; i++){
        cin>>arr[i];
    }
    int sum = 0;

    for(int i=0; i<n-1; i++){
        for(int j=i+1; j<n; j++){
            sum += (arr[i]*arr[j]);
        }
    }
    cout<<sum<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
    int n,x,a[100000];
    cin>>n>>x;
    long long ans=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(i==0){
            if(x<a[0]){
                ans+=a[0]-x;
                a[0]=x;
            }
        }
        else{
            if(a[i]+a[i-1]>x){
                ans+=a[i]+a[i-1]-x;
                a[i]=x-a[i-1];
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 640
import java.util.ArrayList;
import java.util.Comparator;
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();
		sc.close();
		List<String> list = new ArrayList();
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < a;i++){
			sb.append(b);
		}
		list.add(sb.toString());
		sb.delete(0, sb.length());
		for(int i = 0;i < b;i++){
			sb.append(a);
		}
		list.add(sb.toString());
		list.sort(Comparator.naturalOrder());
		System.out.println(list.get(0));
	}
}

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

int main() {
  long long int n,ID,price,quantity,sales[4001] = {0},check,k,kaburi,rep[4001];
  while(cin >> n) {
    long long int sales[4001] = {0};
    if(n == 0) break;
    check = 0;k=0;
    for(int i=0;i<n;i++) {
      cin >> ID >> price >> quantity;
      //      cout << ID << " " << price << " " << quantity << endl;
      sales[ID] += price * quantity;
      kaburi = 0;
      for(int j=0;j<k;j++) {
        if(rep[j] == ID) {
          kaburi = 1;
        }
      }
      if((sales[ID] >= 1000000) && (kaburi == 0)){
        cout << ID << endl;
        check = 1;
        rep[k] = ID;
        k++;
      }
    }
    if(check == 0)
      cout << "NA" << endl;
  }
}

Measured memory_bytes: 0
#include<stdio.h>
#include<string.h>
int main()
{
	char s[101];
	int t[101],l[100],i,j,r;
	l['I']=1;
	l['V']=5;
	l['X']=10;
	l['L']=50;
	l['C']=100;
	l['D']=500;
	l['M']=1000;
	for(;gets(s);)
	{
		memset(t,0,sizeof(t));
		t[0]=l[s[0]];
		for(i=1,j=0;s[i];i++)
		{
			if(s[i]==s[i-1])
				t[j]+=l[s[i]];
			else
			{
				if(l[s[i]]>l[s[i-1]])
					t[j]*=-1;
				t[++j]+=l[s[i]];
			}
		}
		for(i=r=0;i<=j;i++)
			r+=t[i];
		printf("%d\n",r);
	}
	return 0;
}

Measured memory_bytes: 940
N = int(input())
T = list(map(int,input().split()))
M = int(input())
PX = [ list(map(int,input().split())) for i in range(M)]
for i in range(0,M,1):
    tmp = int(PX[i][0])
    ans = sum(T) - T[tmp-1] + PX[i][1]
    print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
const int MOD=1e9+7;
 



int main() {
    int n;
    cin >> n;
    vector<ll> a(n),b(n);
    rep(i,n) {
        cin >> a[i];
        if (i==0) b[i]=a[i];
        else b[i]=b[i-1]+a[i];
    }
    vector<ll> d(4);
    ll ans=1e18;
    repr(i,1,n-2) {
        int left=-1,right=i;
        while (right-left>1) {
            int mid=(right+left)/2;
            if (b[mid]<b[i]-b[mid]) left=mid;
            else right=mid;
        }
        if (right>0) {
            if ((b[i]-b[right-1])-b[right-1]<b[right]-(b[i]-b[right])) --right;
        }
        d[0]=b[right];
        d[1]=b[i]-b[right];
        left=i-1,right=n-1;
        while (right-left>1) {
            int mid=(right+left)/2;
            if (b[mid]-b[i]<b[n-1]-b[mid]) left=mid;
            else right=mid;
        }
        if (right-(i+1)>0) {
            if (b[n-1]-b[right-1]-(b[right-1]-b[i])<(b[right]-b[i])-(b[n-1]-b[right])) --right;
        }
        if (right==n-1) --right;
        d[2]=b[right]-b[i];
        d[3]=b[n-1]-b[right];
        sort(d.begin(),d.end());
        ans=(d[3]-d[0]<ans)?d[3]-d[0]:ans;
    }
    cout << ans << endl;
}

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

long keisan(long n, long x) {
  if (0 <= n) {
    return (n/x) + 1;
  } else {
    return 0;
  }
}

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

  long ans = keisan(b, x) - keisan(a-1, x);

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
const ll MOD = 1000000007;
const int MAX = 200000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    vector<vector<int> > A(3,vector<int>(3));
    bool f[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin >> A[i][j];
            f[i][j] = false;
        }
    }
    int N; cin >> N;
    vector<int> b(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++){
            for(int k=0;k<N;k++){
                if(A[i][j]==b[k]){
                    f[i][j]=true;
                    break;
                }
            }
        }
    }
    if((f[0][0] && f[0][1] && f[0][2])||
    (f[1][0] && f[1][1] && f[1][2])||
    (f[2][0] && f[2][1] && f[2][2])||
    (f[0][0] && f[1][0] && f[2][0])||
    (f[0][1] && f[1][1] && f[2][1])||
    (f[0][2] && f[1][2] && f[2][2])||
    (f[0][0] && f[1][1] && f[2][2])||
    (f[0][2] && f[1][1] && f[0][2])){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }


    return 0;
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N, K; cin >> N >> K;
    vector<ll> A(N);
    rep(i, N){cin >> A.at(i);}
    rep(i, N - K){
        if (A.at(i) < A.at(i + K)){
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 4780
#Coding: Utf-8
count=0
a=[]
for i in range(5):
    a.append(input())
K=int(input())
a.sort(reverse=True)

for j in range(5):
    for k in range(5):
        if int(a[j])-int(a[k])>K:
            count+=1


if count>0:
    print(":(")
else:
    print("Yay!")


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

const int N=2e3+3;
int n,x,y;
int d[N][N];
int c[N];

signed main()
{
	cin>>n>>x>>y;
	if(x>y) swap(x,y);
	for(register int i=1;i<=n;i++)
		for(register int j=1;j<=n;j++)
			d[i][j]=abs(i-j);
	
	for(register int i=1;i<=n;i++)
		for(register int j=1;j<=n;j++)
		{
			int D=abs(i-x)+abs(j-y)+1;
			d[i][j]=min(d[i][j],D);
		}
	
	for(register int i=1;i<=n;i++)
		for(register int j=i;j<=n;j++)
			c[d[i][j]]++;
	
	for(register int i=1;i<n;i++)
		printf("%d\n",c[i]);
	return 0;
}

Measured memory_bytes: 15872
n=int(input())
t,a=map(int,input().split())
x=list(map(int,input().split()))
ans=0
cnt=10**3
for i in range(len(x)):
  s=t-x[i]*0.006
  if abs(s-a)<cnt:
    cnt=abs(s-a)
    ans=i+1
print(ans)


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

int main(){
  int N;
  cin >> N;
  vector<int> s;
  map<int,int> mp;
  int n = N;
  while(n--){
  int x;
  cin >> x;
  s.push_back(x);
  }
  for(int i=0;i<N;i++){
    mp[s[i]] ++;
  }
  int count = 0;
  for(auto p:mp){
  count ++;
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef double D;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
 
#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d %d",&x,&y)
#define rl(x) scanf("%lld",&x)
#define rl2(x,y) scanf("%lld %lld",&x,&y)
#define wd(x) printf("%d" ,x)
#define wd2(x,y) printf("%d %d",x,y)
#define wl(x) printf("%lld",x)
#define wl2(x,y) printf("%lld %lld",x,y)
#define PC(x) putchar(x)
#define GC() getchar()
#define NL printf("\n")
#define SP printf(" ")
 
#define F first
#define S second
#define MP make_pair
#define PB push_back
 
#define fr(i,s,e) for(int i=s;i<e;i++)
#define frr(i,s,e) for(int i=s-1;i>=e;i--)
#define frv(i,a) for(int i = 0;i<(int)a.size();i++)
#define frvr(i,a) for(int i = a.size()-1;i>=0;i--)
#define tr(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end();i++)
void forms(vector<string> &ans,int i,string final,string str){
	if(i==str.size()){
		ans.push_back(final);
		return;
	}
	final+=str[i];
	forms(ans,i+1,final,str);
	final+='+';
	if(i<str.size()-1)
		forms(ans,i+1,final,str);
	return;
}
int main(){
	vector<string>ans;
	string str,str2="";
	cin>>str;
	ll fans=0;
	forms(ans,0,str2,str);
	fr(i,0,ans.size()){
		//cout<<ans[i]<<endl;
		string op=ans[i];
		stack<ll>st;
		stack<char> pls;
		st.push(0);
		fr(j,0,op.size()){
			if(op[j]!='+'){
				ll temp;
				temp=st.top();
				st.pop();
				temp=((temp*10)+(op[j]-'0'));
				st.push(temp);
			}
			else{
				// int x=st.top();
				// st.pop();
				// int y=op[i]-'0';
				// st.push(x+y);
				st.push(0);
				pls.push(str[j]);
			}
		}
		while(!pls.empty()){
			ll x=st.top();
			st.pop();
			ll y=st.top();
			st.pop();
			pls.pop();
			st.push(x+y);
		}
		fans+=st.top();
	}
	cout<<fans<<endl;
	return 0;
}

Measured memory_bytes: 256
def thin(H: int, W: int, C: list)->list:
    return [C[h//2] for h in range(2*H)]


if __name__ == "__main__":
    H = 0
    H, W = map(int, input().split())
    C = [input() for _ in range(H)]
    ans = thin(H, W, C)
    print('\n'.join(ans))


Measured memory_bytes: 3060
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

#define all(c) (c).begin(), (c).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const ll INF = 1e9;
const ll MOD = 1e9 + 7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int n;
struct Edge {
    int to, cost;
    Edge(int to, int cost) : to(to), cost(cost) {}
};
using P = pair<int, int>;
vector<Edge> G[50];
set<int> vs;
int dijkstra(int s) {
    int dp[50];
    rep(i, 50) dp[i] = INF;
    priority_queue<P> que;
    que.push(P(0, s));
    dp[s] = 0;
    while (que.size()) {
        auto p = que.top();
        que.pop();
        int v = p.second;
        rep(i, G[v].size()) {
            auto e = G[v][i];
            if (dp[e.to] > dp[v] + e.cost) {
                dp[e.to] = dp[v] + e.cost;
                que.push(P(-dp[e.to], e.to));
            }
        }
    }
    int ret = 0;
    for (auto v : vs) {
        ret += dp[v];
    }
    return ret;
}
int main() {
    while (cin >> n, n) {
        vs.clear();
        rep(i, 50) G[i].clear();
        rep(i, n) {
            int a, b, c;
            cin >> a >> b >> c;
            G[a].push_back(Edge(b, c));
            G[b].push_back(Edge(a, c));
            vs.insert(a);
            vs.insert(b);
        }
        int ans = INF;
        int ans_v = -1;
        for (auto v : vs) {
            auto ret = dijkstra(v);
            if (ans > ret) {
                ans = ret;
                ans_v = v;
            }
        }
        cout << ans_v << " " << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3008
n = list(input())
if len(n) == 1:
	print(int(n[0]))
elif set(n) == {"9"}:
	print(9 * len(n))
elif set(n[1:]) == {"9"}:
	print(9 * (len(n) - 1) + int(n[0]))
elif n[0] == {"1"}:
	print(9 * (len(n) - 1))
else:
	print(9 * (len(n) - 1) + int(n[0]) - 1)

Measured memory_bytes: 3064
#include <iostream>
#define INF 1e+9
using namespace std;

int main(){
	int n;
	while(cin >> n,n){
		int a,dp[5001] = {},ma = -INF;
		for(int i = 0;i <= n;i++) dp[i] = -INF;
		for(int i = 0;i < n;i++) {
			cin >> a;
			dp[i + 1] = max(a,dp[i] + a);
			ma = max(ma,dp[i + 1]);
		}
		cout << ma << endl;
	}
	return 0;
}

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

using namespace std;

using int64 = long long;

int main() {
  int N, C, V[30][30], c[500][500];

  cin >> N >> C;
  for(int i = 0; i < C; i++) {
    for(int j = 0; j < C; j++) {
      cin >> V[i][j];
    }
  }
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < N; j++) {
      cin >> c[i][j];
    }
  }


  int64 cost[30][3] = {{}};

  for(int i = 0; i < C; i++) {
    for(int l = 0; l < N; l++) {
      for(int m = 0; m < N; m++) {
        int sum = (l + m) % 3;
        if(sum == 0) cost[i][0] += V[c[l][m] - 1][i];
        else if(sum == 1) cost[i][1] += V[c[l][m] - 1][i];
        else if(sum == 2) cost[i][2] += V[c[l][m] - 1][i];
      }
    }
  }

  int64 all = 1LL << 60;
  for(int i = 0; i < C; i++) {
    for(int j = 0; j < C; j++) {
      for(int k = 0; k < C; k++) {
        if(i == j || i == k || j == k) continue;
        all = min(all, cost[i][0] + cost[j][1] + cost[k][2]);
      }
    }
  }

  cout << all << endl;
}

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

 
int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if( c >= a && c <= b ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
signed main(){
    string s; cin >> s;
    string t; cin >> t;
    vector<vector<int>> pos(26);
    for(int i = 0; i <  s.size(); ++i)
        pos[s[i] - 'a'].push_back(i);
    for(auto c : t)
        if(pos[c-'a'].empty())  return puts("-1") * 0;
    int ans = 0;
    int prevIndex = -1;
    int ssize = s.size();
    for(auto c : t){
        char key = c - 'a';
        auto itr = (upper_bound(pos[key].begin(),pos[key].end(),prevIndex));
        if(itr != pos[key].end()){
            ans +=  *itr - prevIndex;
        } else {
            itr = pos[key].begin();
            ans += ssize - prevIndex + *itr;
        }
        prevIndex = *itr;
    }
    cout << ans << endl;
}




Measured memory_bytes: 1724
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>

int main() {
  int n;
  std::cin >> n;
  
  std::vector<int> p(n);
  for (auto&& pi : p) std::cin >> pi;
  
  const auto sum = std::accumulate(p.begin(), p.end(), 0);
  const auto max_p = *std::max_element(p.begin(), p.end());
  std::cout << sum - max_p/2 << std::endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int i,x;
	i = 1;
	while(1){
		scanf("%d",&x);
		if(x == 0){
			break;
		} else {
			printf("Case %d: %d\n",i,x);
		i++;
		}
	}
return 0;
}


Measured memory_bytes: 2040
N = int(input())
*A, = map(int, input().split())

dp = [0]*(N+1)
dp[0] = 1000

for i in range(1, N+1):
    dp[i] = dp[i-1]
    for j in range(1, i):
        dp[i] = max(dp[i], (dp[j]//A[j-1])*A[i-1] + (dp[j]%A[j-1]))

print(dp[-1])


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

int main() {
    int n;
    cin >> n;
    unsigned int allXor = 0;
    vector<unsigned int> arr(n);
    for (int i = 0; i < n; i++) {
        unsigned int a;
        cin >> a;
        allXor = allXor ^ a;
        arr[i] = a;
    }
    
    for (int i = 0; i < n - 1; i++) {
        cout << (arr[i] ^ allXor) << " ";
    }
    
    cout << (arr[n - 1] ^ allXor);
}


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

void solve(std::vector<std::string> c)
{
    cout << c[0].substr(0, 1) << c[1].substr(1, 1) << c[2].substr(2, 1) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    std::vector<std::string> c(3);
    for (int i = 0; i < 3; i++)
    {
        std::cin >> c[i];
    }
    solve(std::move(c));
    return 0;
}


Measured memory_bytes: 256
from collections import deque

def Topologicalsort(v):
    start=deque()
    for i in xrange(v):
        if indeg[i]==0 :
            start.append(i)
    if len(start)>1:
        flag=True
    else:
        flag=False
    while len(start)>0:
        i=start.popleft()
        ans.append(i)
        tmp=[]
        for j in g[i]:
            indeg[j]-=1
            if indeg[j]==0:
                tmp.append(j)
                start.append(j)
                if len(tmp)>1:
                    flag=True
    return ans,flag

def solve(n,m):
    for i in xrange(m):
        wt,lt=map(int,raw_input().split())
        wt-=1;lt-=1
        g[wt].append(lt)
        indeg[lt]+=1
    ans,flag=Topologicalsort(n)
    return ans,flag

n=int(raw_input())
m=int(raw_input())
indeg=[0]*n
g=[[] for _ in xrange(n)]
ans=[]

ans,flag=solve(n,m)

if flag:
    for i in xrange(n):
        print(ans[i]+1)
    print(1)
else:
    for i in xrange(n):
        print(ans[i]+1)
    print(0)

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

int main() {
	double x;
	cin>>x;
	double r=.01,a=100;
	ll counter=0;
	while(a<x) {
		a=(ll)(a+a*r);
		//cout<<a<<endl;
		counter++;
	}
	cout<<counter<<endl;
	return 0;
}


Measured memory_bytes: 3740
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

r, D, x = map(int, input().split())
for i in range(10):
    x = r * x - D
    print(x)


Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, begin, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    int A, B;
    cin >> A >> B;
    if (A >= 13)
    {
        cout << B;
    }
    else if (A <= 5)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << B / 2 << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() 
{
   int k;cin>>k;
   string s;cin>>s;
   if(s.size()<=k)
   {
       cout<<s;return 0;
   }
   else
   {
       for(int i=0;i<k;i++)
       {
           cout<<s[i];
       }
       cout<<"...";return 0;
   }
}




Measured memory_bytes: 3600
#include <iostream>
#define rep(i, n) for(int i=0; i<n; i++)

using namespace std;

int main(void){
  int N;
  cin >> N;
  int t[N+1], x[N+1], y[N+1];
  
  //初めは時刻0で原点にいる
  t[0] = 0, x[0] = 0, y[0] = 0;

  rep(i, N)
    cin >> t[i+1] >> x[i+1] >> y[i+1];
  //入力終了

  //現在地点
  int nowx = 0, nowy = 0;
  rep(i, N){
    //移動距離と制限時間
    int distance = abs(x[i+1]-nowx) + abs(y[i+1]-nowy);
    int time_limit = t[i+1]-t[i];
    //距離が制限時間よりも大きい
    if(distance > time_limit ){
      cout << "No" << endl;
      return 0;
    }
    else{
      //偶奇が一致していればたどり着ける
      if( ((distance^time_limit) & 1) == 0){
	//現在地点の更新
	nowx = x[i+1]; nowy = y[i+1];
	continue;
      }
      else{
	cout << "No" << endl;
	return 0;
      }
    }
  }

  //上のループを抜けていればOK
  cout << "Yes" << endl;
  
  return 0;
}


Measured memory_bytes: 4772
package main

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

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	t, _ := strconv.Atoi(sc.Text())
	return t
}

func main() {
	var n int
	fmt.Scan(&n)
	m := make(map[int]int, 0)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	for i := 0; i < n; i++ {
		m[nextInt(sc)]++
	}
	// fmt.Println("n", n, "m", m)
	ks := make([]int, 0)
	for k := range m {
		ks = append(ks, k)
	}
	sort.Ints(ks)
	// fmt.Println("n", n, "m", m, "ks", ks)
	ans := 1
	for i := 0; i < len(ks); i++ {
		if i < len(ks) {
			ans = max(ans, m[ks[i]])
		}
		if i+1 < len(ks) && ks[i]+1 == ks[i+1] {
			ans = max(ans, m[ks[i]]+m[ks[i+1]])
		}
		if i+2 < len(ks) && ks[i]+1 == ks[i+1] && ks[i+1]+1 == ks[i+2] {
			ans = max(ans, m[ks[i]]+m[ks[i+1]]+m[ks[i+2]])
		}
	}
	fmt.Println(ans)
}

func max(a, b int) int {
	if a >= b {
		return a
	}
	return b
}


Measured memory_bytes: 7680
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n = I()
    a = list(IL())
    m = [0]*n
    for rep in a:
        m[rep-1] += 1
    for rep in m:
        print(rep)
    return

if __name__=='__main__':
    Main()

Measured memory_bytes: 50568
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
//
struct poi{
  int X;int Y;int Z;
  bool operator<(const poi&R)const{
    return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
  }
};
//
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
ll kai[300001];
ll gya[300001];
ll nck[300001];
ll N,A,B,K;
void nCk(ll n,ll mod){
    kai[N]=N;
    ROF(i,1,N){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,N+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,N){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[N]=1;
}
int main(){
  cin>>N>>A>>B>>K;
  nCk(N,mod);
  ll ans=0;
  FOR(i,0,N+1){
    if((K-A*i)%B==0&&(K-A*i)/B>=0&&(K-A*i)/B<=N){
      (ans+=nck[i]*nck[(K-A*i)/B])%=mod;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 7296
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        final String S = sc.next();
        final String T = sc.next();
        
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < S.length() - T.length() + 1; i++) {
            int diff = 0;
            
            for (int j = 0; j < T.length(); j++) {
                if (S.charAt(i + j) != T.charAt(j)) {
                    diff++;
                }
            }
            if (diff < min) {
                min = diff;
            }
        }
        System.out.println(min);
    }
}


Measured memory_bytes: 35612
main :: IO ()
main = do
  [w, h, x, y] <- map read . words <$> getLine :: IO [Int]
  print0 $ solve w h x y

solve :: Int -> Int -> Int -> Int -> (Double, Int)
solve w h x y = if w == 2 * x && h == 2 * y
  then (fromIntegral(w * h) / 2, 1)
  else (fromIntegral(w * h) / 2, 0)

print0 :: (Double, Int) -> IO ()
print0 (x, y) = putStrLn $ (show x) ++ " " ++ (show y)

Measured memory_bytes: 508
#include <iostream>
#include <sstream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <iomanip>
#include <cstdlib>
#include <climits>
#include <set>
using namespace std;

//関数getinputdata宣言
vector<vector<string>> getinputdata();
vector<vector<int>> getinputdata2();
vector<vector<double>> getinputdata3();

void abc127_b(vector<vector<string>> v) {

    int r = atoi(v[0][0].c_str());
    int d = atoi(v[0][1].c_str());
    int x = atoi(v[0][2].c_str());

    for (int i = 1; i <= 10; i++) {


        x = x * r - d;

        cout << x << endl;

    }




}

int main() {

    vector<vector < string>> vec_arr_result;
    //    vector<vector<int>> vec_arr_result;
    vec_arr_result = getinputdata();

    abc127_b(vec_arr_result);

    return 0;
}

//関数getinputdata実装

vector<vector<double>> getinputdata3() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<double>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<double> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atof(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;
}

//関数getinputdata実装

vector<vector<int>> getinputdata2() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<int>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<int> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atoi(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;


}

//関数getinputdata実装

vector<vector < string >> getinputdata() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector < string>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<string> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(ret);
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, m, n) for (ll i = m; i < (n); i++)
#define RFOR(i, m, n) for (ll i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define print(ele) cout << (ele) << "\n"
#define print10(ele) cout << fixed << setprecision(10) << (ele) << "\n"

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

int main() {
  ll x;
  cin >> x;
  ll ans = 0;
  ans += x / 500 * 1000;
  x %= 500;
  ans += x / 5 * 5;
  print(ans);
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
const int Mod=1000000007;
int n,K;
#define Maxn 51
int dp[Maxn][Maxn][3000];
inline void Add(int &x,int y){x=(x+y)%Mod;}
int main(){
	dp[0][0][0]=1;
	scanf("%d%d",&n,&K);
	for(register int i=0;i<n;++i)
	    for(register int j=0;j<=i;++j)
	        for(register int k=0;k<=K;++k){
	        	int val=dp[i][j][k];
	        	Add(dp[i+1][j][k+2*j],1ll*val*(2*j+1)%Mod);
	        	Add(dp[i+1][j-1][k+2*j-2],1ll*val*j*j%Mod);
	        	Add(dp[i+1][j+1][k+2*j+2],val);
			}
	printf("%d\n",dp[n][0][K]);
	return 0;
}

Measured memory_bytes: 28800
/*
勉強させて頂いた解説
https://k-prism.hatenablog.com/entry/2019/07/22/110814
https://img.atcoder.jp/agc036/editorial.pdf
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
template<class T,class Y>T LCM(T a,Y b){return (a*b)/GCD(a,b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

using vi=vector<int>;
using vii=vector<vi>;

#define REP(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()
#define decimal(x) fixed<<setprecision(x)

int main(){
    ll s,v=1e9;
    cin>>s;
    //切り上げ
    ll y=(s+(v-1))/v;
    //1e9*yで1e9以下の部分がわかるため、それをv*y-sで求める。
    ll x=v*y-s;
    cout<<"0 0 "<<v<<" 1 "<<x<<" "<<y<<endl;
    return 0;
}

//a=97,z=122

Measured memory_bytes: 3636
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
		if len(os.Args) > 2 {
			wfp, _ = os.Create(os.Args[2])
		}
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt(scanner)
	ll := make([]int, n)

	for i := 0; i < n; i++ {
		ll[i] = getNextInt(scanner)
	}

	sort.Ints(ll)

	ans := 0
	for i := 0; i < n-2; i++ {
		j := i + 1
		for k := j + 1; k < n; k++ {
			for j < n && ll[k] >= ll[i]+ll[j] {
				j++
			}
			ans += k - j
		}
	}
	fmt.Fprintln(writer, ans)

	writer.Flush()
}


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

int main() {
  LL r, d, x;
  cin >> r >> d >> x;

  for (int i = 2001; i <= 2010; ++i) {
    x = r * x - d;
    cout << x << "\n";
  }
}



Measured memory_bytes: 256
try:
    n=list(map(int, input().strip().split()))
    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if a!=i:
                z=(int(n[a])+int(n[i]))
                lis1.append(z)
            
    minscore='9999999999'
    for i in range(0,len(lis1)):
        if float(minscore)>float(lis1[i]):
            minscore=lis1[i]
    
    print(minscore)
    
except:
    print('')



Measured memory_bytes: 9168
#include<iostream>

using namespace std;

int main(){
    int n,n1;
    cin>>n;
    
    n1=n%10;
    
    if(n1==3)
        cout<<"bon"<<endl;
    else if(n1==0 || n1==1 || n1==6 || n1==8)
        cout<<"pon"<<endl;
    else
        cout<<"hon"<<endl;   
}

Measured memory_bytes: 3644
import bisect

N = int(input())
L = list(map(int, input().split()))
L = sorted(L)

count = 0
for n in range(N-2):
    for m in range(n+1,N-1):
        count += bisect.bisect_left(L,L[m]+L[n]) -m-1

print(count)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll n; cin >> n;
    ll c = n / 11 * 2;
    n = n - (n / 11 * 11);
    if (n == 0) {
        cout << c << endl;
        return 0;
    }
    cout << c + (n > 6) + 1 << endl;
    return 0;
}

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

#include <iostream>
using namespace std;

int main() {
	int n, a, i, b[200000];
	scanf("%d", &n);
	if (n % 2 == 0) {
		for (i = 0; i < n / 2; i++) {
			scanf("%d", &a);
			b[100000 + i] = a;
			scanf("%d", &a);
			b[99999 - i] = a;
		}
		for (i = 0; i < n; i++) {
			printf("%d ", b[100000 - n / 2 + i]);
		}

	} else {
		scanf("%d", &a);
		b[99999]=a;
		for (i = 0; i < (n-1) / 2; i++) {
			scanf("%d", &a);
			b[100000 + i] = a;
			scanf("%d", &a);
			b[99998 - i] = a;
		}
		for (i = 0; i < n; i++) {
			printf("%d ", b[100000 - (n-1) / 2 + i-1]);
		}
	}
	return 0;
}


Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define t(x) cerr<<#x<<":"<<x<<'\n';
#define t2(a,n) { cerr<<#a<<" = "; for(int i=0; i<n; ++i){ cerr << a[i] << ' '; } ; cerr <<'\n'; }
#define t3(a){ cerr<<#a<<" = "; for(auto i: a){ cerr<<i<<" "; } cerr<<'\n'; }



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

	ll n,m;
	cin>>n>>m;
	set<ll> factors;
	for(int i=1; i<= sqrt(m); ++i){
		if( m % i == 0 ){ factors.insert(i); factors.insert(m/i);}
	}
	ll max_ans = 0;
	for(auto i : factors){
		if( (m/i)	>= n ){ max_ans = max( max_ans, i); }
	}
	cout<<max_ans<<endl;

	#ifdef LOL
	    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	#endif
	return 0;
}


Measured memory_bytes: 256
s = input().strip()

if 1 <= int(s[:2]) <= 12:
  if 1 <= int(s[2:]) <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
elif 1 <= int(s[2:]) <= 12:
  if 1 <= int(s[:2]) <= 12:
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
  print("NA")


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <cmath>
using namespace __gnu_pbds;
using namespace std;
 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
 
typedef long long lli;
typedef long li;
typedef pair<int,int> PI;
typedef pair<long,int> PLI;
typedef pair<int,long> PIL;
typedef pair<long, long> PL;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<long> VL;
typedef vector<long long> VLL;
typedef priority_queue<int> PQ;
typedef priority_queue<long> PQL;
typedef priority_queue<long long> PQLL;
#define FAST ios::sync_with_stdio(0)
#define forz(n) for (long i = 0; i < n; i++)
#define forv(i,x,y) for (long i=x; i<y; i++)
#define rforz(a,n) for (long i = a; i < n; i++)
#define forlz(n) for (long int i = 0; i < n; i++)
#define TRAV(it, v) for(auto it = v.begin(); it != v.end(); it++) 
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define SQ(a) (a)*(a)
#define UM unordered_map
#define US unordered_set
#define LB(v,x) lower_bound(v.begin(),v.end(),x);
#define UB(v,x) upper_bound(v.begin(),v.end(),x);
#define CUBE(a) (a)*(a)*(a)
#define SORT(v) sort(v.begin(),v.end());
#define SORTC(v,c) sort(v.begin(),v.end(),c);
#define Pi 3.14159265358979323846
 
 
#define module 1000000007
 
 
lli gcd(lli x,lli y){
    if(x==0) return y;
    return gcd(y%x,x);
}
 
PL Egcd(lli x,lli y){
    if(x==0) return MP(0,1);
    PL t=Egcd(y%x,x);
    return MP(t.S-t.F*(y/x),t.F);
}
 

bool comp(PLL a,PLL b){
    return a.S > b.S;
}
struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
}; 
void solve2(){
   string str;
   cin>>str;
   if(str=="AAA" || str=="BBB"){
       cout<<"No\n";
   }else{
       cout<<"Yes\n";
   }
   return;
}   
 
int main(){
    FAST;
    cin.tie(0);
    cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    //=====================================code starts here
    // lli n;
    // cin>>n;
    // while(n--){
        solve2();
    // }
    
    
    return 0;
}


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

namespace Atcoder_0403
{
    class Program
    {
        static void Main(string[] args)
        {
            

            var input = Console.ReadLine().Split(' ');
            int _edgeCount = int.Parse(input[0]);
            int connectX = int.Parse(input[1]);
            int connectY = int.Parse(input[2]);

            int[] _resultCounts = new int[_edgeCount+1];//ここに結果を入れていく
            for (int j = 2; j <= _edgeCount; j++)//1<=i<j<=_edgeCountでループ　※ループの関係上jを先に回している
            {
                for(int i = 1; i < j; i++)
                {
                    int normalRoot = j - i;
                    int newRoot = Math.Abs(j - connectY) + Math.Abs(connectX - i) + 1;//xとiの距離+yとjの距離+1(xとyの短いほうの距離)
                    int length = (normalRoot > newRoot) ? newRoot : normalRoot;//小さいほうのrootを代入
                    _resultCounts[length]++;
                }
            }

            for(int i = 1; i < _edgeCount; i++)
            {
                Console.WriteLine(_resultCounts[i]);
            }
        }
    }
}


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

#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;
using ll = long long;

void solve();

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(void){
    COMinit();
    int H, W, A, B;
    cin >> H >> W >> A >> B;
    //(H-A-1)回下に行って(B+i)回(iは0からW-B-1)回右に行った後,A-1回下に行って(W-B-i-1)回右に行く
    ll ans = 0;
    for(int i = 0; i <= W-B-1; i++) ans = (ans + COM(H-A-1+B+i, H-A-1)*COM(A+W-B-i-2, W-B-1-i) % MOD) % MOD;
    cout << ans<< endl;
    return 0;
}

void solve(){}

Measured memory_bytes: 12160
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
for(var i=0;i<Arr.length;i++){
   var str=Arr[i];
   if(str==".")break;
   str=str.replace(/[a-zA-Z]|\.|\s/g,"");
   while(str.match(/\[\]|\(\)/)){
      str=str.replace(/\[\]|\(\)/g,"");
   }
   console.log((str=="")?"yes":"no");
}

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

using namespace std;
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e15)
#define int ll
#define PI (acos(-1))
//const ll mod = 1000000007;

int n, m, p;
int a, b, c;

struct edge {
    int from, to, cost;
};

vector<edge> es; // 辺
vector<int> d(2510);  // 最短距離[頂点の最大数]
int V, E;       // V:頂点数，E:辺数

// 頂点sから各頂点への最短距離を求める
bool shortest_path(int s) {
    int count_updates = 0;

    while (true) {
        bool is_updated = false;
        // 全ての辺について更新（実際は到達域から伸びている辺について更新）
        for (auto &e:es) {
            // 到達域の辺　かつ　より短くなる　場合更新
            if (d[e.from] != INF && d[e.to] > d[e.from] + e.cost) {
                d[e.to] = d[e.from] + e.cost;
                is_updated = true;
            }
        }
        // 更新されなくなったら終了
//        if (!is_updated) return true;
        count_updates++;
        if (count_updates == V) return false;
    }
}

signed main() {
    cin >> n >> m >> p;
    V = n;
    E = m;
    for (int i = 0; i < m; i++) {
        cin >> a >> b >> c;
        es.push_back({a, b, p - c});
    }

    fill(d.begin(), d.end(), (ll) INF);
    d[1] = 0;
    shortest_path(1);
    int ans = d[n];
    shortest_path(1);
    if (ans != d[n]) cout << -1 << endl;
    else cout << max(-ans, 0ll) << endl;
}

// グラフ
// コスト最大化(ベルマンフォード)

Measured memory_bytes: 576
import java.util.*;
import java.io.*;
import java.math.*;

public class Main{



  public static OutputStream out=new BufferedOutputStream(System.out);
  static Scanner sc=new Scanner(System.in);
  static long MOD=1000000007l;
  static int INF=10000000;
  static int[] rr=new int[]{1, 0, -1, 0};                                 //rook row move
  static int[] rc=new int[]{0, 1, 0, -1};                                 //rook col move

  //nl-->neew line; //l-->line;  //arp-->array print;  //arpnl-->array print new line
  public static void nl(Object o) throws IOException{out.write((o+"\n").getBytes()); }
  public static void l(Object o) throws IOException{out.write((o+"").getBytes());}
  public static void arp(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+" ").getBytes()); out.write(("\n").getBytes());}
  public static void arpnl(int[] o) throws IOException{for(int i=0;i<o.length;i++) out.write((o[i]+"\n").getBytes());}
  public static void scanl(long[] a,int n) {for(int i=0;i<n;i++) a[i]=sc.nextLong();}
  public static void scani(int[] a,int n) {for(int i=0;i<n;i++) a[i]=sc.nextInt();}
  public static void scan2D(int[][] a,int n,int m) {for(int i=0;i<n;i++) for(int j=0;j<m;j++) a[i][j]=sc.nextInt();}
  //static variables

  //


  public static void main(String[] args) throws IOException{
    long sttm=System.currentTimeMillis();
    long mod=1000000007l;

    // int k=sc.nextInt();
    int k=1;
    while(k-->0){
        solve();
    }

    out.flush();
  }

  public static void solve() throws IOException{
      String s=sc.next();
      int n=s.length();
      if(s.charAt(n-1)=='s'){
          s+="es";
      }
      else{
          s+='s';
      }
      nl(s);
  }

}

class Pair{
  int x; int y;
  Pair(int x,int y){
    this.x=x;
    this.y=y;
  }
}


Measured memory_bytes: 38504