akhauriyash/Code-Regression huggingface dataset:
import sys
while True:
    (H, W) = [int(i) for i in sys.stdin.readline().split()]
    if H == W == 0:
        break
    line = "#." * int(W / 2 + 1)
    for i in range(H):
        if i % 2:
            print(line[1:W+1])
        else:
            print(line[:W])
    print("")

Measured memory_bytes: 6736
#ifdef _DEBUG
#include "../../library/library/debug_template.cpp"
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else
#define DMP(...) ((void)0)
#endif

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

struct init {
	init() {
		cin.tie(nullptr); ios::sync_with_stdio(false);
		cout << fixed << setprecision(10);
	}
} init_;

template<int Modulo = MOD>
struct Mint {

	lint val;
	constexpr Mint(lint v = 0) noexcept : val(v% Modulo) { if (val < 0) val += Modulo; }

	constexpr Mint& operator+=(const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator-=(const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator*=(const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator/=(const Mint& r) noexcept {
		lint a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			lint t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}

	constexpr Mint operator+(const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator-(const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator*(const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator/(const Mint& r) const noexcept { return Mint(*this) /= r; }

	constexpr Mint operator-() const noexcept { return val ? Modulo - val : 0; }

	constexpr bool operator==(const Mint& r) const noexcept { return val == r.val; }
	constexpr bool operator!=(const Mint& r) const noexcept { return !((*this) == r); }
	constexpr bool operator< (const Mint& r) const noexcept { return val < r.val; }

	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept { return os << x.val; }
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		lint tmp; is >> tmp;
		x = Mint(tmp);
		return is;
	}

	constexpr Mint pow(lint n) const noexcept {
		Mint res = 1, tmp = val;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;


int main() {

	int N;
	cin >> N;

	mint all = 1, one = 1, zero = 1;
	for (int i = 0; i < N; i++) {
		all *= 10;
		one *= 9;
		zero *= 8;
	}

	cout << all - one * 2 + zero << "\n";

	return 0;
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    int n;
    cin>>n;
    vector<int> p(n);
    rep(i,n) cin>>p[i];
    int m=0,sum=0;
    rep(i,n){
        m=max(m,p[i]);
        sum+=p[i];
    }
    cout<<sum-m/2<<endl;
}

Measured memory_bytes: 256
N, M = gets.split.map(&:to_i)
Xs = gets.split.map(&:to_i)

Xs.sort!
sum = 0
diff = []

(Xs.length - 1).times do |i|
  diff.push( [Xs[i + 1] - Xs[i], i] ) 
end

diff.sort!{ |b, a| a[0] <=> b[0] }

diff = diff.slice(0, N-1)

diff.sort!{ |b, a| b[1] <=> a[1] }

head = Xs[0]

diff.length.times do |i|
  
  b_i = (diff[i][1])
  
  sum += Xs[b_i] - head

  head = Xs[b_i+1]
  
end

sum += Xs.last - head

puts sum


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

#define int             long long
#define FOR( i, m, n )  for( int (i) = (m); (i) < (n); (i)++ )
#define REP( i, n )     FOR( i, 0, n )
#define REPR( i, m )    for( int (i) = (m); (i) >= 0; (i)-- )
#define REPONE( i, n )  FOR( i, 1, n + 1 )
#define ALL( a )        (a).begin(), (a).end()
#define MP              make_pair

using namespace std;
using P = pair<int, int>;

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

const int INF = 1e18;
const int MOD = 1e9 + 7;

int cnt[100001];

signed main(){
    string s; cin >> s;

    int rnum = 0, lnum = 0;
    REP( i, s.size() ){
        if( lnum > 0 && s[i] == 'R' || i == s.size() - 1 ){
            if( s[i] == 'L' ){
                lnum++;
                i++;
            }
            cnt[i - lnum - 1] += ( rnum + 1 ) / 2 + lnum / 2;
            cnt[i - lnum] += rnum / 2 + ( lnum + 1 ) / 2;
            rnum = 1;
            lnum = 0;
        }else if( s[i] == 'R' ){
            rnum++;
        }else{
            lnum++;
        }
    }

    REP( i, s.size() ){
        cout << cnt[i];
        if( i != s.size() - 1 ) cout << " ";
        else cout << endl;
    }
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
using ll = long long;
using V = vector<int>;
using VV = vector<vector<int>>;
using P = pair<int, int>;

int main()
{
    int n;
    cin >> n;
    V a;
    a.push_back(0);
    rep(i, n)
    {
        int x;
        cin >> x;
        a.push_back(x);
    }
    a.push_back(0);

    int sum = 0;
    rep(i, sz(a) - 1) sum += abs(a[i] - a[i + 1]);

    for (int i = 1; i <= n; i++)
    {
        int dist1 = abs(a[i - 1] - a[i + 1]);
        int dist2 = abs(a[i - 1] - a[i]) + abs(a[i] - a[i + 1]);
        // printf("dist1 = %d, dist2 = %d\n", dist1, dist2);
        int ans = sum + dist1 - dist2;
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3920
import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val s = scanner.next()
    val head = s.substring(0..1).toInt()
    val tail = s.substring(2..3).toInt()
    if (canY(head) && canM(tail)) {
        if (canM(head) && canY(tail)) {
            print("AMBIGUOUS")
        } else {
            print("YYMM")
        }
    } else {
        if (canM(head) && canY(tail)) {
            print("MMYY")
        } else {
            print("NA")
        }
    }
}

fun canY(i: Int): Boolean {
    return i in 0..99
}

fun canM(i: Int): Boolean {
    return i in 1..12
}

Measured memory_bytes: 31392
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        a: [i64; n]
    }
    let (ans, _) = a.iter().fold((0 as i64, 0 as i64), |(acc, m), &x| {
        (if x < m { acc + m - x } else { acc }, std::cmp::max(m, x))
    });
    println!("{}", ans);
}


Measured memory_bytes: 5700
inputs = STDIN.readlines.map{|line|line.strip.split()}
line = inputs.shift

a = line[0].to_i
b = line[1].to_i
k = line[2].to_i

100.times do |t|
    n = 100 - t
    if a % n == 0 && b % n == 0 then
        k -= 1
        if k == 0 then
            puts(n)
            break
        end
    end
end


Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=pow(2,31)-1;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	vi in(a,inf);
	#define B 200
	vi t(a/B+1,inf);
	while(in.size()%B)in.pb(inf);
	while(b--){
		int c,d,e;
		cin>>c>>d>>e;
		if(c==0){
			in[d]=e;
			int q=d/B;
			t[q]=inf;
			rep(i,B)t[q]=min(t[q],in[q*B+i]);
		}else{
			int mi=inf;
			e++;
			while(d<e){
				if(d%B==0&&d+B<=e){
					d+=B-1;
					mi=min(mi,t[d/B]);
				}else mi=min(mi,in[d]);
				d++;
			}
			cout<<mi<<endl;
		}
	}


}

Measured memory_bytes: 1796
A, B = map(int, input().split())
S = input()

if len(S) != A+B+1:
    print("No")
    exit()

for i,s in enumerate(S):
    if i == A:
        if s != "-":
            print("No")
            exit()
    else:
        if not "0" <= s <= "9":
            print("No")
            exit()

print("Yes")

Measured memory_bytes: 3060
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  long double a, b;
  cin >> a >> b;
  long double c = 0;
  b = modfl(b, &c);
  b *= 100;

  ll ans = a * b / 100 + a * c;
  cout << ans << endl;
  return 0;
}

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

#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll unsigned long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

using namespace std;

ll maxn = 1e18;

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	//#ifndef ONLINE_JUDGE
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	//#endif
	int n;
	cin>>n;
	vll v(n);
	for(int i=0;i<n;++i){
		cin>>v[i];
	}
	sort(all(v));
	ll ans=1;
	for(int i=0;i<n;++i){
		if(ans*v[i]>maxn || (v[i]!=0 && ans*v[i] < ans)){
			cout<<-1<<endl;
			return 0;
		}
		ans*=v[i];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3992
def main():
    N = int(input())
    d = []
    for i in range(N):
        d.append(int(input()))

    d.sort(reverse = True)
    counter = 0
    dii = 101
    for di in d:
        if di < dii:
            counter += 1
        dii = di

    print(counter)

main()

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; ++i)
#define all(a) (a).begin(), (a).end()

int N, M;
vector<vector<int>> G;
vector<vector<ll>> lpMemo, rpMemo;
vector<map<int, int>> id;

int subtreeCount(int, int);

// [0, pi]
ll leftProduct(int u, int pi) {
  if (pi == -1) return 1;
  if (lpMemo[u][pi] != -1) return lpMemo[u][pi];

  return lpMemo[u][pi] =
             (subtreeCount(G[u][pi], u) + 1) * leftProduct(u, pi - 1) % M;
}

// [pi, G[u].siize())
ll rightProduct(int u, int pi) {
  if (pi == G[u].size()) return 1;
  if (rpMemo[u][pi] != -1) return rpMemo[u][pi];

  return rpMemo[u][pi] =
             (subtreeCount(G[u][pi], u) + 1) * rightProduct(u, pi + 1) % M;
}

int subtreeCount(int u, int p) {
  if (p == -1) return leftProduct(u, G[u].size() - 1);

  return leftProduct(u, id[u][p] - 1) * rightProduct(u, id[u][p] + 1) % M;
}

int main() {
  cin >> N >> M;
  G.resize(N);
  id.resize(N);
  lpMemo.resize(N), rpMemo.resize(N);

  auto addEdge = [&](int u, int v) {
    id[u][v] = G[u].size();
    lpMemo[u].push_back(-1);
    rpMemo[u].push_back(-1);
    G[u].push_back(v);
  };

  rep(i, N - 1) {
    int x, y;
    cin >> x >> y;
    x--, y--;

    addEdge(x, y);
    addEdge(y, x);
  }

  rep(i, N) cout << subtreeCount(i, -1) << endl;

  return 0;
}


Measured memory_bytes: 40704
from math import *
PI = 3.1415926535898
def dfs(i, su, cnt, s):
	if su == s and cnt == 0:
		return 1
	if i == 10 or cnt == 0:
		return 0
	return dfs(i+1, su, cnt, s) + dfs(i+1, su+i, cnt-1, s)
while True:
	try:
		n, s = map(int, raw_input().strip().split())
		if n == 0 and s == 0:
			break
		print dfs(0, 0, n, s)
	except EOFError:
		break

Measured memory_bytes: 6432
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include<math.h>
using namespace std;

int main()
{
    int N, K, num_attack = 0;
    long long attack = 0;
    cin >> N >> K;
    vector<long long> H(N);
    for(int i = 0; i < N; i++)
    {
        cin >> H.at(i);
    }
    sort(H.begin(), H.end());
    num_attack = N - K;
    for(int i = 0; i < num_attack; i++)
    {
        attack += H.at(i);
    }
    cout << attack << endl;
    return 0;
}


Measured memory_bytes: 1920
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") # 無限

n = int(input())
s = input()
count = 0
max_num = 0
for _ in s:
    if _=="I":
        count+=1
    else:
        count-=1
    if max_num<count:
        max_num=count
print(max_num)

Measured memory_bytes: 3064
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

# from math import comb
def comb(n,r):
    if r==2:
        return n*(n-1)//2
    else:
        return n*(n-1)*(n-2)//6
n=n0()
s=s0()
r=s.count("R")
g=s.count("G")
b=s.count("B")
ans=0
for i in range(1,(n-1)//2+1):
    for j in range(0,n-2*i):
        ans+=1
        if s[j]==s[j+i]==s[j+2*i]:
            ans-=1
        elif s[j]==s[j+i] or s[j]==s[j+2*i] or s[j+i]==s[j+2*i]:
            ans-=1
            
ans+=comb(r,3)+comb(g,3)+comb(b,3)+comb(r,2)*(g+b)+comb(g,2)*(r+b)+comb(b,2)*(r+g)
print(comb(n,3)-ans)

Measured memory_bytes: 68024
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;

int main(){
    int n, a;
    cin >> n >> a;
    if(n % 500 <= a){
        cout << "Yes" << endl; 
    } else {
        cout << "No" << endl; 
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ms(x,y) memset(x, y, sizeof(x))
#define lowbit(x) ((x)&(-x))
#define sqr(x) ((x)*(x))
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;


void run_case() {
    LL n, k, q;
    cin >> n >> k >> q;
    vector<LL> a(n+1);
    for(int i = 0; i < q; ++i) {
        int x; cin >> x;
        a[x]++;
    }
    for(int i = 1; i <= n; ++i) cout << (k-q+a[i] > 0?"Yes":"No") << "\n";
    
}


int main() {
    //freopen("input", "r", stdin);
    ios::sync_with_stdio(false), cin.tie(0);
    cout.flags(ios::fixed);cout.precision(9);
    //int t; cin >> t;
    //while(t--)
    run_case();
    cout.flush();
    return 0;
}


Measured memory_bytes: 3960
from itertools import permutations
n,m,r = map(int,input().split())
route = list(map(int,input().split()))

dp = [[0 for _ in range(n)] for _ in range(n)]
INF = 10**18
for i in range(n):
    for j in range(n):
        if i!=j:
            dp[i][j] = INF
for _ in range(m):
    a,b,c = map(int,input().split())
    dp[a-1][b-1] = c
    dp[b-1][a-1] = c
#print(dp)

#最短リスト
for chu in range(n):
    for fir in range(n):
        for la in range(n):
            dp[fir][la] = min(dp[fir][la] , dp[fir][chu] +  dp[chu][la])

ans = 10**10
for j in permutations(route, r):
    a = 0
    for q,w in zip(j[:-1], j[1:]):
        a += dp[q-1][w-1]
        
    ans = min(ans,a)
print(ans)

Measured memory_bytes: 75028
n, m, l = gets.chomp.split.map(&:to_i)
A = []
n.times do
    A << gets.chomp.split.map(&:to_i).to_a
end
B = []
m.times do
    B << gets.chomp.split.map(&:to_i).to_a
end

n.times do |i|
    line = []
    l.times do |j|
        cij = 0
        m.times do |k|
            cij += A[i][k]*B[k][j]
        end
        line << cij
    end
    puts line.join(" ")
end


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

int hap[100001][3];

void _initialise(int n){
	for(int i=0;i<n;i++){
		hap[i][0] = hap[i][1] = hap[i][2] = -1;
	}
}


int cal_hap(int a[][3],int n)
{
	hap[0][0] = a[0][0], hap[0][1] = a[0][1], hap[0][2] = a[0][2];
	for(int i=0;i<n;i++){
		for(int j=0;j<3;j++){
			int temp = -1;
			for (int k = 0; k < 3; k++) {
				if (k == j) continue;
				temp = max(temp, hap[i-1][k]);
			}
			hap[i][j] = temp + a[i][j];
		}
	}
 	// cout<<hap[n];
	return max(hap[n-1][0],max(hap[n-1][1],hap[n-1][2]));
}


int main(int argc, char const *argv[])
{
	int i,j,k,n;
	cin>>n;
	int a[n][3];
	for(i=0;i<n;i++)
		for(j=0;j<3;j++)
			cin>>a[i][j];
	_initialise(n);
	cout<<cal_hap(a,n);
	return 0;
}

Measured memory_bytes: 2560
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>


#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
#define all(x) (x).begin(), (x).end()
//#define double long double

using namespace std;

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

const int MOD = 1e9 + 7;
const ll INF = 1e17;
const int INT_INF = 1e9;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;
const int MAX = 200020;

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

	int N; cin >> N;
	vector<P>v(N);
	REP(i, N) {
		int A; cin >> A;
		v[i] = { A,i };
	}
	VSORT(v);
	REP(i, N) {
		pe(v[i].second + 1);
	}
	cout << endl;
}


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

const int MAXN = 20010;

template<typename T> inline T read() {
	T x(0), f(1);
	char ch = getchar();
	for(; !isdigit(ch); ch = getchar()) if(ch=='-') f=-1;
	for(; isdigit(ch); ch = getchar()) x = (x*10)+(ch^48);
	return x * f;
}

int n, p[MAXN];
int a[MAXN], b[MAXN];

int main() {
	n = read<int>();
	for(int i = 1; i <= n; i++) p[i] = read<int>();
	a[1] = n*n;
	for(int i = 2; i <= n; i++) a[i] = a[i-1]+n;
	b[1] = n*n;
	for(int i = 2; i <= n; i++) b[i] = b[i-1]-n;
	for(int i = 1; i <= n; i++) 
		a[p[i]] += i-1;
	for(int i = 1; i <= n; i++) printf("%d ", a[i]);
	printf("\n");
	for(int i = 1; i <= n; i++) printf("%d ", b[i]);
	printf("\n");
	return 0;
}


Measured memory_bytes: 896
import numpy as np
N = int(input())
A = np.array(input().split(), dtype=np.int64)

neg = np.count_nonzero(A[A < 0])
if neg % 2 == 0 or 0 in A:
    ans = np.abs(A).sum()
else:
    tmp = np.abs(A).min()
    ans = np.abs(A).sum() - 2 * tmp

print(ans)

Measured memory_bytes: 24824
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    cout << min(c, b/a) << endl;
    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

var N, cnt int

func main() {
	fmt.Scan(&N)
	T := make([]uint64, N)

	for i := 0; i < N; i++ {
		fmt.Scan(&T[i])
	}
	var ans uint64 = uint64(T[0])

	// x,yの最小公倍数はx*y/gcd(x,y)
	// 具体例
	//   15 = 3*5
	//   24 = 2*2*2*3

	// uint64でも収まらないので，割り算を先に実施
	for _, value := range T {
		ans = (ans / gcd(ans, value)) * value
	}
	fmt.Println(ans)
}

func gcd(x, y uint64) uint64 {
	if x%y == 0 {
		return y
	} else {
		r := x % y
		return gcd(y, r)
	}
}

/*  ----------------------------------------  */

func combination(x, y int) int {
	return permutation(x, y) / permutation(y, y)
}

func permutation(x, y int) int {
	var ans int = 1
	for i := x - y; 0 < i; i-- {
		ans *= i
	}
	return ans
}

func max(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Max(float64(x[i]), float64(res)))
	}
	return res
}

func min(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Min(float64(x[i]), float64(res)))
	}
	return res
}

func pow(x, y int) uint64 { return uint64(math.Pow(float64(x), float64(y))) }
func abs(x int) int       { return int(math.Abs(float64(x))) }
func floor(x int) int     { return int(math.Floor(float64(x))) }

type XY struct {
	x int
	y int
}

type SortBy [][]int

func (a SortBy) Len() int      { return len(a) }
func (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a SortBy) Less(i, j int) bool {
	if a[i][0] == a[j][0] {
		return a[i][1] > a[j][1]
	}
	return a[i][0] > a[j][0]
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstring>

using namespace std;

bool is_parindrome(int tested){
  int tot = 0;
  for (int i=0;i<=26;i++) {
    if (((tested >> i) & 1) == 1)
      tot++;
  }
  if (tot > 1)
    return(false);
  else
    return(true);
}

int n, bit[200001] = {};
int split[(1<<26)] = {};

int main(){
  string s;
  cin >> s;
  n = s.length();
  for (int i=0;i<(1<<26);i++) {
    split[i] = 200001;
  }
  bit[0] = 1 << (s[0] - 97);
  split[bit[0]] = 1;
  for (int i=1;i<n;i++) {
    int ascii = s[i] - 97;
    int split_tmp = n;
    int split_idx;
    bit[i] = 1 << ascii;
    bit[i] = bit[i] ^ bit[i-1];
    if (is_parindrome(bit[i])) {
      split_tmp = 0;
    } else {
      for (int k=0;k<26;k++) {
	if (split_tmp > split[((1 << k) ^ bit[i])]) {
	    split_tmp = split[((1 << k) ^ bit[i])];
	}
      }
    }
    split[bit[i]] = split_tmp + 1;
    
  }
  cout << split[bit[n-1]] << endl;
  return 0;
}


Measured memory_bytes: 263556
#include <iostream>
 
int main() {
    int a, b;
    char op;
 
    do{
        std::cin >> a >> op >> b;
        if (op == '+') {
            std::cout << a + b << std::endl;
        }
        else if (op == '-') {
            std::cout << a - b << std::endl;
        }
        else if (op == '*') {
            std::cout << a * b << std::endl;
        }
        else if (op == '/') {
            std::cout << a / b << std::endl;
        }
    } while (op != '?');
}


Measured memory_bytes: 3096
#include<stdio.h>

int main()
{
    int a,b,c,d,e;
    scanf("%d\n%d\n%d\n%d",&a,&b,&c,&d);
    if(a<=b)
        printf("%d\n",a*c);
    if(a>b)
    {
        e=a-b;
        printf("%d\n",b*c+e*d);
    }

    return 0;
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline

n,m = map(int,input().split())
cost = []
for i in range(n):
    a,b = map(int,input().split())
    cost.append([a,b])
cost.sort()
res = 0
cnt = 0
for i in range(n):
    if cost[i][1] >= m-cnt:
        res += cost[i][0]*(m-cnt)
        break
    else:
        res += cost[i][0]*cost[i][1]
        cnt += cost[i][1]
print(res)

Measured memory_bytes: 20100
#include <iostream>
#include <algorithm>
#include <iterator>
#include <vector>
#include <string>

using namespace std;

int main() {
  string S, T, U;
  int A, B;
  cin >> S >> T >> A >> B >> U;
  if (S == U) {
    --A;
  } else {
    --B;
  }
  cout << A << ' ' << B << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<climits>

#define max_n (1<<18)

using namespace std;

int dat[max_n],n;

int get(int k){return dat[k+n];}

void update(int k,int a){
  for(k+=n,dat[k]=a;k>1;k>>=1)
    dat[k>>1]=min(dat[k],dat[k^1]);
}

int rmq(int a,int b){
  int res=INT_MAX;
  for(a+=n,b+=n-1;a<=b;a=(a+1)>>1,b=(b-1)>>1){
    if(a&1)res=min(res,dat[a]);
    if((b&1)==0)res=min(res,dat[b]);
  }
    return res;
}

int main(void){
 
  fill(dat,dat+max_n,INT_MAX);
  int q;
  scanf("%d %d",&n,&q);
 
  while(q--){
    int com,x,y;
    scanf("%d %d %d",&com,&x,&y);
    if(com)printf("%d\n",rmq(x,y+1));
    else update(x,y);
  }
  return 0;
}

Measured memory_bytes: 2052
MOD=10**9+7
cnt=0; sum=0; prev=nil; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end

def puts_yesno(can) puts(can ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n = gi
s = gs

i = 0
j = 0
max = 0
while j<n do
  sub = s[i..j]
  other = s[(j+1)..-1]
  if other[sub]
    cnt = sub.length
    max = cnt if cnt>max
    j += 1
  else
    i += 1
    j += 1
  end
end

puts max


Measured memory_bytes: 4732
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
#define tl 1'000'000'007
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REREP(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
#define REFOR(i, n, a) for (ll i = n; i >= a; i--)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false); 
    ll k,t;
    cin >> k >> t;
    priority_queue<int> que;
    REP(i,t){
        ll x;
        cin >> x;
        que.push(x); 
    }
    ll day= 0;
    ll cnt= 0;
    ll p= que.top()-1;
    que.pop();
    REP(i,k){
        if(que.empty()) {cnt= p; break;}
        ll q= que.top()-1;
        que.pop();
        if(p) que.push(p);
        p=q;
        if(que.empty()) {cnt= p; break;}
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
using std::vector;
const int maxn = 205;
const int maxm = 1e7+5;
int n, m;
int a[maxn], b[maxm], x[maxm], vis1[maxn], vis2[maxn];
int is_prime[maxm], prime[maxm], cnt;
vector<int> to[maxn];
int X[maxn], Y[maxn], cnt1, cnt2;
void pre() {
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) {
	scanf("%d", &a[i]);
	m = std::max(m, a[i]);
	x[a[i]] = 1;
    }
    m++;
    for(int i = 1; i <= m; i++) {
	b[i] = x[i] ^ x[i-1];
	if(b[i] == 1) {
	    if(i & 1) X[++cnt1] = i;
	    else Y[++cnt2] = i;
	}
    }
} 
void add_edge(int u, int v) {
    to[u].push_back(v);
}
void add(int u, int v) {
    add_edge(u, v);
    add_edge(v, u);
}
void build_graph() {
    for(int i = 1; i <= cnt1; i++) 
       for(int j = 1; j <= cnt2; j++) 
	    if(!is_prime[abs(X[i] - Y[j])]) add(i, j + n); 
}
void shake(int n) {
    is_prime[1] = 1;
    for(int i = 2; i <= n; i++) {
	if(!is_prime[i]) prime[++cnt] = i;
	for(int j = 1; j <= cnt && i * prime[j] <= n; j++) {
	    is_prime[i * prime[j]] = 1;
	    if((i % prime[j]) == 0) break;
	}
    }
}
bool dfs(int x) {
    for(int i = 0; i < to[x].size(); i++) {
	int v = to[x][i];
	if(!vis1[v]) {
	    vis1[v] = 1;
	    if(vis2[v] == -1 || dfs(vis2[v])) {
		vis2[x] = v;
		vis2[v] = x;
		return true;
	    }
	}
    }
    return false;
}
int bi() {
    int ans = 0;
    memset(vis2, -1, sizeof(vis1));
    for(int i = 1; i <= cnt1; i++) {
	if(vis2[i] == -1) {
	    memset(vis1, 0, sizeof(vis1));
	    if(dfs(i)) ans++;
	}
    }
    return ans;
}
int solve() {
    shake(m + 1);
    build_graph();
    return bi(); 
}
int main() {
#ifdef orz
    freopen("input", "r", stdin);
#endif
    pre();
    int k = solve();
    printf("%d\n", k + 2 * ((cnt1-k) / 2 + (cnt2-k) / 2) + 3 * ((cnt1-k) % 2));
    return 0;
}


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

int main(void)
{
	int a, b, x=0, y=0, z=0;
	cin >> a >> b;
	
	x = a+b;
	y = a-b;
	z = a*b;
	
	if(x>y && x>z)
		cout << x << endl;
	else if(y>x && y>z)
		cout << y << endl;
	else if(z>x && z>y)
		cout << z << endl;
	else
		cout << x << endl;
		
		
}




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

//define
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1)cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1)cout<<#x<<":"<<x<<endl;
#define ll long long

//constant
const int MOD = 1000000009;

//typedef
typedef vector<int> vi;
typedef vector<vector<int>> vvi;


int main(){
	string s;
	cin >> s;
	int v = 0;
	REP(i, s.size())
		if (v == 0 && s[i] == 'C')
			v++;
		else if (v == 1 && s[i] == 'F')
			v++;
	if (v == 2)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static int MOD = 1000000007;
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int n = parseInt(sc.next());
		sc.close();
		double x = (double)n / 1.08;
		out.println(n==(int)((int)(x)*1.08)?(int)x:(n==(int)((int)(x+1)*1.08))?(int)(x+1):":(");
	}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 10;
int mark[N], nxt[N], x[N], a[N], n, m, ans[N];
long long k;
vector<int> tps;
void dfs(int v) {
	mark[v] = 1, tps.push_back(v);
	if (!mark[nxt[v]])
		dfs(nxt[v]);
}
int main() {
	ios_base::sync_with_stdio (false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n - 1; i++)
		x[i] = a[i + 1] - a[i];
	iota(nxt, nxt + n + 1, 0);
	cin >> m >> k;
	for (int i = 0; i < m; i++) {
		int y;
		cin >> y;
		y--;
		swap(nxt[y], nxt[y - 1]);
	}
	for (int i = 0; i < n; i++) {
		if (!mark[i]) {
			dfs(i);
			int fw = k % ((long long) tps.size());
			for (int i = 0; i < tps.size(); i++)
				ans[tps[i]] = x[tps[(i + fw) % tps.size()]];
			tps.clear();
		}
	}
	long long lst = a[0];
	cout << a[0] << "\n";
	for (int i = 0; i < n - 1; i++) {
		lst = lst + ans[i];
		cout << lst << "\n";
	}

	return 0;	
}


Measured memory_bytes: 10232
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int main(){
    string a, b;
    cin>>a>>b;
    int ans=(a[0]==b[0])+(a[1]==b[1])+(a[2]==b[2]);
    cout<<ans<<endl;
  return 0;
}




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

int main() {
	int n;cin >> n;
	vector<long> v(n);
	for (int  i = 0; i < n; ++i) cin >> v[i];
	while(v.size() > 1) {
		sort(v.begin(),v.end());
		auto vt = v;
		v.clear();
		v.push_back(vt[0]);
		for (int j = 1; j < vt.size(); ++j) {
			auto nvt = vt[j] % vt[0];
			if (nvt != 0) v.push_back(nvt);
		}
	}
	cout << v[0] << endl;
	return 0;
}

Measured memory_bytes: 1792
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]
def lcm(a, b):
	return a*b//fractions.gcd(a, b)
if n == 1:
	print(t[0])
else:
	ans = lcm(t[0], t[1])
	for i in range(2, n):
		ans = lcm(ans, t[i])
	print(ans)

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

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

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;


int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;

    if (N % 2 != 0)
    {
        cout << "No" << endl;
        return 0;
    }
    string res = "Yes";
    rep(i,N/2)
    {
        if (S[i] != S[i + N/2]) res = "No";
    }    
    
    cout << res << endl;
    return 0;
}

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

using namespace std;

int main()
{
    #ifdef lOCAL_EXEC
    #else
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #endif // lOCAL_EXEC
    string s,t;
    cin>>s>>t;
    long long int i,j,x,ans=0;
    for(i=0;i<s.size()-t.size()+1;i++){
        x=0;
       // cout<<i<<endl;
        for(j=i;j<i+t.size();j++){
           // cout<<j<<endl;
            if(s[j]==t[j-i])
                x+=1;
        }
        ans=max(ans,x);
    }
    cout<<t.size()-ans;
    return 0;
}


Measured memory_bytes: 3644
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import bisect
import sys
import logging
import heapq

#logging.basicConfig(level=logging.DEBUG)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	n,k = map(int,input().split())
	a = sorted(list(map(int,input().split())))
	f = sorted(list(map(int,input().split())),reverse=True)

	right = 10**12
	left = -1

	while right > left+1:
		mid = (right+left) // 2
		s = 0
		for i in range(n):
			if(a[i] * f[i] > mid):
				s += a[i] - mid//f[i]
		if(s > k):
			left = mid
		else:
			right  = mid
	print(right)

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n**0.5//1))+1):
		if temp%i==0:
			cnt=0
			while temp%i==0:
				cnt+=1
				temp //= i
			arr.append([i, cnt])

	if temp!=1:
		arr.append([temp, 1])

	if arr==[]:
		arr.append([n, 1])

	return arr

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

class PriorityQueue():
	def __init__(self):
		self.queue = []
	def push(self,i):
		heapq.heappush(self.queue,-i)
	def pop(self):
		return -1 * heapq.heappop(self.queue)
	def sum(self):
		return -sum(self.queue)

main()


Measured memory_bytes: 126668
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input!{
        a: i32,
        b: i32,
        c: i32,
    }
    println!("{} {} {}", c, a, b);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define test int t;cin>>t;while(t--)
#define REP(i,n) for (int i = 1; i <= n; i++)
#define MOD 1000000007
#define ll long long
#define ld long double
#define int ll
#define pb push_back
#define ii pair<int,int>
#define llll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<ii>
#define vllll vector<llll>
#define ff first
#define ss second
#define INF 1000000000
#define HINF 1000000000000000
#define mem(a,b) memset(a,b,sizeof(a))
#define arrin(x,n) int x[n]; for(int o=0;o<n;o++) cin>>x[o]
#define arrout(x,n) for(int o=0;o<n;o++) cout<<x[o]<<" "; cout<<endl
#define all(x) x.begin(),x.end()
#define deb(x) cout<<#x<<'='<<x<<endl
#define deb2(x,y) cout<<#x<<'='<<x<<" "<<#y<<'='<<y<<endl
#define deb3(x,y,z) cout<<#x<<'='<<x<<" "<<#y<<'='<<y<<" "<<#z<<'='<<z<<endl
#define debarr(arr,n) for(int o=0;o<n;o++) deb2(o,arr[o])
#define IO freopen("input.txt", "r", stdin); freopen("output.txt", "w+", stdout)
const double pi = 3.14159265358979323846;

ll power(ll a, ll b){//a^b
    ll res=1;
    //a=a%MOD;
    while(b>0){
        if(b&1)
		{res=(res*a);
		//res%=MOD;
		b--;}
        a=(a*a);
        //a%=MOD;
        b>>=1;
    }
    return res;
}
ll fermat_inv(ll y){return power(y,MOD-2);}
ll gcd(ll a, ll b){return (b==0)?a:gcd(b,a%b);}
int C(int n,int k)
{
	int ans=1;
	if(k>n-k)
	k=n-k;
	for(int i=1;i<=k;i++)
	ans*=(n-i+1),ans/=i;
	return ans;
}

int par[200001];

int find(int x)
{
    if(par[x]<0)
    return x;
    return x=find(par[x]);
}


void unions(int a,int b)
{
    a=find(a);
    b=find(b);
    
    if(a==b)
    return;
    
    if(par[a]<=par[b])
    {
        
        par[a]+=par[b];
        par[b]=a;
    }
    if(par[b]<par[a])
    {
        
        par[b]+=par[a];
        par[a]=b;
    }
}

void solve()
{

	int i=0,j=0,k=0,m,n,p,sum=0,cnt=0;
	cin>>n>>m;
	for(i=0;i<=n;i++)
	par[i]=-1;
	for(i=0;i<m;i++)
	{
	    cin>>j>>k;
	    unions(j,k);
	}
	
	for(i=1;i<=n;i++)
	if(par[i]<0)
	sum=min(sum,par[i]);
	cout<<abs(sum);
	
}
int32_t main() {
    fast
    //IO;
	//cout<<fixed<<setprecision(6);
    //test
    {
        
        solve();
		
		      
    }
    return 0;
}
  

Measured memory_bytes: 5176
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var s = cin.next();

            Console.WriteLine(700 + 100 * s.Count(c => c=='o'));
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 11220
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };

    let n = sc.read();
    let a: Vec<u64> = sc.vec(n);
    if a[0] != 0 {
        println!("-1");
        return;
    }
    for i in 1..n {
        if a[i] > a[i - 1] + 1 {
            println!("-1");
            return;
        }
    }

    let mut cur = 0;
    let mut ans = 0;
    for i in (1..n).rev() {
        if a[i] > cur {
            ans += a[i];
            cur = a[i];
        }
        if cur > 0 {
            cur -= 1;
        }
    }
    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 6396
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
using namespace std;

const int mod = 1000000007;

long long dp[101][4000];
int main() {
	int n, k;
	scanf("%d %d", &n, &k);
	long long ans = (n * (k * (k + 1) / 2)) % mod;
	for (int i = 0; i < n - 1; ++ i)
		(ans *= (k + 1)) %= mod;
	for (int i = 0; i < 4000; ++ i)
		dp[n][i] = 0;
	dp[n][0] = 1;
	for (int i = n; i > 0; -- i)
		for (int j = 0; j < 4000; ++ j)
			for (int a = 0; a <= k; ++ a)
				if (a <= i)
					(dp[i - 1][j + (a + j) / i] += dp[i][j]) %= mod;
				else
					(dp[i - 1][j] += dp[i][j]) %= mod;
	for (int j = 0; j < 4000; ++ j)
		ans = (ans + mod - j * dp[0][j] % mod) % mod;
	printf("%lld\n", ans);
	return 0;
}

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

using namespace std;

int main(){
    string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ";
    int N;
    string S;
    cin >> N >> S;

    for (int i = 0; i < S.size(); i++) {
        for (int j = 0; j < 52; j++) {
            if (S[i] == ABC[j]) {
                cout << ABC[j+N];
                break;
            }
        }
    }
    
    cout << endl;

    return(0);
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#define lli long long int
#define ll long long
#define mod 1000000007
#define pii pair<int,int>
#define mp make_pair
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;

int main(){
	int N, K;
	cin >> N >> K;
	if(K == 1){
		cout << 0;
		return 0;
	}
	
	cout << N-(K-1)-1;
	return 0;
}

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

namespace ABC126_A
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] info = Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToArray();
            int n = info[0];
            int k = info[1] - 1;

            char[] s = Console.ReadLine().ToCharArray();

            s[k] = Char.ToLower(s[k]);

            string result = string.Join("", s);
            Console.WriteLine(result);
            Console.ReadLine();

        }
    }
}

Measured memory_bytes: 11348
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
  int n;
  int a[100000];
  cin>>n;
  int ans=0;
  rep(i,n) cin>>a[i];
  sort(a,a+n);
  rep(i,n){
    if(a[i]==a[i+1] && i<n-1) a[i]=a[i+1]=0;
    if(a[i]!=0) ans++;
  }
  cout<<ans<<endl;
  return 0;
}






Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int K;
main()
{
	cin>>K;
	K--;
	int w;
	for(w=1;;w++)
	{
		vector<vector<long> >dp(w+1,vector<long>(10));
		dp[0][0]=1;
		for(int i=0;i<w;i++)
		{
			for(int j=0;j<10;j++)
			{
				if(i==0)
				{
					for(int k=1;k<10;k++)dp[i+1][k]+=dp[i][j];
				}
				else
				{
					if(j>0)dp[i+1][j-1]+=dp[i][j];
					dp[i+1][j]+=dp[i][j];
					if(j<9)dp[i+1][j+1]+=dp[i][j];
				}
			}
		}
		long sum=0;
		for(int k=0;k<10;k++)sum+=dp[w][k];
		if(K<sum)break;
		K-=sum;
	}
	string ans="";
	for(int l=1;l<10;l++)
	{
		vector<vector<long> >dp(w+1,vector<long>(10));
		dp[1][l]=1;
		for(int i=1;i<w;i++)
		{
			for(int j=0;j<10;j++)
			{
				if(j>0)dp[i+1][j-1]+=dp[i][j];
				dp[i+1][j]+=dp[i][j];
				if(j<9)dp[i+1][j+1]+=dp[i][j];
			}
		}
		long sum=0;
		for(int k=0;k<10;k++)sum+=dp[w][k];
		if(K<sum)
		{
			ans+=l+'0';
			break;
		}
		K-=sum;
	}
	for(int I=2;I<=w;I++)
	{
		for(int l=-1;l<=1;l++)
		{
			int d=ans[I-2]-'0';
			d+=l;
			if(d<0||d>9)continue;
			vector<vector<long> >dp(w+1,vector<long>(10));
			dp[I][d]=1;
			for(int i=I;i<w;i++)
			{
				for(int j=0;j<10;j++)
				{
					if(j>0)dp[i+1][j-1]+=dp[i][j];
					dp[i+1][j]+=dp[i][j];
					if(j<9)dp[i+1][j+1]+=dp[i][j];
				}
			}
			long sum=0;
			for(int k=0;k<10;k++)sum+=dp[w][k];
			if(K<sum)
			{
				ans+=d+'0';
				break;
			}
			K-=sum;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
int main()
{
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;

  int xy = 0, zw = 0;
  double max = 0;
  for (int x = 0; 100 * a * x <= f; x++)
  {
    for (int y = 0; 100 * (a * x + b * y) <= f; y++)
    {
      for (int z = 0; 100 * (a * x + b * y) + c * z <= f; z++)
      {
        for (int w = 0; 100 * (a * x + b * y) + c * z + d * w <= f; w++)
        {
          if (x == 0 && y == 0)
          {
            continue;
          }
          double n = (double)(c * z + d * w) / (a * x + b * y);
          if (n > max && (c * z + d * w <= e * (a * x + b * y)))
          {
            max = n;
            xy = a * x + b * y;
            zw = c * z + d * w;
          }
        }
      }
    }
  }
  if (xy == 0)
  {
    xy = a;
    zw = 0;
  }
  cout << 100 * xy + zw << " " << zw << endl;

  return 0;
}

Measured memory_bytes: 256