akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<math.h>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
const int N=10000;
const db pi=acos(-1.0);
#define lowbit(x) (x)&(-x)
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define fir first
#define sec second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define maxd 1000000007
#define eps 1e-8
int n,k,m,tot=0;
ll f[101][2][32000],sum1[32000],sum2[32000];
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*10+(ch-'0');ch=getchar();}
    return x*f;
}

ll qpow(ll n,int k)
{
    ll ans=1;
    while (k)
    {
        if (k&1) ans=ans*n%maxd;
        n=n*n%maxd;k>>=1;
    }
    return ans;
}

int main()
{
    n=read();k=read();m=sqrt(n);
    rep(i,1,m) f[1][0][i]=1;
    rep(i,1,m)
    {
        int l=n/i,r=n/(i+1)+1;
        if (r==m) r++;
        if (r>l) continue;
        f[1][1][++tot]=(l-r+1);
    }
    //rep(i,1,m) cout << f[1][1][i] << " ";cout << endl << endl;
    rep(i,1,m) sum1[i]=(sum1[i-1]+f[1][0][i])%maxd;
    rep(i,1,tot) sum2[i]=(sum2[i-1]+f[1][1][i])%maxd;
    //rep(i,1,m) cout << f[1][0][i] << " ";cout << endl;
    //rep(i,1,tot) cout << f[1][1][i] << " ";cout << endl;
    //cout << endl;
    rep(i,2,k)
    {
        rep(j,1,m)
        {
            f[i][0][j]=(sum1[m]+sum2[tot]-sum2[j-1]+maxd)%maxd;
        }
        rep(j,1,tot)
        {
            int r=n/j,l=n/(j+1)+1;
            f[i][1][j]=sum1[j]*(r-l+1)%maxd;
        }
        //rep(j,1,m) cout << f[i][0][j] << " ";cout << endl;
        //rep(j,1,tot) cout << f[i][1][j] << " ";cout << endl;
        //cout << endl;
        rep(j,1,m) sum1[j]=(sum1[j-1]+f[i][0][j])%maxd;
        rep(j,1,tot) sum2[j]=(sum2[j-1]+f[i][1][j])%maxd;
    }
    ll ans=0;
    rep(i,1,m) ans=(ans+f[k][0][i])%maxd;
    rep(i,1,tot) ans=(ans+f[k][1][i])%maxd;
    printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 50688
import math

N = int(input())


# def yakusuu(x):
#     tmplist=list(sy.factorint(x).values())
#     a=1
#     for i in tmplist:
#         a*=i+1
#     return a
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0  # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]


def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num


counter = 0
for i in range(1, N + 1, 2):
    if search_divisor_num_1(i) == 8:
        counter += 1
print(counter)


Measured memory_bytes: 3064
# Atcode Frog A
n = int(input())
a = list(map(int, input().strip().split()))
dp = [0]*n
dp[0] = 0
dp[1] = abs(a[1]-a[0])
for i in range(2, n):
	dp[i] = min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]))
print(dp[-1])

Measured memory_bytes: 13928
#include <iostream>
#include <cmath>
using namespace std;
int A[200000],B[200000];

int find(int a)
{
    int j=0,m=sqrt(a);
    for(int i=1;i<=m;i++)
    {
        if(a%i==0)
        {
            A[j]=i;B[j]=a/i;
            j++;
        }
    }
    return j;
}

int main(int argc, char const *argv[])
{
    int a,b,m,Common1=0,Common2=0,Common;
    cin>>a>>b;
    m=find(a);
    for(int i=0;i<m;i++)
    {
        if(b%A[i]==0)
        {
            Common1=A[i];
        }
        if(b%B[i]==0)
        {
            Common2=B[i];
            break;
        }
    }
    Common=(Common1>=Common2?Common1:Common2);
    cout<<Common<<endl;
    //system("pause");
    return 0;
}



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

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

    int min_ind=n;
    for (int i=0;i<n;i++){
        string sub_s = "";
        string sub_t = "";
        for (int j=i;j<n;j++){
            sub_s += s[j];
        }
        for (int j=0;j<n-i;j++){
            sub_t += t[j];
        }

        if (sub_s == sub_t){
            min_ind = i;
            break;
        }
    }
    cout << 2 * min_ind + (n - min_ind) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MAX_V 100
#define MAX_E 10000
#define INF 2000000001
struct edge{int from,to,cost;};

edge es[MAX_E]; //辺
int ds[MAX_V]; //最短距離
int V,E; //頂点数、辺数
int d[MAX_V][MAX_V]; //d[u][v]はe=(u,v)のコスト(存在しなければINF、d[i][i]は0)

void warshall_floyd(){
  for(int k=0;k<V;k++)
    for(int i=0;i<V;i++)
      for(int j=0;j<V;j++){
	if(d[i][k]!=INF&&d[k][j]!=INF)
	  d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
      }
}

bool find_negative_loop(){
  memset(ds,0,sizeof(ds));
  for(int i=0;i<V;i++){
    for(int j=0;j<E;j++){
      edge e=es[j];
      if(ds[e.to]>ds[e.from]+e.cost){
	ds[e.to]=ds[e.from]+e.cost;
	if(i==V-1)return true;
      }
    }
  }  
  return false;
}

int main(){
  cin>>V>>E;
  for(int i=0;i<V;i++)
    for(int j=0;j<V;j++){
      if(i==j)d[i][j]=0;
      else d[i][j]=INF;
    }
  for(int i=0;i<E;i++){
    cin>>es[i].from>>es[i].to>>es[i].cost;
    d[es[i].from][es[i].to]=es[i].cost;
  }
  if(find_negative_loop())cout<<"NEGATIVE CYCLE"<<endl;
  else {
    warshall_floyd();
    for(int i=0;i<V;i++){
       for(int j=0;j<V;j++){
	 if(j)cout<<" ";
	 if(d[i][j]==INF)cout<<"INF";
	 else cout<<d[i][j];
       }
       cout<<endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3224
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
const ll mod = (ll)1e9+7;
const int INF = 0x3f3f3f3f;

vector<int> v(105);
ll dp[105][100010]; //dp[child #][number of candies left] = possibilities up to this point

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    #ifndef ONLINE_JUDGE
    //freopen("B.txt", "r", stdin);
    #endif
    int n, k;
    cin >> n >> k;
    for(int i=1; i<=n; i++)
        cin >> v[i];
    dp[0][0]=1;
    for(int i=1; i<=n; i++)
    {
        dp[i][0] = 1;
        for(int j=1; j<=100000; j++)
        {
            if(j>v[i])
            {
                dp[i][j] -= dp[i-1][j-v[i]-1];
            }
            dp[i][j] += (dp[i][j-1]+dp[i-1][j])%mod;
            if(dp[i][j]<0) dp[i][j]+=mod;
        }
    }
    cout << dp[n][k];
}


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

using namespace std;

int main() {
    int n;
    cin >> n;
    int maxx = 0;
    map<string, int> m;

    while (n--) {
        string x;
        cin >> x;
        m.insert(pair<string, int>(x, m[x]++));
        maxx = max(m[x], maxx);
    }
    for (auto itr = m.begin(); itr != m.end(); itr++)
        if (itr->second == maxx)
            cout << itr->first << endl;
    return 0;
}


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

int main()
{
    int n, q;
    cin >> n >> q;
    vector<tuple<int,int,int>> vec;
    rep(i,n){
        int s,t,x;
        cin >> s >> t >> x;
        s-=x;
        t-=x;
        vec.emplace_back(make_tuple(s,x,3));
        vec.emplace_back(make_tuple(t,x,2));
    }
    rep(i,q){
        int d;
        cin >> d;
        vec.emplace_back(make_tuple(d,2e9,1));
    }
    
    sort(ALL(vec));
    set<int> st;
    st.insert(2e9);
    for(auto i : vec){
        if(get<2>(i) == 3) st.insert(get<1>(i));
        else if(get<2>(i) == 2) st.erase(get<1>(i));
        else if(get<2>(i) == 1){
            if(*st.begin() < 2e9) cout << *st.begin() << endl;
            else cout << -1 << endl;
        }
    }
    return 0;
}

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

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define MP make_pair
#define PB push_back
#define X first
#define Y second

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())
#define FILL(a, value) memset(a, value, sizeof(a))
#define debug(a) cout << #a << " = " << a << endl;

const double PI = acos(-1.0);
const LL INF = 1e9 + 47;
const LL LINF = INF * INF;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1 << 20;
string s[N];
int p[N];

int cmp(int x, int y)
{
	if (s[x] == s[y]) return p[x] > p[y];
	return s[x] < s[y];
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	int n;
	cin >> n;
	FOR(i, 0, n) cin >> s[i] >> p[i];
	VI a(n);
	iota(ALL(a), 0);
	sort(ALL(a), cmp);
	for(auto i: a) cout << i + 1 << endl;
	
	cerr << "Time elapsed: " << clock() / (double)CLOCKS_PER_SEC << endl;
	return 0;
}



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

using namespace std;
typedef long long ll;

const int maxn = 2000 + 10;
const int mod = 1e9 + 7;
ll fac[maxn], inv[maxn], facinv[maxn];

void init()
{
    fac[0] = inv[0] = facinv[0] = 1;
    fac[1] = inv[1] = facinv[1] = 1;
    for(int i = 2; i < maxn; i++)
    {
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - mod / i * inv[mod % i] % mod;
        facinv[i] = facinv[i - 1] * inv[i] % mod;
    }
}

ll C(int n, int k)
{
    if(k > n || k < 0) return 0;
    return fac[n] * facinv[k] % mod * facinv[n - k] % mod;
}

int main()
{
    int n, k;
    scanf("%d%d", &n, &k);
    init();
    for(int i = 1; i <= k; i ++)
    {
        ll ans = C(n - k + 1, i) * C(k - 1, i - 1) % mod;
        printf("%lld\n", ans);
    }
    return 0;
}


Measured memory_bytes: 256
n=int(input())
inf=float("inf")
DP=[inf]*(n+1)
DP[0]=0

for i in range(1,n+1):
    DP[i]=DP[i-1]+1
    for point in (6,9):
        cnt=1
        while point**cnt<=i:
            DP[i]=min(DP[i-1]+1,DP[i-point**cnt]+1,DP[i])
            cnt +=1
            
print(DP[n])

Measured memory_bytes: 3828
#include<iostream>
using namespace std;
int main () {
  int ky[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int K;
  cin >> K;
  cout << ky[K - 1] << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
long long MIN(long long x, long long y) { return x < y ? x : y; }
long long MAX(long long x, long long y) { return x > y ? x : y; }
#define lowbit(x) ((x) & (-(x)))
typedef long long ll;
const int MAXN = 2e5 + 123;
using namespace std;

int ans , mul = 1 , sz;
char s[MAXN];

int main() {
    scanf ("%s" , s);
    sz = strlen(s);
    for (int i = sz - 1 ; i >= 0 ; i --) {
        ans = (ans + (s[i] - '0')) % 9;
    }
    if (ans == 0)
        printf ("Yes\n");
    else
        printf ("No\n");
    return 0;
}


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

int main()
{
    string s, t, ans = "";
    cin >> s >> t;
    int sl = s.length(), tl = t.length(), i, j;
    int dp[sl + 1][tl + 1]{};

    for(i = 1; i <= sl; ++i) {
        for(j = 1; j <= tl; ++j) {
            dp[i][j] = (s[i - 1] == t[j - 1]) ? dp[i - 1][j - 1] + 1 : max(dp[i - 1][j], dp[i][j - 1]);
        }
    }

    int len = dp[sl][tl];
    // cout << len << endl;
    i = sl, j = tl;
    while(len) {
        if(dp[i][j] == max(dp[i - 1][j], dp[i][j - 1])) {
            if(dp[i][j] == dp[i - 1][j])
                i = i - 1;
            else if(dp[i][j] == dp[i][j - 1])
                j = j - 1;
        } else if(dp[i][j] == dp[i - 1][j - 1] + 1) {
            ans += s[i - 1];
            i = i - 1;
            j = j - 1;
            len--;
        }
    }
    reverse(ans.begin(), ans.end());
    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 35456
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n, x, t = rli()
    print(t*((n+x-1)//x))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9160
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
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; }
const int INF = 1001001001;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

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

int H, N;
cin >> H >> N;
vector<int> A(N), B(N);
rep(i,N) cin >> A[i] >> B[i];

vector<int> dp(H+1, INF);
  dp[0] = 0;
  rep(i,N) {
    rep(j,H) {
        chmin(dp[min(j+A[i], H)], dp[j] + B[i]);
    }
  }
  cout << dp[H] << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

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

		int N = sc.nextInt();
		int[] x = new int[N];
		int[] a = new int[N];
		for(int i=0; i<N; i++) {
			x[i] = sc.nextInt();
			a[i] = sc.nextInt()-x[i];
		}

		PriorityQueue<Long> lset = new PriorityQueue<>(new Comparator<Long>() {
			public int compare(Long l1, Long l2) {
				return -Long.compare(l1, l2);
			}
		});
		lset.add((long)x[0]);
		long ladd = 0;
		
		PriorityQueue<Long> rset = new PriorityQueue<>();
		rset.add((long)x[0]);
		long radd = 0;
		
		long min = 0;
		
		for(int i=1; i<N; i++) {
			ladd -= a[i];
			radd += a[i-1];
			if(x[i] < lset.peek()+ladd) {
				min = min + (lset.peek()+ladd - x[i]);
				lset.add(x[i]-ladd);
				lset.add(x[i]-ladd);
				rset.add(lset.poll()+ladd-radd);
			} else if(rset.peek()+radd < x[i]) {
				min = min + (x[i] - (rset.peek()+radd));
				rset.add(x[i]-radd);
				rset.add(x[i]-radd);
				lset.add(rset.poll()+radd-ladd);
			} else {
				lset.add(x[i]-ladd);
				rset.add(x[i]-radd);
			}
		}
		System.out.println(min);
		
		sc.close();
	}
}


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

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

  int vec_x[n];
  for(int i=0;i<n;i++){
    vec_x[i] = 0;
  }
  int vec_y[n];
  for(int i=0;i<n;i++){
    vec_y[i] = 0;
  }

  for(int i=0;i<n;i++){
    cin >> vec_x[i];
  }
  for(int i=0;i<n;i++){
    cin >> vec_y[i];
  }

  //debug: vec_x,vec_yの出力
  // for(int i=0;i<n;i++){
  //   cout << vec_x[i] << " ";
  // }
  // cout << endl;
  // for(int i=0;i<n;i++){
  //   cout << vec_y[i] << " ";
  // }
  // cout << endl;

  // p = 1の場合
  double p1 = 0;
  for(int i=0;i<n;i++){
    p1 += fabs(vec_x[i]-vec_y[i]);
  }

  // p = 2の場合
  double p2 = 0;
  double sum2 = 0;
  for(int i=0;i<n;i++){
    sum2 += pow(fabs(vec_x[i]-vec_y[i]), 2);
  }
  p2 = sqrt(sum2);

  // p = 3の場合
  double p3 = 0;
  double sum3 = 0;
  for(int i=0;i<n;i++){
    sum3 += pow(fabs(vec_x[i]-vec_y[i]), 3);
  }
  p3 = pow(sum3, 1.0/3.0);

  // p = infの場合
  double p_inf = 0;
  for(int i=0;i<n;i++){
    if(p_inf<fabs(vec_x[i]-vec_y[i])){
      p_inf = fabs(vec_x[i]-vec_y[i]);
    }
  }

  // 出力
  printf("%.6lf\n", p1);
  printf("%.6lf\n", p2);
  printf("%.6lf\n", p3);
  printf("%.6lf\n", p_inf);

}



Measured memory_bytes: 3348
process.stdin.setEncoding( 'utf8' );

process.stdin.on( 'readable', function() {
    var chunk = process.stdin.read();
    var inputLineArr;

    if ( chunk !== null ) {
        inputLineArr = chunk.split('\n');

        if( inputLineArr[inputLineArr.length-1] == '' )
            inputLineArr.pop();

        var num = inputLineArr[0].split(' ').map( function( elem ) {
            return parseInt( elem );
        } );

        var a = num[0] + num[1],
            b = num[1] + num[2],
            c = num[2] + num[0];

        console.log( Math.min( a, b, c ) );
    }
} );


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

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

int man(int x1, int x2, int y1, int y2) {
  return abs(x1-x2)+abs(y1-y2);
}

void solve() {
  int n, m;
  cin >> n >> m;
  vector<pair<int,int>> a(n), b(m);
  for(int i=0; i<n; ++i) cin >> a.at(i).first >> a.at(i).second;
  for(int i=0; i<m; ++i) cin >> b.at(i).first >> b.at(i).second;

  for(int i=0; i<n; ++i) {
    int min=1e9, ans=0;
    for(int j=0; j<m; ++j) {
      int d = man(a.at(i).first, b.at(j).first, a.at(i).second, b.at(j).second);
      if(min>d) {
        min=d; ans=j+1;
      }
    }
    cout << ans << endl;
  }

  return;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  //cin >> T;
  while(T--) solve();

  return 0;
}


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

int main() {
    int N;
    cin>>N;
    vector<int> p;
    int tmp;
    for(int i=0;i<N;++i){
        cin>>tmp;
        p.push_back(tmp);
    }
    sort(p.begin(), p.end());
    int ans = 0;
    for(int i=0;i<N;++i){
        if(i==N-1)ans += p[i]/2;
        else ans += p[i];
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
N = int(input())

P = []
for i in range(N):
    x, y, h = map(int, input().split())
    P.append((x, y, h))

for cx in range(101):
    for cy in range(101):
        needH = -1
        for x, y, h in P:
            if h == 0:
                continue
            if needH == -1:
                needH = h + abs(x - cx) + abs(y - cy)
            else:
                if needH != h + abs(x - cx) + abs(y - cy):
                    needH = -2
                    break
        if needH == -2:
            continue

        # 高さが０の場合に矛盾してないか調べる
        for x, y, h in P:
            if h == 0:
                if needH > abs(x - cx) + abs(y - cy):
                    needH = -2
                    break
        if needH == -2:
            continue

        print(cx, cy, needH)


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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl
#define DOUBLE(d) cout << fixed << setprecision(15) << (d) << endl

int X, T;

int main() {
    cin >> X >> T;
    cout << max(0, X-T) << endl;
}

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

#define rep(i, n) for (int i=0; i< (n); ++i)
typedef long long ll;
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; }

using namespace std;

int main() {
    int n, k;

    cin >> n >> k;

    int h[n];
    rep(i, n) cin >> h[i];

    sort(h, h+n, greater<>());
    //rep(i, n) cout << h[i] << endl;

    if (n <= k) {
        // 必殺技は数えない
        cout << 0 << endl;
        return 0;
    }
    ll sum = 0;
    // 0 <= k
    for (int i=k; i<n; i++) {
        sum += h[i];
    }

    cout << sum << endl;
}


Measured memory_bytes: 1024
s = input()
n = len(s)
m = (n-1)//2
if s != s[::-1]:
  print('No')
  exit()
t = s[:m]
if t != t[::-1]:
  print('No')
  exit()
if s[:m] != s[-m:]:
  print('No')
  exit()
print('Yes')

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

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

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

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

    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    int ans=0;

    for(int i=0;i<n;i++)
    {
        if(i%2==0)
        {
            ans+=a[i];
        }
        else
        {
            ans-=a[i];
        }
    }

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

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef vector<string> VS;
typedef priority_queue<int> PQ;
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; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//priority_queue<int,vector<int>, greater<int> > q2;


struct UnionFind {
	VI par;
	UnionFind(int N) :par(N) {
		REP(i, N)par[i] = i;
	}
	int root(int x) {
		if (par[x] == x)return x;
		return par[x] = root(par[x]);
	}
	void unite(int x, int y) {
		int rx = root(x);
		int ry = root(y);
		if (rx == ry)return;
		par[rx] = ry;
	}
	bool same(int x, int y) {
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

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

	int N, L; cin >> N >> L;
	VS A(N);
	REP(i, N)cin >> A[i];
	SORT(A);
	REP(i, N)cout << A[i];
	cout << endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#define rep(i, n)for(int i=0; i<n; i++)
using ll = long long int;
using namespace std;

int main(int argc, char const *argv[])
{
    string s;
    getline(cin, s);
    rep(i, s.size()) {
        if(s[i]>='a' && s[i]<='z') s[i] -= 32;
        else if(s[i]>='A' && s[i]<='Z') s[i] += 32; 
    }

    cout << s << endl;
    
    return 0;
}



Measured memory_bytes: 3164
all_match = [2,5,5,4,5,6,3,7,6]

n,m = map(int,input().split())
a = list(map(int,input().split()))
a.sort(reverse=True)
match = []
for num in a:
    match.append(all_match[num-1])

dp = [-10**7 for i in range(n+1)] #桁数
dp[0] = 0

for i in range(1,n+1):
    possible = []
    for honsu in match:
        if i >= honsu:
            possible.append(dp[i-honsu] + 1)
    if len(possible)>0:
        dp[i] = max(possible)

length = dp[n]
ans = 0
now = n
for i in range(length):
    for j in range(m):
        if now >= match[j]:
            if dp[now-match[j]] == dp[now]-1:
                ans += a[j]*10**(length-i-1)
                now -= match[j]
                break

print(ans)

Measured memory_bytes: 42204
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int S, X;
  cin >> S;
  
  REP(i, 100000) {
    if (S == 4 || S == 2 || S == 1) {
      cout << i + 4 << endl;
      return 0;
    }
    if (S % 2 == 0) {
      S = S/2;
    } else {
      S = 3*S + 1;
    }
  }
  return 0;
}

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

typedef pair<int, int>P;

int main(){

    int N;
    cin >> N;
    vector<P>vec(N);
    rep(i, N){
        cin >> vec[i].first;
        vec[i].second = i;
    }
    sort(vec.begin(), vec.end());
    int ans = 0;
    rep(i, N){
        if(vec[i].second % 2 == 0 && i % 2 == 1)ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
import numpy as np
H,W = map(int,input().split())

S = [list(input()) for _ in range(H)]
point_list = np.array([['#']*W]*H)
dy = [0,0,1,1,1,-1,-1,-1]
dx = [1,-1,0,1,-1,0,1,-1]

for h in range(H):
  for w in range(W):
    count = 0
    for i in range(8):
      y = h+dy[i]
      x = w+dx[i]
      if y < 0 or y >= H or x < 0 or x >= W:
        continue
      if S[h][w] == '.' and S[y][x] == '#':
        count += 1
    if S[h][w] == '.':
      point_list[h][w] = count

for j in range(H):
  print(''.join(point_list[j]))

Measured memory_bytes: 12436
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

int main () {
  vector<int> v;
  for (int i = 0; i < 10; i++) {
    int t;
    scanf("%d", &t);
    v.push_back(t);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < 3; i++) {
    printf("%d\n", v[9 - i]);
  }
}

Measured memory_bytes: 1052
r,c= map(int,input().split())
a=[[0 for i in range(c+1)] for j in range(r+1)]

for k in range(r):
    b = input().split()
    b_int = [int(s) for s in b ]
    for s in range(len(b_int)):
        a[k][s] = b_int[s]
i = 0
j = 0
for i in range(r):
    for j in range(c):
        a[i][c]+=a[i][j]
i = 0
j = 0
for i in range(c+1):
    for j in range(r):
        a[r][i]+=a[j][i]
i = 0
for i in range(r+1):
    print(' '.join(map(str,a[i])))


Measured memory_bytes: 5716
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
#define int long
#define ll long long
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define mk make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) x.size()
#define fi first
#define se second
const int INF = 1e9;
using namespace std;

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(20);

    int N; cin >> N;
    string S;
    cin >> S;
    string a,b;
    a=S.substr(0,N/2);
    b=S.substr(N/2,N/2);
    if(a==b && SZ(S)%2==0) cout << "Yes" << endl;
    else cout << "No" << endl;
}


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

using namespace std;

void solve()
{
    int a,b,c,k,res=0;
    cin>>a>>b>>c>>k;

    while(a&&k)
    {
        res+=1;
        a--;
        k--;
    }

    while(b&&k)
    {
        res+=0;
        b--;
        k--;
    }

    while(c&&k)
    {
        res+=-1;
        c--;
        k--;
    }

    cout<<res<<endl;
}

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

    solve();
    return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define INF 999999999
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define Vecpr vector<pair<lli,lli>>
int main() {
  lli A,B,C,D;
  string a,b,c;
  cin >>A>>B>>C>>D;
  Out(max(A*B,C*D));
}


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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< int , string> P;
//実装案　勝たなかった試合＆負けた試合のベクター　照準ソートして上から
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.first!= secondElof.first)    return firstElof.first> secondElof.first;

else return false;
}
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
string k;
bool a=false;
while(1){

  std::cin >> x;
  if(x==0)return 0;
  if(a){
      std::cout << '\n';
  }
  std::vector< pair <int,string> > v(x);
  Rep(j,x){
      std::cin >> k;
    v[j].second=k;
    v[j].first=0;
std::cin >> y>>z>>w;
v[j].first=y*3+w;
    }

  sort(all(v),pairCompare);
  rep(i,x){
    std::cout << v[i].second<<","<<v[i].first<< '\n';
  }
if(!a)a=true;
}
}


Measured memory_bytes: 3176
#include <iostream>

using namespace std;

int main() {
    long long int N = 0;
    long long int square = 0;
    long long int _square = 0;
    long long int i = 0;
    cin >> N;
    while(true) {
        i++;
        _square = i * i;
        if(!(_square <= N)) {
            break;
        }
        else {
            square = _square;
        }
    }
    cout << square << endl;
    return 0;
}

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

// 插入此處
const int MAXN = 1e3 + 2;
string S[MAXN];
int ans[MAXN][MAXN];
bool vis[MAXN][MAXN];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int bfs(int H, int W, int ch, int cw, int dh, int dw) {
    memset(vis, 0, sizeof(vis));
    memset(ans, -1, sizeof(ans));

    queue<pair<int, int>> q, qq;
    q.push(make_pair(ch, cw));
    qq.push(make_pair(ch, cw));
    ans[ch][cw] = 0;
    int time = 0;
    while (true) {
        // cout << "time " << time << endl;
        if (q.empty())  break;
        // walk
        while (q.size()) {
            pair<int, int> tmp = q.front();
            q.pop();
            int x = tmp.first, y = tmp.second;
            for (int i = 0; i < 4; ++i) {
                int xx = x + dx[i];
                int yy = y + dy[i];
                if (xx >= 0 && xx < H && yy >= 0 && yy < W && S[xx][yy] == '.' && ans[xx][yy] == -1) {
                    q.push(make_pair(xx, yy));
                    qq.push(make_pair(xx, yy));
                    ans[xx][yy] = time;
                }
            }
        }
        // jump!
        queue<pair<int, int>> qqq;
        while (qq.size()) {
            pair<int, int> tmp = qq.front();
            qq.pop();
            int x = tmp.first, y = tmp.second;
            for (int i = -2; i <= 2; ++i) {
                for (int j = -2; j <= 2; ++j) {
                    int xx = x + i;
                    int yy = y + j;
                    if (xx >= 0 && xx < H && yy >= 0 && yy < W && S[xx][yy] == '.' && ans[xx][yy] == -1) {
                        q.push(make_pair(xx, yy));
                        qqq.push(make_pair(xx, yy));
                        ans[xx][yy] = time+1;
                    }
                }
            }
        }
        while (qqq.size()) {
            auto tmp = qqq.front(); qqq.pop();
            qq.push(make_pair(tmp.first, tmp.second));
        }
        ++time;
    }
    return ans[dh][dw];
}

int main() {
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    int H, W; cin >> H >> W;
    int ch, cw; cin >> ch >> cw;
    int dh, dw; cin >> dh >> dw;
    for (int i = 0; i < H; ++i) {
        cin >> S[i];
    }
    cout << bfs(H, W, ch-1, cw-1, dh-1, dw-1) << endl;
    // for (int i = 0; i < H; ++i) {
    //     for (int j = 0; j < W; ++j) {
    //         cout << ans[i][j] << ' ';
    //     }
    //     cout << endl;
    // }
    return 0;
}


Measured memory_bytes: 9528
n = int(input())
a = [int(input()) for _i in range(n)] + [-1]

result = -1
for i in range(n):
    if a[i-1] == a[i]:
        result += a[i]
    elif a[i-1] + 1 == a[i]:
        result += 1
    elif a[i-1] > a[i]:
        result += a[i]
    else:
        result = -1
        break
print(result)

Measured memory_bytes: 12584
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long int li;

const li MAX_N = 1000000000;

int main(int argc, char const *argv[]) {
  li q, h, s, d, n;
  cin >> q >> h >> s >> d >> n;
  li H, S;
  H = min(h,q*2);
  S = min(s,H*2);
  li ans;
  if (S*2 <= d) ans = S * n;
  else ans = d *(n/2) + S*(n%2);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;

int square(int a) { return a * a; }

int main() {
    int n, d;
    cin >> n >> d;
    vector<vector<int>> x(n, vector<int>(d));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < d; j++) {
            cin >> x.at(i).at(j);
        }
    }

    int cnt = 0;
    int dis = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            dis = 0;
            for (int k = 0; k < d; k++) {
                dis += square(x.at(i).at(k) - x.at(j).at(k));
            }
            for (int k = 0; k * k <= dis; k++) {
                if (dis == k * k) {
                    cnt++;
                }
            }
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3636
# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    x = int(input())

    if x >= 30:
        return "Yes"
    return "No"


if __name__ == "__main__":
    print(main())


Measured memory_bytes: 9132
import java.io.*;
    import java.util.*;
    import java.util.LinkedList;

    public class Main {

        public static void main(String[] args) throws IOException {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            InputReader in = new InputReader(inputStream);
            InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);
            BufferedReader reader = new BufferedReader(new InputReader(System.in));

            double d = in.nextDouble();
            double t = in.nextDouble();
            double s = in.nextDouble();
            double time = d/s;
            if(time<=t) out.println("Yes");
            else out.println("No");
            out.flush();
        }
        private static int gcd(int a, int b) {
            return b == 0 ? a : gcd(b,a%b);
        }
        private static void shuffle(int [] a) {
            for (int i = 0; i < a.length; i++) {
                int index = (int) (Math.random() * a.length);
                int temp = a[index];
                a[index] = a[i];
                a[i] = temp;
            }
        }
    }

    class InputReader extends BufferedReader {
        StringTokenizer tokenizer;

        public InputReader(InputStream inputStream) {
            super(new InputStreamReader(inputStream), 32768);
        }

        public InputReader(String filename) {
            super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
        }

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

        public Integer nextInt() {
            return Integer.valueOf(next());
        }
        public Long nextLong() {
            return  Long.valueOf(next());
        }
        public Double nextDouble () {
            return Double.valueOf(next());
        }


        static class OutputWriter extends PrintWriter {
            public OutputWriter(OutputStream outputStream) {
                super(outputStream);
            }

            public OutputWriter(Writer writer) {
                super(writer);
            }

            public OutputWriter(String filename) throws FileNotFoundException {
                super(filename);
            }

            public void close() {
                super.close();
            }
        }
    }

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c; cin>>a>>b>>c;
    set<int> s;
    s.ins(a);
    s.ins(b);
    s.ins(c);
    cout<<s.size()<<endl;
    return 0;
}


Measured memory_bytes: 256
import itertools

N = int(input())
S = [input()[0] for _ in range(N)]

m = S.count('M')
a = S.count('A')
r = S.count('R')
c = S.count('C')
h = S.count('H')

ans = [m, a, r, c, h]

j = 0
p = list(itertools.combinations(ans,3))
for i in p:
    j += i[0]*i[1]*i[2]

print(j)

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

int main()
{
	long long n;

	cin >> n;
	long long ans = n;
	for (long long i=1; i*i<=n; ++i)
		if (n % i == 0)
			ans = min(ans, i+n/i-2);

	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define mp make_pair
#define MEM(x) memset(x,0,sizeof(x))
#define vc vector<int>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define inf 0x3f3f3f3f
#define t_case int tt; cin>>tt; while (tt--)
#define lnginf 9223372036854775807
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define ins insert
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<' ' ; }
#define PI 3.14159265359
const long long LL_INF = (long long) 2e18 + 5;
using namespace std;
const int N = 1e5 + 1;
void solve() {
	int n; cin >> n;
	int a = n;
	cout << (a + a * a + a * a * a) << '\n';


}
int32_t main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif


	fastio   solve();


}

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

#ifndef ONLINE_JUDGE
	#define W(x, y) cerr << "\033[31m" << #x << " = " << x << "\033[0m" << y;
#else
	#define W(x, y)
#endif


#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vii vector<pii>
#define vl vector<ll>
#define vll vector<pll>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pi acos(-1)
#define ld long double
#define prime (1000000000 + 7)

using namespace std;

#define INF 1000000000



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

	ll a, b, c;
	cin >> a >> b >> c;

	cout << min(b/a, c) << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdlib>
#include <cmath>
#include<stdio.h>
#include<queue>
#include<stack>
#include<set>
#define int long long
#define MAX 1000000000000000000LL
int inf=100000000000007;
using namespace std;
typedef pair<int,int> P;
string alph="abcdefghijklmnopqrstuvwxyz";
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

signed main(){
    int n;cin>>n;
    set<int> s;
    int a;
    for(int i=0; i<n;i++){
        cin>>a;
        auto itr=s.find(a);
        if(itr==s.end()){
            s.insert(a);
        }
        else s.erase(a);
    }
    cout<<s.size()<<endl;
    return 0;
}


Measured memory_bytes: 4864
S = input()
p = int(S[:2])
s = int(S[2:])

if (p > 12 or p == 0) and (s <= 12 and s > 0):
  print("YYMM")
elif (p > 0 and p <= 12) and (s > 12 or s == 0):
  print("MMYY")
elif p < 13 and s < 13 and p > 0 and s > 0:
  print("AMBIGUOUS")
else:
  print("NA")


Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main()
{
	string N;
	cin >> N;

	if (N[0]==N[1]&&N[0]==N[2])
	{
		cout << "Yes" << endl;
	}
	else
	if (N[1] == N[2] && N[1] == N[3])
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <cmath>
#include <iterator>
#include <numeric>
#include <iomanip>
#define FI first
#define SE second
#define EB emplace_back
#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 1100000000
#define LLINF 1100000000000000000LL
#define Decimal fixed << setprecision(20)
#define ALL(c) c.begin(),c.end()
#define SHOWVEC(v, sz) for(int i = 0; i < sz; i++) cerr << v[i] << ' '; cerr << endl;
#define SHOWX(x) cerr << #x << ": " << x << endl;
#define SHOWP(p) cerr << "[" << p.first << ',' << p.second << "]";

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int main()
{
  int N;
  cin >> N;
  vector<int> H(N);
  REP(i, N) cin >> H[i];
  int r = 0;
  int ans = 0;
  for (int l = 0; l < N; l++) {
    if (r < l) r = l;
    while (r + 1 < N && H[r] >= H[r + 1]) r++;
    SHOWP(make_pair(l, r));
    ans = max(r - l, ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
using namespace std;
int main(void){
      long long n,max,min,sum=0;
      cin >> n ;
      long long a[n];
      for(int i=0;i<n;i++){
            cin>>a[i];
            sum+=a[i];
            if(i==0){
                        max=a[i];
                        min=a[i];
            }
            if(a[i]>max)max=a[i];
            if(a[i]<min)min=a[i];
      }
      cout << min << " " << max << " " << sum << endl;
      return 0;
}
      




Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define INF 0x7fffffff
#define LL_INF 0x7fffffffffffffff
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

int main(void) {
	int d, s, t; cin >> d >> t >> s;
	cout << ((d <= t * s)? "Yes" : "No") << endl;
	return 0;
}



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

int main () {
  int n;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < n; i++)
    cin >> x[i];
  
  sort (x.begin(), x.end());
  
  int mostLeftAddress = x[0];
  int mostRightAddress = x[n-1];

  vector<int> sums(mostRightAddress - mostLeftAddress + 1);
  for (int i = mostLeftAddress; i <= mostRightAddress; i++) {
    int pAddress = i;
    int sum = 0;
    for (int j = 0; j < n; j++)
      sum += (x[j] - pAddress) * (x[j] - pAddress);
    sums[i - mostLeftAddress] = sum;
  }
  
  sort (sums.begin(), sums.end());
  
  cout << sums[0] << endl;
  
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Rotation solver = new Rotation();
        solver.solve(1, in, out);
        out.close();
    }

    static class Rotation {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            String first = in.next();
            String second = new StringBuilder(in.next()).reverse().toString();
            if (first.equals(second)) {
                out.println("YES");
            } else {
                out.println("NO");
            }
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

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

    }
}



Measured memory_bytes: 21460
#include<bits/stdc++.h>
using namespace std;
#define SORT(c) sort((c).begin(),(c).end());
#define pb push_back
#define MP make_pair
#define pii pair<int,int>
#define pcc pair<char,char>
#define pic pair<int,char>
#define pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define pi 3.141592653589793
#define ll long long
#define ull unsigned long long
#define w(x) int x;cin>>x;while(x--)
#define fast ios_base::sync_with_stdio(0)
#define sz size()
typedef unsigned long long UL;
template<typename T>inline T  S(T a)
{
    return a*a;
}
template<class T>inline string tostring(T a)
{
    ostringstream os("");
    os << a;
    return os.str();
}
template<typename T>inline ll tolong(T a)
{
    ll res;
    istringstream os(a);
    os>>res;
    return res;
}
template<typename T>inline T gcd(T a, T b)
{
    if (b == 0)return a;
    else return gcd(b, a % b);
}
template<typename T>inline T bigmod(T a, T b, T m)
{
    if (b == 0)return 1;
    else if (b % 2 == 0)return S(bigmod(a, b / 2, m)) % m;
    else return (a % m*bigmod(a, b - 1, m)) % m;
}
const int inf = (int)1e9 + 5;
const ll linf = (ll)1e16 + 5;
const ll modd = (ll)1e9 + 7;
const int mod = 10000007;
/*#define N 20000009
bool prime[N];
vector<ll> prm;
void seive ()
{

    memset(prime, true, sizeof(prime));

    for( ll i=2; i*i<=N; i++)
    {
        if (prime[i] == true)
        {
            prm.pb(i);
            for (ll j=i*i; j<=N; j += i)
                prime[j] = false;
        }
    }
}*/
void pr (int f)
{
    if(f==1)
        cout<<"YES\n";
    else
        cout<<"NO\n";
}
map<string,string>ma;
set<int > s;
multiset<string> :: iterator it;

deque <char> q ;
ll ar [55100];
int main()
{
    fast;
     int n,k,x,y;
     cin>>n>>k>>x;
   set < int > s;
 s.insert(n);
 s.insert(k);
s.insert(x);
  cout << s.sz<<endl;
}




Measured memory_bytes: 3580