akhauriyash/Code-Regression huggingface dataset:
//WA RE TLE MLE 10 pts
//Always look up the code afeter programming
//Keep Calm
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F(i, j, k) for(ll i = j; i <= k; ++i)
#define D(i, j, k) for(ll i = j; i >= k; --i)
#define pp pair<ll, ll>
#define mp make_pair
const ll maxn = 3e2+5;
ll n, m, x, y, z;
ll read() {
    char ch = getchar();
    ll x = 0,f = 1;
    while(!isdigit(ch)) {
	if(ch == '-') f = -1;
	ch = getchar();
    }
    while(isdigit(ch)) {
	x = x * 10 + ch - '0';
	ch = getchar();
    }
    return x * f;
}
//by GengChen================
ll a[maxn][maxn], g[maxn][maxn];
struct edge{
    ll w, x, y;
    edge(ll a, ll b, ll c):w(a), x(b), y(c){}
    edge(){}
    bool operator < (const edge b) const {
	return this->w < b.w;
    }
}e[maxn * maxn];
const ll inf = 100000000000;
int main() {
#ifdef orz
    freopen("input", "r", stdin);
#endif
    n = read();
    F(i, 1, n) F(j, 1, n) a[i][j] = read(), g[i][j] = inf;
    F(i, 1, n) F(j, 1, n) if(a[i][j] != a[j][i]) return puts("-1") & 0;
    F(i, 1, n) if(a[i][i] != 0) return puts("-1") & 0;
    F(i, 1, n) g[i][i] = 0;
    F(k, 1, n) F(i, 1, n) F(j, 1, n) if(a[i][j] > a[i][k] + a[k][j]) return puts("-1") & 0;
    ll cnt = 0;
    F(i, 1, n) F(j, i+1, n) e[++cnt] = edge(a[i][j], i, j);
    sort(e+1, e+1+cnt);
    ll ans = 0;
    F(i, 1, cnt) {
	ll u = e[i].x, v = e[i].y;
	if(g[u][v] > e[i].w) {
	    g[v][u] = g[u][v] = e[i].w, ans += e[i].w;
	    F(U, 1, n) F(V, 1, n) {
		ll tmp = min(g[U][u] + e[i].w + g[V][v], g[U][v] + e[i].w + g[V][v]);
		g[U][V] = g[V][U] = min(g[U][V], tmp);
	    }
	}	
    }
    printf("%lld\n", ans);

}


Measured memory_bytes: 2688
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
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<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
const ll INF = 1LL << 62;

vector<vector<char>> cart_product(const vector<vector<char>>& v) {
  vector<vector<char>> s = {{}};
  for (auto& u : v) {
    vector<vector<char>> r;
    for (auto& x : s) {
      for (auto y : u) {
        r.push_back(x);
        r.back().push_back(y);
      }
    }
    s.swap(r);
  }
  return s;
}

bool ok1(ll n, const string& ans, const string& s) {
  if (ans[0] == 'S') {
    if (s[0] == 'o') {
      return ans[n - 1] == ans[1];
    } else {
      return ans[n - 1] != ans[1];
    }
  } else {
    if (s[0] == 'o') {
      return ans[n - 1] != ans[1];
    } else {
      return ans[n - 1] == ans[1];
    }
  }
}

bool ok2(ll n, const string& ans, const string& s) {
  if (ans[n - 1] == 'S') {
    if (s[n - 1] == 'o') {
      return ans[n - 2] == ans[0];
    } else {
      return ans[n - 2] != ans[0];
    }
  } else {
    if (s[n - 1] == 'o') {
      return ans[n - 2] != ans[0];
    } else {
      return ans[n - 2] == ans[0];
    }
  }
}

int main() {
  //
  ll n;
  cin >> n;
  string s;
  cin >> s;
  vector<vector<char>> v = {{'S', 'W'}, {'S', 'W'}};
  vector<vector<char>> start = cart_product(v);
  for (auto& st : start) {
    string ans(n, ' ');
    // cout << st[0] << "," << st[1] << "," << st[2] << endl;
    rep(i, 2) ans[i] = st[i];
    REP(i, 1, n - 1) {
      if (ans[i] == 'S') {
        if (s[i] == 'o') {
          ans[i + 1] = ans[i - 1];
        } else {
          if (ans[i - 1] == 'S') {
            ans[i + 1] = 'W';
          } else {
            ans[i + 1] = 'S';
          }
        }
      } else {
        if (s[i] == 'o') {
          if (ans[i - 1] == 'S') {
            ans[i + 1] = 'W';
          } else {
            ans[i + 1] = 'S';
          }
        } else {
          ans[i + 1] = ans[i - 1];
        }
      }
    }
    if (ok1(n, ans, s) && ok2(n, ans, s)) {
      cout << ans << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}


Measured memory_bytes: 576
#include <iostream>
#include <string>

int main() 
{
    int A, B, C;
    std::cin >> A; std::cin >> B; std::cin >> C;
    std::cout << std::to_string(C) + " " + std::to_string(A) + " " + std::to_string(B) << std::endl;
}

Measured memory_bytes: 3608
#include <stdio.h>

int dp[50];

int fib(int n) {
  if ( n == 0 || n == 1 ) return dp[n] = 1;
  if ( dp[n] !=  -1 ) return dp[n];
  return dp[n] = fib(n -1) + fib(n - 2);
}

int main()
{
  int n, i;
  for (i = 0; i < 50; i++) dp[i] = -1;

  scanf("%d", &n);
  printf("%d\n", fib(n));

  return 0;
}



Measured memory_bytes: 2036
#include <bits/stdc++.h>
#define rep(i , n) for (int i = 0; i < (int)(n); i++)
const int INF = 1<<29;
using namespace std;
using ll = long long;
int n , ans , a[100001];
int main(){
    cin >> n;
	for (int i = 1; i <= n; i++){
        cin >> a[i];
    }
	for (int i = 1; i <= n; i++){
		if (a[i] == i){
			swap(a[i + 1] , a[i]);
			ans++;
		}
    }
        cout << ans << endl;
}

Measured memory_bytes: 3940
import sys

k = int(input())

dp = [ [ [] for _ in range(10)]  for _ in range(10)]
num = 0

for i in range(0,10):
    for j in range(0,10):
        if i==0:
            candi = [""]
        else:
            candi = []
            if j>0: candi += dp[i-1][j-1]
            candi += dp[i-1][j]
            if j<9: candi += dp[i-1][j+1]
        for x in candi:
            x = str(j)+str(x)
            dp[i][j].append(x)
            if j>0:
                num += 1
                if num == k:
                    print(x)
                    sys.exit()
        
    

Measured memory_bytes: 11132
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		scan.close();
		String answer = new String();
		if(a < b && b < c)
			answer = "Yes";
		else
			answer = "No";
		System.out.println(answer);
	}

}

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

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

  int a = n % 10;

  string ans;
  if (a == 2 || a == 4 || a == 5 || a == 7 || a == 9) {
    ans = "hon";
  } else if (a == 3) {
    ans = "bon";
  } else {
    ans = "pon";
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    ll n,k;cin>>n>>k;
    vector<ll> a(n),d(100,0);
    rep(i,n) cin>>a[i];
    rep(i,n){
        rep(j,40)if(a[i]&((ll)1<<j))d[j]++;
    }
    ll l=0;
    for(int i=40;i>=0;i--){
        if(d[i]<=(n/2)){
            if(l+((ll)1<<i)>k) continue;
            else l+=((ll)1<<i);
        }
    }
    ll res=0;
    rep(i,n){
        res+=(a[i]^l);
    }
    cout<<res<<endl;
}


Measured memory_bytes: 3952
#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define pb push_back
#define empb emplace_back
#define mp make_pair
#define F first
#define S second
#define endl "\n"
#define vii vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define mapii map<int,int> 
#define mapll map<ll,ll>
#define all(a) a.begin(),a.end()
#define test ll t; cin>>t; while(t--)
#define prec(n) fixed<<setprecision(n)
#define jaldibazi ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007


int main(){
	jaldibazi;

	int a, b; cin >> a; 
	char c; cin >> c;
	cin >> b;

	cout << (c == '+' ? (a+b) : (a-b) ) << "\n";
	return 0; 
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL LINF=1LL<<62;


int main(){
    int N;
    cin >> N;
    vector<LL> A;
    for(int i=0;i<N;i++){
        LL a;
        cin >> a;
        A.pb(a);
    }
    LL ans=0;
    int r=0;
    LL sum=A[0],tsum=A[0];
    for(int l=0;l<N;l++){
        while(r!=N-1){
            if((sum+A[r+1])==(tsum^A[r+1])){
                sum+=A[r+1];
                tsum^=A[r+1];
                r++;
            }
            else break;
        }
        ans+=r-l+1;
        sum-=A[l];
        tsum^=A[l];
    }
    cout << ans << endl;
    return 0;
}

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

#define repb(i,s,t) for(int i=s;i<=t;++i)
#define pow2(x) ((x)*(x))
#define mst(a,b) memset(a,b,sizeof(a))
#define mcpy(des,sor) memcpy(des,sor,sizeof(des))
#define pt(x) cout<<#x<<" = "<<x<<endl
#define maxn 200005
typedef long long ll;
typedef pair<int,int> pii;
const int inf = 0x3f3f3f3f;

int cal(char s[200],char c)
{
	char a[200];
	int i;
	bool ok;
	mcpy(a,s);
	for(int r=0;;++r)
	{
		ok=true;
		for(i=0;a[i];++i)ok=ok&&(a[i]==c);
		if(ok||i==0)return r;
		for(i=0;a[i];++i)if(a[i]==c||a[i+1]==c)a[i]=c;
		a[--i]=0;
	}
}

int main()
{
	char str[200];
	int ans=inf;
	cin>>str;
	repb(i,0,25)ans=min(ans,cal(str,i+'a'));
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python
"""NOMURA プログラミングコンテスト 2020: A - Study Scheduling
https://atcoder.jp/contests/nomura2020/tasks/nomura2020_a
"""


def main():
    H1, M1, H2, M2, K = list(map(int, input().split()))

    minuts = (H2 - H1) * 60 + (M2 - M1)
    print(minuts - K)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9056
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
namespace prime {
  bool is_prime(ll n) {
    if(n < 2) return false;
    for(ll i = 2; i * i <= n; i++) {
      if(n % i == 0) return false;
    }
    return true;
  }
  vector<ll> divisors(ll n) {
    vector<ll> res;
    for(ll i = 1; i * i <= n; i++) {
      if(n % i == 0) {
        res.push_back(i);
        if(i != n / i) res.push_back(n / i);
      }
    }
    return res;
  }
  map<ll, int> prime_factors(ll n) {
    map<ll, int> res;
    if(n < 2) return res;
    for(ll i = 2; i * i <= n; i++) {
      while(n % i == 0) {
        res[i]++;
        n /= i;
      }
    }
    if(n > 1) res[n] = 1;
    return res;
  }
};

void answer() {
  int n;
  cin >> n;
  int ans = 0;
  REPC(i, 1, n) if(i % 2) {
    if(prime::divisors(i).size() == 8) ans++;
  }
  cout << ans << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3636
using System;
class Program {
  static void Main(string[] args) {
    string[] value = Console.ReadLine().Split();
    int A = int.Parse(value[0]);
    int B = int.Parse(value[1]);
    int price = 0;
    if (A >= 13) price = B;
    else if (A >= 6) price = B / 2;

    Console.WriteLine(price);
  }
}


Measured memory_bytes: 13140
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
using namespace std;
namespace io{
    #define ll long long
    #define inf 0x3f3f3f3f
    #define il inline 
    #define in1(a) readl(a)
    #define in2(a,b) in1(a),in1(b)
    #define in3(a,b,c) in2(a,b),in1(c)
    #define in4(a,b,c,d) in2(a,b),in2(c,d)
    il void readl(ll &x){
        x=0;ll f=1;char c=getchar();
        while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
        while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
        x*=f;
    }
    il void read(int &x){
        x=0;int f=1;char c=getchar();
        while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
        while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
        x*=f;
    }
}using namespace io;
ll k,a,b;
int main(){
	in3(k,a,b);
	if(a>=b||k<a||b-a==1) printf("%lld",k+1);
	else{
		k-=a-1;
		ll ans=a;
		ans+=k/2*(b-a);
		if(k&1) ans++;
		printf("%lld",ans);
	}
	return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std ;

string s;

int main(){
	cin>>s;
	if (s=="AKIHABARA"||
		s=="KIHABARA" ||
		s=="AKIHBARA" ||
		s=="AKIHABRA" ||
		s=="AKIHABAR" ||
		s=="KIHBARA" ||
		s=="KIHABRA" ||
		s=="KIHABAR" ||
		s=="AKIHBRA" ||
		s=="AKIHBAR" ||
		s=="AKIHABR" ||
		s=="KIHBRA" ||
		s=="KIHBAR" ||
		s=="KIHABR" ||
		s=="AKIHBR" ||
		s=="KIHBR") puts("YES") ;
	else puts("NO");
	return 0 ;
}

Measured memory_bytes: 1144
package main

import (
	"fmt"
	"math"
	"strconv"
)

func main() {
	var s string
	fmt.Scan(&s)

	min := 10000000000
	for i := 0; i < len(s)-2; i++ {
		str := s[i : i+3]
		n, _ := strconv.Atoi(str)

		m := int(math.Abs(float64(753 - n)))
		if m < min {
			min = m
		}
	}

	fmt.Println(min)
}


Measured memory_bytes: 512
s=input()
t=input()
n=len(s)
n1=len(t)
tot=n
for i in range(n):
    ans=0
    f=0
    for j in range(n1):
        if i+j>=n:
            f=1
            break
        if s[i+j]==t[j]:
            continue
        else:
            ans+=1
    if f==0:
        tot=min(tot,ans)
print(tot)



Measured memory_bytes: 9052
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
#define rep(i, n) for(int i = 0; i < n; i++)
const int inf9 = 1e9; const lint inf18 = 1e18;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint P(int n, int r){ if(r < 0 || n < r) return 0; return (fact[n] * inv[n - r] % mod); } lint C(int p, int q){ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }
template<class itr, class itr2> bool next_sequence2(itr first, itr last, itr2 first2, itr2 last2){ itr now = last; itr2 now2 = last2; while(now != first){ now--, now2--; (*now)++; if((*now) == (*now2)){ (*now) = 0; }else{ return true; } } return false; }
inline int at(lint i, int j){ return (i >> j) & 1; }

int main(){
    lint A, B, K;
    cin >> A >> B >> K;
    if(K <= A){
        cout << A - K << " " << B << endl;
    }else{
        cout << 0 << " " << max(0ll, B - (K - A)) << endl;
    }
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define lld long long int
vector<vector<char>> grid;
vector<vector<lld>> dp;
lld n,m,ans=0;
bool isValid(int x,int y){
    if(x>=n || y>=m || x<0 || y<0)
        return false;
    return true;
}
int dfs(int x,int y){
    if(x==n-1 && y==m-1){
        return 1;
    }
    if(dp[x][y]!=-1){
        return dp[x][y];
    }
    int distx[]={0,1};
    int disty[]={1,0};
    lld st=0;
    for(int i=0;i<2;i++){
        int nx=x+distx[i];
        int ny=y+disty[i];
        if(isValid(nx,ny) && grid[nx][ny]=='.'){
            st=(st%MOD+dfs(nx,ny)%MOD)%MOD;
        }
    }
    dp[x][y]=st;
    return dp[x][y];
}
int main(){
    cin>>n>>m;
    for(int i=0;i<n;i++){
        vector<char> dummy;
        for(int j=0;j<m;j++){
            char data;
            cin>>data;
            dummy.push_back(data);
        }
        grid.push_back(dummy);
    }
    dp.resize(n+1,vector<lld>(m+1,-1));
    ans=dfs(0,0);
    cout<<ans<<"\n";
}

Measured memory_bytes: 9344
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define MAX 200005
lli arr[MAX];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    set <string> ans;

    lli N;
    cin>>N;
    string s;
    for(lli i = 0; i<N; i++){
        cin>>s;
        ans.insert(s);
    }
    cout<<ans.size()<<endl;
}   

Measured memory_bytes: 19268
// 標準入力
var fs = require('fs'),
length = fs.fstatSync(process.stdin.fd).size,
buffer = new Buffer(length),
bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
input = buffer.toString('utf8', 0, bytesRead).split('\n');
main();
  
// ここから
function main(){
  for(var line = 1, maxLines = input[0] - 0; line <= maxLines; line++){
    var inputArray = input[line].split(" ").sort(function(a,b){return a-b});
    var longest = pow(inputArray[2]);
    var middle = pow(inputArray[1]);
    var shortest = pow(inputArray[0]);
    var isRightTriangle = longest == middle + shortest;
      console.log(isRightTriangle ? 'YES' : 'NO');
  }
}

function pow(a){
  return a*a;
}

Measured memory_bytes: 10376
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<pii>;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (ll)((x).size())
#define all(x) (x).begin(), (x).end()
#define each(a, x) for (auto&& a : (x))
#define _overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(i, a, n, 1)
#define rep4(i, a, n, s) for (ll i = (a); i < (n); i += (s))
#define rep(...) _overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template<typename T> inline void print(const T& x) {cout << x << "\n";}
template<typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template<typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
struct Init {Init() {cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10);}} init;

int main() {
    ll n, m, k;
    cin >> n >> m >> k;
    vi a(n + 1, 0);
    rep(i, n) {
        ll A;
        cin >> A;
        a[i + 1] = a[i] + A;
    }
    vi b(m + 1, 0);
    rep(i, m) {
        ll B;
        cin >> B;
        b[i + 1] = b[i] + B;
    }
    ll ma = 0;
    rep(i, n + 1) {
        if (a[i] > k) break;
        ll j = (upper_bound(all(b), k - a[i]) - b.begin()) - 1;
        chmax(ma, i + j);
    }
    print(ma);
}


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

bool isprime(int x)
{
	if(x==2)
		return true;
	if(x<2||x%2==0)
		return false;
	for(int i=3;i*i<=x;i+=2){
		if(x%i==0)
			return false;
	}
	return true;
}

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

	int cnt=0;

	for(int i=0;i<n;i++){
		int x;
		cin>>x;

		if(isprime(x)){
			cnt++;
		}
	}
	cout<<cnt<<endl;
}

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

int main(){
    int n;
    cin >> n;
    int a[2*n];
    for(int i=0;i<2*n;i++){
        cin >> a[i];
    }
    sort(a,a+2*n);
    int count=0;
    for(int i=0;i<n;i++){
        count+=a[i*2];
    }
    cout << count << endl;
}


Measured memory_bytes: 256
while True:
    a,b=map(int,input().split())
    if a==0 and b==0:
        break
    else:
        for i in range(a):
            if i%2 == 0:
                for j in range(b):
                    if j%2 == 0:
                        print("#",end="")
                    else:
                        print(".",end="")
                print("")
            else:
                for j in range(b):
                    if j%2 == 0:
                        print(".",end="")
                    else:
                        print("#",end="")
                print("")
    print()


Measured memory_bytes: 7008
def solve():
    MAX = 1000001
    N = int(input())
    arr = list(map(int, input().split(" ")))
    arr.sort()
    is_ans = [True]*MAX
    ans = 0

    dup = set()
    for a in arr :
        if a in dup and is_ans[a] :
            j = a
            while j < MAX :
                is_ans[j] = False
                j += a

        dup.add(a)

    for a in arr :
        if is_ans[a]:
            ans += 1
            j = a
            while j < MAX :
                is_ans[j] = False
                j += a

    return ans

print(solve())


Measured memory_bytes: 40284
/* be name Khoda */
#include <bits/stdc++.h>
using namespace std;

const int N = 100 * 1001;
int n, a[N], numdif, maxi, mini = N;
bool dif;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	mini = a[0], maxi = a[n - 1];
	if (maxi - mini > 1)
		cout << "No";
	else {
		if (mini == maxi) {
			if (a[0] + 1 == n || 2 * a[0] <= n) 
				cout << "Yes";
			else
				cout << "No";
		}
		else {
			int nummini = 0, nummaxi = 0;
			for (int i = 0; i < n; i++) {
				if (a[i] == maxi)
					nummaxi++;
				else 
					nummini++;
			}
			int bigger = maxi - nummini;
			if (maxi > nummini && 2 * bigger + nummini <= n)
				cout << "Yes";
			else
				cout << "No";
		}
	}
}
			

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)

#define xx first
#define yy second
#define mp make_pair
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define pdd pair<double,double>
#define ALL(v) (v).begin(), (v).end()

const ll MOD=1e9+7;
const ll inf=1e10;

#define MODSET(d) if ((d) >= MOD) d %= MOD;
#define MODNEGSET(d) if ((d) < 0) d = ((d % MOD) + MOD) % MOD;
#define put(x) cout<<#x<<" = "<<x<<endl;

ll power(ll a,ll n){
    ll ans=1;
    while(n){
        if(n&1)
            ans=(ans*a);
        n>>=1;
        a=(a*a);
    }
    return ans;
}


ll powerMod(ll a,ll n){
    ll ans=1;
    while(n){
        if(n&1)
            ans=(ans*a)%MOD;
        n/=2;
        a=(a*a)%MOD;
    }
    return ans;
}

ll powerMod1(ll a,ll n,ll mod){
    ll ans=1;
    while(n){
        if(n&1)
            ans=(ans*a)%mod;
        n>>=1;
        a=(a*a)%mod;
    }
    return ans;
}

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

ll sumdigit(ll n){
    ll sum=0;
    while(n){
        sum+=n%10;
        n=n/10;
    }
    return sum;
}

ll countSetBit(ll a){
    return __builtin_popcount(a);
}
ll countBit(ll a){
    ll sum=0;
    while(a){
        sum++;
        a>>=1;
    }
    return sum;
}

ll length(ll a){
    ll ans=0;
    while(a){
        ans++;
        a=a/10;
    }
    return ans;
}

bool isVowel(char c){
	if(c=='a' or c=='e' or c=='i' or c=='o' or c=='u')
		return true;
	return false;
}

const int sz=1e5+10;


int main()
{
    fast;
    
    ll t;
    //~ cin>>t;
    t=1;
    while(t--){
        ll n,k;
        cin>>n>>k;
        
		ll a[n];
		for(int i=0;i<n;i++)cin>>a[i];
		
		ll dp[n+1]={};
		
		dp[2]=abs(a[1]-a[0]);
		
		for(int i=2;i<n;i++){
			dp[i+1]=LONG_MAX;
			for(int j=1;j<=k;j++){
				if(i-j<0)
					continue;
				dp[i+1]=min(dp[i+1-j]+abs(a[i]-a[i-j]),dp[i+1]);
			}
			//~ cout<<dp[i+1]<<endl;
		}
		cout<<dp[n];
	}
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll maxn = 2e5 + 5;
const ll maxm = 1e3 + 5;
namespace IO{
    const int SIZE = (1 << 20) + 1;
    char ibuf[SIZE], *iS, *iT, obuf[SIZE],*oS = obuf, *oT = obuf + SIZE - 1;
    char _st[55];
    int _qr = 0;
    inline char gc(){
        return (iS == iT ? iT = (iS = ibuf) + fread(ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS++) : *iS++);
    }
    inline void qread(){}
    template<class T1, class ...T2>
    inline void qread(T1 &IEE, T2&... ls){
        register T1 __ = 0, ___ = 1;
        register char ch;
        while(!isdigit(ch = gc())) ___ = (ch == '-') ? -___ : ___;
        do{
            __ = (__ << 1) + (__ << 3) + (ch ^ 48);
        }while(isdigit(ch = gc()));
        __ *= ___;
        IEE = __;
        qread(ls...);
        return ;
    }
    inline void flush(){
        fwrite(obuf, 1, oS - obuf, stdout);
        oS = obuf;
        return ;
    }
    inline void putc_(char _x){
        *oS++ = _x;
        if(oS == oT) flush();
    }
    inline void qwrite(){}
    template<class T1, class ...T2>
    inline void qwrite(T1 IEE, T2... ls){
        if(!IEE) putc_('0');
        if(IEE < 0) putc_('-'), IEE = -IEE;
        while(IEE) _st[++_qr] = IEE % 10 + '0', IEE /= 10;
        while(_qr) putc_(_st[_qr--]);
        qwrite(ls...);
        return ;
    }
    struct Flusher_{~Flusher_(){flush();}}io_flusher;
}
using namespace IO;
ll n, a[maxn];
int main(){
    cin.tie(0);
    cin >> n;
    ll ma = 0;
    for(int i = 1;i <= n;i++){
        cin >> a[i];
    }
    ma = a[1];
    ll ans = 0;
    for(int i = 2;i <= n;i++){
        if(a[i] < ma){
            ans += ma - a[i];
        }
        ma = max(ma, a[i]);
    }
    cout << ans << endl;
    return 0;
}

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

ll log(ll x){
    ll cnt = 0;
    while(x >>= 1)
        ++cnt;
    return cnt + 1;
}

ll pow(ll x){
    ll cnt = 1;
    while(x--) {
        cnt <<= 1;
    }
    return cnt-1;
}

int main() {
    ll x;
    cin >> x;
    cout << pow(log(x)) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
typedef long long ll;

int main(){
    ll N, M;
    cin >> N >> M;

    if (N>=2 && M>=2) {
        cout << N*M - 2*N - 2*M + 4 << endl;
    }
    else if (N==1 && M==1)
        cout << 1 << endl;
    else if(N==1) {
        cout << M - 2 << endl;
    }
    else if(M==1) {
        cout << N - 2 << endl;
    }
    else // shouldn't reach here
    {
        cout << 0 << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization("unroll-loops")

#include "bits/stdc++.h"
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl '\n'
#define F first
#define S second
#define IO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define cf ll testcases;cin>>testcases;while(testcases--)
#define prn(x) if(x) cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define minel(x) (*min_element(all(x)))
#define maxel(x) (*max_element(all(x)))
#define cou dbg=1;cout
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<ld> vd;
typedef vector<pi> vp;
ll dbg=0;
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p);
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p);
template<typename A> istream& operator>>(istream& cin, vector<A> &v);
int dx[] = {-1, -1, -1,  0, 0,  1, 1, 1};
int dy[] = {-1,  0,  1, -1, 1, -1, 0, 1};

void solve(){
    ll n,k;
    cin>>n>>k;
    vi arr(n+1);
    for(ll i=1;i<=n;i++) cin>>arr[i];
    vi dp(n+1,0);
    for(ll i=2;i<=n;i++){
        dp[i]=dp[i-1]+abs(arr[i]-arr[i-1]);
        for(ll j=2;j<=k;j++){
            if(i-j<=0) break;
            dp[i]=min(dp[i],dp[i-j]+abs(arr[i]-arr[i-j]));
        }
    }
    cout<<dp[n]<<endl;
}

int main(){
    IO;
    // cf
    solve();
    return 0;
}


template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { 
    if(dbg){
        return cout << "(" << p.F << ", " << p.S << ")"; 
    }else{
        return cout<<p.F<<' '<<p.S;
    }
        dbg=0;}
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
    if(dbg){
        cout << "["; for(ll i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
    }else{
        for(ll i=0;i<v.size()-1;i++) cout<<v[i]<<' ';
        return cout<<v[v.size()-1];
    dbg=0;}
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
   cin >> p.first;
   return cin >> p.second;
}
template<typename A> istream& operator>>(istream& cin, vector<A> &v) {
   for(ll i=0;i<v.size()-1;i++) cin>>v[i];
   return cin >> v[v.size()-1];
}

Measured memory_bytes: 4668
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
cnt=0

for i in range(int(input())):
    if is_prime(int(input()))==1:cnt+=1

print(cnt)


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

using ll = long long;

const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;

int main(void){
  int a,b; cin >> a >> b;

  int ans;
  if(b>=a) ans = a;
  else ans = a-1;

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


Measured memory_bytes: 3536
package main
import (
  "fmt"
)

func min(a, b int) int {
  if a < b {
    return a
  }
  return b
}

func main() {
  var h, w int
  fmt.Scan(&h, &w)
  cs := make([][]int, 10)
  for i := 0; i < 10; i++ {
    arr := make([]int, 10)
    for j := 0; j < 10; j++ {
      fmt.Scan(&arr[j])
    }
    cs[i] = arr
  }
  as := make([][]int, h)
  for i := 0; i < h; i++ {
    arr := make([]int, w)
    for j := 0; j < w; j++ {
      fmt.Scan(&arr[j])
    }
    as[i] = arr
  }
  for k := 0; k < 10; k++ {
    for i := 0; i < 10; i++ {
      for j := 0; j < 10; j++ {
        cs[i][j] = min(cs[i][j], cs[i][k]+cs[k][j])
      }
    }
  }
  
  result := 0
  for i := 0; i < h; i++ {
    for j := 0; j < w; j++ {
      if as[i][j] != -1 {
        result += cs[as[i][j]][1]
      }
    }
  }

  fmt.Println(result)
}


Measured memory_bytes: 2944
#include<stdio.h>
int main()
{
	int h, w;
	scanf("%d %d", &h, &w);
	int i, j;
	char s[2003][2003];
	for (i = 0; i < h; i++)
		scanf("%s", s[i]);
	int h1[2003][2003], h2[2003][2003];
	int w1[2003][2003], w2[2003][2003];
	int hh[2003][2003], ww[2003][2003];
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			h1[i][j] = h2[i][j] = w1[i][j] = w2[i][j] = 0;
	for (i = 0; i < h; i++)
	{
		if (s[i][0] == '#')
			w1[i][0] = 0;
		else
			w1[i][0] = 1;
		for (j = 1; j < w; j++)
		{
			if (s[i][j] == '#')
				w1[i][j] = 0;
			else
				w1[i][j] = w1[i][j - 1] + 1;
		}
	}
	for (i = 0; i < h; i++)
	{
		if (s[i][w - 1] == '#')
			w2[i][w - 1] = 0;
		else
			w2[i][w - 1] = 1;
		for (j = w - 2; j >= 0; j--)
		{
			if (s[i][j] == '#')
				w2[i][j] = 0;
			else
				w2[i][j] = w2[i][j + 1] + 1;
		}
	}
	for (j = 0; j < w; j++)
	{
		if (s[0][j] == '#')
			h1[0][j] = 0;
		else
			h1[0][j] = 1;
		for (i = 1; i < h; i++)
		{
			if (s[i][j] == '#')
				h1[i][j] = 0;
			else
				h1[i][j] = h1[i - 1][j] + 1;
		}
	}
	for (j = 0; j < w; j++)
	{
		if (s[h - 1][j] == '#')
			h2[h - 1][j] = 0;
		else
			h2[h - 1][j] = 1;
		for (i = h - 2; i >= 0; i--)
		{
			if (s[i][j] == '#')
				h2[i][j] = 0;
			else
				h2[i][j] = h2[i + 1][j] + 1;
		}
	}
	for (i = 0; i < h; i++)
	{
		for (j = 0; j < w; j++)
		{
			if (s[i][j] == '#')
				hh[i][j] = ww[i][j] = 0;
			else
			{
				if (i < h - 1)
					hh[i][j] = h1[i][j] + h2[i + 1][j];
				else
					hh[i][j] = h1[i][j];
				if (j < w - 1)
					ww[i][j] = w1[i][j] + w2[i][j + 1];
				else
					ww[i][j] = w1[i][j];
			}
		}
	}
	int ans = 0;
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			if (s[i][j] == '.')
				if (ans < hh[i][j] + ww[i][j])
					ans = hh[i][j] + ww[i][j];
	printf("%d\n", ans - 1);
	return 0;
}

Measured memory_bytes: 98048
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;

const int N=100005;
const ll inf=1000000000000000ll;

int n;
ll l,r,mid,al,ar;
int a[N];

ll check(ll w){
	int i;
	for (i=1;i<=n;i++) w=w/a[i]*(ll)a[i];
	return w;
}

int main(){
	int i;
	scanf("%d",&n);
	for (i=1;i<=n;i++) scanf("%d",&a[i]);
	l=2; r=inf;
	while (l<r){
		mid=l+(r-l)/2;
		if (check(mid)>=2) r=mid;
		else l=mid+1;
	}
	al=r;
	if (check(al)>2){
		printf("-1\n");
		return 0;
	}
	l=al; r=inf;
	while (l<r){
		mid=(l+r+1)>>1;
		if (check(mid)==2) l=mid;
		else r=mid-1; 
	}
	ar=l;
	if (check(ar)>2){
		printf("-1\n");
		return 0;
	}
	printf("%lld %lld\n",al,ar);
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<ll> > Graph;
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 ll INF = 1e18;

int n;
vector<int>a(n);

double dp[310][310][310];
double rec(int i,int j,int k){
    if(dp[i][j][k]>=0)return dp[i][j][k];//DPテーブルの値が既に決まっていたらそれを返す
    if(i==0&&j==0&&k==0)return 0.0;
    double res = 0.0;
    if(i>0) res += rec(i-1,j,k) * i;
    if(j>0) res += rec(i+1,j-1,k) * j;
    if(k>0) res += rec(i,j+1,k-1) * k;
    res += n;
    res *= 1.0/(i+j+k);
    dp[i][j][k] = res;
    return res;
}


int main(){
    cin >> n;
    a.resize(n);
    rep(i,n)cin>>a[i];
    int one = 0,two = 0,three = 0;
    rep(i,n){
        if(a[i]==1)one++;
        if(a[i]==2)two++;
        if(a[i]==3)three++;
    }
    rep(i,310)rep(j,310)rep(k,310)dp[i][j][k]=-1;
    double ans = rec(one,two,three);
    cout << printf("%.16lf",ans) << endl;

    return 0;
}


Measured memory_bytes: 233088
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define ll long long 
#define FI first 
#define SE second
#define pb push_back 
#define eb emplace_back
#define mod 1000000007
#define all(c) (c).begin(),(c).end()
#define LB  lower_bound
#define UB  upper_bound
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define mems(s, n) memset(s, n, sizeof(s))
#define NINF INT_MIN 
#define INF INT_MAX 
#define int ll int
#define OOK order_of_key  //no of elements less than
#define FBO find_by_order //iterator pointing kth element;indexing starts from 0
#define CK3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define CK4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl

typedef pair<int,int> PII;
typedef pair<pair<int,int>,int> PPII;
typedef map<char,int>MII;
typedef vector<int> VI;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

/*int power(int a, int b)
{int x=1,y=a;while(b>0){if(b%2){x =(x*y)%mod;}y =(y*y)%mod;b/=2;}return x%mod;}
*/
//int modInverse(int a, int m) {return power(a, m-2);} //gcd(a,m)=1 
//int root(int x){return x==f[x]?x:f[x]=root(f[x]);}


signed main()
{
ios::sync_with_stdio(false); cin.tie(0);
int T=1,T1=0;//cin>>T;
while(T1++<T)
{
   string s;int ans=0;
   cin>>s;MII mr;
   for(int i=0;i<s.size();i++){mr[s[i]]++;if(mr[s[i]]>1)ans=1;}
   if(mr['A']>0&&mr['B']>0)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}


return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define rng(a) a.begin(), a.end()
#define ina(n,a) cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]
#define sz(x) (int)(x).size()
#define se second
#define fi first
#define prev            coyhhhhhhyoc    
#define next          sdNNNmNNNNNNNmds  
#define y0           hNNNNy_yNNNNNN_sNh
#define y1          mNNNNNdtdNNNNNNtsNNm
#define yn          mNNNNNNNNy___smNNNms
#define tm            oooooosyysooooot 
#define read               tyhyt        
#define rank              ytmNmo         
#define index              yyy
#define pb push_back
#define pcnt __builtin_popcountll
#define rrep(i,a,b) for(int i = (b); i >= (a); i--)
#define rall(x,a) for(auto x : a)
#define MOD 1000000007
#define endl "\n"
typedef long long ll;
using namespace std;

const int N = 222222;
int a[N];
int n;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int mini = 1e9, ans = 0;
    cin >> n;
    rep(i, 1, n) {
        cin >> a[i];
        if(a[i] < mini) {
            ans++;
        }
        mini = min(mini, a[i]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <unordered_map>
#include <unordered_set>

int main() {
    int A, B, C;
    std::cin >> A >> B >> C;

    std::cout << std::min(B / A, C) << std::endl;

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            new Program().Solve(new MyInputStream(Console.In, ' '));
            Console.Out.Flush();
        }

        public void Solve(MyInputStream cin)
        {
            var s = string.Join("", cin.Read().ToCharArray().OrderBy(c => c));
            var t = string.Join("", cin.Read().ToCharArray().OrderByDescending(c => c));
            Error.WriteLine(s);
            Error.WriteLine(t);
            if (s.CompareTo(t) < 0) WriteLine("Yes");
            else WriteLine("No");
        }  
    }

    public class MyInputStream
    {
        private readonly System.IO.TextReader _stream;
        private char separator = ' ';
        private Queue<string> inputStream;
        public MyInputStream(System.IO.TextReader s, char separator = ' ')
        {
            this.separator = separator;
            this._stream = s;
            inputStream = new Queue<string>();
        }
        public string Read()
        {
            if (inputStream.Count != 0) return inputStream.Dequeue();
            string[] tmp = _stream.ReadLine().Split(separator);
            for (int i = 0; i < tmp.Length; ++i)
                inputStream.Enqueue(tmp[i]);
            return inputStream.Dequeue();
        }
        public string ReadLine() { return _stream.ReadLine(); }
        public int ReadInt() { return int.Parse(Read()); }
        public long ReadLong() { return long.Parse(Read()); }
        public double ReadDouble() { return double.Parse(Read()); }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read(); return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt(); return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong(); return ret;}
    }
}

Measured memory_bytes: 13664
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

bool getisvalid(int w, int k)
{
	for(int i = 0; i < w - 2; i++){
		if((k & (1 << i)) > 0 && (k & (1 << (i + 1))) > 0) return false;
	}
	return true;
}

int getnext(int w, int now, int k)
{
	if(now < w && (k & (1 << now)) > 0) return now + 1;
	else if(now > 0 && (k & (1 << (now - 1))) > 0) return now - 1;
	else return now;
}

int main()
{
	int h, w, k;
	cin >> h >> w >> k;
	k--;
	int result[101][8] = {};
	bool isvalid[(1 << 8)];
	for(int i = 0; i < (1 << (w - 1)); i++){
		isvalid[i] = getisvalid(w, i);
	}
	result[0][0] = 1;
	for(int i = 1; i <= h; i++){
		for(int j = 0; j < w; j++){
			for(int l = 0; l < (1 << (w - 1)); l++){
				if(isvalid[l]){
					int next = getnext(w, j, l);
					result[i][next] += result[i - 1][j];
					result[i][next] %= mod;
				}
			}
		}
	}
	cout << result[h][k] << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();

		// 文字列の入力
		String[] s = sc.next().split("");
        String ans = "Yes";
        for(int i = 0; i < s.length; i++) {
          if (i == a) {
            if (!s[a].equals("-")) {
              ans = "No";
              break;
            }
          } else {
            if (s[i].equals("-")) {
              ans = "No";
              break;
            }
          }
        }
      
		// 出力
		System.out.println(ans);
	}
}

Measured memory_bytes: 22868
#define _CRT_SECURE_NO_WARNINGS

#include <map>
#include <set>
#include <queue>
#include <ctime>
#include <cmath>
#include <bitset>
#include <random>
#include <vector>
#include <string>
#include <iomanip>
#include <iostream>
#include <algorithm>

using namespace std;

#define X first
#define Y second

const int MAXN = 200100, M = 1000000009;

long long a, b, c, x, y, ans = 0;

int main()
{
#if _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("advent.in", "r", stdin);
	//freopen("advent.out", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin >> a >> b >> c >> x >> y;
	if (x < y)
	{
		swap(x, y);
		swap(a, b);
	}

	if (2 * c <= a + b)
	{
		ans += y * 2 * c;
		x -= y;
	}
	else
	{
		ans += y * (a + b);
		x -= y;
	}

	if (2 * c <= a)
	{
		ans += 2 * c * x;
	}
	else
	{
		ans += a * x;
	}

	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
using namespace std;
#define ll long long
ll n=100;
ll m;
ll sum=0;
int main(){
	scanf("%lld",&m);
	while(1){
		if(n>=m)
			break;
		sum++;
		n*=1.01;
	}
	printf("%lld",sum);
	return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
	int N;
	cin >> N;
	typedef pair<long long, long long> P;
	vector<P> AB( N );
	for( int i = 0; i < N; i++ ) {
		long long A, B;
		cin >> A >> B;
		AB[i] = P( A, B);
	}

	sort( AB.begin(), AB.end() );
	long long ans = AB[0].first;
	ans += AB[N - 1].first - AB[0].first + AB[N - 1].second;

	cout << ans << endl;
}


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

using namespace std;

typedef long long lli;
typedef double lld;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<double> vdl;
typedef vector<vector<lli>> mat;
typedef vector<vdl> mad;
typedef unordered_map<lli,unordered_map<lli,lli>> graph;
typedef complex<double> cmp;
typedef vector<cmp> vcl;

const lli e5 = 1 << 20;
lli n;
lli a[e5];
lli ans[e5];
lli ai[e5];
lli aj[e5];
lli k;

int main(){
	cin >> n;
	k = pow(2,n);
	for(lli i = 0;i < k;i++) cin >> a[i];
	iota(ai,ai+k,0ll);
	for(lli i = 0;i <= n;i++){
		for(lli b = 1;b < (1<<n);b++){
			if((b&(1<<i)) == 0) continue;
			lli  v[] = {ai[b],aj[b],ai[b^(1<<i)],aj[b^(1<<i)]};
			lli mem = 0;
			lli idx1 = 0,idx2 = 0;
			for(lli i = 0;i < 4;i++){
				if(a[v[i]] > mem){
					idx1 = v[i];
					mem = a[v[i]];
				}
			}
			mem = 0;
			for(lli i = 0;i < 4;i++){
				if(v[i] == idx1) continue;
				if(a[v[i]] > mem){
					idx2 = v[i];
					mem = a[v[i]];
				}
			}

			ai[b] = idx1;
			aj[b] = idx2;

		}
	}
	for(lli i = 0;i < k;i++){
		ans[i] = a[ai[i]]+a[aj[i]];
	}
	// for(lli i = 0;i < k;i++){
	// 	for(lli j = i+1;j < k;j++){
	// 		ans[i|j] = max(ans[i|j], a[i]+a[j]);
	// 	}
	// }
	lli max_ans = 0;
	for(lli i = 1;i < k;i++){
		max_ans = max(max_ans, ans[i]);
		cout << max_ans << endl;
	}


}


Measured memory_bytes: 19456